summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
AgeCommit message (Collapse)Author
2013-06-02bnx2x: Revise comments and alignmentYuval Mintz
This patch correct various typos, fix comments conventions and adds/removes a few comments. 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>
2013-06-02bnx2x: Semantic change of empty linesYuval Mintz
This patch removes unnecessary blank lines and adds a few where such are needed (between variable declarations and code) 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>
2013-05-27bnx2x: Change to D3hot only on removalYuval Mintz
This changes the PCI power management scheme of the bnx2x driver to be similar to those of most network drivers - the driver will now changes the power state into D3hot whenever the driver will be removed, instead of whenever an interface is unloaded. This change enables the driver to access its eeprom via ethtool callbacks even when interfaces are unloaded (such access requires the function to be in D0active). 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>
2013-05-23bnx2x: Enable `set_phys_id' for all functionsYaniv Rosner
In Multi-function mode, all functions should be able to utilize said function; There's no reason why only the link owner should be able to do so. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-23bnx2x: Add Private Flags SupportYuval Mintz
Utilize ethtool's callback `get_priv_flags' - shed more light on the feasibility of devices as storage interfaces. CC: Ben Hutchings <bhutchings@solarflare.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> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-30Revert "bnx2x: allow nvram test to run when device is down"Dmitry Kravkov
This reverts commit d2d2d87dfd1a25ee270994c5b9e3eb4690428d32 ("bnx2x: allow nvram test to run when device is down"). Since it makes access to the device in D3 state possible. More work is required to make sure device is not set to D3 during ifdown. Until this is done the nvram-test should simply exit if device is down like it did before. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-24bnx2x: Allow RX/TX pause control in autonegYaniv Rosner
Currently, when link is configured to auto-negotiate the flow control, disabling RX/TX pause via ethtool doesn't work. This fixes the behaviour, advertising asymmetric pause in case either one is exclusively enabled. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-22bnx2x: allow nvram test to run when device is downDmitry Kravkov
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-22bnx2x: add additional regions for CRC memory testDmitry Kravkov
a. Common tree of `dir` structures. b. Multi-port devices structures. CC: Francious Romieu <romieu@fz.zoreil.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-22bnx2x: remove non-necessary assignmentDmitry Kravkov
CC: Francious Romieu <romieu@fz.zoreil.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-22bnx2x: fix byte-by-byte nvram write for BE machinesDmitry Kravkov
CC: Francious Romieu <romieu@fz.zoreil.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-22bnx2x: refactor nvram read procedureDmitry Kravkov
introduce a procedure to read in u32 granularity. CC: Francious Romieu <romieu@fz.zoreil.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-27bnx2x: Support reading I2C EEPROM SFF8472Yaniv Rosner
Add full support for "ethtool -m" command. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-12bnx2x: Set ethtool ops for vfsAriel Elior
Virtual functions don't have access to HW registers, therefore most ethtool ops are forbidden to them. Instead of checking in each op whether the device being driven is a virtual function or a physical function, this patch creates a separate ethtool ops struct for virtual functions and uses it to initialize the ethtool ops of the driver in case it is driving a virtual function device. Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-02-28bnx2x: Fix KR2 linkYaniv Rosner
Fix KR2 link down problem after reboot when link speed is reconfigured via ethtool. Since 1G/10G support link speed were missing by default, 1G/10G link speed were not advertised. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23bnx2x: Add additional debug informationYuval Mintz
Add/Revise several debug prints in the bnx2x driver - on regular flows as well as error flows. 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>
2013-01-23bnx2x: reorganization and beautificationYuval Mintz
Slightly changes the bnx2x code without `true' functional changes. Changes include: 1. Gathering macros into a single macro when combination is used multiple times. 2. Exporting parts of functions into their own functions. 3. Return values after if-else instead of only on the else condition (where current flow would simply return same value later in the code) 4. Removing some unnecessary code (either dead-code or incorrect conditions) Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23bnx2x: Semantic renovationYuval Mintz
Mostly corrects white spaces, indentations, and comments. 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>
2013-01-15bnx2x: Introduce 2013 and advance version to 1.78.02Yuval Mintz
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>
2013-01-15bnx2x: improve stop-on-errorYuval Mintz
Get better control over interrupts during panic, and allow FW to test outgoing Tx packets when stop-on-error is allowed. 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>
2013-01-15bnx2x: add `ethtool -w' support.Miriam Shitrit
This revises and enhances the bnx2x register dump facilities, adding support for `ethtool -w' on top of `ethtool -d'. Signed-off-by: Miriam Shitrit <miris@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>
2013-01-15bnx2x: Fix rare self-test failuresYaniv Rosner
On rare occasions, self test link may fail since the link is being sampled while it's still being stabilized. To correct this behaviour, try to sample the link for 2 seconds prior to declaring a failure. Signed-off-by: Yaniv Rosner <yanivr@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>
2013-01-15Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller
Conflicts: Documentation/networking/ip-sysctl.txt drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Both conflicts were simply overlapping context. A build fix for qlcnic is in here too, simply removing the added devinit annotations which no longer exist. Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-10bnx2x: move debugging code before the returnDan Carpenter
I move the return down a line after the debugging printk. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-02bnx2x: Support of PF driver of a VF acquire requestAriel Elior
When a VF is probed by the VF driver, the VF driver sends an 'acquire' request over the VF <-> PF channel for the resources it needs to operate (interrupts, queues, etc). The PF driver either ratifies the request and allocates the resources, responds with the maximum values it will allow the VF to acquire, or fails the request entirely if there is a problem. 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>
2013-01-02bnx2x: Separate VF and PF logicAriel Elior
Generally, the VF driver cannot access the chip, except by the narrow window its BAR allows. Care had to be taken so the VF driver will not reach code which accesses the chip elsewhere. Refactor the nic_load flow into parts so it would be easier to separate the VF-only logic from the PF-only logic. 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>
2012-12-02bnx2x: Correct advertised speed/duplexYuval Mintz
If link is down due to management (and not due to actual phy link being lost), driver should still behave as if the link is down; Querying via ethtool about speed/duplex state should result in 'UNKNOWN' (same behaviour as when link is actually down). Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-12-02bnx2x: Filter packets on FCoE ringsDmitry Kravkov
Whenever bnx2x fails to transmit a packet due to a full Tx ring, if the ring size is zero (indicating an FCoE ring) driver filters the packet out and gracefully continues. Driver also gathers statistics on such filtered packets. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-28bnx2x: Always take PHY lockYaniv Rosner
Taking PHY lock is not required on some older designs, but we are removing this complication and always taking it since it is always required on newer designs and does not worth the code complication on the older boards. Taking PHY lock was initially required only on specific boards which had their MDC/MDIO bus crossed, but since this lock is now always required, for example, when NCSI is present, the PHY lock will always be taken. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-10Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller
Conflicts: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c Minor conflict between the BCM_CNIC define removal in net-next and a bug fix added to net. Based upon a conflict resolution patch posted by Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-07bnx2x: Support loading cnic resources at run-timeMerav Sicron
This patch replaces the BCM_CNIC define with a flag which can change at run-time and which does not use the CONFIG_CNIC kconfig option. For the PF/hypervisor driver cnic is always supported, however allocation of cnic resources and configuration of the HW for offload mode is done only when the cnic module registers bnx2x. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-03net: bnx2x: Fix typo in bnx2x driverMasanari Iida
Correct spelling typo in bnx2x driver Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-01bnx2x,cnic: use FW 7.8.2Yuval Mintz
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>
2012-09-24bnx2x: Improve code around bnx2x_tests_str_arrMerav Sicron
This patch changes the definition of bnx2x_tests_str_arr from static char pointer to static const char bi-directional array. Also the bnx2x_get_strings function is simplified. Reported-by: Joe Perches <joe@perches.com> Reported-by: David Laight <David.Laight@ACULAB.COM> Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-15Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller
Conflicts: net/netfilter/nfnetlink_log.c net/netfilter/xt_LOG.c Rather easy conflict resolution, the 'net' tree had bug fixes to make sure we checked if a socket is a time-wait one or not and elide the logging code if so. Whereas on the 'net-next' side we are calculating the UID and GID from the creds using different interfaces due to the user namespace changes from Eric Biederman. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-13bnx2x: fix registers dumpedDmitry Kravkov
Under traffic, there are several registers that when read (e.g., via 'ethtool -d') may cause the chip to stall. This patch corrects the registers read in such flows. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-13bnx2x: correct advertisement of pause capabilitiesYaniv Rosner
This patch propagates users' requested flow-control into the link layer, which will later be used to advertise this flow-control for auto-negotiation (until now these values were ignored). Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-13bnx2x: Utilize Link Flap AvoidanceYuval Mintz
Change various flows in the bnx2x driver which up until now flapped the link - these flows now benefit from the link flap avoidance mechanism. This includes the removal of the link reset made upon nic init, as it is possible the link is already active at that time. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-10bnx2x: EEE status is read locallyYuval Mintz
This patch aligns the EEE status with that of all other link properties, by changing the way its accessed - instead of a direct read to the shared memory, each function maintain its own copy locally. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30bnx2x: Move netif_napi_add to the open callMerav Sicron
Move netif_napi_add for all queues from the probe call to the open call, to avoid the case that napi objects are added for queues that may eventually not be initialized and activated. With the former behavior, the driver could crash when netpoll was calling ndo_poll_controller. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-22bnx2x: advertise transmit time stampingRichard Cochran
This driver now offers software transmit time stamping, so it should advertise that fact via ethtool. Compile tested only. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Cc: Eilon Greenstein <eilong@broadcom.com> Cc: Willem de Bruijn <willemb@google.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-27bnx2x: Change bnx2x_tests_str_arr to static charMerav Sicron
This patch changes the definition of bnx2x_tests_str_arr from char to static char. This correction will also eliminate the sparse warning created in commit cf2c1df62e065bfc15e38daf2d3479a56b320f29. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-22bnx2x: link module eepromYuval Mintz
Add the ethtool functionality of accessing optic modules' information and eeprom to the bnx2x driver. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-22bnx2x: 1G sfp+ module handlingYuval Mintz
Automatically lower requested link speed to 1G in case 1G SFP+ module is detected. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-19bnx2x: Add support for ethtool -LMerav Sicron
Add support for ethtool -L/-l for setting and getting the number of RSS queues. The 'combined' field is used as we don't support separate IRQ for Rx and Tx. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-19bnx2x: Split the FP structureBarak Witkowski
This patch moves some fields out of the FP structure to different structures, in order to minimize size of contigiuous memory allocated. Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-19bnx2x: Make the transmission queues adjacentMerav Sicron
In the current scheme the transmission queues of traffic-class 0 were 0-15, the transmission queues of traffic-class 1 were 16-31 and so on. If the number of RSS queues was smaller than 16, there were gaps in transmission queues numbering, as well as in CIDs numbering. This is both a waste (especially when 16 is increased to 64), and may causes problems with flushing queues when reducing the number of RSS queues (using ethtool -L). The new scheme eliminates the gaps. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-19bnx2x: Add support for 4-tupple UDP RSSMerav Sicron
This change enables to control via ethtool whether to do UDP RSS on 2-tupple (IP source / destination only) or on 4-tupple (include UDP source / destination port). It also enables to read back the RSS configuration. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-19bnx2x: Return only online tests for MFMerav Sicron
1. In multi-function device, show only the online tests in self-test results as only these test are performed (offline tests cannot be performed as they may corrupt the traffic of other functions on the same physical port). Note that multi-function mode cannot change while the driver is up. 2. Check result code in NIC load and act accordingly. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-19bnx2x: Add support for external LBMerav Sicron
This change enables to do self-test with external loopback via ethtool. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>