The kernel driver supports VF RSS configuration message
"VIRTCHNL_OP_GET_RSS_HENA_CAPS and VIRTCHNL_OP_SET_RSS_HENA",
this patch adds PMD support for these messages.
Fixes: b81295c474 ("net/i40e: add user callback for VF to PF message")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
In the loop, when the index of array "vsi->rss_key" is equal
to "vsi->rss_key_size", the array will be accessed out of bounds.
Fixes: 50370662b7 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
The QW0 of Tx context descriptor should be reset to 0, otherwise the
previous hardware writeback value may pollute the next context descriptor
write.
Fixes: a2b29a7733 ("net/avf: enable basic Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
For dev_ops not supported by the secondary process, either return -EPERM
or return without doing anything. In both cases log a warning.
It's still application's responsibility to avoid calls like that and
those changes are for debugging/informational purposes.
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
rte_pci_device and rte_eth_dev are process-local structures. Therefore
ena_adapter::pdev and ena_adapter::rte_dev cannot be used universally.
Both ena_timer_wd_callback and ena_interrupt_handler_rte needs access to
the rte_eth_dev, but as they are being setup and executed in the primary
process, it is safe to pass there the same pointer, which is used for
the device configuration.
In all other cases, except the eth_ena_dev_init(), the rte_eth_dev_data
is used instead.
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
To make it possible to the app to determine if the hash was calculated
for the packet or not, the PKT_RX_RSS_HASH should be set in the mbuf's
ol_flags.
As the PMD wasn't setting that, the application couldn't check if there
is a hash in a proper way.
The hash is valid only if it's UDP or TCP and the IP packet wasn't
fragmented.
Fixes: e5df9f33db ("net/ena: fix passing RSS hash to mbuf")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
Currently action RTE_FLOW_ACTION_TYPE_METER_COLOR is defined.
Add the CLI for this action: color type (types)
There are three types: green, yellow and red.
Example for the new policy meter CLIs:
add port meter policy 0 1 g_actions color type green / end y_actions
color type yellow / end r_actions color type red / end
In the above command, the action type is
RTE_FLOW_ACTION_TYPE_METER_COLOR, the meter policy action list:
green -> green, yellow -> yellow, red -> red.
Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Change the variable type in store_dma_desc_info_packed() to fix
suspicious implicit sign extension.
Coverity issue: 370608, 370610, 370612
Fixes: 873e8dad6f ("vhost: support packed ring in async datapath")
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Thread argument changed to wrong value during thread name addition,
fixing that bug.
Fixes: fdefe038eb ("net/ark: set generator delay thread name")
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tunnel offload API requires application to query PMD for specific flow
items and actions. Application uses these PMD specific elements to
build flow rules according to the tunnel offload model.
The model does not restrict private elements location in a flow rule,
but the current MLX5 PMD implementation expects that tunnel offload
rule will begin with PMD specific elements.
The patch removes that placement limitation.
Fixes: 4ec6360de3 ("net/mlx5: implement tunnel offload")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
The admin-configured vNIC settings (i.e. via CIMC or UCSM) now include
Geneve offload. Use that setting to decide whether to enable or
disable Geneve offload and remove the devarg 'geneve-opt'.
Also, the firmware now allows the driver to change the Geneve port
number. So extend udp_tunnel_port_{add,del} to accept Geneve port, in
addition to VXLAN.
Fixes: 93fb21fdbe ("net/enic: enable overlay offload for VXLAN and GENEVE")
Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
A terminated pthread should be joined or detached so that its associated
resources are released.
The "ice-reset-<vf_id>" threads are used to service some reset task in
the background, but they are never joined by the thread that created
them.
The easiest solution is to detach new threads.
The Windows EAL did not provide a pthread_detach wrapper but there is no
resource to release for Windows threads, so add an empty wrapper.
Fixes: 3b3757bda3 ("net/ice: get VF hardware index in DCF")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
A terminated pthread should be joined or detached so that its associated
resources are released.
The "ark-delay-pg" thread is just used to delay some task but it is never
joined by the thread that created it.
The easiest solution is to detach the new thread.
Fixes: 727b3fe292 ("net/ark: integrate PMD")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ed Czeck <ed.czeck@atomicrules.com>
Tunnel offload model requires application to obtain PMD related flow
items or actions to construct a flow rule. These elements acquire
internal PMD flow resources that must be explicitly released.
The patch destroys tunnel offload PMD resources after flow creation
failure.
Fixes: 1b9f274623 ("app/testpmd: add commands for tunnel offload")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
If the FEC mode was not supported, it should return error code.
This patch also adds a space when log error info.
Fixes: 9bf2ea8dbc ("net/hns3: support FEC")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
The memory barrier is used to ensure that the response is returned
only after the Tx/Rx function is set, it should place after the Rx/Tx
function is set.
Fixes: 23d4b61fee ("net/hns3: support multiple process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
This secondary process should not send request to start/stop Rx/Tx,
this patch fixes it.
Fixes: 23d4b61fee ("net/hns3: support multiple process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
The mailbox message id is uint8_t, but the unsupported mailbox message
id was logged by uint16.
Fixes: 463e748964 ("net/hns3: support mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
The TM QCN error event should report by RAS other than MSIX.
Also this patch adds fifo int enable configuration before the TM QCN
error event is enabled.
Fixes: f53a793bb7 ("net/hns3: add more hardware error types")
Fixes: 3903c05382 ("net/hns3: remove read when enabling TM QCN error event")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Support to enable and disable QINQ hardware strip, when configure VLAN
offload with QINQ strip mask. If there are packets have QINQ tag to RSS,
users should enable QINQ strip before configuring the RSS.
Fixes: 220b0e49bc ("net/txgbe: support VLAN")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
The hardware doesn't support counting the number of bytes that through
the fdir rule. Therefore, the corresponding out parameters (e.g.
bytes_set/bytes) is set to zero.
Fixes: fcba820d9b ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Currently in the VF reset scenario, the VF performs the set
alive operation before restoring the configuration completed,
which may cause the hardware to work in an abnormal state.
This patch fix this problem by set VF alive after restoring
the configuration is completed.
Fixes: a5475d61fa ("net/hns3: support VF")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
The fdir hash map hold the pointers of fdir rule elements, it needs to
be set to NULL when clear all fdir rules.
Fixes: fcba820d9b ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
If clear FDIR rules fail, the error code was logged, but the error code
was useless because it was the sum of all fail code.
This patch fixes it by log the success cnt and fail cnt.
Fixes: fcba820d9b ("net/hns3: support flow director")
Fixes: 8eed8acc81 ("net/hns3: add error code to some logs")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
This patch adds more description for hns3 PMD document, that is:
'Sample Application Notes', 'Statistics','Performance tuning'.
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Prior to this change, two implementations of rx_syscall_handler
existed although only one was needed (for the zero copy path which
is only available from kernel 5.4 and onwards). Remove the second
definition from compat.h and move the first definition back to where
it is called in the Rx function. Doing this removes a build warning
on kernels before 5.4 which complained about the second function
being defined but not used.
Fixes: 2aa51cdd55 ("net/af_xdp: fix trigger for syscall on Tx")
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Before this change the dev_infos callback always reported RSS
capabilities regardless of whether the capability is supported by the
device or not. First check the capabilities field in the BAR of the
device and advertise RSS functionality accordingly.
Fixes: 8b945a7f7d ("drivers/net: update Rx RSS hash offload capabilities")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
This version update contains:
* memcpy mapping to the dpdk-optimized version.
* ena_com (HAL) update to the latest version (from 18.09.2020).
* Bug fixes for the large LLQ headers and devargs parsing.
* Bug fix for the default ring size.
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Remove invalid ring size alignment logic and add default Rx and Tx port
ring sizes to the device info spec.
The logic in lines 1297 and 1371 is invalid. The
RTE_ETH_DEV_FALLBACK_RX_RINGSIZE (and the TX counterpart) is a value
that rte_eth_rx_queue_setup() will set if
dev_info.default_rxportconf.ring_size is 0 and user provided 0 in
nb_rx_desc argument. However the current code treats it as a hint for
the PMD to change the ring size to internal defaults.
Additionally since the ENA_DEFAULT_RING_SIZE is defined, report it in
the device capabilities so that both rte_ethdev code and the user can
utilize it for device configuration.
Fixes: ea93d37eb4 ("net/ena: add HW queues depth setup")
Cc: stable@dpdk.org
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
pthread_cond_timedwait() may spuriously wakeup according to POSIX.
Therefore it is required to check whether predicate is actually true
before finishing the waiting loop.
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
swap*_*_le() functions are not used anywhere and besides there are rte
alternatives already present.
Fixes: 1173fca25a ("ena: add polling-mode driver")
Cc: stable@dpdk.org
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
As the documentation of rte_kvargs_parse() states, the valid_keys
argument must be NULL terminated. Lack of this feature may cause
segmentation fault if the passed devarg will be different then the
supported value.
Fixes: 8a7a73f26c ("net/ena: support large LLQ headers")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
The code incorrectly checked the return value of comparison when parsing
the argument key name. The return value of strcmp should be compared
to 0 to identify a match.
Fixes: 8a7a73f26c ("net/ena: support large LLQ headers")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
1. As memzone uses unique names, changed alloc coherent macro to use
64 bit size atomic variable to increase the memzone name space
2. "handle" param name change to be consistent with other macros
3. Variable definition displacement
4. Backslash alignment to column 80
Signed-off-by: Amit Bernstein <amitbern@amazon.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
As in the v20.11 rte_prefetch0_write API was added, it should be used
in the platform file for the definition of the macro prefetchw, instead
of using simply prefetch0.
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
This feature wasn't used by any of the drivers. Because of that, it was
removed.
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
The RSS indirection table shouldn't be included as a part of the
device features context.
If the driver has to acquire it, it can be done using the separate API
whenever the RSS configuration is needed.
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
Although the ENA DPDK PMD doesn't have to perform any actions for
destroying the wait event, some other platforms have to.
The macro "ENA_WAIT_EVENT_DESTROY" was renamed to
"ENA_WAIT_EVENTS_DESTROY" and also whole implementation responsible for
that was moved to a separate function for better readability.
Fixes: 3adcba9a89 ("net/ena: update HAL to the newer version")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
To silence error messages from the static code analysis, make the type
conversions explicit where they're intended.
Also fix the type for the DMA width value.
Fixes: 99ecfbf845 ("ena: import communication layer")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
List of changes:
* Comment style was adjusted for the functions
* The keys_num at "struct ena_admin_feature_rss_flow_hash_control" was
renamed to the key_parts to better describe it's meaning
* The RSS indirection table was called "REDIRECTION" -> changed to
INDIRECTION
* Change AENQ field "syndrom" -> "syndrome"
* Calculate number of the RSS key parts or whole key by using the
common way: sizeof of the first element of the RSS key
* Add description of the "enum ena_admin_aq_feature_id"
* Rename "map_rx_buf_bidirectional" field as "rx_buf_mirroring"
* Other minor style fixes (remove extra spaces, add missing line break,
improve indentation)
* Remove unused macros ENA_ADMIN_EXTRA_PROPERTIES_*
* Restructure the "if {} else if {} else" conditional statement for
setting up the meta descriptor
Fixes: 99ecfbf845 ("ena: import communication layer")
Fixes: b68309be44 ("net/ena/base: update communication layer for the ENAv2")
Fixes: b2b02edeb0 ("net/ena/base: upgrade HAL for new HW features")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
Some platforms may make use of the device argument to make the logs more
verbose and specific for the appropriate device.
As it's not used by the ENA DPDK PMD for the logging, the type is just
defined, but never used.
It may be reconsidered to change this in the future by adding port ID
to the message logs, but as for now the logging behavior won't change.
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
Instead of using 'queue' for struct ena_com_admin_queue and 'dev' for
struct ena_com_dev variables, use more descriptive 'admin_queue' and
'ena_dev'.
This also unifies the names of variables of the type struct ena_com_dev
in the driver.
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
memcpy is now mapped to rte_memcpy macro on x86 architectures.
Fixes: 9ba7981ec9 ("ena: add communication layer for DPDK")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Artur Rojek <ar@semihalf.com>
This patch fixes a bug where firmware version was not
copied from ibv_device_attr structure into mlx5_dev_attr
structure, resulting in inability to read firmware
version.
Fixes: e85f623e13 ("net/mlx5: remove attributes dependency on Verbs")
Cc: stable@dpdk.org
Signed-off-by: Kamil Vojanec <xvojan00@stud.fit.vutbr.cz>
Acked-by: Matan Azrad <matan@nvidia.com>
There was a typo - the device context was wrongly provided
instead of counter's one for the DevX query operation.
Fixes: e6988afdc7 ("net/mlx5: fix imissed statistics")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
If the Send Queue (backing one for PMD Tx queue) the was
created with DevX API the doorbell record offset for the
producer index field was incorrect. If hardware missed the
doorbell register write event the wrong content of doorbell
record might cause queue malfunction. For the Send Queues
created with Verbs API the doorbell record offset was
configured correctly.
Fixes: 86d259cec8 ("net/mlx5: separate Tx queue object creations")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
The support of RSS expansion for the flows with IPv6 GRE item was added
to mlx5 PMD. And the GRE KEY item support in expansion was missed
and the flows with GRE and GRE KEY items were expanded in the wrong
way causing the flow creation failure.
This patch adds the RSS expansion support for GRE KEY and mlx5 PMD
performs RSS expansion correctly.
Fixes: 048f0d45e3 ("net/mlx5: support RSS expansion for IPv6 GRE")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>