Commit Graph

6279 Commits

Author SHA1 Message Date
Ferruh Yigit
520dd9923b drivers: prefix global variables with module name
Some global variables are defined with generic names, add component name
as prefix to variables to prevent collusion with application variables.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
2018-10-29 02:34:21 +01:00
Ferruh Yigit
b74fd6b842 add missing static keyword to globals
Some global variables can indeed be static, add static keyword to them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-29 02:01:08 +01:00
Brian Russell
49bb1f7a0a net/virtio: fix PCI config error handling
In virtio_read_caps and vtpci_msix_detect, rte_pci_read_config returns
the number of bytes read from PCI config or < 0 on error.
If less than the expected number of bytes are read then log the
failure and return rather than carrying on with garbage.

Fixes: 6ba1f63b5a ("virtio: support specification 1.0")
Cc: stable@dpdk.org

Signed-off-by: Brian Russell <brussell@brocade.com>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
2018-10-29 00:54:20 +01:00
Alejandro Lucero
f7378a03d1 net/nfp: support IOVA VA mode
NFP can handle IOVA as VA. It requires to check those IOVAs
being in the supported range what is done during initialization.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-10-28 22:07:13 +01:00
Alejandro Lucero
388022d5d0 net/nfp: check hugepage IOVA based on DMA mask
NFP devices can not handle DMA addresses requiring more than
40 bits. This patch uses rte_dev_check_dma_mask with 40 bits
and avoids device initialization if memory out of NFP range.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2018-10-28 22:06:51 +01:00
Agalya Babu RadhaKrishnan
477f0d38b4 net/vdev_netvsc: disable in FreeBSD build with meson
Disabled vdev_netvsc build in FreeBSD because it is not supported.
Added changes to enable vdev_netvsc build if it is Linux OS and
disable in FreeBSD.

Fixes: 9fc43dbfd6 ("net/vdev_netvsc: add in meson build")

Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
Acked-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-10-27 18:03:33 +02:00
Agalya Babu RadhaKrishnan
b077118a50 net/tap: disable in FreeBSD build with meson
Disabled tap build in FreeBSD because it is not supported
Added changes to enable tap build if it is Linux OS and
disable in FreeBSD.

Fixes: 095cae3668 ("net/tap: add in meson build")

Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2018-10-27 18:03:30 +02:00
Agalya Babu RadhaKrishnan
ddb05fec8c net/softnic: disable in FreeBSD build with meson
Disabled softnic build in FreeBSD because it is not supported
Added changes to enable softnic build if it is Linux OS and
disable in FreeBSD.

Fixes: 6b2a3900e2 ("net/softnic: add to meson build")
Cc: stable@dpdk.org

Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-27 18:00:17 +02:00
Agalya Babu RadhaKrishnan
dbb7952d11 net/avp: disable in FreeBSD build with meson
Disabled avp build in FreeBSD because it is not supported.
Added changes to enable avp build if it is Linux OS and
disable in FreeBSD.

Fixes: ed71204dd0 ("net/avp: add to meson build")
Cc: stable@dpdk.org

Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
2018-10-27 18:00:01 +02:00
Agalya Babu RadhaKrishnan
e60a1a8ba5 net/nfp: disable in FreeBSD build with meson
Disabled nfp build in FreeBSD because it is not supported
Added changes to enable NFP build if it is Linux OS and
disable in FreeBSD.

Fixes: d9b9ca7e05 ("net/nfp: add to meson build")
Cc: stable@dpdk.org

Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
2018-10-27 17:58:08 +02:00
Chas Williams
4a5bc4e201 net/bonding: avoid making copy of MAC address
Calling rte_eth_macaddr_get to get a copy of the MAC address causes
a hot spot according to profiling. We can easily get the current
MAC address by just examining the bonded device.

Signed-off-by: Chas Williams <chas3@att.com>
2018-10-26 22:14:06 +02:00
Michal Krawczyk
0bfe846041 net/ena: change version to 1.1.1
Version change is connected with major bug fixes.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-10-26 22:14:06 +02:00
Stewart Allen
e5df9f33db net/ena: fix passing RSS hash to mbuf
The driver was passing to the mbuf Rx queue ID instead of hash received
from the device. Now, the RSS hash from the Rx descriptor is being set.

Fixes: 1173fca25a ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Signed-off-by: Stewart Allen <allenste@amazon.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-10-26 22:14:06 +02:00
Michal Krawczyk
df238f84c0 net/ena: recreate HW IO rings on start and stop
On the start the driver was refilling all Rx buffs, but the old ones
were not released. That way running start/stop for a few times was
causing device to run out of descriptors.

To fix the issue, IO rings are now being destroyed on stop, and
recreated on start. That way the device is not losing any descriptors.

Furthermore, there was also memory leak for the Rx mbufs, which were
created on start and not destroyed on stop.

Fixes: eb0ef49dd5 ("net/ena: add stop and uninit routines")
Cc: stable@dpdk.org

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-10-26 22:14:06 +02:00
Ilya Maximets
fd61c749db drivers/net: use sleep delay by default for Intel NICs
NICs uses different delays up to a second during their
configuration. It makes no sense to busy-wait so long wasting
CPU cycles and preventing any other threads to execute on the
same CPU core. These busy polling are the rudiments that came
from the kernel drivers where you can not sleep in interrupt
context, but as we're in userspace, we're able and should
sleep to allow other threads to run.
Delays never called on rx/tx path, so this should not affect
performance.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:06 +02:00
Ilya Maximets
b9788afec5 net/*/base: allow experimental APIs
This functionality was missed while adding new drivers to
the meson build.

Fixes: bfabd06000 ("net/avf: support meson build")
Fixes: 30d3d01683 ("net/qede: add in meson build")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:06 +02:00
Zhirun Yan
aa1e69aebb net/ixgbe: update Tx offload mask
Tx offload mask is updated in following commit: 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 IXGBE_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: Xiaolong Ye <xiaolong.ye@intel.com>
2018-10-26 22:14:06 +02:00
Vipin Varghese
93e11beebc net/ixgbe: prevent ic session leak on failure
For function ixgbe_crypto_create_session, fetches ic_session from the
mempool. But on failure scenarios, the object is not released back to
mempool. Using rte_mempool_put the ic_session is put back to mempool.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-10-26 22:14:06 +02:00
Ophir Munk
3a8207423a net/mlx5: close all ports on remove
With the introduction of representors several eth devices are using
the same rte device (e.g. a PCI bus). When calling port detach on one
eth device it is required that all eth devices belonging to the
same rte device have been closed in advance, then the rte device
itself can be removed/detached.
This commit implements this requirement implicitly by adding a
remove callback to struct rte_pci_driver.
The new behavior can be demonstrated in testpmd.
First we attach a representor 0 using PCI address 0000:08:00.0
testpmd> port attach  0000:08:00.0,representor=[0]
Attaching a new port...
EAL: PCI device 0000:08:00.0 on NUMA socket 0
EAL:   probe driver: 15b3:1013 net_mlx5
Port 0 is attached.
Done
Port 1 is attached.
Done

Port 0 is the master device (PF) - an ethdev of the PCI address.
Port 1 is representor 0 - another ethdev (representing a VF) using the
same PCI address. Next we detach port 1
testpmd> port detach 1
Removing a device...
Port 0 is closed
Port 1 is closed
Now total ports is 0
Done

Since port 0 has been implicitly closed we cannot act on it anymore.
testpmd> port stop 0
Invalid port 0

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-26 22:14:06 +02:00
Ophir Munk
42603bbdb5 net/mlx5: release port on close
With the introduction of representors several eth devices are using
the same rte device (e.g. a PCI bus). It is therefore required to
release the eth device resources during an eth device close operation
rather than during an rte device removal (detach) operation.
In current version many PMDs are still releasing the eth device as
part of the rte device removal. In order to allow a smooth transition
for all PMDs to behave correctly an ethdev flag RTE_ETH_DEV_CLOSE_REMOVE
is used. When this flag is set it indicates to rte_eth_dev_close() to
call rte_eth_dev_release_port(), so the port is freed during the close
operation.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-26 22:14:06 +02:00
Ophir Munk
206254b7dc net/mlx5: allow multiple probing for representor
Implement probing of a rte device multiple times, see [1].
Set PCI driver RTE_PCI_DRV_PROBE_AGAIN flag to enable multiple probing
of the PCI device by the PCI common driver.
Consecutive probing requests with a devargs string may contain
repetitive master and representors devices for which eth device should
be created only once. In case an eth device already exists - silently
ignore it.

[1]
commit e9d159c3d5 ("eal: allow probing a device again")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-26 22:14:06 +02:00
Yongseok Koh
0ddd11437a net/mlx5: fix bit width of item and action flags
Most of the code uses uint64_t for MLX5_FLOW_LAYER_* and
MLX5_FLOW_ACTION_*, but there're some code using uint32_t.

Fixes: 2ed2fe5f0a ("net/mlx5: rewrite IP address UDP/TCP port by E-Switch")
Fixes: 57123c00c1 ("net/mlx5: add Linux TC flower driver for E-Switch flow")
Fixes: fc2c498ccb ("net/mlx5: add Direct Verbs translate items")
Fixes: 3d69434113 ("net/mlx5: add Direct Verbs validation function")
Fixes: 84c406e745 ("net/mlx5: add flow translate 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-10-26 22:14:06 +02:00
Yongseok Koh
2466364115 net/mlx5: fix flow tunnel handling
Both rte_flow and mlx5_flow redundantly have item flags. And it is not
properly set in the code. This causes wrong tunnel flag handling. A
rte_flow can have multiple expanded device flows if the flow has an RSS
action. Therefore, mlx5_flow should have the layers field.

Fixes: c4d9b9f7f3 ("net/mlx5: add Direct Verbs final functions")
Fixes: fc2c498ccb ("net/mlx5: add Direct Verbs translate items")
Fixes: 3d69434113 ("net/mlx5: add Direct Verbs validation function")
Fixes: 84c406e745 ("net/mlx5: add flow translate function")
Fixes: 4e05a229c5 ("net/mlx5: add flow prepare 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-10-26 22:14:06 +02:00
Yongseok Koh
98521a3926 net/mlx5: rename static functions
In mlx5_flow*.c, static functions have names starting from 'flow_' while
shared ones start from "mlx5_flow_'.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-26 22:14:06 +02:00
Yongseok Koh
2096f61b95 net/mlx5: fix flow mark ID conversion in Direct Verbs
Fixes: d02cb06912 ("net/mlx5: add Direct Verbs translate actions")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-10-26 22:14:06 +02:00
Yongseok Koh
39bee16117 net/mlx5: fix wildcard item for Direct Verbs
If a network layer is specified with no spec, it means wildcard match.
flow_dv_translate_item_*() returns without writing anything if spec is
null and it causes creation of wrong flow. E.g., the following flow has to
patch with any ipv4 packet.

  flow create 0 ingress pattern eth / ipv4 / end actions ...

But, with the current code, it matches any packet because PMD doesn't write
anything about IPv4. The matcher value and mask becomes completely zero. It
should have written the IP version at least. It is same for the rest of
items.

Even if the spec is null, PMD has to write constant fields before return,
e.g. IP version and IP protocol number.

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-10-26 22:14:06 +02:00
Yongseok Koh
6949c43c14 net/mlx5: fix item validation in Direct Verbs
1) remove MPLS item in validation as it doesn't have a translator.

2) add missing NVGRE item to validation

3) match switch-case order between validation and translation.

Fixes: fc2c498ccb ("net/mlx5: add Direct Verbs translate items")
Fixes: 3d69434113 ("net/mlx5: add Direct Verbs validation function")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-10-26 22:14:06 +02:00
Yongseok Koh
31b1999991 net/mlx5: fix UDP hash field flag in Direct Verbs
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-10-26 22:14:06 +02:00
Yongseok Koh
58b1312e9d net/mlx5: add warning message for Direct Verbs flow
In case that the library doesn't support DV flow, if enabled by
'dv_flow_en=1', print out a warning message and disable it.

Fixes: 51e72d386c ("net/mlx5: add runtime parameter to enable Direct Verbs")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-10-26 22:14:06 +02:00
Viacheslav Ovsiienko
db48f9db5d net/mlx5: support new flow counter API
This patch updates the functions performing the Verbs ibrary calls
in order to support different versions of the library.
The functions:
  - flow_verbs_counter_new()
  - flow_verbs_counter_release()
  - flow_verbs_counter_query()
now have the several compilation branches, depending on the
counters support found in the system at compile time.

The flow_verbs_counter_create() function is introduced as
helper for flow_verbs_counter_new(), actually this helper
create the counters with Verbs.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2018-10-26 22:14:06 +02:00
Viacheslav Ovsiienko
e00767ee04 net/mlx5: remove unnecessary structure initializers
The unnecessary structure filed initializers to zero are removed.
We need to do this minor preparation before the following
mlx5 counter structure modification.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2018-10-26 22:14:06 +02:00
Viacheslav Ovsiienko
3b2c0bbc52 net/mlx5: add new flow counter Verbs API to glue library
This patch updates the mlx5 glue library, new counter support
Verbs function pointers are added to the glue linking structure
mlx5_glue. This structure now contains the pointers to the both
versions of counter supporting functions due to compatibility
issues. Depending on configuration macros the functions perform
actual Verbs library calls or return an error with meaning
"feature is not supported" (NULL or ENOTSUP).

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2018-10-26 22:14:06 +02:00
Viacheslav Ovsiienko
06629d860d net/mlx5: relocate flow counters query function
The flow_verbs_query_count() is moved into the the group of counter
managing functions and renamed to flow_verbs_counter_query() in order
to be in unified fashion with others.

Also minor function modification is made to avoid unreachable code
warnings if there is no counter support at compile time.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2018-10-26 22:14:06 +02:00
Viacheslav Ovsiienko
2dd8b72167 net/mlx5: simplify flow counters support check
The redundant check of Flow counters support in runtime is removed.
The flag flow_counter_en is eliminated from the code. The Verbs
create counter function just returns an error if no counter
support presented in the system.

If there is no any of Flow counters configuration macro defined
the log message is emited, indicating the missing counter support.

mlx5_flow_validate_action_count() fuctnion is also updated due to
flow_counter_en flag removal.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2018-10-26 22:14:06 +02:00
Viacheslav Ovsiienko
9a945375a8 net/mlx5: introduce new flow counters configuration macro
The new configuration macro HAVE_IBV_DEVICE_COUNTERS_SET_V45 is
introduced. Both makefile and meson.build are changed.

Flow counter support code depends on the following configuration
macros:

- HAVE_IBV_DEVICE_COUNTERS_SET_V42 - is defined if system supports
  the "old" flow counters functionality, MLNX_OFED version from
  4.2 to 4.4 is required.

- HAVE_IBV_DEVICE_COUNTERS_SET_V45 - is defined if system supports
  the "new" flow counters functionality, MLNX_OVED 4.5 (or higher)
  or Linux rdma-core v19 (or higher) is required.

Neither HAVE_IBV_DEVICE_COUNTERS_SET_V42 nor
HAVE_IBV_DEVICE_COUNTERS_SET_V45 is defined if there is no
counters support.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2018-10-26 22:14:06 +02:00
Viacheslav Ovsiienko
0d8c6e6ba0 net/mlx5: rename flow counter configuration macro
The HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT is replaced with
HAVE_IBV_DEVICE_COUNTERS_SET_V42. At this stage it is just
macro renaming. This macro is defined if system supports
the "old" Flow counters functionality, MLNX_OFED version
from 4.2 to 4.4 is required.

We need to do this preparation before introducing the new
configuration macro (HAVE_IBV_DEVICE_COUNTERS_SET_V45) for
the "new" Flow counters support.

Both makefile and meson.build are changed.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2018-10-26 22:14:06 +02:00
Viacheslav Ovsiienko
c4301b9caf net/mlx5: fix flow counters creation
The Flow counter creation function contains two problems:

  - Flow counter object in Verbs is not freed in case of memory
    allocation error. The call of counter Verbs object deallocating
    function is added to fix.

  - The initial value of reference counter is set to one in order
    to provide the correct counter object freeing in the
    flow_verbs_counter_release() function. The reference counter
    field should be initialized to one.

Fixes: 60bd8c9747 ("net/mlx5: add count flow action")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2018-10-26 22:14:06 +02:00
Beilei Xing
e4845bb4a6 net/i40e: update Tx offload mask
Tx offload mask is updated in following commit:
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 PMD Tx offload mask.

Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-10-26 22:14:06 +02:00
Wei Zhao
6e8110cca6 net/ixgbe: fix RSS flow error return
If hash function is 0, it should disable RSS then return 0.

Fixes: 518cc3927b ("net/ixgbe: move RSS to flow API")
Cc: stable@dpdk.org

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-10-26 22:14:06 +02:00
Xiaolong Ye
e0e6a7f215 net/i40e: cancel alarm handler at the end of closure
Some operations in i40evf_dev_close like i40evf_dev_promiscuous_disable
still need alarm handler to clear the pending cmd, if alarm handler is
canceled in early stage of i40evf_dev_close,
i40evf_dev_promiscuous_disable will result in failure.

Fixes: 864a800d70 ("net/i40e: remove VF interrupt handler")
Cc: stable@dpdk.org

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-10-26 22:14:06 +02:00
Haiyue Wang
2c6d4f0338 net/i40e: enable loopback function for X722 MAC
In FVL, there was an issue and it didn't support the loopback function
before FW 5.0. For FPK (X722) it should work.

So it needs to distinguish between the devices by checking MAC type.

Fixes: 689bba3327 ("i40e: add VEB switching support")
Fixes: bce83974ba ("net/i40e: set Tx loopback from PF")
Cc: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-10-26 22:14:06 +02:00
Faicker Mo
d0dd0cf061 net/ixgbe: fix flow create in ntuple check
In ixgbe_flow_create function, ntuple filter is parsed first. If the
flow is considered to be ntuple filter, it will not go on to judge
ethertype filter, syn filter and fdir filter.
In the function ntuple_filter_to_5tuple, 5 tuple info is checked,
but it's too late to jump over the ntuple filter if it's a fdir filter.

Fixes: 46ea969177 ("net/ixgbe: add ntuple support to flow parser")
Cc: stable@dpdk.org

Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
a7d3c6271d ethdev: support representor id as iterator filter
The representor id is added in rte_eth_dev_data in order to be able
to match a port with its representor id in devargs.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:06 +02:00
Dekel Peled
6bd7fbd03c net/mlx5: support metadata as flow rule criteria
As described in series starting at [1], it adds option to set
metadata value as match pattern when creating a new flow rule.

This patch adds metadata support in mlx5 driver, in two parts:
- Add the validation and setting of metadata value in matcher,
  when creating a new flow rule.
- Add the passing of metadata value from mbuf to wqe when
  indicated by ol_flag, in different burst functions.

[1] "ethdev: support metadata as flow rule criteria"
    http://mails.dpdk.org/archives/dev/2018-September/113269.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
c9cce42876 ethdev: remove deprecated attach/detach functions
The hotplug attach/detach features are implemented in EAL layer.
There is a new ethdev iterator to retrieve ports from ethdev layer.

As announced earlier, the (buggy) ethdev functions are now removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Moti Haimovsky
e1114ff6a5 net/mlx5: support e-switch flow count action
This commit adds support for configuring flows destined to the mlx5
eswitch with 'count' action and for querying these counts at runtime.

Each flow rule configured by the mlx5 driver is implicitly assigned
with flow counters. These counters can be retrieved when querying
the flow rule via Netlink, they can be found in each flow action
section of the reply. Hence, supporting the 'count' action in the
flow configuration command is straight-forward. When transposing
the command to a tc Netlink message we just ignore it instead of
rejecting it.
In the 'flow query count' side, the command now uses tc Netlink
query command in order to retrieve the values of the flow counters.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-26 22:14:05 +02:00
Moti Haimovsky
684dafe795 net/mlx5: add flow query abstraction interface
Flow engine now supports multiple driver paths with each having
its own flow query implantation routine.
This patch adds an abstraction to the flow query routine in accordance
to commit 0c76d1c9a1 ("net/mlx5: add abstraction for multiple flow
drivers") done by Yongseok Koh.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-26 22:14:05 +02:00
Moti Haimovsky
743fdbeb45 net/mlx5: use the new infrastructure for tc flow
modified TC-flow code to use the new infrastructure
introduced in "net/mlx5: refactor TC-flow infrastructure"
commit.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-26 22:14:05 +02:00
Moti Haimovsky
d53180afe3 net/mlx5: refactor TC-flow infrastructure
This commit refactors tc_flow as a preparation to coming commits
that sends different type of messages and expect differ type of replies
while still using the same underlying routines.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-26 22:14:05 +02:00
Thomas Monjalon
662dbc322d ethdev: remove release function for secondary process
After previous changes, the function rte_eth_dev_release_port()
can be used for primary or secondary process as well.
The only difference with rte_eth_dev_release_port_secondary()
is the shared lock used in rte_eth_dev_release_port().

The function rte_eth_dev_release_port_secondary() was recently
added in 18.11 cycle.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Thomas Monjalon
e16adf08e5 ethdev: free all common data when releasing port
This is a clean-up of common ethdev data freeing.
All data freeing are moved to rte_eth_dev_release_port()
and done only in case of primary process.

It is probably fixing some memory leaks for PMDs which were
not freeing all data.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Hyong Youb Kim
59e657aa0b net/enic: add missing Tx offload flags
The following commit has added a number of existing offload flags such
as PKT_TX_IPV4 and PKT_TX_IPV6 to PKT_TX_OFFLOAD_MASK defined in
rte_mbuf.h. That change breaks the enic driver's Tx prepare handler.

commit ef28cfa73822 ("mbuf: fix Tx offload mask")

The enic driver keeps the supported offload flags in a local variable
(tx_offload_mask), which is strictly a subset of
PKT_TX_OFFLOAD_MASK. This variable is then used to compute the
unsupported flags (tx_offload_notsup_mask), and the Tx prepare handler
(tx_pkt_prepare) uses it to reject packets with unsupported offload
flags.

As is, tx_offload_notsup_mask ends up containing flags like
PKT_TX_IPV4 that are actually supported by the driver, which then
breaks any application that uses checksum offloads and calls the Tx
prepare handler. So add the flags to tx_offload_mask that the driver
supports but were missing in PKT_TX_OFFLOAD_MASK.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-10-26 22:14:05 +02:00
Hyong Youb Kim
432ed10d81 net/enic: fix supported packet types
The handler for dev_supported_ptypes_get currently returns null when
the vectorized Rx handler is used. It is also missing tunnel packet
types. Add the missing packet types to the supported list, and return
the right list for the vectorized Rx handler.

Fixes: 8a6ff33d6d ("net/enic: add AVX2 based vectorized Rx handler")
Fixes: 93fb21fdbe ("net/enic: enable overlay offload for VXLAN and GENEVE")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-10-26 22:14:05 +02:00
Huaibin Wang
815037b92b net/i40e: keep promiscuous on if allmulticast is enabled
Promisc should not be disabled if the all multicast mode is enabled.
Patch keeps the promiscuous on if all multicast mode is on, this
behavior is also consistent with the implementation done on ixgbe
pmd.

Cc: stable@dpdk.org

Signed-off-by: Huaibin Wang <huaibin.wang@6wind.com>
Signed-off-by: Laurent Hardy <laurent.hardy@6wind.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-10-26 22:14:05 +02:00
Raslan Darawsheh
c9aa56edec net/tap: access primary process queues from secondary
In the case the device is created by the primary process,
the secondary must request some file descriptors to attach the queues.
The file descriptors are shared via IPC Unix socket.

Thanks to the IPC synchronization, the secondary process
is now able to do Rx/Tx on a TAP created by the primary process.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Raslan Darawsheh
ed8132e7c9 net/tap: move fds of queues to be in process private
fd's cannot be shared between processes, and each process need to have
it's own fd's pointer.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Raslan Darawsheh
48b9dcd62a net/tap: add queue and port ids in queue structures
Port and queue ids are added to easily map the file
descriptors stored in each process private.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Anoob Joseph
95a6b04f7d use registered name for OCTEON TX references
'OCTEON TX' is the registered name. All other usages need to be fixed.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-10-26 14:16:05 +02:00
Fan Zhang
babdea5933 net/softnic: add crypto commands
This patch updates the CLI parsing of softnic with extra symmetric
cryptodev, port, session, and action support.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26 14:16:05 +02:00
Fan Zhang
3b7f2b9e17 net/softnic: add symmetric crypto action
This patch adds symmetric crypto action support to softnic.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26 14:13:45 +02:00
Fan Zhang
e0e52c7c29 net/softnic: configure crypto port
This patch enables the crypt port configuration in softnic.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26 14:13:45 +02:00
Fan Zhang
29fe4822f5 net/softnic: add cryptodev
This patch adds cryptodev abstraction to softnic. The DPDK
Cryptodevs are abstracted as crypto ports in the softnic.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-26 14:13:45 +02:00
Reshma Pattan
636e5af038 net/softnic: support flow API VXLAN encap action
Added support for ethdev flow API VXLAN encap action.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-17 15:04:39 +02:00
Cristian Dumitrescu
0dac5d7ea0 net/softnic: support VXLAN encap
Add CLI support for VXLAN encap.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-17 15:04:08 +02:00
Keith Wiles
81bede55e3 eal: add macro for attribute weak
eal: add shorthand __rte_weak macro
qat: update code to use __rte_weak macro
avf: update code to use __rte_weak macro
fm10k: update code to use __rte_weak macro
i40e: update code to use __rte_weak macro
ixgbe: update code to use __rte_weak macro
mlx5: update code to use __rte_weak macro
virtio: update code to use __rte_weak macro
acl: update code to use __rte_weak macro
bpf: update code to use __rte_weak macro

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-25 02:11:23 +02:00
Shreyansh Jain
44e87c27a5 net/dpaa2: decrease link state log level
In case the link is down during initial link state check, messages for
link state check flood the console. Reducing the log level for these.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-25 00:51:05 +02:00
Anatoly Burakov
5d7b673d5f mk: build with _GNU_SOURCE defined by default
We use _GNU_SOURCE all over the place, but often times we miss
defining it, resulting in broken builds on musl. Rather than
fixing every library's and driver's and application's makefile,
fix it by simply defining _GNU_SOURCE by default for all
builds.

Remove all usages of _GNU_SOURCE in source files and makefiles,
and also fixup a couple of instances of using __USE_GNU instead
of _GNU_SOURCE.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-22 11:28:27 +02:00
Raslan Darawsheh
9396ad3346 net/tap: fix reported number of Tx packets
When writev fails to send packets it doesn't update the
number of Tx packets, but it still num_tx is updated.

The value that should be returned is the actual number
of sent packets which is num_packets.

Fixes: 02f96a0a82 ("net/tap: add TUN/TAP device PMD")
CC: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2018-10-18 10:24:39 +02:00
Stephen Hemminger
ea2c9969b5 net/ixgbe: remove mild profanity
At the tail end of comment about barriers (I feel your pain);
remove mild profanity.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Stephen Hemminger
a331d57c3e net/bnx2x: remove profanity
No need for profanity in comments.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Shahaf Shuler
cd18e1b72f net/mlx5: fix build on Arm
On some ARM environment, the below compilation error will be seen

dpdk/drivers/net/mlx5/mlx5_flow_dv.c: In function
'flow_dv_translate_item_nvgre':
/tmp/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:785:22: error: pointer targets
in initialization differ in signedness [-Werror=pointer-sign]
  const char *tni_v = nvgre_v->tni;

The reason for this error is that nvgre_v->tni is defined as byte array
in size of 3B. However the code in the function iterate till the 4B in
order to copy/set also the subsequent field after it (flow_id)

Fixing by pointing to this struct from a different pointer.

Fixes: fc2c498ccb ("net/mlx5: add Direct Verbs translate items")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-10-18 10:24:39 +02:00
Maxime Coquelin
6d6e95cec4 net/vhost: add parameter to enable postcopy
Introduce a new postcopy-support parameter to Vhost PMD that
passes the RTE_VHOST_USER_POSTCOPY_SUPPORT flag at vhost
device register time.

Flag should only be set if application does not prefault guest
memory using, for example, mlockall() syscall.

Default value is 0, meaning that postcopy support is disabled
unless specified explicitly.

Example to enable postcopy support for a given device:

--vdev 'net_vhost0,iface=/tmp/vhost-user1,postcopy-support=1'

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-10-18 10:24:39 +02:00
Xiaoyu Min
7604677883 net/mlx5: rewrite MAC address by E-Switch
Offload following modify MAC address actions to E-Switch
via TC-Flower driver

- RTE_FLOW_ACTION_TYPE_SET_MAC_SRC
- RTE_FLOW_ACTION_TYPE_SET_MAC_DST

The corresponding rte_flow_item_eth must be present in
rte_flow pattern

Only support modify outer layer MAC address

The example testpmd command is:

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7000 / end
         actions set_mac_dst mac_addr dd:00:aa:11:bb:33 /
         set_mac_src mac_addr bb:00:cc:11:aa:22 /
	 port_id id 1 / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-18 10:24:39 +02:00
Xiaoyu Min
a7cb5bcd28 net/mlx5: rewrite TTL by E-Switch
Offload following modify TTL actions to E-Switch via
TC-Flower driver

- RTE_FLOW_ACTION_TYPE_SET_TTL
- RTE_FLOW_ACTION_TYPE_DEC_TTL

The corresponding IP protocol rte_flow_item_ipv[4|6]
must be present in rte_flow pattern otherwith PMD
return error

The example testpmd commands are:

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7000 / end
	 actions dec_ttl /
	 port_id id 1 / end

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7001 / end
	 actions set_ttl ttl_value 10 /
	 port_id id 1 / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-18 10:24:39 +02:00
Rahul Lakkireddy
f683a52006 net/cxgbe: add action to swap MAC addresses
Implement RTE_FLOW_ACTION_TYPE_MAC_SWAP to offload flows with
action to swap the source and destination MAC addresses in the
outermost Ethernet header.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-10-18 10:24:39 +02:00
Ed Czeck
589876bff1 net/ark: support updated hardware and Tx meta data
Support for version 2 of DDM hardware and user tx meta data.
Verify version during initialization.

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
2018-10-18 10:24:39 +02:00
Ed Czeck
0c5b65f45c net/ark: remove useless hardware notifications
Only send notification to mpu when crossing 64 index boundary.

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
2018-10-18 10:24:39 +02:00
Ed Czeck
be410a8615 net/ark: add recovery for lack of mbufs
Attempt to allocate smaller chunk of mbufs when larger amount is
not available.  Report error when small chunk not available.

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
2018-10-18 10:24:39 +02:00
Stephen Hemminger
dcf3d57fa4 net/qede: remove invalid config option checks
Now that logging of initialization is controlled by dynamic debug
level, remove the #ifdef for RTE_LIBRTE_QEDE_DEBUG_INIT since that
config option does not exist in common_base and is not documented.

Fixes: 69b6573980 ("net/qede: implement dynamic logging")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Haiyue Wang
a710ceb172 net/avf: fix build with debug enabled
DEBUG_DUMP_DESC flag is enabled/disabled from Makefile and enabling it
causing the build issue.

Add the missed 'volatile' keyword to avoid the warning for type
mismatch, which will be treated as compiler error if WERROR_FLAGS
is enabled.

Fixes: bfd38e4d70 ("net/avf: fix missing compiler error flags")
CC: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Xiaoyu Min
0eef26d073 net/mlx5: fix build with zero-size array
If the build environment doesn't have 'linux/tc_act/tc_pedit.h' header,
compiler will use needed structs defined in mlx5_flow_tcf.c.

However, there is a zero-size array defined in one struct and
ISO C forbids this when -Wpedantic is set by debug mode.

Simply put __extension__ keyword before the struct in question.

Fixes: 2ed2fe5f0a ("net/mlx5: rewrite IP address UDP/TCP port by E-Switch")

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
2018-10-18 10:24:39 +02:00
Yongseok Koh
31fda51877 net/mlx5: support multiple groups and jump action
rte_flow has 'group' attribute and 'jump' action in order to support
multiple groups. This feature is known as multi-table support ('chain' in
linux TC flower) in general because a group means a table of flows. Example
commands are:

	flow create 0 transfer priority 1 ingress
	     pattern eth / vlan vid is 100 / end
	     actions jump group 1 / end

	flow create 0 transfer priority 1 ingress
	     pattern eth / vlan vid is 200 / end
	     actions jump group 2 / end

	flow create 0 transfer group 1 priority 2 ingress
	     pattern eth / vlan vid is 100 /
	     	     ipv4 dst spec 192.168.40.0 dst prefix 24 / end
	     actions drop / end

	flow create 0 transfer group 1 priority 2 ingress
	     pattern end
	     actions of_pop_vlan / port_id id 1 / end

	flow create 0 transfer group 2 priority 2 ingress
	     pattern eth / vlan vid is 200 /
	     	     ipv4 dst spec 192.168.40.0 dst prefix 24 / end
	     actions of_pop_vlan / port_id id 2 / end

	flow create 0 transfer group 2 priority 2 ingress
	     pattern end
	     actions port_id id 2 / end

With theses flows, if a packet having vlan 200 and src_ip as 192.168.40.1,
this packet will firstly hit the 1st flow. Then it will hit the 5th flow
because of the 'jump' action. As a result, the packet will be forwarded to
port 2 (VF representor) with vlan tag being stripped off. If the packet had
vlan 100 instead, it would be dropped by the 3rd flow.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
ce44e50a58 net/atlantic: read MAC registers for debug purposes
This patch add support for dumping MAC registers.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
ce4e8d4180 net/atlantic: implement EEPROM get/set
Add support for EEPROM reading/writing.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
f7c2c2c8c5 net/atlantic: implement VLAN filters and offloads
VLAN filters and VLAN offloads implementation.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
4c4340ff30 net/atlantic: implement MTU configuration
Add support for updating MTU value.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
275d21b554 net/atlantic: implement MAC address manipulations
Add support for adding/removing MAC addresses.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
4c1c8f7646 net/atlantic: add flow control configuration
Add support for flow control feature.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Igor Russkikh
3af0d30854 net/atlantic: implement RSS and RETA manipulation API
Add support for Receive Side Scaling feature.
RSS hash and reta table configuration.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
a9ba50efbd net/atlantic: implement promisc and allmulti modes
Add support for promiscuous/allmulticast modes configuration.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
391de3291d net/atlantic: add Rx/Tx descriptors information
Add support for Rx/Tx descriptors status information.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
fbe059e872 net/atlantic: implement device statistics
Add support for device stats, xstats and queue stats

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
7943ba05f6 net/atlantic: add link status and interrupt management
Implement link interrupt, link info, link polling.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
2b1472d715 net/atlantic: implement Tx path
Add implementation for TX datapath.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Igor Russkikh
3d38e3dcf1 net/atlantic: implement Rx path
Add implementation for RX datapath.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
b78958e237 net/atlantic: implement core logic for Tx/Rx
Add RX/TX function prototypes for further datapath development.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
bb42aa9ffe net/atlantic: configure device start/stop
Start, stop and reset are all done via hw_atl layer.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Igor Russkikh
7906661eda net/atlantic: add b0 hardware layer
This is hw_atl logic layer derived from linux atlantic
driver. It contains RX/TX hardware initialization
sequences, various hw configuration.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Igor Russkikh
86d36773bd net/atlantic: implement firmware operations
AQC NICs comes in fields with two major
FW generations: 1x and 3x.

This is part of linux atlantic driver shared code,
responsible for internal NIC firmware interactions,
including link management ops, FW initialization,
various lifecycle features.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Igor Russkikh
31617c04e7 net/atlantic: add hardware access layer
This patch introduces hw_atl layer which is maintained
in sync with linux kernel driver.
It will generally be in sync with linux upstream.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Igor Russkikh
cab05c5302 net/atlantic: add hardware registers access routines
Add implementation for hardware registers access routines.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Igor Russkikh
8279df65a6 net/atlantic: add logging structure
Implement logging macroses for debug purposes.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
Pavel Belous
5bcf164961 net/atlantic: add PMD driver skeleton
Makefile/meson build infrastructure, atl_ethdev minimal skeleton,
header with aquantia aQtion NIC device and vendor IDs.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
2018-10-18 10:24:39 +02:00
John Daley
1b4ce87dc5 net/enic: fix counter action
- track whether counter DMAs are active or not so they can be stopped if
  needed before DMA memory is freed
- fix counter DMA shut-down by changing vnic_dev_counter_dma_cfg() to
  take the number of counters to DMA instead of high counter index and
  use num counters = 0 to shut off DMAs
- remove unnecessary checks that DMA counter memory is valid and that
  counter DMAs are in use
- change the minimum DMA period to match what 1400 series adapter is
  capable of
- fix comments and change a couple variable names to make more sense

Fixes: 86df6c4e2f ("net/enic: support flow counter action")

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-10-18 10:24:39 +02:00
Thomas Monjalon
391797f042 drivers/bus: move driver assignment to end of probing
The PCI mapping requires to know the PCI driver to use,
even before the probing is done. That's why the PCI driver is
referenced early inside the PCI device structure. See
commit 1d20a073fa ("bus/pci: reference driver structure before mapping")

However the rte_driver does not need to be referenced in rte_device
before the device probing is done.
By moving back this assignment at the end of the device probing,
it becomes possible to make clear the status of a rte_device.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
2018-10-17 10:26:59 +02:00
Thomas Monjalon
5e046832f1 ethdev: rename memzones allocated for DMA
The helper rte_eth_dma_zone_reserve() is called by PMDs
when probing a new port.
It creates a new memzone with an unique name.
The name of this memzone was using the name of the driver
doing the probe.

In order to avoid assigning the driver before the end of the probing,
the driver name is removed from these memzone names.
The ethdev name (data->name) is not used because it may be too long
and may be not set at this stage of probing.

Syntax of old name: <driver>_<ring>_<port>_<queue>
Syntax of new name: eth_p<port>_q<queue>_<ring>

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-17 10:26:59 +02:00
Thomas Monjalon
a1883178e9 net/mlx5: remove useless driver name comparison
The function mlx5_dev_to_port_id() is returning all the ports
associated to a rte_device.
It was comparing driver names while already comparing rte_device pointers.
If two devices are the same, they will have the same driver.
So the useless driver name comparison is removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-17 10:26:59 +02:00
Qi Zhang
8f62ec3861 drivers/net: enable device detach on secondary process
With the enabling for hotplug on multi-process,
rte_eth_dev_pci_generic_remove can be used to detach the device from
a secondary process also. But we need to take care of the uninit callback
parameter to make sure it handles the secondary case correctly.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2018-10-17 10:16:18 +02:00
Qi Zhang
4852aa8f6e drivers/net: enable hotplug on secondary process
Attach port from secondary should ignore devargs since the private
device is not necessary to support. Also previously, detach port on
a secondary process will mess primary process and cause the same
device can't be attached back again. A secondary process should use
rte_eth_dev_release_port_secondary to release a port.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2018-10-17 10:16:18 +02:00
Shreyansh Jain
41c24ea294 net/dpaa2: fix MAC address initialization
Build error:
https://mails.dpdk.org/archives/test-report/2018-October/066840.html

Fixes: c3e0a706fd ("net/dpaa2: read hardware provided MAC for DPNI devices")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-17 09:36:06 +01:00
Hemant Agrawal
94d31549c3 net/dpaa2: support Rx checksum offload in slow parsing
This is required for new mode for LX2 platform specifically

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:26 +02:00
Hemant Agrawal
2375f8792b net/dpaa2: support VLAN TCI population from HW parser
This patch adds the support to update the mbuf vlan tci field
from the HW parse results in annotation area.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:26 +02:00
Hemant Agrawal
5d9a1e4d23 net/dpaa2: enhance queue memory cleanup
Earlier the tx queue data was getting cleaned up in close
while rest of the functionality was in un-init.
Now a new func is created to free queue memory.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:26 +02:00
Hemant Agrawal
fa21a6fec7 net/dpaa2: optimize fd reset in Tx path
various field of FD structure was getting reset in scattered
fashion. This patch align them in single macro.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:26 +02:00
Hemant Agrawal
51aa71e8cb net/dpaa2: update RSS value in mbuf for LX2
This patch copies the flc based hw provided hash results
to the mbuf rss field for lx2 platform only.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:26 +02:00
Shreyansh Jain
e43f252105 net/dpaa2: support statistics per queue
For now, only the packet count stats per queue is available. This is
part of xstats output (though, per queue stats are actually part of
rte_eth_stats basic stats).

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-16 14:54:26 +02:00
Shreyansh Jain
c3e0a706fd net/dpaa2: read hardware provided MAC for DPNI devices
Firmware would contain pre-configured devices for each DPMAC backing
a DPNI. This patch reads those MAC address when the device is
initialized and sets it. THereafter, it can be changed through API or
commands from testpmd.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-16 14:54:26 +02:00
Nipun Gupta
1a814f4b41 bus/fslmc: disable annotation prefetch for LX2
In case of LX2 we get parse result summary in FD. We do not need to
prefetch and read the annotation to fetch the parse results.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-10-16 14:54:26 +02:00
Nipun Gupta
bd23b1a827 bus/fslmc: support 32 enqueues/dequeues for LX2
LX2 can support upto 32 frames in one hw pull request.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-10-16 14:54:26 +02:00
Hemant Agrawal
25fea08220 net/dpaa2: upgrade dpni to mc FW APIs to 10.10.0
New feature includes ordering support and link related
enhancements

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:25 +02:00
Hemant Agrawal
b4a63e605d bus/fslmc: upgrade mc FW APIs to 10.10.0
This patch add the support for new Management Complex
Firmware version to 10.1x.x. One of the main changes in
the APIs ordered queue.

The fslmc bus lib ABI will need to be bumped to reflect
the MC FW API and structure changes.

This will also result in bumping of ABI verion of all dependent
libs as they internally use the MC FW APIs and structures.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:25 +02:00
Hemant Agrawal
24f3c9a6f8 net/dpaa2: fix VLAN filter enablement
Enable the VLAN filters only when requested in rx offload.

Fixes: 0ebce6129b ("net/dpaa2: support new ethdev offload APIs")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-10-16 14:54:25 +02:00
Nipun Gupta
543dbfec6e net/dpaa2: fix IOVA conversion for congestion memory
The code was incorrectly using the Virtual mode, whent
the IOVA mode was set as Physical.

Fixes: 5ae1edff68 ("dpaa2: prepare for 32-bit build")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2018-10-16 14:54:25 +02:00
Shreyansh Jain
e7d9285481 fslmc: enable dpaax library
With this patch, fslmc bus and ethernet devices on this bus
would start using the physical-virtual library interfaces.

This patch impacts mempool/dpaa2, event/dpaa2, net/dpaa2,
raw/dpaa2_cmdif and raw/dpaa2_qdma as they are dependent
on the bus/fslmc and thus impact linkage of libraries.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-16 14:54:25 +02:00
Shreyansh Jain
5a7dbb934d dpaa: enable dpaax library
With this patch, dpaa bus and ethernet devices on this bus
would start using the physical-virtual library interfaces.

This patch impacts mempool/dpaa, event/dpaa and net/dpaa as
they are dependent on the bus/dpaa and thus impact linkage of
libraries.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-16 14:54:25 +02:00
Cristian Dumitrescu
abe92131c9 net/softnic: support VXLAN flow decap action
Add support for ethdev flow API VXLAN decap action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12 19:33:40 +02:00
Cristian Dumitrescu
b9bcbeeccb net/softnic: support packet decap action
Add support for packet decap table action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12 19:33:39 +02:00
Cristian Dumitrescu
974a48d42b net/softnic: support flow mark action
Add support for ethdev flow API mark action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12 19:33:33 +02:00
Cristian Dumitrescu
16d2d65325 net/softnic: support packet tag action
Add support for packet tag table action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12 19:33:31 +02:00
Reshma Pattan
b53258c14c net/softnic: support flow flush
Add rte flow flush api for flushing
all the flows of the port.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12 19:33:23 +02:00
Reshma Pattan
13b8c6802d net/softnic: fix IPv6 endianness
Fix IPv6 endianness from big endian to CPU order.

Fixes: ee19326a4b ("net/softnic: add command for pipeline table entries")
Cc: stable@dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-10-12 19:33:22 +02:00
Jasvinder Singh
7e30e444c3 net/softnic: support flow meter action
Implement flow rules with meter action.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:16 +02:00
Jasvinder Singh
ccc599e9f4 net/softnic: read meter statistics
Implement meter object stats read function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:15 +02:00
Jasvinder Singh
8a917ef88d net/softnic: update policer actions
Implement meter object policer actions function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:14 +02:00
Jasvinder Singh
8602bcae02 net/softnic: update DSCP table
Implement meter object dscp table update.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:13 +02:00
Jasvinder Singh
b89f4a5791 net/softnic: update meter profile
Implement meter profile update function

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:13 +02:00
Jasvinder Singh
dcffaf060e net/softnic: destroy meter object
Implement meter object destroy function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:12 +02:00
Jasvinder Singh
e00231030c net/softnic: create meter object
implement meter object create function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:11 +02:00
Jasvinder Singh
fd338e0b50 net/softnic: delete meter profile
Implement meter profile delete function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:10 +02:00
Jasvinder Singh
0d73ddf25f net/softnic: add meter profile
Implement meter profile add function.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:09 +02:00
Jasvinder Singh
9e800b9082 net/softnic: support metering and policing
Enable metering and policing support for softnic.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-10-12 17:59:09 +02:00
Reshma Pattan
193de77b60 net/softnic: parse raw flow item
Added support for parsing raw flow item.
flow_item_raw_preprocess() is added for the same.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:08 +02:00
Reshma Pattan
a373200590 net/softnic: support flow query
Added pmd_flow_query() API, for flow query
support.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:07 +02:00
Reshma Pattan
bd0447d2c5 net/softnic: support flow destroy
pmd_flow_destroy() API is added to destroy the
created flow.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:06 +02:00
Reshma Pattan
11c5da41c7 net/softnic: support flow create
pmd_flow_create API is added to support
rte flow create.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:05 +02:00
Reshma Pattan
daabf2fb94 net/softnic: map flow action to table action
Added validation and mapping of flow rule action
with table action profile.

Added flow_rule_action_get() to do the same.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:05 +02:00
Reshma Pattan
061ee47cf5 net/softnic: map flow match to hash table
Support for validating and mapping flow rule with HASH
table match is added.

As part of this, below helper functions are added.
flow_rule_match_hash_get()
hash_key_mask_is_same()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:04 +02:00
Reshma Pattan
6655737d2f net/softnic: parse flow match for ACL table
Added flow protocol parsing for IPV4/IPV6 and
TCP/UDP/SCTP for ACL table rule match.

Added below helper functions for doing the same.
port_mask_to_range()
ipv6_mask_to_depth()
ipv4_mask_to_depth()
mask_to_depth()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:03 +02:00
Reshma Pattan
fd9f4290e5 net/softnic: map flow match to ACL table
Support for validating and mapping rte flow rule with
ACL table match is added.

As part of this support below utility functions
been added
flow_rule_match_get()
flow_rule_match_acl_get()
flow_item_skip_disabled_protos()
flow_item_proto_preprocess()
flow_item_is_proto()
flow_item_raw_preprocess()

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:03 +02:00
Reshma Pattan
8364aa4734 net/softnic: support flow validate
Start adding flow api operations.

Started with flow validate api support by adding
below basic infrastructure.

flow_pipeline_table_get()
pmd_flow_validate()

Additional flow validate changes will be
added in next patches.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:02 +02:00
Reshma Pattan
e12b177090 net/softnic: get eth device
Add utility function to get the rte_eth_dev from
a given softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:01 +02:00
Reshma Pattan
51442e0684 net/softnic: add table and port helper functions
Added utility function to freeup the
pipeline tables.

Added utility functions to find the pipeline
output port.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:59:01 +02:00
Reshma Pattan
b767f8efc8 net/softnic: replace pointers with arrays
Change dev_name, action_profile_name and key_mask
from char* type to arary type of structures
softnic_port_in_params, softnic_port_out_params
and softnic_table_hash_params.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:58:59 +02:00
Reshma Pattan
e44856f23f net/softnic: add flow attribute option
Added new cli by which user can specify to softnic
which rte flow group and direction has to mapped to
which pipeline and table.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:58:58 +02:00
Reshma Pattan
c169b6a588 net/softnic: map flow attribute to pipeline table
Added mapping support from rte_flow attributes
to softnic pipeline and table.

So added flow attribute map set and get functions
definition to new file rte_eth_sofnic_flow.c.

Added pmd flow internals with ingress and egress
flow attribute maps.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:58:57 +02:00
Reshma Pattan
90ec92a06d net/softnic: add flow API
Add rte_flow infra structure for flow api support.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-10-12 17:58:55 +02:00
Kevin Laatz
e976ffaa57 net/softnic: use table library headers
This commit modifies SoftNIC to make use of the new header files in
librte_table.

As we are now using the new header files in librte_table in SoftNIC, we no
longer need the old header files so they can be removed.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-10-12 17:58:55 +02:00
Ivan Malov
662e382244 net/sfc: allow to query RSS key and HF when RSS is disabled
If global RSS is not enabled in the multiqueue mode setting,
it will not be possible to change RSS configuration. However,
querying default RSS settings should be possible in any case since
it may be needed by RTE flow API users to find out what RSS settings
will be used by default for a flow rule with RSS action if custom
RSS key and hash function choice are not specified.

Fixes: 63ab5e0c8f ("net/sfc: use zero RSS channels as disabled RSS indicator")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 20:35:29 +02:00
Ivan Malov
453e1d4baa net/sfc: allow to query RSS key and HF in isolated mode
Isolated mode prevents global RSS from being enabled and configured.
However, an application may need to query default RSS key and hash
functions when a flow rule with RSS action is added which does not
contain custom RSS key or hash function choice. In this case
global RSS key and hash functions will be used to handle the rule,
and there should be some way for the application to query these
global default settings to clarify expectations on the traffic
distribution.

Fixes: 84a9b48128 ("net/sfc: support flow API isolated mode")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 20:35:29 +02:00
Ivan Malov
5205c436a3 net/sfc: do not skip RSS configuration step on reconfigure
Earlier a patch was made to support change of Rx queue
number. That patch added goto label in wrong place
because reconfiguration with the same number of queues
results in skipping not only queue init but also RSS
settings. If a user configures device with RSS multiqueue
mode and then wants to stop it and reconfigure without RSS,
this change will be ignored and RSS will continue working.

Move the label in the right place and rename it to describe it.

Fixes: 55a539003f ("net/sfc: support changing the number of receive queues")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 19:34:29 +02:00
Xiaolong Ye
45e4cf1939 net/ifc: invoke ifcvf HW init function in probe
As ifcvf_init_hw is independent with ifcvf_vfio_setup, it's better to
invoke it directly in probe func.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
2018-10-11 18:56:02 +02:00
Xiao Wang
3e2923cffa net/ifc: fix address translation function name
The address translation from user virtual address to guest physical
address should not be named as qva_to_gpa.

Fixes: a3f8150eac ("net/ifcvf: add ifcvf vDPA driver")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2018-10-11 18:56:02 +02:00
Luca Boccassi
362488e631 net/e1000: enable MSI-x for linkup and other events in 82574
Linux supports 82574 MSI-x interrupt for linkup and other link
conditions. Enable the same feature in the e1000 PMD in order to
allow this card to work properly, as it requires interrupt
handling for link negotiations among other things.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2018-10-11 18:56:02 +02:00
Luca Boccassi
d7812ffd83 net/e1000: do not error out if Rx drop enable is set
rx_drop_en is an optimization that does nothing on single-queue
devices like e1000. Do not force applications that do not care to
select per-devices optimizations flags by returning an error, just
log it and carry on.

Fixes: 805803445a ("e1000: support EM devices (also known as e1000/e1000e)")
Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2018-10-11 18:56:02 +02:00
Xiaoyu Min
2ed2fe5f0a net/mlx5: rewrite IP address UDP/TCP port by E-Switch
Offload the following rte_flow actions by inserting accordingly
E-Switch rules via TC Flower driver

 - RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC
 - RTE_FLOW_ACTION_TYPE_SET_IPV4_DST
 - RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC
 - RTE_FLOW_ACTION_TYPE_SET_IPV6_DST
 - RTE_FLOW_ACTION_TYPE_SET_TP_SRC
 - RTE_FLOW_ACTION_TYPE_SET_TP_DST

The example testpmd command is:

    flow create 0 transfer ingress
         pattern eth / ipv4 / udp dst is 7000 / end
	 actions set_ipv4_src ipv4_addr 172.168.0.1 /
	 set_ipv4_dst ipv4_addr 172.168.10.1 /
	 set_tp_dst port 9000 /
	 set_tp_src port 700 /
	 port_id id 1 / end

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:56:02 +02:00
Moti Haimovsky
92378c2b7f net/mlx5: support e-switch TCP-flags flow filter
This patch adds support for offloading flow rules with TCP-flags
filter to mlx5 eswitch Hardwrae.

With mlx5 it is possible to offload a limited set of flow rules to
the mlxsw (or e-switch) using the DPDK flow commands using the
"transfer" attribute. This set of flow rules also supports filtering
according to the values found in the TCP flags.
This patch implements this offload capability in the mlx5 PMD under
transfer attribute.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
2018-10-11 18:56:02 +02:00
Dekel Peled
3e9fa07908 net/mlx5: allow flow rule with attribute egress
This patch complements [1], adding to MLX5 PMD the option to set
flow rule for egress traffic.

[1] "net/mlx5: support metadata as flow rule criteria"
    http://mails.dpdk.org/archives/dev/2018-September/113275.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:56:02 +02:00
Shahaf Shuler
7dd7be29b4 net/mlx5: always use representor ifindex for ioctl
In the current code, on some cases the representor ethdev is using the
PF interface to query some link status information or pause parameters.

It was done because in previous kernel versions there was no support
from the kernel for the representor info.

Using the PF i/f for such ioctl is error prone and not always working
because:
 * On some cases there is no PF at all, only representors (e.g Bluefield
   with host representors)
 * Query the up/down status from representor and link status from PF
   is in-consist
 * PF link is down doesn't necessarily means representor is down.
 * setting different pause configuration for the PF and the
   representors will result on undefined behaviour

Making the code cleaner and more robust by using only the representor
i/f for the ioctl. whatever the kernel will provide on this query will
be used. No need to do W.A. for kernel missing functionality.

Note:
 1. Setting pause parameters will obviously won't work on representors
 2. Old kernel will not report all the possible representor info

Fixes: 2b73026388 ("net/mlx5: probe all port representors")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-11 18:56:02 +02:00
Shahaf Shuler
d469f6a5eb net/mlx5: add representor specific statistics
Representor ports has a different set of extended statistics (as those are
logical ports which cannot count all that the PF can).

Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-11 18:56:02 +02:00
Shahaf Shuler
1a611fdaf6 net/mlx5: support missing counter in extended statistics
The current code would fail if one of the counters DPDK counters was not
found on the device counters.

As representors and PF port has different counters the both cannot work
together.

Addressing this issue by making the counter init more flexible to
contain all the counter found and skipping the error.

Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-11 18:56:02 +02:00
Ferruh Yigit
9631253ffa drivers/net: fix log type string
Syntax for log type string is "pmd.<subsystem>.<driver>[.<pmd_local>]"

Fixes: 3e92fd4e4e ("net/bnxt: use dynamic log type")
Fixes: d7f4562ab1 ("net/bonding: convert to dynamic logging")
Fixes: 6086ab3bb3 ("net/vdev_netvsc: introduce Hyper-V platform driver")
Fixes: 7db274b9ad ("doc: describe dynamic logging format")
Fixes: a10a988a0b ("net/dpaa2: support dynamic logging")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2018-10-11 18:53:49 +02:00
Yongseok Koh
c10f5d643b net/mlx5: fix errno values for flow engine
Fixes: af689f1f04 ("net/mlx5: support flow Ethernet item along with drop action")
Fixes: 919d53ad78 ("net/mlx5: fix count query when flow has not counter")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-10-11 18:53:49 +02:00
Yongseok Koh
65254667c0 net/mlx5: add missing VLAN action constraints
1) VLAN modify isn't supported by driver.

2) FW syndrome (0xA9C090):
	set_flow_table_entry: push vlan action fte in fdb can ONLY be
	forward to the uplink.

3) FW syndrome (0x294609):
	set_flow_table_entry: modify/pop/push actions in fdb flow table are
	supported only while forwarding to vport.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-10-11 18:53:49 +02:00
Stephen Hemminger
86123c2dfb net/failsafe: use prefix for function
All other visible functions in failsafe driver have 'failsafe_'
prefix.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-10-11 18:53:49 +02:00
Rahul Lakkireddy
48f523f625 net/cxgbe: add flow actions to modify IP and TCP/UDP port
Query firmware for the new filter work request to offload flows with
actions to modify IP and TCP/UDP port addresses. When available,
translate IP and TCP/UDP port address modify actions to internal
hardware specification and offload the flow to hardware.

Original work by Shagun Agrawal

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2018-10-11 18:53:49 +02:00
Juhamatti Kuusisaari
c9507cd0ca net/pcap: support physical interface MAC address
At the moment, PCAP interfaces use dummy MAC by default. This change
adds support for selecting PCAP physical interface MAC with phy_mac=1
devarg. This allows to setup packet flows using the physical interface
MAC.

Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-11 18:53:49 +02:00
Igor Romanov
2631dced95 net/sfc: support Tx descriptor status on EF10 datapath
The implementation is shared by ef10 and ef10_simple datapaths.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 18:53:49 +02:00
Igor Romanov
6bc985e411 net/sfc: support TSO in EF10 Tx datapath
Implementation includes following limitations:

1) Packet's header length must be less than 256 (SFC_TSOH_STD_LEN);
2) Offset of the TCP header must be less than 208
   (EF10_TCP_HEADER_OFFSET_LIMIT);
3) Number of Tx descriptors must be not less than number of descriptors
   needed for TSO settings plus header plus one data segment.

If above conditions are not met, the packet is dropped.

If the maximum descriptor space is insufficient to hold entire TSO packet,
only a part of the packet is sent.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 18:53:49 +02:00
Igor Romanov
f1f575be9b net/sfc: put generalised TSO declarations in a header
Move general TSO declarations in a separate header to be able to use
them in other datapaths (not only EFX). Also update the function that
prepares TSO header to make it useful in other datapaths.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 18:53:49 +02:00
Ferruh Yigit
b2fd027389 mbuf: clarify QinQ flag usage
Update implementation that when PKT_RX_QINQ_STRIPPED mbuf ol_flags
set by PMD, PKT_RX_QINQ, PKT_RX_VLAN_STRIPPED & PKT_RX_VLAN
should be also set.

Clarify mbuf documentations that when PKT_RX_QINQ set PKT_RX_VLAN also
should be set.

So that appllication can rely on PKT_RX_QINQ flag to access both
mbuf.vlan_tci & mbuf.vlan_tci_outer

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-10-11 18:53:49 +02:00
Yongseok Koh
7e43a32ee0 net/mlx5: support externally allocated static memory
When MLX PMD registers memory for DMA, it accesses the global memseg list
of DPDK to maximize the range of registration so that LKey search can be
more efficient. Granularity of MR registration is per page.

Externally allocated memory shouldn't be used for DMA because it can't be
searched in the memseg list and free event can't be tracked by DPDK. If it
is used, the following error will occur:

	net_mlx5: port 0 unable to find virtually contiguous chunk for
	address (0x5600017587c0). rte_memseg_contig_walk() failed.

There's a pending patchset [1] which enables externally allocated memory.
Once it is merged, users can register their own memory out of EAL then that
will resolve this issue.

Meanwhile, if the external memory is static (allocated on startup and never
freed), such memory can also be registered by little tweak in the code.

[1] http://patches.dpdk.org/project/dpdk/list/?series=1415

This patch is not a bug fix but needs to be included in stable versions.

Fixes: 974f1e7ef1 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Yongseok Koh
31912d9924 net/mlx4: support externally allocated static memory
When MLX PMD registers memory for DMA, it accesses the global memseg list
of DPDK to maximize the range of registration so that LKey search can be
more efficient. Granularity of MR registration is per page.

Externally allocated memory shouldn't be used for DMA because it can't be
searched in the memseg list and free event can't be tracked by DPDK. If it
is used, the following error will occur:

	net_mlx5: port 0 unable to find virtually contiguous chunk for
	address (0x5600017587c0). rte_memseg_contig_walk() failed.

There's a pending patchset [1] which enables externally allocated memory.
Once it is merged, users can register their own memory out of EAL then that
will resolve this issue.

Meanwhile, if the external memory is static (allocated on startup and never
freed), such memory can also be registered by little tweak in the code.

[1] http://patches.dpdk.org/project/dpdk/list/?series=1415

This patch is not a bug fix but needs to be included in stable versions.

Fixes: 9797bfcce1 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Xueming Li
45b83b9b04 net/mlx5: fix representor port xstats
This patch fixes the issue that representor port shows xstats of PF.

Fixes: 2b73026388 ("net/mlx5: probe all port representors")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Xueming Li
7bc47fb839 net/mlx5: fix representor port link status
Current code uses PF links status for representor port, not the
representor interface itself.
This caused wrong representor port link status when toggling
interface up or down.

Fixes: 2b73026388 ("net/mlx5: probe all port representors")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Yongseok Koh
57123c00c1 net/mlx5: add Linux TC flower driver for E-Switch flow
Flows having 'transfer' attribute have to be inserted to E-Switch on the
NIC and the control path uses Linux TC flower interface via Netlink
socket.
This patch adds the flow driver on top of the new flow engine.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Yongseok Koh
40c9ccf9e9 net/mlx5: remove Netlink flow driver
Netlink based E-Switch flow engine will be migrated to the new flow
engine.
nl_flow will be renamed to flow_tcf as it goes through Linux TC flower
interface.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Yongseok Koh
0c76d1c9a1 net/mlx5: add abstraction for multiple flow drivers
Flow engine has to support multiple driver paths. Verbs/DV for NIC flow
steering and Linux TC flower for E-Switch flow steering. In the future,
another flow driver could be added (devX).

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
51e72d386c net/mlx5: add runtime parameter to enable Direct Verbs
DV flow API is based on new kernel API and is
missing some functionality like counter but add other functionality
like encap.

In order not to affect current users even if the kernel supports
the new DV API it should be enabled only manually.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
c4d9b9f7f3 net/mlx5: add Direct Verbs final functions
This commits add the missing function which are apply, remove, and
destroy.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
509782b35b net/mlx5: add Direct Verbs driver to glue
This commit adds all Direct Verbs required functions to the glue lib.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
d02cb06912 net/mlx5: add Direct Verbs translate actions
In this commit we add the translation of flow actions.
Unlike the Verbs API actions are separeted from the items and are passed
to the API in array structure.
Since the target action like RSS require the QP information those
actions are handled both in the translate action and in the apply.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
fc2c498ccb net/mlx5: add Direct Verbs translate items
This commit handles the translation of the requested flow into Direct
Verbs API.

The Direct Verbs introduce the matcher object which acts as shared mask
for all flows that are using the same mask. So in this commit we
translate the item and get in return a matcher and the value that should
be matched.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
865a0c1567 net/mlx5: add Direct Verbs prepare function
This function allocates the Direct Verbs device flow, and
introduce the relevant PRM structures.

This commit also adds the matcher object. The matcher object acts as a
mask and should be shared between flows. For example all rules that
should match source IP with full mask should use the same matcher. A
flow that should match dest IP or source IP but without full mask should
have a new matcher allocated.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
3d69434113 net/mlx5: add Direct Verbs validation function
This is commit introduce the Direct Verbs driver API.
The Direct Verbs is an API adds new features like encapsulation, match
on metatdata.
In this commit the validation function was added, most of the validation
is done with functions that are also in use for the Verbs API.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
84c406e745 net/mlx5: add flow translate function
This commit modify the conversion of the input parameters into Verbs
spec, in order to support all previous changes.

Some of those changes are:
removing the use of the parser,
storing each flow in its own flow structure.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
4e05a229c5 net/mlx5: add flow prepare function
In current implementation the calculation of the flow size is done
during the validation stage, and the same function is also used to
translate the input parameters into verbs spec.  This is hard to
maintain and error prone.
Another issue is dev-flows (flows that are created implicitly in order
to support the requested flow for example when the user request RSS on
UDP 2 rules need to be created one for IPv4 and one for IPv6).
In current implementation the dev-flows are created on the same
memory allocation. This will be harder to implement in future drivers.

The commits extract the calculation and creation of the dev-flow from
the translation part (the part that converts the parameters into the
format required by the driver). This results in that the prepare
function only function is to allocate the dev-flow.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Ori Kam
23c1d42c71 net/mlx5: split flow validation to dedicated function
In current implementation the validation logic reside in the same
function that calculates the size of the verbs spec and also create the
verbs spec.
This approach results in hard to maintain code which can't be shared.
also in current logic there is a use of parser entity that holds the
information between function calls. The main problem with this parser is
that it assumes the connection between different functions. For example
it assumes that the validation function was called and relevant values
were set.
This may result in an issue if and when we only call the validation
function, or call the apply function without the validation (Currently
according to RTE flow we must call validation before creating flow, but
if we want to change that to save time during flow creation, for example
the user validated some rule and just want to change the IP there is no
true reason the validate the rule again).

This commit address both of those issues by extracting the validation
logic into detected functions and remove the use of the parser object.
The side effect of those changes is that in some cases there will be a
need to traverse the item list again.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-11 18:53:49 +02:00
Hyong Youb Kim
8a6ff33d6d net/enic: add AVX2 based vectorized Rx handler
Add the vectorized version of the no-scatter Rx handler. It aims to
process 8 descriptors per loop using AVX2 SIMD instructions. This
handler is in its own file enic_rxtx_vec_avx2.c, and makefile and
meson.build are modified to compile it when the compiler supports
AVX2. Under ideal conditions, the vectorized handler reduces
cycles/packet by more than 30%, when compared against the no-scatter
Rx handler. Most implementation ideas come from i40e's AVX2 based
handler, so credit goes to its authors.

At this point, the new handler is meant for field trials, and is not
selected by default. So add a new devarg enable-avx2-rx to allow the
user to request the use of the new handler. When enable-avx2-rx=1, the
driver will consider using the new handler.

Also update the guide doc and introduce the vectorized handler.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-10-11 18:53:49 +02:00
Hyong Youb Kim
cd4e7b3250 net/enic: move common Rx functions to a new header file
Move a number of Rx functions to the header file so that the avx2
based Rx handler can use them.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-10-11 18:53:49 +02:00
Adrien Mazarguil
81b750c75e net/bonding: switch to flow API object conversion function
This patch replaces rte_flow_copy() with rte_flow_conv().

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-10-11 18:53:49 +02:00