summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
Commit message (Collapse)AuthorAgeFilesLines
* bnxt_en: Fix handling FRAG_ERR when NVM_INSTALL_UPDATE cmd failsVasundhara Volam2019-08-181-7/+5Star
| | | | | | | | | | | | If FW returns FRAG_ERR in response error code, driver is resending the command only when HWRM command returns success. Fix the code to resend NVM_INSTALL_UPDATE command with DEFRAG install flags, if FW returns FRAG_ERR in its response error code. Fixes: cb4d1d626145 ("bnxt_en: Retry failed NVM_INSTALL_UPDATE with defragmentation flag enabled.") Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2019-07-091-3/+3
|\ | | | | | | | | | | Two cases of overlapping changes, nothing fancy. Signed-off-by: David S. Miller <davem@davemloft.net>
| * bnxt_en: Fix ethtool selftest crash under error conditions.Michael Chan2019-07-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | After ethtool loopback packet tests, we re-open the nic for the next IRQ test. If the open fails, we must not proceed with the IRQ test or we will crash with NULL pointer dereference. Fix it by checking the bnxt_open_nic() return code before proceeding. Reported-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com> Fixes: 67fea463fd87 ("bnxt_en: Add interrupt test to ethtool -t selftest.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnxt_en: Refactor __bnxt_xmit_xdp().Michael Chan2019-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | __bnxt_xmit_xdp() is used by XDP_TX and ethtool loopback packet transmit. Refactor it so that it can be re-used by the XDP_REDIRECT logic. Restructure the TX interrupt handler logic to cleanly separate XDP_TX logic in preparation for XDP_REDIRECT. Acked-by: Andy Gospodarek <gospo@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnxt_en: rename some xdp functionsAndy Gospodarek2019-07-091-1/+1
|/ | | | | | | | | Renaming bnxt_xmit_xdp to __bnxt_xmit_xdp to get ready for XDP_REDIRECT support and reduce confusion/namespace collision. Signed-off-by: Andy Gospodarek <gospo@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Fix possible BUG() condition when calling pci_disable_msix().Michael Chan2019-05-231-1/+1
| | | | | | | | | | | | | | | When making configuration changes, the driver calls bnxt_close_nic() and then bnxt_open_nic() for the changes to take effect. A parameter irq_re_init is passed to the call sequence to indicate if IRQ should be re-initialized. This irq_re_init parameter needs to be included in the bnxt_reserve_rings() call. bnxt_reserve_rings() can only call pci_disable_msix() if the irq_re_init parameter is true, otherwise it may hit BUG() because some IRQs may not have been freed yet. Fixes: 41e8d7983752 ("bnxt_en: Modify the ring reservation functions for 57500 series chips.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Read package version from firmware.Vasundhara Volam2019-05-061-1/+2
| | | | | | | | | | HWRM_VER_GET firmware command returns package name that is running actively on the adapter. Use this version instead of parsing from the package log in NVRAM. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add support for PCIe statisticsVasundhara Volam2019-05-061-0/+39
| | | | | | | | Gather periodic PCIe statistics for ethtool -S. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Update firmware interface to 1.10.0.69.Michael Chan2019-05-061-0/+4
| | | | | | | | PTP API updates for 57500 chips, new RX port stats counters and other miscellaneous updates. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2018-12-201-1/+4
|\ | | | | | | | | | | | | | | | | | | Lots of conflicts, by happily all cases of overlapping changes, parallel adds, things of that nature. Thanks to Stephen Rothwell, Saeed Mahameed, and others for their guidance in these resolutions. Signed-off-by: David S. Miller <davem@davemloft.net>
| * bnxt_en: Fix ethtool self-test loopback.Michael Chan2018-12-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code has 2 problems. It assumes that the RX ring for the loopback packet is combined with the TX ring. This is not true if the ethtool channels are set to non-combined mode. The second problem is that it won't work on 57500 chips without adjusting the logic to get the proper completion ring (cpr) pointer. Fix both issues by locating the proper cpr pointer through the RX ring. Fixes: e44758b78ae8 ("bnxt_en: Use bnxt_cp_ring_info struct pointer as parameter for RX path.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnxt_en: query force speeds before disabling autoneg mode.Vasundhara Volam2018-12-181-1/+21
| | | | | | | | | | | | | | | | | | | | | | With autoneg enabled, PHY loopback test fails. To disable autoneg, driver needs to send a valid forced speed to FW. FW is not sending async event for invalid speeds. To fix this, query forced speeds and send the correct speed when disabling autoneg mode. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnxt_en: Do not free port statistics buffer when device is down.Michael Chan2018-12-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port statistics which include RDMA counters are useful even when the netdevice is down. Do not free the port statistics DMA buffers when the netdevice is down. This is keep the snapshot of the port statistics and counters will just continue counting when the netdevice goes back up. Split the bnxt_free_stats() function into 2 functions. The port statistics buffers will only be freed when the netdevice is removed. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnxt_en: Return linux standard errors in bnxt_ethtool.cVasundhara Volam2018-12-181-17/+39
| | | | | | | | | | | | | | | | | | | | Currently firmware specific errors are returned directly in flash_device and reset ethtool hooks. Modify it to return linux standard errors to userspace when flashing operations fail. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnxt_en: Add ethtool -S priority counters.Michael Chan2018-12-181-1/+113
| | | | | | | | | | | | | | | | | | | | | | | | Display the CoS counters as additional priority counters by looking up the priority to CoS queue mapping. If the TX extended port statistics block size returned by firmware is big enough to cover the CoS counters, then we will display the new priority counters. We call firmware to get the up-to-date pri2cos mapping to convert the CoS counters to priority counters. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnxt_en: get rid of num_stat_ctxs variableVasundhara Volam2018-12-181-2/+0Star
|/ | | | | | | | | | | | For bnxt_en driver, stat_ctxs created will always be same as cp_nr_rings. Remove extra variable that duplicates the value. Also introduce bnxt_get_avail_stat_ctxs_for_en() helper to get available stat_ctxs and bnxt_get_ulp_stat_ctxs() helper to return number of stat_ctxs used by RDMA. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Fix filling time in bnxt_fill_coredump_record()Vasundhara Volam2018-11-151-2/+2
| | | | | | | | | | Fix the year and month offset while storing it in bnxt_fill_coredump_record(). Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.") Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add software "missed_irqs" counter.Michael Chan2018-11-151-1/+4
| | | | | | | | To keep track of the number of times the workaround code for 57500 A0 has been triggered. This is a per NQ counter. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Use bnxt_cp_ring_info struct pointer as parameter for RX path.Michael Chan2018-10-161-9/+10
| | | | | | | | | | In the RX code path, we current use the bnxt_napi struct pointer to identify the associated RX/CP rings. Change it to use the struct bnxt_cp_ring_info pointer instead since there are now up to 2 CP rings per MSIX. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Re-structure doorbells.Michael Chan2018-10-161-1/+1
| | | | | | | | | | | The 57500 series chips have a new 64-bit doorbell format. Use a new bnxt_db_info structure to unify the new and the old 32-bit doorbells. Add a new bnxt_set_db() function to set up the doorbell addreses and doorbell keys ahead of time. Modify and introduce new doorbell helpers to help abstract and unify the old and new doorbells. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add additional extended port statistics.Michael Chan2018-10-161-6/+85
| | | | | | | | | | | Latest firmware spec. has some additional rx extended port stats and new tx extended port stats added. We now need to check the size of the returned rx and tx extended stats and determine how many counters are valid. New counters added include CoS byte and packet counts for rx and tx. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: take coredump_record structure off stackArnd Bergmann2018-08-141-6/+3Star
| | | | | | | | | | | | | | | | The bnxt_coredump_record structure is very long, causing a warning about possible stack overflow on 32-bit architectures: drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c: In function 'bnxt_get_coredump': drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2989:1: error: the frame size of 1188 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] I could not see any reason to operate on an on-stack copy of the structure before copying it back into the caller-provided buffer, which also simplifies the code here. Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: avoid string overflow for record->system_nameArnd Bergmann2018-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | The utsname()->nodename string may be 64 bytes long, and it gets copied without the trailing nul byte into the shorter record->system_name, as gcc now warns: In file included from include/linux/bitmap.h:9, from include/linux/ethtool.h:16, from drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:13: In function 'strncpy', inlined from 'bnxt_fill_coredump_record' at drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2863:2: include/linux/string.h:254:9: error: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] Using strlcpy() at least avoids overflowing the destination buffer and adds proper nul-termination. It may still truncate long names though, which probably can't be solved here. Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Fix strcpy() warnings in bnxt_ethtool.cVasundhara Volam2018-08-111-3/+3
| | | | | | | | | | | | | | This patch fixes following smatch warnings: drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2826 bnxt_fill_coredump_seg_hdr() error: strcpy() '"sEgM"' too large for 'seg_hdr->signature' (5 vs 4) drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2858 bnxt_fill_coredump_record() error: strcpy() '"cOrE"' too large for 'record->signature' (5 vs 4) drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2879 bnxt_fill_coredump_record() error: strcpy() 'utsname()->sysname' too large for 'record->os_name' (65 vs 32) Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add BNXT_NEW_RM() macro.Michael Chan2018-08-061-1/+1
| | | | | | | | | The BNXT_FLAG_NEW_RM flag is checked a lot in the code to determine if the new resource manager is in effect. Define a macro to perform this check. Signed-off-by: Michael Chan <michael.chan@broadocm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add support for ethtool get dump.Vasundhara Volam2018-08-061-0/+333
| | | | | | | | Add support to collect live firmware coredump via ethtool. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add external loopback test to ethtool selftest.Michael Chan2018-08-061-6/+26
| | | | | | | | Add code to detect firmware support for external loopback and the extra test entry for external loopback. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Adjust timer based on ethtool stats-block-usecs settings.Michael Chan2018-08-061-0/+5
| | | | | | | | | | | The driver gathers statistics using 2 mechanisms. Some stats are DMA'ed directly from hardware and others are polled from the driver's timer. Currently, we only adjust the DMA frequency based on the ethtool stats-block-usecs setting. This patch adjusts the driver's timer frequency as well to make everything consistent. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Update firmware interface version to 1.9.2.25.Michael Chan2018-08-061-3/+3
| | | | | | | | New interface has firmware core dump support, new extended port statistics, and IF state change notifications to the firmware. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Read phy eeprom A2h address only when optical diagnostics is supported.Vasundhara Volam2018-05-081-12/+8Star
| | | | | | | | | | | | | | | | | | For SFP+ modules, 0xA2 page is available only when Diagnostic Monitoring Type [Address A0h, Byte 92] is implemented. Extend bnxt_get_module_info(), to read optical diagnostics support at offset 92(0x5c) and set eeprom_len length to ETH_MODULE_SFF_8436_LEN (to exclude A2 page), if dianostics is not supported. Also in bnxt_get_module_info(), module id is read from offset 0x5e which is not correct. It was working by accident, as offset was not effective without setting enables flag in the firmware request. SFP module id is present at location 0. Fix this by removing the offset and read it from location 0. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Reserve rings in bnxt_set_channels() if device is down.Michael Chan2018-04-271-0/+2
| | | | | | | | | | | | The current code does not reserve rings during ethtool -L when the device is down. The rings will be reserved when the device is later opened. Change it to reserve rings during ethtool -L when the device is down. This provides a better guarantee that the device open will be successful when the rings are reserved ahead of time. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Do not allow VF to read EEPROM.Michael Chan2018-04-271-0/+5
| | | | | | | | Firmware does not allow the operation and would return failure, causing a warning in dmesg. So check for VF and disallow it in the driver. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Display function level rx/tx_discard_pkts via ethtoolVasundhara Volam2018-04-271-0/+33
| | | | | | | | | Add counters to display sum of rx/tx_discard_pkts of all rings as function level statistics via ethtool. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Fix memory fault in bnxt_ethtool_init()Vasundhara Volam2018-04-191-22/+27
| | | | | | | | | | | | | | | | In some firmware images, the length of BNX_DIR_TYPE_PKG_LOG nvram type could be greater than the fixed buffer length of 4096 bytes allocated by the driver. This was causing HWRM_NVM_READ to copy more data to the buffer than the allocated size, causing general protection fault. Fix the issue by allocating the exact buffer length returned by HWRM_NVM_FIND_DIR_ENTRY, instead of 4096. Move the kzalloc() call into the bnxt_get_pkgver() function. Fixes: 3ebf6f0a09a2 ("bnxt_en: Add installed-package firmware version reporting via Ethtool GDRVINFO") Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Fix ethtool -x crash when device is down.Michael Chan2018-04-111-3/+8
| | | | | | | | Fix ethtool .get_rxfh() crash by checking for valid indirection table address before copying the data. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Check max_tx_scheduler_inputs value from firmware.Michael Chan2018-04-011-0/+11
| | | | | | | | | | | | When checking for the maximum pre-set TX channels for ethtool -l, we need to check the current max_tx_scheduler_inputs parameter from firmware. This parameter specifies the max input for the internal QoS nodes currently available to this function. The function's TX rings will be capped by this parameter. By adding this logic, we provide a more accurate pre-set max TX channels to the user. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add extended port statistics supportVasundhara Volam2018-04-011-0/+32
| | | | | | | | | Gather periodic extended port statistics, if the device is PF and link is up. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Include additional hardware port statistics in ethtool -S.Vasundhara Volam2018-04-011-0/+5
| | | | | | | | | Include additional hardware port statistics in ethtool -S, which are useful for debugging. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: fix clear flags in ethtool reset handlingScott Branden2018-04-011-2/+6
| | | | | | | | | | Clear flags when reset command processed successfully for components specified. Fixes: 6502ad5963a5 ("bnxt_en: Add ETH_RESET_AP support") Signed-off-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: add support for software dynamic interrupt moderationAndy Gospodarek2018-01-101-0/+12
| | | | | | | | | | | | | This implements the changes needed for the bnxt_en driver to add support for dynamic interrupt moderation per ring. This does add additional counters in the receive path, but testing shows that any additional instructions are offset by throughput gain when the default configuration is for low latency. Signed-off-by: Andy Gospodarek <gospo@broadcom.com> Acked-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add ETH_RESET_AP supportScott Branden2017-12-011-0/+11
| | | | | | | | | Add ETH_RESET_AP support handling to reset the internal Application Processor(s) of the SmartNIC card. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Acked-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()'Christophe JAILLET2017-11-281-2/+2
| | | | | | | | | | | | Error code returned by 'bnxt_read_sfp_module_eeprom_info()' is handled a few lines above when reading the A0 portion of the EEPROM. The same should be done when reading the A2 portion of the EEPROM. In order to correctly propagate an error, update 'rc' in this 2nd call as well, otherwise 0 (success) is returned. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: fix typo in bnxt_set_coalesceAndy Gospodarek2017-11-031-1/+1
| | | | | | | | | | Recent refactoring of coalesce settings contained a typo that prevents receive settings from being set properly. Fixes: 18775aa8a91f ("bnxt_en: Reorganize the coalescing parameters.") Signed-off-by: Andy Gospodarek <gospo@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Reorganize the coalescing parameters.Michael Chan2017-10-271-20/+30
| | | | | | | | | | | | | The current IRQ coalescing logic is a little messy. The ethtool parameters are mapped to hardware parameters in a way that is difficult to understand. The first step is to better organize the parameters by adding the new structure bnxt_coal. The structure is used by both the RX and TX sets of coalescing parameters. Adjust the default coal_ticks to 14 us and 28 us for RX and TX. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Add ethtool reset methodVasundhara Volam2017-10-271-1/+36
| | | | | | | | This is a firmware internal reset after driver is unloaded. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Get firmware package version one time.Michael Chan2017-10-271-14/+16
| | | | | | | | | | | | | The current code retrieves the firmware package version from firmware everytime ethtool -i is run. There is no reason to do that as the firmware will not change while the driver is loaded. Get the version once at init time. Also, display the full 4-part firmware version string and remove the less useful interface spec version. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Check for zero length value in bnxt_get_nvram_item().Michael Chan2017-10-271-0/+3
| | | | | | | | Return -EINVAL if the length is zero and not proceed to do essentially nothing. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Fix possible corrupted NVRAM parameters from firmware response.Michael Chan2017-10-151-1/+3
| | | | | | | | | | | | | | | | In bnxt_find_nvram_item(), it is copying firmware response data after releasing the mutex. This can cause the firmware response data to be corrupted if the next firmware response overwrites the response buffer. The rare problem shows up when running ethtool -i repeatedly. Fix it by calling the new variant _hwrm_send_message_silent() that requires the caller to take the mutex and to release it after the response data has been copied. Fixes: 3ebf6f0a09a2 ("bnxt_en: Add installed-package version reporting via Ethtool GDRVINFO") Reported-by: Sarveswara Rao Mygapula <sarveswararao.mygapula@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Don't use rtnl lock to protect link change logic in workqueue.Michael Chan2017-10-151-0/+4
| | | | | | | | | | | | | | As a further improvement to the PF/VF link change logic, use a private mutex instead of the rtnl lock to protect link change logic. With the new mutex, we don't have to take the rtnl lock in the workqueue when we have to handle link related functions. If the VF and PF drivers are running on the same host and both take the rtnl lock and one is waiting for the other, it will cause timeout. This patch fixes these timeouts. Fixes: 90c694bb7181 ("bnxt_en: Fix RTNL lock usage on bnxt_update_link().") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnxt_en: Improve tx ring reservation logic.Michael Chan2017-08-291-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | When the number of TX rings is changed (e.g. ethtool -L, enabling XDP TX rings, etc), the current code tries to reserve the new number of TX rings before closing and re-opening the NIC. If we are unable to reserve the new TX rings, we abort the operation and keep the current TX rings. The problem is that the firmware will disable the current TX rings even when it cannot reserve the new set of TX rings. We fix it as follows: 1. Instead of reserving the new set of TX rings, just ask the firmware to check if the new set of TX rings is available. There is a flag in the firmware message to do that. If not available, abort and the current TX rings will not be disabled. 2. Do the actual TX ring reservation in the path that opens the NIC. We keep the number of TX rings currently successfully reserved. If the number of TX rings is different than the reserved TX rings, we call firmware and reserve again. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>