DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ciara Loftus <ciara.loftus@intel.com>
To: dev@dpdk.org
Cc: Ciara Loftus <ciara.loftus@intel.com>
Subject: [PATCH 6/6] net/i40e: derive Rx/Tx offload capabilities from path masks
Date: Thu, 24 Sep 2026 13:13:46 +0000	[thread overview]
Message-ID: <20260924131346.100156-7-ciara.loftus@intel.com> (raw)
In-Reply-To: <20260924131346.100156-1-ciara.loftus@intel.com>

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

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 drivers/net/intel/i40e/i40e_ethdev.c | 29 +++-------------------------
 1 file changed, 3 insertions(+), 26 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index defdff0378f..5d6102cae7b 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -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;
-- 
2.43.0


  parent reply	other threads:[~2026-09-24 13:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 13:13 [PATCH 0/6] Fix inconsistencies in offload masks Ciara Loftus
2026-09-24 13:13 ` [PATCH 1/6] net/ice: update Rx supported offloads masks Ciara Loftus
2026-09-24 13:13 ` [PATCH 2/6] net/ice: fix Rx vector path offload masks Ciara Loftus
2026-09-24 13:13 ` [PATCH 3/6] net/i40e: drop unimplemented UDP TSO from Tx mask Ciara Loftus
2026-09-24 13:13 ` [PATCH 4/6] net/ice: derive Rx/Tx offload capabilities from path masks Ciara Loftus
2026-09-24 13:13 ` [PATCH 5/6] net/iavf: " Ciara Loftus
2026-09-24 13:13 ` Ciara Loftus [this message]
2026-09-25 10:50 ` [PATCH 0/6] Fix inconsistencies in offload masks Burakov, Anatoly
2026-09-25 13:29   ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260924131346.100156-7-ciara.loftus@intel.com \
    --to=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox