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 52E63A00C2 for ; Thu, 23 Apr 2020 11:05:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2970F1C29C; Thu, 23 Apr 2020 11:05:41 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60056.outbound.protection.outlook.com [40.107.6.56]) by dpdk.org (Postfix) with ESMTP id 6536B1C29C; Thu, 23 Apr 2020 11:05:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S5OBxIMUnoUvPN1wlloabptfHLGjO/Jvoh1VzqguXOMWoefnjxyMUMUY3rJA6rAnJup8LljXmZO2zntgzYRxlWY9N3qsroJZFl7Ktxq+vf5Isg6LXgTdcQLBTxVzqPG2fHEV/3izx0J3m+M8wlUB382DFxynKuu7iN4RcMISX6HRbEAhmDeGBiDyQCu4u1cQlrbWy8kimubVpPrWIeTA0JFT/R1jhVzyywqlP/v9/vBLglh2d8NGyaB5c4ndbzBh4WSmg4ngn+Pc4P3safrDQxA5XNvEsWxMslCqxLggSuG2SOF9CScT5vVYMYbV3H4vzSvTFkyLuxGskQxJTz57OA== 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=jueghtL1uPiZqHJwPo8mM8TO91d4vUdNyikLNHf2x+4=; b=oZNLQM9ktJ67WV5wd2VY2kj9ZOcbFAWHBbs42NeIPW3wWaZiPXkTgXsOIMQjlicpXmjn4Wfq3GK7cHZdTUWeeFXQ4vXEDTK52SHr09Xi56q5I/pZ5Dom4tSKjte3gvsHeCO27GoEuXQ/oM3g41713jmOVM/AEXCvY53zkXyyNBLl9DmqqVIFiWMs4TfHBz8iHt3ZQLO0IeXPOqOEQhIetxY9RG6iqKRVxOTSjHBH3xH2seqigmAuCXA7lXlovVOcujfoj1xKXuuHQPbsw/GI3mJ1GI8nj9uUs68QeK4pQW3/7IPkHpRFyCj+PzYK7TTPHIrK39JpblL7mRNGF71JMw== 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=jueghtL1uPiZqHJwPo8mM8TO91d4vUdNyikLNHf2x+4=; b=NCZKQBTTXoO7s1bzVwkBGJ0CW/0nLBW8czd030cxrj7FQp/qf9jgVGMpmP0JQxoMxJ1mUxHgIjG1QWHJSOls/IEP7+QCtAkaSPHSf4PsjqpEwbAKIv6G9BnaAudPFi8gIZsMCYz0G0Y3F4ziwFeZFBhA4bk19rB/da59VwDSzi0= 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 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:05:38 +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:05:38 +0000 From: Raslan Darawsheh To: bernard.iremonger@intel.com, jingjing.wu@intel.com, wenzhuo.lu@intel.com Cc: ferruh.yigit@intel.com, dev@dpdk.org, stable@dpdk.org Date: Thu, 23 Apr 2020 12:05:26 +0300 Message-Id: <1587632726-26100-1-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587631275-25710-1-git-send-email-rasland@mellanox.com> References: <1587631275-25710-1-git-send-email-rasland@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: PR3P189CA0060.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:53::35) 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 PR3P189CA0060.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:53::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2937.13 via Frontend Transport; Thu, 23 Apr 2020 09:05:37 +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: 40d08c15-3262-4abf-65c2-08d7e7657dc1 X-MS-TrafficTypeDiagnostic: AM0PR05MB6386: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:785; 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)(2616005)(16526019)(8886007)(186003)(2906002)(26005)(8676002)(66476007)(66556008)(81156014)(55016002)(316002)(956004)(8936002)(6666004)(36756003)(4326008)(52116002)(66946007)(478600001)(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: XqU/04a4UDuxwV+v2LW8+2z+MoRnqihK0SbTpDaUsR2euQ3M2hfboMJ8xlQlKnOxXZ6ba1esK8KW98r+/AoWRtxa+X/vUagxGFHc2JcLOQowqdRUv7TSVm48/TqsfxaTPuc9tgW2Dr6dWX+AsAMK6JwYD8TJZrIr5n4qTNvt2p7M2VDCiKQ337rhYPfEBQDY4yRMpBDc3aPUHMsp9mMOzjhUkcxaicaWjR105drl/L+sX7s6M+Sa7h0XIIw8Fo/5pmZX5WazrDjEOnceBUJIFLitZAJmaD1DNy4GO5gvwOZpDF6qmbqX6ULrf6WwBlb7bE5ioT0GPog84oCZheaFGnkpY4+Faa/4+hmiVOM+fExwYBvnusHAt7Q6AUov7T5q02PjtnxHKontBV6YpvunCrXXKUMV6yi8+Fw9DP8deVuWM/TKpIP6J2ssz6lFO5b9 X-MS-Exchange-AntiSpam-MessageData: 84IYhFb2DesQAA6ot7RK/Sc6dh1Fun66bwMNgU4sNpICgTOQdeFtXiTXis5PlXbyDyuhWN66FDPRu8VmI12PbNCrjRXXvtc4M0DdD7q3qcko4UAAY/pj3xrRX6HMwcEse2lXDXv/YRqEyvr4GC4jNA== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40d08c15-3262-4abf-65c2-08d7e7657dc1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2020 09:05:38.5606 (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: GJ0cMy3+d7NlyRLqx39+MvVky+87ee4saSeY/lea0oKjkzrdyozl4juLkLDstHRDyeNPAJI0WyWt/76iCYl5QQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6386 Subject: [dpdk-stable] [PATCH v3] app/testpmd: add parsing for QINQ VLAN headers X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" When having QINQ VLAN headers in the packet, parse_ethernet is cabable of parsing only the first vlan. add parsing for QINQ VLAN headers in the packet. 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 v3: reword commit to replace Multiple with QINQ --- 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 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) || + info->ethertype == _htons(RTE_ETHER_TYPE_QINQ)) { + 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