qlcnic: Disable DCB operations from SR-IOV VFs.
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Tue, 17 Dec 2013 14:01:49 +0000 (09:01 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Dec 2013 22:09:43 +0000 (17:09 -0500)
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>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c

index 89208e5..8eb1288 100644 (file)
@@ -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;
@@ -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;
index 86bca7c..c233084 100644 (file)
@@ -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;
index c04ae0c..6b6144d 100644 (file)
@@ -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
index 05c1eef..083941c 100644 (file)
@@ -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;
@@ -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;
@@ -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");
 
index 21a4b27..af5a108 100644 (file)
@@ -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);
@@ -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;
@@ -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:
index 686f460..b679309 100644 (file)
@@ -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,
 };