summaryrefslogtreecommitdiff
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: stable@dpdk.org Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Shahed Shaikh <shshaikh@marvell.com>
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: stable@dpdk.org Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
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: stable@dpdk.org Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
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 <bluca@debian.org> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Bruce Richardson <bruce.richardson@intel.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-11-20net/bnx2x: bump version to 1.0.7.1Rasesh Mody
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2018-10-18net/bnx2x: remove profanityStephen Hemminger
No need for profanity in comments. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
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 <thomas@monjalon.net> Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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 <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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 <rasesh.mody@cavium.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-08-03net/bnx2x: bump version to 1.0.6.1Rasesh Mody
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
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 <thomas@monjalon.net>
2018-06-14net/bnx2x: add to meson buildBruce Richardson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-25net/bnx2x: change copyright info to CaviumRasesh Mody
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-05-25net/bnx2x: use SPDX tagRasesh Mody
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-05-15net/bnx2x: fix memzone name overrunAndy Green
Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
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: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
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 <zhouyates@gmail.com> Acked-by: Harish Patil <harish.patil@cavium.com>
2018-04-27net/bnx2x: make init and driver logtype names consistentRasesh Mody
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
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: stable@dpdk.org Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
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: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
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: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
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 <ferruh.yigit@intel.com> Reviewed-by: David Marchand <david.marchand@6wind.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
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 <harish.patil@cavium.com>
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 <anatoly.burakov@intel.com> Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com> Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com> Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
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 <ferruh.yigit@intel.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
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 <stephen@networkplumber.org> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> --- 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 <stephen@networkplumber.org>
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 <santosh.shukla@caviumnetworks.com> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
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 <thomas@monjalon.net> Acked-by: Olivier Matz <olivier.matz@6wind.com>
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 <santosh.shukla@caviumnetworks.com> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Olivier Matz <olivier.matz@6wind.com>
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 <thomas@monjalon.net> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2017-11-06remove useless memzone includesThomas Monjalon
The memzone header is often included without good reason. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
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 <gaetan.rivet@6wind.com>
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] http://dpdk.org/ml/archives/dev/2017-June/067712.html Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
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 <gage.eads@intel.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Gage Eads <gage.eads@intel.com>
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 <matan@mellanox.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
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 <zhiyong.yang@intel.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06net/bnx2x: remove unnecessary void castsStephen Hemminger
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>