summaryrefslogtreecommitdiffstats
path: root/drivers/net/cnic.c
Commit message (Collapse)AuthorAgeFilesLines
...
* cnic: Simplify route checking during iSCSI connection.Michael Chan2010-02-261-24/+13
| | | | | | | | | | | With a separate IP address for iSCSI, connections should proceed whether or not we can get a route to the target from the network stack. It is possible that the network IP address may not reach the iSCSI target. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Eddie Wai <waie@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix panic in cnic_iscsi_nl_msg_recv() when device is down.Michael Chan2010-02-261-0/+7
| | | | | | | | | | | Some data structures are freed when the device is down and it will crash if an ISCSI netlink message is received. Add RCU protection to prevent this. In the shutdown path, ulp_ops[CNIC_ULP_L4] is assigned NULL and rcu_synchronized before freeing the data structures. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Finetune iSCSI connection reset.Eddie Wai2010-02-261-5/+16
| | | | | | | | | | | | For bnx2 devices, always send notification to bnx2i to let it initiate the cleanup when RST is received. For bnx2x devices, add unsolicited RST_COMP handling to start the cleanup. Signed-off-by: Eddie Wai <waie@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Finetune iSCSI connection set up.Eddie Wai2010-02-261-1/+16
| | | | | | | | | Initialize IP ID and handle some additional connection errors. Signed-off-by: Eddie Wai <waie@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/cnic.c: Use (pr|netdev)_<level> macro helpersJoe Perches2010-02-171-50/+37
| | | | | | | | | | | | | Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Remove #define PFX Use pr_<level> Use netdev_<level> Remove periods from formats Coalesce long formats Use __func__ Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Zero out status block and Event Queue indices.Michael Chan2009-12-111-0/+5
| | | | | | | | To prevent stale indices from causing spurious events when restarting the bnx2x devices. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Send delete command when shutting down iSCSI ring.Michael Chan2009-12-111-0/+6
| | | | | | | | | This step is necessary on the bnx2x devices when restarting the iSCSI ring. Without it, the firmware can assert and cause bnx2x to report errors. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Use dma_alloc_coherent().Michael Chan2009-12-021-24/+30
| | | | | | | | | Replace pci_alloc_consistent() with dma_alloc_coherent() so that appropriate GFP flags can be used. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix rq_page_table DMA address.Michael Chan2009-12-021-2/+2
| | | | | | | | The old code mistakenly zeroed out the upper 32-bit of the DMA address. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix bogus iSCSI MAC addressMichael Chan2009-12-021-2/+6
| | | | | | | | Fix code to read the proper iSCSI MAC address for bnx2x devices. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix bnx2x ring shutdown.Michael Chan2009-12-021-0/+7
| | | | | | | | | Need to send a HALT command to the firmware to fully shutdown the bnx2x rings. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix ring I/O address for bnx2x devices.Michael Chan2009-12-021-5/+3
| | | | | | | | | Old code was initializing the ring producers using an incorrect I/O address. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net: tasklet_init - Remove unnecessary leading & from second argJoe Perches2009-11-191-2/+2
| | | | | | | | | | | | | | | | | | | Changed function pointer use from non-majority address-of style to majority short form without & via: (was: 8 with &, 36 without) grep -rPl "\btasklet_init\s*\([^,\)]+,\s*\&" drivers/net | while read file ; do \ perl -i -e 'local $/; while (<>) { s@(\btasklet_init\s*\([^,\)]+,\s*)\&@\1@g ; print ; }' $file ;\ done Compile tested allyesconfig x86 Signed-off-by: Joe Perches <joe@perches.com> drivers/net/cnic.c | 4 ++-- drivers/net/jme.c | 10 +++++----- drivers/net/skge.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: ensure ulp_type is not negativeroel kluin2009-11-041-4/+4
| | | | | | | | | `ulp_type' is signed, make sure it is not negative when we read the array element. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2009-10-291-3/+3
|\ | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
| * cnic: Fix L2CTX_STATUSB_NUM offset in context memory.Michael Chan2009-10-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BNX2_L2CTX_STATUSB_NUM definition needs to be changed to match the recent firmware update: commit 078b0735881c7969aaf21469f3577831cddd9f8c bnx2: Update firmware to 5.0.0.j3. Without the fix, bnx2 can crash intermittently in bnx2_rx_int() when iSCSI is enabled. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Need to include net/ip6_checksum.hDavid S. Miller2009-10-121-0/+1
| | | | | | | | | | | | | | | | drivers/net/cnic.c: In function 'cnic_init_storm_conn_bufs': drivers/net/cnic.c:1757: error: implicit declaration of function 'csum_ipv6_magic' Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Add main functions to support bnx2x devices.Michael Chan2009-10-111-0/+1742
| | | | | | | | | | | | | | | | | | Add iSCSI support for bnx2x devices. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Shmulik Ravid - Rabinovitz <shmulikr@broadcom.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Add bnx2x data structures.Michael Chan2009-10-111-0/+5
| | | | | | | | | | | | | | | | Add hardware and software structures for bnx2x devices. Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Refactor some code.Michael Chan2009-10-111-18/+46
|/ | | | | | | | Refactor ring init. code for subsequent 10G patches. Also add rtnl_lock() in cnic_uio_open() to prevent race condition with netdev events. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix NETDEV_UP event processing.Michael Chan2009-10-021-1/+2
| | | | | | | | | | | | This fixes the problem of not handling the NETDEV_UP event properly during hot-plug or modprobe of bnx2 after cnic. The handling was skipped by mistakenly using "else if" to check for the event. Also update version to 2.0.1. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Shutdown iSCSI ring during uio_close.Michael Chan2009-09-221-2/+2
| | | | | | | | | | The iSCSI ring should be shutdown during uio_close instead of uio_open for proper operations. This fixes the problem of the ring getting stuck intermittently. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2009-09-021-39/+104
|\ | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/yellowfin.c
| * cnic: Fix locking in init/exit calls.Michael Chan2009-08-151-9/+39
| | | | | | | | | | | | | | | | | | | | | | | | The slow path ulp_init and ulp_exit calls to the bnx2i driver are sleepable calls and therefore should not be protected using rcu_read_lock. Fix it by using mutex and refcount during these calls. cnic_unregister_driver() will now wait for the refcount to go to zero before completing the call. Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * cnic: Fix locking in start/stop calls.Michael Chan2009-08-151-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | The slow path ulp_start and ulp_stop calls to the bnx2i driver are sleepable calls and therefore should not be protected using rcu_read_lock. Fix it by using mutex and setting a bit during these calls. cnic_unregister_device() will now wait for the bit to clear before completing the call. Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * cnic: Refine registration with bnx2.Michael Chan2009-08-151-13/+36
| | | | | | | | | | | | | | | | | | | | Register and unregister with bnx2 during NETDEV_UP and NETDEV_DOWN events. This simplifies the sequence of events and allows locking fixes in the next patch. Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * cnic: Fix symbol_put_addr() panic on ia64.Michael Chan2009-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When the cnic driver tries to grab a symbol from bnx2 when bnx2 is running init code, symbol_get() will succeed but symbol_put_addr() will hit BUG() a moment later. module_text_address() fails because bnx2 is still in init code. This is fixed by using symbol_put() instead which does the exact opposite of symbol_get(). Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Put uio init in separate function.Michael Chan2009-08-281-27/+41
| | | | | | | | | | | | | | This will allow the 10G iSCSI code to reuse the function. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Put rx/tx ring allocation in separate function.Michael Chan2009-08-281-11/+22
|/ | | | | | | This will allow the 10G iSCSI code to reuse the function. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix ISCSI_KEVENT_IF_DOWN message handling.Michael Chan2009-07-271-2/+21
| | | | | | | | | | | | | When a net device goes down or when the bnx2i driver is unloaded, the code was not generating the ISCSI_KEVENT_IF_DOWN message properly and this could cause the userspace driver to crash. This is fixed by sending the message properly in the shutdown path. cnic_uio_stop() is also added to send the message when bnx2i is unregistering. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix __symbol_get() build error.Michael Chan2009-06-211-2/+2
| | | | | | | | | | | Ingo molnar <mingo@elte.hu> reported the error drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’ when CONFIG_MODULES is not defined. Fix by using symbol_get() instead. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* Revert "[SCSI] cnic: fix error: implicit declaration of function ↵James Bottomley2009-06-211-2/+0
| | | | | | | | | | | ‘__symbol_get’" This reverts commit bc3bf8fd330ce981ce632a1a4a283eee46838f32. All the commit did was add a second #include of <linux/module.h> which is the wrong fix. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] cnic: fix error: implicit declaration of function ‘__symbol_get’Ingo Molnar2009-06-131-0/+2
| | | | | | | | | | | | | drivers/net/cnic.c: In function ‘init_bnx2_cnic’: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’ drivers/net/cnic.c:2520: warning: assignment makes pointer from integer without a cast make[1]: *** [drivers/net/cnic.o] Error 1 make: *** [drivers/net/cnic.o] Error 2 Caused by not including linux/module.h Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] cnic: fix undefined reference to `ip6_route_output'Randy Dunlap2009-06-131-2/+6
| | | | | | | | | | | | | Fix cnic build for case of CONFIG_INET=n. Fix cnic build for case of CONFIG_IPV6=m and CONFIG_CNIC=y. Fixes these build errors: cnic.c:(.text+0x236a1d): undefined reference to `ip_route_output_key' cnic.c:(.text+0x15a8e8): undefined reference to `ip6_route_output' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* [SCSI] cnic: Add new Broadcom CNIC driver.Michael Chan2009-06-091-0/+2711
The CNIC driver controls BNX2 hardware rings and resources used by iSCSI. Most hardware resources for iSCSI are separate from those used for ethernet networking. iSCSI uses a separate MAC address and IP address. The CNIC driver creates a UIO interface to handle the non-offloaded packets such as ARP, etc in userspace. Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
OpenPOWER on IntegriCloud