diff options
author | Michael Chan <mchan@broadcom.com> | 2014-06-03 02:08:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-03 02:16:41 -0400 |
commit | 5943691442ae248977a2e3cac814ed5ac606903c (patch) | |
tree | 9f6b56c5dd8b707327864ecfdaf667cc4db29acb /drivers/net/ethernet/broadcom | |
parent | 437b8a26f9d057505e631b9b556e9d80c1987aca (diff) |
cnic: Fix missing ISCSI_KEVENT_IF_DOWN message
The iSCSI netlink message needs to be sent before the ulp_ops is cleared
as it is sent through a function pointer in the ulp_ops. This bug
causes iscsid to not get the message when the bnx2i driver is unloaded.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 8da1060f03f0..a4b25bc7113a 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -608,6 +608,10 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) | |||
608 | pr_err("%s: Bad type %d\n", __func__, ulp_type); | 608 | pr_err("%s: Bad type %d\n", __func__, ulp_type); |
609 | return -EINVAL; | 609 | return -EINVAL; |
610 | } | 610 | } |
611 | |||
612 | if (ulp_type == CNIC_ULP_ISCSI) | ||
613 | cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | ||
614 | |||
611 | mutex_lock(&cnic_lock); | 615 | mutex_lock(&cnic_lock); |
612 | if (rcu_dereference(cp->ulp_ops[ulp_type])) { | 616 | if (rcu_dereference(cp->ulp_ops[ulp_type])) { |
613 | RCU_INIT_POINTER(cp->ulp_ops[ulp_type], NULL); | 617 | RCU_INIT_POINTER(cp->ulp_ops[ulp_type], NULL); |
@@ -620,9 +624,7 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) | |||
620 | } | 624 | } |
621 | mutex_unlock(&cnic_lock); | 625 | mutex_unlock(&cnic_lock); |
622 | 626 | ||
623 | if (ulp_type == CNIC_ULP_ISCSI) | 627 | if (ulp_type == CNIC_ULP_FCOE) |
624 | cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | ||
625 | else if (ulp_type == CNIC_ULP_FCOE) | ||
626 | dev->fcoe_cap = NULL; | 628 | dev->fcoe_cap = NULL; |
627 | 629 | ||
628 | synchronize_rcu(); | 630 | synchronize_rcu(); |