diff options
author | Michael Chan <mchan@broadcom.com> | 2011-07-20 10:55:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-21 15:38:32 -0400 |
commit | 415199f2bd977fa4065d4e836b4b7543f7993bc3 (patch) | |
tree | 2dfb4dfcc7097fcdd02d7923e6fdecebc4af0985 /drivers | |
parent | 74e49bbdabbac34c77b280152b1de9bef9bf9be7 (diff) |
cnic: Add VLAN ID as a parameter during netevent upcall
The bnx2fc driver needs to handle netdev events on VLAN devices.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/cnic.c | 50 | ||||
-rw-r--r-- | drivers/net/cnic_if.h | 6 | ||||
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 8 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 8 |
4 files changed, 52 insertions, 20 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 9be0c261b8b0..94a2e541006d 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -5334,6 +5334,27 @@ static struct cnic_dev *is_cnic_dev(struct net_device *dev) | |||
5334 | return cdev; | 5334 | return cdev; |
5335 | } | 5335 | } |
5336 | 5336 | ||
5337 | static void cnic_rcv_netevent(struct cnic_local *cp, unsigned long event, | ||
5338 | u16 vlan_id) | ||
5339 | { | ||
5340 | int if_type; | ||
5341 | |||
5342 | rcu_read_lock(); | ||
5343 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { | ||
5344 | struct cnic_ulp_ops *ulp_ops; | ||
5345 | void *ctx; | ||
5346 | |||
5347 | ulp_ops = rcu_dereference(cp->ulp_ops[if_type]); | ||
5348 | if (!ulp_ops || !ulp_ops->indicate_netevent) | ||
5349 | continue; | ||
5350 | |||
5351 | ctx = cp->ulp_handle[if_type]; | ||
5352 | |||
5353 | ulp_ops->indicate_netevent(ctx, event, vlan_id); | ||
5354 | } | ||
5355 | rcu_read_unlock(); | ||
5356 | } | ||
5357 | |||
5337 | /** | 5358 | /** |
5338 | * netdev event handler | 5359 | * netdev event handler |
5339 | */ | 5360 | */ |
@@ -5342,7 +5363,6 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, | |||
5342 | { | 5363 | { |
5343 | struct net_device *netdev = ptr; | 5364 | struct net_device *netdev = ptr; |
5344 | struct cnic_dev *dev; | 5365 | struct cnic_dev *dev; |
5345 | int if_type; | ||
5346 | int new_dev = 0; | 5366 | int new_dev = 0; |
5347 | 5367 | ||
5348 | dev = cnic_from_netdev(netdev); | 5368 | dev = cnic_from_netdev(netdev); |
@@ -5372,20 +5392,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, | |||
5372 | cnic_ulp_start(dev); | 5392 | cnic_ulp_start(dev); |
5373 | } | 5393 | } |
5374 | 5394 | ||
5375 | rcu_read_lock(); | 5395 | cnic_rcv_netevent(cp, event, 0); |
5376 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { | ||
5377 | struct cnic_ulp_ops *ulp_ops; | ||
5378 | void *ctx; | ||
5379 | |||
5380 | ulp_ops = rcu_dereference(cp->ulp_ops[if_type]); | ||
5381 | if (!ulp_ops || !ulp_ops->indicate_netevent) | ||
5382 | continue; | ||
5383 | |||
5384 | ctx = cp->ulp_handle[if_type]; | ||
5385 | |||
5386 | ulp_ops->indicate_netevent(ctx, event); | ||
5387 | } | ||
5388 | rcu_read_unlock(); | ||
5389 | 5396 | ||
5390 | if (event == NETDEV_GOING_DOWN) { | 5397 | if (event == NETDEV_GOING_DOWN) { |
5391 | cnic_ulp_stop(dev); | 5398 | cnic_ulp_stop(dev); |
@@ -5401,6 +5408,19 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, | |||
5401 | goto done; | 5408 | goto done; |
5402 | } | 5409 | } |
5403 | cnic_put(dev); | 5410 | cnic_put(dev); |
5411 | } else { | ||
5412 | struct net_device *realdev; | ||
5413 | u16 vid; | ||
5414 | |||
5415 | vid = cnic_get_vlan(netdev, &realdev); | ||
5416 | if (realdev) { | ||
5417 | dev = cnic_from_netdev(realdev); | ||
5418 | if (dev) { | ||
5419 | vid |= VLAN_TAG_PRESENT; | ||
5420 | cnic_rcv_netevent(dev->cnic_priv, event, vid); | ||
5421 | cnic_put(dev); | ||
5422 | } | ||
5423 | } | ||
5404 | } | 5424 | } |
5405 | done: | 5425 | done: |
5406 | return NOTIFY_DONE; | 5426 | return NOTIFY_DONE; |
diff --git a/drivers/net/cnic_if.h b/drivers/net/cnic_if.h index 8a1ffbe123bb..79443e0dbf96 100644 --- a/drivers/net/cnic_if.h +++ b/drivers/net/cnic_if.h | |||
@@ -12,8 +12,8 @@ | |||
12 | #ifndef CNIC_IF_H | 12 | #ifndef CNIC_IF_H |
13 | #define CNIC_IF_H | 13 | #define CNIC_IF_H |
14 | 14 | ||
15 | #define CNIC_MODULE_VERSION "2.5.6" | 15 | #define CNIC_MODULE_VERSION "2.5.7" |
16 | #define CNIC_MODULE_RELDATE "July 12, 2011" | 16 | #define CNIC_MODULE_RELDATE "July 20, 2011" |
17 | 17 | ||
18 | #define CNIC_ULP_RDMA 0 | 18 | #define CNIC_ULP_RDMA 0 |
19 | #define CNIC_ULP_ISCSI 1 | 19 | #define CNIC_ULP_ISCSI 1 |
@@ -318,7 +318,7 @@ struct cnic_ulp_ops { | |||
318 | void (*cnic_stop)(void *ulp_ctx); | 318 | void (*cnic_stop)(void *ulp_ctx); |
319 | void (*indicate_kcqes)(void *ulp_ctx, struct kcqe *cqes[], | 319 | void (*indicate_kcqes)(void *ulp_ctx, struct kcqe *cqes[], |
320 | u32 num_cqes); | 320 | u32 num_cqes); |
321 | void (*indicate_netevent)(void *ulp_ctx, unsigned long event); | 321 | void (*indicate_netevent)(void *ulp_ctx, unsigned long event, u16 vid); |
322 | void (*cm_connect_complete)(struct cnic_sock *); | 322 | void (*cm_connect_complete)(struct cnic_sock *); |
323 | void (*cm_close_complete)(struct cnic_sock *); | 323 | void (*cm_close_complete)(struct cnic_sock *); |
324 | void (*cm_abort_complete)(struct cnic_sock *); | 324 | void (*cm_abort_complete)(struct cnic_sock *); |
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 7a16ca1c3ecf..9eebaebdaa78 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -767,17 +767,23 @@ static void bnx2fc_destroy_timer(unsigned long data) | |||
767 | * | 767 | * |
768 | * @context: adapter structure pointer | 768 | * @context: adapter structure pointer |
769 | * @event: event type | 769 | * @event: event type |
770 | * @vlan_id: vlan id - associated vlan id with this event | ||
770 | * | 771 | * |
771 | * Handles NETDEV_UP, NETDEV_DOWN, NETDEV_GOING_DOWN,NETDEV_CHANGE and | 772 | * Handles NETDEV_UP, NETDEV_DOWN, NETDEV_GOING_DOWN,NETDEV_CHANGE and |
772 | * NETDEV_CHANGE_MTU events | 773 | * NETDEV_CHANGE_MTU events |
773 | */ | 774 | */ |
774 | static void bnx2fc_indicate_netevent(void *context, unsigned long event) | 775 | static void bnx2fc_indicate_netevent(void *context, unsigned long event, |
776 | u16 vlan_id) | ||
775 | { | 777 | { |
776 | struct bnx2fc_hba *hba = (struct bnx2fc_hba *)context; | 778 | struct bnx2fc_hba *hba = (struct bnx2fc_hba *)context; |
777 | struct fc_lport *lport = hba->ctlr.lp; | 779 | struct fc_lport *lport = hba->ctlr.lp; |
778 | struct fc_lport *vport; | 780 | struct fc_lport *vport; |
779 | u32 link_possible = 1; | 781 | u32 link_possible = 1; |
780 | 782 | ||
783 | /* Ignore vlans for now */ | ||
784 | if (vlan_id != 0) | ||
785 | return; | ||
786 | |||
781 | if (!test_bit(BNX2FC_CREATE_DONE, &hba->init_done)) { | 787 | if (!test_bit(BNX2FC_CREATE_DONE, &hba->init_done)) { |
782 | BNX2FC_MISC_DBG("driver not ready. event=%s %ld\n", | 788 | BNX2FC_MISC_DBG("driver not ready. event=%s %ld\n", |
783 | hba->netdev->name, event); | 789 | hba->netdev->name, event); |
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 5c54a2d9b834..372d30c099cc 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -2386,14 +2386,20 @@ static void bnx2i_indicate_kcqe(void *context, struct kcqe *kcqe[], | |||
2386 | * bnx2i_indicate_netevent - Generic netdev event handler | 2386 | * bnx2i_indicate_netevent - Generic netdev event handler |
2387 | * @context: adapter structure pointer | 2387 | * @context: adapter structure pointer |
2388 | * @event: event type | 2388 | * @event: event type |
2389 | * @vlan_id: vlans id - associated vlan id with this event | ||
2389 | * | 2390 | * |
2390 | * Handles four netdev events, NETDEV_UP, NETDEV_DOWN, | 2391 | * Handles four netdev events, NETDEV_UP, NETDEV_DOWN, |
2391 | * NETDEV_GOING_DOWN and NETDEV_CHANGE | 2392 | * NETDEV_GOING_DOWN and NETDEV_CHANGE |
2392 | */ | 2393 | */ |
2393 | static void bnx2i_indicate_netevent(void *context, unsigned long event) | 2394 | static void bnx2i_indicate_netevent(void *context, unsigned long event, |
2395 | u16 vlan_id) | ||
2394 | { | 2396 | { |
2395 | struct bnx2i_hba *hba = context; | 2397 | struct bnx2i_hba *hba = context; |
2396 | 2398 | ||
2399 | /* Ignore all netevent coming from vlans */ | ||
2400 | if (vlan_id != 0) | ||
2401 | return; | ||
2402 | |||
2397 | switch (event) { | 2403 | switch (event) { |
2398 | case NETDEV_UP: | 2404 | case NETDEV_UP: |
2399 | if (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state)) | 2405 | if (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state)) |