Commit Graph

29179 Commits

Author SHA1 Message Date
Lior Margalit
4a5a1e6b62 net/mlx5: fix default queue number in RSS flow rule
The selection flags for the RX hash define how the received packets will
be distributed between multiple queues.
When creating a new TIR, the queue_num is set to 1 if none of the selection
flags is set.

Applied the same to the RSS desc before checking if it matches a cached
TIR object to save creating a new object every time.

Fixes: fabf8a3724 ("net/mlx5: fix shared RSS action release")
Cc: stable@dpdk.org

Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-07-29 18:01:21 +02:00
Lior Margalit
5e1db76dd8 net/mlx5: fix RSS flow rule with L4 mismatch
The RSS hash types defined in the API do not support setting the L4 proto
type (TCP or UDP) without setting the L3 proto. For example, ETH_RSS_TCP
is defined as
(ETH_RSS_NONFRAG_IPV4_TCP | \
 ETH_RSS_NONFRAG_IPV6_TCP | \
 ETH_RSS_IPV6_TCP_EX).

The L3 proto of the RSS hash type may be different than the one defined
in the pattern, for example:
testpmd> flow create .../ ipv4 / tcp / end actions rss types ipv6-tcp-ex
end / end

If the RSS hash type also includes L4 proto type as in the above example,
the selection flags for the RX hash are currently set with SPORT/DPORT
without setting SRC/DST IP. As this combination is not supported, it does
not match any of the pre-created TIRs of the indirect RSS action
and the flow creation fails.

The fix is to prevent setting the selection flags for the RX hash with
SPORT/DPORT without setting SRC/DST IP. It applies non-RSS processing of
the received packets. In case of indirect RSS action, it will match the
MLX5_RSS_HASH_NONE pre-created TIR.

Fixes: b1d63d8293 ("net/mlx5: support RSS on src or dst fields only")
Fixes: 4a78c88e3b ("net/mlx5: fix Verbs flow tunnel")
Cc: stable@dpdk.org

Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-07-29 18:01:20 +02:00
Jiawei Wang
7356aec64c net/mlx5: fix mirror flow split with L3 encapsulation
Due to hardware limitations, the decap action (such as
VXLAN/NVGRE/RAW decap) can't follow the sample action in the
same flow, to keep the original action order of sample and decap
actions the flow was internally split into two subflows by PMD,
the sample action was moved into prefix subflow in the original table,
and decap action was moved into suffix subflow in the new table.

There is a specific combination of raw decap and raw encap actions
to specify "L3 encapsulation" packet transformation - raw decap action
to remove L2 header and raw encap to add the tunnel header.
This specific L3 encapsulation is encoded as a single packet reformat
hardware transaction and is supported by hardware after sample
action (no hardware limitations for packet reformat).

The "L3 encapsulation" with mirror actions in the same flow was not handled
correctly in the previous commit.
The patch checks whether the decap action is part of "L3 encapsulation"
and does not move the decap action into suffix subflow for the case.

Fixes: cafd87f62a ("net/mlx5: fix VLAN push/pop and decap actions with mirror")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-07-29 18:01:20 +02:00
Bing Zhao
75f166c20f net/mlx5: fix queue leaking in hairpin auto bind check
During the start up stage, the hairpin auto bind was executed for
each port. All the Tx and Rx queues configured for this port should
be checked to confirm if the auto bind of hairpin is needed.
1. The queue is hairpin queue.
2. The peer port is the same one and the peer queue should also be
   with hairpin type.
3. The manual bind attribute is not set for this queue.

If the queue is not a hairpin queue or it doesn't need to be bound
automatically, the reference count should be decreased by 1 since
the count was increased when calling the mlx5_*xq_get().
When the peer port is not the same, it means that no auto bind is
supported and the mlx5_*xq_release() was missed in the current
implementation.

By calling the release function before continue, the count is
correct when calling the device close.

Fixes: aa8bea0e34 ("net/mlx5: add conditional hairpin auto bind")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-07-29 18:01:19 +02:00
Gregory Etelson
494d6863c2 net/mlx5: fix representor interrupt handler
In mlx5 PMD the PCI device interrupt vector was used by Uplink
representor exclusively and other VF representors did not support
interrupt mode.
All the VFs and Uplink representors are separate ethernet devices
and must have dedicated interrupt vectors.
The fix provides each representor with a dedicated interrupt
vector.

Fixes: 5882bde88d ("net/mlx5: fix representor interrupts handler")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-07-29 18:01:15 +02:00
Alvin Zhang
149211698c net/iavf: relax RSS virtual channel commands
Kernel PF may not respond to virtual channel commands
VIRTCHNL_OP_GET_RSS_HENA_CAPS and VIRTCHNL_OP_SET_RSS_HENA, which
will cause VF to fail to start.

RSS offload type configuration is not a necessary feature for VF,
so in order to improve VF compatibility, in this patch the PMD will
ignore the error result of above two commands and will print warnings
instead.

Fixes: 5a038d1996 ("net/iavf: fix RSS configuration on i40e VF")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-07-27 13:56:22 +02:00
Xiaoyun Li
ed21e06e44 net/iavf: fix Tx threshold check
Function check_tx_thresh is called with wrong parameter. If the
check fails, tx_queue_setup should return error not keep going.
This patch fixes above issues.

Fixes: 69dd4c3d08 ("net/avf: enable queue and device")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2021-07-25 11:47:05 +02:00
Chenbo Xia
1e9221ae38 net/virtio: fix default duplex mode
When virtio front-end initializes, the duplex mode should be set
unknown before reading any duplex mode information from configuration
space. This patch fixes the issue that duplex mode is by default set
to zero, which equals ETH_LINK_HALF_DUPLEX. This will lead to duplex
mode being half duplex when front-end does not have the feature
named VIRTIO_NET_F_SPEED_DUPLEX.

Fixes: 1357b4b362 ("net/virtio: support Virtio link speed feature")
Cc: stable@dpdk.org

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-28 08:33:16 +02:00
Gaoxiang Liu
7b91951549 net/virtio: fix interrupt handle leak
Free memory of interrupt handle in virtio_user_dev_uninit() to
avoid memory leak.
when virtio user dev closes, memory of interrupt handle is not freed
that is allocated in virtio_user_fill_intr_handle().

Fixes: 3d4fb6fd25 ("net/virtio-user: support Rx interrupt")
Cc: stable@dpdk.org

Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-28 08:29:27 +02:00
Maxime Coquelin
3c929a0bb3 vhost: fix crash on reconnect
When the vhost-user frontend like Virtio-user tries to
reconnect to the restarted Vhost backend, the Vhost backend
segfaults when multiqueue is enabled.

This is caused by VHOST_USER_GET_VRING_BASE being called for
a virtqueue that has not been created before, causing a NULL
pointer dereferencing.

This patch adds the VHOST_USER_GET_VRING_BASE requests to
the list of requests that trigger queue pair allocations.

Fixes: 160cbc815b ("vhost: remove a hack on queue allocation")
Cc: stable@dpdk.org

Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2021-07-28 08:27:53 +02:00
Ivan Ilchenko
11d7bc9ff0 net/virtio: report maximum MTU in device info
Fix the driver to report maximum MTU obtained from config if
VIRTIO_NET_F_MTU is supported or calculated based on maximum
Rx packet length.

Fixes: ad97ceece1 ("ethdev: add min/max MTU to device info")
Cc: stable@dpdk.org

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-28 08:20:20 +02:00
Thomas Monjalon
02e077f35d version: 21.08-rc2
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2021-07-24 15:22:43 +02:00
Andrew Rybchenko
61a3b0e5e7 app/testpmd: send failure logs to stderr
Running with stdout suppressed or redirected for further processing
is very confusing in the case of errors. Fix it by logging errors and
warnings to stderr.

Since lines with log messages are touched anyway concatenate split
format strings to make it easier to search using grep.

Fix indent of format string arguments.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-24 15:12:57 +02:00
Paulis Gributs
0a0821bcf3 app/testpmd: remove most uses of internal ethdev array
This patch removes most uses of the global variable rte_eth_devices
from testpmd. This was done to avoid using the object directly which
applications should not do.

Most uses have been replaced with standard function calls, however
the use of it in the show_macs function could not be replaced as no
function call exists to get all mac addresses of a given port.

Signed-off-by: Paulis Gributs <paulis.gributs@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-24 14:41:45 +02:00
Yuying Zhang
5ffc4a2aca app/testpmd: fix MAC address after port reset
MAC address of each port in global variable ports hasn't been updated
after resetting. It was the initial one after resetting VF MAC address.
This patch gets correct port MAC address when starting port.

Fixes: a5279d2561 ("app/testpmd: check status of getting MAC address")
Cc: stable@dpdk.org

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-24 13:28:13 +02:00
Ferruh Yigit
a2db845ccc app/testpmd: fix help string for port reset
Command help string is missing 'reset' keyword,
although description has it. Adding it.

Fixes: 97f1e19679 ("app/testpmd: add port reset command")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-07-24 11:06:07 +02:00
Huisong Li
c6ccd1e392 sched: rework configuration failure handling
Currently, rte_sched_free_memory() is called multiple times by the
exception handling code in rte_sched_subport_config() and
rte_sched_pipe_config().

This patch optimizes them into a unified outlet to free memory.

Fixes: ac6fcb841b ("sched: update subport rate dynamically")
Fixes: 34a90f8665 ("sched: modify pipe functions for config flexibility")
Fixes: ce7c4fd7c2 ("sched: add pipe config to subport level")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2021-07-24 10:58:58 +02:00
Huisong Li
a042481ecd sched: fix profile allocation failure handling
This patch fixes return value judgment when allocate memory to store the
subport profile, and releases memory of 'rte_sched_port' if code fails to
apply for this memory.

Fixes: 0ea4c6afca ("sched: add subport profile table")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2021-07-24 10:58:39 +02:00
Richael Zhuang
d37462e56c power: check frequencies count before filling array
The freqs array size is RTE_MAX_LCORE_FREQS. Before filling the
array with num_freqs elements, restrict the total num to
RTE_MAX_LCORE_FREQS. This fix aims to fix the coverity scan issue
like:
Overrunning array "pi->freqs" of 256 bytes by passing it to a
function which accesses it at byte offset 464.

Coverity issue: 371913
Fixes: ef1cc88f18 ("power: support cppc_cpufreq driver")
Cc: stable@dpdk.org

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Acked-by: David Hunt <david.hunt@intel.com>
2021-07-24 10:09:58 +02:00
Stephen Hemminger
128c22b998 eal: fix argument in 32-bit safe BSF function
The first argument to rte_bsf32_safe was incorrectly declared as
a 64 bit value. The code only works on 32 bit values and the underlying
function rte_bsf32 only accepts 32 bit values. This was a mistake
introduced when the safe version was added and probably cause
by copy/paste from the 64 bit version.

The bug passed silently under the radar until some other code was
built with -Wall and -Wextra in C++ and C++ complains about the
missing cast.

Yes, this is a API signature change, but the original code was wrong.
It is an inline so not an ABI change.

Fixes: 4e261f5519 ("eal: add 64-bit bsf and 32-bit safe bsf functions")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2021-07-24 09:51:30 +02:00
Ivan Malov
73b91412ca net/sfc: improve logging in MAE backend of flow API
Errors detected during parsing of pattern items and actions
are reflected by setting RTE error, but the name of the bad
element is not disclosed, thus leaving the user to join the
dots themselves. Adjust the code to log missing information.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:27:08 +02:00
Ivan Malov
f1893715ce net/sfc: extend logging in MAE backend of flow API
Extra log statements will provide more details to the user
in the case of errors discovered in the pattern or actions.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:26:56 +02:00
Ivan Ilchenko
fdd7719eb3 net/sfc: add xstats for Rx/Tx doorbells
Rx/Tx doorbells statistics are collected in software and
available per queue. These stats are useful for performance
investigation.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:26:45 +02:00
Ivan Ilchenko
21ca2629cf net/sfc: prepare to add more xstats
Move getting MAC stats code that involves locking to separate functions
to simplify addition of new xstats.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:26:45 +02:00
Ivan Ilchenko
c78c2224b7 net/sfc: simplify getting xstats count
There is no point to recalculate number of available xstats on
each request. The number is calculated once on device start
and may be returned on subsequent calls.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:26:45 +02:00
Ivan Ilchenko
1827b073ed net/sfc: fix MAC stats update for stopped device
Return the latest stats snapshot in stopped state
instead of returning an error.

Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:26:35 +02:00
Ivan Ilchenko
7d466e5fd8 net/sfc: fix xstats query by unsorted list of IDs
Device may support only some MAC stats. Add mapping from ids to subset
of supported MAC stats for each port.

Fixes: 73280c1e4f ("net/sfc: support xstats retrieval by ID")
Cc: stable@dpdk.org

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:05:19 +02:00
Ivan Ilchenko
8232cc2d35 net/sfc: fix xstats query by ID according to ethdev
Fix xstats by ID callbacks according to ethdev usage.
Handle combinations of input arguments that are required by ethdev
and sanity check and reject other combinations on callback entry.

Fixes: 73280c1e4f ("net/sfc: support xstats retrieval by ID")
Cc: stable@dpdk.org

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:04:44 +02:00
Ivan Ilchenko
17b0d7b367 net/sfc: fix reading adapter state without locking
Update MAC stats function reads adapter state with MAC stats locking
but without adapter locking. Add adapter locking before calling this
function and remove MAC stats locking since there's no point to have
it together with adapter locking. The second place MAC stats locking
is used is MAC stats reset function. It's called with adapter being
already locked so there's no point to use MAC stats locking anymore.

Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:04:24 +02:00
Ivan Ilchenko
9076e855f1 net/sfc: fix MAC stats lock in xstats query by ID
Add MAC stats lock in xstats_get_by_id() callback before reading
number of supported MAC stats.

Fixes: 73280c1e4f ("net/sfc: support xstats retrieval by ID")
Cc: stable@dpdk.org

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 22:58:30 +02:00
Cheng Jiang
b9f23beee0 examples/vhost: handle memory hotplug for async vhost
When the guest memory is hotplugged, the vhost application which
enables DMA acceleration must stop DMA transfers before the vhost
re-maps the guest memory.

To accomplish that, we need to do these changes in the vhost sample:
1. add inflight packets count.
2. add vring_state_changed() callback.
3. add inflight packets clear process in destroy_device() and
vring_state_changed().

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-23 10:58:53 +02:00
Jiayu Hu
259caa21d7 vhost: handle memory hotplug for async vhost
When the guest memory is hotplugged, the vhost application which
enables DMA acceleration must stop DMA transfers before the vhost
re-maps the guest memory.

This patch is to notify the vhost application of stopping DMA
transfers.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-23 10:58:53 +02:00
Cheng Jiang
b737fd6139 vhost: add unsafe async API to clear packets
Applications need to stop DMA transfers and finish all the inflight
packets when in VM memory hot-plug case and async vhost is used. This
patch is to provide an unsafe API to clear inflight packets which
are submitted to DMA engine in vhost async data path. Update the
program guide and release notes for virtqueue inflight packets clear
API in vhost lib.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-23 10:58:53 +02:00
Cheng Jiang
3f63c19b2b vhost: fix async callbacks return type
The async vhost callback ops should return negative value when there
are something wrong in the callback, so the return type should be
changed into int32_t. The issue in vhost example is also fixed.

Fixes: cd6760da10 ("vhost: introduce async enqueue for split ring")
Fixes: 819a716858 ("vhost: fix async callback return type")
Fixes: 6b3c81db8b ("vhost: simplify async copy completion")
Fixes: abec60e711 ("examples/vhost: support vhost async data path")
Fixes: 6e9a9d2a02 ("examples/vhost: fix ioat dependency")
Fixes: 873e8dad6f ("vhost: support packed ring in async datapath")
Cc: stable@dpdk.org

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-23 10:58:53 +02:00
Hemant Agrawal
29c875cc11 doc: remove SDK info from DPAA2 drivers guides
The prerequisite info is already present in the platform guide.
No need to repeat it in individual dev guides.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-07-23 20:33:12 +02:00
Vanshika Shukla
4ed8a73328 net/dpaa2: add some parameter validations
This patch adds validation of the port id for
rte_pmd_dpaa2_set_custom_hash API to check if the
port is a valid DPAA2 port. Also handles some
edge cases in the rte_pmd_dpaa2_mux_flow_create API.

Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-07-23 20:31:01 +02:00
Nipun Gupta
a5b375edb7 net/dpaa2: add per-thread initialization API
DPAA2 hardware require a hardware portal context.
If a thread doing DPAA2 i/o do not have portal, it will
allocate it on run-time. This may cause a delay in the
datapath at run-time. To avoid it, it is better to allocate
a hw context portal at the start of thread expected to do
i/o with DPAA2 hardware.

This patch makes necessary changes for the same and creates
a pmd API to allocate a hw context portal for a thread.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2021-07-23 20:29:53 +02:00
Rohit Raj
b95afba45f net/dpaa: add check for parsing default Rx queue
Add check for the PCD queue from the kernel interface
for default and error queues.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-07-23 19:44:05 +02:00
Hemant Agrawal
97f4844c3f bus/dpaa: reduce thread ID syscall usage
Reuse DPDK rte_gettid instead of syscall.
It will help to reduce the dpaa portal allocation time.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-07-23 19:42:25 +02:00
Nipun Gupta
8d2bf7c1d5 net/dpaa: fix headroom in VSP case
This patch fixes providing the correct headroom size when
VSP is enabled.

Fixes: e4abd4ff18 ("net/dpaa: support virtual storage profile")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2021-07-23 19:41:06 +02:00
Hemant Agrawal
5ddcf3de6b bus/dpaa: fix freeing in FMAN interface destructor
if was allocated with rte_malloc, free shall be equivalent.

Fixes: 4762b3d419 ("bus/dpaa: delay fman device list to bus probe")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-07-23 19:15:17 +02:00
Michal Krawczyk
b39c3539e7 maintainers: update for ena
Remove Guy Tzalik as the driver's maintainer and add Shai Brandes who
will now be another maintainer of the ENA DPDK driver.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2021-07-23 17:49:01 +02:00
Michal Krawczyk
d00c799fda net/ena: update version to 2.4.0
This version update contains:
  * Rx interrupts feature,
  * Support for the RSS hash function reconfiguration,
  * Small rework of the works,
  * Reset trigger on Tx path fix.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2021-07-23 17:44:58 +02:00
Michal Krawczyk
34d5e97e8d net/ena: rework RSS configuration
Allow user to specify his own hash key and hash ctrl if the
device is supporting that. HW interprets the key in reverse byte order,
so the PMD reorders the key before passing it to the ena_com layer.

Default key is being set in random matter each time the device is being
initialized.

Moreover, make minor adjustments for reta size setting in terms
of returning error values.

RSS code was moved to ena_rss.c file to improve readability.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
2021-07-23 17:44:09 +02:00
Michal Krawczyk
6986cdc4dd net/ena: support Rx interrupt
In order to support asynchronous Rx in the applications, the driver has
to configure the event file descriptors and configure the HW.

This patch configures appropriate data structures for the rte_ethdev
layer, adds .rx_queue_intr_enable and .rx_queue_intr_disable API
handlers, and configures IO queues to work in the interrupt mode, if it
was requested by the application.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Artur Rojek <ar@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
2021-07-23 17:43:46 +02:00
Michal Krawczyk
b57e105381 net/ena: trigger reset on Tx prepare failure
If the prepare function failed, then it means the descriptors are in the
invalid state.

This condition now triggers the reset, which should be further handled
by the application.

To notify the application about prepare function failure, the error log
was added. In general, it should never fail in normal conditions, as the
Tx function checks for the available space in the Tx ring before the
preparation even starts.

Fixes: 2081d5e2e9 ("net/ena: add reset routine")
Cc: stable@dpdk.org

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
2021-07-23 17:43:08 +02:00
Michal Krawczyk
0a001d69bc net/ena: use common debug options
ENA defined its own logger flags for Tx and Rx, but they weren't
technically used anywhere. Those data path loggers weren't used anywhere
after the definition.

This commit uses the generic RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX
flags to define PMD_TX_LOG and PMD_RX_LOG which are now being used on
the data path. The PMD_TX_FREE_LOG was removed, as it has no usage in
the current version of the driver.

RTE_ETH_DEBUG_[TR]X now wraps extra checks for the driver state in the
IO path - this saves extra conditionals on the hot path.

ena_com logger is no longer optional (previously it had to be explicitly
enabled by defining this flag: RTE_LIBRTE_ENA_COM_DEBUG). Having this
logger optional makes tracing of ena_com errors much harder.
Due to ena_com design, it's impossible to separate IO path logs
from the management path logs, so for now they will be always enabled.

Default levels for the affected loggers were modified. Hot path loggers
are initialized with the default level of DEBUG instead of NOTICE, as
they have to be explicitly enabled. ena_com logging level was reduced
from NOTICE to WARNING - as it's no longer optional, the driver should
report just a warnings in the ena_com layer.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
2021-07-23 17:42:33 +02:00
Michal Krawczyk
617898d12a net/ena: adjust logs
ENA logs were not consistent regarding the new line character. Few of
them were relying on the new line character added by the PMD_*_LOG
macros, but most were adding the new line character by themselves. It
was causing ENA logs to add extra empty line after almost each log.

To unify this behavior, the missing new line characters were added to
the driver logs, and they were removed from the logging macros. After
this patch, every ENA log message should add '\n' at the end.

Moreover, the logging messages were adjusted in terms of wording
(removed unnecessary abbreviations), capitalizing of the words (start
sentences with capital letters, and use 'Tx/Rx' instead of 'tx/TX' etc.

Some of the logs were rephrased to make them more clear for the reader.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
2021-07-23 17:42:25 +02:00
Jiawen Wu
1e0857c3f7 net/txgbe: fix VLAN filter setting for VF
Fix the function call error on VLAN filter table address setting for VF.

Fixes: aa1ae7941e ("net/txgbe: support VF VLAN")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2021-07-23 16:06:32 +02:00
Guoyang Zhou
3596d7b607 net/hinic: fix MTU consistency with firmware
The configuration of MTU is inconsistent in the driver and
firmware when the port is stopped, started and reconfigured.
Before, HINIC_MAX_JUMBO_FRAME_SIZE include VLAN tag, but when
frame and pktlen are converted to each other do not include
VLAN tag. And port_mtu_set function will use HINIC_MAX_JUMBO_FRAME_SIZE
to calculate eth_overhead, so MTU will be inconsistent in the driver and
firmware.

Fixes: e542ab51ab ("net/hinic: fix jumbo frame flag condition for MTU set")
Cc: stable@dpdk.org

Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
2021-07-23 15:37:17 +02:00