path: root/drivers/net/bnx2x
AgeCommit message (Collapse)Author
2019-03-22drivers/net: fix possible overflow using strlcatChaitanya Babu Talluri
strcat does not check the destination length and there might be chances of string overflow so instead of strcat, strlcat is used. Fixes: 540a211084a7 ("bnx2x: driver core") Fixes: e163c18a15b0 ("net/i40e: update ptype and pctype info") Cc: Signed-off-by: Chaitanya Babu Talluri <> Reviewed-by: Ferruh Yigit <> Acked-by: Shahed Shaikh <>
2019-03-01drivers/net: fix shifting 32-bit signed variable 31 timesAndrius Sirvys
Shifting signed 32-bit values by 31-bits has the potential for unexpected outcomes as compiler can overwrite a bit. Specified that values are unsigned. Errors are observed from running cppcheck. Bugzilla ID: 58 Fixes: 69e209be5464 ("net/axgbe: add register map and related macros") Fixes: b5bf7719221d ("bnx2x: driver support routines") Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats") Fixes: 6fda3f0ddda9 ("net/cxgbe: add API to program hardware MPS table") Fixes: bdb244b96920 ("e1000: whitespace changes") Fixes: 5a32a257f957 ("e1000: more NICs in base driver") Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change") Fixes: defb9a5dd156 ("nfp: introduce driver initialization") Fixes: ec94dbc57362 ("qede: add base driver") Fixes: d2e7d931d0ad ("net/qede/base: formatting changes") Fixes: cdc07e83bb24 ("net/tap: add eBPF program file") Cc: Signed-off-by: Andrius Sirvys <> Reviewed-by: Ferruh Yigit <>
2019-03-01net/bnx2x: fix segfaults due to stale interrupt statusShahed Shaikh
Previous ungraceful exit may leave behind un-acked stale interrupts for slowpath and fastpath. Interrupt status polling function is started before FLR is initiated, so we don't have a real way to protect this polling function invoking an interrupt handler caused due to stale interrupt status from previous ungraceful exit. So, check uninitialized status block variables in interrupt handling path which may lead to segfault. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Shahed Shaikh <>
2019-02-27build: improve dependency handlingLuca Boccassi
Whenever possible (if the library ships a pkg-config file) use meson's dependency() function to look for it, as it will automatically add it to the Requires.private list if needed, to allow for static builds to succeed for reverse dependencies of DPDK. Otherwise the recursive dependencies are not parsed, and users doing static builds have to resolve them manually by themselves. When using this API avoid additional checks that are superfluous and take extra time, and avoid adding the linker flag manually which causes it to be duplicated. Signed-off-by: Luca Boccassi <> Acked-by: Bruce Richardson <> Tested-by: Bruce Richardson <>
2018-12-13net/bnx2x: cleanup info logsRasesh Mody
Reduced number of INFO logs in BNX2X PMD by converting some INFO logs to DEBUG and few NOTICE logs to INFO, removing extra new lines, printing banner bar once for the adapter and device specific info. Fixes: ba7eeb035a5f ("net/bnx2x: fix logging to include device name") Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Rasesh Mody <>
2018-11-20net/bnx2x: bump version to Mody
Signed-off-by: Rasesh Mody <>
2018-11-14net/bnx2x: fix VF link state updateRasesh Mody
In general the VF driver should not access the chip. For VF link status update, VF driver should not use HW lock, use bnx2x_link_report_locked() instead. Add few prints for releasing previously held HW locks. Fixes: a9b58b15ed51 ("net/bnx2x: fix to add PHY lock") Cc: Signed-off-by: Rasesh Mody <>
2018-11-14net/bnx2x: fix dynamic loggingRasesh Mody
Use rte_log() rather than RTE_LOG() for dynamic logging. Rearrange dynamic log types to the top and configurable log types to bottom. Remove unused RTE_LIBRTE_BNX2X_DEBUG_TX_FREE Fixes: ba7eeb035a5f ("net/bnx2x: fix logging to include device name") Cc: Signed-off-by: Rasesh Mody <> Acked-by: Stephen Hemminger <>
2018-10-18net/bnx2x: remove profanityStephen Hemminger
No need for profanity in comments. Signed-off-by: Stephen Hemminger <> Reviewed-by: Ferruh Yigit <>
2018-10-17ethdev: rename memzones allocated for DMAThomas Monjalon
The helper rte_eth_dma_zone_reserve() is called by PMDs when probing a new port. It creates a new memzone with an unique name. The name of this memzone was using the name of the driver doing the probe. In order to avoid assigning the driver before the end of the probing, the driver name is removed from these memzone names. The ethdev name (data->name) is not used because it may be too long and may be not set at this stage of probing. Syntax of old name: <driver>_<ring>_<port>_<queue> Syntax of new name: eth_p<port>_q<queue>_<ring> Signed-off-by: Thomas Monjalon <> Tested-by: Andrew Rybchenko <>
2018-10-11net/bnx2x: fix to add PHY lockRasesh Mody
This patch adds phy_lock, acquire/release the lock when performing PHY transactions. Without this fix driver can run into synchronization issues with management FW when modifying PHY settings. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Rasesh Mody <>
2018-10-11net/bnx2x: fix call to link handling periodic functionRasesh Mody
If link handling periodic function is allowed to be called in interrupt context, the periodic function can get called too frequently and exhaust the retry credits to check link status. This change makes sure link handling periodic function is not called in interrupt context. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Rasesh Mody <>
2018-10-11net/bnx2x: fix to disable further interruptsRasesh Mody
Fix to disable further fastpath/slowpath interrupts. These will be enabled again by their respective handlers Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Rasesh Mody <>
2018-10-11net/bnx2x: update link/PHY managementRasesh Mody
This patch has changes to update the link/PHY management (elink) code to the latest. Signed-off-by: Rasesh Mody <>
2018-10-11net/bnx2x: fix logging to include device nameRasesh Mody
Fix PMD logging scheme to include device name in the messages printed. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Rasesh Mody <>
2018-08-03net/bnx2x: move SPDX tags to source filesRasesh Mody
We were using LICENSE.bnx2x_pmd to reference inclusion of SPDX licensing tag from all the source file. Remove the LICENSE.bnx2x_pmd file and directly include SPDX tags in source files. Signed-off-by: Rasesh Mody <> Acked-by: Hemant Agrawal <>
2018-08-03net/bnx2x: fix copyrightRasesh Mody
Originally the PMD had "QLogic Corporation" copyright. When we submitted commit e3de5dad2a5d ("net/bnx2x: change copyright info to Cavium"), the "Qlogic Corporation" copyright was accidentally replaced with "Cavium Inc". So now we see multiple Cavium copyright messages. We're changing it to "Broadcom Corporation" copyright. Fixes: e3de5dad2a5d ("net/bnx2x: change copyright info to Cavium") Cc: Signed-off-by: Rasesh Mody <>
2018-08-03net/bnx2x: bump version to Mody
Signed-off-by: Rasesh Mody <>
2018-08-03net/bnx2x: fix poll link statusRasesh Mody
The PMD has been modified to invoke the polling function in the link management code which detects the peer speed/mode, configure the link and update the status accordingly. This patch is the fix for the link down issue seen when we do dev_stop() and dev_start() from an application. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Rasesh Mody <>
2018-08-02net/bnx2x: fix FW command timeout during stopRasesh Mody
This patch fixes firmware command timeout error seen during device stop while stopping queues. It patially reverts an earlier preventive change commit 91b7e432bcef ("net/bnx2x: disable fast path interrupts") to now enable fast path interrupts. The original issue of performance degradation is not observed anymore, with or without the fix. Fixes: 91b7e432bcef ("net/bnx2x: disable fast path interrupts") Cc: Signed-off-by: Rasesh Mody <>
2018-07-12remove useless constructor headersThomas Monjalon
A constructor is usually declared with RTE_INIT* macros. As it is a static function, no need to declare before its definition. The macro is used directly in the function definition. Signed-off-by: Thomas Monjalon <>
2018-06-14net/bnx2x: add to meson buildBruce Richardson
Signed-off-by: Bruce Richardson <> Reviewed-by: Ferruh Yigit <>
2018-05-25net/bnx2x: change copyright info to CaviumRasesh Mody
Signed-off-by: Rasesh Mody <>
2018-05-25net/bnx2x: use SPDX tagRasesh Mody
Signed-off-by: Rasesh Mody <>
2018-05-15net/bnx2x: fix memzone name overrunAndy Green
Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Andy Green <> Acked-by: Pablo de Lara <> Acked-by: Rasesh Mody <>
2018-05-15net/bnx2x: fix KR2 device checkAndy Green
In function ‘elink_check_kr2_wa’: drivers/net/bnx2x/elink.c:12922:28: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] ((next_page & 0xe0) == 0x2)))); This was fixed elsewhere in 2014 Fixes: b5bf7719221d ("bnx2x: driver support routines") Cc: Signed-off-by: Andy Green <> Acked-by: Rasesh Mody <>
2018-05-15net/bnx2x: do not cast function pointers as a policyAndy Green
This is stopping the compiler telling you when you have done something stupid... that is something none of us can afford... Now gcc 8.x can tell you did something stupid despite trying to hide the evidence. Remove all the "black magic" casts. Fix the actual problems. Fixes: b5bf7719221d ("bnx2x: driver support routines") Cc: Signed-off-by: Andy Green <> Acked-by: Rasesh Mody <>
2018-05-14drivers/net: use higher level of probing helper for PCIThomas Monjalon
The drivers avp, bnx2x and liquidio were using the helper function rte_eth_dev_pci_allocate() and can be replaced by rte_eth_dev_pci_generic_probe() which calls the former. Fixes: dcd5c8112bc3 ("ethdev: add PCI driver helpers") Cc: Signed-off-by: Thomas Monjalon <> Reviewed-by: Ferruh Yigit <> Reviewed-by: Andrew Rybchenko <> Reviewed-by: Stephen Hemminger <>
2018-04-27net/bnx2x: reserve enough headroom for mbuf prependYangchao Zhou
When allocating a new mbuf for Rx, the value of m->data_off should be reset to its default value (RTE_PKTMBUF_HEADROOM), instead of reusing the previous undefined value, which could cause the packet to have a too small or too high headroom. Signed-off-by: Yangchao Zhou <> Acked-by: Harish Patil <>
2018-04-27net/bnx2x: make init and driver logtype names consistentRasesh Mody
Signed-off-by: Rasesh Mody <>
2018-04-27net/bnx2x: fix for PCI FLR after ungraceful exitRasesh Mody
This patch provides a fix for PCI function level reset after an ungraceful exit from an application. The fix is to enable internal target read as part of device attach before getting device information from device config space, device itself and shared memory. In addition to that, add a 200ms delay for the recovery flow to complete. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: Signed-off-by: Rasesh Mody <>
2018-04-14drivers/net: remove redundant icc flagFerruh Yigit
ICC warning #188 already disabled globally via commit [1], no need individual arguments in PMDs. [1] Fixes: 1b80b9c854c3 ("mk: disable icc warning 188") Cc: Signed-off-by: Ferruh Yigit <> Tested-by: Pablo de Lara <>
2018-04-14drivers/net: fix icc deprecated parameter warningFerruh Yigit
With icc (ICC) 18.0.1 20171018, -wd usage generates following warning: icc: command line remark #10010: option '-wd3656' is deprecated and will be removed in a future release. See '-help deprecated' "icc -help deprecated" output is: -wd use -diag-disable Based on above information "-wd" converted to "-diag-disable" Cc: Signed-off-by: Ferruh Yigit <> Tested-by: Pablo de Lara <>
2018-04-14ethdev: replace bus specific struct with generic devFerruh Yigit
Public struct rte_eth_dev_info has a "struct rte_pci_device" field in it although it is common for all ethdev in all buses. Replacing pci specific struct with generic device struct and updating places that are using pci device in a way to get this information from generic device. Signed-off-by: Ferruh Yigit <> Reviewed-by: David Marchand <> Acked-by: Pablo de Lara <> Acked-by: Thomas Monjalon <>
2018-04-14net/bnx2x: convert to new Rx offloads APIHarish Patil
Ethdev RX offloads API has changed since: commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") This patch makes use of DEV_RX_OFFLOAD_JUMBO_FRAME offload flag to advertise jumbo frame support. Signed-off-by: Harish Patil <>
2018-04-11net/bnx2x: use contiguous allocation for DMA memoryAnatoly Burakov
All hardware drivers should allocate IOVA-contiguous memzones for their hardware resources. Signed-off-by: Anatoly Burakov <> Tested-by: Santosh Shukla <> Tested-by: Hemant Agrawal <> Tested-by: Gowrishankar Muthukrishnan <>
2018-01-22ethdev: separate driver APIsFerruh Yigit
Create a rte_ethdev_driver.h file and move PMD specific APIs here. Drivers updated to include this new header file. There is no update in header content and since ethdev.h included by ethdev_driver.h, nothing changed from driver point of view, only logically grouping of APIs. From applications point of view they can't access to driver specific APIs anymore and they shouldn't. More PMD specific data structures still remain in ethdev.h because of inline functions in header use them. Those will be handled separately. Signed-off-by: Ferruh Yigit <> Acked-by: Shreyansh Jain <> Acked-by: Andrew Rybchenko <> Acked-by: Thomas Monjalon <>
2018-01-16net/bnx2x: implement dynamic loggingStephen Hemminger
Replace compile time option for init and driver log with dynamic value. Signed-off-by: Stephen Hemminger <> Signed-off-by: Ferruh Yigit <> --- v2: remove remaining RTE_LIBRTE_BNX2X_DEBUG usage
2018-01-05net/bnx2x: remove redundant parenthesisStephen Hemminger
No need for extra parentheis around simple if expresssion Signed-off-by: Stephen Hemminger <>
2017-11-06drivers/net: rename physical address type to IOVASantosh Shukla
Renamed data type from phys_addr_t to rte_iova_t. Signed-off-by: Santosh Shukla <> Reviewed-by: Anatoly Burakov <> Signed-off-by: Thomas Monjalon <>
2017-11-06mbuf: rename data address helpers to IOVAThomas Monjalon
The following inline functions and macros have been renamed to be consistent with the IOVA wording: rte_mbuf_data_dma_addr -> rte_mbuf_data_iova rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default rte_pktmbuf_mtophys -> rte_pktmbuf_iova rte_pktmbuf_mtophys_offset -> rte_pktmbuf_iova_offset The deprecated functions and macros are kept to avoid breaking the API. Signed-off-by: Thomas Monjalon <> Acked-by: Olivier Matz <>
2017-11-06mbuf: rename physical address to IOVASantosh Shukla
Rename buf_physaddr to buf_iova. Keep the deprecated name in an anonymous union to avoid breaking the API. Signed-off-by: Santosh Shukla <> Reviewed-by: Anatoly Burakov <> Signed-off-by: Thomas Monjalon <> Acked-by: Olivier Matz <>
2017-11-06memzone: rename address from physical to IOVAThomas Monjalon
The struct rte_memzone field .phys_addr is renamed to .iova. The deprecated name is kept in an anonymous union to avoid breaking the API. Signed-off-by: Thomas Monjalon <> Acked-by: Santosh Shukla <>
2017-11-06remove useless memzone includesThomas Monjalon
The memzone header is often included without good reason. Signed-off-by: Thomas Monjalon <> Acked-by: Bruce Richardson <>
2017-10-26pci: introduce library and driverGaetan Rivet
The PCI lib defines the types and methods allowing to use PCI elements. The PCI bus implements a bus driver for PCI devices by constructing rte_bus elements using the PCI lib. Move the relevant code out of the EAL to its expected place. Libraries, drivers, unit tests and applications are updated to use the new rte_bus_pci.h header when necessary. Signed-off-by: Gaetan Rivet <>
2017-10-26mbuf: rename deprecated VLAN flagsOlivier Matz
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while. As explained in [1], these flags were kept to let the applications and PMDs move to the new flag. There is also a need to support Rx vlan offload without vlan strip (at least for the ixgbe driver). This patch renames the old flags for this feature, knowing that some PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that the vlan tci has been saved in the mbuf structure. It is likely that some PMDs do not set the proper flags when doing vlan offload, and it would be worth making a pass on all of them. Link: [1] Signed-off-by: Olivier Matz <> Reviewed-by: Ferruh Yigit <>
2017-10-24mk: do not generate LDLIBS from directory dependenciesOlivier Matz
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz variable. This is valid when the subdirectory name match the library name, but it's not always the case, especially for PMDs. The patches removes this feature and explicitly adds the proper libraries in LDLIBS. Some DEPDIRS-xyz variables become useless, remove them. Reported-by: Gage Eads <> Signed-off-by: Olivier Matz <> Reviewed-by: Gage Eads <>
2017-10-12ethdev: add return value to stats get dev opMatan Azrad
The stats_get dev op API doesn't include return value, so PMD cannot return an error in case of failure at stats getting process time. Since PCI devices can be removed and there is a time between the physical removal to the RMV interrupt, the user may get invalid stats without any indication. This patch changes the stats_get API return value to be int instead of void. All the net PMDs stats_get dev ops are adjusted by this patch. Signed-off-by: Matan Azrad <> Reviewed-by: Ferruh Yigit <>
2017-10-06ethdev: increase port id rangeZhiyong Yang
Extend port_id definition from uint8_t to uint16_t in lib and drivers data structures, specifically rte_eth_dev_data. Modify the APIs, drivers and app using port_id at the same time. Fix some checkpatch issues from the original code and remove some unnecessary cast operations. release_17_11 and deprecation docs have been updated in this patch. Signed-off-by: Zhiyong Yang <> Acked-by: Adrien Mazarguil <> Reviewed-by: Ferruh Yigit <>
2017-10-06net/bnx2x: remove unnecessary void castsStephen Hemminger
Signed-off-by: Stephen Hemminger <> Reviewed-by: Kirill Rybalchenko <>