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 0FD6AA00C2; Thu, 23 Apr 2020 11:01:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DFF001D572; Thu, 23 Apr 2020 11:01:23 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60046.outbound.protection.outlook.com [40.107.6.46]) by dpdk.org (Postfix) with ESMTP id 16FBE1D54E; Thu, 23 Apr 2020 11:01:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ma8GQ+7VgvpasNhC6vpr3SWu0Z6i1ADCoLy29tiV9tbeIc7DwMVQRWH55ae0sqyv5VnmHGZeb4f8HvKiGcTPgg4g9pYz0YBCrJUKMk9zpcJEWepLMyVAK7B1XUp7PHYezsGWPgO6ZyeMG5tinjHY/nHvNBkhSKggKdbH9V+5swDA6+Qod0G+2ntFxR6b9Z/6rLqWvokqmSB0vqp8j53QOhiwqUK/cKZUE0Ef/FNfI0q5ADB9vDFcEpAfJUId87EVtNFWnZt8tsLaFJM4o6K+IsLLqxKCrw35K5EHdkIWxmf9Zyd8edpycABad/p14Xw8CMOMWJo5QjuWOApNlHK7RA== 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=Gu9lXON0z8KILdsLF8LO0V14OAzPng5wQgwEsFc244s=; b=Bs8t/QPgV269Tp0uxMDrKNx4QSneD5eYc9SQTO9MLucxnkFYRU/l3ueeusGwDG8ijdMNp0v/3W9L7FCL085YwpN7qn70e92Xhr0dHaX1Aydb/sXPrV8oG/llfZ/y7QWOVZXR0tumJf/azr1EI56D7oE8MYeTOrdUZ6sTEE+05xgod5UOeXN7au1GyiWZMV9r193noY4GARkLc+pk7ZSjK36VyLmu7OlChIOk4ixyzInk+W4UQZJJTvWVobkuWzy1b0y87CfHLY43GPOH43dZPcGRdzvBubh9pQvRb930xVfgQ9CG0PeLN0nkwZxvOf5ox9WmvjVqohUF1zb+3i/YOA== 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=Gu9lXON0z8KILdsLF8LO0V14OAzPng5wQgwEsFc244s=; b=Krn4p9iOxhhEIFYN6zchwx5lgslFEPkUOvzp6B4PEb2lyQVIxusYLz/ud+/tfsnkoOgAXccfrLgme33bRwCWIaUVKuu5M5hmJ1c6VenJNpxThNF2ISPG5MehdkGE2j3g82WSVctUVY/WQvhsHwE2pboPwH2aaUW2OBcCX1u8Dx0= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB6386.eurprd05.prod.outlook.com (2603:10a6:208:13c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Thu, 23 Apr 2020 09:01:21 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e%6]) with mapi id 15.20.2921.032; Thu, 23 Apr 2020 09:01:21 +0000 From: Raslan Darawsheh To: "Iremonger, Bernard" , "Wu, Jingjing" , "Lu, Wenzhuo" CC: "Yigit, Ferruh" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] app/testpmd: add parsing for multiple VLAN headers Thread-Index: AQHWGUr5KNuFBy3ITkKhKp+JGQgxG6iGaG+AgAAAX8A= Date: Thu, 23 Apr 2020 09:01:21 +0000 Message-ID: References: <1587396746-409-1-git-send-email-rasland@mellanox.com> <1587631275-25710-1-git-send-email-rasland@mellanox.com> In-Reply-To: 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=rasland@mellanox.com; x-originating-ip: [188.161.230.216] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 40e57ea2-1fd9-4a03-452c-08d7e764e486 x-ms-traffictypediagnostic: AM0PR05MB6386: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:348; x-forefront-prvs: 03827AF76E x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(396003)(136003)(366004)(346002)(39860400002)(5660300002)(86362001)(33656002)(71200400001)(186003)(6506007)(2906002)(26005)(53546011)(9686003)(8676002)(66476007)(66556008)(64756008)(66446008)(81156014)(76116006)(55016002)(316002)(52536014)(8936002)(4326008)(110136005)(66946007)(478600001)(54906003)(7696005); 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: K+FVa+nTiRJ0ANZOZjSWOUxB9N9DZJfad0rsECOng8UlyYgEIcq6/6BDtkd3P6HvuPLxIDruJbzmYsnhhMamW3sr/6Xdcjb3XbKEgo5ecBXU8ffUsOHfFu43aVtHZMfYP4Rb1lGbrcRsUcNmT9fQtj7ouGG5gz8N4SL/41UvB6G+0ZqSklGcWRUIn9J1G7hnRY7ZCtjIAw6um0psflXcDnldlhDZdcVZH0W1XxTdi1RW9dWcC9xiOXaat7mez2gNafugi6GcDVTNMKV9EUTB8g3xvevncFSyUIfKGYtQ7bOnAsepbga3vQt+fgvY+2HHxitlf+DWe7jDNqx+f7eHzNjlCjSTcoOLKHLu17CaHaMYPnYlLMJBvA+xK6C3rhBAhpofPKCuDiTjdSVTvuzSegt7PNI5FRbamutB6UKSnhEnSybItoEsQ7CC2suJgJuE x-ms-exchange-antispam-messagedata: eSEHlzWdgDJGFS9yU/A/qWRT6xJWpXhVsBjjRum4aegXWh0VQfWn/NK7kKc2sGH7ZZCAuzCvMXYuRMXGjgVLYbKBEEg9ihTR6DXuxr01FprxYmdQZwM7jfj0JTKNimr9aimywcjCZWg2jrBH3TdNfw== x-ms-exchange-transport-forked: True 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: 40e57ea2-1fd9-4a03-452c-08d7e764e486 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2020 09:01:21.2318 (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: 8/PCVDwaVr3BsF7OSuGccOPAqyGcS9illDmkzAkIFMKAXqFarTkR5nQGnHogrDShHx/PpZsMmYvWj18avYeawQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6386 Subject: Re: [dpdk-dev] [PATCH v2] 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" Hi, > -----Original Message----- > From: Iremonger, Bernard > Sent: Thursday, April 23, 2020 12:00 PM > To: Raslan Darawsheh ; Wu, Jingjing > ; Lu, Wenzhuo > Cc: Yigit, Ferruh ; dev@dpdk.org; stable@dpdk.org > Subject: RE: [PATCH v2] app/testpmd: add parsing for multiple VLAN header= s >=20 > Hi Raslan, >=20 > > -----Original Message----- > > From: Raslan Darawsheh > > Sent: Thursday, April 23, 2020 9:41 AM > > To: Iremonger, Bernard ; Wu, Jingjing > > ; Lu, Wenzhuo > > Cc: Yigit, Ferruh ; dev@dpdk.org; > stable@dpdk.org > > Subject: [PATCH v2] app/testpmd: add parsing for multiple VLAN headers >=20 > Might be better to replace "multiple" with QINQ in the commit message. >=20 > > When having multiple VLANs in the packet, parse_ethernet is cabable of >=20 > Might be better to replace "multiple" with QINQ >=20 > > parsing only the first vlan. > > > > add parsing for mutliple VLAN headers in the packet. >=20 > Might be better to replace "multiple" with QINQ Sure, will handle in v3 >=20 > > > > Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine") > > Cc: stable@dpdk.org > > > > Signed-off-by: Raslan Darawsheh > > Acked-by: Ori Kam > > Acked-by: Bernard Iremonger > > --- > > v2: added QinQ to check for multiple vlan's > > --- > > app/test-pmd/csumonly.c | 13 +++++++------ > > 1 file changed, 7 insertions(+), 6 deletions(-) > > > > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index > > fe19615..8626223 100644 > > --- a/app/test-pmd/csumonly.c > > +++ b/app/test-pmd/csumonly.c > > @@ -139,22 +139,23 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct > > testpmd_offload_info *info) > > > > /* > > * Parse an ethernet header to fill the ethertype, l2_len, l3_len and > > - * ipproto. This function is able to recognize IPv4/IPv6 with one opti= onal > vlan > > - * header. The l4_len argument is only set in case of TCP (useful for = TSO). > > + * ipproto. This function is able to recognize IPv4/IPv6 with optional > > + VLAN > > + * headers. The l4_len argument is only set in case of TCP (useful for= TSO). > > */ > > static void > > parse_ethernet(struct rte_ether_hdr *eth_hdr, struct > > testpmd_offload_info *info) { > > struct rte_ipv4_hdr *ipv4_hdr; > > struct rte_ipv6_hdr *ipv6_hdr; > > + struct rte_vlan_hdr *vlan_hdr; > > > > info->l2_len =3D sizeof(struct rte_ether_hdr); > > info->ethertype =3D eth_hdr->ether_type; > > > > - 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) || > > + info->ethertype =3D=3D _htons(RTE_ETHER_TYPE_QINQ)) { > > + 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; > > } > > -- > > 2.7.4 > Otherwise >=20 > Acked-by: Bernard Iremonger Kindest regards, Raslan Darawsheh