net/ena: fix offload capabilities verification
authorMichal Krawczyk <mk@semihalf.com>
Tue, 19 Oct 2021 10:56:23 +0000 (12:56 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 19 Oct 2021 13:04:17 +0000 (15:04 +0200)
commite8c838fde93f48c2a7504570aae38c06e3189fa1
tree2c571f45dbbc01963208c49ee7e1c817a697e358
parent26706314d4188d7073a40d62019b3d85f1492494
net/ena: fix offload capabilities verification

ENA PMD has multiple checksum offload flags, which are more discrete
than the DPDK offload capabilities flags.
As the driver wasn't storing it's internal checksum offload capabilities
and was relying only on the DPDK capabilities, not all scenarios could
be properly covered (like when to prepare pseudo header checksum and
when not).

Moreover, the user could request offload capability, which isn't
supported by the HW and the PMD would quietly ignore the issue.

This commit reworks eth_ena_prep_pkts() function to perform additional
checks and to properly reflect the HW requirements. With the
RTE_LIBRTE_ETHDEV_DEBUG enabled, the function will do even more
verifications, to help the user find any issues with the mbuf
configuration.

Fixes: b3fc5a1ae10d ("net/ena: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
drivers/net/ena/ena_ethdev.c
drivers/net/ena/ena_ethdev.h