Commit Graph

11655 Commits

Author SHA1 Message Date
Hemant Agrawal
a95e588c07 mempool/dpaa2: install missing header with meson
rte_dpaa2_mempool.h header was missed to be added in meson.build
for header installation.

Fixes: 7ed3599095 ("mempool/dpaa2: add functions for CMDIF")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-19 15:49:53 +02:00
Hemant Agrawal
6b6ca75191 drivers: mark internal NXP symbols
This patch moves the internal symbols to INTERNAL sections
so that any change in them is not reported as ABI breakage.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-19 15:49:53 +02:00
Hemant Agrawal
4d1f7981b4 drivers/mempool: mark internal NXP symbols
This patch moves the internal symbols to INTERNAL sections
so that any change in them is not reported as ABI breakage.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-19 15:49:53 +02:00
Hemant Agrawal
1e0f9b0775 bus/dpaa: mark internal symbols
This patch moves the internal symbols to INTERNAL sections
so that any change in them is not reported as ABI breakage.

This patch also removes two symbols, which are not to be exported.
rte_dpaa_mem_ptov  - static inline in the headerfile
fman_ccsr_map_fd - local shared variable.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-19 15:49:53 +02:00
Hemant Agrawal
c9da6cfa1c bus/fslmc: mark internal symbols
This patch moves the internal symbols to INTERNAL sections
so that any change in them is not reported as ABI breakage.

This patch also removes two symbols, which were not used
anywhere else i.e. rte_fslmc_vfio_dmamap & dpaa2_get_qbman_swp

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-19 15:49:53 +02:00
Hemant Agrawal
6ae4ce8942 common/dpaax: mark internal symbols
This patch moves the internal symbols to INTERNAL sections
so that any change in them is not reported as ABI breakage.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-19 15:49:53 +02:00
Xiaoyun Li
aee2733fe3 net/igc/base: update copyright
Clarify Intel copyright and update the date to 2020.

Fixes: 8cb7c57d9b ("net/igc: support device initialization")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-18 20:35:57 +02:00
Xiaoyun Li
dc496974cd net/ice/base: update copyright
Clarify Intel copyright and update the date to 2020.

Fixes: f3202a097f ("net/ice/base: add ACL module")
Fixes: a90fae1d07 ("net/ice/base: add admin queue structures and commands")
Fixes: 2d2bdc0267 ("net/ice/base: add various headers")
Fixes: c9e37832c9 ("net/ice/base: rework on bit ops")
Fixes: 453d087cca ("net/ice/base: add common functions")
Fixes: 6c1f26be50 ("net/ice/base: add control queue information")
Fixes: 1082f78654 ("net/ice/base: support DCB")
Fixes: 6aa406714a ("net/ice/base: add device IDs for Intel E800 Series NICs")
Fixes: bd984f155f ("net/ice/base: support FDIR")
Fixes: 51d04e4933 ("net/ice/base: add flexible pipeline module")
Fixes: 2d2bdc0267 ("net/ice/base: add various headers")
Fixes: aa1cd410fa ("net/ice/base: add flow module")
Fixes: 51c7f09f3f ("net/ice/base: add registers for Intel E800 Series NIC")
Fixes: 64e9587d56 ("net/ice/base: add structures for Rx/Tx queues")
Fixes: 557fa75bcf ("net/ice/base: add code to work with the NVM")
Fixes: b06499a433 ("net/ice/base: update Boot Configuration Section read of NVM")
Fixes: 04b8ec1ea8 ("net/ice/base: add protocol structures and defines")
Fixes: 2a27e0a16d ("net/ice/base: add sideband queue info")
Fixes: 93e84b1bfc ("net/ice/base: add basic Tx scheduler")
Fixes: c7dd159311 ("net/ice/base: add virtual switch code")
Fixes: a240ff5050 ("net/ice/base: add basic structures")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-18 20:35:57 +02:00
Xiaoyun Li
32c3e0b488 common/iavf: update copyright
Clarify Intel copyright and update the date to 2020.

Fixes: 317862a4e4 ("net/iavf: replace license text with SPDX tag")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-18 20:35:57 +02:00
Xiaoyun Li
760ed82196 net/i40e/base: update copyright
Clarify Intel copyright and update the date to 2020.

Fixes: 547be3f01f ("net/i40e/base: replace license text with SPDX tag")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-18 20:35:57 +02:00
Xiaoyun Li
e071d4af8f net/ixgbe/base: update copyright
Clarify Intel copyright and update the date to 2020.

Fixes: 9db3087f4f ("net/ixgbe/base: update the license")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-18 20:35:57 +02:00
Bing Zhao
29e091cefe net/mlx5: fix port action resource initialization
After memory optimization, the organization of some resources are
changed from pointer based LIST to the index based ILIST. A lot of
code parts are touched due to such change.
Some static code checking and analysis tool will complain and raise
a false warning on the uninitialized value using. E.g. in the port
action registering function, the stack variable will be used as the
right value with some uninitialized field to initialize variable
allocated from heap. But indeed, it is not an error because all the
fields set with the uninitialized value will be overwritten in the
following code part and the macros. All the fields will be used as
the left value explicitly.
It makes no sense to clear the stack variable to 0 in this case,
and the extra memset will introduce some cycles overhead. It just
needs to ignore the false warning from the tool, if any.

Fixes: f3faf9ea11 ("net/mlx5: convert port id action to indexed")

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Reviewed-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-18 20:35:57 +02:00
Bing Zhao
d3b61f4b7c net/mlx5: fix port action assert timing
After memory optimization, some action object handles are changed to
index to save the overhead. Assertion in debug mode will be helpful
for trouble shooting.
In the current implementation, only one port action is supported in
switchdev mode for one device flow. In debug mode, an assertion will
be used to check the if the port action is none, and it should
locate before the port action resource registration but not after
it. The action index in the handle should be 0 before registration.
Or else it will always cause a failure because the port action is
registered and the index is not 0.

Fixes: f3faf9ea11 ("net/mlx5: convert port id action to indexed")

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Reviewed-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-18 20:35:57 +02:00
Viacheslav Ovsiienko
3acf107195 common/mlx5: fix netlink buffer allocation from stack
The buffer size to receive netlink reply messages is relatively
large (32K), and it is allocated on the stack and it might
break in application is using smaller per-thread stacks.
This patch allocates temporary buffer from heap.

Fixes: ccdcba53a3 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:57 +02:00
Viacheslav Ovsiienko
e9a8ac59b6 common/mlx5: fix MAC addresses assert
The MLX5 device supports up to MLX5_MAX_MAC_ADDRESSES (256) MAC
addresses.  The code flushes all MAC devices.

If DPDK is compiled with MLX5_DEBUG this would an assert.
PANIC in mlx5_nl_mac_addr_flush():
line 775	assert "(size_t)(i) < sizeof(mac_own) * 8" failed

The root cause is that mac_own is a pointer and is being used as
a bitmap array. The sizeof(mac_own) would therefore be 64 but the
number of entries to be flushed would be 256.

There is a whole set of asserts in MLX5 netlink code with
the same bug; that should just be changed into proper error checks.

Fixes: 8e46d4e18f ("common/mlx5: improve assert control")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:57 +02:00
Suanming Mou
a95decbc9d net/mlx5: fix shared flow counter lookup
Currently, the shared counter search uses the wrong nested index which
is used by the pool index. The incorrect nested index using causes the
search go to incorrect counter pool is not existed.

Add the counter index to fix the incorrect nested use case.

Fixes: 4001d7ad26 ("net/mlx5: change Direct Verbs counter to indexed")

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:57 +02:00
Bing Zhao
25a59a3076 net/mlx5: fix doorbell bitmap management offsets
The doorbell record is organized with page and bitmap. When some new
doorbell needs to be associated with a queue, the bit will be set
in the bitmap to indicate the corresponding doorbell occupied. A
counter is used to record the number of doorbell occupied to speed
up the searching.
If the number reaches the maximal value of a pre-defined number of a
page, a new page will be allocated. If not, then the bitmap will be
checked to find a free one.
The LSHIFT and OR (AND NOT) operations are used to update the bitmap
of a page. But 1 will be treated as a signed integer when compiling.
When the shift number is 31, the shifted value will be considered as
negative. Then a wrong extension will be done when setting it to a
64-bits variable. All the upper 32-bits will be set to 1 by such
extension.
Then a wrong offset value will be calculated because of this. The
next 64 bits will be also treated as the bitmap and get corrupted
through the bit set operation.
The immediate value 1 needs to be used as 64 bits width explicitly.

Fixes: 21cae8580f ("net/mlx5: allocate door-bells via DevX")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:57 +02:00
Suanming Mou
d71d5b949c net/mlx5: fix Verbs counter pool allocation
When create the Verbs flows with counter, randomly SEGSEV will also
comes. The reason is that the counter pool memory is not allocated
sufficiently and initialized correctly in Verbs case.

As the mlx5_flow_counter array member is moved out of the counter pool
struct, the counter pool memory layout currently contain implicitly
with mlx5_flow_counter, mlx5_age_param(if the pool is an age pool),
mlx5_flow_counter_ext(if the pool is a none batch pool). When allocate
the pool memory, the pool size should be calculated based on the pool
type accordingly.

Currently, for Verbs counter pool, both mlx5_flow_counter and
mlx5_flow_counter_ext need to be taken into account in the pool size.
And the pool type should also be initialized as CNT_POOL_TYPE_EXT.

This patch add the missing size and type for the Verbs counter pool.

Fixes: 8d93c830e4 ("net/mlx5: modify ext-counter memory allocation")

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:57 +02:00
Ting Xu
632c7b6edc net/iavf: fix RXDID setting for Rx queue
CVL kernel PF configures all reserved queues for VF, including
Rx queue RXDID. The number of reserved queues is the maximum
between Tx and Rx queues. If the number of the enabled Rx queues
is less than that of reserved queues, required RXDID will only
be set for those enabled, but default value (0) is set for others.
However, RXDID 0 (legacy 16byte descriptor) is not supported now,
PF will return error when configuring those disabled VF queues.

In this patch, required RXDID is set for all reserved Rx queues,
no matter enabled or not. In this way, PF will configure Rx
queues correctly without reporting error.

Fixes: b8b4c54ef9 ("net/iavf: support flexible Rx descriptor in normal path")

Signed-off-by: Ting Xu <ting.xu@intel.com>
Tested-by: Xiaoxiao Zeng <xiaoxiaox.zeng@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-18 20:35:57 +02:00
Shougang Wang
da7018ec29 net/i40e: fix queue region in RSS flow
This patch fixes the issue that the queue region does not
take effect due to incorrectly setting the flow type.

Fixes: ecad87d223 ("net/i40e: move RSS to flow API")
Cc: stable@dpdk.org

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Tested-by: Lunyuan Cui <lunyuanx.cui@intel.com>
2020-05-18 20:35:57 +02:00
Simei Su
4211cc0e92 net/ice/base: fix flow director rule passthrough mode
This patch adds support for FDIR passthrough mode. When FDIR rule
hits, FDIR just forward this packet to the next stage filter.

Fixes: 55daca4e45 ("net/ice/base: change function to static")

Signed-off-by: Simei Su <simei.su@intel.com>
Tested-by: Xiaoxiao Zeng <xiaoxiaox.zeng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-18 20:35:57 +02:00
Mike Baucom
86015ee3ad net/bnxt: fix allocation of ULP context
Fix to allocate bnxt ulp context when TRUFLOW is enabled.
This patch reduces the size of struct bnxt.

Fixes: 313ac35ac7 ("net/bnxt: support ULP session manager init")

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-18 20:35:57 +02:00
Kalesh AP
86421846cc net/bnxt: fix storing MAC address twice
We are maintaining MAC address twice which is unnecessary.
This patch removes the copy which helps reduce size of bnxt structure.

Fixes: b7778e8a1c ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-18 20:35:57 +02:00
Ajit Khaparde
39395b9d41 net/bnxt: fix using RSS config struct
There is no need to maintain local copy.
This helps reduce the size of the bnxt structure.

Fixes: fcc0aa1edc ("net/bnxt: add RSS hash configuration")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2020-05-18 20:35:57 +02:00
Ajit Khaparde
e8fe0e067b net/bnxt: fix allocation of PF info struct
Fixes: 804e746c7b ("net/bnxt: add hardware resource manager init code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-05-18 20:35:57 +02:00
Ajit Khaparde
986fa3ba83 net/bnxt: fix allocation of link info struct
Dynamically alloc link info structure.

Fixes: 1d0704f4d7 ("net/bnxt: add device configure operation")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-05-18 20:35:57 +02:00
Ajit Khaparde
1e2f8aca2c net/bnxt: fix allocation of flow stat related structs
Consolidate flow stat related structs for performance improvement.
The intention of this patch is to reduce the size struct bnxt which
had grown because of recent changes and was impacting performance.

Fixes: 02a95625fe ("net/bnxt: add flow stats in extended stats")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-05-18 20:35:57 +02:00
Ajit Khaparde
96477b5dd5 net/bnxt: fix allocation of COS queue info
Fixes: 698aa7e953 ("net/bnxt: add code to determine the Tx COS queue")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-05-18 20:35:57 +02:00
Ajit Khaparde
205b742952 net/bnxt: fix allocation of LED config info
Dynamically allocate bnxt_led_cfg.
This helps reduces memory footprint of struct bnxt.

Fixes: bb81e07323 ("net/bnxt: support LED on/off")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-05-18 20:35:57 +02:00
Ajit Khaparde
4939f374ad net/bnxt: fix error log for command timeout
Log the command sequence number to aid debug in case of a
FW command timeout.

Fixes: 804e746c7b ("net/bnxt: add hardware resource manager init code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2020-05-18 20:35:57 +02:00
Rasesh Mody
05ccc9d8a9 net/qede: fix port reconfiguration
This patch fixes deallocation of all fastpath resources unconditionally,
when re-configuring the device. When re-allocating resources PMD depends
on application to explicitly setup the Rx/Tx queue.

Deallocation of all the resources is only required if the Rx/Tx queue
configuration changes. For other scenarios like KNI MTU change we'd keep
existing configuration.

Fixes: 8de0c42019 ("net/qede: fix odd number of queues usage in 100G mode")
Fixes: dd28bc8c6e ("net/qede: fix VF port creation sequence")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-18 20:35:57 +02:00
Rasesh Mody
a60704d1ac net/qede: fix assignment of Rx/Tx handlers
Fix to assign dummy Rx/Tx handlers in dev_stop.
For MTU set, assignment of the appropriate Rx/Tx handlers will be
handled by dev_start/dev_stop.

Fixes: 81f8804992 ("net/qede: enhance Rx CPU utilization")
Fixes: 8de0c42019 ("net/qede: fix odd number of queues usage in 100G mode")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-18 20:35:57 +02:00
Marvin Liu
f50560a54b net/virtio: fix unexpected event after reconnect
Event notification should be disabled after virtqueue initialization and
enabled by calling rte_eth_dev_rx_intr_enable later. When virtio user
device reconnecting to vhost, virtqueue_disable_intr should be called to
disable event notification.

Fixes: 6ebbf4109f ("net/virtio-user: fix packed ring server mode")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-18 20:35:57 +02:00
Marvin Liu
e49247b9da net/virtio: remove duplicated AVX512 check
Runtime checks for vectorized datapath are organized into device
configuration function. Remove duplicated check in device init
function.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-18 20:35:57 +02:00
Chenxu Di
5037d2e076 net/i40e: fix boundary check in RSS config
This patch fixes (out-of-bounds read) coverity issue.

Coverity issue: 357699, 357694
Fixes: feaae285b3 ("net/i40e: support hash configuration in RSS flow")

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
2020-05-18 20:35:57 +02:00
Xiaoyun Wang
72babbc001 net/hinic: optimize RSS RETA table update
Before updating RSS indirection table, firstly determine whether
rq num in RETA table is legal, if it is invalid(such as exceeding
the maximum rxq num), driver will not update hw indirection
table and return fail.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-18 20:35:57 +02:00
Xiaoyun Wang
f372a65f70 net/hinic: update code style
The patch modifies the comments of structures or functions, and adds
space for comments, removes extra empty lines and adjusts the
print level for VF branches in one sdk interface.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-18 20:35:57 +02:00
Xiaoyun Wang
ee750eaa14 net/hinic: fix Tx mbuf length while copying
When copy a mbuf to a new dst_mbuf, the pkt_len member of
dst_mbuf needs to be updated.

Fixes: 076221c8fe ("net/hinic: add Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-18 20:35:57 +02:00
Xiaoyun Wang
a2177d2e84 net/hinic: fix queues resource free
Adds tx_queues and rx_queues non-null judgment before free tx or
rx resources, because some app may set tx_queues or rx_queues to
be null before call free resource interfaces, which may cause
a segfault.

Fixes: 64727024d2 ("net/hinic: add device initialization")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-18 20:35:57 +02:00
Stephen Hemminger
eb49f1671f net/vmxnet3: handle bad host framing
The VMXNet3 protocol has a start-of-packet (SOP) and end-of-packet (EOP)
marker. If there was a bug where mbuf arrived without SOP the code that
chains the mbuf would dereference a null pointer.
Also, record any mbuf's dropped in statistics.

Although did the initial code no longer have access to VMware.
Compile tested only!

Coverity issue: 124563
Fixes: 8ee787ce80 ("vmxnet3: remove asserts that confuse coverity")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Yong Wang <yongwang@vmware.com>
2020-05-18 20:35:57 +02:00
Dekel Peled
ff55182ce3 net/mlx5: fix VLAN flow action with wildcard VLAN item
Previous patch added support of VLAN item without VLAN ID value,
i.e. using wildcard VLAN item, to match VLAN with any VLAN ID.
The implication on VLAN actions was not taken into consideration.
VLAN actions (e.g. push vlan) use the VLAN ID value in the VLAN item,
and expect it to be valid.

This patch updates function flow_dev_get_vlan_info_from_items() to
check the VLAN item contents before trying to use it.

Fixes: 92818d839e ("net/mlx5: fix match on empty VLAN item in DV mode")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-18 20:35:57 +02:00
Matan Azrad
5af61440dd net/mlx5: fix flow counter container resize
The design of counter container resize used double buffer algorithm in
order to synchronize between the query thread to the control thread.
When the control thread detected resize need, it created new bigger
buffer for the counter pools in a new container and change the container
index atomically.
In case the query thread had not detect the previous resize before a new
one need was detected by the control thread, the control thread returned
EAGAIN to the flow creation API used a COUNT action.

The rte_flow API doesn't allow unblocked commands and doesn't expect to
get EAGAIN error type.

So, when a lot of flows were created between 2 different periodic
queries, 2 different resizes might try to be created and caused EAGAIN
error.
This behavior may blame flow creations.

Change the synchronization way to use lock instead of double buffer
algorithm.

The critical section of this lock is very small, so flow insertion
rate should not be decreased.

Fixes: ebbac312e4 ("net/mlx5: resize a full counter container")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-18 20:35:57 +02:00
Rasesh Mody
d789705873 net/qede: fix link state configuration
Move link state enable/disable to dev_start() and dev_stop()
respectively. This will ensure when devices are stopped,
link status will be appropriately shown as down.

Fixes: dd28bc8c6e ("net/qede: fix VF port creation sequence")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-18 20:35:57 +02:00
Shougang Wang
670af291ea net/i40e: fix RSS rule creation with L2 payload
This patch fixes the issue that failed to create an RSS rule with type
L2-payload.

Fixes: feaae285b3 ("net/i40e: support hash configuration in RSS flow")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
2020-05-18 20:35:57 +02:00
Jeff Guo
aeef461fd6 net/iavf: fix RSS algorithm configuration
When configure RSS rule, the etherdev rss hash function type should be
mapped to the corresponding virtchnl rss algorithm type.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-18 20:35:57 +02:00
Jeff Guo
56e15e83b8 common/iavf: fix RSS algorithm type
A typo need to be fixed for Simple XOR algorithm configuration.

Fixes: 57094d5943 ("common/iavf: support advanced RSS input set change")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-18 20:35:57 +02:00
Kalesh AP
b27f9e9005 net/bnxt: support 200G link speed
When the driver is loaded on a 200G NIC, the port speed is not
displayed correctly. Parse the 200G speed before displaying it.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-18 20:35:57 +02:00
Shiri Kuzin
4c204fe5e5 common/mlx5: disable relaxed ordering in unsuitable CPUs
Relaxed ordering is a PCI optimization that enables reordering
reads/writes in order to improve performance.

Relaxed ordering was enabled for all processors causing
a degradation in performance in Haswell and Broadwell processors
that don't support this optimization.

In order to avoid that we check if the processor is Haswell
or Broadwell and if so we disable relaxed ordering.

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:57 +02:00
Shiri Kuzin
ffd5b302ba common/mlx5: fix relaxed ordering count object
In order to improve performance relaxed ordering was enabled
when creating count object using Devx.

Currently rte enables this optimization by default when using
Devx.

This causes an issue when using firmware that does not have this
capability causing a count object failure.

In order to fix this issue a check of firmware capabilities was
added before enabling relaxed ordering.

Fixes: 53ac93f71a ("net/mlx5: create relaxed ordering memory regions")

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Shiri Kuzin
2b152cc97c common/mlx5: fix relaxed ordering support detection
Relaxed ordering is a PCI optimization that allows reordering
of reads/writes in order to improve performance.

In order to enable this optimization only when relaxed ordering
is supported, it is checked if IBV_ACCESS_RELAXED_ORDERING is
defined in verbs.h.

Since IBV_ACCESS_RELAXED_ORDERING is an enum and not
defined relaxed ordering wasn't enabled even when supported.

This issue is fixed by using AUTOCONF to check if relaxed
ordering is supported and disabling only if it isn't.

Fixes: 53ac93f71a ("net/mlx5: create relaxed ordering memory regions")

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Shougang Wang
103e2c0226 net/i40e: fix flow director MAC rule creation
This patch fixes the issue that the flow which both source MAC mask
and destination MAC mask are all zeros can not be created.

Fixes: ea0c22fd82 ("net/i40e: enable MAC address as flow director input set")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
2020-05-18 20:35:56 +02:00
Guinan Sun
861ca8b1e9 net/ixgbe: fix statistics in flow control mode
The register autoneg can't be updated synchronously with flow control
mode setting in the state of port start, so NIC statistics error occurs.
AUTO_NEG Advt register should be updated by ixgbe_setup_fc() when
enabling flow control.
The patch fixes the issue.

Fixes: a524f550da ("net/ixgbe: fix flow control mode setting")
Cc: stable@dpdk.org

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-05-18 20:35:56 +02:00
Dekel Peled
4240b11e7b common/mlx5: fix umem buffer alignment
The value MLX5_WQE_BUF_ALIGNMENT is defined as 512.
In some cases this alignment size is not adequate, which results in
memory registration that is not accepted by FW.
The result error can be "page_offset is not aligned to page_size/64,
bad umem_offset" (syndrome 0x357275).

This patch updates the definition to match the running system.

Fixes: 18a68e046b ("net/mlx5: fix DevX Rx queue memory alignment")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Dekel Peled
d237d22fbe net/mlx5: prefer DevX API to create Rx objects
Currently, DevX API is used to create Rx objects (RQ, RQT, TIR) only
if LRO or hairpin features are enabled on this RQ.

This patch uses DevX API by default, if DevX is supported and can be
used. Otherwise, Verbs API is used.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Ophir Munk
e09d350eb5 common/mlx5: remove DevX dependency on Verbs and DV
File mlx5_devx_cmds.c should contain pure DevX calls. It must be OS
agnostic and not include any references to ibv or dv structs (defined in
ibverbs and rdma-core linux libraries).  This commit replaces all ibv
and dv references with 'void *'.  Specifically, the following struct
were replaced:
1. struct ibv_context *
2. struct ibv_qp *
3. struct mlx5dv_devx_cmd_comp *

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Ophir Munk
64c563f8b1 common/mlx5: mark internal symbols
Move mlx5 symbols in the map file to the INTERNAL section and add
__internal tags to their definitions.
Those symbols were exported in 20.02 and now (20.05) they are removed.
Avoid ABI comparison issues between 20.05/20.08 and 20.02 by adding the
suppress_file directive to libabigail.abignore file. This directive will
prevent loading mlx5 common symbols and no comparison will be performed.

In addition move symbols from the EXPERIMENTAL section to the INTERNAL
section.

Fixes: 7b4f1e6bd3 ("common/mlx5: introduce common library")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Leyi Rong
717ca21131 net/iavf: remove useless assignment in Rx
Fix coverity defects of unused value.

Coverity issue: 357745, 357769
Fixes: b8b4c54ef9 ("net/iavf: support flexible Rx descriptor in normal path")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-18 20:35:07 +02:00
Alvin Zhang
23d8a6648f net/igc: fix boundary checks for RSS
Fix some out-of-bounds memory issues, they may lead to wrong results
or affect application stability.

Coverity issue: 357759, 357713
Fixes: bd3fcf0d0f ("net/igc: support RSS")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
2020-05-18 20:35:07 +02:00
Alvin Zhang
3a19eeb0c3 net/e1000: fix port hotplug for multi-process
Enable detach device on secondary process.

Fixes: b9eee2cb8c ("e1000: support port hotplug")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Tested-by: Jianwei Mei <jianweix.mei@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
2020-05-18 20:35:07 +02:00
Pavan Nikhilesh
03a4e635cf mempool/octeontx2: mark internal symbols
Move the internal symbols to INTERNAL sections so that any
change in them is not reported as ABI breakage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-05-18 17:29:24 +02:00
Pavan Nikhilesh
8614cb6afd common/octeontx2: mark internal symbols
Move the internal symbols to INTERNAL sections so that any
change in them is not reported as ABI breakage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-05-18 17:29:20 +02:00
Jay Zhou
b7aa3b5b88 crypto/virtio: enable OOP feature flag
Since it will check the feature mask before running out-of-place
test cases and the virtio-crypto device supports OOP_LB_IN_LB_OUT mode.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-17 16:10:44 +02:00
Anoob Joseph
caeba5062c crypto/octeontx: improve symmetric session-less path
Cleanup sessionless code path and improve error handling.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Ankur Dwivedi
32b8f26adf crypto/octeontx: enable non-byte aligned data
The OCTEON TX crypto PMD supports non-byte aligned data as
input for SNOW and ZUC algos. Adding the same to the feature list.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Anoob Joseph
96330d215f crypto/octeontx2: improve symmetric session algos check
Session configure should return -ENOTSUP in case of unsupported xform
requests. Moving the validation of combinations out of cpt, as the
feature support will not be same across OCTEON TX and OCTEON TX2.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Ankur Dwivedi
51f3e107ac crypto/octeontx2: enable non-byte aligned data
The OCTEON TX2 crypto PMD supports non-byte aligned data as
input for SNOW and ZUC algos. Adding the same to the feature list.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Tejasree Kondoj
120d13db35 net/octeontx2: update max packet length for inline IPsec
Update max packet length supported by Inline IPsec Rx to
NIX_MAX_FRS

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
2020-05-17 16:10:44 +02:00
Anoob Joseph
18839177b8 common/octeontx2: fix port ID bound check
Fix out of bounds access.

Coverity issue: 354230, 354231
Fixes: f44e716377 ("net/octeontx2: add security session operations")
Fixes: 3fe4d07d16 ("crypto/octeontx2: enable CPT to share QP with ethdev")
Cc: stable@dpdk.org

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Yunjian Wang
c40b4fcd98 crypto/caam_jr: fix IRQ functions return type
The caam_jr_enable_irqs() and caam_jr_disable_irqs() methods maybe return a
negative error. So use int instead of uint32_t int the functions.

Fixes: e7a45f3cc2 ("crypto/caam_jr: add UIO specific operations")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
2020-05-17 16:10:44 +02:00
Yunjian Wang
61552661e2 crypto/caam_jr: fix check of file descriptors
Zero is a valid fd. It will fail to check the fd if the fd is zero.
The "job_ring->uio_fd" is an fd, so define it as "int".

Fixes: e7a45f3cc2 ("crypto/caam_jr: add UIO specific operations")
Fixes: a5e1018d5e ("crypto/caam_jr: add routines to configure HW")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
2020-05-17 16:10:44 +02:00
Akhil Goyal
eef9e0412a drivers/crypto: fix build with -fno-common
gcc 10 defaults to -fno-common and as a result when linking
with crypto drivers:

drivers/librte_pmd_dpaa_sec.a(crypto_dpaa_sec_dpaa_sec.c.o):
(.bss+0x4): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here

drivers/librte_pmd_dpaa2_sec.a(crypto_dpaa2_sec_dpaa2_sec_dpseci.c.o):
(.data+0x0): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here

This patch fixes the blunt workaround in the following commit.

Fixes: 50b03f3b8e ("drivers/crypto: disable gcc 10 no-common errors")

Bugzilla ID: 469
Cc: stable@dpdk.org

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-15 19:43:17 +02:00
Yuri Chipchev
1c4975d6df event/dsw: fix enqueue burst return value
The returned number from rte_event_enqueue_*()
wouldn't include events marked with RTE_EVENT_OP_RELEASE.

Fixes: 1c8e3caa3 ("event/dsw: add event scheduling and device start/stop")
Cc: stable@dpdk.org

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
2020-05-14 09:15:37 +02:00
Maxime Coquelin
9036180f61 net/virtio: fix AVX512 datapath selection
The AVX512 packed ring datapath selection was only done
at build time, but it should also be checked at runtime
that the CPU supports it.

This patch add a CPU flags check so that non-vectorized
path is selected at runtime if AVX512 is not supported.

Also in meson build enable vectorization only for relevant file, not for
all driver.

Fixes: ccb10995c2 ("net/virtio: add election for vectorized path")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-11 23:04:33 +02:00
Xiaoyun Wang
9d441c4551 net/hinic/base: support IPv6 flow rules
The patch supports ipv6 flow rules for BGP or ICMP packets.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-11 22:27:39 +02:00
Xiaoyun Wang
13850e88a4 net/hinic: fail initialization for not supported device
If hardware mode for this card does not support nic,
the network features for this card will not be supported
and driver will be initialized failed.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-11 22:27:39 +02:00
Xiaoyun Wang
254bd849b1 net/hinic: set jumbo frame offload flag
The patch adds DEV_RX_OFFLOAD_JUMBO_FRAME flag for jumbo when set mtu.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-11 22:27:39 +02:00
Dekel Peled
563ac307a4 net/mlx5: support match on GTP flags
This patch adds to MLX5 PMD the support of matching on
GTP header item v_pt_rsv_flags.

This item is contained in 1 byte of the format:
-------------------------------------------
| bit   | 0 - 2   | 3  | 4   | 5 | 6 | 7  |
|-----------------------------------------|
| value | Version | PT | Res | E | S | PN |
-------------------------------------------

Matching is supported only for GTP flags E, S, PN.
Therefore values 0 to 7 are supported.

Mask must be set accordingly:
... gtp v_pt_rsv_flags is 1 v_pt_rsv_flags mask 0x07 ...

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Alexander Kozyrev
776aec28fc net/mlx5: fix Tx queue release debug log timing
Program received signal SIGSEGV, Segmentation fault.
0x00000000008ef7c4 in mlx5_tx_queue_release (dpdk_txq=0x17ce01680) at
drivers/net/mlx5/mlx5_txq.c:302
301 mlx5_txq_release(ETH_DEV(priv), i);
302 DRV_LOG(DEBUG, "port %u removing Tx queue %u from list",
303         PORT_ID(priv), txq->idx);
The problem is txq is freed inside the mlx5_txq_release() function
and no longer valid in the debug log right after this invocation.
Move the debug log before the mlx5_txq_release() function to fix this.

Fixes: a6d83b6a92 ("net/mlx5: standardize on negative errno values")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Michael Baum
6f155c0b9d net/mlx4: fix drop queue error handling
The function mlx4_drop_get() creates pointer to a struct mlx4_drop and
if needed allocates by rte_malloc.

If the allocation is failed the function goes to label “error”, and
there does dereference to a null pointer.

Skip resources cleaning when the memory allocation is failed.

Coverity issue: 146206
Coverity issue: 146146
Fixes: d3a7e09234 ("net/mlx4: allocate drop flow resources on demand")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Michael Baum
c8f0abe7f8 net/mlx5: fix meter color register consideration
The mlx5_flow_get_reg_id() function translates tag ID to register
from the registers that are supported and available for use. The
user does not know which register is available at a time and therefore
there is an array that represents mapping to the available registers.
Usually the free registers are continuous in the flow_mreg_c array but
sometimes the mtr_color_reg register is between them and it must be
skipped and the next register returned, in which case the function
returns the mapping of the next entity in the array.

When the function reads from the next entity in the array, it does not
check whether such an entity exists and in some situation invalid access
to memory occurs beyond the array boundaries.

So, when all the registers are valid from HW perspective and the meter
color register is not the default, the tag id 5 causes an out of bound
access.

Validate registers availability when meter color register is not the
default.

Coverity issue: 146355
Fixes: 792e749e92 ("net/mlx5: fix register usage in meter")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Raslan Darawsheh
8a2e026add net/mlx5: fix matching for UDP tunnels with Verbs
When creating flow rule with zero specs it will cause
matching all UDP packets like following:
 eth / ipv4 / udp / vxlan / end
Such rule will match all udp packets.

This change the behavior to match the dv flow engine
which will automatically set the match on relative
outer UDP port if the user didn't specify any.

Fixes: 84c406e745 ("net/mlx5: add flow translate function")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Dekel Peled
92818d839e net/mlx5: fix match on empty VLAN item in DV mode
In existing implementation, using wild card VLAN item is not allowed.
A VLAN item in flow pattern must include VLAN ID (vid) value.
This obligation contradict the flow API specification [1].

This patch updates the VLAN item validation and translation, to allow
wild card VLAN item, without VLAN ID value.
User guide and release notes are updated accordingly.

[1]
commit 40513808b165 ("doc: refine ethernet and VLAN flow rule items")

Fixes: 00f75a4057 ("net/mlx5: fix VLAN match for DV mode")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-11 22:27:39 +02:00
Gaetan Rivet
8459f5ab32 net/ring: fix device pointer on allocation
When a net_ring device is allocated, its device pointer is not set
before calling rte_eth_dev_probing_finish, which is incorrect.

The following:
  commit 96cb195211 ("net/ring: use EAL APIs in PMD specific API")
  commit a6992e9610 ("net/ring: set ethernet device field")

already fixed the same issue in 17.08, which was fine at the time.
Adding the hook rte_eth_dev_probing_finish() however created this bug,
as the eth_dev exposed when this hook is executed is expected to be
complete.

Remove the prior attempts to fix the issue in rte_pmd_ring_probe() and
write the pointer properly in do_eth_dev_ring_create().

Fixes: fbe90cdd77 ("ethdev: add probing finish function")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <grive@u256.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-11 22:27:39 +02:00
Raslan Darawsheh
53601aefc4 net/tap: fix build for glibc < 2.24
When trying to compile with glibc < 2.24 that doesn't
support SOL_NETLINK it will cause compilation failure:

drivers/net/tap/tap_netlink.c:70:17: error:
 'SOL_NETLINK' undeclared (first use in this function)
  setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, &one, sizeof(one));

The glibc commits adds the SOL_NETLINK support:
https://github.com/bminor/glibc/commit/f9b437d5efce93800b51ad2a437c8b1c9

Fixes: 647909bcf3 ("net/tap: use netlink extended ack support")

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-11 22:27:39 +02:00
Sunil Kumar Kori
241546237c net/octeontx2: fix minimum length to SMQ config
NIX exposes NIX_AF_SMQ(0..511)_CFG to configure minimum length
of the packet which is being used for zero padding if packet is
less than configured value.

Setting it to default minimum length i.e. 60 bytes.

Fixes: ec8ddd4fb1 ("net/octeontx2: restructure TM helper functions")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 22:27:39 +02:00
Jerin Jacob
251dab27d5 common/octeontx2: upgrade mbox definition to version 7
Upgrade mailbox definitions to version 0x0007 of kernel AF driver.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 22:27:39 +02:00
Rasesh Mody
80a73194de net/bnx2x: add Rx descriptor MTU segment limitation
Add Rx descriptor limit for number of segments per MTU.
PMD doesn't support Jumbo Rx scatter gather hence set 1 segment per
MTU. Some applications can adjust mbuf_size based on this value.
For others PMD detects the condition where Rx packet length cannot
be held by configured mbuf size and logs the message.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-11 22:27:39 +02:00
Qi Zhang
0beafe7b04 net/ice: fix variable initialization
Fix coverity defect due to uninitialized scalar variable.

Coverity issue: 357763
Fixes: 47d460d632 ("net/ice: rework switch filter")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-11 22:27:39 +02:00
Alvin Zhang
82d806b7ec net/igc: remove useless log
Some log will always be printed when the device is initialized
and shut down, which will mislead users and should be removed.

Fixes: 746664d546 ("net/igc: support flow API")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-11 22:27:39 +02:00
Wei Zhao
55f0335e90 net/ice/base: fix PPPoE-IPv6 dummy packet
The dummy packet for pppoe-ipv6 has an error, we should
use 0x3b for next header in ipv6 header in the dummy packet,
or some case can not be download, such as:

"eth / pppoes seid is 3 / pppoe_proto_id is 0x0057 /
end actions vf id 1 / end"

Fixes: 55d61fb27a ("net/ice/base: add PPPoE IPv6 dummy packet")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Nannan Lu <nannan.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Jeff Guo
ba37f7bf11 net/iavf: fix flow API error logs
When processing a rte flow, such as creating a parse engine, or
creating or destroying a RSS rule, if they are failed, they all
need to construct the flow error structure before return the error
message back to app. If not so, it will cause app crash when
app printing the message out of a flow error.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")
Fixes: ff2d0c345c ("net/iavf: support generic flow API")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Phil Yang
d70a869db2 net/ixgbe: fix link state timing on fiber ports
In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback
to ixgbe_dev_setup_link_thread_handler() is scheduled which should
try to set up the link and clear the flag afterwards. This flag works
as a guard variable between threads.

To avoid potential race condition between threads, set the
IXGBE_FLAG_NEED_LINK_CONFIG flag only when there is no link thread
running.

Bugzilla ID: 388
Fixes: 819d0d1d57 ("net/ixgbe: fix blocking system events")
Cc: stable@dpdk.org

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Lijian Zhang <lijian.zhang@arm.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-11 22:27:39 +02:00
Jeff Guo
bd8cf9c0b0 net/iavf: fix input set for RSS hash
Since some specific RSS hash type need to combine with the protocol
hash type when configure a RSS hash rule, so add the corresponding
input set to support these case for iavf hash.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
7e2c3f1436 net/dpaa2: support additional link speeds
This patch adds the support for additional link speed
supported by LX2160A platforms.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
231366ba5f bus/fslmc: fix size of qman fq descriptor
Correct the qman_fq_desc as per the HW defined size

Fixes: 6fef517e17 ("bus/fslmc: add qman HW fq query count API")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Jun Yang
7a3a9d5660 net/dpaa2: fix congestion ID for multiple traffic classes
When using a single TC, flow id is same as congestion group id.
However in case of multiple traffic classes, same flow id values
are used within each traffic class, which causes incorrect
traffic behavior e.g. halting of traffic.
This patches changes to use the cgid as the index which works
for single as well as multiple traffic classes.

Fixes: 13b856ac02 ("net/dpaa2: support taildrop on frame count basis")
Cc: stable@dpdk.org

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
46dca1d544 net/dpaa2: reduce logs in Rx queue count
Changing them to DP as it is impacting l3fwd-power apps

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
7a5823182d net/dpaa2: support UDP destination port based muxing
This change adds DPDMUX support to bifurcate traffic on
the basis of UDP destination port.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
d527f5d9bb drivers: enhance DPAA2 portal allocation error logs
Update the portal allocation failure log to print the thread id
as well.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
e35ead3379 net/dpaa2: add default Rx/Tx configuration
This patch adds default/preferred rx/tx params in dev info,
specially the advertised burst size.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
2f41c93034 net/dpaa2: do not prefetch annotation for physical mode
When IOVA is physical address do not prefetch the annotation
of the next frame, as there is a cost involved there to convert
the physical address to virtual address.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Rohit Raj
7e6ecac281 net/dpaa2: fix 10G port negotiation
Fixed 10G port negotiation issue with another 10G/non 10G port.

When running testpmd with 10G interfaces on 10BaseT interface
on LS2088ARDB, the ports were showing link as down.

This was identified to be caused by the setting of link as down
during config.
Also, the line rate was not being updated in device link params,
thus having the incorrect link speed in status (as 0).

Fixes: c5acbb5ea2 ("net/dpaa2: support link status event")
Cc: stable@dpdk.org

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Apeksha Gupta
27ede02945 bus/fslmc: fix dereferencing null pointer
Fixes: 6fef517e17 ("bus/fslmc: add qman HW fq query count API")
Cc: stable@dpdk.org

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Simei Su
f002ee9c8e net/ice/base: fix flow director rule completion report
IAVF FDIR needs to check program status from FD completion descriptors
for both successful and failed case, rather than only ask for completion
on error. This patch corrects completion report value so that the called
can determine whether to report completion on error or other cases.

Fixes: 55daca4e45 ("net/ice/base: change function to static")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Ajit Khaparde
cfa9e98d3c net/bnxt: fix FW version query
bnxt_fw_version_get is not indicating the complete FW version.
Fix it to indicate complete version string.

Fixes: e2652b0a20 ("net/bnxt: support get FW version")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Ajit Khaparde
4bcc5ccfe6 net/bnxt: fix uninitialized variable
Fix uninitialized variable error reported by coverity.

Coverity issue: 357771
Fixes: 69c410b844 ("net/bnxt: support EM/EEM")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
2020-05-11 22:27:39 +02:00
Kishore Padmanabha
45e5e9518c net/bnxt: fix overrun of ULP device params array
Fix a buffer overrun issue spotted by coverity while accessing
the array ulp_device_params.
Note that the issue was observed in an internal Coverity scan.

Fixes: 313ac35ac7 ("net/bnxt: support ULP session manager init")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Marvin Liu
b62c5f0df5 net/virtio: fix 32-bit build with clang 6
Clang 6.0.0 will undefine function _mm512_maskz_set1_epi64 on i686
target. Fix it by replacing the function with _mm512_set4_epi64 when
doing 32-bit build.

Warning message during build:
../drivers/net/virtio/virtio_rxtx_packed_avx.c:385:19: warning:
implicit declaration of function '_mm512_maskz_set1_epi64' is invalid
in C99 [-Wimplicit-function-declaration]

Fixes: 77d66da838 ("net/virtio: add vectorized packed ring Rx")

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-11 22:27:39 +02:00
Marvin Liu
01996a034a net/virtio: fix crash when device reconnecting
When doing virtio device initialization, virtqueues will be reset in
server mode if ring type is packed. It will cause issue because queues
have been freed in the beginning of device initialization.

Fix this issue by checking whether device has been initialized before
reset. If device hasn't been initialized, there's no need to reset
queues.

Fixes: 6ebbf4109f ("net/virtio-user: fix packed ring server mode")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-11 22:27:39 +02:00
Kalesh AP
2f8cc21f09 net/bnxt: fix TQM ring context memory size
The current formulas to calculate the TQM slow path and fast path ring
context memory sizes are not quite correct. TQM slow path entry is
array index 0 of ctx->tqm_mem[]. The other array entries are for fast
path. Fix these sizes according to firmware spec. for 57500 and newer
chips.

Fixes: cc5e26b8ef ("net/bnxt: increase TQM entry allocation")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Kalesh AP
fd14f72296 net/bnxt: fix number of TQM ring
Newer firmware advertises the number of TQM rings to allocate
context memory for.  Use the firmware specified value and fall back
to the old value derived from "bp->max_q" if it is not available.

Fixes: f8168ca0e6 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Asaf Penso
6e3a4595a7 net/mlx5: support 200G link speed
Signed-off-by: Asaf Penso <asafp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
647909bcf3 net/tap: use netlink extended ack support
In recent Linux kernels, there is support for extended acknowledgment
to netlink messages. This is quite useful for diagnosing errors
in configuration in the kernel with TAP.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
6d81801d84 net/tap: simplify netlink send/receive functions
The tap_nl_recv() function does not need to use the full
complex recvmsg() system call, basic recv() will work here.

Ditto for tap_nl_send() full sendmsg is not needed.

Add logic to retry in case EINTR rather than forcing
error handling back in driver or worse to ethdev API.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
8451387df2 net/tap: fix crash in flow destroy
The TAP driver does not initialize all the elements of the rte_flow
structure. This can lead to crash in rte_flow_destroy.

(gdb) where
    flow=0x100e99280, error=0x0)
    at drivers/net/tap/tap_flow.c:1514

(gdb) p remote_flow
$1 = (struct rte_flow *) 0x6b6b6b6b6b6b6b6b

Which is here:
static int
tap_flow_destroy_pmd(struct pmd_internals *pmd,
		     struct rte_flow *flow,
		     struct rte_flow_error *error)
{
	struct rte_flow *remote_flow = flow->remote_flow;
...
	if (remote_flow) {
		remote_flow->msg.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;

Simplest fix is to use rte_zmalloc() so remote_flow and other fields
are always set at zero.

Fixes: 2bc06869cd ("net/tap: add remote netdevice traffic capture")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-11 22:27:39 +02:00
Junyu Jiang
1f8672be42 net/ice: fix crash in switch filter
The number of queues in queue group should be checked before
using it. This patch fixed the issue.

Fixes: 47d460d632 ("net/ice: rework switch filter")
Cc: stable@dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-05-11 22:27:39 +02:00
Simei Su
0f664f7d57 net/ice: support mark only action for flow director
This patch fixes issue that doesn't support mark only case.
Mark only action is equal to mark + passthru action.

Fixes: f5cafa961f ("net/ice: add flow director create and destroy")
Cc: stable@dpdk.org

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Zhihong Peng
0012111a3d net/ixgbe: fix link status synchronization on BSD
DPDK does not implement interrupt mechanism on BSD,
so force NIC status synchronization.

Fixes: dc66e5fd01 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org

Signed-off-by: Zhihong Peng <zhihongx.peng@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-11 22:27:39 +02:00
Wei Zhao
2e873cf407 net/ice/base: fix switch rule for IPsec
When we download a switch rule for ipv6 with esp payload
"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end"

if we don't add bm bit set check for tun_type, then a packet of
ipv4 with esp payload

"sendp([Ether(dst="00:00:00:00:01:00")/IP(proto=50)/ESP(spi=1)/
("X"*480)], iface="ens5f0", count=10)"

Will also go to queue index 2. And also, we need to do tun_type
check, or the second rule of following can not be download because
of rejection from switch rule download function ice_aq_sw_rules().

"eth / ipv4 / esp spi is 1 / end actions queue index 5 / end"

"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end"

Fixes: 4f11962fce ("net/ice/base: support AH ESP and NAT-T on switch")
Fixes: 99d8ba79ef ("net/ice/base: force switch to use different recipe")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Qi Fu <qi.fu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Alvin Zhang
5330b04297 net/iavf: fix link speed
If the PF driver does not support the new speed reporting capabilities
then use link_event instead of link_event_adv to get the speed.

Fixes: 48de41ca11 ("net/avf: enable link status update")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-05-11 22:27:39 +02:00
Linsi Yuan
6ebabb76a5 net/bnxt: fix possible stack smashing
We see a stack smashing as a result of defensive code missing. Once the
nb_pkts is less than RTE_BNXT_DESCS_PER_LOOP, it will be modified to
zero after doing a floor align, and we can not exit the following
receiving packets loop. And the buffers will be overwrite, then the
stack frame was ruined.

Fix the problem by adding defensive code, once the nb_pkts is zero, just
directly return with no packets.

Fixes: bc4a000f2f ("net/bnxt: implement SSE vector mode")
Cc: stable@dpdk.org

Signed-off-by: Linsi Yuan <yuanlinsi01@baidu.com>
Signed-off-by: Dongsheng Rong <rongdongsheng@baidu.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Randy Schacher
34ce841502 net/bnxt: fix build with gcc 10 default no-common
Remove the defensive compile-time checker macro.

Bugzilla ID: 468
Fixes: 8430a8b841 ("net/bnxt: add initial TruFlow core session open")

Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
c6611b77d0 net/netvsc: do not configure RSS if disabled
This fixes the problem where driver would not start if only
have a single Rx queue and multiple Txq. In that case, RSS
should stay disabled.

Fixes: 92d23a57ca ("net/netvsc: support configuring RSS parameters")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
019a28912b net/netvsc: do RSS across Rx queue only
If number of tx queues is greater than the number of rx queues;
the driver ends up allocating more channels than rx queues.
The problem is that the RSS indirection table is programmed such
that some packets will end up on a channel that would never be
polled. The fix is to limit the RSS indirection table by number
of rx queues not channels.

Fixes: 92d23a57ca ("net/netvsc: support configuring RSS parameters")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
81938ebb54 net/netvsc: manage VF port under read/write lock
With multiple channels, the primary channel may receive notification
that VF has been added or removed while secondary channel is in
process of doing receive or transmit.  Resolve this race by converting
existing vf_lock to a reader/writer lock.

Users of lock (tx/rx/stats) acquire for read, and actions like
add/remove acquire it for write.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
33fd81cdb5 net/netvsc: check vmbus ring buffer more often
Since VF notifications are handled as VMBUS notifications on the
primary channel (and not as hotplug). The channel should be checked
before deciding to use VF for Rx or Tx.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
1c33435a58 bus/vmbus: add missing barrier
The check for event ring being empty needs a barrier
to avoid any over aggressive optimization.
This is same barrier as Linux kernel.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
3a185ff42e bus/vmbus: fix comment spelling
No code change here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
672f4d127b net/netvsc: fix comment spelling
No code change here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Gaetan Rivet
94a6f2def2 net/failsafe: avoid crash on malformed ethdev
Some PMD do not respect the eth_dev API when allocating their
rte_eth_dev. As a result, on device add event resulting from
rte_eth_dev_probing_finish() call, the eth_dev processed is incomplete.

The segfault is a good way to focus the developer on the issue, but does
not inspire confidence. Instead, warn the user of the error repeatedly.

The failsafe PMD can warn of the issue and continue. It will repeatedly
attempt to initialize the failed port and complain about it, which
should result in the same developer focus but with less crashing.

Signed-off-by: Gaetan Rivet <grive@u256.net>
2020-05-11 22:27:39 +02:00
Yunjian Wang
b9663f6035 net/failsafe: fix fd leak
Zero is a valid fd. The fd won't be closed thus leading fd leak,
when it is zero.

Also the service proxy is initialized at 0. This is assuming that all of
its fields are invalid at 0. The issue is that a file descriptor at 0 is
a valid one.

The value -1 is used as sentinel during cleanup. Initialize the RX proxy
file descriptor to -1.

Fixes: f234e5bd99 ("net/failsafe: register slaves Rx interrupts")
Fixes: 9e0360aebf ("net/failsafe: register as Rx interrupt mode")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Gaetan Rivet <grive@u256.net>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
2020-05-11 22:27:39 +02:00
Pablo de Lara
0b133c36ad crypto/zuc: support IPsec Multi-buffer lib v0.54
The latest version of the Intel IPSec Multi-buffer library
adds an API to authenticate multiple buffers in parallel.
The PMD is modified to use this API, improving
performance of the ZUC-EIA3 algorithm.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-05-11 13:17:43 +02:00
Akhil Goyal
e11bdd3774 cryptodev: add feature flag for non-byte aligned data
Some wireless algos like SNOW, ZUC may support input
data in bits which are not byte aligned. However, not
all PMDs can support this requirement. Hence added a
new feature flag RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA
to identify which all PMDs can support non-byte aligned
data.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2020-05-11 13:17:43 +02:00
Kevin Traynor
50b03f3b8e drivers/crypto: disable gcc 10 no-common errors
gcc 10 defaults to -fno-common and as a result when linking
with crypto drivers:

drivers/librte_pmd_dpaa_sec.a(crypto_dpaa_sec_dpaa_sec.c.o):
(.bss+0x4): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here

drivers/librte_pmd_dpaa2_sec.a(crypto_dpaa2_sec_dpaa2_sec_dpseci.c.o):
(.data+0x0): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here

This is a blunt fix for the issue by enabling fcommon for
dpaa_sec/dpaa2_sec/caam_jr.

Bugzilla ID: 469
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-11 13:17:43 +02:00
Akhil Goyal
c08ced9a9a crypto/dpaa_sec: improve error handling
The return values in cases of errors were not
specified properly. With this patch appropriate
error numbers are returned.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 13:17:43 +02:00
Akhil Goyal
94ae7667f7 crypto/dpaa2_sec: improve error handling
The return values in cases of errors were not
specified properly. With this patch appropriate
error numbers are returned.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 13:17:43 +02:00
Adam Dybkowski
b5d704b92a common/qat: remove redundant check
This patch removed the non-essential check for NULL pointer.

Coverity issue: 357770
Fixes: c13cecf60f ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-05-11 13:17:43 +02:00
Adam Dybkowski
7277e63f59 common/qat: fix enqueue/dequeue statistics
This patch fixes enqueued and dequeued count statistics that should
contain the number of operations enqueued by the end user app
instead of the total number of QAT requests - bigger in case of
a multiple-request dynamic Huffman compression operation.

Fixes: c13cecf60f ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-05-11 13:17:43 +02:00
Kevin Traynor
6a6b5d5616 crypto/kasumi: fix extern declaration
gcc 10 defaults to fno-common and it reports:

crypto_kasumi_rte_kasumi_pmd_ops.c.o:(.data.rel+0x0):
multiple definition of `rte_kasumi_pmd_ops';
crypto_kasumi_rte_kasumi_pmd.c.o:(.bss+0x8): first defined here

Fix by making rte_kasumi_pmd_ops extern in the header file.

Fixes: 2773c86d06 ("crypto/kasumi: add driver for KASUMI library")
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-05-11 13:17:43 +02:00
Lukasz Wojciechowski
2eaf352d3d crypto/dpaa_sec: repair memory allocations
This patch repairs 2 memory allocations issues:

1) possible leak of memory
    In cryptodev_dpaa_sec_probe() function in case of portal
    initialization failure, function exited without cleanup.

    The patch redirects flow to out label, which provides
    proper cleanup in case of error: freeing cryptodevice private
    data and releasing cryptodevice.

2) double free of cryptodev private data
    The function dpaa_sec_dev_init() in case of failure called
    dpaa_sec_uninit() which freed both private data and security
    context. However one layer above in cryptodev_dpaa_sec_probe()
    function, the private data were freed one more time.

    The patch limits cleanup of the dpaa_sec_dev_init() function
    to freeing only the security context.

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-11 13:17:43 +02:00
Lukasz Wojciechowski
6290de2c3f crypto/dpaa_sec: improve memory freeing
This patch fixes management of memory for authentication
and encryption keys.
There were two issues with former state of implementation:

1) Invalid access to dpaa_sec_session union members
    The dpaa_sec_session structure includes an anonymous union:
    union {
        struct {...} aead_key;
        struct {
            struct {...} cipher_key;
            struct {...} auth_key;
        };
    };
    Depending on the used algorithm a rte_zmalloc() function
    allocated memory that was kept in aead_key, cipher_key
    or auth_key. However every time the memory was released,
    rte_free() was called only on cipher and auth keys, even
    if pointer to allocated memory was stored in aead_key.

    The C language specification defines such behavior as undefined.
    As the cipher_key and aead_key are similar, have same sizes and
    alignment, it has worked, but it's directly against C specification.

    This patch fixes this, providing a free_session_data() function
    to free the keys data. It verifies which algorithm was used
    (aead or auth+cipher) and frees proper part of the union.

2) Some keys might have been freed multiple times
    In functions like: dpaa_sec_cipher_init(), dpaa_sec_auth_init(),
    dpaa_sec_chain_init(), dpaa_sec_aead_init() keys data were freed
    before returning due to some error conditions. However the pointers
    were not zeroed causing another calls to ret_free from higher
    layers of code. This causes an error log about invalid memory address
    to be printed.

    This patch fixes it by making only one layer responsible for freeing
    memory

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-11 13:17:43 +02:00
Adam Dybkowski
e703b80152 common/qat: fix queue head update
This patch fixes missing queue head update that occurred when
a multiple-request dynamic Huffman compression operation was not
complete within one qat_dequeue_op_burst function call.

Fixes: c13cecf60f ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Tested-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
2020-05-11 13:17:43 +02:00
Arek Kusztal
fae347cb34 crypto/qat: fix cipher descriptor for ZUC and SNOW
Offset of cd pointer is too big by state1size + state2size, so few extra
unnecessary bytes will be copied into cd. Snow offset was improved as well.

Fixes: d9b7d5bbc8 ("crypto/qat: add ZUC EEA3/EIA3 capability")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-05-11 13:17:43 +02:00
Yunjian Wang
4f429be4c0 crypto/ccp: fix fd leak on probe failure
Zero is a valid fd. When ccp_probe_device() is failed, the uio_fd won't be
closed thus leading fd leak.

Fixes: ef4b04f87f ("crypto/ccp: support device init")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
2020-05-11 13:17:43 +02:00
Pablo de Lara
6ab5245040 crypto/aesni_mb: fix DOCSIS AES-256
When adding support for DOCSIS AES-256,
when setting the cipher parameters, all key sizes
were accepted, but only 128-bit and 256-bit keys
are supported.

Fixes: 9536622b86 ("crypto/aesni_mb: support DOCSIS AES-256")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
2020-05-11 13:17:43 +02:00
Pablo de Lara
20731cd8cb crypto/aesni_mb: check if session is valid
Check if session is valid after getting operation
out of the internal IPSec MB manager, in case the
session has been freed while the operation was still
inside the manager.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-05-11 13:17:43 +02:00
Ferruh Yigit
ea153cc853 event/octeontx2: fix build for O1 optimization
Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using
gcc 7.3.0

Build error
In file included from .../drivers/event/octeontx2/ot
x2_evdev.c:15:0:
.../drivers/event/octeontx2/otx2_evdev_stats.h:
    In function ‘otx2_sso_xstats_get’:
.../drivers/event/octeontx2/otx2_evdev_stats.h:124:9:
    error: ‘xstats’ may be used uninitialized in this function
           [-Werror=maybe-uninitialized]
   xstat = &xstats[ids[i] - start_offset];
   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is false positive, 'xstats_mode_count' should be preventing taking
the loop and accessing 'xstats'.
Returning in that case to silence the compiler warning.

Reported-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 21:09:20 +02:00
Ferruh Yigit
5f267cb01b net/ena: fix build for O1 optimization
Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)

Build error:
.../drivers/net/ena/ena_ethdev.c: In function ‘eth_ena_dev_init’:
.../drivers/net/ena/ena_ethdev.c:1815:20:
    error: ‘wd_state’ may be used uninitialized in this function
           [-Werror=maybe-uninitialized]
 1815 |  adapter->wd_state = wd_state;
      |  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~

This looks like false positive, fixing by assigning initial value to
'wd_state' variable.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2020-05-11 19:21:31 +02:00
Ferruh Yigit
0403b233ee mempool/octeontx2: fix build for gcc O1 optimization
Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)

Build error:
In file included from .../drivers/mempool/octeontx2/otx2_mempool.h:13,
                from .../drivers/mempool/octeontx2/otx2_mempool_ops.c:8:
.../drivers/mempool/octeontx2/otx2_mempool_ops.c:
	In function ‘otx2_npa_alloc’:
.../drivers/common/octeontx2/otx2_common.h:94:2:
    error: ‘aura_handle’ may be used uninitialized in this function
           [-Werror=maybe-uninitialized]
   94 |  rte_log(RTE_LOG_DEBUG, otx2_logtype_ ## subsystem,  \
      |  ^~~~~~~
.../drivers/mempool/octeontx2/otx2_mempool_ops.c:643:11:
    note: ‘aura_handle’ was declared here
  643 |  uint64_t aura_handle;
      |           ^~~~~~~~~~~

This looks like false positive, assigning an initial value to
'aura_handle' to fix the build error.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 19:21:18 +02:00
Radu Nicolau
299e282f62 raw/ioat: support ICX
Add support for Ice Lake IOAT DMA engine PCI Device ID.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2020-05-11 17:18:58 +02:00
Sunil Kumar Kori
463a5245d5 bus/pci: optimise scanning with whitelist/blacklist
rte_bus_scan API scans all the available PCI devices irrespective of white
or black listing parameters then further devices are probed based on white
or black listing parameters. So unnecessary CPU cycles are wasted during
rte_pci_scan.

For Octeontx2 platform with core frequency 2.4 Ghz, rte_bus_scan consumes
around 26ms to scan around 90 PCI devices but all may not be used by the
application. So for the application which uses 2 NICs, rte_bus_scan
consumes few microseconds and rest time is saved with this patch.

Patch restricts devices to be scanned as per below mentioned conditions:
 - All devices will be scanned if no parameters are passed.
 - Only white listed devices will be scanned if white list is available.
 - All devices, except black listed, will be scanned if black list is
   available.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Gaetan Rivet <grive@u256.net>
2020-05-11 16:59:58 +02:00
David Marchand
87db93e07a remove references to private PCI probe function
rte_pci_probe() is private to the PCI bus.
Clean the remaining references in the documentation and comments.

Fixes: c752998b5e ("pci: introduce library and driver")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Gaetan Rivet <grive@u256.net>
2020-05-11 16:59:58 +02:00
Jerin Jacob
e4f27af0f4 bus/pci: reduce boot-up logs to absolute minimum
Some machines may have a lot of PCI devices and all of them are
not bound to DPDK. In such case the logs from EAL creates a lot of
clutter on boot-up, typically one needs to scroll the screen to
find other issues in boot-up.

This patch changes the following to reduce the clutter in
the default boot-up logs.

- Change the log-level of PCI probes to `debug`
- Introduce new driver probe as `info` log-level for the successful probe.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 16:36:00 +02:00
Pavan Nikhilesh
838d94399b common/octeontx: fix gcc 9.1 ABI break
GCC 9.1 fixes a bug with passing bitfields as pass by value in function
parameters and generates a warning for the same as below:

drivers/common/octeontx/octeontx_mbox.c:282:1: note: parameter passing
for argument of type ‘struct mbox_intf_ver’ changed in GCC 9.1

Fix the warning generated by passing bitfield as pass by reference.

Fixes: b4134b2d31 ("common/octeontx: update mbox to version 1.1.3")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-06 23:53:19 +02:00
Mattias Rönnblom
52b66b2f20 event/dsw: avoid reusing previously recorded events
Avoid reusing recorded events when performing a migration, since this
may make the migration selection logic pick an already-moved flow.

Fixes: f6257b22e7 ("event/dsw: add load balancing")
Cc: stable@dpdk.org

Reported-by: Venky Venkatesh <vvenkatesh@paloaltonetworks.com>
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
2020-05-04 13:48:28 +02:00
Harman Kalra
cf55f04a0c event/octeontx: support Rx/Tx checksum offload
Adding support for rx checksum offload. In case of wrong
checksum received (inner/outer l3/l4) it reports the
corresponding layer which has bad checksum. It also adds
rx burst function pointer hook for rx checksum offload to
event PMD.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-03 16:37:30 +02:00
Vamsi Attunuru
45231cc6fa event/octeontx: support VLAN filter offload
Adding rx burst function pointer hooks for vlan filter
offload in event PMD.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-03 12:19:07 +02:00
Harman Kalra
56a96aa424 event/octeontx: add framework for Rx/Tx offloads
Adding macro based framework to hook dequeue/enqueue function
pointers to the appropriate function based on rx/tx offloads.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-03 12:08:31 +02:00
Harman Kalra
844d302d73 event/octeontx: support multi-segment
Adding support for multi segment to the eventdev PMD.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-03 11:57:56 +02:00
Lukasz Bartosik
534d1d4b65 event/octeontx2: fix queue removal from Rx adapter
When eth port queue is removed from Rx adapter using
rte_event_eth_rx_adapter_queue_del() it incorrectly
initializes CQ context instead of modifying it. This
might lead to a crash when CQ context is modified
as a part of rte_eth_dev_stop() sequence as CQ will
hold invalid entries. This is responsibility of an
application to call rte_event_eth_rx_adapter_queue_del()
to remove eth port queue from Rx adapter in tear down
sequence.

Fixes: 37720fc1fb ("event/octeontx2: add Rx adapter")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-05-02 11:47:00 +02:00
Ophir Munk
0efc99bed3 net/mlx5: fix flow rules with Verbs
The flow_verbs_translate() function accumulates hash fields while
iterating through the flow items (SRC_IPV4, DST_IPV4, SRC_IPV6,
DST_IPV6, SRC_PORT_TCP, DST_PORT_TCP, SRC_PORT_UDP, DST_PORT_UDP).
Before this commit the dev_flow handle structure was reused in each new
flow_verbs_translate() call, however the dev_flow->hash_fields variable
was not reset before each call. As a result hash_fields from previous
calls remained present in the current flow which lead to invalid
combinations (e.g.  simultaneous IPv4 and IPv6 specs). This scenario
happens for example in the next flows sequence, when running in verbs
mode (dv_flow_en=0).

flow create 0 ingress group 0 pattern eth / ipv4 / end <rss actions>
flow create 0 ingress group 0 pattern eth / ipv6 / end <rss actions>

The fix is to reset dev_flow->hash_fields in flow_verbs_prepare().

Fixes: e7bfa3596a ("net/mlx5: separate the flow handle resource")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Eli Britstein
6030e1d452 net/mlx5: optimize IPv4/IPv6 matching
The HW is optimized for IPv4/IPv6. For such cases avoid matching on
ethertype, and use ip_version field instead.

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Eli Britstein
dd5374bcf0 net/mlx5: introduce helper to set IP version match
Introduce a helper function to set the ip_version match.

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Kevin Traynor
869ea2e62d net/mlx5: fix gcc 10 enum-conversion warning
gcc 10.0.1 reports warnings when using mlx5_rte_flow enums
with rte_flow type enums. For example:

../drivers/net/mlx5/mlx5_flow.c: In function ‘flow_hairpin_split’:
../drivers/net/mlx5/mlx5_flow.c:3406:19:
warning: implicit conversion from ‘enum mlx5_rtedflow_action_type’ to
         ‘enum rte_flow_action_type’ [-Wenum-conversion]
 3406 |  tag_action->type = MLX5_RTE_FLOW_ACTION_TYPE_TAG;
      |                   ^
../drivers/net/mlx5/mlx5_flow.c:3419:13:
warning: implicit conversion from ‘enum mlx5_rte_flow_item_type’
         to ‘enum rte_flow_item_type’ [-Wenum-conversion]
 3419 |  item->type = MLX5_RTE_FLOW_ITEM_TYPE_TAG;
      |             ^

Fix by casting to the correct enum.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:27 +02:00
Wisam Jaddo
b756f29807 net/mlx5: fix VLAN ID check
All comparison should be done in CPU endianness, otherwise
it will not give right results.

for example:
255 after converting into RTE_BE16 will be biger than 4096 after
converting into RTE_BE16.

Fixes: a5f2da0b81 ("net/mlx5: support modify VLAN ID on new VLAN header")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:27 +02:00
Bing Zhao
c8fa92f6c1 net/mlx5: fix assert in modify converting
The assertion was added incorrectly in converting the modify actions
into the format of low layer driver.
There is no mask specified in the rte_flow actions, and PMD driver
will give a mask of all 1s to the field to be modified. For each
field, the mask could not be zero. But for the whole header which
contains this field, the masks of other fields could be zero. The
assertion needs to be removed for debug mode.

Fixes: 72a944dba1 ("net/mlx5: fix header modify action validation")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:27 +02:00
Dong Zhou
fa2d01c87d net/mlx5: support flow aging
Currently, there is no flow aging check and age-out event callback
mechanism for mlx5 driver, this patch implements it. It's included:
- Splitting the current counter container to aged or no-aged container
  since reducing memory consumption. Aged container will allocate extra
  memory to save the aging parameter from user configuration.
- Aging check and age-out event callback mechanism based on current
  counter. When a flow be checked aged-out, RTE_ETH_EVENT_FLOW_AGED
  event will be triggered to applications.
- Implement the new API: rte_flow_get_aged_flows, applications can use
  this API to get aged flows.

Signed-off-by: Dong Zhou <dongz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Dong Zhou
8d93c830e4 net/mlx5: modify ext-counter memory allocation
Currently, the counter pool needs 512 ext-counter memory for no batch
counters, it's allocated separately by once, behind the 512
basic-counter memory. This is not easy to get ext-counter pointer by
corresponding basic-counter pointer. This is also no easy for expanding
some other potential additional type of counter memory.

So, need allocate every one of ext-counter and basic-counter together,
as a single piece of memory. It's will be same for further additional
type of counter memory. In this case, one piece of memory contains all
type of memory for one counter, it's easy to get each type memory by
using offsetting.

Signed-off-by: Dong Zhou <dongz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Xiaoyu Min
0afac6dcca net/mlx5: fix RSS enablement
PMD create some default control rules with RSS action
if it's not isolated mode.

However whether default control rules need to do RSS or not should be
controlled by device configuration, the mq_mode of rxmode configuration
in specific.

In another word, only when mq_mode is configured with ETH_MQ_RX_RSS_FLAG
set, then RSS is needed for default rules.

Fixes: c64ccc0eca ("mlx5: fix overwritten RSS configuration")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Kishore Padmanabha
8a32d5c492 net/bnxt: modify mark manager validity checks
The ULP mark manager originally assumed that zero was an invalid
mark and used it for invalidation and deletion.  The mark manager
now supports adding zero as a mark, flags for validity and type,
and adds explicit bounds checking instead of relying on mask.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-05 15:54:27 +02:00
Mike Baucom
17b6c8386d net/bnxt: fix mark handling
The current mark handling uses the meta data field of the rxcmp as the
first level check for determining gfid vs lfid.  When the meta data is
zero due to only the lowest 16bits of the gfid being set, the cfa code
is incorrectly interpreted as being an lfid.  Changing code to look at
meta fmt instead of the meta data directly for the determination.

Fixes: b87abb2e55 ("net/bnxt: support marking packet")

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2020-05-05 15:54:27 +02:00
Nithin Dabilpuram
542714cc4b net/octeontx2: update red algo for shaper dynamic update
Due to an errata red algo needs to be set to discard instead of stall
for 96XX C0 silicon for two rate shaping. This workaround is being
already handled for newly created hierarchy but not for dynamic
shaper update cases. This patch hence applies the workaround
even when for shaper dynamic update.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2020-05-05 15:54:26 +02:00
Amit Gupta
c600b523c0 net/octeontx2: fix bad L4 checksum detection
On detecting outer L4 checksum as bad, both outer and
inner checksums are marked as bad. No need to explicitly
check inner L4 checksum in this case.

Outer L4 UDP checksum error => PKT_RX_OUTER_L4_CKSUM_BAD
and PKT_RX_L4_CKSUM_BAD

Inner L4 UDP checksum error => PKT_RX_L4_CKSUM_BAD

Fixes: 41fe7a3a11 ("net/octeontx2: offload bad L2/L3/L4 UDP lengths detection")

Signed-off-by: Amit Gupta <agupta3@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-05 15:54:26 +02:00
Yunjian Wang
5ed5df8073 net/octeontx: fix dangling pointer on init failure
When octeontx_create() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.

Fixes: 9e399b88ce ("net/octeontx: fix memory leak of MAC address table")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
2020-05-05 15:54:26 +02:00
Rasesh Mody
f97b56f9f1 net/qede: support FW version query
Add support for get firmware version operation.

Get and dump multi boot image (MBI) version as part of get
firmware version string along with Management firmware (MFW) version.
Use qede_fw_version_get() for PMD info logs.

Signed-off-by: Yash Sharma <ysharma@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-05 15:54:26 +02:00
Rasesh Mody
5810e43604 net/qede: support flow API flush
This patch adds support to flush the rte flows.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-05 15:54:26 +02:00
Matan Azrad
11e2ed9e43 vdpa/mlx5: fix PCI address comparison
A regular memcmp function was used to compare between two objects of
type `struct rte_pci_addr`.

Due to the alignment rules of compiler structure builders, some memory
is not initiated in the structure even though all the fields were
initiated.

Therefore, the comparison may fail even though the PCI addresses are
identical and to cause false failure in probe.

Use the dedicated API to compare 2 PCI addresses.

Fixes: 75dd0ae917 ("vdpa/mlx5: disable RoCE")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
Tested-by: Noa Ezra <noae@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Joyce Kong
3fc1d87c2a virtio: use one way barrier for split vring avail index
In case VIRTIO_F_ORDER_PLATFORM(36) is not negotiated, then the frontend
and backend are assumed to be implemented in software, that is they can
run on identical CPUs in an SMP configuration.
Thus a weak form of memory barriers like rte_smp_r/wmb, other than
rte_cio_r/wmb, is sufficient for this case(vq->hw->weak_barriers == 1)
and yields better performance.
For the above case, this patch helps yielding even better performance
by replacing the two-way barriers with C11 one-way barriers for avail
index in split ring.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Joyce Kong
ea5207c158 virtio: use one way barrier for split vring used index
In case VIRTIO_F_ORDER_PLATFORM(36) is not negotiated, then the frontend
and backend are assumed to be implemented in software, that is they can
run on identical CPUs in an SMP configuration.
Thus a weak form of memory barriers like rte_smp_r/wmb, other than
rte_cio_r/wmb, is sufficient for this case(vq->hw->weak_barriers == 1)
and yields better performance.
For the above case, this patch helps yielding even better performance
by replacing the two-way barriers with C11 one-way barriers for used
index in split ring.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Wei Hu (Xavier)
68ca93e31c net/hns3: fix return value when clearing statistics
Since the return value of the '.stats_reset' and '.xstats_reset'
callback function is int, when failing to issue command to firmware to
execute clear statistics, the relevant callback function should return
non-zero value.

Fixes: 8839c5e202 ("net/hns3: support device stats")
Cc: stable@dpdk.org

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-05 15:54:26 +02:00
Wei Hu (Xavier)
2de74dcfbd net/hns3: fix MSI-X interrupt during initialization
Currently, based on hns3 VF device error may occur during initialization.

The root cause as below:
When the following formula is executed during initialization, the
private variable named hw->tqps_num has not been obtained from PF driver
through mailbox, further causes failure when mapping interrupt and
queues.
  hw->num_msi = (num_msi > hw->tqps_num + 1) ? hw->tqps_num + 1 : num_msi;
We need to use hw->tqp_num after it is correctly assigned.

On the other hand, because the private variable named hw->num_msi, which
represents the number of MSI-x interrupt of hns3 PF/VF device, is used in
the '.get_reg' ops implementation function to dump all interrupt related
registers, it should be obtained from firmware directly and we'd better
not modify it in the driver.

Fixes: ef2e785c36 ("net/hns3: fix Tx interrupt when enabling Rx interrupt")
Fixes: 02a7b55657 ("net/hns3: support Rx interrupt")
Cc: stable@dpdk.org

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2020-05-05 15:54:26 +02:00
Min Hu (Connor)
99d673d5d3 net/hns3: fix VLAN PVID when configuring device
In current version, when upper level application calls the
rte_eth_dev_configure API function, if pvid config is not set of the
input parameter which struct type is rte_eth_conf, hns3 pmd driver also
sets the VLAN pvid related configuration to hardware, and this is not
reasonable. For example, As pvid is set to 100 by
rte_eth_dev_set_vlan_pvid, when pvid config is not set in rte_eth_conf,
rte_eth_dev_configure will tell driver to delete pvid 0, and that is
meaningless.

This patch fixes it to ensure that driver does not set VLAN pvid related
configuration to hardware when pvid config is not set in rte_eth_conf.

Fixes: 411d23b9ea ("net/hns3: support VLAN")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
2020-05-05 15:54:26 +02:00
Wei Hu (Xavier)
837740cfa3 net/hns3: get PCI revision ID
The hns3 network engine is built-in multiple SoCs, such as kunpeng 920,
kunpeng 930, etc. The PCI revision id is 0x21 in kunpeng 920, and the PCI
revision id is 0x30 in kunpeng 930.

This patch gets PCI revision to identify different version of hardware
network engine.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-05 15:54:26 +02:00
Lijun Ou
8eed8acc81 net/hns3: add error code to some logs
Here adds some prints for return value when the relative function fails
and enter the exception branch.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-05 15:54:26 +02:00
Wei Hu (Xavier)
c4b7d6761d net/hns3: get Tx abnormal errors in xstats
When upper level application calls the rte_eth_tx_burst API function to
send multiple packets at a time with burst mode based on hns3 network
engine, there are some abnormal conditions that cause the driver to fail
to operate the hardware to send packets correctly.

This patch adds some statistic counts for the abnormal errors of Tx data
path to the extend device statistics. The upper level application can
get them by calling the rte_eth_xstats_get API function.

Note: When using burst mode to call the rte_eth_tx_burst API function to
send multiple packets at a time. When the first abnormal error is
detected, add one to the relevant error statistics item, and then exit
the loop of sending multiple packets of the function. That is to say,
even if there are multiple packets in which abnormal errors may be
detected in the burst, the relevant error statistics in the driver will
only be increased by one.

The detail description of the Tx abnormal errors statistic items as
below:
 - TX_OVER_LENGTH_PKT_CNT Total number of greater than
   HNS3_MAX_FRAME_LEN the driver supported.

 - TX_EXCEED_LIMITED_BD_PKT_CNT
     Total number of exceeding the hardware limited bd which process a
     packet needed bd numbers.

 - TX_EXCEED_LIMITED_BD_PKT_REASSEMBLE_FAIL_CNT
     Total number of exceeding the hardware limited bd fail which
     process a packet needed bd numbers and reassemble fail.

 - TX_UNSUPPORTED_TUNNEL_PKT_CNT
     Total number of unsupported tunnel packet. The unsupported tunnel
     type: vxlan_gpe, gtp, ipip and MPLSINUDP, MPLSINUDP is a packet
     with MPLS-in-UDP RFC 7510 header.

 - TX_QUEUE_FULL_CNT
     Total count which the available bd numbers in current bd queue is
     less than the bd numbers with the pkt process needed.

 - TX_SHORT_PKT_PAD_FAIL_CNT
     Total count which the packet length is less than minimum packet
     size HNS3_MIN_PKT_SIZE and fail to be appended with 0.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
2020-05-05 15:54:26 +02:00
Jasvinder Singh
c1ea7a5f99 net/softnic: fix resource leak for pipeline
For sending request messages to data plane threads, the
caller invokes pipeline_msg_send_recv() function which never
returns null response. Thus, removed redundant check on
the returned response.

Coverity issue: 357676, 357680, 357681, 357682, 357690, 357693, 357711
Coverity issue: 357722, 357725, 357734, 357739, 357743, 357747, 357762
Coverity issue: 357766, 357787

Fixes: 6d4d054025 ("net/softnic: add command to read stats")
Fixes: 202905f3ee ("net/softnic: add command to create objects")
Fixes: ee19326a4b ("net/softnic: add command for pipeline table entries")
Fixes: 9bc0ce0ad1 ("net/softnic: add command for meter action")
Fixes: 2505030a83 ("net/softnic: add command for TTL action")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-05-05 15:54:26 +02:00
Jasvinder Singh
22335d4348 net/softnic: fix memory leak for thread
For sending request messages to data plane threads, the
caller invokes thread_msg_send_recv() function which never
returns null response. Thus, removed redundant check on
the returned response.

Coverity issue: 357717, 357772
Fixes: 70709c78fd ("net/softnic: add command to enable/disable pipeline")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-05-05 15:54:26 +02:00
Andrew Rybchenko
afff2aa3e3 net/sfc/base: fix build when EVB is enabled
Make local MCDI helper functions static.

Fixes: f0bda0cd68 ("net/sfc/base: add MCDI wrappers for vPort and vSwitch in EVB")
Fixes: ea94d14dbe ("net/sfc/base: provide APIs to configure and reset vPort")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-05-05 15:54:26 +02:00
Andrew Rybchenko
dd3d209cb1 net/sfc/base: use simpler EF10 family run-time checks
Fixes: 4625c4f527 ("net/sfc/base: factor out upstream port vAdaptor allocation")
Fixes: 4f12e20c85 ("net/sfc/base: introduce EVB module for SR-IOV")
Fixes: 18c8e84d77 ("net/sfc/base: support proxy auth operations for SR-IOV")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-05-05 15:54:26 +02:00
Andrew Rybchenko
f201b886b7 net/sfc/base: use simpler EF10 family conditional check
Fixes: 4f12e20c85 ("net/sfc/base: introduce EVB module for SR-IOV")
Fixes: 18c8e84d77 ("net/sfc/base: support proxy auth operations for SR-IOV")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-05-05 15:54:26 +02:00
Bing Zhao
0ba70e439e net/mlx5: fix actions validation on root table
The maximal supported header modifications number of a single modify
context on the root table cannot be queried from firmware directly.
It is a fixed value of 16 in the latest releases. In the validation
stage, PMD driver should ensure that no more than 16 header modify
actions exist in a single context.
In some old firmware releases, the supported value is 8. PMD driver
should try its best to create the flow. Firmware will return error
and refuse to create the flow if the actions number exceeds the
maximal value.

Fixes: 72a944dba1 ("net/mlx5: fix header modify action validation")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:26 +02:00
Suanming Mou
691b3d3ebb net/mlx5: fix indexed pool bitmap initialization
Currently, the indexed memory pool bitmap start address is not aligned
to cacheline size explicitly. The bitmap initialization requires the
address should be cacheline aligned. In that case, the initialization
maybe failed if the address is not cacheline aligned.

Add RTE_CACHE_LINE_ROUNDUP() to the trunk size calculation to make sure
the bitmap offset address will start with cacheline aligned.

Fixes: a3cf59f56c ("net/mlx5: add indexed memory pool")

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Tested-by: Lijian Zhang <lijian.zhang@arm.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2020-05-05 15:54:26 +02:00
Alexander Kozyrev
9a6ea33af9 net/mlx5: fix packet length assert in MPRQ
The assert that checks if there is a enough room for the
whole packet minus headroom data is written incorrectly.
The check should be negated in order to work properly.

Fixes: bd0d5930bf ("net/mlx5: enable MPRQ multi-stride operations")

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:26 +02:00
Alexander Kozyrev
0c55591588 net/mlx5: fix assert in dynamic metadata handling
The assert in dynamic flow metadata handling is wrong after the
fix for the performance degradation. The assert meant to check
the metadata mask but was updated with the metadata offset instead.
Fix this assert and restore proper metadata mask checking.

Fixes: 6c55b622a9 ("net/mlx5: set dynamic flow metadata in Rx queues")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:26 +02:00
Marvin Liu
ccb10995c2 net/virtio: add election for vectorized path
Rewrite vectorized path selection logic. Default setting comes from
vectorized devarg, then checks each criteria.

Packed ring vectorized path need:
    AVX512F and required extensions are supported by compiler and host
    VERSION_1 and IN_ORDER features are negotiated
    mergeable feature is not negotiated
    LRO offloading is disabled

Split ring vectorized rx path need:
    mergeable and IN_ORDER features are not negotiated
    LRO, chksum and vlan strip offloadings are disabled

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Marvin Liu
6494b9a9b2 net/virtio: add vectorized packed ring Tx
Optimize packed ring Tx path like Rx path. Split Tx path into batch and
single Tx functions. Batch function is further optimized by AVX512
instructions.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Marvin Liu
77d66da838 net/virtio: add vectorized packed ring Rx
Optimize packed ring Rx path with SIMD instructions. Solution of
optimization is pretty like vhost, is that split path into batch and
single functions. Batch function is further optimized by AVX512
instructions.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Marvin Liu
57f90f8945 net/virtio: reuse packed ring functions
Move offload, xmit cleanup and packed xmit enqueue function to header
file. These functions will be reused by packed ring vectorized path.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Marvin Liu
6b7eefbceb net/virtio-user: add parameter to enable vectorized path
Add new devarg for virtio user device vectorized path selection.
By default vectorized path is disabled.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Marvin Liu
4710e16a4a net/virtio: add parameter to enable vectorized path
Previously, virtio split ring vectorized path was enabled by default.
This is not suitable for everyone because that path does not follow
virtio spec. Add new devarg for virtio vectorized path selection. By
default vectorized path is disabled.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Marvin Liu
f68a6fac2d net/virtio: enable in-order feature if negotiated
Ring initialization is different when inorder feature negotiated. This
action should dependent on negotiated feature bits.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Marvin Liu
1982462ead net/virtio: add Rx free threshold setting
Introduce free threshold setting in Rx queue, its default value is 32.
Limit the threshold size to multiple of four as only vectorized packed
Rx function will utilize it. Virtio driver will rearm Rx queue when
more than rx_free_thresh descs were dequeued.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Matan Azrad
9f09b1ca15 vdpa/mlx5: recreate a virtq becoming enabled
The virtq configurations may be changed when it moves from disabled
state to enabled state.

Listen to the state callback even if the device is not configured.
Recreate the virtq when it moves from disabled state to enabled state
and when the device is configured.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Matan Azrad
7497873f23 vdpa/mlx5: separate virtq stop
In live migration, before logging the virtq, the driver queries the
virtq indexes after moving it to suspend mode.

Separate this method to new function mlx5_vdpa_virtq_stop as a
preparation for reusing.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Matan Azrad
c2eb33aaf9 vdpa/mlx5: manage virtqs by array
As a preparation to listen the virtqs status before the device is
configured, manage the virtqs structures in array instead of list.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Suanming Mou
dd76f43612 net/mlx5: save meter index instead of meter id
Currently, while creating the flow with meter, meter id is saved to the
rte flow. While destroying the flow, the meter object will be found by
the meter id, so the meter object will be released accordingly. But as
the meter id is configured by user, while the meter id is set to 0, it
doesn't make any sense to flow destroy since 0 means flow doesn't have
meter. The meter object with id 0 will be leaked.

As meter object is allocated from indexed memory, and the index starts
from 1, save the internal generated index instead of user defined meter
id will never meet the issue as above.

This patch saves meter index instead of meter id in rte flow.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:26 +02:00
Stephen Hemminger
cececca099 common/mlx5: fix uninitialized RoCE variable
Gcc 8.3.0 (Debian 10) complains about uninitialized variable.

[474/2122] Compiling C object
'drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_nl.c.o'.
In file included from ../drivers/common/mlx5/mlx5_nl.h:12,
                 from ../drivers/common/mlx5/mlx5_nl.c:23:
../drivers/common/mlx5/mlx5_nl.c: In function ‘mlx5_nl_enable_roce_get’:
../drivers/common/mlx5/mlx5_common.h:68:2: warning: ‘cur_en’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
  rte_log(RTE_LOG_ ## level, \
  ^~~~~~~
../drivers/common/mlx5/mlx5_nl.c:1560:6: note: ‘cur_en’ was declared here
  int cur_en;
      ^~~~~~

The compiler is correct, this variable would only be set if kernel
netlink response message contains the DEVLINK parameter that flags if
ROCE is enabled.

Fixes: fa69eaef5f ("common/mlx5: support ROCE disable through Netlink")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:26 +02:00
Asaf Penso
9b080425e3 net/mlx5: fix assert in doorbell lookup
The asserts makes sure that 'i' doesn't exceed the expected value.
This to prevent an out of bound access to dbr_bitmap.

The current location of the assert protects the assignment of
dbr_bitmap, but not the access to it.

Moved the assert to the correct place, to protect both cases.
Also, used an existing define for the assert.

Fixes: 21cae8580f ("net/mlx5: allocate door-bells via DevX")
Cc: stable@dpdk.org

Signed-off-by: Asaf Penso <asafp@mellanox.com>
Reviewed-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:26 +02:00
Bing Zhao
f21a98196a net/mlx5: fix empty flow error structure
The output flow error parameter is used to indicate the detailed
reason of the failure when calling a rte_flow_* interface. Even
though sometimes the application will not check it or use it, the PMD
must fill it in the failure branch before returning. Or else, some
dirty value in the stack, heap will be accessed as a pointer and then
cause a crash.
In this case, when a port is stopped, it is not allowed to insert a
flow from application. The detailed error information should be
filled. If the application needs to check the detailed error reason,
it will get the information but not result in any crash.

Fixes: 40b9e7f65f ("net/mlx5: check device status before creating flow")

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-05-05 15:54:26 +02:00
Bing Zhao
351b54f5cf net/mlx5: fix Rx queue flags on destroying flow
After inserting an offload flow, the software flag information will
be updated based on the flow. When receiving a packet on this queue,
the hardware packet type bits and the software flag will be used
together to get the inner packet and tunnel header type (if any) from
the global packet type table.
When destroying a flow, the corresponding Rx queue flag needs to be
updated. All flags should be cleared when closing a device because
all control flows and application flows are invalid anymore.
Such behavior is missed when implementing the non-cached mode.

Fixes: 8db7e3b698 ("net/mlx5: change operations for non-cached flows")

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:26 +02:00
Qi Zhang
a7b645debc net/ice/base: fix DCF switch rule
1. ln_en bit should not be turned on, since we only support Rx VEB.
2. lan_en bit need to be turned on for a DCF switch rule, otherwise
   any Tx packet that hit on a rule will be dropped.

Fixes: fed0c5ca5f ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-05-05 15:54:26 +02:00
Simei Su
ada64daa1a net/iavf: fix VF reset for flow director rule
After VF reset, FDIR rule still takes effect. To solve the issue,
this patch adds to flush all flows before flow uninit. VIRTCHNL
sends message to PF by Admin Queue, so flow flush should be implemented
before Admin Queue shut down.

Fixes: ff2d0c345c ("net/iavf: support generic flow API")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-05 15:54:25 +02:00
Wei Zhao
1491f63c75 net/i40e: fix flush of flow director filter
When we flush FDIR filter, we can not call i40e_fdir_teardown()
function as it will free vsi used for FDIR, then the vsi->base_queue
will be freed from pf->qp_pool, but vsi->base_queue can only get
once when do dev init in i40e_pf_setup(). If we free it, it will
never be alloc again.

Bugzilla ID: 404
Fixes: 2e67a7fbf3 ("net/i40e: config flow director automatically")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-05-05 15:54:25 +02:00
Wei Zhao
73cc2f0ab5 net/i40e: fix flow director for ARP packets
Currently, flow "pattern eth type is 0x0806 / end actions mark id
0x86 / rss / end" can't be created successfully. FDIR parser
shouldn't deny RTE_ETHER_TYPE_ARP since ARP packets will be
parsed as PCTYPE_L2_PAYLOAD. This patch fixes the issue.

Bugzilla ID: 402
Fixes: 42044b69c6 ("net/i40e: support input set selection for FDIR")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-05-05 15:54:25 +02:00
Qi Zhang
a3a51cbc7a net/ice/base: workaround unexpected rule deletion
Ideally a rule with "TO VSI LIST" action should not be deleted when one
of the VF reset happens. The correct action by kernel PF driver is to
remove the VSI of a reset VF from the VSI list, but this is not
implemented in kernel PF yet, so workaround is the DCF to prevent a
rule with "To VSI List" action happens.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2020-05-05 15:54:25 +02:00
Shahaji Bhosle
b58398d9f8 net/bnxt: add Truflow flush-timer to alloc table scope
Updated the params list to include flush timer, this will
allow users to set the HW flush timer value in 10th of second.
Setting 0 will disable the pending cache flush feature.

Signed-off-by: Shahaji Bhosle <sbhosle@broadcom.com>
Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-05 15:53:57 +02:00
Mike Baucom
a8dab4fe26 net/bnxt: update ULP to handle action/index tables
The ulp required to be changed to properly call the index table
management routines and use the index for external memory indices.
The ulp no longer has to account for stride as the tf_core returns the
actual offset, not a 0 based index.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-05 15:53:57 +02:00
Farah Smith
229f986396 net/bnxt: update external action record pool
- Added support variable sized action records
- Additional error checking on table scope params
- Single external pool supported per direction
- Changed to return action record pointer
- Allows action pool to fully utilize the number of flows

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
2020-05-05 15:53:57 +02:00
Mike Baucom
16d48e0121 net/bnxt: enable processing partially added flows
The resource function did not have a method of invalidating or
indicating that a resource is uninitialized.  Added an invalid enum so
that processing works correctly for partially added flows.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-05 15:53:57 +02:00
Somnath Kotur
9bccd7010f net/bnxt: fix max ring count
Max Rx Ring count could be < Max stat contexts. While accounting
for stat contexts, this should be also considered and
the max ring count adjusted accordingly.

Fixes: f03e66cb64 ("net/bnxt: limit queue count for NS3/Stingray devices")
Cc: stable@dpdk.org

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2020-05-05 15:53:57 +02:00
Ori Kam
f5bf02df31 eal/ppc: fix bool type after altivec include
The AltiVec header file breaks boolean type. [1] [2]

Currently the workaround was located only in mlx5 device.
Adding the trace module caused this issue to appear again, due to
order of includes, it keeps overriding the local fix.

This patch solves this issue by resetting the bool type, immediately
after it is being changed.

[1] https://mails.dpdk.org/archives/dev/2018-August/110281.html

[2]
In file included from
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool_trace_fp.h:18:0,
                 from
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool.h:54,
                 from
dpdk/drivers/common/mlx5/mlx5_common_mr.c:7:
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point.h: In
function '__rte_trace_point_fp_is_enabled':
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point.h:226:2:
error: incompatible types when returning type 'int' but '__vector __bool
int' was expected
  return false;
  ^
In file included from
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point.h:281:0,
                 from
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool_trace_fp.h:18,
                 from
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool.h:54,
                 from
dpdk/drivers/common/mlx5/mlx5_common_mr.c:7:
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool_trace_fp.h:
In function 'rte_mempool_trace_ops_dequeue_bulk':
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point_provider.h:104:6:
error: wrong type argument to unary exclamation mark
  if (!__rte_trace_point_fp_is_enabled()) \
      ^
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point.h:49:2:
note: in expansion of macro '__rte_trace_point_emit_header_fp'
  __rte_trace_point_emit_header_##_mode(&__##_tp); \
  ^
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point.h:99:2:
note: in expansion of macro '__RTE_TRACE_POINT'
  __RTE_TRACE_POINT(fp, tp, args, __VA_ARGS__)
  ^
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool_trace_fp.h:20:1:
note: in expansion of macro 'RTE_TRACE_POINT_FP'
 RTE_TRACE_POINT_FP(
 ^
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool_trace_fp.h:
In function 'rte_mempool_trace_ops_dequeue_contig_blocks':
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point_provider.h:104:6:
error: wrong type argument to unary exclamation mark
  if (!__rte_trace_point_fp_is_enabled()) \
      ^
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point.h:49:2:
note: in expansion of macro '__rte_trace_point_emit_header_fp'
  __rte_trace_point_emit_header_##_mode(&__##_tp); \
  ^
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point.h:99:2:
note: in expansion of macro '__RTE_TRACE_POINT'
  __RTE_TRACE_POINT(fp, tp, args, __VA_ARGS__)
  ^
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool_trace_fp.h:29:1:
note: in expansion of macro 'RTE_TRACE_POINT_FP'
 RTE_TRACE_POINT_FP(
 ^
dpdk/ppc_64-power8-linux-gcc/include/rte_mempool_trace_fp.h:
In function 'rte_mempool_trace_ops_enqueue_bulk':
dpdk/ppc_64-power8-linux-gcc/include/rte_trace_point_provider.h:104:6:
error: wrong type argument to unary exclamation mark
  if (!__rte_trace_point_fp_is_enabled()) \

Fixes: 725f5dd0bf ("net/mlx5: fix build on PPC64")

Signed-off-by: Ori Kam <orika@mellanox.com>
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-06 11:45:13 +02:00
Kevin Traynor
ec87d3b2c2 net/avp: fix gcc 10 maybe-uninitialized warning
gcc 10.0.1 reports:

../drivers/net/avp/avp_ethdev.c: In function ‘avp_xmit_scattered_pkts’:
../drivers/net/avp/avp_ethdev.c:1791:24:
warning: ‘avp_bufs[count]’ may be used uninitialized in this function
 [-Wmaybe-uninitialized]
 1791 |   tx_bufs[i] = avp_bufs[count];
      |                ~~~~~~~~^~~~~~~
../drivers/net/avp/avp_ethdev.c:1791:24:
warning: ‘avp_bufs[count]’ may be used uninitialized in this function
 [-Wmaybe-uninitialized]

Fix by initializing the array.

Fixes: 295abce2d2 ("net/avp: add packet transmit functions")
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Steven Webster <steven.webster@windriver.com>
2020-05-06 11:18:36 +02:00
Ray Kinsella
105f3039c7 version: reference next ABI 21 for recent additions
Change references to ABI 20.0.1 to use ABI v21, see
https://doc.dpdk.org/guides/contributing/abi_policy.html#general-guidelines

"Major ABI versions are declared no more frequently than yearly.
Compatibility with the major ABI version is mandatory in subsequent
releases until a new major ABI version is declared."

Combined ABI policy and versioning in maintainers, add map files to the
filter to more closely monitor future ABI changes.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-05 00:25:34 +02:00
Kalesh AP
bc75bdb60f net/bnxt: fix VNIC Rx queue count on VNIC free
bnxt_free_one_vnic and bnxt_setup_one_vnic are called on configuring
port vlan stripping. bnxt_setup_one_vnic keeps incrementing the
vnic rx_queue_cnt. Fix to reset vnic rx_queue_cnt in bnxt_free_one_vnic.

Fixes: cfadfee41e ("net/bnxt: fix VLAN strip")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-04-25 23:09:29 +02:00
Rahul Gupta
d256c73c11 net/bnxt: fix memory leak during queue restart
During port 0 rxq 1 start ie queue start,
bnxt_free_hwrm_rx_ring() we are clearing the pointers to mbuf array.
Due to this we overwrite the queue with fresh mbuf allocations
causing previously allocated mbufs to leak.
Add a check before allocating mbuf to replenish only empty mbuf slots
in the RxQ.

Fixes: 2eb53b134a ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-25 23:09:29 +02:00
Vijaya Mohan Guvva
e6cf7bee1c bus/pci: fix UIO resource access from secondary process
For PCI devices presented through igb_uio, pcidev->mem_resource[] is
not populated when the device is initialized for secondary process.

Initialize pcidev->mem_resource[] with pci-bar mapped addresses.

Fixes: eee16c964c ("pci: support multiple PCI regions per device")
Cc: stable@dpdk.org

Signed-off-by: Vijaya Mohan Guvva <vijay1054@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-04-25 22:41:58 +02:00
Luca Boccassi
611faa5f46 fix various typos found by Lintian
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
2020-04-25 19:53:47 +02:00
David Christensen
9052157318 bus/pci: support IOVA as VA on PowerNV systems
All recent POWER systems, Power 8 and 9 specifically, support an IOMMU
(it can't be disabled). The functionality of the IOMMU is different
depending on whether it's running on a bare metal PowerNV system or in
a virtual environment (PowerVM LPAR or KVM/QEMU).  DPDK currently
supports the IOMMU found on PowerNV platforms, sPAPRv2, so IOVA=VA
mode can be enabled when the correct platform is detected.

The POWER IOMMU type can't be detected through mechanisms such as
parsing files in the /sys hierarchy like x86_64 systems so the
/proc/cpuinfo file is parsed to determine whether Linux is running
on bare metal (i.e. PowerNV) or in a virtual environment (KVM/QEMU).

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
2020-04-25 17:01:01 +02:00
Haiyue Wang
4c82473412 build: add internal tag check
Add checks during build to ensure that all symbols in the INTERNAL
version map section have __internal tags on their definitions, and
enable the warnings needed to announce their use.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-04-25 17:01:01 +02:00
Haiyue Wang
2d148778d2 build: enable internal API tag
Allow the drivers and libraries to use the internal tag for marking
internal ABI symbols.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
2020-04-25 17:01:00 +02:00
Kalesh AP
24fd2eea9f net/bnxt: fix port MAC query on VF
HWRM_PORT_MAC_QCFG is not supported on a VF. Added a PF check
in bnxt_hwrm_port_mac_qcfg() to prevent the probe failure on a VF.

Fixes: f6e250d21a ("net/bnxt: fetch SVIF information from firmware")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-04-22 13:41:25 +02:00
Kalesh AP
f02ea89fcb net/bnxt: log firmware status on early init failure
Firmware reports any fatal error (either ASIC or Firmware related) via a
new status register. This status register can provide more detailed
information about the firmware errors, especially if error occurs before
HWRM_VER_GET is issued. Attempt to map this register if it is present
and check for firmware status when VER_GET command fails.

Refactored the code to allocate the "bp->recovery_info" structure
in bnxt_init_fw() instead of doing in bnxt_hwrm_error_recovery_qcfg().

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-22 13:41:24 +02:00
Kalesh AP
8b60154d4b net/bnxt: fix VLAN add when port is stopped
Driver destroys the vnic when the port is brought down.
When user tries to add a vlan when port is stopped, driver
issues HWRM command to FW with invalid vnic_id and it fails.

Fixed to return an error while setting vlan when port is
not started.

Fixes: b4e190d55c ("net/bnxt: fix MAC/VLAN filter allocation")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-22 13:41:24 +02:00
Kalesh AP
cf2445374c net/bnxt: fix port start failure handling
Fixed to invoke clean up in the reverse sequence of
initialization in case any of the FW commands fail
during port start.

Fixes: 0b53359123 ("net/bnxt: inform firmware about IF state changes")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-22 13:41:24 +02:00
Kalesh AP
ec16ad80c6 net/bnxt: use true/false for bool types
Fixes: 0b53359123 ("net/bnxt: inform firmware about IF state changes")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-22 13:41:24 +02:00
Kalesh AP
ac2df046a0 net/bnxt: fix HWRM command during FW reset
FW returns HWRM_ERR_CODE_HOT_RESET_PROGRESS(0xa) when it is
unable to process a specific cmd while hot reset is in progress.
Host driver is expected to keep retrying the cmd for 2s with
a gap of 50ms between each retrial.

Also, fixed to fail port start if the HWRM_FUNC_DRV_IF_CHANGE
still returns error after 2 seconds.

Fixes: 0b53359123 ("net/bnxt: inform firmware about IF state changes")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-22 13:41:24 +02:00
Kalesh AP
85cf7f2bba net/bnxt: support speed capabilities query
Added information about supported speeds for the port in the
"dev_infos_get". As other PMDs are returning the speed capabilities,
apps may expect this behavior from bnxt PMD.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-22 13:41:24 +02:00
Kalesh AP
7bc39dac4a net/bnxt: use macro for PCI log format
Use PCI_PRI_FMT instead of "%04x:%02x:%02x:%02x" print format.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-22 13:41:24 +02:00
Ajit Khaparde
2ec9392ba1 net/bnxt: fix build on BSD
There is no ENODATA in the errno.h in BSD.
Use a common errno to return error.

Fixes: 69c410b844 ("net/bnxt: support EM/EEM")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2020-04-22 13:41:24 +02:00
Beilei Xing
b09d34ac85 net/ice: fix flow redirector
If there's VF reset, the kernel PF will remove rules
associated with the reset VF no matter the HW VSI ID
is changed or not. So DCF should redirector all rules
associated with the reset VF no matter the HW VSI ID
is changed or not.

Fixes: 3b3757bda3 ("net/ice: get VF hardware index in DCF")
Fixes: c8183dd8e0 ("net/ice: redirect switch rule to new VSI")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2020-04-22 12:31:12 +02:00
Cheng Peng
fdfbfe7085 net/iavf: fix stats query error code
The iavf_dev_stats_get function should return ret instead of -eio.

Fixes: f4a41a6953 ("net/avf: support stats")
Cc: stable@dpdk.org

Signed-off-by: Cheng Peng <cheng.peng5@zte.com.cn>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-04-22 12:31:12 +02:00
David Christensen
941b494e65 net/i40e: enable PPC AltiVec path in meson build
The meson build file does not enable i40e vectorization support for
PPC/altivec systems, even though the existing Makefile does enable the
support. Add the required architecture check and sources line.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-04-22 12:31:12 +02:00
Shougang Wang
dfcea7f90f net/ixgbe: fix link status after port reset
It's a normal behavior to change the link status to up after
resetting the port. So it is unnecessary to set link down before
starting port, and changing the link state(link up/down) frequently
will cause link speed unstable.

Fixes: c3f2fbff78 ("net/ixgbe: fix link status")
Cc: stable@dpdk.org

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Tested-by: Xueming Zhang <xuemingx.zhang@intel.com>
2020-04-22 12:31:12 +02:00
Wei Zhao
8f5d8e74fb net/ice: support flow for AH ESP and L2TP
Add switch filter support for AH ESP and L2TP protocol,
and use SPI or session idas input set for switch rule.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-22 12:31:12 +02:00
Wei Zhao
fe44d4a079 net/ice/base: support L2TP on switch
Add dummy packet and tunnel type to support
L2TP on switch, now we can use session id as
input set for switch rule.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-22 12:31:12 +02:00
Wei Zhao
4f11962fce net/ice/base: support AH ESP and NAT-T on switch
Add dummy packet and tunnel type to support
AH ESP and NAT-T on switch, now we can use SPI as
input set for switch rule.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-22 12:31:12 +02:00
Tao Zhu
d68ab7a9f9 net/ixgbe: fix resource leak after thread exits normally
When the thread exits normally, pthread_join() is not called, which can
result in a resource leak. Therefore, the thread is set to separation
mode using function pthread_detach(), so that no program call
pthread_join() is required to recycle, and when the thread exits,
the system automatically reclaims resources.

Wait for the thread to finish with timeout argument(0 means that it will
not return until link complete), wait until the thread finishes before
returning. Normally, the thread will finish in a shorter time, and give
a warning message if it hasn't finished in a longer time.

Fixes: 819d0d1d57 ("net/ixgbe: fix blocking system events")
Cc: stable@dpdk.org

Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-04-22 12:31:12 +02:00
Alexander Kozyrev
a24431dffb net/mlx5: improve logging of MPRQ selection
MPRQ is silently turned off in case there is not enough
Rx queues configured. Improve the logging to show a
warning in this case to notify a user about the Rx burst
function selected.

Fixes: 7d6bf6b866 ("net/mlx5: add Multi-Packet Rx support")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 22:28:06 +02:00
Alexander Kozyrev
6c55b622a9 net/mlx5: set dynamic flow metadata in Rx queues
Using a global mbuf dynamic field for metadata incurs some
performance penalty on a datapath. Store this information in
the Rx queue descriptor for a better cache locality.

Fixes: a18ac61133 ("net/mlx5: add metadata support to Rx datapath")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 22:28:06 +02:00
Bing Zhao
72a944dba1 net/mlx5: fix header modify action validation
The header modify actions number supported now has some limitation,
and it is decided by both driver and hardware. If the configuration
is different or the table to insert the flow is different, the result
might be different if the flow contains header modify actions.
Currently, the actual action number could only be calculated in the
later stage called translate, from user specified value to the driver
format. And the action numbers checking is missed in the flow
validation. So PMD will return incorrect result to indicate the
flow actions are valid by rte_flow_validate but then it will fail
when calling rte_flow_create.

Adding some simple checking in the validation will help to get rid
of this incorrect checking. Most of the actions will only consume 1
SW action field except the MAC address and IPv6 address. And from
SW POV, the maximal action fields for these will be consumed even if
only part of such field will be modified because that there is no
mask in the flow actions and the mask will always be all ONEs.

The metering or extra metadata supports will cost one more action.

Fixes: 9597330c68 ("net/mlx5: update modify header action translator")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 22:28:06 +02:00
Tonghao Zhang
0d7d180a0d net/mlx5: fix crash when releasing meter table
The meters of ports share the same meter table on
the port. When releasing meters, don't check value returned
using assert. Because other meters may reference to it.

Fixes: 46a5e6bc6a ("net/mlx5: prepare meter flow tables")
Fixes: 9dbaf7eef6 ("net/mlx5: fix meter suffix table leak")
Cc: stable@dpdk.org

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 22:28:06 +02:00
Chengwen Feng
4016d76b7c net/hns3: get Rx/Tx queue fbd in xstats
This patch adds getting Rx/Tx queue fbd information in extended device
statistics. The upper level application can get them by calling the
rte_eth_xstats_get API function.

The fbd registers of every Rx/Tx queue are very useful to identify the
Rx/Tx bottleneck.
1. The Rx queue fbd register is the number of the unprocessed buffer
   descriptors which are waiting for driver to process;
2. The Tx queue fbd register is the number of the unprocessed buffer
   descriptors which are waiting for network engine hardware to process.

As a result, we get the following output information in testpmd
application by using the command "show port xstats" as below:
rx_q0RX_QUEUE_FBD: 19
rx_q1RX_QUEUE_FBD: 18
tx_q0TX_QUEUE_FBD: 0
tx_q1TX_QUEUE_FBD: 0

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
2020-04-21 19:16:41 +02:00
Wei Hu (Xavier)
bd5b86732b net/hns3: modify format for firmware version
This patch modifies the print format for firmware version in the log, It
replaces "0x%08x" with "%lu.%lu.%lu.%lu" in the format control string.
By the way, this patch adds ".fw_version_get" ops implemation for hns3
VF PMD driver.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-04-21 19:16:41 +02:00
Jeff Guo
7be10c3004 net/iavf: add RSS configuration for VF
The VF must be capable of configuring RSS. Add a virtchnl handler to
parse a specific RSS configuration, and process the configuration for
VFs, such as add or delete a RSS rule.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 18:03:26 +02:00
Thomas Monjalon
d53a513aed common/mlx5: fix build with rdma-core 21
drivers/common/mlx5/mlx5_glue.c: In function 'mlx5_glue_devx_qp_query':
drivers/common/mlx5/mlx5_glue.c:1010:9: error:
implicit declaration of function 'mlx5dv_devx_qp_query'

The function mlx5dv_devx_qp_query() was added in rdma-core 22.
This function is compiled only if HAVE_IBV_DEVX_OBJ,
which is true if the function mlx5dv_devx_obj_create is found.
Unfortunately mlx5dv_devx_obj_create() was introduced in rdma-core 21,
when mlx5dv_devx_qp_query() did not exist yet.

A new flag HAVE_IBV_DEVX_QP is added when mlx5dv_devx_qp_query()
is found.

Fixes: 62d6f70f30 ("net/mlx5: add glue for queue query via DevX")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 16:18:13 +02:00
Wentao Cui
78466e086a net/mlx5: optimize memory for flow meter
This commit focus on flow meter data structures
optimization: mlx5_flow_meter.

Optimize memory consumption of flow meter data structure.
Reorganize flow meter data structure,delete unnecessary
data fields.

Signed-off-by: Wentao Cui <wentaoc@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 16:18:13 +02:00
Bernard Iremonger
ae08c73e6f net/i40e: fix flow director initialisation
Remove references to struct rte_fdir_conf which is deprecated,
in i40e_flow_parse_fdir_filter(), i40e_flow_destroy() and
i40e_flow_add_del_fdir_filter().

Fixes: c3be43817c ("net/i40e: fix unexpected skip FDIR setup")
Fixes: 2e67a7fbf3 ("net/i40e: config flow director automatically")
Fixes: 4149825bbd ("net/i40e: finish integration FDIR with generic flow API")
Cc: stable@dpdk.org

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
ece350b463 net/iavf: support flow director mark action
This patch enables mark action support and takes mark only case
into consideration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
6fb63b1a4d net/iavf: support flow director PFCP
This patch enables PFCP node and session packets with S_FIELD
for flow director filter.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
78dcaa91ea net/iavf: support flow director L2TPv3 and IPsec
This patch enables L2TPv3 with SESSION_ID, ESP/AH with SPI, NAT-T
with SPI and IP src/dst for flow director filter.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
26db935656 net/iavf: support flow director GTPU
This patch enables GTPU with TEID and QFI for flow director filter.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Simei Su
d5eb3e600d net/iavf: support flow director basic rule
This patch adds FDIR create/destroy/validate function in AVF.
Common pattern and queue/qgroup/passthru/drop actions are supported.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Haiyue Wang
d1c91179e9 net/ice: check DSN package file firstly
Align the package file search sequence with PF only for DCF mode. Get
the DSN through the virtual channel firstly to check the accessibility
of the package file.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
63660ea3ee net/iavf: add RSS hash parsing in SSE path
Support RSS hash parsing from Flex Rx
descriptor in SSE data path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
f978c1c9b3 net/iavf: add RSS hash parsing in AVX path
Support RSS hash parsing from Flex Rx
descriptor in AVX data path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
75c348b06a net/iavf: support flow mark in SSE path
Support Flow Director mark ID parsing from Flex
Rx descriptor in SSE path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
d35f115ed0 net/iavf: support flow mark in AVX path
Support Flow Director mark ID parsing from Flex
Rx descriptor in AVX path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
dd3432e3f7 net/iavf: support flow mark in normal data path
Support Flow Director mark ID parsing in normal path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
f71dbf852d net/iavf: add flow director enabled switch value
The commit adds fdir_enabled flag into iavf_rx_queue structure
to identify if fdir id is active. Rx data path can be benefit if
fdir id parsing is not needed, especially in vector path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
1162f5a0ef net/iavf: support flexible Rx descriptor in SSE path
Support flexible Rx descriptor format in SSE
path of iAVF PMD.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
5b6e885908 net/iavf: support flexible Rx descriptor in AVX path
Support flexible Rx descriptor format in AVX
path of iAVF PMD.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
b8b4c54ef9 net/iavf: support flexible Rx descriptor in normal path
Support flexible Rx descriptor format in normal
path of iAVF PMD.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
837c2ed86e net/iavf: return error if opcode is mismatched
Adds error return when the opcode of read message is
mismatched which is received from adminQ.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Leyi Rong
63b5e32439 net/iavf: support flexible Rx descriptor definitions
Add definitions for flexible Rx descriptor structures and macros.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
0136df99a9 net/mlx5: reorganize flow API structure
Currently, the rte flow structure is not fully aligned and has some
bits wasted. The members can be optimized and reorganized to save
memory.

1. The drv_type uses only limited bits, change the type to 2 bits what
it needs.

2. Align the hairpin_flow_id, drv_type, fdir, copy_applied to 32 bits.
As hairpin never uses the full 32 bits.

3. __rte_packed helps tight up the structure memory layout.

The optimization totally helps save 14 bytes for the structure.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
ab612adc1e net/mlx5: allocate flow API from indexed pool
This commit allocates rte flow from indexed memory pool.

Allocate rte flow memory from indexed memory pool helps save more than
MALLOC_ELEM_OVERHEAD bytes memory from rte_malloc().

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
e745f90007 net/mlx5: optimize flow RSS struct
When destroy the flow with RSS, flow can invoke the queues information
from hrxq index table object, since the queue number and list are both
saved to the index table object. No need to save the duplicated data in
rte flow.

Save the RSS description information to the intermediate private data
when create the flow with RSS action helps to save the memory for rte
flow.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Wentao Cui
c2ddde7950 net/mlx5: optimize flow director filter memory
This commit is for mlx5 fdir flow memory optimization.

Currently for the fdir member in rte_flow structure. It saves the fdir
memory pointer directly. As fdir is fading away, use one bit help to
indicate the function in the flow and add the content to an extra list
save the memory for the other widely usage cases.

Signed-off-by: Wentao Cui <wentaoc@mellanox.com>
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
90e6053a19 net/mlx5: convert mark copy resource to indexed
Allocate mark copy resource from indexed pool helps rte flow saves the 4
bytes index instead of 8 bytes pointer. For mark copy resource itself,
it helps save MALLOC_ELEM_OVERHEAD bytes from rte_malloc().

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
8638e2b076 net/mlx5: allocate meter from indexed pool
This patch allocate the meter object memory from indexed memory pool
which will help to save the MALLOC_ELEM_OVERHEAD memory taken by
rte_malloc().

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
8eb5485dc0 net/mlx5: optimize flow meter handle type
While flow attaches the meter handle, the meter id can be the unique tag
for the flow to get the meter handle. It's no need for flow to save the
pointer of the meter handle.

Save the meter id instead of pointer helps reduce the size for rte flow
structure.

As the supported maximum meter rule is 4K, uint16_t type is selected for
the meter id.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
77749adab9 net/mlx5: reorganize flow handle struct
Currently, the mlx5_flow_handle struct is not fully aligned and has some
bits wasted. The members can be optimized and reorganized to save memory.

1. As metadata and meter is sharing the same flow match id, now the flow
   id is limited to 24 bits due to the 8 MSBs are used as for the meter
   color.  Align the flow id to other bit members to 32 bits to save the
   mlx5 flow handle memory.

2. The vlan_vf in struct mlx5_flow_handle_dv was already moved to struct
   mlx5_flow_handle. Remove the legacy vlan_vf in struct
   mlx5_flow_handle_dv.

3. Reorganize the vlan_vf in mlx5_flow_handle with member SILIST_ENTRY
   next to make it align with 8 bytes.

4. Reorganize the header modify in mlx5_flow_handle_dv to ILIST_ENTRY
   next to make it align to with bytes.

5. Introduce __rte_pack attribute to make the struct tightly organized.

It will totally save 20 bytes memory for mlx5_flow_handle struct.

For the resource objects which are converted to indexed, align the names
with the prefix of rix_.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
488d13abdc net/mlx5: optimize action flags in flow handle
As only limited bits is used in act_flags for flow destroy, it's a bit
expensive to save the whole 64 bits. Move the act_flags out of flow
handle and save the needed bits for flow destroy to save some bytes for
the flow handle data struct.

The fate action type and mark bits are reserved as they will be used in
flow destroy.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
6fc183924b net/mlx5: reorganize fate actions as union
Currently, one flow only has one fate action, the fate actions members
in the flow struct can be reorganized as union to save the memory for
flow struct.

This commit reorganizes the fate actions as union, the act_flags helps
to identify the fate action type when flow destroys.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
b88341ca35 net/mlx5: convert flow dev handle to indexed
This commit converts flow dev handle to indexed.

Change the mlx5 flow handle from pointer to uint32_t saves memory for
flow. With million flow, it saves several MBytes memory.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
772dc0eb83 net/mlx5: convert hrxq to indexed
This commit converts hrxq to indexed.

Using the uint32_t index instead of pointer saves 4 bytes memory for the
flow handle. For millions flows, it will save several MBytes of memory.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
7ac99475ce net/mlx5: convert jump resource to indexed
This commit convert jump resource to indexed.

The table data struct is allocated from indexed memory. As it is add in
the hash list, the pointer is still used for hash list search. The index
is added to the table struct, and the pointer in flow handle is decrease
to uint32_t type. For flow without jump flows, it saves 4 bytes memory.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
f3faf9ea11 net/mlx5: convert port id action to indexed
This commit converts port id action to indexed.

Using the uint32_t index instead of pointer saves 4 bytes memory for the
flow handle. For millions flows, it will save several MBytes of memory.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
5f1142692a net/mlx5: convert tag resource to indexed
This commit convert tag resource to indexed.

As tag resources are add in the hash list, to avoid introduce
performance issue and keep the hash list, only the tag resource memory
is allocated from indexed memory. The resources is still added to the
hash list. Add four bytes index in the tag resource struct and change
the tag resources in the flow handle from pointer to uint32_t seems be
no benefit for tag resource, but it saves memory for flows without tag
action. And also for sub flows share one tag action resource.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
8acf8ac9b7 net/mlx5: convert push VLAN resource to indexed
This commit converts the push VLAN resource to indexed.

Using the uint32_t index instead of pointer saves 4 bytes memory for the
flow handle. For millions flows, it will save several MBytes of memory.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
014d1cbe51 net/mlx5: convert encap/decap resource to indexed
This commit converts the flow encap/decap resource to indexed.

Using the uint32_t index instead of pointer saves 4 bytes memory for the
flow handle. For millions flows, it will save several MBytes of memory.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
1fd4bb67eb net/mlx5: add trunk release for indexed pool
While entries are fully freed in trunk, it means the trunk is free now.
User may prefer the free trunk memory can be reclaimed.

Add the trunk release memory option for indexed pool in this case.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
62d7d519b1 net/mlx5: add trunk dynamic grow for indexed pool
This commit add trunk dynamic grow for the indexed pool.

In case for pools which are not sure the entry number needed, pools can
be configured in increase progressively mode. It means the trunk size
will be increased dynamically one after one, then reach a stable value.
It saves memory to avoid allocate a very big trunk at beginning.

User should set both the grow_shift and grow_trunk to help the trunk
grow works. Keep one or both grow_shift and grow_trunk as 0 makes the
trunk work as fixed size.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Suanming Mou
a3cf59f56c net/mlx5: add indexed memory pool
Currently, the memory allocated by rte_malloc() also introduced more
than 64 bytes overhead. It means when allocate 64 bytes memory, the
real cost in memory maybe double. And the libc malloc() overhead is 16
bytes, If users try allocating millions of small memory blocks, the
overhead costing maybe huge. And save the memory pointer will also be
quite expensive.

Indexed memory pool is introduced to save the memory for allocating
huge amount of small memory blocks. The indexed memory uses trunk and
bitmap to manage the memory entries. While the pool is empty, the trunk
slot contains memory entry array will be allocated firstly. The bitmap
in the trunk records the entry allocation. The offset of trunk slot in
the pool and the offset of memory entry in the trunk slot compose the
index for the memory entry. So, by the index, it will be very easy to
address the memory of the entry. User saves the 32 bits index for the
memory resource instead of the 64 bits pointer.
User should create different pools for allocating different size of
small memory block. It means one pool provides one fixed size of small
memory blocked allocating.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-04-21 13:57:09 +02:00
Yunjian Wang
13b698d11f net/tap: fix queues fd check before close
The fd is possibly a negative value while it is passed as an
argument to function "close". Fix the check to the fd.

Fixes: ed8132e7c9 ("net/tap: move fds of queues to be in process private")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-04-21 13:57:09 +02:00
Ajit Khaparde
f6d1379f55 net/bnxt: remove redefinition of page size
PAGE_SIZE is a common macro and cause redefinition errors.
Replace such occurrences.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-04-21 13:57:09 +02:00
Kishore Padmanabha
dc8ee8121c net/bnxt: add port database
The port database is a repository of the port details
it is used by the ulp code to query any port related details.

Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
2020-04-21 13:57:09 +02:00
Mike Baucom
4bc32a8055 net/bnxt: add cache table type for TCAM lookup
In order to re-use allocated resources and reduce search complexity for
simple keys, a generic software cache table was added for the TCAM. The
implementation is specifically only for keys that can be compressed to
less than 16 bits.  The keys are generated using the same mechanisms as
other search tables, but the table type is set to a cache that mirrors
the actual TCAM table. The allocated result fields are stored in the
cache entry and can be used for subsequent searches in future tables.

Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
2020-04-21 13:57:09 +02:00
Mike Baucom
072cb4a870 net/bnxt: add default identifiers to ULP mapper
- Added ulp_mapper_init/deinit to allocate/deallocate mapper data for
  storing the default identifiers
- Modified the template_db to include the new opcode for accessing the
  default ids.
- Modified the result and key field builders to use the new opcode for
  writing the default ids into blobs

Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
2020-04-21 13:57:09 +02:00
Kishore Padmanabha
74bcfc0624 net/bnxt: add session and function flow flush
The ulp flow flush has been extended to support session flow
flush and function flow flush. The session flow flush is called when
there the device is sole owner of the session and it deletes all the
flows associated with that session. The function flow flush is
called if the device function is not the sole owner of the session,
it deletes all the flows that are associated with that device
function.

Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
2020-04-21 13:57:09 +02:00