Commit Graph

28217 Commits

Author SHA1 Message Date
Alvin Zhang
7594f2dac4 net/i40e: fix VF RSS configuration
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>
2021-05-12 14:21:27 +02:00
Jie Wang
d7ea27d065 net/ice: fix VSI array out of bounds access
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>
2021-05-12 14:21:09 +02:00
Beilei Xing
2444d35dc1 net/iavf: fix Tx context descriptor
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>
2021-05-12 10:52:54 +02:00
Alvin Zhang
752ab161bd net/i40e: fix offload flag checking in simple Tx
Tx offload flags 'PKT_TX_IPV6, PKT_TX_IPV4, PKT_TX_OUTER_IPV6,
PKT_TX_OUTER_IPV4' are supported in simple datapath.

This patch removes these offload flags from packet checking in simple
Tx datapath and defines 2 macro I40E_TX_OFFLOAD_SIMPLE_SUP_MASK
and I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK.

Fixes: 146ffa81d0 ("net/i40e: add Tx preparation for simple Tx datapath")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
2021-05-12 10:50:36 +02:00
Stanislaw Kardach
39ecdd3dfa net/ena: disable ops not supported by secondary process
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>
2021-05-12 14:19:03 +02:00
Stanislaw Kardach
aab5885733 net/ena: make ethdev references multi-process safe
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>
2021-05-12 14:19:02 +02:00
Michal Krawczyk
b418f0d299 net/ena: indicate Rx RSS hash presence
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>
2021-05-12 14:19:02 +02:00
Haifei Luo
c5c507100e app/testpmd: support action meter color
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>
2021-05-12 14:06:27 +02:00
Cheng Jiang
35139e648a vhost: fix sign extension in async packed ring
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>
2021-05-12 10:28:18 +02:00
Cheng Jiang
11a7cd8c92 vhost: fix sign extension in async split ring
Change the variable type in store_dma_desc_info_split() to fix
suspicious implicit sign extension.

Coverity issue: 370604, 370607, 370609
Fixes: 3d6cb86b0d ("vhost: refactor async split ring functions")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
2021-05-12 10:28:08 +02:00
Ed Czeck
4b42104c47 net/ark: fix control thread argument
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>
2021-05-12 00:44:06 +02:00
Gregory Etelson
8c5a231bce net/mlx5: fix tunnel offload private items location
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>
2021-05-12 00:03:18 +02:00
John Daley
61c7b522d9 net/enic: enable GENEVE offload via VNIC configuration
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>
2021-05-11 23:52:26 +02:00
David Marchand
8eff201b00 net/ice: fix leak on thread termination
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>
2021-05-11 23:40:22 +02:00
David Marchand
b8b5dc6b95 net/ark: fix leak on thread termination
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>
2021-05-11 23:40:22 +02:00
Gregory Etelson
99fc79b37a app/testpmd: fix tunnel offload flows cleanup
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>
2021-05-11 21:08:41 +02:00
Chengwen Feng
ab8c500585 net/hns3: fail setting FEC if one bit mode is not supported
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>
2021-05-11 20:07:59 +02:00
Chengwen Feng
ac8962e965 net/hns3: fix ordering in secondary process initialization
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>
2021-05-11 20:07:59 +02:00
Chengwen Feng
db6a165adc net/hns3: fix secondary process request start/stop Rx/Tx
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>
2021-05-11 20:07:59 +02:00
Chengwen Feng
34a9a44a32 net/hns3: fix mailbox message ID in log
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>
2021-05-11 20:07:59 +02:00
Chengwen Feng
ffb62592f8 net/hns3: fix TM QCN error event report by MSI-X
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>
2021-05-11 19:34:17 +02:00
Jiawen Wu
15f0573e92 net/txgbe: fix QinQ strip
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>
2021-05-11 18:51:21 +02:00
Chengwen Feng
7ab816640c net/hns3: fix querying flow director counter for out param
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>
2021-05-11 18:29:06 +02:00
Hongbo Zheng
9c552087dc net/hns3: fix VF alive notification after config restore
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>
2021-05-11 18:28:43 +02:00
Chengwen Feng
7d01f89fa6 net/hns3: clear hash map on flow director clear
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>
2021-05-11 18:27:25 +02:00
Chengwen Feng
f4e5c18ffa net/hns3: fix log on flow director clear
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>
2021-05-11 18:27:25 +02:00
Chengwen Feng
d9fb708a00 net/hns3: return error on PCI config write failure
This patch returns error code when calling rte_pci_write_config() API.

Fixes: 6dd32ded17 ("net/hns3: check PCI config space write")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2021-05-11 18:27:25 +02:00
Min Hu (Connor)
63a0f65c95 doc: add more description in hns3 guide
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>
2021-05-11 16:30:41 +02:00
Ciara Loftus
89233c081c net/af_xdp: fix build with Linux < 5.4
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>
2021-05-11 16:11:26 +02:00
Heinrich Kuhn
b75fc6b190 net/nfp: fix reporting of RSS capabilities
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>
2021-05-11 15:31:32 +02:00
Michal Krawczyk
1b48c60d05 net/ena: update version to v2.3.0
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>
2021-05-11 15:00:44 +02:00
Stanislaw Kardach
30a6c7ef40 net/ena: report default ring size
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>
2021-05-11 15:00:44 +02:00
Stanislaw Kardach
072b9f2bbc net/ena: handle spurious wakeups in wait event
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>
2021-05-11 15:00:44 +02:00
Stanislaw Kardach
07ebd5dd98 net/ena: remove endian swap functions
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>
2021-05-11 15:00:44 +02:00
Michal Krawczyk
9f220a959d net/ena: fix crash with unsupported device argument
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>
2021-05-11 15:00:44 +02:00
Igor Chauskin
9b312ad310 net/ena: fix parsing of large LLQ header device argument
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>
2021-05-11 15:00:44 +02:00
Amit Bernstein
7c0a233eef net/ena/base: adjust to latest ena-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>
2021-05-11 15:00:44 +02:00
Michal Krawczyk
eb357d5f86 net/ena/base: prefetch cache with intention to write
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>
2021-05-11 15:00:44 +02:00
Michal Krawczyk
71f0a44d6f net/ena/base: remove mutable RSS from host info
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>
2021-05-11 15:00:44 +02:00
Michal Krawczyk
dedd737b9f net/ena/base: remove indirection table from features context
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>
2021-05-11 15:00:44 +02:00
Michal Krawczyk
04a6a3e63a net/ena/base: destroy multiple wait events
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>
2021-05-11 15:00:43 +02:00
Michal Krawczyk
83e8d5378d net/ena/base: fix type conversions by explicit casting
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>
2021-05-11 15:00:43 +02:00
Michal Krawczyk
b19f366cc9 net/ena/base: improve style and comments
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>
2021-05-11 15:00:43 +02:00
Michal Krawczyk
ac2fd8a5ea net/ena/base: add device argument to logging macros
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>
2021-05-11 15:00:43 +02:00
Michal Krawczyk
b4f8decd38 net/ena/base: unify parameter names for functions
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>
2021-05-11 15:00:43 +02:00
Igor Chauskin
142778b370 net/ena: switch memcpy to optimized version
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>
2021-05-11 15:00:43 +02:00
Kamil Vojanec
520e3f4888 net/mlx5/linux: fix firmware version
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>
2021-05-10 11:57:49 +02:00
Viacheslav Ovsiienko
978a0303a3 net/mlx5/linux: fix missed Rx packet stats
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>
2021-05-09 11:38:33 +02:00
Viacheslav Ovsiienko
31625e6288 net/mlx5: fix Tx queue doorbell record field offset
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>
2021-05-09 11:37:15 +02:00
Jiawei Wang
09546d7b01 net/mlx5: fix RSS flow item expansion for GRE key
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>
2021-05-09 10:38:36 +02:00