From: Long Li <longli@microsoft.com>
To: Wei Hu <weh@microsoft.com>,
"ferruh.yigit@amd.com" <ferruh.yigit@amd.com>,
"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>,
Thomas Monjalon <thomas@monjalon.net>,
Alan Elder <alan.elder@microsoft.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH 1/1] net/mana: add vlan tagging support
Date: Tue, 20 Feb 2024 18:59:41 +0000 [thread overview]
Message-ID: <SJ1PR21MB3457DF1D34B57A6089803B0ECE502@SJ1PR21MB3457.namprd21.prod.outlook.com> (raw)
In-Reply-To: <SI2P153MB044107FBE1BC364F7C243FD3BB502@SI2P153MB0441.APCP153.PROD.OUTLOOK.COM>
> Not sure if we want to do the same. Two reasons.
>
> 1. Searching the netvsc source, I don't see a place that it set hv->vlan_strip to
> false. It means !hv->vlan_string is always false, and rte_vlan_insert(&m) never
> run.
It's set here:
drivers/net/netvsc/hn_ethdev.c: hv->vlan_strip = !!(rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP);
>
> 2. Usually vlan_strip can be set to true or false if the hardware supports this
> feature. In the mana case, the hardware strips off the vlan tag anyway. There is
> no way to tell the mana hardware to keep the tag. Adding the tag back by
> software not only slows things down, but it also complicates the code and test.
> Not sure if there is any real application needs it.
If MANA always strips the tag, you need to add the tag back if needed.
>
> I am open to add it. But in my opinion, we don't need it. Let me know what you
> think.
> >
> > > pkts[pkt_received++] = mbuf;
> > > rxq->stats.packets++;
> > > rxq->stats.bytes += mbuf->data_len; diff --git
> > > a/drivers/net/mana/tx.c b/drivers/net/mana/tx.c index
> > > 58c4a1d976..f075fcb0f5 100644
> > > --- a/drivers/net/mana/tx.c
> > > +++ b/drivers/net/mana/tx.c
> > > @@ -180,6 +180,15 @@ get_vsq_frame_num(uint32_t vsq)
> > > return v.vsq_frame;
> > > }
> > >
> > > +#define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */
> > > +#define VLAN_PRIO_SHIFT 13
> > > +#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator
> > > / Drop Eligible Indicator */
> > > +#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */
> > > +
> > > +#define mana_mbuf_vlan_tag_get_id(m) ((m)->vlan_tci &
> > > VLAN_VID_MASK)
> > > +#define mana_mbuf_vlan_tag_get_cfi(m) (!!((m)->vlan_tci &
> > > VLAN_CFI_MASK))
> > > +#define mana_mbuf_vlan_tag_get_prio(m) (((m)->vlan_tci &
> > > VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT)
> > > +
> >
> > Those definitions look like those in @Alan Elder's patch for netvsc.
> > Can we consolidate some of those definitions into a common place?
> >
> > Maybe in "lib/net/rte_ether.h"?
> >
>
> Ok. Will add it to rte_ether.h.
@Alan has sent a patch for some helper marcos for parsing vlan_tci, please use those helper marcos in
https://git.dpdk.org/next/dpdk-next-net/commit/?id=f9c66ea9b5bfd15f314f6d101f156a312121e7e1
Thanks,
Long
prev parent reply other threads:[~2024-02-20 18:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-09 8:52 Wei Hu
2024-02-09 16:06 ` Ferruh Yigit
2024-02-20 4:29 ` Wei Hu
2024-02-09 18:48 ` Long Li
2024-02-20 5:48 ` Wei Hu
2024-02-20 18:59 ` Long Li [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=SJ1PR21MB3457DF1D34B57A6089803B0ECE502@SJ1PR21MB3457.namprd21.prod.outlook.com \
--to=longli@microsoft.com \
--cc=alan.elder@microsoft.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=thomas@monjalon.net \
--cc=weh@microsoft.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).