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 95832A0093; Thu, 10 Mar 2022 15:20:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51F354113F; Thu, 10 Mar 2022 15:20:46 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2060.outbound.protection.outlook.com [40.107.236.60]) by mails.dpdk.org (Postfix) with ESMTP id AE2F64113E; Thu, 10 Mar 2022 15:20:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FDGqtaGasfHVTEP/gQnb+ZKgFdQU8JwwqerPa3abSehcImmyQhgVPSV9wj5SlopBHTwLhu5eeSpzHKpGzzp+E8DzpTFhw4uEdTrePq0xEEhmmHrRShYDu9iSthgygKjp3OXIELT6cwYT7L8bZrCnG4L8jPvZw+3pS9GHpKbaSF7fqhLIRvibIQpQI+YWc/Yvu0E02UEiqpFoh6fr+AbMv5j+BxrN/t7JK2I08KkXGuYdMPOo1MRosAfH3dT0HDvyzsogfXNSEXGQkKh5zdBf8ApoEy3ojypEgbx+n9Wfmct1iD/pqD8zuNuILFw8Y7oKShymmqxW6H9kwIUTdPfEtg== 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=gqi+b1xrsSlP73cu5f+lLzVPXX5CVMmvufXx/MuAXzw=; b=GzuwkiBS09H2QdFQpgmrXyiOFDl6SDZcmSIkDS5bqFWntDzRGCJG42XdfH+f62N/IsIGxAV8KckDh88u2ELryJYtN+MXJTeR6npBXsMsVJlshHSrD5NHBncD9ytdv1d2Hg4jYLr+KEx/ORxJ+NGaQmgdQVBOt4zXqbq8zzFSbB4pBetoFgGE0VQm/aeMZ5C+yv99yQDkPRNDEl0EbYL0Pqo9vj3Fywlk3u/QospU7uwC+uiA+F7fEMeu4k+OOfxgCrCCnQJQSUqITd1xT+jdWv6YDUdUOfcpWXAWb8cyycGq5WJCMIDjgQFx2DhljuyqflKBEFUbFPkb0Ry5xJB1lQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=gqi+b1xrsSlP73cu5f+lLzVPXX5CVMmvufXx/MuAXzw=; b=kqsQj1t4q9YMxj7UvNFGs3mtTBkQPcFRv46H51f5CLA0678WJi/jDe4e+uB/KfJgyVjLfGCJB/gZ9BcL1U55BR0WL8EWi2PBrdWbCSDWDkcFE1yPkiFW2bcnoDEgGlGQMVv+7ZFyLgqKYW+CwVF1BUSkkoCxr/VUnJn2xvLPzIYs8T7CzGcu3T1JbSBNY0l4YjBCRn16nBHjaP0S29j5we9hduCNOHXlhhgSQgrrz9BPGuxhXRK/FMDPFrS+cLOsiVbgnfGcPdj83o7upynFyzWbWGQi5gO2iQEzByh42Tl2qxzbEX0d/z6mu0i6iTRGVbh53H4Ee2bl0ovsb/gVCw== Received: from BN8PR04CA0041.namprd04.prod.outlook.com (2603:10b6:408:d4::15) by BN8PR12MB3380.namprd12.prod.outlook.com (2603:10b6:408:43::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.21; Thu, 10 Mar 2022 14:20:42 +0000 Received: from BN8NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:408:d4:cafe::70) by BN8PR04CA0041.outlook.office365.com (2603:10b6:408:d4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22 via Frontend Transport; Thu, 10 Mar 2022 14:20:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT067.mail.protection.outlook.com (10.13.177.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5061.22 via Frontend Transport; Thu, 10 Mar 2022 14:20:42 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 10 Mar 2022 14:20:38 +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; Thu, 10 Mar 2022 06:20:34 -0800 From: Gregory Etelson To: CC: , , , , Xiaoyun Li , Aman Singh , Yuying Zhang , Ting Xu , Ferruh Yigit Subject: [PATCH] app/testpmd: fix GTP header parsing in csum FWD engine Date: Thu, 10 Mar 2022 16:20:19 +0200 Message-ID: <20220310142019.13398-1-getelson@nvidia.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f1b3ca4-c6c0-4624-b5db-08da02a128b1 X-MS-TrafficTypeDiagnostic: BN8PR12MB3380: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: OYP/he4PE808bGtPzeROPZOn8GAXDL34hKocNG6KfJjfdxlW6/aqNY2UwlHuWO0oH3Fzeb9r7ev1qHnHAk6J2AJVuNX0vr1qePn+HroXH5T4HgbddfIQ2HdXTY4FQWeiz0S8YnbN0M2+U6qNBxkHoDtdgXE4y+KX2PGrjVVBRjS8kv6j48aK6Hnq2NZ/c6b6SKritt3XLWRJLc4XrVXJUJj5rz7WbEH+/y2YQKUawTBemd0IepLtxwUKJ1GhKLXgySoApO0wBSMiTuIIvnXqYKTCq5KVMjMWUdhLxPLqMYOA+4KRf7sUaD7Z3Ny6VKGdo8/i41nW+1CnqPlLHaXZTukTMmsFFrHt5zpbtVia0D9ZF+rXYaG4jng9H63TJlyge5QcBwrh6ondipBOyeK5rFmUHM1vHK2d5tKiPtXDRI3pTM6uaaSf+Tk0LUnVJlZU0kNrSI5CNGgmA+9r3hH4Pv5orxYgGYAKRI4NlVCgcZc12UZuZWbnsuX1SnWq4O+cKrbdqLs2a4baxo3P0NVZ97Dymipcxv0PwUxjJPoR2mNw/h3EJgtpOVTKSojfgYeU+4/8PbwGqI9i/F8SdDrSaEiQ5xY3hGBVlxR4X9TRi5OSYvniC9BfJ8yBTUYut3vzXnGYGUL2ykA5UunwU31RMZpBx5MJsGiD4+RuYJJXJS3WGPAgh8IqSzx2clIXcOgaZbj0I06I+xuHo5VWnjdWuA== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(426003)(1076003)(336012)(81166007)(186003)(16526019)(55016003)(83380400001)(2616005)(26005)(8936002)(316002)(36756003)(4326008)(8676002)(70206006)(70586007)(54906003)(6916009)(508600001)(5660300002)(82310400004)(7696005)(356005)(86362001)(6286002)(6666004)(47076005)(2906002)(40460700003)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2022 14:20:42.0353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f1b3ca4-c6c0-4624-b5db-08da02a128b1 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.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3380 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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 header extension bits are set. Cc: stable@dpdk.org Fixes: d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum offload") Signed-off-by: Gregory Etelson --- 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