tx_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.

Fixes: 623ca7a15db4 ("net/ice: enable UDP fragmentation offload")
Cc: [email protected]

Signed-off-by: Ciara Loftus <[email protected]>
---
 drivers/net/intel/ice/ice_ethdev.c | 33 +++++++-----------------------
 1 file changed, 7 insertions(+), 26 deletions(-)

diff --git a/drivers/net/intel/ice/ice_ethdev.c 
b/drivers/net/intel/ice/ice_ethdev.c
index 2722f359cb3..b8e703c6956 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -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;
        }
 
-- 
2.43.0

Reply via email to