The TCA_FLOWER_KEY_VLAN_ETH_TYPE should be specified for the E-Switch
Flows with VLAN and L3 pattern items in the Netlink messages. The patch
adds missing flower key to the messages. This patch partially reverts to
the code smashed by http://patches.dpdk.org/patch/47781
Fixes: 251e8d02cf ("net/mlx5: add VXLAN to flow translate routine")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
The only time that software should write to the TDH register
is after a reset (hardware reset or CTRL.RST) and
before enabling the transmit function (TXDCTL.ENABLE).
If software were to write to this register while the transmit
function was enabled, the on-chip descriptor buffers might
be invalidated and the hardware could become confused.
Fixes: 029fd06d40 ("ixgbe: queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Following commit updated the Tx offload mask
commit 1037ed842c ("mbuf: fix Tx offload mask").
So, not having PKT_TX_IPV6 and PKT_TX_IPV4 in qede PMDs supported
Tx offload mask breaks TSO support since application will fail in transmit
prepare function.
Fixes: 1037ed842c ("mbuf: fix Tx offload mask")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
rx_buffer_info should be refill not linearly, but out of order.
IDs should be taken from empty_rx_reqs array.
rx_refill_buffer is introduced to temporary storage
bulk of mbufs taken from pool.
In case of error unused mbufs are put back to pool.
Fixes: c203497667 ("net/ena: add Rx out of order completion")
Cc: stable@dpdk.org
Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
The memcpy operation overwrites the device info fields set
by ethdev API and leaves the device field undefined.
Thus, replaces memcpy by only updating the required fields
at the driver layer.
error log: testpmd> show port info 1
**** Infos for port 1 ****
MAC address: 00:00:00:00:00:00
Device name: net_softnic0
Segmentation fault.
port_infos_display (port_id=1) at /dpdk/app/test-pmd/config.c:418
if (dev_info.device->devargs && dev_info.device->devargs->args)
Fixes: cc6d421574 ("net/softnic: add softnic PMD")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
DCR is Intel internal information, no need to be in public code.
Fixes: de2cd512b1 ("net/i40e/base: new AQ commands for cloud filter")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
When compiling with gcc -O1, this error appears:
drivers/net/mlx4/mlx4_ethdev.c: In function ‘mlx4_rxmode_toggle’:
rte_log.h:321:3: error:
‘mode’ may be used uninitialized in this function
The function mlx4_rxmode_toggle is never called with a value which
is not in the switch block, but GCC complains about it with -O1.
So the default case is "fixed" by setting string "undefined".
Fixes: eacaac7bae ("net/mlx4: restore promisc and allmulti support")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
This patch checks the return value of function
rte_eth_bond_8023ad_agg_selection_set() in bond_ethdev_configure
for error return value.
Fixes: 6d72657ce3 ("net/bonding: add other aggregator modes")
Cc: stable@dpdk.org
Signed-off-by: Lee Daly <lee.daly@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Private vdev was the way previously, when pdump developed, now with
shared device mode on virtual devices, pcap data path in secondary
is not working.
When secondary adds a virtual device, related data transferred to
primary and primary creates the device and shares device back with
secondary. When pcap device created in primary, pcap handlers
(pointers) are process local and they are not valid for secondary
process. This breaks secondary.
So we can't directly share the pcap handlers, but need to create a new
set of handlers for secondary, that's what we done in this patch.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
This is prework for data path enabling for secondary process.
To prevent pcap handler opened by one process be overwritten by
another process, each process should have their private copy,
`rte_eth_dev->process_private` is exactly what we needed.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tx offload mask is updated in following commit 1037ed842c
("mbuf: fix Tx offload mask"). Currently, the new added offload
flags are not supported in PMD and application will fail to call
PMD transmit prepare function.
This patch updates AVF_TX_OFFFLOAD_MASK.
Fixes: 1037ed842c ("mbuf: fix Tx offload mask")
Cc: stable@dpdk.org
Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
When eth_octeontx is initialized before event_octeontx, eth_octeontx
would initiate setting up of the event device with the max ports and
queues available. If number of ports is more than the number of queues,
some ports would be left unused when the ports and queues are mapped
1:1. But even in that case the ports need to be setup, or otherwise it
would lead to a segmentation fault when event device is started.
Fixes: f7be70e513 ("net/octeontx: add net device probe and remove")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
When queues are stopped release Tx buffers.
During start initialize array of empty Tx/Rx reqs with default values.
Fixes: df238f84c0 ("net/ena: recreate HW IO rings on start and stop")
Cc: stable@dpdk.org
Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
Update the mlx5_flow_validate_item_mpls() function to allow
MPLS over IP, UDP, and GRE.
Modify the flow_dv_validate() function with the new logic introduced
in previous patch of this series: set new variable last_item
after each validation, update item_flags after each item iteration.
The new variable last_item is sent to mlx5_flow_validate_item_mpls()
and used to validate the MPLS item.
Same change implemented in flow_verbs_validate().
Update the mlx5_flow_validate_item_mpls() function to verify that
device configuration has mpls_en set to 1.
This code was added earlier this year, but unintentionaly removed
in recent versions.
Fixes: 84c406e745 ("net/mlx5: add flow translate function")
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
The support in MPLS on this flow engine was overlooked. It's absence is
critical because there are required actions for MPLS which can be done
only with the DV engine.
To set correctly the MPLS filter, we need to reason about the flow item
before the MPLS (UDP, GRE or other).
To do that, a new variable last_item was added and updated after each
translation. the full item flags are updated after each item iteration.
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Unnecessary volatile attribute keeps compiler from further optimizing the
code and this results in a little performance drop (~2%). Because of memory
barriers, it is safe to remove.
Fixes: 6bf10ab69b ("net/mlx5: support 32-bit systems")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
There's some performance drop due to extra condition checks on the
datapath. Checking for external memory registration should be consolidated
to the existing bottom-half.
Fixes: 7e43a32ee0 ("net/mlx5: support externally allocated static memory")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
There's some performance drop due to extra condition checks on the
datapath. Checking for external memory registration should be consolidated
to the existing bottom-half.
Fixes: 31912d9924 ("net/mlx4: support externally allocated static memory")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
The flow_dv_query() just returns -ENOTSUP value and does not
set provided error parameter structure, that crashes the
port_flow_query(). The patch fixes flow_db_query(), now it
sets an error parameter structure.
Fixes: 684dafe795 ("net/mlx5: add flow query abstraction interface")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
This patch fixes compilation errors with meson and the clang
compiler caused by some of the struct members not being
initialized.
```
../drivers/net/mlx5/mlx5_mr.c:345:37: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
struct mlx5_mr_cache entry = { 0, };
^
../drivers/net/mlx5/mlx5_mr.c:389:36: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
struct mlx5_mr_cache ret = { 0, };
^
../drivers/net/mlx5/mlx5_mr.c:691:35: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
struct mlx5_mr_cache ret = { 0, };
^
```
The compilation errors reproduce with
clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.
Fixes: e1114ff6a5 ("net/mlx5: support e-switch flow count action")
Fixes: db48f9db5d ("net/mlx5: support new flow counter API")
Fixes: 974f1e7ef1 ("net/mlx5: add new memory region support")
Fixes: 65c9d24170 ("net/mlx5: enable loopback by configured mode")
Fixes: 87011737b7 ("mlx5: add software counters")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
This patch fixes compilation errors with meson and the clang
compiler caused by some of the struct members not being
initialized.
```
../drivers/net/mlx4/mlx4_mr.c:357:37: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
struct mlx4_mr_cache entry = { 0, };
^
../drivers/net/mlx4/mlx4_mr.c:401:36: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
struct mlx4_mr_cache ret = { 0, };
^
../drivers/net/mlx4/mlx4_mr.c:691:35: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
struct mlx4_mr_cache ret = { 0, };
^
```
The compilation errors reproduce with
clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.
Fixes: 9797bfcce1 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
This patch adds the in_hw flag check for tc flower filter rules.
If rule is applied without skip_sw flag set driver should check
whether the in_hw flag is set after rule applying. If no in_hw
flag set found it means the rule is not hardware offloaded and
error should be returned to application.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
The tc flower filter rules are used to control E-switch from
the application side. In order to gain garanteed rule hardware
offload the skip_sw flag should be specified while applying the
rule. But some tc rules is rejected by kernel if skip_sw flag
is set by design. Currently this regards VXLAN tunneling rules,
which are applied to special VXLAN virtual devices. Albeit these
rules are applied with skip_sw flag reset kernel tries to
perform hardware offload. If kernel succeeded the in_hw flag
is set in rule properties and application should check this
flag to get know whether the applied rule is actually hardware
offloaded.
This patch prepares for the rule flags query and check in_hw flag.
The driver checks only the rules with skip_sw flag reset, so we
need to test the actual flags of rule is being applied. The pointer
to flags field into translated rule is introduced and flags are
tested directly in the rule body. It is more reliable than save and
check flags copy.
Also patch swaps the flow_tcf_apply() and flow_tcf_remove(),
we are going to call flow_tcf_remove() from flow_tcf_appy() if
no in_hw flag set found in applied rule.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
While receiving the Netlink reply messages we should stop at DONE
or ACK message. The existing implementation stops at DONE message
or if no multiple message flag set ( NLM_F_MULTI). It prevents
the single query requests from working, these requests send the
single reply message without multi-message flag followed by
ACK message. This patch fixes receiving part of Netlink
communication routine.
Fixes: 6e74990b34 ("net/mlx5: update E-Switch VXLAN netlink routines")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
This patch removes the unused message length parameter, we
do not send multiple commands in the single message anymore,
message length can be taken from the prepared message header,
so length parameter can be removed.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
The assignment should be done after initialization, or it will be zero.
Fixes: 264b23e3d2 ("net/i40e: add parameter check for RSS flow init")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
As the code has changed the max wait time to 1000ms, the comment should
be changed accordingly.
Fixes: 64f1c8539c ("net/ixgbe: wait longer for link after fiber MAC setup")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
There's an issue that X710 can't receive any packet after
reading some special registers. That's because these
registers are only valid for X722, read access for non-X722
will cause ECC error.
Fixes: d9efd0136a ("i40e: add EEPROM and registers dumping")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
There need an parameter check for RSS flow init, or it may cause
core dump if pointer is NULL in memory copy.
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
For ixgbevf kernel driver, link status changes from down to up
will trigger vf kernel driver send IXGBE_VF_RESET message to pf
kernel driver, after this, vf kernel driver will disable and enable
it self. By these series operations, the vf kernel driver report
link up. Besides, all these operations handles in kernel thread.
For DPDK user space driver, it only gets link status changes from
down to up, but miss IXGBE_VF_RESET message sending and reset itself.
If we will add fully implementation of link status change for DPDK
user space driver, we need take much more modification. We have
aligned that for link status changes from down to up we only notify
link is up, users need to reset vf port.
Fixes: dc66e5fd01 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org
Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
As mlx5_flow_hashfields_adjust() refers to flow->rss, actions must be
translated prior to items like in Verbs. Otherwise, hash fields are not
correctly set.
Fixes: d02cb06912 ("net/mlx5: add Direct Verbs translate actions")
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
The current code wrongly assumes that packets are non-TSO and ends up
rejecting large TSO packets. Check non-TSO and TSO max packet sizes
separately.
Fixes: 5a12c38740 ("net/enic: check maximum packet size in Tx prepare handler")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
Fields in the struct efx_filter_spec_t starting from efs_outer_vid
are hashed for software filter lookup. efs_mark is not a matching
criteria. Exclude efs_mark from hash.
Fixes: 5f78af5239 ("net/sfc: support MARK and FLAG actions in flow API")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tunneling offloads are represented by multi-bit values. So, feature
wise tunneling offload can only be entirely supported/unsupported
using PKT_TX_TUNNEL_MASK. Its upon PMDs to further isolate which of
the tunneling offload types are supported by respective PMD.
Using subset of bits from PKT_TX_TUNNEL_MASK to indicate supported vs
unsupported offloads can lead to undesired result.
Use PKT_TX_TUNNEL_MASK in QEDE_TX_OFFLOAD_MASK and use independent
value of supported PKT_TX_TUNNEL_* in .tx_pkt_prepare() to mark
supported tunnel offloads.
Fixes: 44346c24b7 ("net/qede: fix VXLAN tunnel Tx offload flag setting")
Cc: stable@dpdk.org
Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
Reviewed-by: Rasesh Mody <rasesh.mody@cavium.com>
When the priv_size of the mbuf is > 128 bytes, the mbuf would not be
properly constructed. This would lead to a corrupt mbuf.
This patch fixes the issue by accounting for
rte_pktmbuf_priv_size(pool) and RTE_PKTMBUF_HEADROOM
while configuring first skip register calculation.
Fixes: 197438ee9f ("net/octeontx: add Rx queue setup and release ops")
Cc: stable@dpdk.org
Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Nitin Saxena <nitin.saxena@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
The ethdev flag RTE_ETH_DEV_CLOSE_REMOVE is set for drivers
having migrated to the new behaviour of rte_eth_dev_close().
As any other flag, it can be useful to know about its value
as soon as the port is probed.
Unfortunately, it was set inside the close operation,
just before being erased by memset() in rte_eth_dev_release_port().
The flag assignment is moved to the probing stage, so it can
be checked by the application in order to anticipate the behaviour.
Fixes: 42603bbdb5 ("net/mlx5: release port on close")
Fixes: 6c99085d97 ("net/vmxnet3: fix hot-unplug")
Fixes: 4d7877fde2 ("net/ena: remove resources when port is being closed")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Currently, if configuration fails (for example if a 100G card is used
with an odd number of RX/TX queues) QEDE crashes due to a null pointer
dereference.
This commit fixes it by checking that the pointer is not NULL before
using it.
Fixes: 7105b24f4b ("net/qede: fix memory alloc for multiple port reconfig")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
If rule contains tunneling action (like VXLAN encapsulation)
the VTEP (Virtual Tunneling EndPoint) device is pre-configured
before applying the rule. If kernel returns an error this
VTEP configuration should be rolled back to the origin state.
The patch adds the missing VTEP configuration restoration.
Fixes: 95a464cecc ("net/mlx5: add E-switch VXLAN tunnel devices management")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
The VXLAN related rule cleanup routine queries and gathers all
existing local IP and neigh rules into buffer list. One buffer
may contain multiple rule deletion commands and is prepared
to send into Netlink as single message. But, if error occurs
for some deletion commands in the buffer, the multiple ACK
message with errors can be send back by the kernel. It breaks
the Netlink communication sequence numbers, because we expect
only one ACK message and it smashes out futher Netlik
communication.
The workaround of this problem is to send rule deletion commands
from buffer in one-by-one fashion and get ACK message for every
command sent. We do not expect too may rules preexist, so there
should not be critical performance degradation at VXLAN outer
interface initialization.
Fixes: f420f03d67 ("net/mlx5: add E-switch VXLAN rule cleanup routines")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This patch is preparation for the following fix, we are going to send
Netlink message from buffer in one-by-one fashion. It is highly
desirable to check multimessage buffer consistency for debug purposes.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
The Netlink message buffer is allocated and there is the typo,
the other pointer is checked instead of returned one. If no
memory is allocated and NULL is returned by allocation routine
the bug causes segmentation fault. The patch fixes typo,
returned pointer is validated.
Fixes: f420f03d67 ("net/mlx5: add E-switch VXLAN rule cleanup routines")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Don't fail the build if pkg-config can't be found, instead print the
linker flag as it was doing before the change.
Fixes: b6b8793919 ("net/mlx5: use pkg-config to handle SUSE libmnl")
Cc: stable@dpdk.org
Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Fix the flow_fdir_cmp() function, used by flow_fdir_filter_lookup().
This function is used by flow_fdir_filter_add() to check if same rule
exists, and by flow_fdir_filter_delete() to find flow rule to delete.
The function compared actions conf pointers, changed to compare
actions type only.
Fixes: 2720f833d4 ("net/mlx5: add missing flow director delete")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
When stopping a bonded port all slaves are deactivated. Attempting
to deactivate a slave that was never activated will result in a segfault
when mode 4 is used.
Fixes: 7486331308 ("net/bonding: stop and deactivate slaves on stop")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
In general the VF driver should not access the chip. For VF link status
update, VF driver should not use HW lock, use bnx2x_link_report_locked()
instead.
Add few prints for releasing previously held HW locks.
Fixes: a9b58b15ed ("net/bnx2x: fix to add PHY lock")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Use rte_log() rather than RTE_LOG() for dynamic logging. Rearrange
dynamic log types to the top and configurable log types to bottom.
Remove unused RTE_LIBRTE_BNX2X_DEBUG_TX_FREE
Fixes: ba7eeb035a ("net/bnx2x: fix logging to include device name")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
For performance reasons, word1 of send_hdr_s
sub descriptor was not cleared assuming it is always
having default value of zero since it comes from fixed
offsets of SQ buffer.
This is causing issues in case of SG mode because,
the size of send command might change and hence the word1
of send_hdr_s is not always at fixed offsets of the SQ buffer
and hence not having default value of zero.
This fixes the issue by clearing the word1 in case of SG mode
for every packet.
Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx")
Cc: stable@dpdk.org
Signed-off-by: Subrahmanyam Nilla <snilla@caviumnetworks.com>
Signed-off-by: Nithin Dabilpuram <nithin.dabilpuram@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Individual MPS TCAM entries are not allocated as separate entities.
All entries are allocated once as an array. So, fix bug with attempting
to free illegal memory location.
Also add missing MPS TCAM initialization for CXGBEVF.
Fixes: 6fda3f0ddd ("net/cxgbe: add API to program hardware MPS table")
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Set the "value" in the filter spec and not the "mask". Also, remove
duplicate comparison for hardware supported match items already done
earlier.
Fixes: af44a57798 ("net/cxgbe: support to offload flows to HASH region")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Under heavy load, flow related operations can take more time to
complete. Increase max completion wait time to 10 seconds. Also
increase max receive budget to read more replies from firmware
in every cycle.
Fixes: 9eb2c9a480 ("net/cxgbe: implement flow create operation")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Fix issue where ethertype is set to 0x800 for IPv4 by ether match
item and IPv4 match item also inherently sets ethertype to 0x800.
Current logic returns error when IPv4 match item is parsed. So, fix
by only bailing if the redefined match items have different values.
Fixes: ee61f5113b ("net/cxgbe: parse and validate flows")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
The AltiVec header file breaks boolean type:
error: incompatible types when initializing type
'__vector _bool int' {aka '_vector(4) __bool int'} using type 'int'
If __APPLE_ALTIVEC__ is defined, then bool type is redefined
and conflicts with stdbool.h.
There is no good solution to fix it for the whole project without
breaking something else, so a workaround is inserted in mlx5 PMD.
This workaround is not compatible with C++ but there is no C++ in DPDK.
Suggested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: David Wilder <dwilder@us.ibm.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
This patch fixes the variable 'phy_word' may be used uninitialized.
Fixes: 5b6439cf03 ("e1000/base: support different EEARBC for i210")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
In scenarios for multiq or flowq setup failure
`rte_eth_dev_probing_finish()` has to be invoked for successful device
registration.
Fixes: fbe90cdd77 ("ethdev: add probing finish function")
Cc: stable@dpdk.org
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
- Currently, no device supports partial mask for protocol in IP header.
- As there could be multiple IP items, next_protocol variable in flow
validation has to be reset for inner layer. Otherwise, inner TCP/UDP
will see protocol number of outer IP header.
- Remove redundant protocol checking for MPLS, which is done in
mlx5_flow_validate_item_mpls().
Fixes: 3d69434113 ("net/mlx5: add Direct Verbs validation function")
Fixes: 23c1d42c71 ("net/mlx5: split flow validation to dedicated function")
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
dev_flow->verbs is mistakenly used instead of dev_flow->dv. A sanity
check is added for debugging purpose.
Fixes: fc2c498ccb ("net/mlx5: add Direct Verbs translate items")
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Static analysis tools don't like the fact that fd could be zero
in the error path. This won't happen in real world because
stdin would have to be closed, then other error occurring.
Coverity issue: 14079
Fixes: 02f96a0a82 ("net/tap: add TUN/TAP device PMD")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Some toolchain has fls() definition in string.h as argument type int,
which is conflicting uint32_t argument type.
/export/dpdk.org/lib/librte_eal/common/rte_reciprocal.c:47:19:
error: conflicting types for ‘fls’
static inline int fls(uint32_t x)
^~~
/opt/marvell-tools-201/aarch64-marvell-elf/include/strings.h:59:6:
note: previous declaration of ‘fls’ was here
int fls(int) __pure2;
FreeBSD string.h also has fls() with argument as int type.
https://www.freebsd.org/cgi/man.cgi?query=fls&sektion=3
Fixing the conflict by using rte version of fls.
Fixes: ffe3ec811e ("sched: introduce reciprocal divide")
Fixes: faf2b25c9f ("fm10k: support VMDQ in multi-queue configuration")
Cc: stable@dpdk.org
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
The netvsc device calls VF (if present) to update the link status
with the wrong device. This leads to errors in mlx5 device when it
can't find the ifindex.
Fixes: dc7680e859 ("net/netvsc: support integrated VF")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
ag_cons is used uninitialized, it is used when DEBUG enabled, remove
debug code.
Fixes: 0958d8b643 ("net/bnxt: support LRO")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Previously, there is instability during vector Rx if descriptor
number is not power of 2, e.g. process hang and some Rx packets
are unexpectedly empty. That's because vector Rx mode assumes Rx
descriptor number is power of 2 when doing bit mask.
This patch allows vector mode only when the number of Rx descriptor
is power of 2.
Fixes: 8e109464c0 ("i40e: allow vector Rx and Tx usage")
Fixes: a3c83a2527 ("net/i40e: enable runtime queue setup")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This patch adds support for the rx_queue_count API in mlx5 driver
Signed-off-by: Tom Barbette <barbette@kth.se>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Tx offload mask is updated in following commit 1037ed842c
("mbuf: fix Tx offload mask") Currently, the new added offload
flags are not supported in PMD and application will fail to call
PMD transmit prepare function.
This patch updates IGB_TX_OFFFLOAD_MASK.
Fixes: 1037ed842c ("mbuf: fix Tx offload mask")
Cc: stable@dpdk.org
Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Even though flow_drv_prepare() takes item_flags and action_flags to be
filled in, those are not used and will be overwritten by parsing of
flow_drv_translate(). There's no reason to keep the flags and fill it.
Appropriate notes are added to the documentation of flow_drv_prepare() and
flow_drv_translate().
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
1) Fix layer parsing
In translation of tunneled flows, dev_flow->layers must not be used to
check tunneled layer as it contains all the layers parsed from
flow_drv_prepare(). Checking tunneled layer is needed to distinguish
between outer and inner item. This should be based on dynamic parsing. With
dev_flow->layers on a tunneled flow, items will always be interpreted as
inner as dev_flow->layer already has all the items. Dynamic parsing
(item_flags) is added as there's no such code.
2) Refactoring code
- flow_dv_create_item() and flow_dv_create_action() are merged into
flow_dv_translate() for consistency with Verbs and *_validate().
Fixes: 2466364115 ("net/mlx5: fix flow tunnel handling")
Fixes: d02cb06912 ("net/mlx5: add Direct Verbs translate actions")
Fixes: fc2c498ccb ("net/mlx5: add Direct Verbs translate items")
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
1) Fix layer parsing
In translation of tunneled flows, dev_flow->layers must not be used to
check tunneled layer as it contains all the layers parsed from
flow_drv_prepare(). Checking tunneled layer is needed to set
IBV_FLOW_SPEC_INNER and it should be based on dynamic parsing. With
dev_flow->layers on a tunneled flow, items will always be interpreted as
inner as dev_flow->layer already has all the items.
2) Refactoring code
It is partly because flow_verbs_translate_item_*() sets layer flag. Same
code is repeating in multiple locations and that could be error-prone.
- Introduce VERBS_SPEC_INNER() to unify setting IBV_FLOW_SPEC_INNER.
- flow_verbs_translate_item_*() doesn't set parsing result -
MLX5_FLOW_LAYER_*.
- flow_verbs_translate_item_*() doesn't set priority or adjust hashfields
but does only item translation. Both have to be done outside.
- Make more consistent between Verbs and DV.
3) Remove flow_verbs_mark_update()
This code can never be reached as validation prohibits specifying mark and
flag actions together. No need to convert flag to mark.
Fixes: 84c406e745 ("net/mlx5: add flow translate function")
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Applications which add RSS rules must supply an RSS key and length.
If an application is only interested in default RSS operation it
should not care about the exact RSS key.
By setting the key to NULL - the PMD will use the default RSS key.
In addition if the application does not care about the RSS type it can
set it to 0 and the PMD will use the default type (ETH_RSS_IP).
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Due to a limitation on driver/FW, priority ranges from 1 to 16 in kernel.
Priority in rte_flow attribute starts from 0 and is added by 1 in
translation. This is subject to be changed to determine the max priority
based on trial-and-error like Verbs driver once the restriction is lifted
or the range is extended.
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Add txqs_max_vec parameter to configure the maximum number of Tx queues to
enable vectorized Tx. And its default value is set according to the
architecture and device type.
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
When a device is spawned, it does make more sense that the configuration
parameters are passed by callee. Furthermore, setting default value for
some configuration would need PCIe device ID which can be found in the
probe function.
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
The last part of patchset contains the rule cleanup routines.
These ones is the part of outer interface initialization at
the moment of VXLAN VTEP attaching. These routines query
the list of attached VXLAN devices, the list of local IP
addresses with peer and link scope attribute and the list
of permanent neigh rules, then all found abovementioned
items on the specified outer device are flushed.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
VXLAN encap rules are applied to the VF ingress traffic and have the
VTEP as actual redirection destinations instead of outer PF.
The encapsulation rule should provide:
- redirection action VF->PF
- VF port ID
- some inner network parameters (MACs/IP)
- the tunnel outer source IP (v4/v6)
- the tunnel outer destination IP (v4/v6). Current
- VNI - Virtual Network Identifier
There is no direct way found to provide kernel with all required
encapsulatioh header parameters. The encapsulation VTEP is created
attached to the outer interface and assumed as default path for
egress encapsulated traffic. The outer tunnel IP address are
assigned to interface using Netlink, the implicit route is
created like this:
ip addr add <src_ip> peer <dst_ip> dev <outer> scope link
Peer address provides implicit route, and scode link reduces
the risk of conflicts. At initialization time all local scope
link addresses are flushed from device (see next part of patchset).
The destination MAC address is provided via permenent neigh rule:
ip neigh add dev <outer> lladdr <dst_mac> to <dst_ip> nud permanent
At initialization time all neigh rules of this type are flushed
from device (see the next part of patchset).
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
VXLAN interfaces are dynamically created for each local UDP port
of outer networks and then used as targets for TC "flower" filters
in order to perform encapsulation. These VXLAN interfaces are
system-wide, the only one device with given UDP port can exist
in the system (the attempt of creating another device with the
same UDP local port returns EEXIST), so PMD should support the
shared device instances database for PMD instances. These VXLAN
implicitly created devices are called VTEPs (Virtual Tunnel
End Points).
Creation of the VTEP occurs at the moment of rule applying. The
link is set up, root ingress qdisc is also initialized.
Encapsulation VTEPs are created on per port basis, the single
VTEP is attached to the outer interface and is shared for all
encapsulation rules on this interface. The source UDP port is
automatically selected in range 30000-60000.
For decapsulaton one VTEP is created per every unique UDP
local port to accept tunnel traffic. The name of created
VTEP consists of prefix "vmlx_" and the number of UDP port in
decimal digits without leading zeros (vmlx_4789). The VTEP
can be preliminary created in the system before the launching
application, it allows to share UDP ports between primary
and secondary processes.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
The counters for E-Switch rules were erroneously deleted in
flow_tcf_remove() routine. The counters deletion is moved to
flow_tcf_destroy() routine.
Fixes: e1114ff6a5 ("net/mlx5: support e-switch flow count action")
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This part of patchset updates Netlink exchange routine. Message
sequence numbers became not random ones, the multipart reply messages
are supported, not propagating errors to the following socket calls,
Netlink replies buffer size is increased to MNL_SOCKET_BUFFER_SIZE
and now is preallocated at context creation time instead of stack
usage. This update is needed to support Netlink query operations.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This part of patchset adds support of VXLAN-related items and
actions to the flow translation routine. Later some tunnel types,
other than VXLAN can be addedd (GRE). No VTEP devices are created at
this point, the flow rule is just translated, not applied yet.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
The e-switch Flow prepare function is updated to support VXLAN
encapsulation/and decapsulation actions. The function calculates
buffer size for Netlink message and Flow description structures,
including optional ones for tunneling purposes.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This patch adds VXLAN support for flow item/action lists validation.
The following entities are now supported:
- RTE_FLOW_ITEM_TYPE_VXLAN, contains the tunnel VNI
- RTE_FLOW_ACTION_TYPE_VXLAN_DECAP, if this action is specified
the items in the flow items list treated as outer network
parameters for tunnel outer header match. The ethernet layer
addresses always are treated as inner ones.
- RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP, contains the item list to
build the encapsulation header. In current implementation the
values is the subject for some constraints:
- outer source MAC address will be always unconditionally
set to the one of MAC addresses of outer egress interface
- no way to specify source UDP port
- all abovementioned parameters are ignored if specified
in the rule, warning messages are sent to the log
Minimal tunneling support is also added. If VXLAN decapsulation
action is specified the ETH item can follow the VXLAN VNI item,
the content of this ETH item is treated as inner MAC addresses
and type. The outer ETH item for VXLAN decapsulation action
is always ignored.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
The rule validation function for E-Switch checks item list first,
then action list is checked. This patch swaps the validation order,
now actions are checked first. This is preparation for validation
function update with VXLAN tunnel actions. VXLAN decapsulation
action requires to check the items in special way. We could do
this special check in the single item check pass if the action
flags were gathered before. This is the reason to swap the
item/actions checking loops.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This patch introduces the data structures needed to implement VXLAN
encapsulation/decapsulation hardware offload support for E-Switch.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This patch contains tc flower related and some other definitions
needed to implement VXLAN encapsulation/decapsulation hardware
offload support for E-Switch.
mlx5 driver dynamically creates and manages the VXLAN virtual
tunnel endpoint devices, the following definitions control
the parameters of these network devices:
- MLX5_VXLAN_PORT_MIN - minimal allowed UDP port for VXLAN device
- MLX5_VXLAN_PORT_MAX - maximal allowed UDP port for VXLAN device
- MLX5_VXLAN_DEVICE_PFX - name prefix of driver created VXLAN device
The mlx5 drivers creates the VXLAN devices with UDP port within
specified range, devices have the names with specified prefix,
followed by decimal digits of UDP port.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This patch updates meson.build before adding E-Switch VXLAN
encapsulation/decapsulation hardware offload support.
E-Switch rules are controlled via tc Netilnk commands,
so we need to include tc related headers, and check for
some tunnel specific key definitions.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This patch updates makefile before adding E-Switch VXLAN
encapsulation/decapsulation hardware offload support.
E-Switch rules are controlled via tc Netilnk commands,
so we need to include tc related headers, and check for
some tunnel specific key definitions.
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
After the patch below the call to rte_eth_bond_8023ad_agg_selection_set
from probe() segfaults; there is no need to call the function, just set
the mode directly.
Also, reverted 1620175b40.
Fixes: 391797f042 ("drivers/bus: move driver assignment to end of probing")
Fixes: 1620175b40 ("net/bonding: fix invalid port id")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>