dpdk.git
4 years agonet/bonding: change state machine to defaulted
Weifeng Li [Sat, 18 Jul 2020 04:35:38 +0000 (12:35 +0800)]
net/bonding: change state machine to defaulted

A dpdk bonding 802.3ad network as follows:
+----------+                        +-----------+
|dpdk lacp |bond1.1 <------> bond2.1|switch lacp|
|          |bond1.2 <------> bond2.2|           |
+----------+                        +-----------+
If a fiber optic go wrong about single pass during normal running like
this:
bond1.2 -----> bond2.2 ok
bond1.2 <--x-- bond2.2 error: bond1.2 receive no LACPDU Some packets
      from switch to dpdk will choose bond2.2
      and lost.

DPDK lacp state machine will transits to the expired state if no LACPDU
is received before the current_while_timer expires. But if no LACPDU is
received before the current_while_timer expires again, DPDK lacp state
machine has no change. Bond2.2 can not change to inactive depend on the
received LACPDU.
According to IEEE 802.3ad, if no lacpdu is received before the
current_while_timer expires again, the state machine should transits
from expired to defaulted. Bond2.2 will change to inactive depend on the
LACPDU with defaulted state.

This patch adds a state machine change from expired to defaulted when no
lacpdu is received before the current_while_timer expires again
according to IEEE 802.3ad:
If no LACPDU is received before the current_while timer expires again,
the state machine transits to the DEFAULTED state. The record Default
function overwrites the current operational parameters for the Partner
with administratively configured values. This allows configuration of
aggregations and individual links when no protocol partner is present,
while still permitting an active partner to override default settings.
The update_Default_Selected function sets the Selected variable FALSE
if the Link Aggregation Group has changed. Since all operational
parameters are now set to locally administered values there can be no
disagreement as to the Link Aggregation Group, so the Matched variable
is set TRUE.

The relevant description is in the chapter 43.4.12 of the link below:
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=850426

Signed-off-by: Weifeng Li <liweifeng96@126.com>
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/bonding: delete redundant code
Dongyang Pan [Sat, 4 Jul 2020 01:15:26 +0000 (09:15 +0800)]
net/bonding: delete redundant code

The function valid_bonded_port_id() has already contains function
rte_eth_dev_is_valid_port(), so delete redundant check.

Fixes: 588ae95e7983 ("net/bonding: fix port ID check")
Cc: stable@dpdk.org
Signed-off-by: Dongyang Pan <197020236@qq.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/bnxt: support exact match templates
Kishore Padmanabha [Fri, 17 Jul 2020 03:25:26 +0000 (23:25 -0400)]
net/bnxt: support exact match templates

Added support for exact match templates

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: update TruFlow resource allocation numbers
Kishore Padmanabha [Fri, 17 Jul 2020 14:14:49 +0000 (19:44 +0530)]
net/bnxt: update TruFlow resource allocation numbers

The truflow session open allocation parameters are updated to
support NAT records, L2 context regions, engress encap features.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: modify default egress rule for VF representor
Kishore Padmanabha [Fri, 17 Jul 2020 14:14:48 +0000 (19:44 +0530)]
net/bnxt: modify default egress rule for VF representor

The default egress rule should include buffer descriptor action
record only if the VF representor is enabled.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix null pointer dereference
Kishore Padmanabha [Fri, 17 Jul 2020 14:14:47 +0000 (19:44 +0530)]
net/bnxt: fix null pointer dereference

Avoid dereferencing a null pointer.

Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init")
Cc: stable@dpdk.org
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
4 years agonet/bnxt: use SPDX license tag
Randy Schacher [Fri, 17 Jul 2020 14:14:46 +0000 (19:44 +0530)]
net/bnxt: use SPDX license tag

Update cfa_resource_types.h to use SPDX license header.

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: remove unused macro
Randy Schacher [Fri, 17 Jul 2020 14:14:45 +0000 (19:44 +0530)]
net/bnxt: remove unused macro

Remove unused define TF_MSG_TCAM_SET_DEV_DATA_SIZE.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
4 years agonet/bnxt: use NAT IPv4 action
Jay Ding [Fri, 17 Jul 2020 14:14:44 +0000 (19:44 +0530)]
net/bnxt: use NAT IPv4 action

Use NAT IPv4 instead of NAT IPv4 SRC and DST.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
4 years agonet/bnxt: fix exact match message size
Farah Smith [Fri, 17 Jul 2020 14:14:43 +0000 (19:44 +0530)]
net/bnxt: fix exact match message size

Fix incorrect EM message size when calling insert_em_internal.

Fixes: 98487d729b4a ("net/bnxt: cleanup and refactor session management")

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: add matching protocol header info
Kishore Padmanabha [Fri, 17 Jul 2020 14:14:42 +0000 (19:44 +0530)]
net/bnxt: add matching protocol header info

The protocol header are implicitly matched based on the proto
field data. For instance, if ether type is set as 0x800 in the
ether header then ipv4 protocol header is assumed to be present
for template matching even if ipv4 header is not present in the
given flow pattern.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
4 years agonet/bnxt: fix accumulation of flow counters
Somnath Kotur [Fri, 17 Jul 2020 14:14:41 +0000 (19:44 +0530)]
net/bnxt: fix accumulation of flow counters

OVS-DPDK is accumulating the flow counters that are returned as part of
the flow_query API and it is being issued at least 3 times every second.
So there is no need to accumulate the counts internally in the driver.

Fixes: 306c2d28e247 ("net/bnxt: support count action in flow query")

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>
4 years agonet/bnxt: enable default flows in TruFlow mode
Kishore Padmanabha [Fri, 17 Jul 2020 14:14:40 +0000 (19:44 +0530)]
net/bnxt: enable default flows in TruFlow mode

Removed the check to enable default flows only when VF representor
are enabled. It should be enabled all the time in truflow mode.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
4 years agonet/bnxt: initialize table scope parameter
Farah Smith [Fri, 17 Jul 2020 14:14:39 +0000 (19:44 +0530)]
net/bnxt: initialize table scope parameter

Initialize table scope resource manager parameter.
Clear out rm_is_allocated parms before calling as base_index was added
and used incorrectly in this instance.

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: modify resource management scheme
Peter Spreadborough [Fri, 17 Jul 2020 14:14:38 +0000 (19:44 +0530)]
net/bnxt: modify resource management scheme

Add support for new resource manager to manage CFA resources.
TCAM is split into high and low regions now and CFA resource types
are being updated accordingly.

Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/ixgbe: fix flow control status
Guinan Sun [Sat, 23 May 2020 05:22:39 +0000 (05:22 +0000)]
net/ixgbe: fix flow control status

mac_ctrl_frame_fwd assignment is missing, so
setting mac_ctrl_frame_fwd should be added in
ixgbe_flow_ctrl_get().
The patch fixes the issue.

Fixes: 56ea46a997b7 ("ethdev: retrieve flow control configuration")
Cc: stable@dpdk.org
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Bo Chen <box.c.chen@intel.com>
4 years agonet/ixgbe: fix MAC control frame forward
Guinan Sun [Sat, 23 May 2020 05:22:38 +0000 (05:22 +0000)]
net/ixgbe: fix MAC control frame forward

mac_ctrl_frame_fwd shouldn't be cleared when port stop,
otherwise it will be inconsistent with the actual status.
This patch fixes the issue.

Fixes: a524f550da6e ("net/ixgbe: fix flow control mode setting")
Cc: stable@dpdk.org
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: fix filter pctype
Shougang Wang [Wed, 15 Jul 2020 08:08:10 +0000 (08:08 +0000)]
net/i40e: fix filter pctype

The i40e_filter_pctype TCP_SYN_NO_ACK, UNICAST_IPV4_UDP and
MULTICAST_IPV4_UDP for x722 were missing when translating RSS type to
i40e_filter_pctype. This patch fixes it.

Fixes: da7018ec29d4 ("net/i40e: fix queue region in RSS flow")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ice/base: fix memory leak on GTPU RSS
Junfeng Guo [Mon, 20 Jul 2020 07:09:55 +0000 (15:09 +0800)]
net/ice/base: fix memory leak on GTPU RSS

Add memory space free logic for adding and removing GTP-U before return
success status, to avoid memory leak issue.

Fixes: bed9bb3139ef ("net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: fix flow director Rx writeback packet
Chenmin Sun [Fri, 17 Jul 2020 14:57:58 +0000 (22:57 +0800)]
net/i40e: fix flow director Rx writeback packet

This patch fixes the fdir cannot receive rx writeback packet issue.
The root cause is FDIR interrupt is not correctly enabled.

Beside this, to make sure fdir programming works fine when the port
is stopped, move the fdir interrupt configure from start/stop to
setup/teardown.

Fixes: cfd662d22e7b ("net/i40e: fix interrupt throttling setting in PF")
Cc: stable@dpdk.org
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/ice: fix GTPU RSS
Simei Su [Fri, 17 Jul 2020 03:27:36 +0000 (11:27 +0800)]
net/ice: fix GTPU RSS

Because of incomplete protocol header fields, GTPU_INNER_IPV4_UDP
and GTPU_INNER_IPV4_TCP profile aren't included in inner ipv4 group.
This patch complements header fields for GTPU/GTPU_EH ipv4 rss config.

Besides, after configuring L4 port, GTPU and GTPU_EH packets don't do
hash for UDP/TCP/SCTP. This patch also enables L4 hash for GTPU and GTPU
extension packets.

Fixes: d117de460035 ("net/ice: fix GTPU/PPPoE packets with no hash value")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: optimize flow director update rate
Chenmin Sun [Fri, 17 Jul 2020 17:36:58 +0000 (01:36 +0800)]
net/i40e: optimize flow director update rate

This patch optimized the fdir update rate for i40e PF, by tracking
whether the fdir rule being inserted into the guaranteed space
or shared space.
For the flows that are inserted to the guaranteed space, we assume
that the insertion will always succeed as the hardware only report
the "no enough space left" error. In this case, the software can
directly return success and no need to retrieve the result from
the hardware. When destroying a flow, we also assume the operation
will succeed as the software has checked the flow is indeed in
the hardware.
See the fdir programming status descriptor format in the datasheet
for more details.

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agonet/i40e: optimize TPID fetching
Chenmin Sun [Fri, 17 Jul 2020 17:36:57 +0000 (01:36 +0800)]
net/i40e: optimize TPID fetching

This patch moves the fetching the device tpid to where it really needs,
rather than fetching it every time when entered the functions.
This is because this operation costs too many cycles and it is used only
when matching the ethernet header.

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agonet/i40e: optimize flow director memory management
Chenmin Sun [Fri, 17 Jul 2020 17:36:56 +0000 (01:36 +0800)]
net/i40e: optimize flow director memory management

This patch allocated some memory pool for flow management to avoid
calling rte_zmalloc/rte_free every time.
This patch also improves the hash table operation. When adding/removing
a flow, the software will directly add/delete it from the hash table.
If any error occurs, it then roll back the operation it just done.

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agonet/i40e: support flow director space tracking
Chenmin Sun [Fri, 17 Jul 2020 17:36:55 +0000 (01:36 +0800)]
net/i40e: support flow director space tracking

This patch introduces a FDIR flow management for guaranteed/shared
space tracking.
The fdir space is reported by the
i40e_hw_capabilities.fd_filters_guaranteed and fd_filters_best_effort.
The fdir space is managed by hardware and now is tracking in software.
The management algorithm is controlled by the GLQF_CTL.INVALPRIO.
Detailed implementation please check in the datasheet and the
description of struct i40e_fdir_info.fdir_invalprio.

This patch changes the global register GLQF_CTL. Therefore, when devarg
``support-multi-driver`` is set, the patch will not take effect to
avoid affecting the normal behavior of other i40e drivers, e.g., Linux
kernel driver.

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agonet/bnxt: remove experimental build flag
David Marchand [Thu, 16 Jul 2020 07:26:18 +0000 (09:26 +0200)]
net/bnxt: remove experimental build flag

-DALLOW_EXPERIMENTAL_API is always set for in-tree compilation.
See https://git.dpdk.org/dpdk/commit/?id=acec04c4b2f5

Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: support decrement TTL action
Kishore Padmanabha [Wed, 15 Jul 2020 13:50:38 +0000 (19:20 +0530)]
net/bnxt: support decrement TTL action

Added support for decrement TTL action.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: increase number of egress flow entries
Kishore Padmanabha [Wed, 15 Jul 2020 13:50:37 +0000 (19:20 +0530)]
net/bnxt: increase number of egress flow entries

Increase the number of egress flow entries.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: consider VLAN fields for template match criteria
Kishore Padmanabha [Wed, 15 Jul 2020 13:50:36 +0000 (19:20 +0530)]
net/bnxt: consider VLAN fields for template match criteria

The vlan mask fields were not setting the field bitmap causing
the template match process to ignore vlan fields. This change fixes
this bug.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: support identifier search and ref count
Kishore Padmanabha [Wed, 15 Jul 2020 13:50:35 +0000 (19:20 +0530)]
net/bnxt: support identifier search and ref count

Add support to search for identifiers and increase the reference
count for identifiers that are already allocated.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
4 years agonet/bnxt: ignore IPv4 TOS mask
Kishore Padmanabha [Wed, 15 Jul 2020 13:50:34 +0000 (19:20 +0530)]
net/bnxt: ignore IPv4 TOS mask

This is a work around for the OVS setting offload rules that
are passing ipv4 tos mask as wild card and currently we do not
support.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: support extracting data from ULP blob
Kishore Padmanabha [Wed, 15 Jul 2020 13:50:33 +0000 (19:20 +0530)]
net/bnxt: support extracting data from ULP blob

Extended the ulp blob to extract data from the blob for a given
offset and length. The support is added only for little endian
format.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: support two table scopes
Farah Smith [Wed, 15 Jul 2020 13:50:32 +0000 (19:20 +0530)]
net/bnxt: support two table scopes

Need to remap the table scope ids allocated from HCAPI RM from high
to low value because for legacy devices a table scope is a set of base
addresses.  The PCIe addresses must map to a PCIe PF which exists in
the hardware.

Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: check index range in bulk get
Jay Ding [Wed, 15 Jul 2020 13:50:31 +0000 (19:20 +0530)]
net/bnxt: check index range in bulk get

In tf_tbl_bulk_get, check if the indexes are in the range
of reserved tbl id instead of checking the allocation of each id.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: implement TF Identifier search
Jay Ding [Wed, 15 Jul 2020 13:50:30 +0000 (19:20 +0530)]
net/bnxt: implement TF Identifier search

Implement shadow copy DB to hold reference count for
each ID in each identifier type. Implement identifier
search functionality.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: delay EEM sysmem mapping
Peter Spreadborough [Wed, 15 Jul 2020 13:50:29 +0000 (19:20 +0530)]
net/bnxt: delay EEM sysmem mapping

- The mapping of kernel pages for EEM sysmem operation takes
  a significant amount of time. This change give the build option
  to delay the sysmem mapping until the first write to EEM

Signed-off-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
4 years agoadd python2 deprecation notice
Louise Kilheeney [Fri, 10 Jul 2020 10:10:47 +0000 (11:10 +0100)]
add python2 deprecation notice

Prepare for python2 removal in 20.11.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
4 years agoapp/bbdev: support python3
Louise Kilheeney [Fri, 10 Jul 2020 10:10:54 +0000 (11:10 +0100)]
app/bbdev: support python3

Use of the print function required for python3 compatibility.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
4 years agotest/eal: check invalid CPU value
Kevin Traynor [Mon, 20 Jul 2020 10:19:08 +0000 (11:19 +0100)]
test/eal: check invalid CPU value

When using --lcores option, there is a limit of CPU_SETSIZE.
Currently that allows 0..1023 on Linux.

Check it is caught when this limit is exceeded.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
4 years agobus/fslmc: fix memory leak in secondary process
Yunjian Wang [Fri, 17 Jul 2020 10:50:17 +0000 (18:50 +0800)]
bus/fslmc: fix memory leak in secondary process

In fslmc_process_mcp(), we allocate memory for 'dev_name' but not
released before return in secondary process. And it is not used
since commit a69f79300262 ("bus/fslmc: support multi VFIO group"),
so it can be removed.

Fixes: e55d0494ab98 ("bus/fslmc: support secondary process")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agolpm: report error when defer queue overflows
Ruifeng Wang [Thu, 16 Jul 2020 15:49:19 +0000 (23:49 +0800)]
lpm: report error when defer queue overflows

Coverity complains about unchecked return value of rte_rcu_qsbr_dq_enqueue.
By default, defer queue size is big enough to hold all tbl8 groups. When
enqueue fails, return error to the user to indicate system issue.

Coverity issue: 360832
Fixes: 8a9f8564e9f9 ("lpm: implement RCU rule reclamation")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agomempool/ring: support RTS and HTS ring modes
Konstantin Ananyev [Wed, 15 Jul 2020 14:58:15 +0000 (15:58 +0100)]
mempool/ring: support RTS and HTS ring modes

Two new sync modes were introduced into rte_ring:
relaxed tail sync (RTS) and head/tail sync (HTS).
This change provides user with ability to select these
modes for ring based mempool via mempool ops API.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Gage Eads <gage.eads@intel.com>
4 years agodoc: add ring based mempool guide
Konstantin Ananyev [Wed, 15 Jul 2020 14:58:14 +0000 (15:58 +0100)]
doc: add ring based mempool guide

Add documentation for rte_ring mempool driver.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoregex/mlx5: add empty start/stop/close
Ori Kam [Mon, 20 Jul 2020 06:26:17 +0000 (06:26 +0000)]
regex/mlx5: add empty start/stop/close

Add the start, stop and close functions.
In current implementation they are empty functions
and are only exists in order that when called
from rte level, the function will return with success code.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support dequeue
Yuval Avnery [Mon, 20 Jul 2020 06:26:16 +0000 (06:26 +0000)]
regex/mlx5: support dequeue

Implement dequeue function for the regex API.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support enqueue
Yuval Avnery [Mon, 20 Jul 2020 06:26:15 +0000 (06:26 +0000)]
regex/mlx5: support enqueue

Will look for a free SQ to send the job on.
doorbell will be given when sq is full, or no more jobs on the burst.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: setup fast path
Yuval Avnery [Mon, 20 Jul 2020 06:26:14 +0000 (06:26 +0000)]
regex/mlx5: setup fast path

Allocated and register input/output buffers and metadata.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: add send queue
Ori Kam [Mon, 20 Jul 2020 06:26:13 +0000 (06:26 +0000)]
regex/mlx5: add send queue

This commit introduce the SQ creation.
The SQ is used for enqueuing a job.

In order to support out of order matches, we create number
os SQ per one application QP.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: add completion queue creation
Ori Kam [Mon, 20 Jul 2020 06:26:12 +0000 (06:26 +0000)]
regex/mlx5: add completion queue creation

This commit adds the creation of CQ

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support rules import
Francis Kelly [Mon, 20 Jul 2020 06:26:11 +0000 (06:26 +0000)]
regex/mlx5: support rules import

This commit introduce the ability to program rules to the
RegEx engine.

Signed-off-by: Francis Kelly <fkelly@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support configuration
Ori Kam [Mon, 20 Jul 2020 06:26:10 +0000 (06:26 +0000)]
regex/mlx5: support configuration

This commit implements the configure function.
This function is responsible to configure the RegEx engine.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: add engine status check
Ori Kam [Mon, 20 Jul 2020 06:26:09 +0000 (06:26 +0000)]
regex/mlx5: add engine status check

This commit checks the engine status.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support info query
Ori Kam [Mon, 20 Jul 2020 06:26:08 +0000 (06:26 +0000)]
regex/mlx5: support info query

This commit adds the get info function.

Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: support probing
Ori Kam [Mon, 20 Jul 2020 06:26:07 +0000 (06:26 +0000)]
regex/mlx5: support probing

This commit adds the probe function to the RegEx PMD.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: add log macros
Yuval Avnery [Mon, 20 Jul 2020 06:26:06 +0000 (06:26 +0000)]
regex/mlx5: add log macros

Add the MLX5_REGEX_LOG macro which should be used for error prints.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoregex/mlx5: introduce driver for BlueField 2
Yuval Avnery [Mon, 20 Jul 2020 06:26:05 +0000 (06:26 +0000)]
regex/mlx5: introduce driver for BlueField 2

This commit introduce the RegEx poll mode drivers class, and
adds Mellanox RegEx PMD.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Signed-off-by: Ori Kam <orika@mellanox.com>
4 years agodoc: announce removal of mbuf legacy refcnt field
Phil Yang [Fri, 17 Jul 2020 04:36:51 +0000 (12:36 +0800)]
doc: announce removal of mbuf legacy refcnt field

refcnt_atomic member in structures rte_mbuf and rte_mbuf_ext_shared_info
will be removed in 20.11 release.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agombuf: use C11 atomic builtins for refcnt
Phil Yang [Fri, 17 Jul 2020 04:36:50 +0000 (12:36 +0800)]
mbuf: use C11 atomic builtins for refcnt

Use C11 atomic builtins with explicit ordering instead of rte_atomic
ops which enforce unnecessary barriers on aarch64.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Suggested-by: Dodji Seketeli <dodji@redhat.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agotest/crypto: skip unsupported cases
Akhil Goyal [Thu, 16 Jul 2020 19:07:13 +0000 (00:37 +0530)]
test/crypto: skip unsupported cases

blockcipher cases are either returning TEST_SUCCESS
or TEST_FAILED as status, but the test may not be
supported by the PMD which is also a success case
for the PMD. Hence checking for status == TEST_FAILED
for setting the overall status as failed.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ankur Dwivedi <adwivedi@marvell.com>
4 years agoexamples/ipsec-secgw: enable flow based distribution
Anoob Joseph [Fri, 17 Jul 2020 12:31:10 +0000 (18:01 +0530)]
examples/ipsec-secgw: enable flow based distribution

RTE_FLOW API allows hardware parsing and steering of packets to specific
queues which helps in distributing ingress traffic across various cores.
Adding 'flow' rules allows user to specify the distribution required.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoapp/testpmd: fix typos
Viacheslav Ovsiienko [Wed, 15 Jul 2020 10:30:35 +0000 (10:30 +0000)]
app/testpmd: fix typos

Fix minor typos.

Fixes: 4940344dab1d ("app/testpmd: add Tx scheduling command")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/virtio-user: fix uninitialized reply-ack variable
Chenbo Xia [Tue, 14 Jul 2020 11:03:05 +0000 (11:03 +0000)]
net/virtio-user: fix uninitialized reply-ack variable

This patch fixes an issue that uninitialized has_reply_ack
is used for setting message flags.

Coverity issue: 360834
Fixes: c60208dd6384 ("net/virtio-user: support reply-ack")

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Adrian Moreno <amorenoz@redhat.com>
4 years agonet/ice: fix IPv6 NAT-T ESP
Jeff Guo [Thu, 16 Jul 2020 07:29:00 +0000 (15:29 +0800)]
net/ice: fix IPv6 NAT-T ESP

The hash for ipv6 nat-t esp should be enable as ipv4 nat-t esp.

Fixes: dadf70e5c30a ("net/ice: enable additional input set for RSS hash")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: fix queue pairs configuration in VF
Alvin Zhang [Thu, 16 Jul 2020 06:33:36 +0000 (14:33 +0800)]
net/i40e: fix queue pairs configuration in VF

If a VF request PF to allocate more number of queue pairs, the PF will
free the queue pairs which have been allocated and reset the VF. So,
VF should stop to work until all the process is done. This patch modify
the process of the request queue pairs. To improve efficiency and
eliminate code redundancy, the promiscuous ops were also updated.

Fixes: c48eb308ed13 ("net/i40e: support VF request more queues")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
4 years agonet/ice/base: fix GTPU IP hash
Jeff Guo [Thu, 16 Jul 2020 07:30:41 +0000 (15:30 +0800)]
net/ice/base: fix GTPU IP hash

Enable GTPU SESSION flag usage to fix GTPU IP hash issue.

Fixes: 8fb908838516 ("net/ice/base: improve GTPU extend header handle")
Cc: stable@dpdk.org
Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix RSS type
Simei Su [Thu, 16 Jul 2020 03:24:54 +0000 (11:24 +0800)]
net/ice: fix RSS type

When a RSS rule with only SRC/DST_ONLY or IPV6 prefix RSS type,
it should return failure. Besides, when a RSS rule with symmetric
hash function, the RSS type shouldn't carry with SRC/DST_ONLY.
This patch adds invalid RSS type check for the two cases.

Fixes: 0b952714e9c1 ("net/ice: refactor PF hash flow")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ice: fix tunnel type get
Wei Zhao [Thu, 16 Jul 2020 01:42:12 +0000 (09:42 +0800)]
net/ice: fix tunnel type get

When function ice_get_tun_type_for_recipe() get tunnel type,
for ICE_NON_TUN we need to include gtp-c and some gtp-u ptype
with no payload, as they do not have tunnel packet as paylod.

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

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Nannan Lu <nannan.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/bonding: fix MAC address when one port resets
Wei Hu (Xavier) [Fri, 17 Apr 2020 08:19:18 +0000 (16:19 +0800)]
net/bonding: fix MAC address when one port resets

The current bonding PMD driver call mac_address_slaves_update function
to modify the MAC address of all slaves devices. In
mac_address_slaves_update function, the rte_eth_dev_default_mac_addr_set
API function is called to set the MAC address of the slave devices in
turn in the for loop statement.

When one port reset, calling rte_eth_dev_default_mac_addr_set API fails
because the firmware will not respond to the commands from the driver,
and exit the loop, so other slave devices cannot continue to update the
MAC address.

This patch fixes the issue by avoid exiting the loop when calling
rte_eth_dev_default_mac_addr_set fails.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Xuan Li <lixuan47@hisilicon.com>
4 years agonet/bonding: fix MAC address when switching active port
Wei Hu (Xavier) [Fri, 17 Apr 2020 08:19:17 +0000 (16:19 +0800)]
net/bonding: fix MAC address when switching active port

Currently, based on a active-backup bond device, when the link status of
the primary port changes from up to down, one slave port changes to the
primary port, but the new primary port's MAC address cannot change to
the bond device's MAC address. And we can't continue receive packets
whose destination MAC addresses are the same as the bond devices's MAC
address.

The current bonding PMD driver call mac_address_slaves_update function
to modify the MAC address of all slaves devices: the primary port using
bond device's MAC address, and other slaves devices using the respective
MAC address. We found that one error using primary_port instead of
current_primary_port in mac_address_slaves_update function.

On the other hand, The current bonding PMD driver sets slave devices's
MAC address according to the variable named current_primary_port. The
variable named current_primary_port changes in the following scenario:
1. Add the slave devices to bond, the first slave port will be regarded
   as the current_primary_port. If changing the order of adding the
   slave devices, the value of the variable named current_primary_port
   will be different.
2. The upper application specifies primary_port via calling the
   rte_eth_bond_primary_set API function.
3. Delete the primary slave device.
4. The link status of the primary port changes from up to down.

We have tested the above 4 cases and found that there are problems that
the new primary port's MAC address didn't change to the bond device's
MAC address when running case 3 and 4. When current_primary_port
changes, the new primary port's MAC address should change at the same
time. We also need to call mac_address_slaves_update function to update
MAC addresses in case
3 and 4.

Bugzilla ID: 256
Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/bnxt: fix crash during Tx
Ajit Khaparde [Mon, 13 Jul 2020 05:17:59 +0000 (10:47 +0530)]
net/bnxt: fix crash during Tx

When TRUFLOW is not enabled ulp_ctx is not allocated.
In non-vector Tx datapath we are accessing this invalid pointer
resulting in a segfault. Check if TRUFLOW is enabled before
accessing ulp_ctx to avoid this.

Fixes: 1e46b3962620 ("net/bnxt: fill cfa action in Tx descriptor")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
4 years agonet/af_packet: fix munmap on init failure
Yunjian Wang [Mon, 6 Jul 2020 12:28:02 +0000 (20:28 +0800)]
net/af_packet: fix munmap on init failure

Add a missing available check and fix the wrong address passed
to munmap on init failure.

Fixes: dd6590fe2fd7 ("af_packet: fix possible memory leak")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/af_packet: fix memory leak on init failure
Yunjian Wang [Mon, 6 Jul 2020 12:27:51 +0000 (20:27 +0800)]
net/af_packet: fix memory leak on init failure

Add missing code to free memory when the device initialization fails.

Fixes: ccd37d341e8d ("net/af_packet: remove queue number limitation")
Fixes: 5f19dee604ed ("drivers/net: do not use private ethdev data")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/af_packet: fix check of file descriptors
Yunjian Wang [Mon, 6 Jul 2020 12:27:32 +0000 (20:27 +0800)]
net/af_packet: fix check of file descriptors

Zero is a valid fd. It will fail to check the fd if the fd is zero.

Fixes: 527740ccfaec ("af_packet: fix some leaks")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/bonding: fix error code on device creation
Wei Hu (Xavier) [Tue, 14 Jul 2020 08:19:43 +0000 (16:19 +0800)]
net/bonding: fix error code on device creation

Because the return value of rte_vdev_init() has multiple non-zero
values, when rte_vdev_init() return non-zero in the
rte_eth_bond_create() function, it should return the actual error code
rather than -ENOMEM.

Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free")
Cc: stable@dpdk.org
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agoapp/testpmd: fix output format in flow query
Chenxu Di [Tue, 14 Jul 2020 01:37:21 +0000 (01:37 +0000)]
app/testpmd: fix output format in flow query

This patch fix the error line break in the output format of flow query

Fixes: bdb1d61690f7 ("app/testpmd: support RSS config in flow query")

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/hns3: fix RSS configuration on empty RSS type
Lijun Ou [Tue, 14 Jul 2020 06:16:09 +0000 (14:16 +0800)]
net/hns3: fix RSS configuration on empty RSS type

According to the definition of RSS types of action attributes from
testpmd, the driver will not disable RSS but instead requests the
unspecified "best-effort" settings when upper application call
rte_flow_create API function to create flow using empty RSS types.

As a result, here use the default RSS types when RSS types is empty.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: support keeping CRC
Min Hu (Connor) [Tue, 14 Jul 2020 06:16:08 +0000 (14:16 +0800)]
net/hns3: support keeping CRC

CRC is the end of frame, which occupies 4 bytes. Keeping CRC is a
feature of MAC, which will not strip CRC field when receiving frames.
The feature can be enabled using DEV_RX_OFFLOAD_KEEP_CRC offload by
upper level application. And the feature is only supported for hns3 PF
PMD driver, not supported for hns3 VF PMD driver

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: support 200G speed rate
Wei Hu (Xavier) [Tue, 14 Jul 2020 06:16:07 +0000 (14:16 +0800)]
net/hns3: support 200G speed rate

The 200G device has a new device id 0xA228, so adds this device id
to pci table for pci driver can probe it. Similar to the network port
with other speed, the hns3 PMD driver gets 200G speed information
from firmware, and passes them to DPDK framework.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/hns3: support copper media type
Wei Hu (Xavier) [Tue, 14 Jul 2020 06:16:06 +0000 (14:16 +0800)]
net/hns3: support copper media type

The hns3 network engine is built-in multiple SoCs, such as kunpeng 920,
kunpeng 930, etc. The PCI revision id is 0x21 in kunpeng 920, and the
PCI revision id is 0x30 in kunpeng 930.

Copper media type is supported for hns3 PF device in kunpeng 930 and
later SoCs. The configuration operation for PHY is implemented by
firmware.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
4 years agonet/ice/base: fix RSS removal for GTP-U
Junfeng Guo [Mon, 13 Jul 2020 11:05:40 +0000 (19:05 +0800)]
net/ice/base: fix RSS removal for GTP-U

Previous logic in removing RSS for GTPU was added in incorrect lines.
The adjustment in this patch will correct the code order so that RSS
for GTPU can be removed successfully.

We also delete the redundant print statement and cleanup the coding
style in this patch.

Fixes: bed9bb3139ef ("net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agodoc: update QAT driver version for D15xx
Adam Dybkowski [Thu, 16 Jul 2020 11:40:44 +0000 (13:40 +0200)]
doc: update QAT driver version for D15xx

This patch updates the minimum driver version that supports
Intel QuickAssist device D15xx.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocrypto/qat: fix ambiguous variable names for CRC
David Coyle [Thu, 16 Jul 2020 15:34:36 +0000 (16:34 +0100)]
crypto/qat: fix ambiguous variable names for CRC

The variable names crc_length and crc_offset have been changed to
crc_data_len and crc_data_ofs respectively, to make it clearer as to
their use i.e. the length and offset of the data over which the CRC is
calculated.

Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocrypto/qat: check multi-segment buffers for DOCSIS
David Coyle [Thu, 16 Jul 2020 15:33:31 +0000 (16:33 +0100)]
crypto/qat: check multi-segment buffers for DOCSIS

Multi-segment mbufs are not supported for DOCSIS security protocol.
This patch adds an explicit check for this and returns an op error if
this case is found. This limitation is also added to the QAT cryptodev
documentation.

Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocrypto/aesni_mb: fix memory leak in DOCSIS session
David Coyle [Thu, 16 Jul 2020 15:32:18 +0000 (16:32 +0100)]
crypto/aesni_mb: fix memory leak in DOCSIS session

This patch improves the DOCSIS session creation as follows:
- it validates the security action type as well as the protocol before
  creating a session and now does this validation before allocating the
  session from the mempool

Fixes: fda5216fba55 ("crypto/aesni_mb: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
4 years agocrypto/qat: improve DOCSIS session creation
David Coyle [Thu, 16 Jul 2020 15:32:17 +0000 (16:32 +0100)]
crypto/qat: improve DOCSIS session creation

This patch improves the DOCSIS session creation as follows:
- it validates the security action type as well as the protocol before
  creating a session and now does this validation before allocating the
  session from the mempool
- it clears the entire private session struct before populating it with
  DOCSIS session info, in case any data was left over from the last time
  it was used
- it simplifies the DOCSIS parameter setting, which was overly
  complicated

Fixes: 6f0ef237404b ("crypto/qat: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agoapp/crypto-perf: enable feature flag for security
David Coyle [Thu, 16 Jul 2020 15:29:52 +0000 (16:29 +0100)]
app/crypto-perf: enable feature flag for security

The RTE_CRYPTODEV_FF_SECURITY feature was disabled through the
ff_disable device configuration option for all crypto performance tests,
including security related tests. This patch updates the crypto
performance tool to not disable RTE_CRYPTODEV_FF_SECURITY for DOCSIS and
PDCP security tests.

Fixes: d4a131a9498d ("test/crypto-perf: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agotest/crypto: enable feature flag for security
David Coyle [Thu, 16 Jul 2020 15:29:51 +0000 (16:29 +0100)]
test/crypto: enable feature flag for security

The RTE_CRYPTODEV_FF_SECURITY feature was disabled through the
ff_disable device configuration option for all cryptodev tests,
including security related tests. This patch updates the cryptodev unit
tests to not disable RTE_CRYPTODEV_FF_SECURITY for DOCSIS and PDCP
security tests.

Fixes: ea31f2b4f547 ("test/crypto: add DOCSIS security cases")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agotest/crypto: fix AESNI-MB CPU tests
David Coyle [Thu, 16 Jul 2020 15:28:31 +0000 (16:28 +0100)]
test/crypto: fix AESNI-MB CPU tests

The AESNI-MB CPU test cases, which are executed via the
cryptodev_cpu_aesni_mb_autotest command, aborted when it tried to run
the DOCSIS security tests as these are not CPU type tests. The abort
happened at the following line in process_crypto_request():

RTE_VERIFY(gbl_action_type != RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO);

The tests have been updated not to run the DOCSIS (or PDCP) security
tests during cryptodev_cpu_aesni_mb_autotest, with the decision based on
improved PMD security capability checks.

Fixes: ea31f2b4f547 ("test/crypto: add DOCSIS security cases")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
4 years agocrypto/octeontx2: support security session data path
Vamsi Attunuru [Thu, 16 Jul 2020 08:39:31 +0000 (14:09 +0530)]
crypto/octeontx2: support security session data path

This patch adds lookaside IPsec enqueue and dequeue routines.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: support security session create
Vamsi Attunuru [Thu, 16 Jul 2020 08:39:30 +0000 (14:09 +0530)]
crypto/octeontx2: support security session create

This patch creates session for lookaside IPsec.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: add security misc callbacks
Vamsi Attunuru [Thu, 16 Jul 2020 08:39:29 +0000 (14:09 +0530)]
crypto/octeontx2: add security misc callbacks

This patch adds lookaside IPsec callback functions.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: add security capabilities
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:28 +0000 (14:09 +0530)]
crypto/octeontx2: add security capabilities

This patch adds lookaside IPsec capabilities for
rte_security

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: register security operations
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:27 +0000 (14:09 +0530)]
crypto/octeontx2: register security operations

This patch registers security operations with cryptodev.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: add lookaside SA context definitions
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:26 +0000 (14:09 +0530)]
crypto/octeontx2: add lookaside SA context definitions

This patch adds lookaside IPsec SA context definitions.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agonet/octeontx2: move security session struct to crypto PMD
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:25 +0000 (14:09 +0530)]
net/octeontx2: move security session struct to crypto PMD

This patch moves otx2_sec_session structure to otx2_security.h
to make it common for inline and lookaside protocol modes of
rte_security

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx2: move capabilities init into probe
Tejasree Kondoj [Thu, 16 Jul 2020 08:39:24 +0000 (14:09 +0530)]
crypto/octeontx2: move capabilities init into probe

This patch moves capabilities initialization into probe.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocompress/qat: revert change in GEN3 marketing name
Adam Dybkowski [Mon, 13 Jul 2020 11:25:17 +0000 (13:25 +0200)]
compress/qat: revert change in GEN3 marketing name

The patch reverts the commit that updated Intel QuickAssist GEN3
marketing name. The change was not backported and has to be withdrawn.

This reverts commit 9cd9d3e702fba4700539c1a2eddac13dd14ecf70

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocompress/qat: fix lacking memzone lookup
Arek Kusztal [Wed, 8 Jul 2020 09:44:01 +0000 (11:44 +0200)]
compress/qat: fix lacking memzone lookup

Because capability memzone of compression does not have lookup
call, second and subsequent devices cannot be created.

Fixes: 7788dceccb80 ("common/qat: add multi-process handling of capabilities")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
4 years agoexamples/fips_validation: fix count overwrite for TDES
Archana Muniganti [Thu, 11 Jun 2020 13:44:17 +0000 (19:14 +0530)]
examples/fips_validation: fix count overwrite for TDES

Application updates first line of each test vector with
COUNT = i(where i = 1,2,3..) assuming first line contains
COUNT string. But few of the TDES input test vectors don't
contain COUNT string and thus COUNT is getting overwritten on
other data.

Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
4 years agoexamples/fips_validation: fix parsing of TDES vectors
Ayuj Verma [Thu, 11 Jun 2020 13:44:16 +0000 (19:14 +0530)]
examples/fips_validation: fix parsing of TDES vectors

Processing of test vector for COUNT = 0 is getting skipped, as
some of the NIST TDES files doesn't have an empty line after
[ENCRYPT]/[DECRYPT] and thus treated as an interim block.

Parse function now identifies such blocks, separates out interim
and test vector data, and then parses each with their respective
callbacks.

Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Ayuj Verma <ayverma@marvell.com>