Huisong Li [Fri, 22 Jan 2021 10:18:40 +0000 (18:18 +0800)]
net/hns3: move queue stats to xstats
One of the hot discussions in community recently was moving queue stats
to xstats. In this solution, a temporary
'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag is created to implement
the smooth switch. And the first half of this work has been completed in
the ethdev framework. Now driver needs to remove the flag from the
driver initialization process and does the rest of work.
For better readability and reasonability, per-queue stats also should be
cleared when rte_eth_stats is cleared. Otherwise, the sum of one item in
per-queue stats may be greater than corresponding item in rte_eth_stats.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Huisong Li [Fri, 22 Jan 2021 10:18:39 +0000 (18:18 +0800)]
net/hns3: encapsulate DFX stats in datapath
pkt_len_errors and l2_errors in Rx datapath indicate that driver
needs to discard received packets. And driver does not discard
packets for l3/l4/ol3/ol4_csum_errors in Rx datapath and others
stats in Tx datapath. Therefore, it is necessary for improving
code readability and maintainability to encapsulate error stats
and dfx stats.
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Jiawei Wang [Tue, 26 Jan 2021 03:49:42 +0000 (05:49 +0200)]
app/testpmd: fix sample action for RSS with no key
When the RSS with null key was set in sample actions list, it
caused the segmentation fault since the RSS key pointer was
NULL while did the memory copy.
This patch adds the RSS key NULL pointer checking before copying
to fix the segmentation fault issue.
Fixes:
11b1b0eddade ("app/testpmd: support RSS in sample action")
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Dapeng Yu [Tue, 26 Jan 2021 09:52:11 +0000 (17:52 +0800)]
net/i40e: fix register setting for hash enable
The original code causes wrong value to be set into PFQF_HENA
register because unnecessary calling to get translated pctype
value for X722 NIC. As a result RSS is not working.
So remove the unnecessary translation.
Fixes:
ef4c16fd9148 ("net/i40e: refactor RSS flow")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Haiyue Wang [Wed, 27 Jan 2021 16:05:16 +0000 (00:05 +0800)]
net/ice/base: do not set VLAN mode in DCF mode
The PF will set the VLAN mode globally, DCF just needs to get the VLAN
mode.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Viacheslav Ovsiienko [Wed, 27 Jan 2021 13:53:05 +0000 (15:53 +0200)]
net/mlx5: fix wire vport hint
In order to optimize number of hops in the steering tables there
was the hint field of source vport in the matcher. If this hint
was provided for the wire port the actual vport match, used by
kernel, was not set in the matcher metadata register field.
This could led to not creating the rule in hardware and E-Switch
malfunction if kernel used non-zero metadata value for the wire
vport.
This patch always sets the match for the vport metadata register
value besides the hint.
Fixes:
aaf34de5d801 ("net/mlx5: add wire vport hint")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Alexander Kozyrev [Thu, 28 Jan 2021 08:00:14 +0000 (08:00 +0000)]
net/mlx5: support modify field flow action
Add support for new MODIFY_FIELD action to the Mellanox PMD.
This is the generic API that allows to manipulate any packet
header field by copying data from another packet field or
mark, metadata, tag, or immediate value (or pointer to it).
Since the API is generic and covers a lot of action under its
umbrella it makes sense to implement all the mechanics gradually
in order to move to this API for any packet field manipulations
in the future. This is the first step of RTE flows consolidation.
The modify field RTE flow action supports three operations: set,
add and sub. This patch brings to live only the "set" operation.
Support is provided for any packet header field as well as
meta/tag/mark and immediate value can be used as a source.
There are few limitations for this first version of API support:
- encapsulation levels are not supported, just outermost header
can be manipulated for now.
- offsets can only be 4-bytes aligned: 32, 64 and 96 for IPv6.
- the special ITEM_START ID is not supported as we do not allow
to cross packet header field boundaries yet.
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Alexander Kozyrev [Mon, 25 Jan 2021 17:01:13 +0000 (17:01 +0000)]
common/mlx5: add GTP TEID modification ID
Define hardware ID for GTP TEID modification. This value
can be used later in the RTE modify field API.
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Jiawei Wang [Tue, 26 Jan 2021 15:37:56 +0000 (17:37 +0200)]
net/mlx5: fix count actions query in sample flow
If the count action was presented in sample actions list, MLX5 PMD
created the counter resource and saved the index of counter in the
sample resource only, the counter index of flow was not updated.
This patch removes the counter index in the sampler resource and
saves it into the flow, and adds the checking to make sure only one
count be created once per flow, it's used for all sample sub flows.
Fixes:
0756228b2704 ("net/mlx5: update translate function for sample action")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Dana Vardi [Wed, 27 Jan 2021 16:09:48 +0000 (18:09 +0200)]
net/mvpp2: add fill buffs to configuration file
Extend config file with 'fill_bpool_buffs'
which control the amount of refill buffers
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Dana Vardi [Wed, 27 Jan 2021 16:09:47 +0000 (18:09 +0200)]
net/mvpp2: update QoS defaults variable name
'global_default' is only being used for 'qos'
so adding 'qos' into its name
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Dana Vardi [Wed, 27 Jan 2021 16:09:46 +0000 (18:09 +0200)]
net/mvpp2: support forwarding bad packets
Extend the config file with option to forward packets
that were marked as "l2 bad pkts".
By default the driver drop those packets
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Dana Vardi [Wed, 27 Jan 2021 16:09:45 +0000 (18:09 +0200)]
net/mvpp2: support custom header in config file
Extend 'start_hdr' options with custom header.
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:44 +0000 (18:09 +0200)]
net/mvpp2: consider packet type in checksum info
Provide checksum information based on the ptype.
Signed-off-by: Liron Himi <lironh@marvell.com>
Dana Vardi [Wed, 27 Jan 2021 16:09:43 +0000 (18:09 +0200)]
net/mvpp2: update start header name in config file
Change 'dsa_mode' to 'start_hdr' in config file
Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:42 +0000 (18:09 +0200)]
net/mvpp2: apply flow control after port init
In case ppio was not initialized yet (only at 'start' function)
the flow-ctrl setting should be saved for later stage.
Signed-off-by: Liron Himi <lironh@marvell.com>
Meir Levi [Wed, 27 Jan 2021 16:09:41 +0000 (18:09 +0200)]
net/mvpp2: add 2.5G link info
Update capability with 2.5G support
Signed-off-by: Meir Levi <mlevi4@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:40 +0000 (18:09 +0200)]
net/mvpp2: expose max MTU
Expose max-MTU based on the max frame size that
l4 checksum generation can be done by HW.
Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:39 +0000 (18:09 +0200)]
net/mvpp2: update flow control autoneg disable handling
Flow control autoneg disable is not supported
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:38 +0000 (18:09 +0200)]
net/mvpp2: introduce fixup for FIFO overrun
Currently the HW is configured with only one pool which its
buffer size may be larger than the rx-fifo-size.
In that situation, frame size larger than the fifo-size
is gets dropped due to fifo overrun.
This is cause because the HW works in cut-through mode which
waits to have in the fifo at least the amount of bytes as define
in the smallest pool's buffer size.
This patch add a dummy pool which its buffer size
is very small (smaller than 64B frame). This tricks the HW and
any frame size is gets passed from the FIFO to the PP2.
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:37 +0000 (18:09 +0200)]
net/mvpp2: rearrange functions order
Rearrange functions order
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:36 +0000 (18:09 +0200)]
net/mvpp2: support user defined configuration
Extend the config file with 'udf' (user-defined) settings
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:35 +0000 (18:09 +0200)]
net/mvpp2: skip QoS init if not requested
Skip qos init if not requested
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:34 +0000 (18:09 +0200)]
net/mvpp2: support raw flow pattern
Add support for RAW type and connect it to MUSDK UDF
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:33 +0000 (18:09 +0200)]
net/mvpp2: move common functions to common location
Move common functions to common location
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:32 +0000 (18:09 +0200)]
net/mvpp2: build flow table key along with rule
Currently the key is always built in network order
regardless of user input.
Besides the fact that it is not in user order,
it prevent future support for udf header between standard headers.
This patch builds the key while parsing the given rule.
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:31 +0000 (18:09 +0200)]
net/mvpp2: support generic flow pattern combinations
Currently only specific pattern combinations are supported.
This makes it hard to support additional pattern.
In addition there is no a real limitation that prevent any combination.
This patch iterate the input patterns and convert them to a mvpp2 API.
The doc doesn't describes those limitation so
just update the action list
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:30 +0000 (18:09 +0200)]
net/mvpp2: use generic name for global config variable
As the config file is not just for 'qos'
it is more accurate to replace the name from 'qos_cfg'
to 'cfg'
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:29 +0000 (18:09 +0200)]
net/mvpp2: adjust number of unicast address
HW support 25 mac address for filtering plus one for
the primary mac address.
Signed-off-by: Liron Himi <lironh@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:28 +0000 (18:09 +0200)]
net/mvpp2: add Tx flow control
Add tx flow control operations.
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:27 +0000 (18:09 +0200)]
net/mvpp2: support DSA mode
Extend the config file with 'dsa-mode' field.
Currently 'eth' (default) and 'dsa' headers are supported.
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:26 +0000 (18:09 +0200)]
net/mvpp2: update Tx checksum
According to the dpdk spec, only 'ol_flags'
should be used for tx checksum generation
Signed-off-by: Liron Himi <lironh@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:25 +0000 (18:09 +0200)]
net/mvpp2: support VLAN offload
Enable VLAN filter configuration
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:24 +0000 (18:09 +0200)]
net/mvpp2: support loopback
Add support for loopback mode
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:23 +0000 (18:09 +0200)]
net/mvpp2: save initial configuration
Save configuration that was done prior 'start' as
only then the ppio is being configured.
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:22 +0000 (18:09 +0200)]
net/mvpp2: align checking order
First check for 'isolated' and then for '!ppio'
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:21 +0000 (18:09 +0200)]
net/mvpp2: do cosmetic changes to cookie usage
No need to add high address to cookie on transmit side, as it has
already 64bit value
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:20 +0000 (18:09 +0200)]
net/mvpp2: update RSS tables reservation
In kernel-4.14 the pp2 kernel occupied 4 RSS tables
as opposed to 1 RSS table in older version.
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:19 +0000 (18:09 +0200)]
net/mvpp2: fix frame size checking
Need to add CRC len to the frame-size to compare against
max_rx_pkt_len which includes it.
Fixes:
79ec62028b9a ("net/mvpp2: update MTU and MRU related calculations")
Cc: stable@dpdk.org
Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:18 +0000 (18:09 +0200)]
net/mvpp2: remove CRC length from MRU validation
CRC is being removed by HW before packet get
write to the buffer, so CRC len should not be
included in MRU validation
Fixes:
79ec62028b9a ("net/mvpp2: update MTU and MRU related calculations")
Cc: stable@dpdk.org
Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:17 +0000 (18:09 +0200)]
net/mvpp2: remove VLAN flush
VLAN-flush in MUSDK is not supported yet.
Until it does, the code should be removed as currently
an redundant error message is displayed.
Fixes:
a8f3d6783a3c ("net/mrvl: support VLAN filtering")
Cc: stable@dpdk.org
Signed-off-by: Liron Himi <lironh@marvell.com>
Liron Himi [Wed, 27 Jan 2021 16:09:16 +0000 (18:09 +0200)]
net/mvpp2: remove debug log on fast-path
In case of non-ip frame the current code reached the 'default'
case which result with function call to log a msg.
Those kind of calls should not be performed on fast-path.
The performance for this kind of frames increased by 50%
Fixes:
acab7d58c81b ("net/mvpp2: convert to dynamic logging")
Cc: stable@dpdk.org
Signed-off-by: Liron Himi <lironh@marvell.com>
Yuri Chipchev [Wed, 27 Jan 2021 16:09:15 +0000 (18:09 +0200)]
net/mvpp2: fix stack corruption
Fixes stack corruption in mrvl_fill_bpool function
in case num > MRVL_PP2_RXD_MAX
Fixes:
c3637258d894 ("net/mrvl: fix Rx descriptors number")
Cc: stable@dpdk.org
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Ajit Khaparde [Wed, 27 Jan 2021 16:09:43 +0000 (08:09 -0800)]
net/bnxt: update copyright year
Update copyright year in various files.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Heinrich Kuhn [Tue, 19 Jan 2021 11:56:17 +0000 (13:56 +0200)]
net/nfp: free port private data on close
Free the private data of a port when the .dev_close() callback is
invoked. For NFP6000/4000 devices multiple ports may exist under a
single PF device. In this situation the PF resources will only be freed
when all the ports associated with the PF has been freed too.
PF hot plugging isn't explicitly supported for NFP6000/4000 devices but
all the private data of all the ports under the PF in question will be
freed upon device removal.
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Louis Peens <louis.peens@netronome.com>
Heinrich Kuhn [Tue, 19 Jan 2021 11:56:16 +0000 (13:56 +0200)]
net/nfp: create separate entity for PF device
Before this change memory for the private data of all physical ports
where allocated with single rte_zmalloc() call. Specific port private
data was accessed by means of an offset into this memory. This scheme is
problematic when attempting to free only one port's private data at a
time.
To address this, a new entity is created called struct nfp_pf_dev. This
struct represents the PF device. It has a number of PF specific members.
Notably it has a pointer of type rte_eth_dev that points to the eth_dev
associated with the first physical port of the device. It also has an
array of nfp_net_hw's containing pointers to all the physical ports
under the PF.
Memory is first allocated for the PF and PF specific initialization is
attempted. Next, all the physical ports under the PF is iterated and
memory is allocated separately for the private data of each port. Port 0
is skipped during this phase because memory has already been allocated
and an eth_dev already exits for the 0th port.
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Louis Peens <louis.peens@netronome.com>
Andrew Boyer [Mon, 18 Jan 2021 20:35:08 +0000 (12:35 -0800)]
net/ionic: fix address handling in Tx
Don't assume standard headroom.
Use helper variables to improve readability.
Fixes:
a27d901331da ("net/ionic: add Rx and Tx handling")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:35:07 +0000 (12:35 -0800)]
net/ionic: fix up function attribute tags
One function marked cold is in the hot path.
Make sure to always inline hot path functions.
Fixes:
a27d901331da ("net/ionic: add Rx and Tx handling")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:35:06 +0000 (12:35 -0800)]
net/ionic: convert per-queue offloads into queue flags
This will conserve resources by reducing struct ionic_qcq.
Saving a cacheline or two in the rxq and txq structs helps when
running in embedded configurations where CPU cache space is at a
premium.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:35:05 +0000 (12:35 -0800)]
net/ionic: allow separate L3 and L4 checksum offload
DTS, at least, expects to be able to specify L4 checksum offload
without L3 csum offload. Split up the flag checks.
Fixes:
a27d901331da ("net/ionic: add Rx and Tx handling")
Cc: stable@dpdk.org
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:35:04 +0000 (12:35 -0800)]
net/ionic: observe endiannness in ioread/iowrite
The IONIC FW is little-endian.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:35:03 +0000 (12:35 -0800)]
net/ionic: inline queue space function
This is a hot-path function.
Remove ionic_q_has_space() while here.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:35:02 +0000 (12:35 -0800)]
net/ionic: inline queue flush function
This is hot-path function.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:35:00 +0000 (12:35 -0800)]
net/ionic: query firmware for supported queue versions
This allows the PMD to better support FW changes.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:34:58 +0000 (12:34 -0800)]
net/ionic: observe endianness in Rx filter
The IONIC firmware is little-endian.
Add a new field to struct ionic_rx_filter to store the CPU-endian
match type.
Use a local variable for the VLAN when searching the hash table.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:34:57 +0000 (12:34 -0800)]
net/ionic: observe endianness in firmware commands
The IONIC firmware is little-endian.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Andrew Boyer [Mon, 18 Jan 2021 20:34:56 +0000 (12:34 -0800)]
net/ionic: strip out unneeded interrupt code
Only the NotifyQ uses an interrupt, so simplify the other queues.
Simplify ionic_dev_cmd_adminq_init() and ionic_cq_init().
Move ionic_intr_alloc() into ionic_notify_qcq_alloc().
Create ionic_lif_notifyq_deinit().
Simplify ionic_lif_qcq_deinit().
Remove unneeded flags and defines.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Matan Azrad [Wed, 6 Jan 2021 06:43:29 +0000 (06:43 +0000)]
vdpa/mlx5: fix configuration mutex cleanup
When the vDPA device is closed, the driver polling thread is canceled.
The polling thread locks the configuration mutex while it polls the CQs.
When the cancellation happens, it may terminate the thread inside the
critical section what remains the configuration mutex locked.
After device close, the driver may be configured again, in this case,
for example, when the first queue state is updated, the driver tries to
lock the mutex again and deadlock appears.
Initialize the mutex after the polling thread cancellation.
Fixes:
99abbd62c272 ("vdpa/mlx5: fix queue update synchronization")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Joyce Kong [Tue, 26 Jan 2021 09:57:43 +0000 (17:57 +0800)]
net/virtio: fix Arm build with old compiler
In file included from ../drivers/net/virtio/virtio_rxtx_packed.c:22:0:
../drivers/net/virtio/virtio_rxtx_packed_neon.h:
In function ‘virtqueue_enqueue_batch_packed_vec’:
../drivers/net/virtio/virtio_rxtx_packed_neon.h:74:2: warning:
implicit declaration of function ‘vreinterpretq_p128_u32’
[-Wimplicit-function-declaration]
poly128_t cmp1 = vreinterpretq_p128_u32(~vceqq_u32(ref_seg, def_ref_seg));
The message shows ‘vreinterpretq_p128_u32’ intrinsic is not supported
because an old version gcc (gcc 4.8.5) is used. So fix the issue with
implementing the logic with other intrinsics.
Bugzilla ID: 621
Fixes:
530887469350 ("net/virtio: add vectorized packed ring NEON Tx")
Fixes:
5971ce5e2a59 ("net/virtio: add vectorized packed ring NEON Rx")
Reported-by: Subhi Masri <subhim@nvidia.com>
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Subhi Masri <subhim@nvidia.com>
Cheng Jiang [Tue, 12 Jan 2021 04:38:57 +0000 (04:38 +0000)]
examples/vhost: refactor vhost data path
Change the vm2vm data path to batch enqueue for better performance.
Support latest async vhost API, refactor vhost async data path,
replace rte_atomicNN_xxx to __atomic_XXX and clean some codes.
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Cheng Jiang [Tue, 12 Jan 2021 04:38:56 +0000 (04:38 +0000)]
examples/vhost: add ioat ring space count and check
Add ioat ring space count and check, if ioat ring space is not enough
for the next async vhost packet enqueue, then just return to prevent
enqueue failure. Add rte_ioat_completed_ops() fail handler.
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:39 +0000 (11:16 +0100)]
net/virtio: handle virtio-user setup failure properly
This patch fixes virtio_user_dev_setup() error path,
by cleaning all resources it allocates. It introduces
virtio_user_dev_uninit_notify() that cleans all open
FDs. It implies assigning all FDs to -1 at init time.
With these changes done, virtio_user_dev_init_notify()
can be simplified.
Suggested-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:38 +0000 (11:16 +0100)]
net/virtio: improve vhost-user error logging
This patch improves error logging in vhost_user_read,
especially printing errno when recv() fails.
Suggested-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:37 +0000 (11:16 +0100)]
net/virtio: move vhost-vDPA data to its backend
As done earlier for Vhost-user and Vhost-kernel, this
patch moves the Vhost-vDPA specific data to its backend
file.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:36 +0000 (11:16 +0100)]
net/virtio: move vhost-kernel data to its backend
As done earlier for Vhost-user, this patch moves the
Vhost-Kernel specific data to its backend file.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:35 +0000 (11:16 +0100)]
net/virtio: move vhost-user specifics to its backend
This patch moves all the Vhost-user backend specific
logic like Vhost FD, listen FD and interrupt handling
to the vhost-user backend implementation.
In order to achieve that, new ops are created to update
the link status, disconnect and reconnect the server,
and fetch the link state interrupt FD.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:34 +0000 (11:16 +0100)]
net/virtio: introduce backend data
The goal of this patch is to introduce backend-specific
data in order to better isolate what is backend-specific
from what is generic to Virtio-user.
For now, only Vhost-user protocol features are moved to
Vhost-user backend data.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:33 +0000 (11:16 +0100)]
net/virtio: move protocol features to vhost-user
Since only protocol features are specific to Vhost-user
backend, this patch moves all related code to Vhost-user
file.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:32 +0000 (11:16 +0100)]
net/virtio: make server mode blocking
This patch makes the Vhost-user backend server mode
blocking at init, waiting for the client connection.
The goal is to make the driver more reliable, as without
waiting for client connection, the Virtio driver has to
assume the Vhost-user backend will support all the
features it has advertized, which could lead to undefined
behaviour.
For example, without this patch, if the user enables packed
ring Virtio feature but the backend does not support it,
the ring initialized by the driver will not be compatible
with the backend.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:31 +0000 (11:16 +0100)]
net/virtio: move vhost-user requests to vhost-user backend
Now that we have a proper isolation of the backends,
we can move Vhost-user requests declaration to the
Vhost-user backend file.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:30 +0000 (11:16 +0100)]
net/virtio: improve virtio-user errors handling
This patch adds error logs and propagates errors reported
by the backend. It also adds the device path in error logs
to make it easier to distinguish which device is facing the
issue.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:29 +0000 (11:16 +0100)]
net/virtio: remove useless request ops
Now that all the ops have been implemented, we
can remove the send_request ops for all backends.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:28 +0000 (11:16 +0100)]
net/virtio: add virtio-user status ops
This patch introduces new callbacks to
get and set the device status.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:27 +0000 (11:16 +0100)]
net/virtio: add virtio-user vring address ops
This patch introduces a new callback for setting
vrings addresses.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:26 +0000 (11:16 +0100)]
net/virtio: add virtio-user vring file ops
This patch introduces new callbacks for setting
vring files (kick and call).
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:25 +0000 (11:16 +0100)]
net/virtio: add virtio-user vring setting ops
This patch introduces new callbacks for setting
and getting vring state.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:24 +0000 (11:16 +0100)]
net/virtio: add virtio-user memory tables ops
This patch implements a dedicated callback for
preparing and sending memory table to the backends.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:23 +0000 (11:16 +0100)]
net/virtio: add virtio-user protocol features ops
This patch introduces new callbacks for getting
and setting Vhost-user protocol features.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:22 +0000 (11:16 +0100)]
net/virtio: add virtio-user features ops
This patch introduces new callbacks for getting
and setting Virtio features, and implements them
for the different backend types.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:21 +0000 (11:16 +0100)]
net/virtio: add virtio-user ops to set owner
This patch implements a dedicated callback for
sending owner request. All the requests will be
converted that way so that backends other than
Vhost-user don't have to work around being it.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:20 +0000 (11:16 +0100)]
net/virtio: make vhost-user request sender consistent
This patch makes vhost_user_write() consistent with
vhost_user_read(), by passing a Vhost-user message
pointer instead of a buffer pointer and its length, which
is now calculated in the function.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:19 +0000 (11:16 +0100)]
net/virtio: remove last PCI refs in non-PCI code
This patch finalizes the bus isolation part of this
refactoring.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:18 +0000 (11:16 +0100)]
net/virtio: move vring alignment to generic header
This patch moves vring alignment define to the generic
Virtio header.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:17 +0000 (11:16 +0100)]
net/virtio: make interrupt handling more generic
This patch aims at isolating MSIX notion into PCI
layer.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:16 +0000 (11:16 +0100)]
net/virtio: move config definitions to generic header
This patch moves config and status definitions from the PCI
header to the generic one.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:15 +0000 (11:16 +0100)]
net/virtio: move virtqueue defines in generic header
This patch moves the virtqueues defines from PCI header
to the generic one.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:14 +0000 (11:16 +0100)]
net/virtio: move features definition to generic header
This patch moves all the Virtio definition to the generic
header. It also renames some helpers to no more reference
PCI.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:13 +0000 (11:16 +0100)]
net/virtio: introduce generic virtio header
This patch moves virtio_hw and virtio callbacks into
a generic virtio header, now that they have been
curated from PCI references.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:12 +0000 (11:16 +0100)]
net/virtio: move legacy IO to virtio PCI
This patch moves Virtio PCI legacy IO handling to
virtio_pci.c. Two functions are created so that
virtio_pci_ethdev does not have to care about it.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:11 +0000 (11:16 +0100)]
net/virtio: pack virtio HW struct
This patch improves the virtio_hw struct packing,
going from 88 down to 80 bytes with a 6 bytes hole in
the end of the first cacheline. Fields only used in the
slow path are placed in the end, so that hot path only
uses the first cacheline.
The patch also changes booleans fields to uint8_t type, and
fix inconsistencies in their assignments.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:10 +0000 (11:16 +0100)]
net/virtio: move PCI-specific fields to PCI device
This patch moves the fields from virtio_hw structure that
are PCI-specific to virtio_pci_dev_struct.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:09 +0000 (11:16 +0100)]
net/virtio: remove bus type enum
Bus type awareness at the generic ethdev level is no
more needed as previous patches have made it bus-agnostic.
This patch removes it from struct virtio_hw.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:08 +0000 (11:16 +0100)]
net/virtio: validate features at bus level
This patch provides a new callback for the bus type
to validate negotiated features are compatible with it.
Only user for now is PCI modern bus type, which implies
that the device supports Virtio 1.0+.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:07 +0000 (11:16 +0100)]
net/virtio: add callback for device closing
This patch introduces a new callback for device closing,
making virtio_dev_close() bus-agnostic.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:06 +0000 (11:16 +0100)]
net/virtio: store PCI type in virtio device metadata
Going further in making the Virtio ethdev layer bus agnostic,
this patch adds a boolean in the Virtio PCI device metadata.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:05 +0000 (11:16 +0100)]
net/virtio: force IOVA as VA mode for virtio-user
At least Vhost-user backend of Virtio-user PMD requires
IOVA as VA mode. Until now, it was implemented as a hack
by forcing to use mbuf's buf_addr field instead of buf_iova.
This patch removes all this logic and just fails probing
if IOVA as VA mode is not selected. It simplifies the
code overall, and removes some bus-specific logic from
generic virtio_ethdev.c.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:04 +0000 (11:16 +0100)]
net/virtio: move MSI-X detection to PCI ethdev
This patch introduces a new callback to notify the bus
driver some interrupt related operation was done.
This is used by Virtio PCI driver to check msix status.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:03 +0000 (11:16 +0100)]
net/virtio: move PCI specific dev init to PCI ethdev init
This patch moves the PCI specific initialization from
eth_virtio_dev_init() to eth_virtio_pci_init().
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:02 +0000 (11:16 +0100)]
net/virtio: move PCI device init in dedicated file
This patch moves the PCI Ethernet device registration bits
in a dedicated patch. In following patches, more code will
be moved there, with the goal of making virtio_ethdev.c
truly bus-agnostic.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 26 Jan 2021 10:16:01 +0000 (11:16 +0100)]
net/virtio: introduce PCI device metadata
This patch initiate refactoring of Virtio PCI, by introducing
a new device structure for PCI-specific metadata.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>