Remove function ice_clear_queues, since all equivalent code
has already been executed during ice_rx|tx_queue_stop.
Also function ice_rx|tx_queue_release_mbufs simply wrapped a
function pointer call which is not necessary, remove them.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Remove CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC with below
consideration:
1. A default Rx path can always be selected by setting a proper
rx_free_thresh value at runtime, see
ice_check_rx_burst_bulk_alloc_preconditions.
2. Its not a big deal to always reserve more space for desc ring.
"ring_size = (uint16_t)(rxq->nb_rx_desc + ICE_RX_MAX_BURST);"
3. Fixes a potential invalid memory access in ice_reset_rx_queue.
If CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC is turned on while
ice_check_rx_burst_bulk_alloc_preconditions return fail.
Below code will have problem.
for (i = 0; i < ICE_RX_MAX_BURST; ++i)
rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf;
Fixes: 50370662b7 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Remove unnecessary variable "meta" in ice_flow_create and
ice_flow_validate, it should be defined when really needed:
its ice_parse_engine_create and ice_parse_engine_validate.
A meta data created by parser->parse_pattern_action should be
freed inside parser->engine->create.
During a validate operation, since parser->engine_>create will not
be invoked, it is unnecessary to create a meta during parser, so
NULL will passed to engine->parse_pattern_action and all parser's
parse_pattern_action need to be modified to handle meta = NULL
properly.
With above implementation, the patch also fixes a potential memory
leak in ice_parse_engine_validate, since meta may not be freed.
BTW, an engine without a create op should be regarded as a bug. So
use RTE_ASSERT to replace runtime engine->create == NULL check in
ice_parse_engine_create.
Fixes: 4e27d3ed02 ("net/ice: fix flow API framework")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Commit 'dc36bd5dfdeb' mistakenly initializes ret as -rte_errno, then
return ret if ice_search_pattern_match_item fails, if rte_errno happens
to be 0 in this case, it would cause an unrecognized flow rule to be
marked as recognition success. Later, when the code tries to parse the
flow rule, a segmentation fault will occur due to null pointer
reference.
Fixes: dc36bd5dfd ("net/ice: fix flow FDIR/switch memory leak")
Cc: stable@dpdk.org
Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Operator '<<' should be used instead of '<' for shifting value to be
set in MSI-X configuration register.
Old code adds 1 on even MSI-X interrupt vector index used by queue,
resulting in interrupt mapping error.
Fixes: 65dfc889d8 ("net/ice: support Rx queue interruption")
Cc: stable@dpdk.org
Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Coverity complains of unchecked return value warning of
ice_xmit_cleanup, while this cleanup is opportunistic and will not cause
problems if it fails. So instead of checking the return value of
ice_xmit_cleanup and return in case of cleanup failure, we directly cast
it to void function to make the Coverity happy.
Coverity issue: 353623
Fixes: 17c7d0f9d6 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
The original PASSTHRU implementation is forwarding to queue 0. The
corrected implementation is forwarding to the next stage filter.
Fixes: f5cafa961f ("net/ice: add flow director create and destroy")
Cc: stable@dpdk.org
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
The patch distinguishes fdir rules for GTPU with or without
extend header, so flow to match below patterns can be created
correctly.
1. eth / ipv4 / udp / gtpu teid is 10 / ...
2. eth / ipv4 / udp / gtpu teid is 10 / gtp_psc / ...
3. eth / ipv4 / udp / gtpu / gtp_psc qfi is 10 / ...
4. eth / ipv4 / udp / gtpu teid is 10 / gtp_psc is 10 / ...
Fixes: efc16c6214 ("net/ice: support flow director GTPU tunnel")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
This patch adds the capability of matching the outer IPv4
headers for GTPU flows.
Fixes: efc16c6214 ("net/ice: support flow director GTPU tunnel")
Cc: stable@dpdk.org
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Based on current FDIR implementation for GTP-U, inner specification is
not supported, issue a rule for eth/ipv4/gtpu/ipv4 will also match
eth/ipv4/gtpu/ipv6, the patch adds new pattern list to align with
existed implementation.
Fixes: efc16c6214 ("net/ice: support flow director GTPU tunnel")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
1. Fix ice FDIR and hash flow memory leak.
2. Fix the ice definition of LIST_FOR_EACH_ENTRY_SAFE not
save tmp which cause list deletion incompletely.
Fixes: 5f0978e962 ("net/ice/base: add OS specific implementation")
Fixes: f5cafa961f ("net/ice: add flow director create and destroy")
Fixes: 5ad3db8d4b ("net/ice: enable advanced RSS")
Cc: stable@dpdk.org
Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Reviewed-by: Simei Su <simei.su@intel.com>
Reviewed-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
If there's no mark action when creating a FDIR rule,
there shouldn't be FDIR flags in mbuf.
Fixes: f5cafa961f ("net/ice: add flow director create and destroy")
Fixes: bd984f155f ("net/ice/base: support FDIR")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Remove the unused definitions, rewrite the IO data read/write helpers,
and put the common definitions related to RTE defines under the macro
__INTEL_NET_BASE_OSDEP__, so it works like OS(RTE) dependency.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Replaces the redefined TRUE and FALSE values with standard ones to
match the 'bool' type definition.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Hardware limits that max buffer size per Tx descriptor should be
(16K-1)B. So when TSO enabled, the mbuf data size may exceed the
limit and cause malicious behavior to the NIC. This patch fixes
this issue by using more Tx descs for this kind of large buffer.
Fixes: 17c7d0f9d6 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Add support to the ice driver for the API rte_eth_tx_done_cleanup
to force free consumed buffers on Tx ring.
Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Use the API rte_ether_addr_copy to do MAC assignment, instead of
calling rte_memcpy function directly.
Fixes: 84dc7a95a2 ("net/ice: enable flow director engine")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Add support for 1/10G devices.
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
ice_add_mac_rule allow user to add rule to port based on
hw->port_info->lport number. Function in some case should
allow user to add filter rule on different port, write
another function which implemented that behaviour.
The same situation is which removing mac function.
Add new API function which allow user to choose port on which
rule going to be added. Leave add mac rule function that always
add rule on hw->port_info->lport to avoid changes in components
which don't need to choose different port. Also add function to
remove rule from specific port.
Alloc more switch_info structs to track separately rules for each
port. Choose switch_info struct basing on logic port number
because in FW added rules are connected with port.
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Change internal implementation of how FD filter programming desc
is prepared. This is to minimize the amount of code needed to prep
the FD filter programming desc (avoid memcpy, etc...) and just use
predefined shifts and mask. This type of change are needed to expedite
FD setup during data path (ADQ uses this codepath during initial
flow setup) and it will also be useful when adding side-band
flow-director filter.
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Increase the maximum time that the driver will wait for a PF reset
from 200 milliseconds to 300 milliseconds, to account for possibility
of a slightly longer than expected PF reset.
Fixes: 453d087cca ("net/ice/base: add common functions")
Cc: stable@dpdk.org
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
In ice_prot_type_to_id routine, correct the loop limit check
to use ARRAY_SIZE instead of looking for the array element to
have a specific value.
Fixes: fed0c5ca5f ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Enable the code to clear the HW tables.
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Change the extraction sequence generated by flow director flexbytes to
use package mac protocol. Without this change data in packet headers
cannot be used for flexbyte matching. The old extraction for flex bytes
started at the beginning of the payload which is after the header.
Signed-off-by: Henry Tieman <henry.w.tieman@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Use a format consistent with the rest of the code.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
When RDMA is not enabled, when checking for completion of a CORER or
GLOBR do not wait for the PE unit to be loaded (indicated by GLNVM_ULD
register's PE_DONE bit being set) since that does not happen and will
cause issues such as failing to initialize the device.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Add a feature to allow user to add switch filter using input like
MAC + VLAN (C-tag only) + L4 (TCP/UDP) port. API "ice_add_adv_rule"
is extended to handle this filter type.
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Allow tools to access register offset 0xB8188 (GLGEN_RSTAT) for
NVMUpdate operations. This is a read-only register, so risk of other
issues stemming from this change is low. Even so, update the write
command to prevent and reject any commands which attempt to write to
this register, just like we do for GL_HICR_EN.
Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
There'll always be a MDD event triggered when adding
a FDIR rule. The root cause is 'LAN enable' is not
configured during control VSI setup.
Besides, correct FDIR fields for both main VSI and
control VSI.
Fixes: 84dc7a95a2 ("net/ice: enable flow director engine")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
According to comms package, index 94 should be MAC_IPV6_ICMP,
not MAC_IPV4_ICMP. This patch fixes the issue.
Fixes: 4cf29798b4 ("net/ice: fix packet type table")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Add FDIR support for normal GTP-U packet, which doesn't contain GTP_PSC
extension header.
Fixes: efc16c6214 ("net/ice: support flow director GTPU tunnel")
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Pattern name of GTP-U flow with extension header should be
xxx_gtpu_eh_xxx. So it will not conflict with the pattern name of a
GTP-U flow that does not contains extension header.
Fixes: 3e4eab9c21 ("net/ice: add pattern manifest")
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Flow type "IPv4 + UDP" or "IPv4 + TCP" is conflict with "IPv4 + any"
flow type. If a rule for IPv4 + any is created, we should reject any
rule for IPv4 + UDP otherwise the first rule may be impacted, same
decision should be made on a reverse order. For IPv6 and IPv4 GTPU
inner case, we have the same limitation.
Fixes: 109e8e0624 ("net/ice: configure HW flow director rule")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Merge all versions in linker version script files to DPDK_20.0.
This commit was generated by running the following command:
:~/DPDK$ buildtools/update-abi.sh 20.0
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Since the library versioning for both stable and experimental ABI's is
now managed globally, the LIBABIVER and version variables no longer
serve any useful purpose, and can be removed.
The replacement in Makefiles was done using the following regex:
^(#.*\n)?LIBABIVER\s*:=\s*\d+\n(\s*\n)?
(LIBABIVER := numbers, optionally preceded by a comment and optionally
succeeded by an empty line)
The replacement for meson files was done using the following regex:
^(#.*\n)?version\s*=\s*\d+\n(\s*\n)?
(version = numbers, optionally preceded by a comment and optionally
succeeded by an empty line)
[David]: those variables are manually removed for the files:
- drivers/common/qat/Makefile
- lib/librte_eal/meson.build
[David]: the LIBABIVER is restored for the external ethtool example
library.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
When FDIR filter detects duplicated rule and then returns EEXIST, ice
flow will capture this error and return immediately.
Fixes: 4e27d3ed02 ("net/ice: fix flow API framework")
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Since not all data paths support flow mark, the driver needs
a hint from application to select the correct data path if
flow mark is required. The patch introduces a devarg
"flow-mark-support" as a workaround solution, since a standard
way is still ongoing.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
By moving irq enable/disable from device start/stop to FDIR
setup/teardown, FDIR queue irq config is independent of LAN queue irq
config. So device stop will not cause FDIR rule failure.
Fixes: 84dc7a95a2 ("net/ice: enable flow director engine")
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Qi Zhang <qi.z.zhang@intel.com>
To make sure if FDIR programming succeed or fail, legacy programming
status descriptor WB format is enabled and FDIR queue irq is opened.
Fixes: 84dc7a95a2 ("net/ice: enable flow director engine")
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Qi Zhang <qi.z.zhang@intel.com>
The FDIR parser will select ICE_FLTR_PTYPE_NONF_IPV4_OTHER as flow type
for an IPv4 UDP flow with empty l4 matching field which is not correct.
Same issues happens on all the combination between IPv4/IPv6 and
UDP/TCP/SCTP cases.
The patch fixes all the wrong flow ptype selections.
Fixes: f5cafa961f ("net/ice: add flow director create and destroy")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
By default RSS hash delivery (offload) is bound to RSS mode and
it is incorrect to advertise it as enabled if Rx multi-queue mode
has no RSS.
Fixes: 8b945a7f7d ("drivers/net: update Rx RSS hash offload capabilities")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Fixes: 84dc7a95a2 ("net/ice: enable flow director engine")
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Currently, multiple rte_flow RSS rules may map to the same
hardware rule if a later rule is just for input set change or
symm turn on/off. So after one of the rules be destroyed, we will
get error ICE_ERR_DOES_NOT_EXIST when destroying any other rules.
The patch simply fixes this by ignoring this error. A more
sophisticated fix that remember the sequence and replay properly
will be provided in the future.
Fixes: 5ad3db8d4b ("net/ice: enable advanced RSS")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
In ice_hash_create(), whatever the hash_function is, the
filter_ptr->symm is always 0 and when we destroy the flow, the
ice_rem_rss_cfg() is never carried out. So the destroy function never
works well. The patch fixes this issue and at the same time
distinguishes between simple_xor and symmetric_toeplitz.
To fix this issue, the patch adds a new structure to include a flag to
indicate if it is a simple_xor flow so that it's easier to remove the
config when destroying the flow. The patch also simplifies code
implementation logic in ice_hash_create().
Fixes: 5ad3db8d4b ("net/ice: enable advanced RSS")
Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
To avoid wild pointer, pointers should be set to NULL after free them.
Fixes: 1a2fc1799f ("net/ice: reject duplicated flow for flow director")
Fixes: 84dc7a95a2 ("net/ice: enable flow director engine")
Fixes: 0f880c3df1 ("net/ice: add flow director counter resource init/release")
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
All the counter resources should be cleaned up when teardown.
Fixes: 0f880c3df1 ("net/ice: add flow director counter resource init/release")
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>