dpdk.git
3 years agonet/bnxt: add separate mutex for FW health check
Somnath Kotur [Fri, 11 Sep 2020 01:56:03 +0000 (18:56 -0700)]
net/bnxt: add separate mutex for FW health check

def_cp_lock was added to sync race between dev_configure and
int_handler. It should not be used to synchronize scheduling of FW
health check between dev_start and async event handler as well,
use a separate mutex for the same.

Fixes: a73b8e939f10 ("net/bnxt: fix race between start and interrupt handler")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix checking VNIC in shutdown path
Somnath Kotur [Fri, 11 Sep 2020 01:56:02 +0000 (18:56 -0700)]
net/bnxt: fix checking VNIC in shutdown path

Add a couple of NULL pointer checks in bnxt_free_all_filters()
and bnxt_free_vnics() respectively to guard against certain error
injection/recovery scenarios where it was found that the application
was crashing with the bp->vnic_info pointer being NULL.

Fixes: 51fafb89a9a0 ("net/bnxt: get rid of ff pools and use VNIC info array")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: add locks in flow database
Kishore Padmanabha [Fri, 11 Sep 2020 01:56:01 +0000 (18:56 -0700)]
net/bnxt: add locks in flow database

Added support for mutex protection for the flow database to prevent
simultaneous access to flow database and protect flow creation and
deletion.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix representor data path
Somnath Kotur [Fri, 11 Sep 2020 01:56:00 +0000 (18:56 -0700)]
net/bnxt: fix representor data path

1.Representor Rx ring producer index was not getting reset in
the ring full case. Fix it by incrementing only in
success case.
2.Instead of calling the mbuf specific routine to free the mbuf when
representor ring is full rte_free was being called leading to
'invalid memory' errors being logged.
3. Do not account the pkt meant for the representor in the parent
Rx ring's array that is returned to the application.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: provide switch info if VFR are configured
Sriharsha Basavapatna [Fri, 11 Sep 2020 01:55:59 +0000 (18:55 -0700)]
net/bnxt: provide switch info if VFR are configured

Some applications need switch_info of the device to be returned
as a part of eth_dev_info_get(). The offload logic in such
applications could use this info. Pass this info to the when VF
representors are configured.

Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")
Cc: stable@dpdk.org
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix out of bound access in bit handling
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:58 +0000 (18:55 -0700)]
net/bnxt: fix out of bound access in bit handling

Fix out of bounds access in action bit handling.
The act_val is changed to be array to resolve out of bound access issue.

Fixes: 52799debdf1c ("net/bnxt: support action bitmap opcode")
Cc: stable@dpdk.org
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: enable NAT action with tagged traffic
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:57 +0000 (18:55 -0700)]
net/bnxt: enable NAT action with tagged traffic

Added support for performing L3 or L4 rewrite for VLAN tagged
flows. The outer most DMAC, SMAC and VLAN are used to overwrite
when NAT operations are performed.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: enable VXLAN IPv6 encapsulation
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:56 +0000 (18:55 -0700)]
net/bnxt: enable VXLAN IPv6 encapsulation

Add code to support vxlan ipv6 tunnel encapsulation. The
ipv6 flow traffic class and flow label wild card match
can be ignored to support offload on some applications.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: check and set initial counter ID
Somnath Kotur [Fri, 11 Sep 2020 01:55:55 +0000 (18:55 -0700)]
net/bnxt: check and set initial counter ID

Instead of relying on value of Flow counter ID to determine validity
have an explicit boolean flag for the same to check and set.

Fixes: 306c2d28e247 ("net/bnxt: support count action in flow query")
Fixes: 9cf9c8385df7 ("net/bnxt: add ULP flow counter manager")
Cc: stable@dpdk.org
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: increase counter support from 8K to 16K
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:54 +0000 (18:55 -0700)]
net/bnxt: increase counter support from 8K to 16K

The number of internal stats counter is increased to 16k
in both egress and ingress direction.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: remove VLAN pop action for egress flows
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:53 +0000 (18:55 -0700)]
net/bnxt: remove VLAN pop action for egress flows

Whitney platform does not support VLAN pop action in the egress
direction. Hence the VLAN pop action is removed from the egress
action templates.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: use direct HWRM message for interface table
Randy Schacher [Fri, 11 Sep 2020 01:55:52 +0000 (18:55 -0700)]
net/bnxt: use direct HWRM message for interface table

Change interface tables to use direct or non-tunneled HWRM messaging
instead of tunneled messaging. Update HWRM API to a new version to
allow this change.

Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: update resource settings
Shahaji Bhosle [Fri, 11 Sep 2020 01:55:51 +0000 (18:55 -0700)]
net/bnxt: update resource settings

Update default resource configuration.
Resources include ENCAP records, TCAM, wild card, source property
functions and such.

Signed-off-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix VFR cleanup during init failure
Somnath Kotur [Fri, 11 Sep 2020 01:55:50 +0000 (18:55 -0700)]
net/bnxt: fix VFR cleanup during init failure

If VF-rep port add fails for some reason, code was rolling back
all ports added so far. With some applications, there is no need
to do that. Just log failure message for the VF rep port add and
continue.
Also include RTE_MAX_ETH_PORTS value in the bounds check as one port
will be taken by the uplink port anyway

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org
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: fix crash in VFR queue select
Somnath Kotur [Fri, 11 Sep 2020 01:55:49 +0000 (18:55 -0700)]
net/bnxt: fix crash in VFR queue select

Instead of bounds checking against max possible rings while selecting
queue index for the VF representor, do it against the number of rings
configured.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
3 years agonet/bnxt: refactor VFR port clean up
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:48 +0000 (18:55 -0700)]
net/bnxt: refactor VFR port clean up

When parent VF or PF ports are cleaned up, the child VF representor
ports also need to be cleaned up. If not cleaned up, then deleting
the parent VF shall result in not cleaning up the hardware rules and
updating the firmware of VFR removal. The issue can occur even when
application is exited without deleting VFR ports.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix function id used in flow flush
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:47 +0000 (18:55 -0700)]
net/bnxt: fix function id used in flow flush

The function id being used in the flush is incorrect, fixed the
flush of the flows.

Fixes: 74bcfc062489 ("net/bnxt: add session and function flow flush")
Cc: stable@dpdk.org
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: modify default flow rule creation
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:46 +0000 (18:55 -0700)]
net/bnxt: modify default flow rule creation

Change default flow rule to use 8-byte encap.
The VFR conduit uses VLAN encap to send packets. So the encap record
is changed from 16B to 8B. That frees up 8B of encap records.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: add null check for resource manager
Shahaji Bhosle [Fri, 11 Sep 2020 01:55:45 +0000 (18:55 -0700)]
net/bnxt: add null check for resource manager

Verify the resource manager has been allocated prior to using it.
This can avoid potential segmentation faults.

Signed-off-by: Shahaji Bhosle <sbhosle@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: free EM index on failure
Mike Baucom [Fri, 11 Sep 2020 01:55:44 +0000 (18:55 -0700)]
net/bnxt: free EM index on failure

When a Exact Match entry fails insertion, the allocated index needs to
be pushed back to the allocation stack. This patch takes care of that.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix coexistence of IPv4 and IPv6 ingress rules
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:43 +0000 (18:55 -0700)]
net/bnxt: fix coexistence of IPv4 and IPv6 ingress rules

The ingress rule to match on ipv4 and ipv6 is now two rules to
make sure both rules can coexist at the same time. Added count
action only for ingress flows.

Fixes: fe82f3e02701 ("net/bnxt: support exact match templates")
Cc: stable@dpdk.org
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: reduce debug log messages
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:42 +0000 (18:55 -0700)]
net/bnxt: reduce debug log messages

Removed the mark id log message since it is in the data path.
Also optimized the link status debug message.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: reject flow offload with invalid MAC
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:41 +0000 (18:55 -0700)]
net/bnxt: reject flow offload with invalid MAC

Reject offload flows that have broadcast or multicast
Ethernet addresses.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix flow drop action to support count
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:40 +0000 (18:55 -0700)]
net/bnxt: fix flow drop action to support count

Changed the action template to support count action in addition
to a flow that does drop action.

Fixes: fe82f3e02701 ("net/bnxt: support exact match templates")
Cc: stable@dpdk.org
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
3 years agonet/bnxt: fix port stop process and cleanup resources
Kishore Padmanabha [Fri, 11 Sep 2020 01:55:39 +0000 (18:55 -0700)]
net/bnxt: fix port stop process and cleanup resources

The port deinitialization now cleans up all the resources
properly. If all the ports are stopped then ULP context is
freed.
Added fix to update the correct tfp pointer in the ULP context
with the changes to support multi control channels.

Fixes: 70e64b27af5b ("net/bnxt: support ULP session manager cleanup")
Cc: stable@dpdk.org
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
3 years agobus/dpaa: fix fd check before close
Yunjian Wang [Tue, 15 Sep 2020 11:57:40 +0000 (19:57 +0800)]
bus/dpaa: fix fd check before close

The fd is possibly a negative value while it is passed as an
argument to function "close". Fix the check to the fd.

Fixes: b9c94167904f ("bus/dpaa: decouple FQ portal alloc and init")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agonet/ice: fix ptype parsing
Ting Xu [Wed, 16 Sep 2020 03:02:28 +0000 (11:02 +0800)]
net/ice: fix ptype parsing

The ptype mask for flexible descriptor in Rx function ice_recv_pkts_vec
has a reversed order, which leads to an incorrect value of the final
ptype. This patch fix the mask to parse the correct ptype of RX packets.

Fixes: c68a52b8b38c ("net/ice: support vector SSE in Rx")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: fix recreating flexible flow director rule
Guinan Sun [Tue, 15 Sep 2020 06:52:25 +0000 (06:52 +0000)]
net/i40e: fix recreating flexible flow director rule

This patch fixes the failure of recreate flexible fdir rule.
The root cause is that the flex_mask_flag is not reset during
flow destroy and flow flush.

Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR")
Cc: stable@dpdk.org
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: remove devargs for flow mark
Guinan Sun [Wed, 16 Sep 2020 03:10:02 +0000 (03:10 +0000)]
net/ice: remove devargs for flow mark

Currently, all data paths already support flow mark, so remove devargs
"flow-mark-support". FDIR matched ID will display in verbose
when packets match the created rule.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
3 years agonet/ice: support flow mark in SSE path
Guinan Sun [Wed, 16 Sep 2020 03:10:01 +0000 (03:10 +0000)]
net/ice: support flow mark in SSE path

Support flow director mark ID parsing from flexible
Rx descriptor in SSE path.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
3 years agonet/ice: support flow mark in AVX path
Guinan Sun [Wed, 16 Sep 2020 03:10:00 +0000 (03:10 +0000)]
net/ice: support flow mark in AVX path

Support flow director mark ID parsing from flexible
Rx descriptor in AVX path.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
3 years agonet/ice: add flow director enabled switch
Guinan Sun [Wed, 16 Sep 2020 03:09:59 +0000 (03:09 +0000)]
net/ice: add flow director enabled switch

The patch adds fdir_enabled flag to identify if parse flow director mark
ID from flexible Rx descriptor.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
3 years agonet/ice: support flex Rx descriptor RxDID22
Junyu Jiang [Wed, 16 Sep 2020 03:09:58 +0000 (03:09 +0000)]
net/ice: support flex Rx descriptor RxDID22

This patch supports RxDID #22 by the following changes:
- add structure and macro definition for RxDID #22.
- support RxDID #22 format in normal path.
- change RSS hash parsing from RxDID #22 in AVX/SSE data path.

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
3 years agonet/mlx5: fix hairpin dependency on destination DevX TIR
Michael Baum [Sun, 13 Sep 2020 19:05:22 +0000 (19:05 +0000)]
net/mlx5: fix hairpin dependency on destination DevX TIR

The PMD supports hairpin only if DevX is supported and DV flow is
enabled.

When destination DevX TIR is not supported, the PMD tries to create TIR
action, and fails.

Avoid supporting hairpin when destination DevX TIR is not supported.

Fixes: b6b3bf86bd1a ("net/mlx5: get hairpin capabilities")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix Rx objects creator selection
Michael Baum [Sun, 13 Sep 2020 19:05:21 +0000 (19:05 +0000)]
net/mlx5: fix Rx objects creator selection

There are 2 creators for Rx objects, DevX and Verbs.
There are supported DR versions when a DevX destination TIR flow action
creation cannot be supported, using this versions the TIR object should
be created by Verbs, what forces all the Rx objects to be created by
Verbs.

The selection of the Rx objects creator, wrongly, didn't take into
account the destination TIR action support what caused a failure in the
Rx flows creation.

Select Verbs creator when destination TIR action creation is not
supported by the DR version.

Fixes: 6deb19e1b2d2 ("net/mlx5: separate Rx queue object creations")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/hns3: fix queue offload capability
Wei Hu (Xavier) [Tue, 8 Sep 2020 12:28:07 +0000 (20:28 +0800)]
net/hns3: fix queue offload capability

Currently, offload capabilities are only enabled for all Rx/Tx queues in
hns3 PF/VF PMD driver, and offload capability only applied in a Rx/Tx
queue is not supported.
So this patch moves 'DEV_TX_OFFLOAD_MBUF_FAST_FREE' from
tx_queue_offload_capa to tx_offload_capa.

Fixes: 1f5ca0b460cd ("net/hns3: support some device operations")
Fixes: a5475d61fa34 ("net/hns3: support VF")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
3 years agoapp/testpmd: fix name of bitrate library in meson build
Bruce Richardson [Wed, 2 Sep 2020 16:24:27 +0000 (17:24 +0100)]
app/testpmd: fix name of bitrate library in meson build

The bitrate library in DPDK is actually in a "bitratestats" directory,
so that is used by meson for the macro and library name.
Therefore, we need to update references to RTE_LIBRTE_BITRATE to
RTE_LIBRTE_BITRATESTATS in testpmd to have it found. Rather than
supporting both defines, since make is being removed, we can just
replace all instances of the former define with the latter.

To ensure testpmd links ok when this is done, we also need to add
bitratestats to the list of library dependencies.

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/nfp: expand device info get
Heinrich Kuhn [Wed, 2 Sep 2020 11:52:27 +0000 (13:52 +0200)]
net/nfp: expand device info get

Report Rx and Tx descriptor related limitations in the nfp dev_info_get
callback function. This commit also adds NFP_ALIGN_RING_DESC to replace
a static integer value used during rx/tx queue setups to validate
descriptor alignment.

Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
3 years agocommon/mlx5: fix aligned malloc
Ophir Munk [Wed, 9 Sep 2020 08:43:17 +0000 (08:43 +0000)]
common/mlx5: fix aligned malloc

Before this commit system call memalign was used for aligned
allocations, however memalign is deprecated.

Based on (1) - POSIX requires that memory aligned allocations can be
freed using free. Some systems provide no way to reclaim memory
allocated with memalign (because one can only pass to free a pointer
gotten from malloc, while, memalign would call malloc and then align the
obtained value).
Another issue is that 64/32 bits architectures use a minimal alignment
size. So any requested alignment below the minimal system size can be
simplified by calling malloc.

The glibc implementation allows memory obtained from posix_memalign to
be reclaimed with free.  This commit replaces system call memalign with
system call posix_memalign. It also calls malloc in case the requested
alignment is below the minimal system size.

(1) https://linux.die.net/man/3/memalign

Fixes: d38e3d526657 ("common/mlx5: add memory management functions")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@mellanox.com>
3 years agonet/mlx5: fix RSS RETA reset on start
Maxime Leroy [Thu, 16 Jul 2020 10:43:20 +0000 (12:43 +0200)]
net/mlx5: fix RSS RETA reset on start

The following sequences was working fine on mlx5:
   rte_eth_dev_configure(portid, ...);

   for (queueid = 0; queueid < nb_txq; queueid++)
      rte_eth_tx_queue_setup(portid, queueid, ...);

   for (queueid = 0; queueid < nb_rxq; queueid++)
      rte_eth_rx_queue_setup(portid, queueid, ...);

  // use a custom reta configuration
  rte_eth_dev_rss_reta_update(portid, reta_conf, reta_size);
  rte_eth_dev_start(portid);

We were able to configure a custom reta before starting the port.

The commit "net/mlx5: support RSS on hairpin" breaks this logic by
moving the code initializing the RSS reta from rte_eth_dev_configure
into rte_eth_dev_start.

To fix the issue, the skip_default_rss_reta is always set to 1 in
rte_eth_dev_rss_reta to avoid reconfigure the rss reta when the device
is started.

Fixes: 63bd16292c3a ("net/mlx5: support RSS on hairpin")
Cc: stable@dpdk.org
Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agonet/iavf: support RSS for IPv6 64-bit prefix
Junfeng Guo [Tue, 15 Sep 2020 08:17:59 +0000 (16:17 +0800)]
net/iavf: support RSS for IPv6 64-bit prefix

RSS for IPv6 prefix 64bit fields are supported in this patch, so that
we can use prefix instead of full IPv6 address for RSS. The prefix
here only includes the first 64 bits of both SRC and DST IPv6 address.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: replace function name with macro
Junfeng Guo [Tue, 15 Sep 2020 08:17:58 +0000 (16:17 +0800)]
net/iavf: replace function name with macro

Replace some function name with macro to shrink coding characters.
VIRTCHNL_DEL_PROTO_HDR_FIELD, VIRTCHNL_ADD_PROTO_HDR_FIELD
--> REFINE_PROTO_FLD.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: merge inner/outer seg info for flow director
Zhirun Yan [Mon, 14 Sep 2020 03:05:30 +0000 (11:05 +0800)]
net/ice: merge inner/outer seg info for flow director

For tunnel and non-tunnel packets, it can share the same seg_tun info.
seg_tun[1] can be used for supporting inner fields with tunnel flow rule
or for non-tunnel packets, seg_tun[0] only used for tunnel outer part.
Add outer_input_set to distinguish inner/outer input set. So we can
identify different fields in outer or inner part.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: refactor flow director set config
Zhirun Yan [Mon, 14 Sep 2020 03:05:29 +0000 (11:05 +0800)]
net/ice: refactor flow director set config

The original set conf function in FDIR was very long. Refactor to
increase readability to make it clearer and allow for more convenient
further changes.

No functional change here.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: support outer IP hash for no inner GTPU
Alvin Zhang [Tue, 15 Sep 2020 02:43:44 +0000 (10:43 +0800)]
net/iavf: support outer IP hash for no inner GTPU

Outer IP hash can be configured as input sets for no inner GTPU packets.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agoapp/flow-perf: allow fixed values for actions
Wisam Jaddo [Sun, 30 Aug 2020 11:15:44 +0000 (11:15 +0000)]
app/flow-perf: allow fixed values for actions

Sometime the user want to have fixed values of
encap/decap or header modify for all flows.

This will introduce the ability to choose from
fixed or dynamic values by setting the flag in
config.h

To use different value for each flow:
config.h: #define FIXED_VALUES 0

To use single value for all flows:
config.h: #define FIXED_VALUES 1

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: support ICMP matching
Wisam Jaddo [Sun, 30 Aug 2020 11:15:43 +0000 (11:15 +0000)]
app/flow-perf: support ICMP matching

Start support matching on icmpv4 and icmpv6.

Usage:
--icmpv4: add icmp item to match on.
--icmpv6: add icmpv6 item to match on.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: add port mask option
Wisam Jaddo [Sun, 30 Aug 2020 11:15:42 +0000 (11:15 +0000)]
app/flow-perf: add port mask option

Sometimes you need to check flow performance for
certain port and not all ports. Thus a portmask
option is needed.

Usage:
--portmask=N

Where N represent the hexadecimal bitmask of ports
used.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: add random mark values
Wisam Jaddo [Sun, 30 Aug 2020 11:15:41 +0000 (11:15 +0000)]
app/flow-perf: add random mark values

Instead of having single id value, use up to 256
values, thus we make sure that all flows will not
use same mark action.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: fix IPv4 source matching
Wisam Jaddo [Sun, 30 Aug 2020 11:15:40 +0000 (11:15 +0000)]
app/flow-perf: fix IPv4 source matching

All value must be converted into intended endianness.

Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")
Cc: stable@dpdk.org
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: support VXLAN encap/decap actions
Wisam Jaddo [Sun, 30 Aug 2020 11:15:39 +0000 (11:15 +0000)]
app/flow-perf: support VXLAN encap/decap actions

Introduce vxlan-encap and vxlan-decap actions.

vxlan-encap have fixed pattern and values for
encap data.

Usage example:
--vxlan-encap
--vxlan-decap

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: support raw encap/decap actions
Wisam Jaddo [Sun, 30 Aug 2020 11:15:38 +0000 (11:15 +0000)]
app/flow-perf: support raw encap/decap actions

Introduce raw-encap and raw-decap actions.
The two actions are added in command line
options, and for the data to encap or decap
the user need to parse it within the command
line.

All values of raw-encap data is set to be fixed
values.

Usage example:

--raw-encap=ether,ipv4,udp,vxlan

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: fix memory leak from RSS action
Wisam Jaddo [Sun, 30 Aug 2020 11:15:37 +0000 (11:15 +0000)]
app/flow-perf: fix memory leak from RSS action

Currently, each call for add_rss_action will allocate
extra memory for rss_data, which will reflect bad results
on memory consumption for all flows, and will leads into
memory leak.

In this fix, it will check if it's allocated before
reallocating it.

Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")
Cc: stable@dpdk.org
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: support flag action
Wisam Jaddo [Sun, 30 Aug 2020 11:15:36 +0000 (11:15 +0000)]
app/flow-perf: support flag action

Introduce flag action support to flow perf
application.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: support header modify actions
Wisam Jaddo [Sun, 30 Aug 2020 11:15:35 +0000 (11:15 +0000)]
app/flow-perf: support header modify actions

Introduce headers modify actions in the app.
All header modify actions will add different value
for each flow, to make sure each flow will create
and use it's own actions.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: support user order
Wisam Jaddo [Sun, 30 Aug 2020 11:15:34 +0000 (11:15 +0000)]
app/flow-perf: support user order

The old design was using the bit mask to identify
items, action and attributes.

So it was all based on the order of the code itself,
to place the order of the actions, items & attributes
inside the flows. Such design will lead into many failures
when some PMD support order different than other PMD,
in the end the rules will fail to create. Also sometimes
the user needs to have one action before other actions
and vice versa, so using new design of arrays that
take user order into consideration make more sense.

After this patch, we start supporting inner items
and more than one instance of same action.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agodoc: fix section layout of the flow perf app guide
Wisam Jaddo [Sun, 30 Aug 2020 11:15:33 +0000 (11:15 +0000)]
doc: fix section layout of the flow perf app guide

Currently all the sections are considered as main title under
DPDK Tools User Guides.

This fix will collect all flow perf sections under one title
which is Flow Performance Tool

Fixes: 3344cf2e3001 ("app/flow-perf: add flow performance skeleton")
Cc: stable@dpdk.org
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agoapp/flow-perf: fix actions mask
Wisam Jaddo [Sun, 30 Aug 2020 11:15:32 +0000 (11:15 +0000)]
app/flow-perf: fix actions mask

Actions have it's own macro which is FLOW_ACTION_MASK

Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")
Cc: stable@dpdk.org
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
3 years agonet/axgbe: support IEEE 1588 PTP
Selwin Sebastian [Tue, 9 Jun 2020 15:13:43 +0000 (20:43 +0530)]
net/axgbe: support IEEE 1588 PTP

Add ethdev APIs to support PTP timestamping

Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
Acked-by: Amaranath Somalapuram <asomalap@amd.com>
3 years agonet/cxgbe: fix duplicate MAC addresses in MPS TCAM
Karra Satwik [Fri, 11 Sep 2020 23:47:51 +0000 (05:17 +0530)]
net/cxgbe: fix duplicate MAC addresses in MPS TCAM

During MAC address insertion to MPS TCAM, add a default mask when
the mask is not explicitly specified. Otherwise, driver misses the
mask comparison and ends up inserting duplicate entries in the
MPS TCAM.

Fixes: 6fda3f0ddda9 ("net/cxgbe: add API to program hardware MPS table")
Cc: stable@dpdk.org
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agonet/dpaa: fix port ID type in API
Ferruh Yigit [Tue, 25 Aug 2020 17:51:06 +0000 (18:51 +0100)]
net/dpaa: fix port ID type in API

Updating the type for 'port' variable from 'uint8_t' to 'uint16_t'.

Fixes: 8c3495f5d2dd ("net/dpaa: support loopback API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agonet/pfe: fix misuse of interface index
Sachin Saxena [Mon, 14 Sep 2020 14:22:17 +0000 (19:52 +0530)]
net/pfe: fix misuse of interface index

Pfe pmd has no need to bound host interface
for which we require if_index field.
Setting it to 0 as unused.

Fixes: fe38ad9ba73e ("net/pfe: add device start/stop")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/dpaa2: fix misuse of interface index
Sachin Saxena [Mon, 14 Sep 2020 14:21:18 +0000 (19:51 +0530)]
net/dpaa2: fix misuse of interface index

Dpaa2 pmd has no need to bound host interface
for which we require if_index field.
Setting it to 0 as unused.

Fixes: 3e5a335d3f88 ("net/dpaa2: add basic operations")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodoc: update RSS flow action with best effort
Ori Kam [Mon, 10 Aug 2020 15:08:25 +0000 (15:08 +0000)]
doc: update RSS flow action with best effort

Using the rte_flow action RSS types field,
may result in undefined outcome.

For example selecting both UDP and TCP,
selecting TCP RSS type but the pattern is targeting UDP traffic.
another option is that the PMD doesn't support all requested types.

Until now, it wasn't clear what will happen in such cases.
This commit clarify this issue by stating that the PMD
will work in the best-effort mode, and will fail
in case the requested type is not supported.

Signed-off-by: Ori Kam <orika@nvidia.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
3 years agonet/tap: free mempool when closing
Yunjian Wang [Sat, 8 Aug 2020 09:58:43 +0000 (17:58 +0800)]
net/tap: free mempool when closing

When setup tx queues, we will create a mempool for the 'gso_ctx'.
The mempool is not freed when closing tap device. If free the tap
device and create it with different name, it will create a new
mempool. This maybe cause an OOM.

The snprintf function return value is not checked and the mempool
name may be truncated. This patch also fix it.

Fixes: 050316a88313 ("net/tap: support TSO (TCP Segment Offload)")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agomaintainers: update for igb/igc/ixgbe
Haiyue Wang [Mon, 7 Sep 2020 03:18:57 +0000 (11:18 +0800)]
maintainers: update for igb/igc/ixgbe

Co-work with Jeff, setting me as new maintainer for igb, igc and ixgbe.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet: check first segment length on SW VLAN insertion
Andrew Rybchenko [Wed, 27 May 2020 14:31:41 +0000 (15:31 +0100)]
net: check first segment length on SW VLAN insertion

SW VLAN insertion relies on Ethernet addresses location in contiguous
memory (do not split across mbuf segments). There is no any formal
requirements on data location and mbuf structure which guarantee it.
So, check it explicitly to avoid corrupted packets if the condition
is violated. Typically software VLAN insertion is done on Tx prepare
stage and application will get indication that the packet is invalid
and cannot be transmitted.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/octeontx2: support TM length adjust and packet mode
Nithin Dabilpuram [Wed, 22 Apr 2020 17:21:04 +0000 (22:51 +0530)]
net/octeontx2: support TM length adjust and packet mode

This patch adds support to packet length adjust TM feature
for private shaper. It also adds support to packet mode
feature that applies both to private shaper and node DWRR
scheduling of SP children.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
3 years agoapp/testpmd: add TM command for non-leaf and packet mode
Nithin Dabilpuram [Wed, 22 Apr 2020 17:21:03 +0000 (22:51 +0530)]
app/testpmd: add TM command for non-leaf and packet mode

Add TM command to enable packet mode for all SP children
in non leaf node. This is a new command as
"add tm nonleaf node pktmode".

Also add support to shaper profile add command to take
packet mode parameter used to setup shaper in packet mode.
This adds an extra argument "packet_mode" to shaper profile add command
"add port tm node shaper profile" as last argument.

This patch also dumps new tm port/level/node capabilities
sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported,
shaper_private_packet_mode_supported, shaper_private_byte_mode_supported,
shaper_shared_packet_mode_supported, shaper_shared_byte_mode_supported.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
3 years agodrivers/net: update TM capability
Nithin Dabilpuram [Wed, 22 Apr 2020 17:21:02 +0000 (22:51 +0530)]
drivers/net: update TM capability

Since existing PMD's support shaper byte mode and scheduler
wfq byte mode, update the same in their port/level/node capabilities
that are added. SoftNIC PMD is already upto date with new capabilities.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
3 years agoethdev: support TM for shaper config in packet mode
Nithin Dabilpuram [Wed, 22 Apr 2020 17:21:01 +0000 (22:51 +0530)]
ethdev: support TM for shaper config in packet mode

Some NIC hardware support shaper to work in packet mode i.e
shaping or ratelimiting traffic is in packets per second (PPS) as
opposed to default bytes per second (BPS). Hence this patch
adds support to configure shared or private shaper in packet mode,
provide rate in PPS and add related tm capabilities in port/level/node
capability structures.

This patch also updates tm port/level/node capability structures with
exiting features of scheduler wfq packet mode, scheduler wfq byte mode
and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agonet/iavf: support outer IP hash for GTPC
Alvin Zhang [Mon, 14 Sep 2020 09:12:08 +0000 (17:12 +0800)]
net/iavf: support outer IP hash for GTPC

Add patterns and headers for GTPC, now outer IP hash can be configured
as input sets for GTPC packets.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e/base: update version
Guinan Sun [Sat, 12 Sep 2020 03:00:39 +0000 (03:00 +0000)]
net/i40e/base: update version

Update base code version in readme.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e/base: fix PHY config param when enabling EEE
Guinan Sun [Sat, 12 Sep 2020 03:00:38 +0000 (03:00 +0000)]
net/i40e/base: fix PHY config param when enabling EEE

The i40e_enable_eee function did not copy phy_type_ext field
from current PHY configuration retrieved with Get PHY Abilities AQ.
It caused a misconfiguration of the PHY on devices supporting 2.5
and 5G speeds and prevented establishing link when only those
speeds were selected for advertisement.

Fixes: c61bcb0fe1b0 ("net/i40e/base: support Energy Efficient Ethernet")
Cc: stable@dpdk.org
Signed-off-by: Galazka Krzysztof <krzysztof.galazka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e/base: add EEE LPI status check for X722
Guinan Sun [Sat, 12 Sep 2020 03:00:37 +0000 (03:00 +0000)]
net/i40e/base: add EEE LPI status check for X722

Add reading LPI (low power idle) status for supported X722 devices.
If adapter's PHY supports EEE in current mode (device ID + link speed),
LPI status is read from PHY Clause 45 PCS status register.

Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e/base: fix Rx only for unicast promisc on VLAN
Guinan Sun [Sat, 12 Sep 2020 03:00:36 +0000 (03:00 +0000)]
net/i40e/base: fix Rx only for unicast promisc on VLAN

Set promiscuous mode to rx traffic only if VSI has VLANs configured.
Rename misleading PROMISC_TX bit to proper name.
Added I40E_AQC_SET_VSI_PROMISC_RX_ONLY during VSI unicast promiscuous
mode configuration with port VLAN.
Aligned unicast promiscuous with VLAN to the one without VLAN.
Previously other VFs could listen to unicast tx traffic of other VFs.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e/base: support minimum rollback revision
Guinan Sun [Sat, 12 Sep 2020 03:00:35 +0000 (03:00 +0000)]
net/i40e/base: support minimum rollback revision

Add support for minimum rollback revision.

Signed-off-by: Przemyslaw Ciesielski <przemyslaw.ciesielski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e/base: fix function header arguments
Guinan Sun [Sat, 12 Sep 2020 03:00:34 +0000 (03:00 +0000)]
net/i40e/base: fix function header arguments

Fix them by adding the argument descriptions.

Fixes: 0d9d27bb8684 ("i40e/base: prepare local LLDP MIB in TLV")
Cc: stable@dpdk.org
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e/base: update FW API version
Guinan Sun [Sat, 12 Sep 2020 03:00:33 +0000 (03:00 +0000)]
net/i40e/base: update FW API version

Update FW increment API version for:
-NVM FW Lockdown Feature for legacy devices
-Security Version Opt-In

Signed-off-by: Jacek Naczyk <jacek.naczyk@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice/base: preserve default aggregator VSI information
Qi Zhang [Mon, 7 Sep 2020 11:15:34 +0000 (19:15 +0800)]
net/ice/base: preserve default aggregator VSI information

Added the change to keep the default aggregator VSI information.

Signed-off-by: Tarun Singh <tarun.k.singh@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: rename ACL priority values
Qi Zhang [Mon, 7 Sep 2020 11:12:35 +0000 (19:12 +0800)]
net/ice/base: rename ACL priority values

The naming convention used to shorten 'priority' is 'prio'.
Convert the ACL related entries that use 'prior' to 'prio'.

Also, as ICE_LOW, ICE_NORMAL,... are not very descriptive of what
they represent. Add 'ACL_PRIO' to help convey their use.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: remove unnecessary conditional
Qi Zhang [Mon, 7 Sep 2020 11:06:51 +0000 (19:06 +0800)]
net/ice/base: remove unnecessary conditional

These two conditional statements are unnecessary because the condition
is always true based on existing code flow.  Remove them to resolve
potential errors from some static analysis tools.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: rename function
Qi Zhang [Mon, 7 Sep 2020 11:03:14 +0000 (19:03 +0800)]
net/ice/base: rename function

'xtrct' or 'xtract' is currently used in the code to shorten 'extract'.
Rename ice_prgm_acl_prof_extrt() to ice_prgm_acl_prof_xtrct() so we don't
have another variation of a 'extract'.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: cache NVM module bank information
Qi Zhang [Mon, 7 Sep 2020 10:57:19 +0000 (18:57 +0800)]
net/ice/base: cache NVM module bank information

The ice flash contains two copies of each of the NVM, Option ROM, and
Netlist modules. Each bank has a pointer word and a size word. In order
to correctly read from the active flash bank, the driver must calculate
the offset manually.

During NVM initialization, read the Shadow RAM control word and
determine which bank is active for each NVM module. Additionally, cache
the size and pointer values for use in calculating the correct offset.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: cleanup code
Qi Zhang [Wed, 26 Aug 2020 14:01:40 +0000 (22:01 +0800)]
net/ice/base: cleanup code

Remove unnecessary mac_type check, fix couple comment, and remove
unnecessary empty line.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: remove unused parameter
Qi Zhang [Wed, 26 Aug 2020 13:57:46 +0000 (21:57 +0800)]
net/ice/base: remove unused parameter

remove unused parameter of ice_parse_fdir_func_caps

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: separate NVM version struct
Qi Zhang [Wed, 26 Aug 2020 13:35:30 +0000 (21:35 +0800)]
net/ice/base: separate NVM version struct

The ice_nvm_info structure has become somewhat of a dumping ground for
all of the fields related to flash version. It holds the NVM version and
EETRACK id, the OptionROM info structure, the flash size, the ShadowRAM
size, and more.

A future change is going to add the ability to read the NVM version and
EETRACK ID from the inactive NVM bank. To make this simpler, it is
useful to have these NVM version info fields extracted to their own
structure.

Rename ice_nvm_info into ice_flash_info, and create a separate
ice_nvm_info structure that will contain the eetrack and NVM map
version. Move the netlist_ver structure into ice_flash_info and rename it
ice_netlist_info for consistency.

Modify the static ice_get_orom_ver_info to take the option rom structure
as a pointer. This makes it more obvious what portion of the hw struct
is being modified. Do the same for ice_get_netlist_ver_info.

Introduce a new ice_get_nvm_ver_info function, which will be similar to
ice_get_orom_ver_info and ice_get_netlist_ver_info, used to keep the NVM
version extraction code co-located.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: enable QinQ filter for switch advanced rule
Qi Zhang [Wed, 26 Aug 2020 13:25:46 +0000 (21:25 +0800)]
net/ice/base: enable QinQ filter for switch advanced rule

Enable QinQ type filter for switch advanced rule, it support tunnel
and non-tunnel packet use external and inner vlan id as input set
for rules, it also support session id as input set for PPPoE rule
with QinQ flag in packet.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: adjust rate limit profile ids runtime database
Qi Zhang [Wed, 26 Aug 2020 13:16:27 +0000 (21:16 +0800)]
net/ice/base: adjust rate limit profile ids runtime database

Moving the runtime profile ids database/storage to the hw structure.

Signed-off-by: Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: change misc ACL style
Qi Zhang [Wed, 26 Aug 2020 13:06:56 +0000 (21:06 +0800)]
net/ice/base: change misc ACL style

This is a collection of minor ACL style changes including:

- When there is nothing to unroll, return a value directly.
- Return ICE_SUCCESS(0) in cases where an error was previously checked
  so ICE_SUCCESS is the only possible return.
- Remove unnecessary parentheses and newlines
- Move unroll of allocation to end of function and use goto on errors to
  free.
- Fix function header comment style
- Remove 'else' from an 'if else' condition where both conditions return
  a value to reduce indentation.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: preserve NVM capabilities in safe mode
Qi Zhang [Wed, 26 Aug 2020 13:03:24 +0000 (21:03 +0800)]
net/ice/base: preserve NVM capabilities in safe mode

If the driver initializes in safe mode, it will call
ice_set_safe_mode_caps. This results in clearing the capabilities
structures, in order to set them up for operating in safe mode, ensuring
many features are disabled.

This has a side effect of also clearing the capability bits that relate
to NVM update. The result is that the device driver will not indicate
support for unified update, even if the firmware is capable.

Fix this by adding the relevant capability fields to the list of values
we preserve. To simplify the code, use a common_cap structure instead of
a handful of local variables. To reduce some duplication of the
capability name, introduce a couple of macros used to restore the
capabilities values from the cached copy.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: remove function ACL count query
Qi Zhang [Wed, 26 Aug 2020 12:59:16 +0000 (20:59 +0800)]
net/ice/base: remove function ACL count query

Remove debug function ice_aq_query_acl_cntrs.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: remove repeated words
Qi Zhang [Wed, 26 Aug 2020 12:49:36 +0000 (20:49 +0800)]
net/ice/base: remove repeated words

A new test in checkpatch detects repeated words; cleanup all pre-existing
occurrences of those now.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: check failed acts allocation
Qi Zhang [Wed, 26 Aug 2020 12:43:40 +0000 (20:43 +0800)]
net/ice/base: check failed acts allocation

There is no check for failed allocation of 'acts'. Add a check and
return if memory was not successfully allocated. Also, as all 'goto out'
occur after this check there is no need to perform a check for 'acts' as
we will have returned if it is not set.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: move a function
Qi Zhang [Wed, 26 Aug 2020 12:37:36 +0000 (20:37 +0800)]
net/ice/base: move a function

Move ice_flow_get_hw_prof, this is not necessary for DPDK, just
sync the code with other compile option which ice_flow_get_hw_prof
is declared as a static function.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: clear advanced rules in reset preparation
Qi Zhang [Wed, 26 Aug 2020 12:29:51 +0000 (20:29 +0800)]
net/ice/base: clear advanced rules in reset preparation

Clear advanced rules from SW and HW before reset.

Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: move a function
Qi Zhang [Wed, 26 Aug 2020 12:24:29 +0000 (20:24 +0800)]
net/ice/base: move a function

The only caller of this function is within the file so mark it as static
and move it up in the file to avoid a forward declaration.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: filter for GTPU outer IP without inner IP
Qi Zhang [Wed, 26 Aug 2020 12:21:19 +0000 (20:21 +0800)]
net/ice/base: filter for GTPU outer IP without inner IP

Add ptype MAC_IPV4_GTPU into
ice_ptypes_ipv4_ofos, ice_ptypes_ipv4_ofos_all and ice_ipv4_ofos_no_l4

Add ptype MAC_IPV6_GTPU into
ice_ptypes_ipv6_ofos, ice_ptypes_ipv6_ofos_all and ice_ipv6_ofos_no_l4

Add ptype MAC_IPV4_GTPU and MAC_IPV6_GTPU into
the new ice_ptypes_gtpu_no_ip

So outer IP can be configured as input set for GTPU packet that without
inner IP layer.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: support outer IP filter for GTPC
Qi Zhang [Wed, 26 Aug 2020 12:15:52 +0000 (20:15 +0800)]
net/ice/base: support outer IP filter for GTPC

Add ptype MAC_IPV4_GTPC_TEID and MAC_IPV4_GTPC into
ice_ptypes_ipv4_ofos, ice_ptypes_ipv4_ofos_all and ice_ipv4_ofos_no_l4

Add ptype MAC_IPV6_GTPC_TEID and MAC_IPV6_GTPC into
ice_ptypes_ipv6_ofos, ice_ptypes_ipv6_ofos_all and ice_ipv6_ofos_no_l4

So outer IP can be configured as input set for GTPC packet.

Also add MAC_IPV4_GTPC_TEID and MAC_IPV6_GTPC_TEID into
ice_ptypes_gtpc, so when ICE_FLOW_SEG_HDR_GTPC is requested, it can
take effect on all GTPC packets (with or without TEID).

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: refactor DCB related variables
Qi Zhang [Wed, 26 Aug 2020 12:05:49 +0000 (20:05 +0800)]
net/ice/base: refactor DCB related variables

In this patch, the DCB related variables will be refactored out of the
ice_port_info_struct. The goal is to make the ice_port_info struct
cleaner.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>