Fix inconsistencies in offload masks
cover Fix inconsistencies in offload masks
This series fixes some inconsistencies in the path offload masks and dev_info offload capabilities for the ice, iavf and i40e drivers. The first 3 patches are concerned with fixing the path offload masks. The last 3 patches change how offloads are derived for the dev_info offload capabilities. Instead of defining an explicit list of offloads, reuse the information that is already available in the path offload masks. It should help prevent further inconsistencies in the future.
Ciara Loftus (6):
net/ice: update Rx supported offloads masks net/ice: fix Rx vector path offload masks net/i40e: drop unimplemented UDP TSO from Tx mask net/ice: derive Rx/Tx offload capabilities from path masks net/iavf: derive Rx/Tx offload capabilities from path masks net/i40e: derive Rx/Tx offload capabilities from path masks
drivers/net/intel/i40e/i40e_ethdev.c | 29 +++--------------------- drivers/net/intel/i40e/i40e_rxtx.h | 1 - drivers/net/intel/iavf/iavf_ethdev.c | 34 +++++++++------------------- drivers/net/intel/ice/ice_ethdev.c | 32 ++++++-------------------- drivers/net/intel/ice/ice_rxtx.h | 6 +++-- 5 files changed, 25 insertions(+), 77 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/6 net/ice: update Rx supported offloads masks
All Rx paths support offloading the outer UDP cksum. Advertise this in the Rx path offload masks and the dev_info Rx offload capabilities.
--- drivers/net/intel/ice/ice_ethdev.c | 1 + drivers/net/intel/ice/ice_rxtx.h | 2 ++ 2 files changed, 3 insertions(+)
drivers/net/intel/ice/ice_ethdev.c +1 -0
@@ -4751,6 +4751,7 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)RTE_ETH_RX_OFFLOAD_TCP_CKSUM |RTE_ETH_RX_OFFLOAD_QINQ_STRIP |RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM | +RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM |RTE_ETH_RX_OFFLOAD_VLAN_EXTEND |RTE_ETH_RX_OFFLOAD_RSS_HASH | RTE_ETH_RX_OFFLOAD_TIMESTAMP |
drivers/net/intel/ice/ice_rxtx.h +2 -0
@@ -87,6 +87,7 @@RTE_ETH_RX_OFFLOAD_TCP_CKSUM | \RTE_ETH_RX_OFFLOAD_QINQ_STRIP | \RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM | \ +RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM | \RTE_ETH_RX_OFFLOAD_VLAN_EXTEND | \RTE_ETH_RX_OFFLOAD_RSS_HASH | \ RTE_ETH_RX_OFFLOAD_TIMESTAMP | \
@@ -100,6 +101,7 @@#define ICE_RX_VECTOR_OFFLOAD_OFFLOADS ( \ ICE_RX_VECTOR_OFFLOADS | \ RTE_ETH_RX_OFFLOAD_CHECKSUM | \ + RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM | \ RTE_ETH_RX_OFFLOAD_VLAN_STRIP | \ RTE_ETH_RX_OFFLOAD_VLAN_FILTER |\ RTE_ETH_RX_OFFLOAD_RSS_HASH)
Signature · 1 line
2.43.0
PATCH 2/6 net/ice: fix Rx vector path offload masks
In reply to Ciara LoftusThe offload RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM was advertised as available on the plain (non-offload) AVX2/AVX512 Rx paths, however only the offload versions of those paths compute checksum status flags. Move the flag to the Rx vector offload path mask where it belongs.
--- drivers/net/intel/ice/ice_rxtx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/intel/ice/ice_rxtx.h +2 -2
@@ -95,12 +95,12 @@/* basic vector paths */ #define ICE_RX_VECTOR_OFFLOADS ( \ RTE_ETH_RX_OFFLOAD_KEEP_CRC | \ - RTE_ETH_RX_OFFLOAD_SCATTER | \ - RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM) + RTE_ETH_RX_OFFLOAD_SCATTER)/* vector offload paths */ #define ICE_RX_VECTOR_OFFLOAD_OFFLOADS ( \ ICE_RX_VECTOR_OFFLOADS | \ RTE_ETH_RX_OFFLOAD_CHECKSUM | \ + RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM | \ RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM | \ RTE_ETH_RX_OFFLOAD_VLAN_STRIP | \ RTE_ETH_RX_OFFLOAD_VLAN_FILTER |\
Signature · 1 line
2.43.0
PATCH 3/6 net/i40e: drop unimplemented UDP TSO from Tx mask
In reply to Ciara LoftusCommit d9550ce576a7 ("net/intel: create common checksum Tx offload function") added RTE_ETH_TX_OFFLOAD_UDP_TSO to the scalar Tx offload mask when merging i40e's checksum helper with ice's, but UDP TSO was never actually wired up for i40e. i40e_calc_context_desc() does not trigger on RTE_MBUF_F_TX_UDP_SEG, so no context descriptor is built for UDP segmentation, and get_context_desc() only invokes i40e_set_tso_ctx() for RTE_MBUF_F_TX_TCP_SEG, so the TSO fields are never programmed for a UDP-segmented packet either.
Fix this by removing the unimplemented offload from the mask.
--- drivers/net/intel/i40e/i40e_rxtx.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/intel/i40e/i40e_rxtx.h +0 -1
@@ -97,7 +97,6 @@ enum i40e_header_split_mode {RTE_ETH_TX_OFFLOAD_SCTP_CKSUM | \RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM | \RTE_ETH_TX_OFFLOAD_TCP_TSO | \ -RTE_ETH_TX_OFFLOAD_UDP_TSO | \RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | \RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | \ RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO | \
Signature · 1 line
2.43.0
PATCH 4/6 net/ice: derive Rx/Tx offload capabilities from path masks
In reply to Ciara Loftustx_offload_capa was missing RTE_ETH_TX_OFFLOAD_UDP_TSO even though the scalar Tx path supports it. Rather than adding the missing flag to the Tx offload capabilities directly, derive tx_offload_capa from a mask of all of the Tx path offload masks.
While we are here, do the same for the Rx offload capabilities mask, which now derives itself from a mask of all of the Rx 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.
--- drivers/net/intel/ice/ice_ethdev.c | 33 +++++++----------------------- 1 file changed, 7 insertions(+), 26 deletions(-)
drivers/net/intel/ice/ice_ethdev.c +7 -26
@@ -4745,32 +4745,13 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->flow_type_rss_offloads =0 ;if (!is_safe_mode) { - dev_info->rx_offload_capa |= -RTE_ETH_RX_OFFLOAD_IPV4_CKSUM | -RTE_ETH_RX_OFFLOAD_UDP_CKSUM | -RTE_ETH_RX_OFFLOAD_TCP_CKSUM | -RTE_ETH_RX_OFFLOAD_QINQ_STRIP | -RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM | -RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM | -RTE_ETH_RX_OFFLOAD_VLAN_EXTEND | -RTE_ETH_RX_OFFLOAD_RSS_HASH | -RTE_ETH_RX_OFFLOAD_TIMESTAMP | -RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT ; - dev_info->tx_offload_capa |= -RTE_ETH_TX_OFFLOAD_QINQ_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_OUTER_UDP_CKSUM | -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 ; -if (hw->phy_model ==ICE_PHY_E830 ) - dev_info->tx_offload_capa |= -RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP ; + dev_info->rx_offload_capa =ICE_RX_SCALAR_OFFLOADS | +ICE_RX_VECTOR_OFFLOADS |ICE_RX_VECTOR_OFFLOAD_OFFLOADS ; + dev_info->tx_offload_capa =ICE_TX_SCALAR_OFFLOADS | +CI_TX_VECTOR_OFFLOADS |CI_TX_VEC_OFFLOAD_PATH_OFFLOADS | +CI_TX_VEC_CTX_OFFLOAD_PATH_OFFLOADS ; +if (hw->phy_model !=ICE_PHY_E830 ) + dev_info->tx_offload_capa &= ~RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP ; dev_info->flow_type_rss_offloads |=ICE_RSS_OFFLOAD_ALL ; }
Signature · 1 line
2.43.0
PATCH 5/6 net/iavf: derive Rx/Tx offload capabilities from path masks
In reply to Ciara Loftusrx_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.
--- drivers/net/intel/iavf/iavf_ethdev.c | 34 +++++++++------------------- 1 file changed, 11 insertions(+), 23 deletions(-)
drivers/net/intel/iavf/iavf_ethdev.c +11 -23
@@ -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 )
Signature · 1 line
2.43.0
PATCH 6/6 net/i40e: derive Rx/Tx offload capabilities from path masks
In reply to Ciara LoftusThe Rx and Tx offload capability masks duplicated the offload lists already maintained for tracking the offloads enabled on the various scalar and vector Rx and Tx paths. Instead of defining explicit lists for the offload capabilities masks, instead derive the capabilities from the path 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.
--- drivers/net/intel/i40e/i40e_ethdev.c | 29 +++------------------------- 1 file changed, 3 insertions(+), 26 deletions(-)
drivers/net/intel/i40e/i40e_ethdev.c +3 -26
@@ -3865,35 +3865,12 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_mtu = dev_info->max_rx_pktlen -I40E_ETH_OVERHEAD ; dev_info->min_mtu =RTE_ETHER_MIN_MTU ; dev_info->rx_queue_offload_capa =0 ; - 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_KEEP_CRC | -RTE_ETH_RX_OFFLOAD_SCATTER | -RTE_ETH_RX_OFFLOAD_VLAN_EXTEND | -RTE_ETH_RX_OFFLOAD_VLAN_FILTER | -RTE_ETH_RX_OFFLOAD_RSS_HASH ; + dev_info->rx_offload_capa =I40E_RX_SCALAR_OFFLOADS |I40E_RX_VECTOR_OFFLOADS ; dev_info->tx_queue_offload_capa =RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ; dev_info->tx_offload_capa = -RTE_ETH_TX_OFFLOAD_VLAN_INSERT | -RTE_ETH_TX_OFFLOAD_QINQ_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 | - dev_info->tx_queue_offload_capa; + (I40E_TX_SCALAR_OFFLOADS |I40E_TX_VECTOR_OFFLOADS ) & + ~RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM ;if (hw->mac.type ==I40E_MAC_X722 ) { dev_info->tx_offload_capa |=RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM ;
Signature · 1 line
2.43.0
Quoted 8 lines · Ciara Loftus
This series fixes some inconsistencies in the path offload masks and
dev_infooffload capabilities for the ice, iavf and i40e drivers. The first 3 patches are concerned with fixing the path offload masks. The last 3 patches change how offloads are derived for thedev_infooffload capabilities. Instead of defining an explicit list of offloads, reuse the information that is already available in the path offload masks. It should help prevent further inconsistencies in the future.
Signature · 2 lines
Thanks, Anatoly
Quoted 10 lines · Anatoly
Quoted 8 lines · Ciara Loftus
This series fixes some inconsistencies in the path offload masks and
dev_infooffload capabilities for the ice, iavf and i40e drivers. The first 3 patches are concerned with fixing the path offload masks. The last 3 patches change how offloads are derived for thedev_infooffload capabilities. Instead of defining an explicit list of offloads, reuse the information that is already available in the path offload masks. It should help prevent further inconsistencies in the future.
Quoted 2 lines
Series-acked-by Anatoly Burakov <[email protected]>
Series applied to dpdk-next-net-intel
Thanks,
/Bruce