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 4F177A0561; Mon, 20 Apr 2020 17:32:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0AB4B1D691; Mon, 20 Apr 2020 17:32:39 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70043.outbound.protection.outlook.com [40.107.7.43]) by dpdk.org (Postfix) with ESMTP id D04D51D686; Mon, 20 Apr 2020 17:32:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SwzNtwKZ+AxudnSTG2W5lie9q5NYpBc5hpn+MdQMHRXFaW5Yx4V/4dFUnGG48dal2aDu/k9JttMdyqr57teH8cqC+hdonQqjG1V4ihBoeoaPxqY5wOD3t4B9vRVkNtcmuEQbeQhN8klewJFTinTzFyVIGIZ1YWroceZkp83JTdOZMhQVyK9gMDitrYs86cyseyc0rY6dflBVrBnF1T+Bpz0dgD31zjAS1jKiLUP7hN74mKw8W7MTznUTL8LjK0SDfTJrDy+pE2fP8ejwJcz5htFRmhQRH8Xy9ufdnroAlsRi2v9gKeFoEu+s9BReXeyVHgZGCXIZi5pseEUi9Qhfew== 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=31MFCg0KR1dCrH2wiJY/hNr9RpqOaTuFPMWp/59j8Eg=; b=JDUOeyZDBdinJb3ghLJxZ6f4ZSXF5072w0I0unKpQlSvcbMgbLrjZ7pEY4wPvPOgGG4bLyDg/P2VfLYtgx/n7a3QMgP7zAjCbC1qtzUQAn7dAbnfrolQih7krgqcM1+mwdOqN7hDjKgKvWYLLaeevOe9JfTwVUTsDiQ1aHIP8Zu3XtVMkcLKBGLjxPSLG2lTHxazE9kYlOzSLy4EBbLA5E/7P35wBvpqzf7pncmWREjGrDL/dpwbwRna3CCX5Dl6kTvvMEYGc9wotQGb/ChvFjcPaFsAgiN/wn9ic1gCcVAxFwBj9LGpUaVzCGTqextQ3iIG6itmQ2gU6Bamj5cKRw== 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=31MFCg0KR1dCrH2wiJY/hNr9RpqOaTuFPMWp/59j8Eg=; b=nnX4gLNv0J+8gGfPhgaLEWleZqWA22m+oQwuUxqUOxYYP1xIiC4jYYPNlMi7cxBQfneT/VU3RHGd8H6c5jmPkiBMdYqeib4Jdv/wWzFppxiRTo1NKX7yB9P1Iboa47mMgWKSnQyV+zBhfqFDBAIGg3F+x8q4+FRGN8mpwxgQ5X8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB6804.eurprd05.prod.outlook.com (2603:10a6:20b:146::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25; Mon, 20 Apr 2020 15:32:36 +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.030; Mon, 20 Apr 2020 15:32:36 +0000 From: Raslan Darawsheh To: bernard.iremonger@intel.com, jingjing.wu@intel.com, wenzhuo.lu@intel.com Cc: dev@dpdk.org, stable@dpdk.org Date: Mon, 20 Apr 2020 18:32:26 +0300 Message-Id: <1587396746-409-1-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 Content-Type: text/plain X-ClientProxiedBy: PR0P264CA0164.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1b::32) To AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by PR0P264CA0164.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2921.25 via Frontend Transport; Mon, 20 Apr 2020 15:32:35 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cbf5e747-1ab0-4fd2-9206-08d7e5400d9e X-MS-TrafficTypeDiagnostic: AM0PR05MB6804: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 03793408BA 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:(10009020)(4636009)(136003)(39860400002)(396003)(376002)(346002)(366004)(81156014)(36756003)(8886007)(66946007)(8936002)(5660300002)(26005)(478600001)(66556008)(66476007)(316002)(6666004)(186003)(16526019)(7696005)(2616005)(52116002)(956004)(4326008)(2906002)(8676002)(86362001)(55016002); 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: ETWga4G/XY5wzPiN2awkWLh9bgmSJAxr8Ze2wG3kt8UXfwK8PqTGf4EXsLA00tVA5yTfOrbIKNHXLUnIwDdcfC2L03POvY/oF13P5uC9B5+/7BapwcerEEpLWEJb+GZIQjMoX+/cYKuTQA5SwVEnhjMpeQz5uzprK3zSn+1BcLJzL/AyEml9VdDEpWmdrc9XGAIgwuDX3aeRPPnawoDoNjI2jqmrX2ZZCyJyAnm7W8S3j6IFW2Td7g2WjCJzph15kmdu47bRgD/HkxbSXP0W6Dei859xr4CqLwZHVbWu79paG3fRC9UaYAngXIpMsRal/t6ZdD+3HjHE8wCeYtd37Y/teYzUoc75ZzhyMnXeIkBV1vdCbp1q9dc+UAdnpRwYfbWPqIp7iZvr5S7l2LZ5wKXpNuYBiBNir4DKZuq7m7HskLCACuAuYT6chuTxDpk3 X-MS-Exchange-AntiSpam-MessageData: qkWokPS0nywgpyIU1aNtD38QCEJBtWoX5tCUb/d74TS0dXuK7UDlDmJRnWUfaa529q2yGBNDPyXJgmFy54vZrSskPyeErAkSXKZdYwrQliPAqSK35qdod92ADoL4o8mIOJpCezcpXe8o/Z0vBhAluQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbf5e747-1ab0-4fd2-9206-08d7e5400d9e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2020 15:32:36.7299 (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: NozhcVMaE101/+scSZAjZ3rRCzCHGgLdIaJbyu5Uu/62dMr8nq//0mXfc4HPUl8RfLhF3h49HTZ4DPRE73E7mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6804 Subject: [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" When having multiple VLANs in the packet, parse_ethernet is cabable of parsing only the first vlan. add parsing for mutliple VLAN headers in the packet. Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine") Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh --- app/test-pmd/csumonly.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) /* * Parse an ethernet header to fill the ethertype, l2_len, l3_len and - * ipproto. This function is able to recognize IPv4/IPv6 with one optional 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 = sizeof(struct rte_ether_hdr); info->ethertype = eth_hdr->ether_type; - if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) { - struct rte_vlan_hdr *vlan_hdr = ( - struct rte_vlan_hdr *)(eth_hdr + 1); - + while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) { + vlan_hdr = (struct rte_vlan_hdr *) + ((char *)eth_hdr + info->l2_len); info->l2_len += sizeof(struct rte_vlan_hdr); info->ethertype = vlan_hdr->eth_proto; } -- 2.7.4