DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Long Li <longli@microsoft.com>,
	Alan Elder <alan.elder@microsoft.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: "dev@dpdk.org" <dev@dpdk.org>, stephen <stephen@networkplumber.org>
Subject: Re: [PATCH v4] net/netvsc: fix parsing of VLAN metadata
Date: Thu, 15 Feb 2024 11:46:29 +0000	[thread overview]
Message-ID: <cd727ea7-6353-4b94-acde-08a93b43f315@amd.com> (raw)
In-Reply-To: <PH7PR21MB3263C50C506E47271E1B4B09CE4E2@PH7PR21MB3263.namprd21.prod.outlook.com>

On 2/14/2024 10:17 PM, Long Li wrote:
>> +#define HN_VLAN_CFI_SHIFT	12
>> +#define HN_VLAN_PRI_SHIFT	13
>> +#define HN_VLAN_PRI_MASK	0xe000 /* Priority Code Point */
>> +#define HN_VLAN_CFI_MASK	0x1000 /* Canonical Format Indicator / Drop
>> Eligible Indicator */
>> +#define HN_VLAN_VID_MASK	0x0fff /* VLAN Identifier */
>> +
>> +#define HN_VLAN_TCI_ID(vlan_tci)	((vlan_tci) & HN_VLAN_VID_MASK)
>> +#define HN_VLAN_TCI_PRI(vlan_tci)	(((vlan_tci) & HN_VLAN_PRI_MASK) >>
>> HN_VLAN_PRI_SHIFT)
>> +#define HN_VLAN_TCI_CFI(vlan_tci)	(((vlan_tci) & HN_VLAN_CFI_MASK) >>
>> HN_VLAN_CFI_SHIFT)
>> +#define HN_VLAN_TCI_MAKE(id, pri, cfi)	((id) |
>> 	\
>> +					 ((pri) << HN_VLAN_PRI_SHIFT) |	\
>> +					 ((cfi) << HN_VLAN_CFI_SHIFT))
>> +
> 
> The patch looks good.
> 
> It seems HN_VLAN_TCI_ID, HN_VLAN_TCI_PRI, HN_VLAN_TCI_CFI and HN_VLAN_TCI_MAKE could be useful to other drivers. (at least to MANA)
> 
> Ferruh, do you think we should define those common functions in ./lib/net/rte_ether.h?
> 

Hi Long,

That is good idea indeed, so others can benefit from them. Thanks.

@Alan, can you please move above macros to './lib/net/rte_ether.h', with
RTE_VLAN_ prefix? And use them from net library in the driver.

Btw, CFI seems renamed to DEI (Drop Eligible Indicator), perhaps can be
good to go with that acronym.


  reply	other threads:[~2024-02-15 11:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08 15:09 [PATCH v3] " Alan Elder
2024-02-09  1:18 ` Long Li
2024-02-09 15:50   ` [PATCH v4] " Alan Elder
2024-02-14 22:17     ` Long Li
2024-02-15 11:46       ` Ferruh Yigit [this message]
2024-02-15 18:12         ` [PATCH v5] " Alan Elder
2024-02-15 18:25           ` Stephen Hemminger
2024-02-16  9:43           ` [PATCH v6] " Alan Elder
2024-02-16 11:39             ` Ferruh Yigit
2024-02-19  9:31               ` [PATCH v7 0/2] " Alan Elder
2024-02-19  9:31               ` [PATCH v7 1/2] lib/net: " Alan Elder
2024-02-19 11:12                 ` Ferruh Yigit
2024-02-19 11:14                   ` Ferruh Yigit
2024-02-19  9:31               ` [PATCH v7 2/2] net/netvsc: " Alan Elder
2024-02-19 11:12                 ` Ferruh Yigit
2024-02-19  9:34               ` [EXTERNAL] Re: [PATCH v6] " Alan Elder
2024-02-16 11:33           ` [PATCH v5] " Ferruh Yigit

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=cd727ea7-6353-4b94-acde-08a93b43f315@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=alan.elder@microsoft.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=longli@microsoft.com \
    --cc=stephen@networkplumber.org \
    /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).