<div class="__aliyun_email_body_block"><div  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun"><div  style="clear: both; font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;">Hi Stephen,</div><div  style="clear: both; font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><div  style="clear: both;"><br ></div><div  style="clear: both;">Thank you for your feedback. </div><div  style="clear: both;">We understand your technical concern regarding the VLAN offload implementation.</div><div  style="clear: both;"><br ></div><div  style="clear: both;">Our implementation choice is driven by practical customer requirements.</div><div  style="clear: both;">In real-world deployment scenarios, there is a strong expectation that basic VLAN offload capabilities are available and functional by default.</div><div  style="clear: both;">Numerous customer applications, automation scripts, and network configurations rely on these standard VLAN operations "just working,"</div><div  style="clear: both;">irrespective of whether the underlying mechanism is hardware-accelerated or software-based.<br ></div><div  style="clear: both;"><br ></div><div  style="clear: both;">Our current approach ensures that:<br ></div><div  style="clear: both;">Compatibility is maintained: Existing deployment tools and scripts function without any required modifications.<br ></div><div  style="clear: both;">Customer expectations are met: The fundamental VLAN functionality is present and operational.<br ></div><div  style="clear: both;"><br ></div><div ><span >The alternative—returning -ENOTSUP—would indeed break a significant number of existing customer deployments that</span></div><div ><span >operate under the reasonable assumption that basic VLAN features are available.</span></div><span  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><br ></span></div><div  style="clear: both; font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><span  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;">Thank you.</span></div><div  style="clear: both; font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><span  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><br ></span></div><div  style="clear: both; font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><span  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun;"><br ></span></div><blockquote  _quote="1" style="margin-right: 0px; margin-top: 0px; margin-bottom: 0px; font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);"><div  class="alimail-quote"><div  style="clear: both;">------------------------------------------------------------------</div><div  style="clear: both;">发件人:Stephen Hemminger <stephen@networkplumber.org></div><div  style="clear: both;">发送时间:2025年11月25日(周二) 23:28</div><div  style="clear: both;">收件人:Dimon<dimon.zhao@nebula-matrix.com></div><div  style="clear: both;">抄 送:dev<dev@dpdk.org>; Kyo Liu<kyo.liu@nebula-matrix.com>; Leon<leon.yu@nebula-matrix.com>; Sam<sam.chen@nebula-matrix.com></div><div  style="clear: both;">主 题:Re: 回复:[PATCH v1 1/1] net/nbl: add VLAN offload set interface</div><div  style="clear: both;"><br ></div>On Tue, 25 Nov 2025 10:28:38 +0800<br >"Dimon" <dimon.zhao@nebula-matrix.com> wrote:<br ><br >> Hi Stephen,<br >> Thank you for your review.<br >> <a  href="http://patches.dpdk.org/project/dpdk/patch/20251107073459.3532524-3-dimon.zhao@nebula-matrix.com/" target="_blank">http://patches.dpdk.org/project/dpdk/patch/20251107073459.3532524-3-dimon.zhao@nebula-matrix.com/</a> <<a  href="http://patches.dpdk.org/project/dpdk/patch/20251107073459.3532524-3-dimon.zhao@nebula-matrix.com/" target="_blank">http://patches.dpdk.org/project/dpdk/patch/20251107073459.3532524-3-dimon.zhao@nebula-matrix.com/</a> ><br >> In this previous commit, the driver is advertising RTE_ETH_RX_OFFLOAD_VLAN_STRIP<br >> in the offload flags. Because we do not support QINQ and FILTER,<br >> we are not advertising QINQ or FILTER flags.<br >> dev_info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_VLAN_INSERT;<br >> dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_VLAN_STRIP;<br >> In this previous commit, we simulate support for Tx and Rx VLAN offload,<br >> while in reality we handle Tx VLAN insertion and Rx VLAN stripping in software.<br >> For Rx VLAN stripping, the driver uses rte_vlan_strip to achieve this functionality.<br >> It does not have the capability to do this in hardware.<br >> So when enabling or disabling Rx VLAN stripping, the driver and hardware do not need to do anything.<br >> Why vlan_offload_set is Required?<br >> The rte_eth_dev_set_vlan_offload function has this flow:<br >> int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask)<br >> {<br >>  // ...<br >>  if (dev->dev_ops->vlan_offload_set == NULL)<br >>  return -ENOTSUP; // This causes the error!<br >>  // ...<br >>  ret = dev->dev_ops->vlan_offload_set(dev, mask);<br >> }<br >> Without implementing vlan_offload_set, users get -ENOTSUP error when running:<br >> testpmd> vlan set strip on 0  <br >> Since hardware doesn't need configuration changes, our implementation is minimal:<br >> int nbl_vlan_offload_set(__rte_unused struct rte_eth_dev *dev, <br >>  __rte_unused int mask)<br >> {<br >>  // No hardware configuration needed - everything handled in software<br >>  return 0;<br >> }<br >> ------------------------------------------------------------------<br >> 发件人:Stephen Hemminger <stephen@networkplumber.org><br >> 发送时间:2025年11月25日(周二) 07:35<br >> 收件人:Dimon<dimon.zhao@nebula-matrix.com><br >> 抄 送:dev<dev@dpdk.org>; Kyo Liu<kyo.liu@nebula-matrix.com>; Leon<leon.yu@nebula-matrix.com>; Sam<sam.chen@nebula-matrix.com><br >> 主 题:Re: [PATCH v1 1/1] net/nbl: add VLAN offload set interface<br >> On Sun, 23 Nov 2025 19:40:26 -0800<br >> Dimon Zhao <dimon.zhao@nebula-matrix.com> wrote:<br >> > The rte_eth_dev_set_vlan_offload function internally calls<br >> > the vlan_offload_set interface, so we must implement this function.<br >> > Otherwise, an error will occur when<br >> > executing the vlan set strip on command.<br >> > <br >> > Fixes: 9d7757dce874 ("net/nbl: simulate VLAN offload")<br >> > <br >> > Signed-off-by: Dimon Zhao <dimon.zhao@nebula-matrix.com><br >> > ---<br >> > drivers/net/nbl/nbl_dev/nbl_dev.c | 5 +++++<br >> > drivers/net/nbl/nbl_dev/nbl_dev.h | 1 +<br >> > drivers/net/nbl/nbl_ethdev.c | 1 +<br >> > 3 files changed, 7 insertions(+)<br >> > <br >> > diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.c b/drivers/net/nbl/nbl_dev/nbl_dev.c<br >> > index 58eb1c6231..923de2e9d0 100644<br >> > --- a/drivers/net/nbl/nbl_dev/nbl_dev.c<br >> > +++ b/drivers/net/nbl/nbl_dev/nbl_dev.c<br >> > @@ -758,6 +758,11 @@ int nbl_promiscuous_disable(struct rte_eth_dev *eth_dev)<br >> > return 0;<br >> > }<br >> > <br >> > +int nbl_vlan_offload_set(__rte_unused struct rte_eth_dev *dev, __rte_unused int mask)<br >> > +{<br >> > + return 0;<br >> > +}  <br >> This seems broken in handling VLAN.<br >> The intention is that the driver changes how vlans handled based on the mask<br >> in the API call. <br >> The driver is not advertising RTE_ETH_VLAN_STRIP_OFFLOAD in the offload flags.<br >> Same for QINQ or FILTER flags.<br >> What is the intention? How is the hardware handling VLAN tags? Does it<br >> have the capability to do this in hardware? Can it be enabled and disabled?<br ><br ><br >If device does not support VLAN offload then it is correct for any<br >attempts to change the mask to return -ENOTSUP. This is what happens<br >now with all of these kind of devices.<br ><br >You could make an argument that at the ethdev shim layer, requests<br >to disable any feature that a device could not support could be reported<br >as allowed. But that is such a odd case, that it is more logical to<br >argue that: "Any change to offload X should be reported as non supported<br >unless the device reports it can do feature X".<br ><br >If you have some customer or internal script expecting testpmd<br >to always allow vlan strip 0 then that is the real issue.</div></blockquote><div  style="line-height: 20px; clear: both;"><br ></div></div></div>
<div style="clear: both;"><span style="font-size: 10px; color: rgb(216, 216, 216);">本邮件所含信息及其任何附件为保密信息且可能属于专有信息。任何非指定接收人均无权访问本邮件。如果您不是该邮件的指定接收人,那么任何对本邮件内容进行披露,复制或使用的行为均是禁止的。如果您不是该邮件的指定接收人,请您立即通过邮件通知 compliance@nebula-matrix.com并立即删除您错误接受的邮件。</span></div><div style="clear: both;"><span style="font-size: 10px; color: rgb(216, 216, 216);">The information in this message and any attachments is confidential and may be privileged.  Access to this email by anyone other than the intended recipient is not authorized.  If you are not the intended recipient, disclosure, copying or use of the contents of this email is prohibited.  If you are not the intended recipient, please notify  compliance@nebula-matrix.com immediately by email, and please destroy the email you received in error.</span></div>