From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0331A034D for ; Sun, 13 Mar 2022 10:01:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A47C341147; Sun, 13 Mar 2022 10:01:57 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2060.outbound.protection.outlook.com [40.107.93.60]) by mails.dpdk.org (Postfix) with ESMTP id 2F7EF4068A; Sun, 13 Mar 2022 10:01:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mn8tlP53QDaDIxfwRJADYUj4fOz8n46iRP3mrnyCIcc/eX1yaoRELmm42VnArMbgiluUCwvoiDQwpeyLIQE9OzCCwi1BiwUQYwXqcaKiA3KR8fMC6soV+S6z3WZrtsV16HYftAQEpem3yE8zWG2ctSSo7CWQW2djdcGJi/3iWuYQtq3BhteNENw4lC1AB7r+FkI4gfcUPcm6EnEMzCvehBVIpQFPn/TJvg8KT8oc47qWYNQ9mGDEY4Poqqr0xZNzduIq+I+gSVNT7kGUpyWkJ8V/EIX4Dtuq+jAu+9NwAHEKIRf33OkBXMRD9OzEDdhJnpWONQj2Hb58XXrOTYmcMw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2W+DdJiLfewozpiAjpATS1NCLHNM3Ew5Zu1Lh1TlLOs=; b=ZxM/mmZqUPQYGWJV76IRcNbEyIf5jWhfhK2lXHyWInBFRs65/zQX5GQdO7tf7P1ogxbGkeZEBsIptct3ysbM77OuVbxUJhXX0+jLhYgoF+3SthBgMb/w2e8cdMxBxGVAp8rcfcN1e1l81Ca7c7ezaWde5xzLafv3Iw+sHHTOk9Y7fJ3NwZqpZWN3Gu3FkJ1M/iecigw7aq/cbV0I3wMxaQIhXMDMYW/V1aO5+y5IpUfvxSJ1WVRBKiwgsicu0db8bY8SJG3Az+lMwBo4PpbEkp+GUD7GaGOjAp6QmOE4okSB2EEPoT4oj7aCnkbFnx9t5nO63pqJl7+k1CgfwAGKyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2W+DdJiLfewozpiAjpATS1NCLHNM3Ew5Zu1Lh1TlLOs=; b=r1klUnflnNE1qQAsRiqVMxenn3Pl/XWN5Nt/ZYkyILS0WT6kI8+OOB9xsx3/utIcweCDJAHRKQVRH31BaJw6HhM++McVAKsqXx/TR8DTSqE/zXHt2f1hU5Eq7VNXyXZsfmdvoInnzOZ6xnWgkhEkRPkYR8sbWQp4XPIuvj0lgz561AXp0HogsK5A3yhF0mPjAO8cKB2eB37pvlZ21nhSd74DYYsiqQhUAij9rkq6PozopEE0R147WZcu8tavsyBycMQzhmOtmV6RX4LTSeUu8OV6I5meZkpeOs+9YE9qEye9aAYQh/Q+C23VBaAmmgAS7wRktoumD9I5Wenqghf/dA== Received: from DS7PR03CA0326.namprd03.prod.outlook.com (2603:10b6:8:2b::28) by BN8PR12MB2980.namprd12.prod.outlook.com (2603:10b6:408:62::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Sun, 13 Mar 2022 09:01:53 +0000 Received: from DM6NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2b:cafe::1c) by DS7PR03CA0326.outlook.office365.com (2603:10b6:8:2b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.20 via Frontend Transport; Sun, 13 Mar 2022 09:01:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT016.mail.protection.outlook.com (10.13.173.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5061.22 via Frontend Transport; Sun, 13 Mar 2022 09:01:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sun, 13 Mar 2022 09:01:51 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sun, 13 Mar 2022 01:01:47 -0800 From: Gregory Etelson To: CC: , , , , Aman Singh , Xiaoyun Li , Yuying Zhang , Ferruh Yigit , Ting Xu Subject: [PATCH v2] app/testpmd: fix GTP header parsing in csum FWD engine Date: Sun, 13 Mar 2022 11:01:23 +0200 Message-ID: <20220313090124.3028-1-getelson@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310142019.13398-1-getelson@nvidia.com> References: <20220310142019.13398-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 952435bb-d71f-455b-b66a-08da04d01d71 X-MS-TrafficTypeDiagnostic: BN8PR12MB2980:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X3LrFPlpMkg/gRkoWVc0c1qCuDVs3ZJxtgqNheNZyKHzMlg8BbUXeX+SbM9XH9vYpufP3pkE6LeG/G0NxtjpVKHJ+VOVP+R6caVxNkCuxYOm6rlw5J6KbahRlhRauLxvVGR1LyTWTk4SY7im7TZdGIEvsU3bWeo687AbMd45cZ8n0RDhTrbmNGhw0Bi75xtuUI6V4q2Koms4P9SJj1WyJqrK0ZA6KYOvLRPvDhbthBWcE0sVBZ2nwkHaoNe2ZySOzoV6PieOOBRnxsnIZEI75tVhB6JBsFUmsPoXkiQgtBZh/o7EgJ/0ReuLTY0UOHQWb0JLmPOvqSIT1Q/ZW1fEdPHLGX62o/TX1JIiWfq7o8cqBY7qbeoLKV+1PzgPvXO2Be5Hs5a+Cud/SCn+lkRDgAlPKdsseH08xPvRidfeJ+uzwHD6zbFivXiBwKux2hrTA/38qvcoRwRFZtiYiLQkFGUYuxCBuFc74lSql5HKGiIyiRGaanjnXEVnbTDBj8cvNDRNn0+5xnrsWZk/Qkxh/+1UwPoXNWgOjdbKU2E9hWHFJd1Tep6cUSrGDAMDbAGqaggTKs4RElQy3rWMwzCH8ozEtLEFX3ftnRDqcen2jMUkgcV2M8AMe9JY51Ba05tqI0kqZVBuV4czLEcHyZtiQDfEE3qrX6w1V7O80Y0YLAjrYVLhab1VL7LxOBSzZj87yzTPk82SUyWo/tuvn59rig== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(83380400001)(6286002)(47076005)(316002)(186003)(6666004)(1076003)(26005)(336012)(16526019)(5660300002)(426003)(82310400004)(8936002)(2616005)(4326008)(86362001)(40460700003)(2906002)(6916009)(54906003)(7696005)(8676002)(36860700001)(36756003)(55016003)(70206006)(81166007)(70586007)(508600001)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2022 09:01:51.8796 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 952435bb-d71f-455b-b66a-08da04d01d71 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2980 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 GTP header can be followed by an optional 32 bits extension. GTP notifies about the extension presence through the E, S or PN header bits. Csum GTP header parser did not check the extension bits value. The patch updates GTP header length if at-least one of the extension bits is set. Cc: stable@dpdk.org Fixes: d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum offload") Signed-off-by: Gregory Etelson Acked-by: Aman Singh --- v2: Update the patch comment. --- app/test-pmd/csumonly.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 5274d498ee..f8abcded2b 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -223,15 +223,14 @@ parse_gtp(struct rte_udp_hdr *udp_hdr, gtp_hdr = (struct rte_gtp_hdr *)((char *)udp_hdr + sizeof(struct rte_udp_hdr)); - + if (gtp_hdr->e || gtp_hdr->s || gtp_hdr->pn) + gtp_len += sizeof(struct rte_gtp_hdr_ext_word); /* * Check message type. If message type is 0xff, it is * a GTP data packet. If not, it is a GTP control packet */ if (gtp_hdr->msg_type == 0xff) { - ip_ver = *(uint8_t *)((char *)udp_hdr + - sizeof(struct rte_udp_hdr) + - sizeof(struct rte_gtp_hdr)); + ip_ver = *(uint8_t *)((char *)gtp_hdr + gtp_len); ip_ver = (ip_ver) & 0xf0; if (ip_ver == RTE_GTP_TYPE_IPV4) { -- 2.35.1