DPDK patches and discussions
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@nvidia.com>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	"NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"haijie1@huawei.com" <haijie1@huawei.com>
Subject: Re: [PATCH v2] app/testpmd: fix VLAN header parsing
Date: Mon, 24 Mar 2025 09:40:40 +0000	[thread overview]
Message-ID: <CH3PR12MB84609D51CB1C8A9B3EE5EA66CFA42@CH3PR12MB8460.namprd12.prod.outlook.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9FB4A@smartserver.smartshare.dk>

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

>> -                     eth_hdr->ether_type == _htons(RTE_ETHER_TYPE_QINQ)) {
>> -                     vlan_hdr = (struct rte_vlan_hdr *)
>> -                             ((char *)eth_hdr + sizeof(*eth_hdr));
>> +             vlan_hdr = (struct rte_vlan_hdr *) RTE_PTR_ADD(eth_hdr,
>> +                              offsetof(struct rte_ether_hdr, ether_type));
>> +             while ((ethertype == _htons(RTE_ETHER_TYPE_VLAN) ||
>> +                     ethertype == _htons(RTE_ETHER_TYPE_QINQ))) {

>Two details:
>1. Lines continuing on the next line must be indented by two TABs.
>2. Please add the boundary check, as requested by Stephen. (I realize this mail may have crossed my response arguing why it is required.)

Sure, I’ve sent a V3 having these fixed thanks for your review and comments.

>> +                     vlan_hdr++;
>>                        ethertype = vlan_hdr->eth_proto;
>>                }
>>                return ethertype;
>> --
>> 2.39.5 (Apple Git-154)

[-- Attachment #2: Type: text/html, Size: 5261 bytes --]

  reply	other threads:[~2025-03-24  9:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-23 12:28 [PATCH] " Raslan Darawsheh
2025-03-23 13:14 ` Morten Brørup
2025-03-24  7:34   ` Raslan Darawsheh
2025-03-24  7:43     ` Morten Brørup
2025-03-24  7:44     ` Morten Brørup
2025-03-24  8:32       ` Raslan Darawsheh
2025-03-24  8:45         ` Morten Brørup
2025-03-23 16:00 ` Stephen Hemminger
2025-03-24  7:37   ` Raslan Darawsheh
2025-03-23 16:39 ` Thomas Monjalon
2025-03-24  7:38   ` Raslan Darawsheh
2025-03-24  8:50 ` [PATCH v2] " Raslan Darawsheh
2025-03-24  9:04   ` Morten Brørup
2025-03-24  9:40     ` Raslan Darawsheh [this message]
2025-03-24  9:33 ` [PATCH v3] " Raslan Darawsheh
2025-03-24 13:18   ` Morten Brørup
2025-03-24 16:59     ` Thomas Monjalon

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=CH3PR12MB84609D51CB1C8A9B3EE5EA66CFA42@CH3PR12MB8460.namprd12.prod.outlook.com \
    --to=rasland@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=haijie1@huawei.com \
    --cc=mb@smartsharesystems.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).