aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHariprasad Shenai <hariprasad@chelsio.com>2016-05-05 01:35:39 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-07 15:12:54 -0400
commit218d48e701f08a71df57c410e596e30b3285bd25 (patch)
tree1ba722feabd11873d7dc63e4a41a3647b73345af
parent5113bfdbc63845402eec7f419204d22283c9cd4c (diff)
cxgb4: Reset dcb state machine and tx queue prio only if dcb is enabled
When cxgb4 is enabled with CONFIG_CHELSIO_T4_DCB set, VI enable command gets called with DCB enabled. But when we have a back to back setup with DCB enabled on one side and non-DCB on the Peer side. Firmware doesn't send any DCB_L2_CFG, and DCB priority is never set for Tx queue. But driver resets the queue priority and state machine whenever there is a link down, this patch fixes it by adding a check to reset only if cxgb4_dcb_enabled() returns true. Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index d7f40436f319..477db477b133 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -304,6 +304,22 @@ static void dcb_tx_queue_prio_enable(struct net_device *dev, int enable)
304} 304}
305#endif /* CONFIG_CHELSIO_T4_DCB */ 305#endif /* CONFIG_CHELSIO_T4_DCB */
306 306
307int cxgb4_dcb_enabled(const struct net_device *dev)
308{
309#ifdef CONFIG_CHELSIO_T4_DCB
310 struct port_info *pi = netdev_priv(dev);
311
312 if (!pi->dcb.enabled)
313 return 0;
314
315 return ((pi->dcb.state == CXGB4_DCB_STATE_FW_ALLSYNCED) ||
316 (pi->dcb.state == CXGB4_DCB_STATE_HOST));
317#else
318 return 0;
319#endif
320}
321EXPORT_SYMBOL(cxgb4_dcb_enabled);
322
307void t4_os_link_changed(struct adapter *adapter, int port_id, int link_stat) 323void t4_os_link_changed(struct adapter *adapter, int port_id, int link_stat)
308{ 324{
309 struct net_device *dev = adapter->port[port_id]; 325 struct net_device *dev = adapter->port[port_id];
@@ -314,8 +330,10 @@ void t4_os_link_changed(struct adapter *adapter, int port_id, int link_stat)
314 netif_carrier_on(dev); 330 netif_carrier_on(dev);
315 else { 331 else {
316#ifdef CONFIG_CHELSIO_T4_DCB 332#ifdef CONFIG_CHELSIO_T4_DCB
317 cxgb4_dcb_state_init(dev); 333 if (cxgb4_dcb_enabled(dev)) {
318 dcb_tx_queue_prio_enable(dev, false); 334 cxgb4_dcb_state_init(dev);
335 dcb_tx_queue_prio_enable(dev, false);
336 }
319#endif /* CONFIG_CHELSIO_T4_DCB */ 337#endif /* CONFIG_CHELSIO_T4_DCB */
320 netif_carrier_off(dev); 338 netif_carrier_off(dev);
321 } 339 }
@@ -494,22 +512,6 @@ static int link_start(struct net_device *dev)
494 return ret; 512 return ret;
495} 513}
496 514
497int cxgb4_dcb_enabled(const struct net_device *dev)
498{
499#ifdef CONFIG_CHELSIO_T4_DCB
500 struct port_info *pi = netdev_priv(dev);
501
502 if (!pi->dcb.enabled)
503 return 0;
504
505 return ((pi->dcb.state == CXGB4_DCB_STATE_FW_ALLSYNCED) ||
506 (pi->dcb.state == CXGB4_DCB_STATE_HOST));
507#else
508 return 0;
509#endif
510}
511EXPORT_SYMBOL(cxgb4_dcb_enabled);
512
513#ifdef CONFIG_CHELSIO_T4_DCB 515#ifdef CONFIG_CHELSIO_T4_DCB
514/* Handle a Data Center Bridging update message from the firmware. */ 516/* Handle a Data Center Bridging update message from the firmware. */
515static void dcb_rpl(struct adapter *adap, const struct fw_port_cmd *pcmd) 517static void dcb_rpl(struct adapter *adap, const struct fw_port_cmd *pcmd)