DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Robin Jarry" <rjarry@redhat.com>
To: "Kevin Traynor" <ktraynor@redhat.com>, <dev@dpdk.org>,
	"Gregory Etelson" <getelson@nvidia.com>
Cc: <stable@dpdk.org>
Subject: Re: [PATCH dpdk v3] net: fix VLAN packet type
Date: Thu, 23 Apr 2026 11:49:47 +0200	[thread overview]
Message-ID: <DI0FVI2TG9UU.JRHQ224VBSMW@redhat.com> (raw)
In-Reply-To: <66613eae-13f6-42f9-bada-d1f3b5d9cee0@redhat.com>

Kevin Traynor, Apr 23, 2026 at 11:19:
> Not shown in diff, but for:
>
> 		pkt_type |=
> 			proto == rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN) ?
> 				 RTE_PTYPE_L2_ETHER_VLAN :
> 				 RTE_PTYPE_L2_ETHER_QINQ;
>
> It seems to be produce the right result, but I'm not sure we should be
> treating the ptype L2 defines as bitmasks. Maybe I'm wrong and it was
> planned, but it looks like a coincidence it works now because QINQ (0x7)
> happens to be a superset of VLAN (0x6) for the OR.
>
> Perhaps you could check vlan_depth and assign VLAN or QINQ based on that?

I hadn't considered this. It would make sense to have something like:

l3:
	switch (vlan_depth) {
	case 0:
		pkt_type = RTE_PTYPE_L2_ETHER;
		break;
	case 1:
		pkt_type = RTE_PTYPE_L2_ETHER_VLAN;
		break;
	default:
		pkt_type = RTE_PTYPE_L2_ETHER_QINQ;
		break;
	}

Mind that this will report RTE_PTYPE_L2_ETHER_QINQ even if we have
double stacked 802.1Q tags (ether type 0x8100) and no 802.1ad S-tag
(QinQ 0x88A8). I don't think this is an issue, but I'll let you judge.

I can send a v4 with this if that suits you.


  reply	other threads:[~2026-04-23  9:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 10:28 [PATCH dpdk] net: fix L2 ptype assignment in VLAN loop Robin Jarry
2026-04-22 10:35 ` Robin Jarry
2026-04-22 10:38 ` [PATCH dpdk v2] " Robin Jarry
2026-04-22 13:16   ` Thomas Monjalon
2026-04-22 13:18     ` Robin Jarry
2026-04-22 13:23   ` David Marchand
2026-04-22 13:32 ` [PATCH dpdk v3] net: fix VLAN packet type Robin Jarry
2026-04-23  9:19   ` Kevin Traynor
2026-04-23  9:49     ` Robin Jarry [this message]
2026-04-23 10:59       ` Kevin Traynor
2026-04-23 11:11         ` Robin Jarry
2026-04-23 11:24 ` [PATCH dpdk v4] " Robin Jarry
2026-04-24 16:18   ` Kevin Traynor
2026-04-25  8:40   ` David Marchand
2026-04-27 10:47     ` Robin Jarry
2026-04-27 15:53       ` Thomas Monjalon
2026-04-30 10:12         ` David Marchand
2026-04-30 11:06           ` Morten Brørup
2026-05-15 11:17     ` Kevin Traynor

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=DI0FVI2TG9UU.JRHQ224VBSMW@redhat.com \
    --to=rjarry@redhat.com \
    --cc=dev@dpdk.org \
    --cc=getelson@nvidia.com \
    --cc=ktraynor@redhat.com \
    --cc=stable@dpdk.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