DPDK patches and discussions
 help / color / mirror / Atom feed
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: Fri, 9 Feb 2024 18:48:11 +0000	[thread overview]
Message-ID: <PH7PR21MB326397294D17E722F5F46D72CE4B2@PH7PR21MB3263.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20240209085211.2643148-1-weh@microsoft.com>

> +		if (oob->rx_vlan_tag_present) {
> +			mbuf->ol_flags |=
> +				RTE_MBUF_F_RX_VLAN |
> RTE_MBUF_F_RX_VLAN_STRIPPED;
> +			mbuf->vlan_tci = oob->rx_vlan_id;
> +		}
> +

Netvsc has the following code for dealing with vlan on RX mbufs (in hn_rxtx.c):
                /* NDIS always strips tag, put it back if necessary */
                if (!hv->vlan_strip && rte_vlan_insert(&m)) {

It seems we should do the same?

>  		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"?

Thanks,

Long

  parent reply	other threads:[~2024-02-09 18:48 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 [this message]
2024-02-20  5:48   ` Wei Hu
2024-02-20 18:59     ` Long Li

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=PH7PR21MB326397294D17E722F5F46D72CE4B2@PH7PR21MB3263.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).