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 2F909A034E; Mon, 21 Feb 2022 14:24:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF8C54068C; Mon, 21 Feb 2022 14:24:38 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2063.outbound.protection.outlook.com [40.107.101.63]) by mails.dpdk.org (Postfix) with ESMTP id 7DB344013F; Mon, 21 Feb 2022 14:24:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cSQQVS/Fty84Knq+RoFD6RyqyepXG954HEYZqJZh4PGf9RdpRRmyT8B7OcAZsLv+ehvL0oL42QUgmSWeIz3cDk/DO3Nmz6tACws6VAP/VtPH4hkVtZRd5uYIJC130YkKDBcP8nx0IG+GuWhy2Qu4Ucxvg14xBcdjhMFKDSbmT5sdFfcHv77dUx24VkCGfHRrlxMcxhcK0ZGqI+EMke9IBkmpSinFYSqKqSzU83UnNuGCO/mkgDp+T6GBD/ZfgRbxYI6LIMUVwPIuvFHAe1mjPMJEY6zUnuvtf04u+a6yMgEI8isgSmJ+CnGrc8XFtGNBJBObU4ilm65BqOrLnljXYg== 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=/WUon7JQdiPmFIGCTu3ydyIw8a0d4lzOmUiusHpZEz8=; b=AqVIot5VCGSbI9Gf7VoBUtL8W1mm0/OEACV55W7/7unkCKTACa5GO6VYfkcfl7Ivq6rCbBY1MscodNtxnlYMoyTj4wjX69JZAK5VLW6UL//KaZ4ETjsXU/5Vi0CcQp42ioYZzl5fLAA+pUOf7fRpUvvw2ijURECPxP8Z8lUz88/NndHgXYhZsPKz4OOJ/TQuNxsJjcz5m925TrXx0rbUEQxuyBlJjHYqEQJBaB6NozbJeOCRgKbGhZ7QgrLQXeqJqaC7h3YTj5eaBRFw8nHotqbtIR9gFyMsHK/FEwlnBVGooxjVAi9XS5OxL2y4vtJ47+NtND0KxV8TUGkT/4qQTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=dpdk.org 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=/WUon7JQdiPmFIGCTu3ydyIw8a0d4lzOmUiusHpZEz8=; b=jBGE9xescmVoVp6Vep42kn0A3c11mepCkYO9AzJKigjANSMNbqu+lE+8aPFvvVLiP8TpuIraT2nPDs5LKbxDf+BFHEMkhycnDQUpTvvi6Sk1BbHz2oz10gZFPmqNoQiCB/3/rbNMKyWUPjFaNZ7NxZi7RdbJhc9x7ssxgzLGaw34RkUu4fJJo02JBbwApHvRM8cc9DDA1qWQ7QRX2J04PPkpjAoyjoX7PMBt3BUCwUnA9C6wRX+oF2QnuxeJDQixy2TP/0oj3dcxBj85lVmZ4EH9C4QvTQ/vYieQjBl6sknqrMNaUK7T5Xm+R+l0IZvDD8Vg74heiBRB7PhyINkvpg== Received: from DS7PR03CA0201.namprd03.prod.outlook.com (2603:10b6:5:3b6::26) by DM6PR12MB2620.namprd12.prod.outlook.com (2603:10b6:5:42::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Mon, 21 Feb 2022 13:24:35 +0000 Received: from DM6NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b6:cafe::f3) by DS7PR03CA0201.outlook.office365.com (2603:10b6:5:3b6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16 via Frontend Transport; Mon, 21 Feb 2022 13:24:35 +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 DM6NAM11FT045.mail.protection.outlook.com (10.13.173.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Mon, 21 Feb 2022 13:24:34 +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.18; Mon, 21 Feb 2022 13:24:34 +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.9; Mon, 21 Feb 2022 05:24:31 -0800 From: Raja Zidane To: CC: , Subject: [PATCH V4] app/testpmd: fix GENEVE parsing in csum forward mode Date: Mon, 21 Feb 2022 15:24:23 +0200 Message-ID: <20220221132423.14343-1-rzidane@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220220120954.29784-1-rzidane@nvidia.com> References: <20220220120954.29784-1-rzidane@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 681a5890-3f3c-4a5a-f6e5-08d9f53d80b7 X-MS-TrafficTypeDiagnostic: DM6PR12MB2620: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: k1Tk35/CUzOybKPO4xArBP78iy/QlOKv360zw4XE6zM5LAQjsf7tMIdhEOGZ7ObZmADydI0OHX75GOqci3uTlfAFaPRf4HWsViG8h1r2AIR60ql9bYow2b3TQTdRDJV9Gwwm1NA5hums62X7w8EBvzCX41At3NwTm0+ro1/hU//Wd3m1227HIJICksRF8NuasvVmhtUbWkuR2ujxc9y2jCcXrsL55PzlCh+eJDaiAbx9p/gb0v34yMoZ5G4Iy9P/2dlCcP03xlydQGq1lT0FL6RoUpbuX+ld8qrYaHgny8gZTkIJHKzVOvcStRCUv/cZSBghw6v/ES80QA4kwgKTHyktjnCU2bwWBaxXfT/N+ph1StR2PWf6El2v2zdWNGYb7kDzZ5vcMhe8qL2ytIB4VAVQPMHSRXBOGw7S3+ORS7jTtv4JbH1qLfxrgNZ9j7Xc58FGKNIlWGrBRbKXKxkXlDgSKqftkQjeLekWmFRXIw6Sdg7F7gBgOr//AAuAbG9tXc4wplfRTinolxQV7jQ+9BP/CcEm0IrCp+oFZy5upddNmvsyqFDsqnTKgI1aiSefNgEjUA2AVskRzS7LXEPWOG5PSm38lLDRmT9gLYV1Rt4I9LCNf3uNXxmXq1gaSNfBjRlJi0WMrDpoHosu00HGOnqTp0ZrWilToiONmtZNzqwLsoIBgNPMfd1b5UWhelycTe0oAfsMBBmGBL8okSGzuA== 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)(36840700001)(40470700004)(46966006)(1076003)(6916009)(54906003)(81166007)(26005)(8676002)(5660300002)(4326008)(6286002)(8936002)(16526019)(186003)(70206006)(83380400001)(70586007)(450100002)(356005)(82310400004)(316002)(86362001)(336012)(426003)(7696005)(40460700003)(2616005)(55016003)(508600001)(47076005)(36756003)(6666004)(2906002)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2022 13:24:34.9267 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 681a5890-3f3c-4a5a-f6e5-08d9f53d80b7 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: DM6NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2620 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 The csum FWD mode parses any received packet to set mbuf offloads for the transmitting burst, mainly in the checksum/TSO areas. In the case of a tunnel header, the csum FWD tries to detect known tunnels by the standard definition using the header'sdata and fallback to check the packet type in the mbuf to see if the Rx port driver already sign the packet as a tunnel. In the fallback case, the csum assumes the tunnel is VXLAN and parses the tunnel as VXLAN. When the GENEVE tunnel was added to the known tunnels in csum, its parsing trial was wrongly located after the pkt type detection, causing the csum to parse the GENEVE header as VXLAN when the Rx port set the tunnel packet type. Remove the fall back case to VxLan. Log error of unrecognized tunnel if no tunnel was parsed successfully. Fixes: c10a026c3b03 ("app/testpmd: introduce vxlan parsing function in csum fwd engine") Cc: stable@dpdk.org Signed-off-by: Raja Zidane --- V2: Log error when an unrecognized tunnel is found (unknown UDP dst port), instead of parsing it as VxLan by default. V3: revert unneeded changes (swapping parse_geneve & parse_vxlan). V4: Log unknown tunnel error in debug mode. app/test-pmd/csumonly.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 02bc3929c7..5274d498ee 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -258,8 +258,7 @@ parse_gtp(struct rte_udp_hdr *udp_hdr, /* Parse a vxlan header */ static void parse_vxlan(struct rte_udp_hdr *udp_hdr, - struct testpmd_offload_info *info, - uint32_t pkt_type) + struct testpmd_offload_info *info) { struct rte_ether_hdr *eth_hdr; @@ -267,8 +266,7 @@ parse_vxlan(struct rte_udp_hdr *udp_hdr, * default vxlan port (rfc7348) or that the rx offload flag is set * (i40e only currently) */ - if (udp_hdr->dst_port != _htons(RTE_VXLAN_DEFAULT_PORT) && - RTE_ETH_IS_TUNNEL_PKT(pkt_type) == 0) + if (udp_hdr->dst_port != _htons(RTE_VXLAN_DEFAULT_PORT)) return; update_tunnel_outer(info); @@ -922,8 +920,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE; goto tunnel_update; } - parse_vxlan(udp_hdr, &info, - m->packet_type); + parse_vxlan(udp_hdr, &info); if (info.is_tunnel) { tx_ol_flags |= RTE_MBUF_F_TX_TUNNEL_VXLAN; @@ -935,6 +932,12 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) RTE_MBUF_F_TX_TUNNEL_GENEVE; goto tunnel_update; } + /* Always keep last. */ + if (unlikely(RTE_ETH_IS_TUNNEL_PKT( + m->packet_type) != 0)) { + TESTPMD_LOG(DEBUG, "Unknown tunnel packet. UDP dst port: %hu", + udp_hdr->dst_port); + } } else if (info.l4_proto == IPPROTO_GRE) { struct simple_gre_hdr *gre_hdr; -- 2.21.0