From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A3F8DA00C2; Wed, 22 Apr 2020 09:22:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 485A01C29A; Wed, 22 Apr 2020 09:22:05 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by dpdk.org (Postfix) with ESMTP id 0072B1C28F; Wed, 22 Apr 2020 09:22:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KdlIif/DuVB39ElPjR/NHwbMKUgW6xmLNGWFtl0+ApI28P3/wQEtYxQrUhGYFC/7MxSS4hOgmLqcM+dHpXoAXyaHy7WboOWYF8oLvehgYQjBrnl3bbS8x0jxdz5dEDvrykjurQR6NGS2iBZMMs+eqwYpF/QbGMQcQ247soU/qcQF3teuVlvvIZLgYQWiFVU4MJ94bwSQqOIbQyhd0fJLkMQ8d4O/llvrfuPLzoIu7xH9DBDPfkclQIiPo9hIK25we5QUZCrwmUzeaww+edMLdH3SvqW6kFP07KsEkKvUYaEi9CLnl05JIehHda+6ExcPeM9bY131BoE8LkKBlHz2gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QGQY+Dt9yjVlFpdgcwsbwb98lh1HSgZZ8UUe+ISoIMM=; b=Mw28LuQaNqrWDKpFKrlVlDNYs/+SqpBPw0/XNPCk/2HCBkZP4QskZOio1YMZOuJaREuMWjPmo5s7AMD08IxHvo4Z16JrQrVw95ggMqTMLDtMzVlg6NLotQ4Ey15hFEZDTUgO9AcMynE3t/kAfKoheETkoNHUQAO98gXCSAiqJBUAo0QBDBhB8aYgVlgcOt2yAfeLueoi8dm5xmYmdVA2E6fjzfY9lEAaHKMD5N5t7+FAksWOHGFGomAViMm00Vm6RDAWADYyT7Ejg5Q5U7EywoEhnWZFq0qs3f4smRt006dlhKX9IHmPA6+HUXBeCySoRo3PKlAJuZO9Q1WigT1QTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QGQY+Dt9yjVlFpdgcwsbwb98lh1HSgZZ8UUe+ISoIMM=; b=VV7B6SeVtnALvU0qT5vpEFA3uQUNGjpdrs2o1DHTiA3V4yuBXXosCmXz5mm3bTB3voz+j/R8q2yZBYaFxAo7vQEy8oNXWCQpCo+TB4kNh8CERyh9OxY1yExoUnIKOdEkgiFSZ2z/zEWx8oPbAX0KhVZdm6F7pFEIbqHAg7T9G1k= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (2603:10a6:20b:63::30) by AM6PR05MB4309.eurprd05.prod.outlook.com (2603:10a6:209:41::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Wed, 22 Apr 2020 07:22:02 +0000 Received: from AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::f5cd:b10f:5f1b:4b22]) by AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::f5cd:b10f:5f1b:4b22%7]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 07:22:02 +0000 From: Ori Kam To: Raslan Darawsheh , "bernard.iremonger@intel.com" , "jingjing.wu@intel.com" , "wenzhuo.lu@intel.com" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN headers Thread-Index: AQHWFyjxZfl/09l/P0CEGe8ciAorLaiEvfVg Date: Wed, 22 Apr 2020 07:22:02 +0000 Message-ID: References: <1587396746-409-1-git-send-email-rasland@mellanox.com> In-Reply-To: <1587396746-409-1-git-send-email-rasland@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [89.208.130.33] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 2aae51db-95f2-46fb-03f0-08d7e68dda7c x-ms-traffictypediagnostic: AM6PR05MB4309:|AM6PR05MB4309: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 03818C953D x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR05MB5176.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(39860400002)(396003)(136003)(376002)(366004)(186003)(54906003)(81156014)(8936002)(5660300002)(6506007)(53546011)(9686003)(33656002)(316002)(26005)(7696005)(478600001)(55016002)(110136005)(2906002)(86362001)(76116006)(66476007)(64756008)(66946007)(4326008)(66446008)(66556008)(71200400001)(52536014); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +mq1vkveYV1tzC2jgD/J/y2cpk8CwEyx9N+4fn1lb23AWsZwE6YPLnZEo96/lAYqca4EBu7vPRiH3lUmQVh1AGciLbLb89MSxkvU1ALWY42kshdIoC7bAKSnoqZFNac2oOcx5ap6C8/wF4M0zI71FaXvieN4+0yPbczVija7UWBo1sMYjQJ7RUn1UCWALg4tM+1p0p19mWU2LFUSWG5WNPVUITrXGCe7nb24JKZcXbrriD/COJzwIWqwjXZjWv4vFTzK7FAxIFQrrFDD/QrLm34cO72lcpp7Far8VTKd3UijfIUEUbsQ/ftMwTYyaMY+rHEHds7FwLdFf+UfhnWqb6UuwSI1ZyRlj37OYQNRu9dGQbwPte5OZ5uphW6zUTJdrjoP5HqP5ko/Qhv74mEtBubcDbDBzi6RhkWcUifVTPurV83n5cVKv/exWmFG32GB x-ms-exchange-antispam-messagedata: e4E0u8DaqM1bOerr8ImQBuItCwoyqoPRHUMeRaf2+sz7kLe5S/jqpvEMHcMBDHQ8uRiSsJihiqNyTYP0VT3HQbJPN4myHqqB8ZlbEnReHt9z/UiUtAnN8OlfoapTK/+MoNDWGQFs4IZC+eD/nvtzew== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2aae51db-95f2-46fb-03f0-08d7e68dda7c X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2020 07:22:02.5492 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wG3kwU4t/56FH7njorQwCIgcLkP39yEVxJxJgPcDPHCZfSq6N87SMtmdxu2Mh0CqVa9rXuwhw854d6176UF4aw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4309 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN headers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev On Behalf Of Raslan Darawsheh > Sent: Monday, April 20, 2020 6:32 PM > To: bernard.iremonger@intel.com; jingjing.wu@intel.com; > wenzhuo.lu@intel.com > Cc: dev@dpdk.org; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN > headers >=20 > When having multiple VLANs in the packet, parse_ethernet > is cabable of parsing only the first vlan. >=20 > add parsing for mutliple VLAN headers in the packet. >=20 > Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine") > Cc: stable@dpdk.org >=20 > Signed-off-by: Raslan Darawsheh > --- > app/test-pmd/csumonly.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c > index fe19615..b0665f7 100644 > --- a/app/test-pmd/csumonly.c > +++ b/app/test-pmd/csumonly.c > @@ -139,22 +139,22 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct > testpmd_offload_info *info) >=20 > /* > * Parse an ethernet header to fill the ethertype, l2_len, l3_len and > - * ipproto. This function is able to recognize IPv4/IPv6 with one option= al vlan > - * header. The l4_len argument is only set in case of TCP (useful for TS= O). > + * ipproto. This function is able to recognize IPv4/IPv6 with optional V= LAN > + * headers. The l4_len argument is only set in case of TCP (useful for T= SO). > */ > static void > parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_inf= o > *info) > { > struct rte_ipv4_hdr *ipv4_hdr; > struct rte_ipv6_hdr *ipv6_hdr; > + struct rte_vlan_hdr *vlan_hdr; >=20 > info->l2_len =3D sizeof(struct rte_ether_hdr); > info->ethertype =3D eth_hdr->ether_type; >=20 > - if (info->ethertype =3D=3D _htons(RTE_ETHER_TYPE_VLAN)) { > - struct rte_vlan_hdr *vlan_hdr =3D ( > - struct rte_vlan_hdr *)(eth_hdr + 1); > - > + while (info->ethertype =3D=3D _htons(RTE_ETHER_TYPE_VLAN)) { > + vlan_hdr =3D (struct rte_vlan_hdr *) > + ((char *)eth_hdr + info->l2_len); > info->l2_len +=3D sizeof(struct rte_vlan_hdr); > info->ethertype =3D vlan_hdr->eth_proto; > } > -- Acked-by: Ori Kam Thanks, Ori > 2.7.4