Skip to content

Commit

Permalink
qlcnic: Disable DCB operations from SR-IOV VFs.
Browse files Browse the repository at this point in the history
o These operations will be supported only through PFs (SR-IOV and non-SR-IOV).

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sucheta Chakraborty authored and David S. Miller committed Dec 17, 2013
1 parent baf9573 commit 3c44bba
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
6 changes: 0 additions & 6 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,6 @@ static void qlcnic_83xx_init_rings(struct qlcnic_adapter *adapter)
int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
struct qlcnic_dcb *dcb;
int err = 0;

ahw->msix_supported = !!qlcnic_use_msi_x;
Expand Down Expand Up @@ -2264,11 +2263,6 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)
if (err)
goto disable_mbx_intr;

dcb = adapter->dcb;

if (dcb && qlcnic_dcb_attach(dcb))
qlcnic_clear_dcb_ops(dcb);

/* Periodically monitor device status */
qlcnic_83xx_idc_poll_dev_state(&adapter->fw_work.work);
return 0;
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ int qlcnic_register_dcb(struct qlcnic_adapter *adapter)
{
struct qlcnic_dcb *dcb;

if (qlcnic_sriov_vf_check(adapter))
return 0;

dcb = kzalloc(sizeof(struct qlcnic_dcb), GFP_ATOMIC);
if (!dcb)
return -ENOMEM;
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,10 @@ static inline void qlcnic_dcb_init_dcbnl_ops(struct qlcnic_dcb *dcb)
if (dcb && dcb->ops->init_dcbnl_ops)
dcb->ops->init_dcbnl_ops(dcb);
}

static inline void qlcnic_dcb_enable(struct qlcnic_dcb *dcb)
{
if (dcb && qlcnic_dcb_attach(dcb))
qlcnic_clear_dcb_ops(dcb);
}
#endif
7 changes: 2 additions & 5 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,6 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct qlcnic_hardware_context *ahw;
int err, pci_using_dac = -1;
char board_name[QLCNIC_MAX_BOARD_NAME_LEN + 19]; /* MAC + ": " + name */
struct qlcnic_dcb *dcb;

if (pdev->is_virtfn)
return -ENODEV;
Expand Down Expand Up @@ -2335,10 +2334,6 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

adapter->flags |= QLCNIC_NEED_FLR;

dcb = adapter->dcb;

if (dcb && qlcnic_dcb_attach(dcb))
qlcnic_clear_dcb_ops(dcb);
} else if (qlcnic_83xx_check(adapter)) {
qlcnic_83xx_check_vf(adapter, ent);
adapter->portnum = adapter->ahw->pci_func;
Expand Down Expand Up @@ -2367,6 +2362,8 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_free_hw;
}

qlcnic_dcb_enable(adapter->dcb);

if (qlcnic_read_mac_addr(adapter))
dev_warn(&pdev->dev, "failed to read mac addr\n");

Expand Down
8 changes: 0 additions & 8 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ static int qlcnic_sriov_vf_init_driver(struct qlcnic_adapter *adapter)
static int qlcnic_sriov_setup_vf(struct qlcnic_adapter *adapter,
int pci_using_dac)
{
struct qlcnic_dcb *dcb;
int err;

INIT_LIST_HEAD(&adapter->vf_mc_list);
Expand Down Expand Up @@ -538,11 +537,6 @@ static int qlcnic_sriov_setup_vf(struct qlcnic_adapter *adapter,
if (err)
goto err_out_send_channel_term;

dcb = adapter->dcb;

if (dcb && qlcnic_dcb_attach(dcb))
qlcnic_clear_dcb_ops(dcb);

err = qlcnic_setup_netdev(adapter, adapter->netdev, pci_using_dac);
if (err)
goto err_out_send_channel_term;
Expand Down Expand Up @@ -1584,8 +1578,6 @@ static int qlcnic_sriov_vf_reinit_driver(struct qlcnic_adapter *adapter)
if (err)
goto err_out_term_channel;

qlcnic_dcb_get_info(adapter->dcb);

return 0;

err_out_term_channel:
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,8 +1299,6 @@ static const int qlcnic_pf_passthru_supp_cmds[] = {
QLCNIC_CMD_GET_STATISTICS,
QLCNIC_CMD_GET_PORT_CONFIG,
QLCNIC_CMD_GET_LINK_STATUS,
QLCNIC_CMD_DCB_QUERY_CAP,
QLCNIC_CMD_DCB_QUERY_PARAM,
QLCNIC_CMD_INIT_NIC_FUNC,
QLCNIC_CMD_STOP_NIC_FUNC,
};
Expand Down

0 comments on commit 3c44bba

Please sign in to comment.