aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>2013-12-17 09:01:49 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-17 17:09:43 -0500
commit3c44bba1d270cb1620b4fe76786d0968118cb86b (patch)
tree961c3d97473ec018d09c178f3c0f928e47b22ff8
parentbaf9573e6794a979ba1b9bb8a1221c56ceb1bc79 (diff)
qlcnic: Disable DCB operations from SR-IOV VFs.
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>
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c6
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c3
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h6
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c7
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c8
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c2
6 files changed, 11 insertions, 21 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
index 89208e5b25d6..8eb1288ca254 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
@@ -2198,7 +2198,6 @@ static void qlcnic_83xx_init_rings(struct qlcnic_adapter *adapter)
2198int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac) 2198int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)
2199{ 2199{
2200 struct qlcnic_hardware_context *ahw = adapter->ahw; 2200 struct qlcnic_hardware_context *ahw = adapter->ahw;
2201 struct qlcnic_dcb *dcb;
2202 int err = 0; 2201 int err = 0;
2203 2202
2204 ahw->msix_supported = !!qlcnic_use_msi_x; 2203 ahw->msix_supported = !!qlcnic_use_msi_x;
@@ -2264,11 +2263,6 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)
2264 if (err) 2263 if (err)
2265 goto disable_mbx_intr; 2264 goto disable_mbx_intr;
2266 2265
2267 dcb = adapter->dcb;
2268
2269 if (dcb && qlcnic_dcb_attach(dcb))
2270 qlcnic_clear_dcb_ops(dcb);
2271
2272 /* Periodically monitor device status */ 2266 /* Periodically monitor device status */
2273 qlcnic_83xx_idc_poll_dev_state(&adapter->fw_work.work); 2267 qlcnic_83xx_idc_poll_dev_state(&adapter->fw_work.work);
2274 return 0; 2268 return 0;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
index 86bca7c14f99..c23308483cee 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
@@ -260,6 +260,9 @@ int qlcnic_register_dcb(struct qlcnic_adapter *adapter)
260{ 260{
261 struct qlcnic_dcb *dcb; 261 struct qlcnic_dcb *dcb;
262 262
263 if (qlcnic_sriov_vf_check(adapter))
264 return 0;
265
263 dcb = kzalloc(sizeof(struct qlcnic_dcb), GFP_ATOMIC); 266 dcb = kzalloc(sizeof(struct qlcnic_dcb), GFP_ATOMIC);
264 if (!dcb) 267 if (!dcb)
265 return -ENOMEM; 268 return -ENOMEM;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
index c04ae0cdc108..6b6144def503 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
@@ -121,4 +121,10 @@ static inline void qlcnic_dcb_init_dcbnl_ops(struct qlcnic_dcb *dcb)
121 if (dcb && dcb->ops->init_dcbnl_ops) 121 if (dcb && dcb->ops->init_dcbnl_ops)
122 dcb->ops->init_dcbnl_ops(dcb); 122 dcb->ops->init_dcbnl_ops(dcb);
123} 123}
124
125static inline void qlcnic_dcb_enable(struct qlcnic_dcb *dcb)
126{
127 if (dcb && qlcnic_dcb_attach(dcb))
128 qlcnic_clear_dcb_ops(dcb);
129}
124#endif 130#endif
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 05c1eef8df13..083941c14158 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2212,7 +2212,6 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2212 struct qlcnic_hardware_context *ahw; 2212 struct qlcnic_hardware_context *ahw;
2213 int err, pci_using_dac = -1; 2213 int err, pci_using_dac = -1;
2214 char board_name[QLCNIC_MAX_BOARD_NAME_LEN + 19]; /* MAC + ": " + name */ 2214 char board_name[QLCNIC_MAX_BOARD_NAME_LEN + 19]; /* MAC + ": " + name */
2215 struct qlcnic_dcb *dcb;
2216 2215
2217 if (pdev->is_virtfn) 2216 if (pdev->is_virtfn)
2218 return -ENODEV; 2217 return -ENODEV;
@@ -2335,10 +2334,6 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2335 2334
2336 adapter->flags |= QLCNIC_NEED_FLR; 2335 adapter->flags |= QLCNIC_NEED_FLR;
2337 2336
2338 dcb = adapter->dcb;
2339
2340 if (dcb && qlcnic_dcb_attach(dcb))
2341 qlcnic_clear_dcb_ops(dcb);
2342 } else if (qlcnic_83xx_check(adapter)) { 2337 } else if (qlcnic_83xx_check(adapter)) {
2343 qlcnic_83xx_check_vf(adapter, ent); 2338 qlcnic_83xx_check_vf(adapter, ent);
2344 adapter->portnum = adapter->ahw->pci_func; 2339 adapter->portnum = adapter->ahw->pci_func;
@@ -2367,6 +2362,8 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2367 goto err_out_free_hw; 2362 goto err_out_free_hw;
2368 } 2363 }
2369 2364
2365 qlcnic_dcb_enable(adapter->dcb);
2366
2370 if (qlcnic_read_mac_addr(adapter)) 2367 if (qlcnic_read_mac_addr(adapter))
2371 dev_warn(&pdev->dev, "failed to read mac addr\n"); 2368 dev_warn(&pdev->dev, "failed to read mac addr\n");
2372 2369
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
index 21a4b274d2e4..af5a108d9097 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
@@ -500,7 +500,6 @@ static int qlcnic_sriov_vf_init_driver(struct qlcnic_adapter *adapter)
500static int qlcnic_sriov_setup_vf(struct qlcnic_adapter *adapter, 500static int qlcnic_sriov_setup_vf(struct qlcnic_adapter *adapter,
501 int pci_using_dac) 501 int pci_using_dac)
502{ 502{
503 struct qlcnic_dcb *dcb;
504 int err; 503 int err;
505 504
506 INIT_LIST_HEAD(&adapter->vf_mc_list); 505 INIT_LIST_HEAD(&adapter->vf_mc_list);
@@ -538,11 +537,6 @@ static int qlcnic_sriov_setup_vf(struct qlcnic_adapter *adapter,
538 if (err) 537 if (err)
539 goto err_out_send_channel_term; 538 goto err_out_send_channel_term;
540 539
541 dcb = adapter->dcb;
542
543 if (dcb && qlcnic_dcb_attach(dcb))
544 qlcnic_clear_dcb_ops(dcb);
545
546 err = qlcnic_setup_netdev(adapter, adapter->netdev, pci_using_dac); 540 err = qlcnic_setup_netdev(adapter, adapter->netdev, pci_using_dac);
547 if (err) 541 if (err)
548 goto err_out_send_channel_term; 542 goto err_out_send_channel_term;
@@ -1584,8 +1578,6 @@ static int qlcnic_sriov_vf_reinit_driver(struct qlcnic_adapter *adapter)
1584 if (err) 1578 if (err)
1585 goto err_out_term_channel; 1579 goto err_out_term_channel;
1586 1580
1587 qlcnic_dcb_get_info(adapter->dcb);
1588
1589 return 0; 1581 return 0;
1590 1582
1591err_out_term_channel: 1583err_out_term_channel:
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
index 686f460b1502..b679309147bb 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
@@ -1299,8 +1299,6 @@ static const int qlcnic_pf_passthru_supp_cmds[] = {
1299 QLCNIC_CMD_GET_STATISTICS, 1299 QLCNIC_CMD_GET_STATISTICS,
1300 QLCNIC_CMD_GET_PORT_CONFIG, 1300 QLCNIC_CMD_GET_PORT_CONFIG,
1301 QLCNIC_CMD_GET_LINK_STATUS, 1301 QLCNIC_CMD_GET_LINK_STATUS,
1302 QLCNIC_CMD_DCB_QUERY_CAP,
1303 QLCNIC_CMD_DCB_QUERY_PARAM,
1304 QLCNIC_CMD_INIT_NIC_FUNC, 1302 QLCNIC_CMD_INIT_NIC_FUNC,
1305 QLCNIC_CMD_STOP_NIC_FUNC, 1303 QLCNIC_CMD_STOP_NIC_FUNC,
1306}; 1304};