path: root/drivers/net/octeontx
AgeCommit message (Collapse)Author
2019-03-20net/octeontx: fix vdev nameStephen Hemminger
The octeontx driver is creating vdev with name "OCTEONTX_PMD" which is an artifact from how RTE_PMD_REGISTER_VDEV arguments work. Change to use the same convention as all the other network drivers ie "net_octeontx"). Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove") Cc: Signed-off-by: Stephen Hemminger <> Reviewed-by: Rami Rosen <> Acked-by: Jerin Jacob <>
2018-11-16net/octeontx: fix failures when available ports > queuesAnoob Joseph
When eth_octeontx is initialized before event_octeontx, eth_octeontx would initiate setting up of the event device with the max ports and queues available. If number of ports is more than the number of queues, some ports would be left unused when the ports and queues are mapped 1:1. But even in that case the ports need to be setup, or otherwise it would lead to a segmentation fault when event device is started. Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove") Cc: Signed-off-by: Anoob Joseph <> Signed-off-by: Pavan Nikhilesh <> Acked-by: Jerin Jacob <>
2018-11-14net/octeontx: fix mbuf corruption with large private sizesNitin Saxena
When the priv_size of the mbuf is > 128 bytes, the mbuf would not be properly constructed. This would lead to a corrupt mbuf. This patch fixes the issue by accounting for rte_pktmbuf_priv_size(pool) and RTE_PKTMBUF_HEADROOM while configuring first skip register calculation. Fixes: 197438ee9f18 ("net/octeontx: add Rx queue setup and release ops") Cc: Suggested-by: Jerin Jacob <> Signed-off-by: Anoob Joseph <> Signed-off-by: Nitin Saxena <> Acked-by: Jerin Jacob <>
2018-10-26ethdev: remove release function for secondary processThomas Monjalon
After previous changes, the function rte_eth_dev_release_port() can be used for primary or secondary process as well. The only difference with rte_eth_dev_release_port_secondary() is the shared lock used in rte_eth_dev_release_port(). The function rte_eth_dev_release_port_secondary() was recently added in 18.11 cycle. Signed-off-by: Thomas Monjalon <> Reviewed-by: Andrew Rybchenko <>
2018-10-26ethdev: free all common data when releasing portThomas Monjalon
This is a clean-up of common ethdev data freeing. All data freeing are moved to rte_eth_dev_release_port() and done only in case of primary process. It is probably fixing some memory leaks for PMDs which were not freeing all data. Signed-off-by: Thomas Monjalon <> Acked-by: Andrew Rybchenko <>
2018-10-26use registered name for OCTEON TX referencesAnoob Joseph
'OCTEON TX' is the registered name. All other usages need to be fixed. Signed-off-by: Anoob Joseph <> Acked-by: Jerin Jacob <>
2018-10-17drivers/net: enable hotplug on secondary processQi Zhang
Attach port from secondary should ignore devargs since the private device is not necessary to support. Also previously, detach port on a secondary process will mess primary process and cause the same device can't be attached back again. A secondary process should use rte_eth_dev_release_port_secondary to release a port. Signed-off-by: Qi Zhang <>
2018-10-01event/octeontx: support Tx adapterPavan Nikhilesh
Add Tx adapter support and move few routines around to avoid code duplication. Signed-off-by: Pavan Nikhilesh <> Acked-by: Jerin Jacob <>
2018-09-28net/*/base: allow use of experimental APIs in base codeBruce Richardson
The driver setting of "allow_experimental_apis" was not being used when building the base code. To allow this we can manually put in a check in the base code files for the setting and set the appropriate cflag if it's needed. Signed-off-by: Bruce Richardson <> Acked-by: Andrew Rybchenko <> Tested-by: Ilya Maximets <>
2018-09-14ethdev: make default behavior CRC strip on RxFerruh Yigit
Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag. Without any specific Rx offload flag, default behavior by PMDs is to strip CRC. PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC Rx offload capability. Applications that require keeping CRC should check PMD capability first and if it is supported can enable this feature by setting DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure() Signed-off-by: Ferruh Yigit <> Acked-by: Tomasz Duszynski <> Acked-by: Shahaf Shuler <> Reviewed-by: Maxime Coquelin <> Acked-by: Jan Remes <> Acked-by: Jerin Jacob <> Acked-by: Hyong Youb Kim <>
2018-08-28net/octeontx: fix packet corruption on TxJerin Jacob
LMTST does not guarantee packet content get synced with L2C when HW access the packet for transmitting. Adding coherent IO write barrier will make sure HW sees the correct packet if its modified. Fixes: 9e747589bd4c ("net/octeontx: add packet transmit burst function") Cc: Reported-by: Vikas Aggarwal <> Signed-off-by: Jerin Jacob <> Acked-by: Santosh Shukla <>
2018-08-02net/octeontx: fix stop clearing Rx/Tx functionsPavan Nikhilesh
On dev_stop the Rx/Tx_burst functions are being set to NULL, this causes a SEGFAULT in cases where control path calls stop and a paket is still being processed by a worker. Instead clear the fastpath functions in dev_close. Fixes: da6c687471a3 ("net/octeontx: add start and stop support") Cc: Signed-off-by: Pavan Nikhilesh <> Acked-by: Jerin Jacob <>
2018-07-26drivers/net: fix crash in secondary processFerruh Yigit
Calling rte_eth_dev_info_get() on secondary process cause a crash because eth_dev->device is not set properly. Fixes: ee27edbe0c10 ("drivers/net: share vdev data to secondary process") Cc: Reported-by: Vipin Varghese <> Signed-off-by: Ferruh Yigit <> Reviewed-by: Qi Zhang <>
2018-07-12mempool/octeontx: fix pool to aura mappingPavan Nikhilesh
HW needs each pool to be mapped to an aura set of 16 auras. Previously, pool to aura mapping was considered to be 1:1. Fixes: 02fd6c744350 ("mempool/octeontx: support allocation") Cc: Signed-off-by: Pavan Nikhilesh <> Acked-by: Santosh Shukla <> Acked-by: Jerin Jacob <>
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-07-03ethdev: add new offload flag to keep CRCFerruh Yigit
DEV_RX_OFFLOAD_KEEP_CRC offload flag is added. PMDs that support keeping CRC should advertise this offload capability. DEV_RX_OFFLOAD_CRC_STRIP flag will remain one more release default behavior in PMDs are to keep the CRC until this flag removed Until DEV_RX_OFFLOAD_CRC_STRIP flag is removed: - Setting both KEEP_CRC & CRC_STRIP is INVALID - Setting only CRC_STRIP PMD should strip the CRC - Setting only KEEP_CRC PMD should keep the CRC - Not setting both PMD should keep the CRC A helper function rte_eth_dev_is_keep_crc() has been added to be able to change the no flag behavior with minimal changes in PMDs. The PMDs that doesn't report the DEV_RX_OFFLOAD_KEEP_CRC offload can remove rte_eth_dev_is_keep_crc() checks next release, related code commented to help the maintenance task. And DEV_RX_OFFLOAD_CRC_STRIP has been added to virtual drivers since they don't use CRC at all, when an application requires this offload virtual PMDs should not return error. Signed-off-by: Ferruh Yigit <> Acked-by: Allain Legacy <> Acked-by: Andrew Rybchenko <> Acked-by: Thomas Monjalon <>
2018-05-14ethdev: add probing finish functionThomas Monjalon
A new hook function is added and called inside the PMDs at the end of the device probing: - in primary process, after allocating, init and config - in secondary process, after attaching and local init This new function is almost empty for now. It will be used later to add some post-initialization processing. For the PMDs calling the helpers rte_eth_dev_create() or rte_eth_dev_pci_generic_probe(), the hook rte_eth_dev_probing_finish() is called from here, and not in the PMD itself. Note that the helper rte_eth_dev_create() could be used more, especially for vdevs, avoiding some code duplication in PMDs. Cc: Signed-off-by: Thomas Monjalon <> Reviewed-by: Andrew Rybchenko <> Reviewed-by: Stephen Hemminger <>
2018-05-14ethdev: new Rx/Tx offloads APIWei Dai
This patch check if a input requested offloading is valid or not. Any reuqested offloading must be supported in the device capabilities. Any offloading is disabled by default if it is not set in the parameter dev_conf->[rt]xmode.offloads to rte_eth_dev_configure() and [rt]x_conf->offloads to rte_eth_[rt]x_queue_setup(). If any offloading is enabled in rte_eth_dev_configure() by application, it is enabled on all queues no matter whether it is per-queue or per-port type and no matter whether it is set or cleared in [rt]x_conf->offloads to rte_eth_[rt]x_queue_setup(). If a per-queue offloading hasn't be enabled in rte_eth_dev_configure(), it can be enabled or disabled for individual queue in ret_eth_[rt]x_queue_setup(). A new added offloading is the one which hasn't been enabled in rte_eth_dev_configure() and is reuqested to be enabled in rte_eth_[rt]x_queue_setup(), it must be per-queue type, otherwise trigger an error log. The underlying PMD must be aware that the requested offloadings to PMD specific queue_setup() function only carries those new added offloadings of per-queue type. This patch can make above such checking in a common way in rte_ethdev layer to avoid same checking in underlying PMD. This patch assumes that all PMDs in 18.05-rc2 have already converted to offload API defined in 17.11 . It also assumes that all PMDs can return correct offloading capabilities in rte_eth_dev_infos_get(). In the beginning of [rt]x_queue_setup() of underlying PMD, add offloads = [rt]xconf->offloads | dev->data->dev_conf.[rt]xmode.offloads; to keep same as offload API defined in 17.11 to avoid upper application broken due to offload API change. PMD can use the info that input [rt]xconf->offloads only carry the new added per-queue offloads to do some optimization or some code change on base of this patch. Signed-off-by: Wei Dai <> Signed-off-by: Ferruh Yigit <> Signed-off-by: Qi Zhang <>
2018-05-14net/octeontx: fix missing offload flagsPavan Nikhilesh
Fix missing DEV_RX_OFFLOAD_CHECKSUM flag in RX offloads. Remove depricated txq_flags field. Fixes: a92870896b4a ("net/octeontx: use the new offload APIs") Signed-off-by: Pavan Nikhilesh <>
2018-04-24drivers/net: share vdev data to secondary processJianfeng Tan
dpdk-procinfo, as a secondary process, cannot fetch stats for vdev. This patch enables that by attaching the port from the shared data. We also fill the eth dev ops, with only some ops works in secondary process, for example, stats_get(). Note that, we still cannot Rx/Tx packets on the ports which do not support multi-process. Reported-by: Signed-off-by: Vipin Varghese <> Signed-off-by: Jianfeng Tan <> Reviewed-by: Qi Zhang <>
2018-04-24drivers/net: do not use private ethdev dataJianfeng Tan
We introduced private rte_eth_dev_data to allow vdev to be created both in primary process and secondary process(es). This is not friendly to multi-process model, for example, it leads to port id contention issue if two processes both find the data entry is free. And to get stats of primary vdev in secondary, we must allocate from the pre-defined array so that we can find it. Suggested-by: Bruce Richardson <> Signed-off-by: Jianfeng Tan <> Reviewed-by: Qi Zhang <>
2018-04-14ethdev: return diagnostic when setting MAC addressOlivier Matz
Change the prototype and the behavior of dev_ops->eth_mac_addr_set(): a return code is added to notify the caller (librte_ether) if an error occurred in the PMD. The new default MAC address is now copied in dev->data->mac_addrs[0] only if the operation is successful. The patch also updates all the PMDs accordingly. Signed-off-by: Olivier Matz <> Signed-off-by: Ivan Malov <> Acked-by: Andrew Rybchenko <> Acked-by: Adrien Mazarguil <> Acked-by: Shreyansh Jain <> Reviewed-by: Ferruh Yigit <> Acked-by: Thomas Monjalon <> Acked-by: Nelio Laranjeiro <>
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/octeontx: fix uninitialized speed variableStephen Hemminger
This is fix for Coverity Defect 268319 about uninitialized speed in an error case. Also drop unnecessary assignment. Coverity issue: 268319 Fixes: 4fac7c0a147e ("net/octeontx: add link update") CC: Signed-off-by: Stephen Hemminger <> Acked-by: Jerin Jacob <>
2018-04-14net/octeontx: remove redundant driver name updateSantosh Shukla
Cc: Signed-off-by: Santosh Shukla <> Reviewed-by: David Marchand <>
2018-04-14net/octeontx: use the new offload APIsPavan Nikhilesh
Use the new Rx/Tx offload APIs and remove the old style offloads. Signed-off-by: Pavan Nikhilesh <> Acked-by: Santosh Shukla <>
2018-04-04common/octeontx: move mbox to common folderPavan Nikhilesh
Move commonly used functions across mempool, event and net devices to a common folder in drivers. Signed-off-by: Pavan Nikhilesh <> Acked-by: Jerin Jacob <> Acked-by: Santosh Shukla <>
2018-03-30net/octeontx: use link status helper functionsStephen Hemminger
Use new rte_eth_linkstatus_get/set helper functions to handle link status update. Signed-off-by: Stephen Hemminger <> Reviewed-by: Ferruh Yigit <>
2018-03-30net/octeontx: fix uninitialized variable in port openSantosh Shukla
Coverity issue: 195045 Fixes: f18b146c498d ("net/octeontx: create ethdev ports") Cc: Signed-off-by: Santosh Shukla <>
2018-03-30net/octeontx: fix null pointer dereferenceSantosh Shukla
Coverity issue: 195040 Fixes: f18b146c498d ("net/octeontx: create ethdev ports") Cc: Signed-off-by: Santosh Shukla <>
2018-02-05net/octeontx: register fpa as platform HW mempoolPavan Nikhilesh
Register octeontx-fpavf as platform HW mempool when net/octeontx pmd is used. Signed-off-by: Pavan Nikhilesh <> Acked-by: Santosh Shukla <>
2018-01-31drivers/octeontx: align dynamic log names with standardHarry van Haaren
This commit aligns the names for dynamic logging with the newly defined logging format. Signed-off-by: Harry van Haaren <> Acked-by: Jerin Jacob <> Acked-by: Santosh Shukla <> Acked-by: Bruce Richardson <>
2018-01-30drivers/net: build Cavium NIC PMDs with mesonPavan Nikhilesh
Add Cavium octeontx and thunder nicvf to meson build infrastructure. Signed-off-by: Pavan Nikhilesh <> Acked-by: Bruce Richardson <>
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-16ethdev: fix link autonegotiation valueThomas Monjalon
There are 3 kind of link data in ethdev: - capabilities (rte_eth_dev_info) - configuration (rte_eth_conf) - status (rte_eth_link) A bit-field is used for capabilities (rte_eth_dev_info.speed_capa) and configuration (rte_eth_conf.link_speeds). Bits are defined in ETH_LINK_SPEED_*. Some numerical (ETH_SPEED_NUM_*) and boolean (ETH_LINK_*) values are used for the link status (rte_eth_link.*). There was a mistake in the comment of rte_eth_link.link_autoneg, suggesting ETH_LINK_SPEED_[AUTONEG/FIXED] which are 0/1, instead of ETH_LINK_[AUTONEG/FIXED] which are 1/0. The drivers are fixed to use ETH_LINK_[AUTONEG/FIXED]. Fixes: 82113036e4e5 ("ethdev: redesign link speed config") Suggested-by: Andrew Rybchenko <> Signed-off-by: Thomas Monjalon <> Acked-by: Stephen Hemminger <>
2018-01-16net/octeontx: add channel to port id mappingPavan Nikhilesh
The channel to port id map is used by event octeontx to map the received wqe to the respective ethdev port. Signed-off-by: Pavan Nikhilesh <> Acked-by: Santosh Shukla <>
2018-01-16net/octeontx: implement dynamic loggingPavan Nikhilesh
Signed-off-by: Pavan Nikhilesh <> Acked-by: Santosh Shukla <> Acked-by: Stephen Hemminger <>
2018-01-16net/octeontx: advertise supported mbuf pool opsPavan Nikhilesh
Advertise mempool/octeontx as the only supported mempool ops when the application checks using `rte_eth_dev_pool_ops_supported`. Signed-off-by: Pavan Nikhilesh <> Acked-by: Santosh Shukla <>
2018-01-09drivers: use SPDX tag for Cavium copyright filesJerin Jacob
Signed-off-by: Jerin Jacob <> Acked-by: Hemant Agrawal <>
2017-11-07bus/vdev: move code from EAL into a new driverJianfeng Tan
Move the vdev bus from lib/librte_eal to drivers/bus. As the crypto vdev helper function refers to data structure in rte_vdev.h, so we move those helper function into drivers/bus too. Signed-off-by: Jianfeng Tan <>
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-06malloc: rename address mapping function to IOVAThomas Monjalon
The function rte_malloc_virt2phy() is renamed to rte_malloc_virt2iova(). The deprecated name is kept as an alias to avoid breaking the API. Signed-off-by: Thomas Monjalon <> Acked-by: Santosh Shukla <>
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-26net/octeontx: fix build for gcc < 4.6Ferruh Yigit
-Ofast option supported starting from gcc4.6 [1], for older versions using "-O3 -ffast-math" instead. [1] build error: CC octeontx_rxtx.o cc1: error: invalid option argument ‘-Ofast’ Fixes: 9e747589bd4c ("net/octeontx: add packet transmit burst function") Signed-off-by: Ferruh Yigit <> Acked-by: Santosh Shukla <>
2017-10-25net/octeontx: support event Rx adapterPavan Nikhilesh
Add functions to modify and delete qos responsible for mapping eth queues to event queues used for configuring event Rx adapter. The mbox functions have been moved from octeontx_pkivf.c to octeontx_pkivf.h to allow event_octeontx to access them. Signed-off-by: Pavan Nikhilesh <>
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-23mempool/octeontx: move mbox from event to mempoolSantosh Shukla
Octeontx mempool pmd need mailbox for pool setup. That mailbox was defined at drivers/event/octeontx. So mempool has dependency on event/octeontx driver and commit:8700239f7767 has added make rule which makes sure event/* get build before mempool, but this rule introduces cyclic dependency and may create problem to future feature addition in drivers/Makefile. Same problem noticed and reported in below thread: The patch solves problem by moving mbox definition from drivers/event/octeontx to drivers/mempool/octeontx. Moving mbox files involves below changes: * Renamed ssovf_mbox.[ch] --> octeontx_mbox.[ch] * Renamed ssovf_probe.c --> octeontx_ssovf.c * Introduced pool logger file. * Moved API from to * Respective Makefile changes done in drivers/event/octeontx/Makefile and drivers/mempool/octeontx/Makefile. Fixes: 8700239f7767 ("mempool/octeontx: add build and log infrastructure") Reported-by: Hemant Agrawal <> Signed-off-by: Santosh Shukla <> Tested-by: Hemant Agrawal <> Reviewed-by: Pavan Nikhilesh <>
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-12net/octeontx: add start and stop supportJerin Jacob
add start, stop and close support. Signed-off-by: Jerin Jacob <> Signed-off-by: Santosh Shukla <>