DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dimon Zhao <dimon.zhao@nebula-matrix.com>
Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v2] net/nbl: add VLAN offload set interface
Date: Wed, 26 Nov 2025 16:37:14 -0800	[thread overview]
Message-ID: <20251127003821.76733-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20251124034026.3680873-1-dimon.zhao@nebula-matrix.com>

From: Dimon Zhao <dimon.zhao@nebula-matrix.com>

Implement the vlan_offload_set device operation to allow
enabling or disabling VLAN offloads through the API.

rte_eth_dev_set_vlan_offload() calls the driver to update the hardware
configuration. Because this driver performs VLAN stripping entirely in
software, only a dummy implementation is needed to avoid returning an
error.

Validation of unsupported or invalid flags is already handled in ethdev.

Fixes: 9d7757dce874 ("net/nbl: simulate VLAN offload")

Signed-off-by: Dimon Zhao <dimon.zhao@nebula-matrix.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
v2 - reworded the commit message and added a comment
     (want ok from original submitter)

 drivers/net/nbl/nbl_dev/nbl_dev.c | 9 +++++++++
 drivers/net/nbl/nbl_dev/nbl_dev.h | 1 +
 drivers/net/nbl/nbl_ethdev.c      | 1 +
 3 files changed, 11 insertions(+)

diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.c b/drivers/net/nbl/nbl_dev/nbl_dev.c
index 58eb1c6231..e926c06456 100644
--- a/drivers/net/nbl/nbl_dev/nbl_dev.c
+++ b/drivers/net/nbl/nbl_dev/nbl_dev.c
@@ -758,6 +758,15 @@ int nbl_promiscuous_disable(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
+int nbl_vlan_offload_set(__rte_unused struct rte_eth_dev *dev, __rte_unused int mask)
+{
+	/*
+	 * No hardware or state change needed since
+	 * receive does VLAN in software based on rxmode.offload
+	 */
+	return 0;
+}
+
 static int nbl_dev_setup_chan_queue(struct nbl_adapter *adapter)
 {
 	struct nbl_dev_mgt *dev_mgt = NBL_ADAPTER_TO_DEV_MGT(adapter);
diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.h b/drivers/net/nbl/nbl_dev/nbl_dev.h
index c8a5a4670b..21d87a372d 100644
--- a/drivers/net/nbl/nbl_dev/nbl_dev.h
+++ b/drivers/net/nbl/nbl_dev/nbl_dev.h
@@ -95,5 +95,6 @@ int nbl_xstats_reset(struct rte_eth_dev *eth_dev);
 int nbl_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu);
 int nbl_promiscuous_enable(struct rte_eth_dev *eth_dev);
 int nbl_promiscuous_disable(struct rte_eth_dev *eth_dev);
+int nbl_vlan_offload_set(__rte_unused struct rte_eth_dev *dev, __rte_unused int mask);
 
 #endif
diff --git a/drivers/net/nbl/nbl_ethdev.c b/drivers/net/nbl/nbl_ethdev.c
index a3b963e9cc..d269ea8058 100644
--- a/drivers/net/nbl/nbl_ethdev.c
+++ b/drivers/net/nbl/nbl_ethdev.c
@@ -45,6 +45,7 @@ const struct eth_dev_ops nbl_eth_dev_ops = {
 	.mtu_set = nbl_mtu_set,
 	.promiscuous_enable = nbl_promiscuous_enable,
 	.promiscuous_disable = nbl_promiscuous_disable,
+	.vlan_offload_set = nbl_vlan_offload_set,
 };
 
 static int nbl_eth_dev_init(struct rte_eth_dev *eth_dev)
-- 
2.51.0


      parent reply	other threads:[~2025-11-27  0:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07  7:34 [PATCH v1 0/4] NBL add new features Dimon Zhao
2025-11-07  7:34 ` [PATCH v1 1/4] net/nbl: change default Rx extension header size to 12 bytes Dimon Zhao
2025-11-11 14:32   ` Stephen Hemminger
2025-11-07  7:34 ` [PATCH v1 2/4] net/nbl: add support for Tx and Rx VLAN offload Dimon Zhao
2025-11-07 16:10   ` Stephen Hemminger
2025-11-10  8:17     ` 回复:[PATCH " Dimon
2025-11-07  7:34 ` [PATCH v1 3/4] net/nbl: add support for imissed stats Dimon Zhao
2025-11-07 16:05   ` Stephen Hemminger
2025-11-07  7:34 ` [PATCH v1 4/4] net/nbl: update documentation and maintainers Dimon Zhao
2025-11-09 20:16   ` Stephen Hemminger
2025-11-10  8:56     ` 回复:[PATCH " Dimon
2025-11-11 11:31 ` [PATCH v2 0/4] NBL add new features Dimon Zhao
2025-11-11 11:31   ` [PATCH v2 1/4] net/nbl: change default Rx extension header size to 12 bytes Dimon Zhao
2025-11-11 11:31   ` [PATCH v2 2/4] net/nbl: add support for Tx and Rx VLAN offload Dimon Zhao
2025-11-11 11:31   ` [PATCH v2 3/4] net/nbl: add support for imissed stats Dimon Zhao
2025-11-11 11:31   ` [PATCH v2 4/4] net/nbl: add IOVA mode check in Coexistence Dimon Zhao
2025-11-11 21:19     ` Thomas Monjalon
2025-11-24  3:40   ` [PATCH v1 0/1] fix NBL Rx VLAN issues in DPDK 25.11-rc3 Dimon Zhao
2025-11-24  3:40     ` [PATCH v1 1/1] net/nbl: add VLAN offload set interface Dimon Zhao
2025-11-24 23:35       ` Stephen Hemminger
2025-11-25  2:28         ` 回复:[PATCH " Dimon
2025-11-25 15:27           ` Stephen Hemminger
2025-11-26  1:52             ` 回复:回复:[PATCH " Dimon
2025-11-26 22:16               ` Stephen Hemminger
2025-11-24 15:44     ` [PATCH v1 0/1] fix NBL Rx VLAN issues in DPDK 25.11-rc3 Patrick Robb
2025-11-27  0:37     ` Stephen Hemminger [this message]

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=20251127003821.76733-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=dimon.zhao@nebula-matrix.com \
    /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;
as well as URLs for NNTP newsgroup(s).