aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x
diff options
context:
space:
mode:
authorDmitry Kravkov <dmitry@broadcom.com>2011-03-31 20:04:22 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-31 20:04:22 -0400
commitfab0dc89f0d98459c6ce7fa27422949ac15837fa (patch)
treecd7d169e81ff9028d746f2540302d677b17f30cf /drivers/net/bnx2x
parent3b7f817e47bb66ae4d82ed73689a521af70a5410 (diff)
bnx2x, cnic: Disable iSCSI if DCBX negotiation is successful
With current bnx2x firmware 6.2.9, iSCSI is not supported in DCB network, so we need to disable it. Add cnic command to disconnect iSCSI connections and prevent future connections when DCBX negotiation succeeds. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x')
-rw-r--r--drivers/net/bnx2x/bnx2x_dcb.c22
-rw-r--r--drivers/net/bnx2x/bnx2x_dcb.h8
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c5
3 files changed, 33 insertions, 2 deletions
diff --git a/drivers/net/bnx2x/bnx2x_dcb.c b/drivers/net/bnx2x/bnx2x_dcb.c
index 9a24d79c71d9..1214907d00d9 100644
--- a/drivers/net/bnx2x/bnx2x_dcb.c
+++ b/drivers/net/bnx2x/bnx2x_dcb.c
@@ -571,6 +571,28 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
571{ 571{
572 switch (state) { 572 switch (state) {
573 case BNX2X_DCBX_STATE_NEG_RECEIVED: 573 case BNX2X_DCBX_STATE_NEG_RECEIVED:
574#ifdef BCM_CNIC
575 if (bp->state != BNX2X_STATE_OPENING_WAIT4_LOAD) {
576 struct cnic_ops *c_ops;
577 struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
578 bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
579 cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI_OOO;
580 cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI;
581
582 rcu_read_lock();
583 c_ops = rcu_dereference(bp->cnic_ops);
584 if (c_ops) {
585 bnx2x_cnic_notify(bp, CNIC_CTL_STOP_ISCSI_CMD);
586 rcu_read_unlock();
587 return;
588 }
589 rcu_read_unlock();
590 }
591
592 /* fall through if no CNIC initialized */
593 case BNX2X_DCBX_STATE_ISCSI_STOPPED:
594#endif
595
574 { 596 {
575 DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_NEG_RECEIVED\n"); 597 DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_NEG_RECEIVED\n");
576#ifdef BCM_DCBNL 598#ifdef BCM_DCBNL
diff --git a/drivers/net/bnx2x/bnx2x_dcb.h b/drivers/net/bnx2x/bnx2x_dcb.h
index 71b8eda43bd0..1e14775a18cb 100644
--- a/drivers/net/bnx2x/bnx2x_dcb.h
+++ b/drivers/net/bnx2x/bnx2x_dcb.h
@@ -183,9 +183,13 @@ void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled);
183 183
184enum { 184enum {
185 BNX2X_DCBX_STATE_NEG_RECEIVED = 0x1, 185 BNX2X_DCBX_STATE_NEG_RECEIVED = 0x1,
186 BNX2X_DCBX_STATE_TX_PAUSED = 0x2, 186#ifdef BCM_CNIC
187 BNX2X_DCBX_STATE_TX_RELEASED = 0x4 187 BNX2X_DCBX_STATE_ISCSI_STOPPED,
188#endif
189 BNX2X_DCBX_STATE_TX_PAUSED,
190 BNX2X_DCBX_STATE_TX_RELEASED
188}; 191};
192
189void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state); 193void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state);
190 194
191/* DCB netlink */ 195/* DCB netlink */
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 32e64cc85d2c..f3cf88918a9e 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -10342,6 +10342,11 @@ static int bnx2x_drv_ctl(struct net_device *dev, struct drv_ctl_info *ctl)
10342 break; 10342 break;
10343 } 10343 }
10344 10344
10345 case DRV_CTL_ISCSI_STOPPED_CMD: {
10346 bnx2x_dcbx_set_params(bp, BNX2X_DCBX_STATE_ISCSI_STOPPED);
10347 break;
10348 }
10349
10345 default: 10350 default:
10346 BNX2X_ERR("unknown command %x\n", ctl->cmd); 10351 BNX2X_ERR("unknown command %x\n", ctl->cmd);
10347 rc = -EINVAL; 10352 rc = -EINVAL;