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 5BCE2A00C2; Sun, 20 Feb 2022 13:10:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA2B74068C; Sun, 20 Feb 2022 13:10:10 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2055.outbound.protection.outlook.com [40.107.102.55]) by mails.dpdk.org (Postfix) with ESMTP id 9528840395; Sun, 20 Feb 2022 13:10:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S4p9H7cQD3TSe5e+wMHfKThRExkBDYq6s4KaM8BeKt6rL1b2MqXso2VZifYyNiaZ6tqyFSc1Kl5L3CMlLFTf1WFg4iY9jmSfzJjUj7YkHH+WdLTTC7B5wsMvYyWj99OEU2HmolXUWwh4WOMI+piLLeFTKe8VcKe9x+hnEDizwjUPP9CWn0v62P3T7uAOiNZDjyZha11m4Bfgh9pFEdFp4wAc+wpIrrzjKDQ79HovpqwMjfvx5tx8uOl5Sy8P/rRLNk8kmzRn219U9GjNAG0OarZqh67v+3T6LbzPJL1MHFEn4+HC/pHQdZbIk0TKZQgnOEx+D0FFxdz2BmgJ/Jv9Pw== 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=moDyVqI/iVn/hw1jNuMYe3DPwNWiQtGKUqsAWBIjXdU=; b=MPAzO/89jTm6T95GiKz5JPsmybhHfMGLpth46NpgzmMnzpY0xRpTIg8vvvNnxRvRc/s1dWREum2xCAM3AR+VsLR+baVSnJAXl/J4/P/mOm73RfsSKS1Mh5Szwe7S2APWeSu8wbUfalHgL7B41Xtedu5tBzD+ybfWxQjC+suYzTsppMDZzOj4IOEdS0NsfTEK68DHCbT2QdWujOjx73EjNDn4Y0HRv7VWxP3nnaPVBGRMU1uT9RgekwVxxRZRm+qM2Ea/IUU0kI15UFJoc5O1hRVc2wCTrF2s8/2DZpV4zCrc/ZfAzYRUt/JPj8iS2PSyNuvklm76TG8v6LNdnB6a1w== 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=moDyVqI/iVn/hw1jNuMYe3DPwNWiQtGKUqsAWBIjXdU=; b=GNy4rQ3TJBIjaBo6kjgfohXDiFu5GbRn+h064l5hEd1tddU6bKCLh6yTIaTqEH6lcuOtpcRVqHw6aC3wWSwKBKIGiE76A4SAeASjd/DTlzQ7MrOSPbmhxEboqOjkvd5FjpSfDp4CYsCcQFmbOesVjP9X9BJ2STnmLCPkKUvOPxyVAi6jHZRKXcH2wCxOt1sM9B3p2Erv+8L+cnhWeeBxvXvPNEgUKj+GsGW2OBpnscODdmAAkeU84CZ7eD3ocstJSEG+Qel+gVKph0DfewTxVSEkfHOU7XM5PcEDEyuSvG0hQWk6+5ECh2zR+UTo82GX8dk6k3mw+iq6lVG7WIhUhA== Received: from BN0PR02CA0050.namprd02.prod.outlook.com (2603:10b6:408:e5::25) by MN2PR12MB3534.namprd12.prod.outlook.com (2603:10b6:208:108::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.15; Sun, 20 Feb 2022 12:10:06 +0000 Received: from BN8NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e5:cafe::55) by BN0PR02CA0050.outlook.office365.com (2603:10b6:408:e5::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14 via Frontend Transport; Sun, 20 Feb 2022 12:10:06 +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 BN8NAM11FT050.mail.protection.outlook.com (10.13.177.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Sun, 20 Feb 2022 12:10:06 +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; Sun, 20 Feb 2022 12:10:04 +0000 Received: from nvidia.com (10.126.230.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; Sun, 20 Feb 2022 04:10:02 -0800 From: Raja Zidane To: CC: , Subject: [PATCH V3] app/testpmd: fix GENEVE parsing in csum forward mode Date: Sun, 20 Feb 2022 14:09:54 +0200 Message-ID: <20220220120954.29784-1-rzidane@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220216123732.32617-1-rzidane@nvidia.com> References: <20220216123732.32617-1-rzidane@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: face6baa-93d7-48a6-0171-08d9f469eed4 X-MS-TrafficTypeDiagnostic: MN2PR12MB3534: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: ybE22M800F5Vzrbsjbyoa4z7am8k7xzFoQV+1mwz+lLPUKyJu2RZd0k5fbjfEGPwHhcJrQbpigosPJhvHHkGxkrAyXy82oR7HWJwgEYPWC0D17ExqlaYT+Xbt+EdibX+fKrSAOyONOxuicj5x3UL3Y28oSn51t/raIzUjoxT2T0iMQXpPFz4x9/DxCfjTkMMtkwYmKjl9+wobkhhnSxiBr1firF/13/X+0uol5zb3LmFo+/Cn8S4Gg/3DQrwgZxZ0aAD6t8vlLI386h4E2z7iaqC8WcO1Q67xR1KgfWu1g447euRT1J+2uSz2kbPU7jlV7TH6NJLRYYjDg4vd7+05A/soRS1ywTKYhKC14L/HANsRnvsvgjzCLxAHfEhggt3XXHc9jcnYABWYTvzsk57qV/6lerrUn0lA2glpVPEjg4ycGktOJTt+l1BIYExCCDJ47vfjgUOi3cq7bZxNcSMSgffNK6y2PRCiUMxcM+jOyRIMWt+Z9C4xSqaDR/dBQRYadgHGuuiW/4EZmI7d0Dh+F9pjuGc4m8hGOPzXlZJ/6ib8SiCuV4iDBVNiDFbK8eqF80ovO5133E8xedZRY5dEl7P6Gu+WaZt0Lht1mfp4AcUTEnpfgrW1QDUzl5D8eq/c3IlROLyCvt0sE8Czwb8VMsbha7MTIoHNFM3oNtXYX3YJQk6Ezt4RHzC/8VvdJ68VIQaYqjZ+m4iF4kjv0e98Q== 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)(40470700004)(36840700001)(46966006)(36860700001)(36756003)(6916009)(47076005)(82310400004)(40460700003)(7696005)(6666004)(16526019)(6286002)(426003)(336012)(186003)(1076003)(26005)(83380400001)(2616005)(356005)(55016003)(508600001)(8936002)(54906003)(86362001)(2906002)(316002)(70206006)(8676002)(4326008)(450100002)(70586007)(81166007)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2022 12:10:06.3532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: face6baa-93d7-48a6-0171-08d9f469eed4 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: BN8NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3534 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). 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..e9ade3b864 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(ERR, "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