summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/cnic.c
Commit message (Collapse)AuthorAgeFilesLines
* ethernet: Remove unnecessary alloc/OOM messages, alloc cleanupsJoe Perches2013-02-041-4/+2
| | | | | | | | | | | | | | | | alloc failures already get standardized OOM messages and a dump_stack. Convert kzalloc's with multiplies to kcalloc. Convert kmalloc's with multiplies to kmalloc_array. Fix a few whitespace defects. Convert a constant 6 to ETH_ALEN. Use parentheses around sizeof. Convert vmalloc/memset to vzalloc. Remove now unused size variables. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic, bnx2x: Add CNIC_DRV_STATE_HANDLES_IRQ to ethdev->drv_stateMichael Chan2013-01-231-0/+4
| | | | | | | | | | | | | | | | | | | In INTA mode, cnic and bnx2x share the same IRQ. During chip reset, for example, cnic will stop servicing IRQs after it has shutdown the cnic hardware resources. However, the shared IRQ is still active as bnx2x needs to finish the reset. There is a window when bnx2x does not know that cnic is no longer handling IRQ and things don't always work properly. Add a flag to tell bnx2x that cnic is handling IRQ. The flag is set before the first cnic IRQ is expected and cleared when no more cnic IRQs are expected, so there should be no race conditions. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic, bnx2x, bnx2: Simplify cnic probing.Michael Chan2012-12-071-12/+9
| | | | | | | | | Instead of using symbol_get(), cnic can now directly call the cnic_probe functions in struct bnx2x and struct bnx2. symbol_get() is not reliable as it fails when the module is still initializing. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Include bnx2x.hMichael Chan2012-12-071-30/+20
| | | | | | | by removing duplicate symbols and removing some redundant code. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnx2: Add BNX2 prefix to CHIP ID and name macrosMichael Chan2012-12-071-7/+7
| | | | | | | for namespace consistency. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnx2: Add BNX2 prefix to descriptor structures and macrosMichael Chan2012-12-071-35/+35
| | | | | | | for namespace consistency. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix rare race condition during iSCSI disconnect.Eddie Wai2012-12-051-2/+11
| | | | | | | | | | | | | If the initiator and target try to close the connection at about the same time, there is a race condition in the termination sequence for bnx2x. Fix the problem by waiting for the remote termination to complete before deleting the Connection ID. This will prevent the firmware assert. Update version to 2.5.15. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Reset iSCSI EQ during shutdown.Michael Chan2012-12-051-0/+19
| | | | | | | | | | Without the reset, reloading the cnic driver can cause the iSCSI Event Queue to be out of sync with the driver and cause intermittent crash. Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/broadcom: remove __dev* attributesBill Pemberton2012-12-031-1/+1
| | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* bnx2x,cnic: use FW 7.8.2Yuval Mintz2012-10-011-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the bnx2x and cnic drivers into using FW 7.8.2 which was recently submitted into the linux-firmware tree. A short summary of minor bugs fixed by this FW: 1. In switch dependent mode, fix several issues regarding inner vlan vs. DCB priorities. 2. iSCSI - not all packets were completed on a forward channel. 3. DCB - fixed for 4-port devices. 4. Fixed false parity reported in CAM memories when operating near -5% on the 1.0V core supply. 5. ETS default settings are set to fairness between traffic classes (rather than strict priority), and uses the same chip receive buffer configuration for both PFC and pause. For a complete list of fixes made by this FW, see commit 236367db in the linux-firmware git repository. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Allocate UIO resources only on devices that support iSCSI.Michael Chan2012-09-101-1/+4
| | | | | | | | | Update version to 2.5.13. Reviewed-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Allocate kcq resource only on devices that support FCoE.Michael Chan2012-09-101-4/+3
| | | | | | | | | | To save memory and to exit IRQ loop quicker on devices that don't support FCoE. Reviewed-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Add function pointers to arm IRQ for different devices.Michael Chan2012-09-101-4/+22
| | | | | | | | | | This will make it easier to exit IRQ loop and re-arm IRQ on devices that don't support FCoE. Reviewed-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Free UIO rings when the device is closed.Michael Chan2012-09-101-0/+7
| | | | | | | | | This will free up unneeded memory. Reviewed-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Add functions to allocate and free UIO ringsMichael Chan2012-09-101-19/+40
| | | | | | | | | | These functions are needed to free up memory when the rings are no longer needed. Reviewed-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-07-101-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: net/batman-adv/bridge_loop_avoidance.c net/batman-adv/bridge_loop_avoidance.h net/batman-adv/soft-interface.c net/mac80211/mlme.c With merge help from Antonio Quartulli (batman-adv) and Stephen Rothwell (drivers/net/usb/qmi_wwan.c). The net/mac80211/mlme.c conflict seemed easy enough, accounting for a conversion to some new tracing macros. Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers/net/ethernet/broadcom/cnic.c: remove invalid reference to list ↵Julia Lawall2012-07-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iterator variable If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. There does not seem to be a meaningful value to provide to netdev_warn. Replace with pr_warn, since pr_err is used elsewhere. This problem was found using Coccinelle (http://coccinelle.lip6.fr/). Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
| * cnic: Don't use netdev->base_addrMichael Chan2012-07-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | commit c0357e975afdbbedab5c662d19bef865f02adc17 bnx2: stop using net_device.{base_addr, irq}. removed netdev->base_addr so we need to update cnic to get the MMIO base address from pci_resource_start(). Otherwise, mmap of the uio device will fail. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | drivers/net/ethernet: Fix non-kernel-doc comments with kernel-doc start markersBen Hutchings2012-07-101-3/+1
| | | | | | | | | | | | | | | | | | Convert doxygen (or similar) formatted comments to kernel-doc or unformatted comment. Delete a few that are content-free. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Fix mmap regression.Michael Chan2012-06-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 1f85d58cdf15354a7120fc9ccc9bb9c45b53af88 cnic: Remove uio mem[0]. introduced a regression as older versions of userspace app still rely on this mmap. Restore the mmap functionality and get the base address from pci_resource_start() as the nedev->base_addr has been deprecated for PCI devices. Update version to 2.5.12. Signed-off-by: Michael Chan <mchan@broadocm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Handle RAMROD_CMD_ID_CLOSE error.Eddie Wai2012-06-271-0/+9
| | | | | | | | | | | | | | | | | | If firmware returns error status, proceed to close the iSCSI connection. Update version to 2.5.11. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Remove uio mem[0].Michael Chan2012-06-271-4/+1
| | | | | | | | | | | | | | | | This memory region is no longer used. Userspace gets the BAR address directly from sysfs. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Read bnx2x function number from internal registerEddie Wai2012-06-271-1/+7
| | | | | | | | | | | | | | | | so that it will work on any hypervisor. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Fix occasional NULL pointer dereference during reboot.Michael Chan2012-06-271-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We register with bnx2x before we allocate ctx_tbl structure, so it is possible for bnx2x to call cnic_ctl before the structure is allocated. This can sometimes cause NULL pointer dereference of cp->ctx_tbl. We fix this by adding simple checking for valid state before proceeding. The cnic_ctl call is RCU protected so we don't have to deal with race conditions. Because of the additional checking, we need to finish the shutdown before clearing the CNIC_UP flag. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnx2x, bnx2fc, bnx2i, cnic: Add statistics support and FCoE capabilities ↵Barak Witkowski2012-06-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | advertisement 1. When FCoE offload driver is registered, copy its capabilities to the chip scratchpad. 2. Copy FCoE/iSCSI MAC addresses in aligned manner to chip scratchpad. 3. Add FCoE/iSCSI statistics collection support Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | ethernet: Remove casts to same typeJoe Perches2012-06-061-6/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding casts of objects to the same type is unnecessary and confusing for a human reader. For example, this cast: int y; int *p = (int *)&y; I used the coccinelle script below to find and remove these unnecessary casts. I manually removed the conversions this script produces of casts with __force, __iomem and __user. @@ type T; T *p; @@ - (T *)p + p A function in atl1e_main.c was passed a const pointer when it actually modified elements of the structure. Change the argument to a non-const pointer. A function in stmmac needed a __force to avoid a sparse warning. Added it. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Fix parity error code conflictMichael Chan2012-03-211-5/+7
| | | | | | | | | | | | The recently added parity error handling used an error code that was already defined for a different error. This could lead to bnx2x firmware assert. We need to fix this with new error codes that are defined for parity error only. Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-02-261-1/+5
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/ethernet/sfc/rx.c Overlapping changes in drivers/net/ethernet/sfc/rx.c, one to change the rx_buf->is_page boolean into a set of u16 flags, and another to adjust how ->ip_summed is initialized. Signed-off-by: David S. Miller <davem@davemloft.net>
| * ethernet/broadcom: ip6_route_output() never returns NULL.RongQing.Li2012-02-221-1/+5
| | | | | | | | | | | | | | | | ip6_route_output() never returns NULL, so it is wrong to check if the return value is NULL. Signed-off-by: RongQing.Li <roy.qing.li@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Update VLAN ID during ISCSI_UEVENT_PATH_UPDATEEddie Wai2012-02-091-0/+2
| | | | | | | | | | | | | | | | This will support the new VLAN attribute in the iSCSI iface file. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: set error flag when iSCSI connection failsJeffrey Huang2012-02-091-0/+2
| | | | | | | | | | | | | | | | | | to speed up error recovery due to SPQ failures. The error flag will expedite the recovery process by skipping the timeouts. Signed-off-by: Jeffrey Huang <huangjw@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | cnic: Add FCoE parity error recoveryMichael Chan2012-02-051-4/+34
|/ | | | | | | | | | When bnx2x returns error on FCoE SPQ messages, generate an error completion to bnx2fc immediately to speed up error recovery. This will eliminate length timeouts and spped up the reset of the device. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Improve error recovery on bnx2x devicesMichael Chan2012-01-051-5/+69
| | | | | | | | | | | | | | | | | When a bnx2x device encounters parity errors, it will not respond to all SPQ messages. As a result, the shutdown sequence before reset can take a long time as the ulp drivers (bnx2i/bnx2fc) have to wait for timeout of all such messages. To improve this scenario, when bnx2x returns error on the SPQ, we'll send an immediate response to the ulp drivers to avoid such lengthy timeouts. Adjust the return code of relevant functions to return error only if the message cannot be sent on the SPQ so that we'll generate an error completion to the ulp drivers. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Re-init dev->stats_addr after chip resetMichael Chan2012-01-051-0/+1
| | | | | | | because bnx2x frees the old and allocates new memory during chip reset. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnx2x, cnic: support DRV_INFO upon FW requestBarak Witkowski2011-12-061-0/+47
| | | | | | | | | | | | | | Add support to send driver capabilities, settings and statistics to management firmware. [ Redone using many local variables, removed many unnecessary inlines, and put #defines at the left margin suggested by Joe Perches ] Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: treewide use of RCU_INIT_POINTEREric Dumazet2011-11-231-3/+3
| | | | | | | | | | | | rcu_assign_pointer(ptr, NULL) can be safely replaced by RCU_INIT_POINTER(ptr, NULL) (old rcu_assign_pointer() macro was testing the NULL value and could omit the smp_wmb(), but this had to be removed because of compiler warnings) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: remove ipv6_addr_copy()Alexey Dobriyan2011-11-221-1/+1
| | | | | | | C assignment can handle struct in6_addr copying. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: Add timeout for ramrod replies.Michael Chan2011-08-281-7/+10
| | | | | | | | | | If the bnx2x device has encountered parity errors, the chip will not DMA any replies. Using wait_event_timeout() will allow us to make forward progress and let bnx2x reset the chip. 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>
* cnic, bnx2fc: Increase maximum FCoE sessions.Michael Chan2011-08-281-6/+8
| | | | | | | | Increase it to NVRAM configured limit or 1024 whichever is less. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* broadcom: Move the Broadcom driversJeff Kirsher2011-08-101-0/+5487
Moves the drivers for Broadcom devices into drivers/net/ethernet/broadcom/ and the necessary Kconfig and Makefile changes. CC: Eilon Greenstein <eilong@broadcom.com> CC: Michael Chan <mchan@broadcom.com> CC: Matt Carlson <mcarlson@broadcom.com> CC: Gary Zambrano <zambrano@broadcom.com> CC: "Maciej W. Rozycki" <macro@linux-mips.org> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
OpenPOWER on IntegriCloud