rx_offload_capa was missing RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM even though
the scalar Rx path supports it. Rather than adding the missing flag to the
Rx offload capabilities directly, derive rx_offload_capa from a mask of all
of the Rx path offload masks.
Similarly, tx_offload_capa was missing RTE_ETH_TX_OFFLOAD_UDP_TSO despite
the Tx path already supporting and advertising this offload. Derive the
tx offload capabilities mask from a mask of all of the Tx path offload
masks.
A benefit of this is that if an offload is ever added to a path, it is
automatically reflected in the advertised capabilities too, instead of
relying on the capabilities masks in dev_info being kept manually in sync.
Some overlap will be present when masking the masks but it is kept because
relying on one path's offload mask always being a superset of another's is
fragile.
Fixes: 3b8c645afa06 ("net/iavf: fix outer checksum flags")
Fixes: 1e728b01120c ("net/iavf: rework Tx path")
Cc: [email protected]
Signed-off-by: Ciara Loftus <[email protected]>
---
drivers/net/intel/iavf/iavf_ethdev.c | 34 +++++++++-------------------
1 file changed, 11 insertions(+), 23 deletions(-)
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c
b/drivers/net/intel/iavf/iavf_ethdev.c
index a8daa507bbb..b8ca1a19e3e 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -1202,31 +1202,19 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct
rte_eth_dev_info *dev_info)
RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
dev_info->rx_offload_capa =
- RTE_ETH_RX_OFFLOAD_VLAN_STRIP |
- RTE_ETH_RX_OFFLOAD_QINQ_STRIP |
- RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |
- RTE_ETH_RX_OFFLOAD_UDP_CKSUM |
- RTE_ETH_RX_OFFLOAD_TCP_CKSUM |
- RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |
- RTE_ETH_RX_OFFLOAD_SCATTER |
- RTE_ETH_RX_OFFLOAD_VLAN_FILTER |
- RTE_ETH_RX_OFFLOAD_VLAN_EXTEND |
- RTE_ETH_RX_OFFLOAD_RSS_HASH;
+ (IAVF_RX_SCALAR_OFFLOADS | IAVF_RX_SCALAR_FLEX_OFFLOADS |
+ IAVF_RX_VECTOR_OFFLOADS | IAVF_RX_VECTOR_OFFLOAD_OFFLOADS |
+ IAVF_RX_VECTOR_FLEX_OFFLOADS |
IAVF_RX_VECTOR_OFFLOAD_FLEX_OFFLOADS) &
+ ~(RTE_ETH_RX_OFFLOAD_KEEP_CRC |
+ RTE_ETH_RX_OFFLOAD_TIMESTAMP |
+ RTE_ETH_RX_OFFLOAD_SECURITY);
dev_info->tx_offload_capa =
- RTE_ETH_TX_OFFLOAD_VLAN_INSERT |
- RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
- RTE_ETH_TX_OFFLOAD_UDP_CKSUM |
- RTE_ETH_TX_OFFLOAD_TCP_CKSUM |
- RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |
- RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |
- RTE_ETH_TX_OFFLOAD_TCP_TSO |
- RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
- RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO |
- RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO |
- RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO |
- RTE_ETH_TX_OFFLOAD_MULTI_SEGS |
- RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
+ (IAVF_TX_SCALAR_OFFLOADS | CI_TX_VECTOR_OFFLOADS |
+ CI_TX_VEC_OFFLOAD_PATH_OFFLOADS |
CI_TX_VEC_CTX_OFFLOAD_PATH_OFFLOADS) &
+ ~(RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM |
+ RTE_ETH_TX_OFFLOAD_QINQ_INSERT |
+ RTE_ETH_TX_OFFLOAD_SECURITY);
/* X710 does not support outer udp checksum */
if (adapter->hw.mac.type != IAVF_MAC_XL710)
--
2.43.0