dpdk.git
3 years agonet/ixgbe: add private APIs for flow filtering
Chenxu Di [Wed, 8 Jul 2020 01:18:38 +0000 (01:18 +0000)]
net/ixgbe: add private APIs for flow filtering

The legacy filter API will be superseded by rte_flow.
There are also several small features which can not be
implemented in rte_flow. This patch re-implemented these
features as private API.
Two APIs are added:
rte_pmd_ixgbe_get_fdir_info.
rte_pmd_ixgbe_get_fdir_stats.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/i40e: add private APIs for flow filtering
Chenxu Di [Wed, 8 Jul 2020 01:18:37 +0000 (01:18 +0000)]
net/i40e: add private APIs for flow filtering

The legacy filter API will be superseded by rte_flow.
There are also several small features which can not be
implemented in rte_flow. This patch re-implemented these
features as private API.
Three APIs are added:
rte_pmd_i40e_get_fdir_info.
rte_pmd_i40e_get_fdir_stats.
rte_pmd_i40e_set_gre_key_len.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/i40e: support cloud filter with L4 port
Guinan Sun [Wed, 8 Jul 2020 07:40:58 +0000 (07:40 +0000)]
net/i40e: support cloud filter with L4 port

This patch enables cloud filter for IPv4/6_UDP/TCP/SCTP with
SRC port only or DST port only.
This supports different filter types for the same packet type.
E.g. one IPv4_UDP rules with SRC port only and another IPv4_UDP rule
with DST port only.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/iavf: support flow director GTPU outer IPv4/IPv6
Junfeng Guo [Wed, 8 Jul 2020 04:26:13 +0000 (12:26 +0800)]
net/iavf: support flow director GTPU outer IPv4/IPv6

Add FDir support for MAC_IPV4_GTPU and MAC_IPV6_GTPU type with outer
IPv4/IPv6 address, teid and qfi fields matching. Note that outer IPv4
and IPv6 matching fields here include both SRC & DST of both IPv4 &
IPv6.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: support flow director GTPU outer IPv4/IPv6
Junfeng Guo [Wed, 8 Jul 2020 04:26:12 +0000 (12:26 +0800)]
net/ice: support flow director GTPU outer IPv4/IPv6

Add FDir support for MAC_IPV4_GTPU and MAC_IPV6_GTPU type with outer
IPv4/IPv6 address, teid and qfi fields matching. Note that outer IPv4
and IPv6 matching fields here include both SRC & DST of both IPv4 &
IPv6.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: support src MAC filter for flow director
Zhirun Yan [Wed, 8 Jul 2020 12:43:07 +0000 (12:43 +0000)]
net/ice: support src MAC filter for flow director

This patch enables FDIR with src mac filter and change the logic for
only supporting ether type field without IP pattern. Application may
set ether type with IP. It is redundant for flow, ignore ether type
except for ICE_FLTR_PTYPE_NON_IP_L2.

Also, remove redundant code for checking next_type.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice/base: fix tunnel filtering rule
Wei Zhao [Tue, 7 Jul 2020 09:40:48 +0000 (17:40 +0800)]
net/ice/base: fix tunnel filtering rule

If we download a NVGRE rule like "eth / ipv4 / nvgre / eth / ipv4 src
is 192.168.1.2 dst is 192.168.1.3 / end actions queue index 3 / end"
the special word will not be added because of rm->n_grp_count = 1,
so we have to change the ice_add_special_words() function before
ice_create_recipe_group(), then the special words will be add
into rm->rg_list.
Btw, the flag match_tun_mask is useless now and no need to add special
words in function ice_add_sw_recipe().

Fixes: eda40e22b858 ("net/ice/base: improve switch chained recipe")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice/base: fix tunnel type check for PPPoE
Wei Zhao [Tue, 7 Jul 2020 09:40:47 +0000 (17:40 +0800)]
net/ice/base: fix tunnel type check for PPPoE

This patch fix tunnel type check for PPPoE type of recipe
when search for recipe which has been created before, and
also fix a bug of typo.

Fixes: 418d2563d10b ("net/ice/base: get tunnel type for recipe")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agocommon/octeontx2: retry interrupt callback unregister
Nithin Dabilpuram [Thu, 11 Jun 2020 07:26:04 +0000 (12:56 +0530)]
common/octeontx2: retry interrupt callback unregister

Interrupt callback unregister can fail with -EAGAIN
when interrupt handler is active in interrupt thread.
Hence retry before reporting a failure or proceeding further.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agovdpa/mlx5: enable status protocol feature
Maxime Coquelin [Mon, 6 Jul 2020 11:24:52 +0000 (13:24 +0200)]
vdpa/mlx5: enable status protocol feature

This patch advertises VHOST_USER_PROTOCOL_F_STATUS
support in the MLX5 driver so that that the protocol
feature is negotiated.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovdpa/ifc: enable status protocol feature
Maxime Coquelin [Mon, 6 Jul 2020 11:24:51 +0000 (13:24 +0200)]
vdpa/ifc: enable status protocol feature

This patch advertises VHOST_USER_PROTOCOL_F_STATUS
support in the IFC driver so that that the protocol
feature is negotiated.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: support virtio status message
Adrian Moreno [Mon, 6 Jul 2020 11:24:50 +0000 (13:24 +0200)]
vhost: support virtio status message

This patch adds support to the new Virtio device get status
Vhost-user message.

The driver can send this new message to read the device status.

One of the uses of this message is to ensure the feature negotiation has
succeeded.  According to the virtio spec, after completing the feature
negotiation, the driver sets the FEATURE_OK status bit and re-reads it
to ensure the device has accepted the features.

This patch also clears the FEATURE_OK status bit if the feature
negotiation has failed to let the driver know about his failure.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: support virtio status
Maxime Coquelin [Mon, 6 Jul 2020 11:24:49 +0000 (13:24 +0200)]
vhost: support virtio status

This patch adds support to the new Virtio device status
Vhost-user protocol feature.

Getting such information in the backend helps to know
when the driver is done with the device configuration
and so makes the initialization phase more robust.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: check vDPA configuration succeed
Maxime Coquelin [Mon, 6 Jul 2020 11:24:48 +0000 (13:24 +0200)]
vhost: check vDPA configuration succeed

This patch checks whether vDPA device configuration
succeed and does not set the CONFIGURED flag if it
didn't.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: make some vDPA callbacks mandatory
Maxime Coquelin [Mon, 6 Jul 2020 11:24:47 +0000 (13:24 +0200)]
vhost: make some vDPA callbacks mandatory

Some of the vDPA callbacks have to be implemented
for vDPA to work properly.

This patch marks them as mandatory in the API doc and
simplify code calling these ops with removing
unnecessary checks that are now done at registration
time.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: refactor virtio ready check
Maxime Coquelin [Mon, 6 Jul 2020 11:24:46 +0000 (13:24 +0200)]
vhost: refactor virtio ready check

This patch is a small refactoring, as preliminary work
for adding support to Virtio status support.

No functional change here.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: fix virtio ready flag check
Maxime Coquelin [Mon, 6 Jul 2020 11:24:45 +0000 (13:24 +0200)]
vhost: fix virtio ready flag check

Before checking whether the device is ready is done
a check on whether the RUNNING flag is set. Then the
READY flag is set if virtio_is_ready() returns true.

While it seems to not cause any issue, it makes more
sense to check whether the READY flag is set and not
the RUNNING one.

Fixes: c0674b1bc898 ("vhost: move the device ready check at proper place")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agonet/virtio-user: support reply-ack
Maxime Coquelin [Fri, 3 Jul 2020 15:57:27 +0000 (17:57 +0200)]
net/virtio-user: support reply-ack

This patch adds support reply-ack vhost-user protocol
feature, which is for now only used to ensure
VHOST_USER_SET_MEM_TABLE requests are handled by the
slave, but later will be used for VHOST_USER_SET_STATUS.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agonet/virtio: support vhost-user protocol features
Maxime Coquelin [Fri, 3 Jul 2020 15:57:26 +0000 (17:57 +0200)]
net/virtio: support vhost-user protocol features

This patch adds support for Vhost-user protocol features.
It is required to support protocol features that were not in
initial Vhost-user specification, such as reply-ack, MTU...

Also, this patch prevents Virtio multiqueue feature negotiation
if the slave does not support MQ protocol feature as stated
in Vhost-user specification:
"The multiple queues feature is supported only when the protocol
feature ``VHOST_USER_PROTOCOL_F_MQ`` (bit 0) is set."

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agoeal/linux: truncate thread name
David Marchand [Fri, 10 Jul 2020 09:45:50 +0000 (11:45 +0200)]
eal/linux: truncate thread name

pthread_setname_np refuses names larger than 16 bytes (\0 included).
Rather than return an error, truncate the name to this limit in the
rte_thread_setname helper.

Caught with ixgbe which creates control thread with name
"ixgbe-link-handler":

Configuring Port 0 (socket 0)
EAL: Cannot set name for ctrl thread
...
EAL: Cannot set name for ctrl thread

Port 0: link state change event
...
EAL: Cannot set name for ctrl thread

Port 0: link state change event

Note: before this change, the thread would keep its original name, which
meant in my test for the ixgbe handler either "dpdk-testpmd" or
"eal-intr-thread".

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agolpm: hide defer queue handle
Ruifeng Wang [Sat, 11 Jul 2020 07:41:31 +0000 (15:41 +0800)]
lpm: hide defer queue handle

There is no need to return the defer queue handle in rte_lpm_rcu_qsbr_add,
since enough flexibility has been provided to configure the defer queue.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
3 years agoexamples/l3fwd-power: select default mode automatically
Anatoly Burakov [Fri, 19 Jun 2020 10:53:55 +0000 (11:53 +0100)]
examples/l3fwd-power: select default mode automatically

Currently, the application does support running without the power
library being initialized, but it has to be specifically requested. On
platforms without support for frequency scaling using the power library,
we can just enable interrupt-only mode by default.

Suggested-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Harman Kalra <hkalra@marvell.com>
3 years agopower: add environment capability probing
Anatoly Burakov [Fri, 19 Jun 2020 10:53:54 +0000 (11:53 +0100)]
power: add environment capability probing

Currently, there is no way to know if the power management env is
supported without trying to initialize it. The init API also does
not distinguish between failure due to some error and failure due to
power management not being available on the platform in the first
place.

Thus, add an API that provides capability of probing support for a
specific power management API.

Suggested-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agoexamples/l3fwd-power: add interrupt-only mode
Anatoly Burakov [Fri, 19 Jun 2020 10:53:53 +0000 (11:53 +0100)]
examples/l3fwd-power: add interrupt-only mode

In addition to existing modes, add a mode which is very similar to
legacy mode, but does not do frequency scaling, and thus does not
depend on the power library.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
3 years agoexamples/l3fwd-power: add legacy mode option
Anatoly Burakov [Fri, 19 Jun 2020 10:53:52 +0000 (11:53 +0100)]
examples/l3fwd-power: add legacy mode option

Currently, legacy mode is the implicit default, but it is not possible
to directly request using legacy mode. Add the argument to enable
requesting legacy mode, and also make it the default.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agoexamples/l3fwd-power: fix style and control flow
Anatoly Burakov [Fri, 19 Jun 2020 10:53:51 +0000 (11:53 +0100)]
examples/l3fwd-power: fix style and control flow

Make the coding style more consistent, and the init logic control flow
more explicit.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agoexamples/l3fwd-power: allow only supported environments
Anatoly Burakov [Fri, 19 Jun 2020 10:53:50 +0000 (11:53 +0100)]
examples/l3fwd-power: allow only supported environments

Currently, l3fwd-power will attempt to run even if the power env
is set to KVM, which is not supported. Fix this by preventing the
app from initializing unless the env is set to one of the supported
modes.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
3 years agoexamples/l3fwd-power: disable interrupts by default
Anatoly Burakov [Fri, 19 Jun 2020 10:53:49 +0000 (11:53 +0100)]
examples/l3fwd-power: disable interrupts by default

Currently, interrupts are enabled in telemetry and empty poll modes, but
they are not used. Switch to disabling interrupts by default, and only
enable interrupts for modes that require them.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
3 years agopci: keep API compatibility with mmap values
Thomas Monjalon [Fri, 10 Jul 2020 09:47:37 +0000 (11:47 +0200)]
pci: keep API compatibility with mmap values

The function pci_map_resource() returns MAP_FAILED in case of error.
When replacing the call to mmap() by rte_mem_map(),
the error code became NULL, breaking the API.
This function is probably not used outside of DPDK,
but it is still a problem for two reasons:
- the deprecation process was not followed
- the Linux function pci_vfio_mmap_bar() is broken for i40e

The error code is reverted to the Unix value MAP_FAILED.
Windows needs to define this special value (-1 as in Unix).
After proper deprecation process, the API could be changed again
if really needed.

Because of the switch from mmap() to rte_mem_map(),
another part of the API was changed: "int additional_flags"
are defined as "additional flags for the mapping range"
without mentioning it was directly used in mmap().
Currently it is directly used in rte_mem_map(),
that's why the values rte_map_flags must be mapped (sic) on the mmap ones
in case of Unix OS.

These are side effects of a badly defined API using Unix values.

Bugzilla ID: 503
Fixes: 2fd3567e5425 ("pci: use OS generic memory mapping functions")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Lihong Ma <lihongx.ma@intel.com>
3 years agoeal: fix parentheses in alignment macros
Harman Kalra [Wed, 24 Jun 2020 10:20:47 +0000 (15:50 +0530)]
eal: fix parentheses in alignment macros

Found an issue while using RTE_ALIGN_MUL_NEAR with an
expression, like as passed in estimate_tsc_freq().
RTE_ALIGN_MUL_FLOOR resulted in unexpected value as
parathesis are required to evaluate an expression.

Fixes: 5120203d753f ("eal: add macros to align value to multiple")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
3 years agodoc: add RIB and FIB into the API index
Vladimir Medvedkin [Wed, 8 Jul 2020 18:31:27 +0000 (19:31 +0100)]
doc: add RIB and FIB into the API index

Add RIB/FIB library into the API doxygen index.
Move LPM/LPM6 under separate section "routing".

Fixes: 5a5793a5ffa2 ("rib: add RIB library")
Fixes: f7e861e21c46 ("rib: support IPv6")
Fixes: 39e927248416 ("fib: add FIB library")
Fixes: 40d41a8a7b34 ("fib: support IPv6")
Cc: stable@dpdk.org
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
3 years agoeal/windows: detect insufficient privileges for hugepages
Dmitry Kozlyuk [Wed, 8 Jul 2020 21:48:43 +0000 (00:48 +0300)]
eal/windows: detect insufficient privileges for hugepages

AdjustTokenPrivileges() succeeds even if no requested privileges have
been granted; this behavior is documented. Check last error code in
addition to return value to detect such case.

Make error messages more specific and add troubleshooting hint.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
3 years agonet: fix checksum on big endian CPUs
Hongzhi Guo [Fri, 10 Jul 2020 11:43:13 +0000 (19:43 +0800)]
net: fix checksum on big endian CPUs

With current code, the checksum of odd-length buffers is wrong on
big endian CPUs: the last byte is not properly summed to the
accumulator.

Fix this by left-shifting the remaining byte by 8. For instance,
if the last byte is 0x42, we should add 0x4200 to the accumulator
on big endian CPUs.

This change is similar to what is suggested in Errata 3133 of
RFC 1071.

Fixes: 6006818cfb26("net: new checksum functions")
Cc: stable@dpdk.org
Signed-off-by: Hongzhi Guo <guohongzhi1@huawei.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
3 years agonet: fix unneeded replacement of TCP checksum 0
Hongzhi Guo [Fri, 10 Jul 2020 06:55:51 +0000 (14:55 +0800)]
net: fix unneeded replacement of TCP checksum 0

Per RFC768:
If the computed checksum is zero, it is transmitted as all ones.
An all zero transmitted checksum value means that the transmitter
generated no checksum.

RFC793 for TCP has no such special treatment for the checksum of zero.

Fixes: 6006818cfb26 ("net: new checksum functions")
Cc: stable@dpdk.org
Signed-off-by: Hongzhi Guo <guohongzhi1@huawei.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
3 years agovhost: restrict pointer aliasing for packed ring
Joyce Kong [Fri, 10 Jul 2020 02:38:50 +0000 (10:38 +0800)]
vhost: restrict pointer aliasing for packed ring

Restrict pointer aliasing to allow the compiler to vectorize loop
more aggressively.

With this patch, a 9.6% improvement is observed in throughput for
the packed virtio-net PVP case, and a 2.8% improvement in throughput
for the packed virtio-user PVP case. All performance data are measured
on ThunderX-2 platform under 0.001% acceptable packet loss with 1 core
on both vhost and virtio side.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
3 years agonet/virtio: restrict pointer aliasing for NEON
Joyce Kong [Fri, 10 Jul 2020 02:38:49 +0000 (10:38 +0800)]
net/virtio: restrict pointer aliasing for NEON

Restrict pointer aliasing to allow the compiler to vectorize loops
more aggressively.

With this patch, a 9.6% improvement is observed in throughput for
the virtio-net PVP case, and a 2.4% perf improvement in throughput
for the virtio-user PVP case. All performance data are measured
on ThunderX-2 platform under the 0.001% acceptable packet loss with
2 cores on the vhost side and 1 core on the virtio side.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
3 years agointroduce restricted pointer aliasing marker
Joyce Kong [Fri, 10 Jul 2020 02:38:48 +0000 (10:38 +0800)]
introduce restricted pointer aliasing marker

The 'restrict' keyword is recognized in C99, while type qualifier
'__restrict' compiles ok in C with all language levels. This patch
is to replace the existing 'restrict' with '__rte_restrict' which
is a common wrapper supported by all compilers.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agotest/lpm: add RCU performance tests
Honnappa Nagarahalli [Fri, 10 Jul 2020 02:22:27 +0000 (10:22 +0800)]
test/lpm: add RCU performance tests

Add performance tests for RCU integration. The performance
difference with and without RCU integration is very small
(~1% to ~2%) on both Arm and x86 platforms.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
3 years agotest/lpm: add RCU functional tests
Ruifeng Wang [Fri, 10 Jul 2020 02:22:26 +0000 (10:22 +0800)]
test/lpm: add RCU functional tests

Add positive and negative tests for API rte_lpm_rcu_qsbr_add.
Also test LPM library behavior when RCU QSBR is enabled.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
3 years agolpm: implement RCU rule reclamation
Ruifeng Wang [Fri, 10 Jul 2020 02:22:25 +0000 (10:22 +0800)]
lpm: implement RCU rule reclamation

Currently, the tbl8 group is freed even though the readers might be
using the tbl8 group entries. The freed tbl8 group can be reallocated
quickly. This results in incorrect lookup results.

RCU QSBR process is integrated for safe tbl8 group reclaim.
Refer to RCU documentation to understand various aspects of
integrating RCU library into other libraries.

To avoid ABI breakage, a struct __rte_lpm is created for lpm library
internal use. This struct wraps rte_lpm that has been exposed and
also includes members that don't need to be exposed such as RCU related
config.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
3 years agoeal/linux: use C11 atomics for interrupt status
Phil Yang [Thu, 9 Jul 2020 08:34:35 +0000 (16:34 +0800)]
eal/linux: use C11 atomics for interrupt status

The event status is defined as a volatile variable and shared between
threads. Use C11 atomic built-ins with explicit ordering instead of
rte_atomic ops which enforce unnecessary barriers on aarch64.

The event status has been cleaned up by the compare-and-swap operation
when we free the event data, so there is no need to set it to invalid
after that.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Harman Kalra <hkalra@marvell.com>
3 years agoring: use custom element for fixed size API
Feifei Wang [Thu, 9 Jul 2020 06:12:12 +0000 (01:12 -0500)]
ring: use custom element for fixed size API

Use rte_ring_xxx_elem_xxx APIs to replace legacy API implementation.
This reduces code duplication and improves code maintenance.

Tests done on Arm, x86 [1] and PPC [2] do not indicate performance
degradation.
[1] https://mails.dpdk.org/archives/dev/2020-July/173780.html
[2] https://mails.dpdk.org/archives/dev/2020-July/173863.html

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
3 years agoring: remove experimental flag from custom element API
Feifei Wang [Thu, 9 Jul 2020 06:12:11 +0000 (01:12 -0500)]
ring: remove experimental flag from custom element API

Remove the experimental tag for rte_ring_xxx_elem APIs that have been
around for 2 releases.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
3 years agoring: remove experimental flag from reset API
Feifei Wang [Thu, 9 Jul 2020 06:12:10 +0000 (01:12 -0500)]
ring: remove experimental flag from reset API

Remove the experimental tag for rte_ring_reset API that have been around
for 4 releases.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agoservice: fix C++ linkage
Levend Sayar [Thu, 9 Jul 2020 12:32:16 +0000 (15:32 +0300)]
service: fix C++ linkage

"extern C" define is added to rte_service_component.h file
to be able to use in C++ context

Fixes: 21698354c832 ("service: introduce service cores concept")
Cc: stable@dpdk.org
Signed-off-by: Levend Sayar <levendsayar@gmail.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
3 years agoethdev: fix log type for some error messages
Ferruh Yigit [Thu, 2 Jul 2020 11:17:05 +0000 (12:17 +0100)]
ethdev: fix log type for some error messages

Some log macros was using 'EAL' logtype, convert them to 'ethdev'.
Also fix missing EOL and fix syntax for some logs.

Fixes: 214ed1acd125 ("ethdev: add iterator to match devargs input")
Fixes: e489007a411c ("ethdev: add generic create/destroy ethdev APIs")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
3 years agodoc: update feature list in hns3 guide
Lijun Ou [Sat, 4 Jul 2020 10:09:51 +0000 (18:09 +0800)]
doc: update feature list in hns3 guide

This patch updates the feature list for hns3 PMD driver document.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agonet/hns3: fix inserted VLAN tag position in Tx
Wei Hu (Xavier) [Sat, 4 Jul 2020 10:09:50 +0000 (18:09 +0800)]
net/hns3: fix inserted VLAN tag position in Tx

Based on hns3 network engine, in order to configure hardware VLAN insert
offload in Tx direction, PMD driver reads the VLAN tags from the
vlan_tci_outer and vlan_tci of the structure rte_mbuf, fills them into
the Tx Buffer Descriptor and sets the related offload flag for every
packet.

Currently, there are two VLAN related problems in the 'tx_pkt_burst' ops
implementation function:
1) When setting the related offload flag, PMD driver inserts the VLAN
   tag into the position that close to L3 header. So, when upper
   application sends a packet with a VLAN tag in the data buffer, the
   VLAN offloaded by hardware will be added to the wrong position. It is
   supposed to add the VLAN tag from the rte_mbuf to the position close
   to the MAC header in the packet when using VLAN insertion.

   And when PF PVID is enabled by calling the API function named
   rte_eth_dev_set_vlan_pvid or VF PVID is enabled by hns3 PF kernel
   ether driver, the VLAN tag from the structure rte_mbuf to enable the
   VLAN insertion should be filled into the position that close to L3
   header to avoid to be overwritten by the PVID which will always be
   inserted in the position that close to the MAC address.

2) When sending multiple segment packets, VLAN information is required
   to be filled into the first Tx Buffer descriptor. However, currently
   hns3 PMD driver incorrectly placed it in the last Tx Buffer
   Descriptor. This results in VLAN insert offload failure when sending
   multiple segment packets.

This patch fixed them by filling the VLAN information into the position
of the Tx Buffer Descriptor.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: cleanup duplicated code on processing TSO in Tx
Chengchang Tang [Sat, 4 Jul 2020 10:09:49 +0000 (18:09 +0800)]
net/hns3: cleanup duplicated code on processing TSO in Tx

This patch fixes up paylen calculation twice when processing TSO request
in the '.tx_pkt_burst' ops implementation function to avoid performance
loss.

Fixes: 6dca716c9e1d ("net/hns3: support TSO")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
3 years agonet/hns3: check multi-process action register result
Wei Hu (Xavier) [Sat, 4 Jul 2020 10:09:48 +0000 (18:09 +0800)]
net/hns3: check multi-process action register result

Currently, there is a coverity defect warning about hns3 PMD driver, the
detail information as blow:
CID 289969 (#1 of 1): Unchecked return value (CHECKED_RETURN)
1. check_return: Calling rte_mp_action_register without checking return
   value (as is done elsewhere 11 out of 13 times).

The problem is that missing checking the return value of calling the API
rte_mp_action_register during initialization. If registering an action
function for primary and secondary communication failed, the secondary
process can't work properly.

This patch fixes it by adding check return value of the API function
named rte_mp_action_register in the '.dev_init' implementation function
of hns3 PMD driver.

Coverity issue: 289969
Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agoapp/testpmd: enable empty polls in burst stats
Honnappa Nagarahalli [Mon, 6 Jul 2020 23:32:31 +0000 (18:32 -0500)]
app/testpmd: enable empty polls in burst stats

The number of empty polls provides information about available
CPU head room in the presence of continuous polling.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
3 years agoapp/testpmd: fix burst percentage calculation
Honnappa Nagarahalli [Mon, 6 Jul 2020 23:32:30 +0000 (18:32 -0500)]
app/testpmd: fix burst percentage calculation

The burst % calculation can over flow due to multiplication.
Fix the multiplication and increase the size of variables to
64b.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
3 years agoapp/testpmd: use clock time in throughput calculation
Honnappa Nagarahalli [Mon, 6 Jul 2020 23:32:29 +0000 (18:32 -0500)]
app/testpmd: use clock time in throughput calculation

The throughput calculation requires a counter that measures
passing of time. However, the kernel saves and restores the PMU
state when a thread is unscheduled and scheduled. This ensures
that the PMU cycles are not counted towards a thread that is
not scheduled. Hence, when RTE_ARM_EAL_RDTSC_USE_PMU is enabled,
the PMU cycles do not represent the passing of time.
This results in incorrect calculation of throughput numbers.
Use clock_gettime system call to calculate the time passed since
last call.

Bugzilla ID: 450
Fixes: 0e106980301d ("app/testpmd: show throughput in port stats")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
3 years agovhost: introduce async enqueue for split ring
Patrick Fu [Tue, 7 Jul 2020 05:07:09 +0000 (13:07 +0800)]
vhost: introduce async enqueue for split ring

This patch implements async enqueue data path for split ring. 2 new
async data path APIs are defined, by which applications can submit
and poll packets to/from async engines. The async engine is either
a physical DMA device or it could also be a software emulated backend.
The async enqueue data path leverages callback functions registered by
applications to work with the async engine.

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: introduce async enqueue registration API
Patrick Fu [Tue, 7 Jul 2020 05:07:08 +0000 (13:07 +0800)]
vhost: introduce async enqueue registration API

Performing large memory copies usually takes up a major part of CPU
cycles and becomes the hot spot in vhost-user enqueue operation. To
offload the large copies from CPU to the DMA devices, asynchronous
APIs are introduced, with which the CPU just submits copy jobs to
the DMA but without waiting for its copy completion. Thus, there is
no CPU intervention during data transfer. We can save precious CPU
cycles and improve the overall throughput for vhost-user based
applications. This patch introduces registration/un-registration
APIs for vhost async data enqueue operation. Together with the
registration APIs implementations, data structures and the prototype
of the async callback functions required for async enqueue data path
are also defined.

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agoapp/testpmd: add GTPU to RSS hash commands
Jeff Guo [Tue, 7 Jul 2020 05:25:46 +0000 (13:25 +0800)]
app/testpmd: add GTPU to RSS hash commands

Add testpmd cmdline support for GTPU, it could be used to configure
gtpu teid hash. The commands as below:

testpmd> flow create 0 ingress pattern eth / ipv4 / udp / gtpu / \
ipv4 / end actions rss types gtpu end  key_len 0 queues end / end

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: enable additional input set for RSS hash
Jeff Guo [Tue, 7 Jul 2020 05:25:45 +0000 (13:25 +0800)]
net/ice: enable additional input set for RSS hash

PF could add or delete a RSS rule base on the PF's hash capability.
Some new rss input set will be supported, the protocols as below:
eth/vlan/l2tpv3/esp/ah/pfcp.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: support hash for GTPU protocols
Jeff Guo [Tue, 7 Jul 2020 05:25:44 +0000 (13:25 +0800)]
net/ice: support hash for GTPU protocols

Support hash flow for the new protocols of GTPU_EH UPLINK, GTPU_EH
DOWNLINK and GTPU_IP.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: refactor PF hash flow
Jeff Guo [Tue, 7 Jul 2020 05:25:43 +0000 (13:25 +0800)]
net/ice: refactor PF hash flow

Refactor hash flow by change the action parser and clean some code.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: enable additional hash flow
Jeff Guo [Tue, 7 Jul 2020 05:14:06 +0000 (13:14 +0800)]
net/iavf: enable additional hash flow

Some new hash flow will be supported to expend the flow hash
capability, the input set are the session id for NAT-T ESP protocol,
the l3 src/dst and the teid for GTPU_IP protocol.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: enable 5 tuple RSS hash
Jeff Guo [Tue, 7 Jul 2020 05:14:05 +0000 (13:14 +0800)]
net/iavf: enable 5 tuple RSS hash

Previous iavf not support 5 tuple hash, this patch aims to enable it
for regular ip pattern and also GTPU inner ip pattern, the 5 tuple
involves ip src and ip dst, tcp sport and tcp dport, udp sport and
udp dport and protocol id.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: refactor hash flow
Jeff Guo [Tue, 7 Jul 2020 05:14:04 +0000 (13:14 +0800)]
net/iavf: refactor hash flow

Refactor hash flow by change the process of the pattern parser and the
action parser, and refine the lookup table for regular IP and GTPU_EH,
ETH, and also VLAN.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: support ether type filter on flow director
Simei Su [Tue, 7 Jul 2020 03:21:15 +0000 (11:21 +0800)]
net/ice: support ether type filter on flow director

This patch enables FDIR with input set ethertype.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/e1000/base: update version
Guinan Sun [Mon, 6 Jul 2020 08:12:22 +0000 (08:12 +0000)]
net/e1000/base: update version

Update base code version in readme.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: modify copyright
Guinan Sun [Mon, 6 Jul 2020 08:12:21 +0000 (08:12 +0000)]
net/e1000/base: modify copyright

Modify the copyright of the file header.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: cleanup pre-processor tags
Guinan Sun [Mon, 6 Jul 2020 08:12:20 +0000 (08:12 +0000)]
net/e1000/base: cleanup pre-processor tags

The codes has been exposed correctly, so remove pre-processor tags.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: introduce DPGFR register
Guinan Sun [Mon, 6 Jul 2020 08:12:19 +0000 (08:12 +0000)]
net/e1000/base: introduce DPGFR register

Defined DPGFR, Dynamic Power Gate Force Control Register.

Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: add ADL device ID
Guinan Sun [Mon, 6 Jul 2020 08:12:18 +0000 (08:12 +0000)]
net/e1000/base: add ADL device ID

Add new device ID for Alder Lake brand.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: support MAC type for Nahum10
Guinan Sun [Mon, 6 Jul 2020 08:12:17 +0000 (08:12 +0000)]
net/e1000/base: support MAC type for Nahum10

Add support to a new MAC type (for Nahum10).

Signed-off-by: Roman Fridlyand <roman.fridlyand@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: expose FEXTNVM registers and masks
Guinan Sun [Mon, 6 Jul 2020 08:12:16 +0000 (08:12 +0000)]
net/e1000/base: expose FEXTNVM registers and masks

Adding defines for FEXTNVM8 and FEXTNVM12 registers with new masks for
future use.

Signed-off-by: Nir Efrati <nir.efrati@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: fix led blinking for i210
Guinan Sun [Mon, 6 Jul 2020 08:12:15 +0000 (08:12 +0000)]
net/e1000/base: fix led blinking for i210

Added initialization of identification LED.

Signed-off-by: Maciej Hefczyc <maciej.hefczyc@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
3 years agonet/e1000/base: modify flow control setup
Guinan Sun [Mon, 6 Jul 2020 08:12:14 +0000 (08:12 +0000)]
net/e1000/base: modify flow control setup

Customers had a problem with large pings after connected standby.
This is due to the requirement of maintaining link after CS - the driver
blocks resets during "AdapterStart" and skips flow control setup.
Added condition in e1000_setup_link_ich8lan.c function that always setup
flow control, and setup physical interface only when no need to block
resets.

Signed-off-by: Nir Efrati <nir.efrati@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: add missed define for VFTA
Guinan Sun [Mon, 6 Jul 2020 08:12:13 +0000 (08:12 +0000)]
net/e1000/base: add missed define for VFTA

VLAN filtering using the VFTA (VLAN Filter Table Array) and
should be initialized prior to setting rx mode.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: remove useless statement
Guinan Sun [Mon, 6 Jul 2020 08:12:12 +0000 (08:12 +0000)]
net/e1000/base: remove useless statement

As it stands now, this fix will not change the current functionality
of the code. In addition, we remove the comment that seemed to be
a copy/paste from a separate implementation.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: expose more future extended NVM
Guinan Sun [Mon, 6 Jul 2020 08:12:11 +0000 (08:12 +0000)]
net/e1000/base: expose more future extended NVM

Future extended NVM 5 (five) required for a Dynamic Power Gating
control in the MAC.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: add missing device ID
Guinan Sun [Mon, 6 Jul 2020 08:12:10 +0000 (08:12 +0000)]
net/e1000/base: add missing device ID

Adding Intel(R) I210 Gigabit Network Connection 15F6 device ID for SGMII
flashless automotive device.

Signed-off-by: Kamil Bednarczyk <kamil.bednarczyk@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: increase timeout for ME ULP exit
Guinan Sun [Mon, 6 Jul 2020 08:12:09 +0000 (08:12 +0000)]
net/e1000/base: increase timeout for ME ULP exit

Due timing issues in WHL and since recovery by host is
not always supported, increased timeout for Manageability Engine(ME)
to finish Ultra Low Power(ULP) exit flow for Nahum before timer expiration.

Signed-off-by: Nir Efrati <nir.efrati@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: add missing register defines
Guinan Sun [Mon, 6 Jul 2020 08:12:08 +0000 (08:12 +0000)]
net/e1000/base: add missing register defines

Added defines for the EEC, SHADOWINF and FLFWUPDATE registers needed for
the nvmupd_validate_offset function to correctly validate the NVM update
offset.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: add PCIm function state
Guinan Sun [Mon, 6 Jul 2020 08:12:07 +0000 (08:12 +0000)]
net/e1000/base: add PCIm function state

Added define to pcim function state.

Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: expose MAC functions
Guinan Sun [Mon, 6 Jul 2020 08:12:06 +0000 (08:12 +0000)]
net/e1000/base: expose MAC functions

Now the functions are being accessed outside of the file, we need
to properly expose them for silicon families to use.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: remove duplicated codes
Guinan Sun [Mon, 6 Jul 2020 08:12:05 +0000 (08:12 +0000)]
net/e1000/base: remove duplicated codes

Add two files base.c and base.h to reduce the redundancy
in the silicon family code.
Remove the code duplication from e1000_82575 files.
Clean family specific functions from base.
Fix up a stray and duplicate function declaration.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: modify HW level time sync mechanisms
Guinan Sun [Mon, 6 Jul 2020 08:12:04 +0000 (08:12 +0000)]
net/e1000/base: modify HW level time sync mechanisms

Add additional configuration space access to allow HW
level time sync mechanism.

Signed-off-by: Evgeny Efimov <evgeny.efimov@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: fix minor issues and improve code style
Guinan Sun [Mon, 6 Jul 2020 08:12:03 +0000 (08:12 +0000)]
net/e1000/base: fix minor issues and improve code style

Fix typo in piece of code of NVM access for SPT.
And cleans up the remaining instances in the shared code
where it was not adhering to the Linux code standard.
Wrong description was found in the mentioned file, so fix them.
Remove shadowing variable declarations.

Relating to operands in bitwise operations having different sizes.
Unreachable code since *clock_in_i2c_* always return success.
Don't return unused s32 and don't check for constants.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Robert Konklewski <robertx.konklewski@intel.com>
Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: add function parameter descriptions
Guinan Sun [Mon, 6 Jul 2020 08:12:02 +0000 (08:12 +0000)]
net/e1000/base: add function parameter descriptions

Add function parameter descriptions to address gcc 7 warnings.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: fall through explicitly
Guinan Sun [Mon, 6 Jul 2020 08:12:01 +0000 (08:12 +0000)]
net/e1000/base: fall through explicitly

Found some inconsistent code comments when it came to when we "fall
through", so made them more consistent and non-repetitive.

This patch adds/changes fall through comments to address new warnings
produced by gcc 7.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: expose xMDIO methods
Guinan Sun [Mon, 6 Jul 2020 08:12:00 +0000 (08:12 +0000)]
net/e1000/base: expose xMDIO methods

Move read and write xmdio methods to e1000_phy.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: support i211
Guinan Sun [Mon, 6 Jul 2020 08:11:59 +0000 (08:11 +0000)]
net/e1000/base: support i211

Add support SF/FW synchronization.
Add support to print PBA when using flashless.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: introduce flags for outstanding requests
Guinan Sun [Mon, 6 Jul 2020 08:11:58 +0000 (08:11 +0000)]
net/e1000/base: introduce flags for outstanding requests

Introduce flags to make flexible adjusting
number of outstanding requests.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: add ICL device ID
Guinan Sun [Mon, 6 Jul 2020 08:11:57 +0000 (08:11 +0000)]
net/e1000/base: add ICL device ID

This patch contains a preliminary support for new LAN device ID.

Signed-off-by: Lotem Leder <lotem.leder@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/e1000/base: update for i210 slow system clock
Guinan Sun [Mon, 6 Jul 2020 08:11:56 +0000 (08:11 +0000)]
net/e1000/base: update for i210 slow system clock

This code is required for the update for system clock.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
3 years agonet/ice: fix GTPU/PPPoE packets with no hash value
Simei Su [Tue, 7 Jul 2020 01:38:18 +0000 (09:38 +0800)]
net/ice: fix GTPU/PPPoE packets with no hash value

When RSS init, because of profile overlap, the GTPU_IPV4 packets
don't hit GTPU_INNER_IPV4 profile which causes no hash value. Because
of no PPPoE profile, the PPPoE packets also has no hash value. This
patch solves this issue by pulling GTPU_IPV4 profile into inner ipv4
group and creating related PPPoE profile at the same time.

Fixes: 4717a12cfaf1 ("net/ice: initialize and update RSS based on user config")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: fix getting EEPROM information
Pavel Ivashchenko [Thu, 2 Jul 2020 12:37:17 +0000 (12:37 +0000)]
net/i40e: fix getting EEPROM information

Fixes: 50130a0c4440 ("net/i40e/base: change AQ command for PHY access")
Cc: stable@dpdk.org
Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: fix error log in generic flow
Shougang Wang [Mon, 6 Jul 2020 09:37:05 +0000 (09:37 +0000)]
net/ice: fix error log in generic flow

When create a RSS rule with void action, the error log is "Invalid
input set". This patch fix the issue by adding check for the type of
first actions item.

Fixes: 7615a6895009 ("net/ice: rework for generic flow enabling")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: support PPPoE RSS
Simei Su [Thu, 2 Jul 2020 05:11:50 +0000 (13:11 +0800)]
net/ice: support PPPoE RSS

This patch enables PPPoE control packets with src mac and session id
and PPPoE data packets with ip address and L4 port in rte_flow.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agoapp/testpmd: support extended RSS offload types
Simei Su [Thu, 2 Jul 2020 05:11:49 +0000 (13:11 +0800)]
app/testpmd: support extended RSS offload types

This patch adds testpmd cmdline support for PPPoE.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: add PPPoE RSS offload types
Simei Su [Thu, 2 Jul 2020 05:11:48 +0000 (13:11 +0800)]
ethdev: add PPPoE RSS offload types

This patch defines new RSS offload types for PPPoE. Typically,
session id would be the RSS input set for a PPPoE packet, but
as a hint, each driver may have different default behaviors.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodoc: update release notes for bnxt
Ajit Khaparde [Thu, 2 Jul 2020 23:28:38 +0000 (16:28 -0700)]
doc: update release notes for bnxt

Update release notes with enhancements in Broadcom PMD.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: support count action in flow query
Somnath Kotur [Thu, 2 Jul 2020 23:28:37 +0000 (16:28 -0700)]
net/bnxt: support count action in flow query

Use the flow counter manager to fetch the accumulated stats for
a flow.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: add ULP flow counter manager
Somnath Kotur [Thu, 2 Jul 2020 23:28:36 +0000 (16:28 -0700)]
net/bnxt: add ULP flow counter manager

The Flow counter manager allocates memory to hold the software view
of the counters where the on-chip counter data will be accumulated
along with another memory block that will be shadowing the on-chip
counter data i.e where the raw counter data will be DMAed into from
the chip.
It also keeps track of the first HW counter ID as that will be needed
to retrieve the counter data in bulk using a TF API. It issues this cmd
in an rte_alarm thread that keeps running every second.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fill cfa action in Tx descriptor
Venkat Duvvuru [Thu, 2 Jul 2020 23:28:35 +0000 (16:28 -0700)]
net/bnxt: fill cfa action in Tx descriptor

Currently, only vfrep transmit requires cfa_action to be filled
in the tx buffer descriptor. However with truflow, dpdk(non vfrep)
to port also requires cfa_action to be filled in the tx buffer
descriptor.

This patch uses the correct cfa_action pointer while transmitting
the packet. Based on whether the packet is transmitted on non-vfrep
or vfrep, tx_cfa_action or vfr_tx_cfa_action inside txq will be
filled in the tx buffer descriptor.

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>