Maxime Coquelin [Mon, 28 Sep 2020 09:17:11 +0000 (11:17 +0200)]
examples/vhost: remove dequeue zero-copy support
Dequeue zero-copy feature is being removed from the
Vhost library. This preliminary patch removes its uses
in the Vhost example application.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Mon, 28 Sep 2020 09:17:10 +0000 (11:17 +0200)]
examples/vhost_crypto: use vhost async-copy flag
The crypto backend uses RTE_VHOST_USER_DEQUEUE_ZERO_COPY only
for the shared areas to be populated at mmap time. It does
not use the other mechanisms the feature provides.
Now that RTE_VHOST_USER_DEQUEUE_ZERO_COPY is being removed,
let's use RTE_VHOST_USER_ASYNC_COPY instead which does the
same thing.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Mon, 28 Sep 2020 09:17:09 +0000 (11:17 +0200)]
net/vhost: remove dequeue zero-copy support
The dequeue zero-copy feature from the Vhost library is
being removed in this release, this patch remove its support
in the Vhost PMD.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Marvin Liu [Mon, 28 Sep 2020 08:20:52 +0000 (16:20 +0800)]
net/virtio: fix indirect descriptors in packed datapaths
Like split ring, packed ring will utilize indirect ring
elements when queuing mbufs need multiple descriptors.
Thus each packet will take only one slot when having
multiple segments.
Fixes:
892dc798fa9c ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Marvin Liu [Mon, 28 Sep 2020 08:20:51 +0000 (16:20 +0800)]
net/virtio: fix packed ring indirect descricptors setup
Add packed indirect descriptors format into virtio Tx
region. When initializing vring, packed indirect
descriptors will be initialized if ring type is packed.
Fixes:
bc80357cd677 ("net/virtio: drop unused field in Tx region structure")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Yunjian Wang [Fri, 25 Sep 2020 11:22:06 +0000 (19:22 +0800)]
examples/vhost_blk: check driver start failure
This checks the return value from the function
rte_vhost_driver_start.
Coverity issue: 362027
Fixes:
c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Ivan Dyukov [Tue, 22 Sep 2020 21:18:02 +0000 (00:18 +0300)]
net/virtio: sync speed capability with ethdev
ethdev library was updated with new speed 200G
Add 200G speed capa to virtio device
Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Ivan Dyukov [Tue, 22 Sep 2020 21:18:01 +0000 (00:18 +0300)]
net/virtio: set default speed unknown
rte_ethdev states new rule for NICs: they should return UNKNOWN
speed if speed is unknown and interface is up, in case of down
interface, NONE speed should be returned.
Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Tue, 15 Sep 2020 07:25:56 +0000 (09:25 +0200)]
vhost: promote vDPA API as stable
As announced in v20.08, this patch makes the vDPA
and related Vhost API stable.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Chenbo Xia [Wed, 30 Sep 2020 04:23:28 +0000 (12:23 +0800)]
doc: fix ethdev port id size
The ethdev port id should be 16 bits now. This patch changes the
variable size of port id in docs from 8 bits to 16 bits.
Fixes:
fdec9301f52d ("doc: add flow classify guides")
Fixes:
4a3ef59a10c8 ("examples/flow_filtering: add simple demo of flow API")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Chenbo Xia [Wed, 30 Sep 2020 04:23:27 +0000 (12:23 +0800)]
app: fix ethdev port id size
The ethdev port id should be 16 bits now. This patch changes the
variable size of port id in applications from 8 bits to 16 bits.
Fixes:
e977e4199a8d ("app/testpmd: add commands to load/unload BPF filters")
Fixes:
46cf97e4bbfa ("eventdev: add test for eth Tx adapter")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Chenbo Xia [Wed, 30 Sep 2020 04:23:26 +0000 (12:23 +0800)]
drivers/net: fix port id size
The ethdev port id should be 16 bits now. This patch changes the
variable size of port id in some net drivers from 8 bits to 16
bits.
Fixes:
09b23f8b9df6 ("net/bnxt: fix port stop process and cleanup resources")
Fixes:
769de16872ab ("net/bnxt: fix port default rule create/destroy")
Fixes:
50370662b727 ("net/ice: support device and queue ops")
Fixes:
a50d7cbbdad7 ("net/qede: support registers dump")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Dumitru Ceara [Mon, 28 Sep 2020 18:47:29 +0000 (20:47 +0200)]
net/ring: advertise multi segment Tx and scatter Rx
Even though ring interfaces don't support any other TX/RX offloads they
do support sending multi segment packets and this should be advertised
in order to not break applications that use ring interfaces.
Also advertise scatter RX support.
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Andrew Rybchenko [Thu, 24 Sep 2020 13:02:35 +0000 (14:02 +0100)]
net/sfc: create virtual switch to enable VFs
PF driver is responsible for vSwitch creation and vPorts allocation
for VFs.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:40:59 +0000 (13:40 +0100)]
net/sfc: fix RSS hash offload if queue action is used
When RSS hash offload is requested, the ingress filters that forward
packets to an RX queue must have an RSS context assigned to them to
calculate RSS hash, which was not always provided.
Fix it by creating a dummy RSS context that forwards packets
to the same queue and assign it to created by flow API filters when
RSS hash offload is enabled. RSS key and hash functions from
default RSS context are used.
Fixes:
5d308972954c ("ethdev: add mbuf RSS update as an offload")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Igor Romanov [Thu, 24 Sep 2020 12:40:58 +0000 (13:40 +0100)]
net/sfc: fix RSS hash flag when offload is disabled
Do not set RSS hash flag in the received mbufs when RSS hash
offload is not enabled, which means that RSS hash value is invalid.
Fixes:
5d308972954c ("ethdev: add mbuf RSS update as an offload")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Li Zhang [Wed, 9 Sep 2020 03:34:34 +0000 (06:34 +0300)]
app/testpmd: extend ICMP flow matching fields
Ability to distinguish ICMP identifier fields in packets.
Distinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version.
Existing fields in ICMP header contain the required information.
ICMP header already is supported and no code change in RTE FLOW.
Extend testpmd CLI to include the fields of ident and sequence number.
One example:
flow create 0 ingress pattern eth / ipv4 /
icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end
The ICMP packet with code 1, identifier 5 and
sequence number 6 will be matched.
It will implement action counter and forward to queue 0.
Signed-off-by: Li Zhang <lizh@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Ciara Loftus [Fri, 25 Sep 2020 09:20:21 +0000 (09:20 +0000)]
net/af_xdp: enable custom XDP program loading
The new 'xdp_prog=<string>' vdev arg allows the user to specify the path to
a custom XDP program to be set on the device, instead of the default libbpf
one. The program must have an XSK_MAP of name 'xsks_map' which will allow
for the redirection of some packets to userspace and thus the PMD, using
some criteria defined in the program. This can be useful for filtering
purposes, for example if we only want a subset of packets to reach
userspace or to drop or process a subset of packets in the kernel.
Note: a netdev may only load one program.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Tested-by: Xuekun Hu <xuekun.hu@intel.com>
Phil Yang [Thu, 3 Sep 2020 02:53:10 +0000 (10:53 +0800)]
net/mlx5: relax atomic refcnt for multi-packet Rx buffer
Use C11 atomics with RELAXED ordering instead of the rte_atomic ops
which enforce unnecessary barriers on aarch64.
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Yunjian Wang [Mon, 24 Aug 2020 11:46:53 +0000 (19:46 +0800)]
net/qede: fix dereference before null check
Coverity flags that 'fp->sb_info' variable is used before
it's checked for NULL. This patch fixes this issue.
Coverity issue: 260413
Fixes:
4c4bdadfa9e7 ("net/qede: refactoring multi-queue implementation")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Kiran Kumar K [Thu, 27 Aug 2020 11:40:41 +0000 (17:10 +0530)]
net/octeontx2: move ESP parsing to LE layer
Add support to parse NAT-T-ESP by moving the ESP parsing
to LE.
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:34 +0000 (01:14 +0200)]
app/testpmd: align behaviour of multi-port detach
A port can be closed in multiple situations:
- close command calling close_port() -> rte_eth_dev_close()
- exit calling close_port() -> rte_eth_dev_close()
- hotplug calling close_port() -> rte_eth_dev_close()
- hotplug calling detach_device() -> rte_dev_remove()
- port detach command, detach_device() -> rte_dev_remove()
- device detach command, detach_devargs() -> rte_eal_hotplug_remove()
The flow rules are flushed before each close.
It was already done in close_port(), detach_devargs() and
detach_port_device() which calls detach_device(),
but not in detach_device(). As a consequence, it was missing for siblings
of port detach command and unplugged device.
The check before calling port_flow_flush() is moved inside the function.
The state of the port to close is checked to be stopped.
As above, this check was missing in detach_device(),
impacting the cases of a multi-port device unplugged or detached
with the port detach command.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:33 +0000 (01:14 +0200)]
app/testpmd: reset port status on close notification
Since rte_eth_dev_release_port() is called on all port close operations,
the event RTE_ETH_EVENT_DESTROY can be reliably used for resetting
the port status on the application side.
The intermediate state RTE_PORT_HANDLING is removed in close_port()
because a port can also be closed by a PMD in a device remove operation.
In case multiple ports are closed, calling remove_invalid_ports()
only once is enough.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:32 +0000 (01:14 +0200)]
drivers/net: remove redundant MAC addresses freeing
The MAC addresses array is already freed by rte_eth_dev_release_port().
The redundant freeing can be removed from the PMD port closing functions.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:31 +0000 (01:14 +0200)]
drivers/net: check process type in close operation
The secondary processes are not allowed to release shared resources.
Only process-private resources should be freed in a secondary process.
Most of the time, there is no process-private resource,
so the close operation is just forbidden in a secondary process.
After adding proper check in the port close functions,
some redundant checks in the device remove functions are dropped.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:30 +0000 (01:14 +0200)]
drivers/net: accept removing device without any port
The ports can be closed (i.e. completely released)
before removing the whole device.
Such case was wrongly considered an error by some drivers.
If the device supports only one port, there is nothing much
to free after the port is closed.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:29 +0000 (01:14 +0200)]
ethdev: remove old close behaviour
The temporary flag RTE_ETH_DEV_CLOSE_REMOVE is removed.
It was introduced in DPDK 18.11 in order to give time for PMDs to migrate.
The old behaviour was to free only queues when closing a port.
The new behaviour is calling rte_eth_dev_release_port() which does
three more tasks:
- trigger event callback
- reset state and few pointers
- free all generic port resources
The private port resources must be released in the .dev_close callback.
The .remove callback should:
- call .dev_close callback
- call rte_eth_dev_release_port()
- free multi-port device shared resources
Despite waiting two years, some drivers have not migrated,
so they may hit issues with the incompatible new behaviour.
After sending emails, adding logs, and announcing the deprecation,
the only last solution is to declare these drivers as unmaintained:
ionic, liquidio, nfp
Below is a summary of what to implement in those drivers.
* The freeing of private port resources must be moved
from the ".remove(device)" function to the ".dev_close(port)" function.
* If a generic resource (.mac_addrs or .hash_mac_addrs) cannot be freed,
it must be set to NULL in ".dev_close" function to protect from
subsequent rte_eth_dev_release_port() freeing.
* Note 1:
The generic resources are freed in rte_eth_dev_release_port(),
after ".dev_close" is called in rte_eth_dev_close(), but not when
calling ".dev_close" directly from the ".remove" PMD function.
That's why rte_eth_dev_release_port() must still be called explicitly
from ".remove(device)" after calling the ".dev_close" PMD function.
* Note 2:
If a device can have multiple ports, the common resources must be freed
only in the ".remove(device)" function.
* Note 3:
The port is supposed to be in a stopped state when it is closed.
If it is not the case, it is free to the PMD implementation
how to react when trying to close a non-stopped port:
either try to stop it automatically or just return an error.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Yunjian Wang [Mon, 28 Sep 2020 23:14:28 +0000 (01:14 +0200)]
net/tap: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:27 +0000 (01:14 +0200)]
net/softnic: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
Nothing is closed in a secondary process.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:26 +0000 (01:14 +0200)]
net/ring: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
Nothing is closed in a secondary process.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Rasesh Mody [Mon, 28 Sep 2020 23:14:25 +0000 (01:14 +0200)]
net/qede: release port upon close
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
for the port can be freed by rte_eth_dev_close(). With this change the
private port resources are released in the .dev_close callback.
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Sachin Saxena [Mon, 28 Sep 2020 23:14:24 +0000 (01:14 +0200)]
net/pfe: release port upon close
With removal of old close behavior, the private
port resources must be released in the .dev_close callback.
Freeing of port private resources is moved from
the ".remove(device)" to the ".dev_close(port)" operation
Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:23 +0000 (01:14 +0200)]
net/pcap: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:22 +0000 (01:14 +0200)]
net/octeontx: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
The callback ".dev_close(port)" is called also
from the ".remove(device)" operation.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:21 +0000 (01:14 +0200)]
net/null: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:20 +0000 (01:14 +0200)]
net/mlx4: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:19 +0000 (01:14 +0200)]
net/failsafe: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Sachin Saxena [Mon, 28 Sep 2020 23:14:18 +0000 (01:14 +0200)]
net/enetc: release port upon close
With removal of old close behavior, the private
port resources must be released in the .dev_close callback.
Freeing of port private resources is moved from
the ".remove(device)" to the ".dev_close(port)" operation
Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Sachin Saxena [Mon, 28 Sep 2020 23:14:17 +0000 (01:14 +0200)]
net/dpaa2: release port upon close
With removal of old close behavior, the private
port resources must be released in the .dev_close callback.
Freeing of port private resources is moved from
the ".remove(device)" to the ".dev_close(port)" operation
Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Sachin Saxena [Mon, 28 Sep 2020 23:14:16 +0000 (01:14 +0200)]
net/dpaa: release port upon close
With removal of old close behavior, the private
port resources must be released in the .dev_close callback.
Freeing of port private resources is moved from
the ".remove(device)" to the ".dev_close(port)" operation
Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:15 +0000 (01:14 +0200)]
net/bonding: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Rasesh Mody [Mon, 28 Sep 2020 23:14:14 +0000 (01:14 +0200)]
net/bnx2x: release port upon close
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources
for the port can be freed by rte_eth_dev_close(). With this change the
private port resources are released in the .dev_close callback.
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:13 +0000 (01:14 +0200)]
net/axgbe: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
The ".dev_close" callback is also called as part of the ".remove" one.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:12 +0000 (01:14 +0200)]
net/atlantic: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Igor Russkikh <irusskikh@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:11 +0000 (01:14 +0200)]
net/af_packet: release port upon close
The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources
can be freed by rte_eth_dev_close().
Freeing of private port resources is moved
from the ".remove(device)" to the ".dev_close(port)" operation.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:10 +0000 (01:14 +0200)]
ethdev: allow drivers to return error on close
The device operation .dev_close was returning void.
This driver interface is changed to return an int.
Note that the API rte_eth_dev_close() is still returning void,
although a deprecation notice is pending to change it as well.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Thomas Monjalon [Mon, 28 Sep 2020 23:14:09 +0000 (01:14 +0200)]
ethdev: reset device and interrupt pointers on release
The pointers .device and .intr_handle were already reset by the helper
rte_eth_dev_pci_generic_remove().
It is now made part of rte_eth_dev_release_port().
It makes rte_eth_dev_pci_release() meaningless,
so it is replaced with a call to rte_eth_dev_release_port().
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Huisong Li [Fri, 25 Sep 2020 12:47:19 +0000 (20:47 +0800)]
app/testpmd: fix displaying Rx/Tx queues information
Currently, the information of Rx/Tx queues from PMD driver is not
displayed exactly in the rxtx_config_display function. Because
"ports[pid].rx_conf" and "ports[pid].tx_conf" maintained in testpmd
application may be not the value actually used by PMD driver. For
instance, user does not set a field, but PMD driver has to use the
default value.
This patch fixes rxtx_config_display so that the information of Rx/Tx
queues can be really displayed for the PMD driver that implement
.rxq_info_get and .txq_info_get ops callback function.
Fixes:
75c530c1bd53 ("app/testpmd: fix port configuration print")
Fixes:
d44f8a485f5d ("app/testpmd: enable per queue configure")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Chengchang Tang [Fri, 25 Sep 2020 12:47:18 +0000 (20:47 +0800)]
app/testpmd: fix descriptor id check
The number of desc is a per queue configuration. But in the check
function, nb_txd & nb_rxd are used to check whether the desc_id is
valid. nb_txd & nb_rxd are the global configuration of number of desc.
If the queue configuration is changed by cmdline liks: "port config xx
txq xx ring_size xxx", the real value will be changed.
This patch use the real value to check whether the desc_id is valid.
And if these are not configured by user. It will use the default value
to check it, since the rte_eth_rx_queue_setup & rte_eth_tx_queue_setup
will use a default value to configure the queue if nb_rx_desc or
nb_tx_desc is zero.
Fixes:
af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Chengchang Tang [Fri, 25 Sep 2020 12:47:17 +0000 (20:47 +0800)]
app/testpmd: fix packet header in txonly mode
In txonly forward mode, the packet header is fixed by the initial
setting, including the packet length and checksum. So when the packets
varies, this may cause a packet header error. Currently, there are two
methods in txonly mode to randomly change the packets.
1. Set txsplit random and txpkts (x[,y]*), the number of segments
each packets will be a random value between 1 and total number of
segments determined by txpkts settings.
The step as follows:
a) ./testpmd -w xxx -l xx -n 4 -- -i --disable-device-start
b) port config 0 tx_offload multi_segs on
c) set fwd txonly
d) set txsplit rand
e) set txpkts 2048,2048,2048,2048
f) start
The nb_segs of the packets sent by testpmd will be 1~4. The real packet
length will be 2048, 4096, 6144 and 8192. But in fact the packet length
in ip header and udp header will be fixed by 8178 and 8158.
2. Set txonly-multi-flow. the ip address will be varied to generate
multiple flow.
The step as follows:
a) ./testpmd -w xxx -l xx -n 4 -- -i --txonly-multi-flow
b) set fwd txonly
c) start
The ip address of each pkts will change randomly, but since the header
is fixed, the checksum may be a error value.
Therefore, this patch adds a function to update the packet length and
check sum in the pkts header when the txsplit mode is set to rand or
multi-flow is set.
Fixes:
82010ef55e7c ("app/testpmd: make txonly mode generate multiple flows")
Fixes:
79bec05b32b7 ("app/testpmd: add ability to split outgoing packets")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Chengchang Tang [Fri, 25 Sep 2020 12:47:16 +0000 (20:47 +0800)]
app/testpmd: remove restriction on Tx segments set
Currently, if nb_txd is not set, the txpkts is not allowed to be set
because the nb_txd is used to avoid the number of segments exceed the Tx
ring size and the default value of nb_txd is 0. And there is a bug that
nb_txd is the global configuration for Tx ring size and the ring size
could be changed by some command per queue. So these valid check is
unreliable and introduced unnecessary constraints.
This patch adds a valid check function to use the real Tx ring size to
check the validity of txpkts.
Fixes:
af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Chengchang Tang [Fri, 25 Sep 2020 12:47:15 +0000 (20:47 +0800)]
app/testpmd: fix VLAN configuration on failure
When failing to configure VLAN offloads after the port was started, there
is no need to update the port configuration. Currently, when user
configure an unsupported VLAN offloads and fails, and then restart the
port, it will fails since the configuration has been refreshed.
This patch makes the function return directly instead of refreshing the
configuration when execution fails.
Fixes:
384161e00627 ("app/testpmd: adjust on the fly VLAN configuration")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Chengchang Tang [Fri, 25 Sep 2020 12:47:14 +0000 (20:47 +0800)]
app/testpmd: fix port id check in Tx VLAN command
To set Tx vlan offloads, it is required to stop port firstly. But before
checking whether the port is stopped, the port id entered by the user
is not checked for validity. When the port id is illegal, it would lead
to a segmentation fault since it attempts to access a member of
non-existent port.
This patch adds verification of port id in tx vlan offloads and remove
duplicated check.
Fixes:
597f9fafe13b ("app/testpmd: convert to new Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Andy Moreton [Thu, 24 Sep 2020 12:12:35 +0000 (13:12 +0100)]
common/sfc_efx/base: handle descriptor proxy queue events
The TXQ_DESC and VIRTQ_DESC events are used to pass host descriptors
over an extended width event queue to an application processor for
handling. See SF-122927-TC and SF-122966-SW for details.
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andy Moreton [Thu, 24 Sep 2020 12:12:34 +0000 (13:12 +0100)]
common/sfc_efx/base: add option for descriptor proxy queues
EF100 uses descriptor proxy queues to support virtio-blk proxy.
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andy Moreton [Thu, 24 Sep 2020 12:12:33 +0000 (13:12 +0100)]
common/sfc_efx/base: handle normal events in extended width
Process the encasulated events as for the normal event loop. The phase
bit in the encapsulated event should be ignored, as the polling loop
uses the phase bit from the extended-width event.
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andy Moreton [Thu, 24 Sep 2020 12:12:32 +0000 (13:12 +0100)]
common/sfc_efx/base: poll extended width event queues
Extended width queues use a different layout and so require
a different polling loop.
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andy Moreton [Thu, 24 Sep 2020 12:12:31 +0000 (13:12 +0100)]
common/sfc_efx/base: support creation of extended width EvQ
Add a flag to request an extended width event queue, and
check that the supplied buffer is large enough to hold the
event queue descriptors.
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andy Moreton [Thu, 24 Sep 2020 12:12:30 +0000 (13:12 +0100)]
common/sfc_efx/base: add 256-bit type
EF100 requires support for extended-width event descriptors
for use with descriptor proxy queues. Extend libefx types
used for hardware access (and endian conversion) to support
a 256bit data type.
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andy Moreton [Thu, 24 Sep 2020 12:12:29 +0000 (13:12 +0100)]
common/sfc_efx/base: add option for extended width events
EF100 uses event queues with 256bit extended width events to
support descriptor proxy queues.
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:28 +0000 (13:12 +0100)]
common/sfc_efx/base: allocate vAdaptor on Riverhead
Riverhead has EVB support similar to EF10 and NIC must allocate
its vAdaptor on init.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:27 +0000 (13:12 +0100)]
common/sfc_efx/base: use EF10 EVB methods for Riverhead
There is no difference yet in EVB support on EF10 and Riverhead.
So, it is better to reuse existing methods.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:26 +0000 (13:12 +0100)]
common/sfc_efx/base: replace PCI efsys macros with functions
efsys macros that manipulate PCI devices cannot be defined in
common sfc_efx DPDK driver since in DPDK build the bus drivers
that provide required functionality are built after common drivers.
Replace the macros with function callbacks to remove that build
dependency. Drivers now should pass the callbacks directly to
efx function instead of defining implementation in efsys.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:25 +0000 (13:12 +0100)]
common/sfc_efx/base: support UDP tunnel operations for EF100
EF100 uses VNIC encapsulation rule MCDI for configuring UDP
tunnels in HW individually. Use busy added and removed states
of UDP tunnel table entries for the implementation.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:24 +0000 (13:12 +0100)]
common/sfc_efx/base: introduce states for UDP tunnel entries
UDP tunnel reconfigure operation takes UDP tunnel table, which contains
entries that need to be applied to HW. This approach does not retain
information about what entries were removed or added, which is required
for Riverhead.
Add states to the table entries to indicate add or remove operations.
On tunnel reconfiguration added and removed entries become busy to
indicate that the entries are currently configured and to prevent add or
remove operations from other threads. After tunnel reconfiguration is
complete, the states are reset - added entries become applied and
removed entries are purged from the table.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:23 +0000 (13:12 +0100)]
common/sfc_efx/base: introduce UDP tunnel destruct operation
The procedures for destroying UDP tunnels are NIC family specific,
so they should be implemented separately for each of them.
Check for supported UDP encapsulation is removed from generic
operations since it is no longer used by the generic libefx API.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:22 +0000 (13:12 +0100)]
common/sfc_efx/base: add NIC magic check on BAR lookup
Check that BAR lookup was successful by looking at the content
of signature register.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:21 +0000 (13:12 +0100)]
common/sfc_efx/base: add Xilinx capabilities table lookup
APIs for searching a capability in a Xilinx capabilities table and
reading table entries are needed for function control window lookup
to get the bar index and offset of the window.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:20 +0000 (13:12 +0100)]
common/sfc_efx/base: add efsys API to find a memory BAR
Function control window lookup needs memory BARs handles to
search Xilinx capabilities tables.
Define an API to get a memory BAR handle by a PCIe device handle and
BAR index.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:19 +0000 (13:12 +0100)]
common/sfc_efx/base: add function control window lookup API
Riverhead NIC may provide a locator of function control window
(EF100 resource locator).
The locator may be present in a Xilinx capabilities table which
itself is located by looking into extended PCI capabilities.
PCI capabilities are made possible to access by adding PCI config
space interface to efsys.
APIs are implemented to facilitate function control window lookup:
- API to find an extended PCI capability given a capability ID;
- API to read Xilinx PCI capability;
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Igor Romanov [Thu, 24 Sep 2020 12:12:18 +0000 (13:12 +0100)]
common/sfc_efx/base: add function control window concept
Function control window can be located at a different offset than
other windows on Riverhead. Meaning that the drivers must handle
accesses to the function control window differently in case of EF100.
Add accessor macros for function control window and change
EFX NIC create API to facilitate that accessors.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:17 +0000 (13:12 +0100)]
common/sfc_efx/base: choose smallest Rx prefix on Riverhead
Riverhead supports many Rx prefixes. The Rx prefix may be chosen
based on which information is required.
To have better performance choose the smallest Rx prefix which
meets our requirements.
Right now there is no way to specify requirements on Rx queue
creation, but it could be added in the future.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:16 +0000 (13:12 +0100)]
common/sfc_efx/base: group RxQ parameters into a structure
Make number of efx_mcdi_init_rxq() arguments reasonable before
addition of one more argument.
Non essential parameters not supported in some cases are moved
into helper structure.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:15 +0000 (13:12 +0100)]
common/sfc_efx/base: add API to get Rx prefix information
Define default Siena, EF10 default, packed stream, equal-stride
superbuffer and Riverhead default prefixes in order to make an API
to get Rx prefix layout information generic and usable on all NICs.
Riverhead supports many Rx prefixes. Riverhead FW supports MCDI to
choose Rx prefix based on required Rx prefix fields and allows to
query the prefix layout using MCDI. The patch prepares to introduce
the support in libefx and provides fallback for NICs and FW which
lacks the support.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:14 +0000 (13:12 +0100)]
common/sfc_efx: do not include libefx headers from efsys.h
efsys.h may depends on target system headers only. Otherwise, it could
result in cross-dependency when libefx header depends on efsys.h and
efsys.h depends on the libefx header.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <andrewle@xilinx.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Ivan Malov [Thu, 24 Sep 2020 12:12:13 +0000 (13:12 +0100)]
common/sfc_efx/base: report restrictions for TSO version 3
Riverhead puts a number of restrictions on TSO transactions.
Reflect some of them in the NIC configuration structure.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <andrewle@xilinx.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Ivan Malov [Thu, 24 Sep 2020 12:12:12 +0000 (13:12 +0100)]
common/sfc_efx/base: indicate support for TSO version 3
Riverhead boards support TSO version 3.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <andrewle@xilinx.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:11 +0000 (13:12 +0100)]
common/sfc_efx/base: handle Tx complete on Riverhead
Introduce a new event callback which has the same prototype, but
provides number of completed descriptors instead of the last
completed descriptor index.
When all libefx-based drivers implement the new callback, libefx
may be updated to use it for Siena and EF10 family NICs and
the old one may be removed.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:10 +0000 (13:12 +0100)]
common/sfc_efx/base: handle Rx events for Riverhead
Rx event on Riverhead provides a number of received packets and
no classification/offloads information is available Rx event.
Introduce a new event callback to be implemented by drivers.
The callback provides information about the number of completed
packets. libefx-based drivers should implement the new callback
for Riverhead and keep the old one for Siena and EF10 NICs.
The new callback may be used for Medford2 NO_CONT_EV Rx mode
support.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:09 +0000 (13:12 +0100)]
common/sfc_efx/base: fix Tx descriptor DMA sync on Riverhead
Rx/Tx queue DMA sync should not assume descriptor size to be the same
for all NIC familties since it Tx descritor size is 16 on Riverhead.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:08 +0000 (13:12 +0100)]
common/sfc_efx/base: implement Tx control path for Riverhead
Tx control path on Riverhead is very similar to EF10, but datapath
differs a lot since Tx descriptor size is 16 bytes (vs 8 bytes on EF10).
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:07 +0000 (13:12 +0100)]
common/sfc_efx/base: implement Rx control path for Riverhead
Reuse EF10 RSS-related functions since current version of the RSS
interface is compatible with EF10.
Implement own functions to create and destroy Rx queues which reuse
MCDI wrappers which are shared with EF10.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:06 +0000 (13:12 +0100)]
common/sfc_efx/base: move Rx index check to generic code
Make NIC family specific functions a bit shorter and reduce
code duplication.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:05 +0000 (13:12 +0100)]
common/sfc_efx/base: free Rx queue structure in generic code
Rx queue structure is allocated in generic code, but was freed in NIC
family specific callbacks. Move free to generic function makes NIC
family specific callbacks shorter and reduces code duplication.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:04 +0000 (13:12 +0100)]
common/sfc_efx/base: maintain RxQ counter in generic code
The counter is incremented in generic efx_rx_qcreate(), but was
asserted and decremented in NIC family specific queue create and
destroy callbacks. Move assert and decrement to generic functions
as well to make NIC family specific callbacks shorter.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:03 +0000 (13:12 +0100)]
common/sfc_efx/base: switch TxQ init to extended version
Extended version of MCDI allows up to 64 DMA addresses which are
required for Riverhead.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:02 +0000 (13:12 +0100)]
common/sfc_efx/base: move TxQ init/fini wrappers to generic
TxQ init/fini MCDI is similar on Riverhead and these
functions should be reused to implement TxQ creation and
destruction on Riverhead.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:01 +0000 (13:12 +0100)]
common/sfc_efx/base: move RxQ init/fini wrappers to generic
RxQ init/fini MCDI is similar on Riverhead and these
functions should be reused to implement RxQ creation and
destruction on Riverhead.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:12:00 +0000 (13:12 +0100)]
common/sfc_efx/base: handle MCDI events on Riverhead
EF100 MCDI event layout is same as on EF10 except added QDMA phase
bit which is unused on EF10.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Ivan Malov [Thu, 24 Sep 2020 12:11:59 +0000 (13:11 +0100)]
common/sfc_efx/base: complete EvQ creation on Riverhead
Client drivers relying on interrupts will fail to complete event
queue creation on Riverhead boards as the latter have no support
for INIT_DONE events which means that it's useless to wait until
initialisation callback is triggered by interrupt-driven polling.
Client drivers which avoid interrupt-driven polling still handle
INIT_DONE events by direct polling and will fail to do so.
Solve this problem by adding an extra poll-once method which
will be called by client drivers after queue creation (probably,
with driver-specific lock being held). The method will invoke
initialisation callback on Riverhead and do nothing on the other
boards. Then the drivers will proceed with normal waiting which
will complete immediately in the case of Riverhead.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:58 +0000 (13:11 +0100)]
common/sfc_efx/base: add event queue module for Riverhead
Events are significantly reworked on Riverhead, so it is better
to implement own set of callbacks to simplify future development
and avoid inheritance of legacy code.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:57 +0000 (13:11 +0100)]
common/sfc_efx/base: merge versions of init EvQ wrappers
The decision on which version of the INIT_EVQ command to use may
be done inside the function itself. Caller should just provide
enough information sufficient in both cases. It avoids code
duplication and simplifies maintenance.
If v2 is not supported, keep decision about low-latency hint outside
the MCDI helper function since it will differ on Riverhead (there is
no EVB yet, but still want merging for better throughput).
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:56 +0000 (13:11 +0100)]
common/sfc_efx/base: prepare to merge EvQ init functions
v1 and v2 defines are the same except output length.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:55 +0000 (13:11 +0100)]
common/sfc_efx/base: move EvQ create generic checks
There is no point to duplicate these generic checks in NIC family
specific handlers.
As the side effect it fixes bug with incorrect interrupt moderation
settings silently ignored on event queue create on Siena.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:54 +0000 (13:11 +0100)]
common/sfc_efx/base: move EvQ init/fini wrappers to generic
EvQ init/fini MCDI is similar on Riverhead and these
functions should be reused to implement EvQ creation and
destruction on Riverhead.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:53 +0000 (13:11 +0100)]
common/sfc_efx/base: add interrupts module for Riverhead
Riverhead supports interrupt aggregation rings. Right now there
are no plans to support it in libefx, but it is better to have
own set of callbacks to easier handle EF10 and Riverhead
differences in the future.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:52 +0000 (13:11 +0100)]
common/sfc_efx/base: use EF10 MAC methods for Riverhead
There is no difference yet in MAC support on EF10 and Riverhead.
So, it is better to reuse existing methods.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:51 +0000 (13:11 +0100)]
common/sfc_efx/base: use EF10 filter methods for Riverhead
Filtering MCDI on Riverhead are the same as on EF10.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:50 +0000 (13:11 +0100)]
common/sfc_efx/base: use dummy tunnel ops for Riverhead
Riverhead does not support tunnels yet.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Andrew Rybchenko [Thu, 24 Sep 2020 12:11:49 +0000 (13:11 +0100)]
common/sfc_efx/base: add Riverhead support to NIC module
Define basic NIC features and limitations.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>