From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: zaiyuwang@trustnetic.com, Jiawen Wu <jiawenwu@trustnetic.com>,
stable@dpdk.org
Subject: [PATCH 11/12] net/ngbe: restrict VLAN strip configuration on VF
Date: Fri, 6 Jun 2025 16:01:16 +0800 [thread overview]
Message-ID: <C15823B48F0E54CF+20250606080117.183198-12-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20250606080117.183198-1-jiawenwu@trustnetic.com>
Fix the same issue as PF in commit baca8ec066dc ("net/ngbe: restrict
configuration of VLAN strip offload").
There is a hardware limitation that Rx ring config register is not
writable when Rx ring is enabled, i.e. the TXGBE_RXCFG_ENA bit is set.
But disabling the ring when there is traffic will cause ring get stuck.
So restrict the configuration of VLAN strip offload only if device is
started.
Fixes: f47dc03c706f ("net/ngbe: add VLAN ops for VF device")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ngbe/ngbe_ethdev_vf.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ngbe/ngbe_ethdev_vf.c b/drivers/net/ngbe/ngbe_ethdev_vf.c
index 5d68f1602d..846bc981f6 100644
--- a/drivers/net/ngbe/ngbe_ethdev_vf.c
+++ b/drivers/net/ngbe/ngbe_ethdev_vf.c
@@ -828,7 +828,7 @@ ngbevf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
}
static void
-ngbevf_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)
+ngbevf_vlan_strip_q_set(struct rte_eth_dev *dev, uint16_t queue, int on)
{
struct ngbe_hw *hw = ngbe_dev_hw(dev);
uint32_t ctrl;
@@ -848,6 +848,19 @@ ngbevf_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)
ngbe_vlan_hw_strip_bitmap_set(dev, queue, on);
}
+static void
+ngbevf_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)
+{
+ struct ngbe_hw *hw = ngbe_dev_hw(dev);
+
+ if (!hw->adapter_stopped) {
+ PMD_DRV_LOG(ERR, "Please stop port first");
+ return;
+ }
+
+ ngbevf_vlan_strip_q_set(dev, queue, on);
+}
+
static int
ngbevf_vlan_offload_config(struct rte_eth_dev *dev, int mask)
{
@@ -860,7 +873,7 @@ ngbevf_vlan_offload_config(struct rte_eth_dev *dev, int mask)
for (i = 0; i < dev->data->nb_rx_queues; i++) {
rxq = dev->data->rx_queues[i];
on = !!(rxq->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP);
- ngbevf_vlan_strip_queue_set(dev, i, on);
+ ngbevf_vlan_strip_q_set(dev, i, on);
}
}
@@ -870,6 +883,13 @@ ngbevf_vlan_offload_config(struct rte_eth_dev *dev, int mask)
static int
ngbevf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
{
+ struct ngbe_hw *hw = ngbe_dev_hw(dev);
+
+ if (!hw->adapter_stopped && (mask & RTE_ETH_VLAN_STRIP_MASK)) {
+ PMD_DRV_LOG(ERR, "Please stop port first");
+ return -EPERM;
+ }
+
ngbe_config_vlan_strip_on_all_queues(dev, mask);
ngbevf_vlan_offload_config(dev, mask);
--
2.48.1
next prev parent reply other threads:[~2025-06-06 8:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250606080117.183198-1-jiawenwu@trustnetic.com>
2025-06-06 8:01 ` [PATCH 01/12] net/txgbe: support flow filter for VF Jiawen Wu
2025-06-06 8:01 ` [PATCH 02/12] net/txgbe: refactor FDIR filter to improve functionality Jiawen Wu
2025-06-06 16:23 ` Stephen Hemminger
2025-06-06 8:01 ` [PATCH 03/12] net/txgbe: fix reserved extra FDIR headroom Jiawen Wu
2025-06-06 8:01 ` [PATCH 04/12] net/txgbe: support RSS offload for SCTP port Jiawen Wu
2025-06-06 8:01 ` [PATCH 05/12] net/ngbe: " Jiawen Wu
2025-06-06 8:01 ` [PATCH 06/12] net/txgbe: fix MAC control frame forwarding Jiawen Wu
2025-06-06 8:01 ` [PATCH 07/12] net/ngbe: " Jiawen Wu
2025-06-06 8:01 ` [PATCH 08/12] net/txgbe: fix incorrect device statistics Jiawen Wu
2025-06-06 8:01 ` [PATCH 09/12] net/ngbe: " Jiawen Wu
2025-06-06 8:01 ` [PATCH 10/12] net/txgbe: restrict VLAN strip configuration on VF Jiawen Wu
2025-06-06 8:01 ` Jiawen Wu [this message]
2025-06-06 8:01 ` [PATCH 12/12] net/txgbe: add missing LRO flag in mbuf when LRO enabled Jiawen Wu
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=C15823B48F0E54CF+20250606080117.183198-12-jiawenwu@trustnetic.com \
--to=jiawenwu@trustnetic.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=zaiyuwang@trustnetic.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).