Commit Graph

6316 Commits

Author SHA1 Message Date
Viacheslav Ovsiienko
e71b32f172 net/mlx5: fix VLAN inner ethernet type on E-Switch
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>
2018-11-22 16:17:31 +01:00
Yanglong Wu
ff30a020bb net/ixgbe: fix TDH register write
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>
2018-11-22 13:58:23 +01:00
Shahed Shaikh
3985ea528a net/qede: fix Tx offload mask
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>
2018-11-22 10:31:25 +01:00
Rafal Kozik
79405ee175 net/ena: fix out of order completion
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>
2018-11-22 09:50:39 +01:00
Jasvinder Singh
66cdfd67c5 net/softnic: fix undefined device info fields
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>
2018-11-21 16:23:56 +01:00
Ferruh Yigit
1a0833efde net/i40e/base: fix comment referencing internal data
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>
2018-11-20 12:42:50 +01:00
Rasesh Mody
39150b6e73 net/bnx2x: bump version to 1.0.7.1
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
2018-11-20 10:09:37 +01:00
Thomas Monjalon
554f06d10b net/mlx4: fix possible uninitialized variable
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>
2018-11-23 01:43:39 +01:00
Lee Daly
6f4ae7f5d9 net/bonding: fix possible silent failure in configuration
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>
2018-11-16 18:27:55 +01:00
Qi Zhang
0d0dd2d9d8 net/pcap: enable data path for secondary process
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>
2018-11-16 16:56:19 +01:00
Qi Zhang
0ecfb6c04d net/pcap: move handler to process private
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>
2018-11-16 16:55:10 +01:00
Zhirun Yan
d31c844435 net/avf: fix Tx offload mask
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>
2018-11-16 16:28:52 +01:00
Anoob Joseph
7efd5202f7 net/octeontx: fix failures when available ports > queues
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>
2018-11-16 12:03:54 +01:00
Rafal Kozik
778677dcb2 net/ena: fix cleaning HW IO rings configuration
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>
2018-11-16 11:49:51 +01:00
Ferruh Yigit
fe4fc7d694 net/mvpp2: fix possible uninitialized variable access
Fixes: cdb53f8da6 ("net/mvpp2: support metering")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
2018-11-16 11:13:51 +01:00
Dekel Peled
c5e508f0c3 net/mlx5: fix packet type for MPLS in UDP
Change the relevant value in tunnels_info[] to match tunnel type.

Fixes: a4a5cd21d2 ("net/mlx5: add flow MPLS item")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-11-16 10:45:37 +01:00
Dekel Peled
38f7efaaf5 net/mlx5: fix MPLS item validation
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>
2018-11-16 10:45:37 +01:00
Dekel Peled
d1abe664dd net/mlx5: add MPLS to Direct Verbs flow engine
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>
2018-11-16 10:45:37 +01:00
Yongseok Koh
545db54c7c net/mlx5: optimize Rx buffer replenishment threshold
Due to redundant calculation per every burst, performance drops a little.

Fixes: e10245a13b ("net/mlx5: fix Rx buffer replenishment threshold")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-11-16 10:45:37 +01:00
Yongseok Koh
317e64739d net/mlx5: optimize Tx doorbell write
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>
2018-11-16 10:45:37 +01:00
Yongseok Koh
feddd5d243 net/mlx5: optimize Tx external memory registration
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>
2018-11-16 10:45:37 +01:00
Yongseok Koh
1948776360 net/mlx4: optimize Tx external memory registration
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>
2018-11-16 10:45:37 +01:00
Yongseok Koh
57e1073bdc net/mlx5: fix flow destruction
As flow_drv_destroy() frees dev_flow, flow_rxq_flags_trim() must be called
ahead.

Fixes: 84c406e745 ("net/mlx5: add flow translate function")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-11-16 10:45:37 +01:00
Viacheslav Ovsiienko
a3166356ab net/mlx5: fix flow query routine in Direct Verbs
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>
2018-11-16 10:45:38 +01:00
Ali Alnubani
0c15f3c010 net/mlx5: fix initialization of struct members
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>
2018-11-16 10:44:55 +01:00
Ali Alnubani
d924d6b964 net/mlx4: fix initialization of struct members
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>
2018-11-15 23:54:53 +01:00
Ali Alnubani
d77b9aac5d net/mlx5: fix minor typos
Fixes: e1114ff6a5 ("net/mlx5: support e-switch flow count action")
Fixes: 974f1e7ef1 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-11-15 23:54:53 +01:00
Ali Alnubani
96c0cc17fc net/mlx4: fix minor typo
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>
2018-11-15 23:54:53 +01:00
Viacheslav Ovsiienko
6526d465f0 net/mlx5: add E-switch rule hardware offload flag check
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>
2018-11-15 23:54:53 +01:00
Viacheslav Ovsiienko
59d6457111 net/mlx5: prepare to add E-switch rule flags check
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>
2018-11-15 23:54:53 +01:00
Viacheslav Ovsiienko
84cacbe34b net/mlx5: fix Netlink communication routine
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>
2018-11-15 23:54:53 +01:00
Viacheslav Ovsiienko
ccdb3b2373 net/mlx5: remove unused TC message length parameter
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>
2018-11-15 23:54:53 +01:00
Wei Zhao
2e00f9e70e net/i40e: fix RSS key initialization
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>
2018-11-15 23:32:46 +01:00
Xiaolong Ye
73247f1ced net/ixgbe: fix maximum wait time in comment
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>
2018-11-15 23:32:01 +01:00
Beilei Xing
199efc4ac5 net/i40e: fix X710 Rx after reading some registers
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>
2018-11-15 23:31:28 +01:00
Wei Zhao
264b23e3d2 net/i40e: add parameter check for RSS flow init
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>
2018-11-14 00:35:53 +01:00
Yanglong Wu
91546fb62e net/ixgbevf: fix link state
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>
2018-11-14 00:35:53 +01:00
Yongseok Koh
e31b6a4151 net/mlx5: fix Direct Verbs RSS hash field
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>
2018-11-14 00:35:53 +01:00
Hyong Youb Kim
7ac790d63b net/enic: fix size check in Tx prepare handler
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>
2018-11-14 00:35:53 +01:00
Igor Romanov
f7c8539801 net/sfc/base: fix field order in filter spec struct
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>
2018-11-14 00:35:53 +01:00
Shahed Shaikh
49d3978d57 net/qede: fix Tx tunnel offload support mask
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>
2018-11-14 00:35:53 +01:00
Nitin Saxena
679dfdc96e net/octeontx: fix mbuf corruption with large private sizes
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>
2018-11-14 00:35:53 +01:00
Thomas Monjalon
15febafdd4 drivers/net: set close behaviour flag at probing
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>
2018-11-14 00:35:53 +01:00
Timothy Redaelli
69d3e963e4 net/qede: fix crash when configure fails
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>
2018-11-14 00:35:53 +01:00
Shahaf Shuler
325384fcd9 net/mlx5: remove GRE inner IPv6 matching limitation
Such limitation seems not to exist on:
 - MLNX_OFED_linux-4.5-0.3.0.0 (Beta)
 - MLNX_OFED_LINUX-4.4-2.0.7.0 (GA)
 - upstream kernel 4.19.0-rc7

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-11-14 00:35:53 +01:00
Viacheslav Ovsiienko
817a6c4740 net/mlx5: fix VXLAN device rollback if rule apply fails
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>
2018-11-14 00:35:53 +01:00
Viacheslav Ovsiienko
1f64486170 net/mlx5: fix rule cleanup Netlink command sending
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>
2018-11-14 00:35:53 +01:00
Viacheslav Ovsiienko
b9e5c3ab2e net/mlx5: add Netlink message size check in rule cleanup
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>
2018-11-14 00:35:53 +01:00
Viacheslav Ovsiienko
00ae11c4e8 net/mlx5: fix buffer allocation check in rule cleanup
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>
2018-11-14 00:35:53 +01:00
Luca Boccassi
0c9df53de4 net/mlx5: fallback quietly if pkg-config is unavailable
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>
2018-11-14 00:35:53 +01:00
Dekel Peled
99813c2a32 net/mlx5: fix flow director add and delete
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>
2018-11-14 00:35:53 +01:00
Radu Nicolau
0911d4ec01 net/bonding: fix crash when stopping mode 4 port
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>
2018-11-14 00:35:53 +01:00
Rasesh Mody
39ae74caa0 net/bnx2x: fix VF link state update
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>
2018-11-14 00:35:53 +01:00
Rasesh Mody
853c782496 net/bnx2x: fix dynamic logging
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>
2018-11-14 00:35:53 +01:00
Tiwei Bie
ecfae1510e net/virtio: fix unchecked return value
Coverity issue: 302861
Fixes: 6ba1f63b5a ("virtio: support specification 1.0")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-11-14 00:35:53 +01:00
Tiwei Bie
2dac0df47c net/virtio-user: fix typo in error message
The param we are checking is VIRTIO_USER_ARG_PATH, instead
of VIRTIO_USER_ARG_QUEUE_SIZE.

Fixes: ce2eabdd43 ("net/virtio-user: add virtual device")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
2018-11-14 00:35:53 +01:00
Subrahmanyam Nilla
823ebfc219 net/thunderx: fix Tx desc corruption in scatter-gather mode
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>
2018-11-14 00:35:53 +01:00
Rahul Lakkireddy
27e5d9000c net/cxgbevf: fix illegal memory access when freeing MPS TCAM
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>
2018-11-14 00:35:53 +01:00
Rahul Lakkireddy
34ca5e3eb7 net/cxgbe: fix wrong ingress port value set in filter spec
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>
2018-11-14 00:35:53 +01:00
Rahul Lakkireddy
f1e9d2afea net/cxgbe: increase completion wait time for flow operations
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>
2018-11-14 00:35:53 +01:00
Rahul Lakkireddy
15fb77f62c net/cxgbe: fix check for redefined match items
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>
2018-11-14 00:35:53 +01:00
Rahul Lakkireddy
6507fb6f0a net/cxgbe: check Rx config before doing VLAN strip offload
Fixes: 436125e641 ("net/cxgbe: update to Rx/Tx offload API")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-11-14 00:35:53 +01:00
Rahul Lakkireddy
854f4bf07c net/cxgbevf: add PCI uninitialization for VF
Fixes: 2195df6d11 ("net/cxgbe: rework ethdev device allocation")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-11-14 00:35:53 +01:00
Ilya Maximets
916193dda6 net/ixgbe: stop link setup alarm handler before start
We should stop alarm handler before resetting the HW to
avoid concurrent device reconfiguration.

Fixes: 0408f47ba4 ("net/ixgbe: fix busy polling while fiber link update")
CC: stable@dpdk.org

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-11-14 00:35:53 +01:00
Thomas Monjalon
725f5dd0bf net/mlx5: fix build on PPC64
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>
2018-11-14 00:35:53 +01:00
Yunjian Wang
ba46f5e60f net/e1000/base: fix uninitialized variable
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>
2018-11-14 00:35:53 +01:00
Vipin Varghese
126372ce72 net/tap: fix probe for multiq or flowq failure
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>
2018-11-14 00:35:53 +01:00
Yongseok Koh
3193c2494e net/mlx5: fix L4 protocol validation
- 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>
2018-11-14 00:35:53 +01:00
Yongseok Koh
636a71dedc net/mlx5: fix device flow reference
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>
2018-11-14 00:35:52 +01:00
Stephen Hemminger
e0a10f4691 net/tap: fix file descriptor check
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>
2018-11-14 02:14:12 +01:00
Stephen Hemminger
cc02c97718 net/tap: fix file descriptor leak on error
If netlink socket setup fails the file descriptor was leaked.

Coverity issue: 257040
Fixes: 7c25284e30 ("net/tap: add netlink back-end for flow API")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2018-11-14 02:14:09 +01:00
Jerin Jacob
5d08fecdd3 eal: fix build
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>
2018-11-12 13:27:02 +01:00
Stephen Hemminger
7415ad0cdc net/netvsc: fix VF link update
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>
2018-11-05 20:10:54 +01:00
Ferruh Yigit
c06aee624d net/bnxt: fix uninitialized variable access
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>
2018-11-05 18:54:48 +01:00
Beilei Xing
054d1be48c net/i40e: fix Rx instability with vector mode
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>
2018-11-05 16:50:14 +01:00
Ferruh Yigit
37cf9ea83d net/avf/base: fix shifting 32-bit signed variable 31 times
Fixes: e5b2a9e957 ("net/avf/base: add base code for avf PMD")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
2018-11-05 15:58:45 +01:00
Tom Barbette
26f0488344 net/mlx5: support Rx queue count API
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>
2018-11-05 15:01:25 +01:00
Zhirun Yan
ac60b2de4f net/igb: update Tx offload mask
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>
2018-11-05 15:01:25 +01:00
Yongseok Koh
c1cfb132fa net/mlx5: remove flags setting from flow preparation
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>
2018-11-05 15:01:25 +01:00
Yongseok Koh
9ce75f5122 net/mlx5: fix Direct Verbs flow tunnel
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>
2018-11-05 15:01:25 +01:00
Yongseok Koh
4a78c88e3b net/mlx5: fix Verbs flow tunnel
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>
2018-11-05 15:01:25 +01:00
Ophir Munk
f1b85a2719 net/mlx5: support default RSS key as null
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>
2018-11-05 15:01:25 +01:00
Yongseok Koh
e7d2e32b26 net/mlx5: limit priority range for Linux TC flower driver
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>
2018-11-05 15:01:25 +01:00
Yongseok Koh
09d8b41699 net/mlx5: make vectorized Tx threshold configurable
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>
2018-11-05 15:01:25 +01:00
Yongseok Koh
f87bfa8eae net/mlx5: move device spawn configuration to probing
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
f420f03d67 net/mlx5: add E-switch VXLAN rule cleanup routines
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
7a2d6d99a4 net/mlx5: add E-Switch VXLAN encapsulation rules
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
95a464cecc net/mlx5: add E-switch VXLAN tunnel devices management
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
4eaa82256c net/mlx5: fix E-Switch flow counter deletion
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
6e74990b34 net/mlx5: update E-Switch VXLAN netlink routines
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
251e8d02cf net/mlx5: add VXLAN to flow translate routine
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
1a02c6781f net/mlx5: add VXLAN to flow prepare routine
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
2a3fed2042 net/mlx5: add E-Switch VXLAN to validation routine
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
0decab8ed1 net/mlx5: swap items/actions validations for E-Switch rules
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
6f2f07e228 net/mlx5: add necessary structures for E-Switch VXLAN
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
a57f692be0 net/mlx5: add necessary definitions for E-Switch VXLAN
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
72579fae4e net/mlx5: prepare meson build for adding E-Switch VXLAN
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>
2018-11-05 15:01:25 +01:00
Viacheslav Ovsiienko
65888c9274 net/mlx5: prepare makefile for adding E-Switch VXLAN
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>
2018-11-05 15:01:25 +01:00
Hyong Youb Kim
eeef60b0eb net/enic: use macro for attribute weak
Fixes: 8a6ff33d6d ("net/enic: add AVX2 based vectorized Rx handler")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-11-05 15:01:25 +01:00
Radu Nicolau
7dc58bc761 net/bonding: fix crash on probe
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>
2018-11-05 15:01:25 +01:00