Adds the basic probing infrastructure to support the flower firmware
application.
Adds the cpp service, used for some user tools.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
The NFP card can load different firmware applications.
This commit move the init logic of corenic app of the
secondary process into its own function.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Calling nfp_net_init() is only done for the corenic firmware flavor
and it is guaranteed to always be called from the primary process,
so the explicit check for RTE_PROC_PRIMARY can be dropped.
The calling graph of nfp_net_init() already guaranteed the free of
resources when it fail, so remove the necessary free logics inside it.
While at it remove the unused member is_phyport from struct nfp_net_hw.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
The NFP card can load different application firmwares. Currently
only the CoreNIC application firmware is supported. This commit makes
needed infrastructure changes in order to support other application
firmwares too.
Clearer separation is made between the PF device and any application
firmware specific concepts. The PF struct is now generic regardless
of the application firmware loaded. A new struct is also made for the
CoreNIC application firmware. Future additions to support other
application firmwares should also add an application firmware specific
struct.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Before, use two variables to represent the ethdev structure for
firmware with NFDk and NFD3, but only a few field values differ
between the two variables. Now use one variable only, and to
distinguish different firmware versions in specific functions.
Signed-off-by: Jin Liu <jin.liu@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
The return value of 'nfp_pf_init' function is variable ret, but
there is one statement, if error occurs, assign error num to
variable err, it is incorrect, fixed it.
Fixes: 5c464d6a27 ("net/nfp: support NFP3800 card")
Cc: stable@dpdk.org
Signed-off-by: Jin Liu <jin.liu@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Instead of a one-liner describing each vdev argument, add a description
and example for each. Move the information describing preferred busy
polling from the "Limitations" section to the "Options" section where it
is better placed. Also make general grammar improvements.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
When packet length in Tx is less than length hardware supported,
the minimum frame length in hns3 is used to do padding to avoid
hardware error. Currently, this length is fixed by macro, which
is very unfavorable for subsequent hardware evolution. So fix it
as firmware report.
Fixes: 395b5e08ef ("net/hns3: add Tx short frame padding compatibility")
Cc: stable@dpdk.org
Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
VF's command receive queue was mainly used to receive mailbox messages
from PF. There are two type mailbox messages: request response message
and message pushed by PF.
There are two types of threads that can handle these messages:
1) the interrupt thread of the main process: it could handle both types
of messages.
2) other threads: it could only handle request response messages.
The collaboration mechanism between the two type threads is that other
threads set the opcode of processed messages to zero so that the
interrupt thread of the main process does not process these messages
again.
Unfortunately, the other threads mark the message pointed to by the
crq->next-to-use variable which is fixed in the loop, not the message
pointed to by the next-to-use variable.
Fixes: dbbbad23e3 ("net/hns3: fix VF handling LSC event in secondary process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
VF's command receive queue was mainly used to receive mailbox messages
from PF. There are two type mailbox messages: request response message
and message pushed by PF.
There are two types of threads that can handle these messages:
1) the interrupt thread of the main process: it could handle both types
of messages.
2) other threads: it could only handle request response messages.
The collaboration mechanism between the two type threads is that other
threads set the opcode of processed messages to zero so that the
interrupt thread of the main process does not process these messages
again. Because other threads can only process part of the messages,
after the processing is complete, the next-to-use pointer of the
command receive queue should not be updated. Otherwise, some messages
(e.g. messages pushed by PF) maybe discarded.
Unfortunately, the patch to be reverted updates next-to-use pointer of
the command receive queue in other threads context, and this will lead
to discard some mailbox message.
So this commit reverts
commit 599ef84add ("net/hns3: fix mailbox communication with HW")
Fixes: 599ef84add ("net/hns3: fix mailbox communication with HW")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
When user set 'L3_SRC/DST_ONLY' or 'L4_SRC/DST_ONLY' to 'rss_hf' and
do not specify the packet type, these types will be set to hardware.
Fixes: 806f1d5ab0 ("net/hns3: set RSS hash type input configuration")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
When user only use 'ipv4' to set 'rss_hf', hns3 will enable
all tuple fields for 'ipv4' flow. But if user use 'ipv4-tcp'
, 'ipv4' and 'l4-src-only' to set 'rss_hf', driver does not
enable all tuple fields for 'ipv4' flow.
Fixes: 806f1d5ab0 ("net/hns3: set RSS hash type input configuration")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Currently, hns3 driver use 'ipv4-other' and 'ipv6-other' as the flag
of IP packets to judge if enable RSS tuple field. But user may use
'RTE_ETH_RSS_IPV4' or 'RTE_ETH_RSS_IPV6' as the flag. So this patch
adds the processing of these macros.
Fixes: 806f1d5ab0 ("net/hns3: set RSS hash type input configuration")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Currently, the hns3 driver uses _HNS3_XXX conditional compilation
macros to prevent duplicate header files. But in the C11 standard, all
identifiers starting with an underscore plus an uppercase letter are
always reserved. So this patch fixes it.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Header files should be self contained and should not be cyclically
dependent.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Currently, hns3 reports VXLAN tunnel packet type for GENEVE,
which is misleading to user. In fact, hns3 hardware cannot
distinguish between VXLAN and GENEVE packet. So this patch
uses RTE_PTYPE_TUNNEL_GRENAT packet type to report.
Fixes: 7d6df32cf7 ("net/hns3: fix missing outer L4 UDP flag for VXLAN")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
meson build -Db_coverage=true
ninja -C build
../drivers/net/hns3/hns3_ethdev.c:2856:22: warning: ‘cfg.umv_space’ may be
used uninitialized in this function [-Wmaybe-uninitialized]
2856 | pf->wanted_umv_size = cfg.umv_space;
Fix compiling warnings using gcc 10.3.1.
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
This 'hns3_restore_filter' is an internal interface of driver.
Currently, it uses 'struct rte_eth_dev *dev' as input parameter,
This is inconvenient for the function to call in driver because
caller has to obtain its device address by global variable
'rte_eth_devices[]'. Fix the input of this function.
Fixes: 920be799db ("net/hns3: fix RSS indirection table configuration")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
The 'hns3_restore_filter' is used to restore flow rules from
rte_flow API during the reset process. This patch moves the
recovery of flow direction rule to this function to improve
code maintainability.
Fixes: fcba820d9b ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
After reset process, types of RSS flow rule cannot be restored when
load driver without RTE_ETH_MQ_RX_RSS_FLAG flag. This is because the
restoration for RSS flow rule is done in the 'hns3_config_rss()'. But
this function is also used to configure and restore RSS configuration
from ethdev ops, and doesn't configure RSS types if 'rxmode.mq_mode'
has not the flag. As a result, RSS types configured by rte flow API
can't be restored in this case when encounter reset. Actually, all
RSS rules are saved to a global link list.
Use the linked list to restore RSS flow rule.
Fixes: 920be799db ("net/hns3: fix RSS indirection table configuration")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
RSS flow rules are saved in RSS filter linked list. The linked
list is modified by rte_flow API and is used to restore RSS rules
during reset process. So this patch uses 'hw->flows_lock' to protect
the configuration and recovery of RSS rule.
Fixes: c37ca66f2b ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Currently, driver sets RSS function to 'RTE_ETH_HASH_FUNCTION_MAX'
when user flush all rules in order to judge whether driver needs
to restore RSS rules. In fact, all rules are saved in flow RSS list.
So there is no need to modify RSS function to this macro. And this
list can be used to restore. The modification of RSS function may
introduce new problem.
Fixes: eb158fc756 ("net/hns3: fix config when creating RSS rule after flush")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
The 'hns3_restore_rss_filter' function is used to restore RSS rule.
But this function calls the 'hns3_config_rss_filter' which sets the
last to invalid in flow RSS list. This causes the flow RSS list has
no valid rule.
Fixes: ec674cb742 ("net/hns3: fix flushing RSS rule")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
The Tx performance deteriorates in the case of larger packets size and
larger burst. It may take a long time to optimize in these scenarios,
so this commit reverts
commit 0b77e8f3d3 ("net/hns3: optimize Tx performance")
Fixes: 0b77e8f3d3 ("net/hns3: optimize Tx performance")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
In the situation that the driver hns3 exits abnormally during packets
sending and receiving, the hardware statistics are not cleared when the
driver hns3 is reloaded. It need to be cleared during driver hns3
initialization that hardware MAC statistics.
Fixes: 8839c5e202 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
The '__rte_unused' tag in the input parameter of 'hns3_mac_stats_reset'
is redundant. This patch remove this tag. In addition, this function is
aimed to clear MAC statics. So using 'struct hns3_hw' as input parameter
is better than 'struct rte_eth_dev', and it also facilitates the call of
this function.
Fixes: 8839c5e202 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Currently, to prevent missing reporting of reset interrupts and quickly
identify reset interrupts, the following logic is designed in the
FW (firmware) command interface hns3_cmd_send: if an unprocessed
interrupt exist (by checking reset registers), related reset task is
scheduled.
The secondary process may invoke the hns3_cmd_send interface (e.g. using
proc-info query some stats). Unfortunately, the secondary process
does not support reset processing, and a segment fault may occur if it
schedules reset task.
Fix it by limit the checking and scheduling of reset under only primary
process.
Fixes: 2790c64647 ("net/hns3: support device reset")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Optimize SVE xmit algorithm performance, will get about 1%+
performance gain under 64B macfwd.
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
If txq's next-to-use plus nb_pkts equal txq's nb_tx_desc when using
simple xmit algorithm, the txq's next-to-use will equal nb_tx_desc
fter the xmit, this does not cause Tx exceptions, but may affect other
ops that depend on this field, such as tx_descriptor_status.
Fixes: 7ef933908f ("net/hns3: add simple Tx path")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
If txq's next-to-use plus nb_pkts equal txq's nb_tx_desc when using
SVE xmit algorithm, the txq's next-to-use will equal nb_tx_desc after
the xmit, this does not cause Tx exceptions, but may affect other ops
that depend on this field, such as tx_descriptor_status.
Fixes: f0c243a6cb ("net/hns3: support SVE Tx")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Currently, the number of Tx send bytes is obtained by accumulating the
length of the batch 'mbuf' packets of the current loop cycle.
Unfortunately, it uses svcntd (which means all lane, regardless of
whether the corresponding lane is valid) which may lead to overflow,
and thus refers to an invalid mbuf.
Because the SVE xmit algorithm applies only to a single mbuf, the
mbuf's data_len is equal pkt_len, so this patch fixes it by using
svaddv_u64(svbool_t pg, svuint64_t data_len) which only adds valid
lanes.
Fixes: fdcd6a3e02 ("net/hns3: add bytes stats")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
The Rx and Tx vector algorithm of hns3 PMD don't support PTP
function. Currently, hns3 driver uses 'pf->ptp_enable' to check
whether PTP is enabled so as to not select Rx and Tx vector
algorithm. And the variable is set when call rte_eth_timesync_enable().
Namely, it may not be set before selecting Rx/Tx function, let's say
the case: set PTP offload in dev_configure(), do dev_start() and then
call rte_eth_timesync_enable(). In this case, all PTP packets can not
be received to application. So this patch fixes the check based on the
RTE_ETH_RX_OFFLOAD_TIMESTAMP flag.
Fixes: 3ca3dcd651 ("net/hns3: fix vector Rx/Tx when PTP enabled")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Show whether support modifying VF VLAN filter or not.
Sample output changes:
+ -- support VF VLAN FILTER MOD: Yes
Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Rename the function name with prefix hns3_ to keep the same code
style with other files and adjust some code to make it more readable.
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Fix code check warnings according to:
- function should have same name with previous declaration;
- local variable should no be referenced in macro referenced;
- macro argument 'adapter' should be enclosed in parentheses.
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Rename hns3 dump files and abstract a head file for dump.
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Increase the number of default Rx/Tx queue pairs to 8,
and add MQ feature flag to vDPA protocol features.
Signed-off-by: Abhimanyu Saini <absaini@amd.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Change cidx and pidx definition to mean used queue and avail
queue index respectively.
Signed-off-by: Abhimanyu Saini <absaini@amd.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Pickup new FW interface definitions for avail and used indexes.
Signed-off-by: Abhimanyu Saini <absaini@amd.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
The used/avail queue indexes are not bound by queue size,
because HW calculates descriptor entry index by performing
a simple modulo between queue index and queue_size.
So, do not check initial used and avail queue indexes
against queue size because it is possible for these
indexes to be greater than queue size in the
following cases:
1) The queue is created to be migrated into, or
2) The client issues a qstop/qstart after running datapath
Fixes: 4dda72dbde ("common/sfc_efx/base: add base virtio support for vDPA")
Cc: stable@dpdk.org
Signed-off-by: Abhimanyu Saini <absaini@amd.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Currently ring pmd does not support ``rte_power_monitor`` api.
This patch adds support by adding monitor callback that is called
whenever we enter sleep state and need to check if it is time to wake
up.
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The relation between the isolated mode in ethdev flow API
and bifurcated driver behaviour was not clearly explained.
It is made clear in the how-to guide that isolated mode is required
for flow bifurcation to the kernel.
On the other side, the impact of the isolated mode on a bifurcated
driver is made more explicit.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
There's a bug in memif_stats_get() function due to confusion
between C2S (client->server) and S2C (server->client) rings,
causing a crash if there's a different number of Rx and Tx queues.
Fixit by selectiing the correct rings for Rx and Tx i.e for Rx, S2C
rings are selected and for Tx, C2S rings are selected.
Bugzilla ID: 734
Fixes: 09c7e63a71 ("net/memif: introduce memory interface PMD")
Cc: stable@dpdk.org
Signed-off-by: Huzaifa Rahman <huzaifa.rahman@emumba.com>
Reviewed-by: Joyce Kong <joyce.kong@arm.com>
The TAP device only lasts as long as the DPDK application that opened
it is running. This behavior is bad if the DPDK application needs
to be updated transparently without disturbing other services
using the tap device.
Add a persist feature to the TAP device. If this flag is set, the
kernel network device remains even if after the application has exited.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
On Linux and most other systems, network interface index is a 32-bit
integer. Indexes overflowing the 16-bit integer are frequently seen
when used inside a Docker container.
Fixes: 7c25284e30 ("net/tap: add netlink back-end for flow API")
Fixes: 2bc06869cd ("net/tap: add remote netdevice traffic capture")
Cc: stable@dpdk.org
Signed-off-by: Alex Kiselev <alex@bisonrouter.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
This commit extends the timeout for service_may_be_active()
from 100ms to 1000ms. Local testing on a idle and loaded system
(compiling DPDK with all cores) always completes after 1 ms.
The wait time for a service-lcore to finish is also extended
from 100ms to 1000ms.
The same timeout waiting code was duplicated in two tests, and
is now refactored to a standalone function avoiding duplication.
Reported-by: David Marchand <david.marchand@redhat.com>
Suggested-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>