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 B1B44A0C4E; Sun, 5 Dec 2021 04:45:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D7CE4013F; Sun, 5 Dec 2021 04:45:09 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2048.outbound.protection.outlook.com [40.107.237.48]) by mails.dpdk.org (Postfix) with ESMTP id 8FAA440040; Sun, 5 Dec 2021 04:45:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WXMs3ff9jyHst/QgvL+PKdxEnjj/bdwGfQdf2VchY0QNlitE9CurIIQ1DKrUiNPubiIuMX02JfTRObomXYbNuDZSaUmYpH8AbJC1oqKY9+TK1dKxtAXFGrAlPfmQK0t9I3WAULstv1aTaJCWHYx6oeQqBlETy2+EyhBbhBkHlsObCcWT10NABTkXBg4TTSR4c96QeSQpml5XEULUkW/XkZOnGMVCstHp3w+zhxspfzOMK1kETb7rHXTJg6S9QrcVyaAAbSsKmOmnmhGPqHQ1i5gkaiTvPiq195jsJEIOq8aK5ngE6UzeqTto8VNPNgOOY/08qu4zqQqsfXJY1dKzGQ== 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=IncgGbrGM1cZyaRQqeeSIk9Ku/PMebWCF8CxOOmodqg=; b=igjKrgGx3TAIoTBCUBIPeuSSBHQKi5l4LHh94NXLCuLT3nQmGMHwN+cgYacQiZPVC5Jsm5uijqib1C8AxBpz2o/Yk+CynH1LpS0lmPWFNQorVvyhoKc+nsF4ftt/H2efhnBk0+/C7Beu6DPbSHRWxkmQOWDhZus2a7y94Rb8jyvB18EHcjqzi1u7utHnf+1tUXxI/Ga3EeAekQNnDt/xTMmz7t1eH3CLs1iHgYvFttgrBdPmg7q9gmMzEWLDdg3Qp3Nok80lFAqPBBXgffPYEONRq+Cyznn5oudhJd9nMZAK1rDZu3wirkUp29riI93Onn4lwBPHzNubkiskK+fViw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=IncgGbrGM1cZyaRQqeeSIk9Ku/PMebWCF8CxOOmodqg=; b=qwDleI6yeFJtewTkduIRMB0p3yw28J94V4qpmLlueFG5luOuTKODP6r9i/S8dDt+1qYjeUJ+cvnt7Kp2oWgAj/z2Kcn7IezoWGl64Eb5TrQbqsMj74Cc8xK8VW8h++lR7ZzmcEYvZ5rkJuCRWuOQi/u0yKByrpOCT0h7dAI/DsazggV+YrMGe44OgC8JApQkI/xAf+WkGAIGUtGj8Ms+0VZqkOL2XcO94N0QLCjIYmfficmpeFH17G+n18NhrU271WFq+tFaF6hVI1BUDt1Yuz/QK0V4W1LgmNF0eVwvsui5NPrYYhJyq2Fkgnr+6mN2T9PIFdq4Iw+L6gjZbfViYA== Received: from BN6PR1201CA0021.namprd12.prod.outlook.com (2603:10b6:405:4c::31) by BN7PR12MB2770.namprd12.prod.outlook.com (2603:10b6:408:32::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.14; Sun, 5 Dec 2021 03:45:07 +0000 Received: from BN8NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4c:cafe::30) by BN6PR1201CA0021.outlook.office365.com (2603:10b6:405:4c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11 via Frontend Transport; Sun, 5 Dec 2021 03:45:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) 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 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by BN8NAM11FT020.mail.protection.outlook.com (10.13.176.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4755.13 via Frontend Transport; Sun, 5 Dec 2021 03:45:07 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sat, 4 Dec 2021 19:45:05 -0800 Received: from nvidia.com (172.20.187.5) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.9; Sat, 4 Dec 2021 19:45:04 -0800 From: Raja Zidane To: CC: Matan Azrad , Subject: [PATCH] app/testpmd: fix GENEVE parsing in csum forward mode Date: Sun, 5 Dec 2021 03:44:50 +0000 Message-ID: <20211205034450.7888-1-rzidane@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25e4e80c-9989-439f-216b-08d9b7a1a147 X-MS-TrafficTypeDiagnostic: BN7PR12MB2770: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kwbupYXXpzSY+Dwu7G32+HcFjkBozhdpQvOu71WufBh4rkYXMwQlrNwBTMc77UNcosGdPadpegaimqg0HmR6TzU+UhDZf72hOqsDxUH52TrEAF9t+PxICxSSENojCmA4TqjGBnXBUv5ozUezpRGEmm/NAsVXcCUKc24cEBWjzWdmuaVG7T2Bk/yaVsmylXAn6b5rZcbfGkptiTi7cTK+GgyU0wfbvegnBS5zhefSVhV1iYfAcT4MWPyacx3V9PjWvLOgkbayV7l9PY1kAFM+85uPOP6vfbcSbcXWRz3qzcFnyl616OwquC1IMSeZctsVkVDvoeA6rNDXZ1KZpuEesY1A1/yUTQf9B2iyL9WnFciz3iaLuqER09GW2kY3DDAXtdiDJ9FQgw4xawQIs3rZoDgwF9oHTcnJdZrmCCILkKDeHFD/O/2VAapgpZgWWbOZFgZrNQqquJafbwfjjGlWmdXtUWgVeAUXu69crHpjUjxjszENlB2uYOHGgJTb92e+Qvi5upsjvpBJJTI+8vi2FvrY/RQO2Eqyw34Oph9nzueSTy+pJCldjwlkkRKEWUhczyLCuRpPe8o6fGQjZ1/nEFJZHY6NgG1KUSXfKZVIBgPmmyZ4cZlUsR/N7qYw2274OplfT5cs2iO+ooTDCEnPIWG59tZobeVV777XPbzegDTn+bkJCziBoQfUrqZ/1MCb/XkWkOOypnXg/X79q6obw1V7xcIGbfF5jVNcGLUgRjZswbaiqhkn+82asjaicl058XtW1V/OmozoAG/m6J9ecA== X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(40470700001)(5660300002)(186003)(4326008)(6666004)(16526019)(36860700001)(2906002)(83380400001)(40460700001)(6916009)(2616005)(8936002)(1076003)(6286002)(7696005)(316002)(8676002)(426003)(70586007)(450100002)(54906003)(70206006)(356005)(86362001)(36756003)(336012)(55016003)(82310400004)(7636003)(26005)(47076005)(508600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2021 03:45:07.1328 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25e4e80c-9989-439f-216b-08d9b7a1a147 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2770 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. Locate the GENEVE parsing trial before the packet type detection. Fixes: ea0e711b8ae0 ("app/testpmd: add GENEVE parsing") Cc: stable@dpdk.org Signed-off-by: Raja Zidane --- Acked-by: Matan Azrad app/test-pmd/csumonly.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 2aeea243b6..fe810fecdd 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -254,7 +254,10 @@ parse_gtp(struct rte_udp_hdr *udp_hdr, info->l2_len += RTE_ETHER_GTP_HLEN; } -/* Parse a vxlan header */ +/* + * Parse a vxlan header. + * If a tunnel is detected in 'pkt_type' it will be parsed by default as vxlan. + */ static void parse_vxlan(struct rte_udp_hdr *udp_hdr, struct testpmd_offload_info *info, @@ -912,17 +915,18 @@ 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_geneve(udp_hdr, &info); if (info.is_tunnel) { tx_ol_flags |= - RTE_MBUF_F_TX_TUNNEL_VXLAN; + RTE_MBUF_F_TX_TUNNEL_GENEVE; goto tunnel_update; } - parse_geneve(udp_hdr, &info); + /* Always keep last. */ + parse_vxlan(udp_hdr, &info, + m->packet_type); if (info.is_tunnel) { tx_ol_flags |= - RTE_MBUF_F_TX_TUNNEL_GENEVE; + RTE_MBUF_F_TX_TUNNEL_VXLAN; goto tunnel_update; } } else if (info.l4_proto == IPPROTO_GRE) { -- 2.17.1