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 CBB9EA0C53 for ; Wed, 24 Nov 2021 14:26:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC66C426E9; Wed, 24 Nov 2021 14:26:38 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2074.outbound.protection.outlook.com [40.107.244.74]) by mails.dpdk.org (Postfix) with ESMTP id 772D04115C; Wed, 24 Nov 2021 14:26:35 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+Q5fUiTtByHk7dUwTDKw7g+L1+pU3+UePHUcOaaV0C43JdjtRd6eF/Bk+0sOubFnCUAjDsbnYcgpLNeUw19G1PXqXiIZcOqvgooiDBdpJCbUoeQjXDetJcT4k4z3j0m9zXAVOYirxeN9ubH59fb1iOro73zAYdd5F3O21Iyzj1meb9XirXPTTorGlWGGU0TWK/Yc1l8yaHj5wWu7Vl48TiialiNH9XisJXwGnxMBxzafJ/EdHpKUYwk/hjkeIqzO7oRfgHSW5BsXyNMzgeZtpECDsQ2JyHq5ez/RRKpscnDce1+Vt6IprrQN0y252JcwjRxSP0tC7EVfGIxIsSXYQ== 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=5zVKZU4ThZ3TFCvA/IUktXiPuU4ghK3tfpLqvO6Gtzk=; b=KyZHZtBwjl9NMmURB6pacvq5B/ItY9RuuXIafqc8Y4OVq/AUrdSRDvQqhhf9VUiZaWDzA6hdFEfW5kKmH9m9VBKqLdHiUdGCPkMhrc9lCDtJB17k8AxHlHNbyolWBCMIrrCBtlfdKAluGz9Pl53zVuhH83t2rQz6lzMP2cWzABKF29FI9DC831VGMjv7MqemIbOlMO+uxGbxYpXPYByqNZbsIBopdNBU9wSVmkc2GTWoN4/Xb6eOu06/i3zu4t1NpubwMbQ06V9eSu6/xZ9tMwI70Gph0mjDJu7SPXWSUcCFvB02wX+kYk1kbQuq0YzoNhmSXfniP6m2/WSKWOeWRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) 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=5zVKZU4ThZ3TFCvA/IUktXiPuU4ghK3tfpLqvO6Gtzk=; b=aNgxbU65dw1n7ssPBQ5FnrpcQrtTvEaLiN/NkY5arpqQs4VZ8+21aioVQ+ytSV6/tZca6RZSEGTZ9lfg8U6KVofJybAbMkbunRrpDcH1ZGhTI1pbdJLbPEIBIVOtaWlPqi94vNS71BroOCGlUGckECm96iuPJjYM5a5+y7vGcBjj0ualDgx38dN35DsUOaNRRkU3jyWdm5LFi3MxAm/u+3aE9/NNbPyi1oluoQjRWUwzeoaowaIzeZb9CgAGuZgIPTRXVgRIk40/URNXccGyvfQ9DsrFa2cpU3eVQm2p+X1sHqWfuGKEs2/r93eNx9dRH4jA/E+x/vv9g3bZlZk5LQ== Received: from BN9PR03CA0846.namprd03.prod.outlook.com (2603:10b6:408:13d::11) by MWHPR12MB1807.namprd12.prod.outlook.com (2603:10b6:300:113::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22; Wed, 24 Nov 2021 13:26:33 +0000 Received: from BN8NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13d:cafe::80) by BN9PR03CA0846.outlook.office365.com (2603:10b6:408:13d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.24 via Frontend Transport; Wed, 24 Nov 2021 13:26:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT011.mail.protection.outlook.com (10.13.176.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4713.20 via Frontend Transport; Wed, 24 Nov 2021 13:26:32 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 24 Nov 2021 13:26:22 +0000 From: Alexander Kozyrev To: CC: , , , , Subject: [PATCH] net/mlx5: fix GENEVE and VXLAN-GPE item matching Date: Wed, 24 Nov 2021 15:26:09 +0200 Message-ID: <20211124132609.3315173-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2c0ca005-96b8-48dd-a265-08d9af4e0810 X-MS-TrafficTypeDiagnostic: MWHPR12MB1807: 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: Em9EfCUwcrbrdjkiN9Vvfl4uGlaQH29dFwR8YMxG0JgOmAcaikmOZ0sFkRnuoPFeG4VlkVabdavRTxPX8Ic/4t8C7YY/1fC/LcevBfGBPCrFHjUTzDDBnfF1BO2zE8saV6ZYt72hvgkV7BYzLxSNyrTedcJpnW3KPqZB5ap9MaaibcaoC8OGTan73L/1IzHpuDNprr8nmXq1akRsWiOABOZVwKQwwx9gOuQNBZ5gK0UU84RkCVL5QLlKIbGG+K60VPmB/BbOafSzYSMP0PM3ugOCgel2a+Vfs65aOc3d14n5bsR+wRSWJC6eJqWWmBhKWxeYjUSF7kpgPQtGRxbAHyB/X1AC9QOxsS5zJ3XyM2hW1R5SQWPvYSV8r/Q0N7qnPdGQ5U6EniJ24kZtJrKhV4FekBYkSiKX4AdHuFBjQqQ5FPTemsU6ozM6RMr+R5Ua+XWCxMti0YpVw27akgjVzdXl6f29FG0pDGYZGdzKtZOjPj+VZWXoQmbeevs0mZWqXCXnu0hyjA+VFyY5GE5wSAsGJbHGdJ8/gsQuFYJK6ewCFqeaNUlw52Sp9LqNwJTysfXbk5/MVXLwACZ0OkT1nPbF8ErKVx/txmg3UxhvPVwnqqDwqvGzF1UIg1aDQaFpvoEEubfM2kO+hAR6wls90OznXsyb+ep4mWl5paBdDagAFCjtbcsycVh5yev8dwlslW/1wvHHl/yOuhiUJhpjYg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(6286002)(107886003)(426003)(5660300002)(54906003)(82310400004)(2616005)(70206006)(55016003)(8676002)(186003)(4326008)(1076003)(6666004)(86362001)(83380400001)(336012)(16526019)(26005)(508600001)(356005)(36860700001)(2906002)(7636003)(8936002)(70586007)(316002)(36756003)(6916009)(7696005)(47076005)(450100002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2021 13:26:32.5404 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c0ca005-96b8-48dd-a265-08d9af4e0810 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.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1807 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 GENEVE and VXLAN-GPE item matching is done similarly to GRE matching. Users can skip the specification of the protocol type and expect that this type is deducted from the inner header type automatically. But the inner header type may not be specified in order to match all the protocol types. In this case, PMD should not specify the protocol type. Check if we have the inner header type before setting the protocol type. Fixes: 690391dd0e ("net/mlx5: fix GENEVE protocol type translation") Fixes: 861fa3796f ("net/mlx5: fix VXLAN-GPE next protocol translation") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev --- drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 1a9c040f3c..3da122cbb9 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -9057,7 +9057,6 @@ flow_dv_translate_item_vxlan_gpe(void *matcher, void *key, m_protocol = vxlan_m->protocol; v_protocol = vxlan_v->protocol; if (!m_protocol) { - m_protocol = 0xff; /* Force next protocol to ensure next headers parsing. */ if (pattern_flags & MLX5_FLOW_LAYER_INNER_L2) v_protocol = RTE_VXLAN_GPE_TYPE_ETH; @@ -9065,6 +9064,8 @@ flow_dv_translate_item_vxlan_gpe(void *matcher, void *key, v_protocol = RTE_VXLAN_GPE_TYPE_IPV4; else if (pattern_flags & MLX5_FLOW_LAYER_INNER_L3_IPV6) v_protocol = RTE_VXLAN_GPE_TYPE_IPV6; + if (v_protocol) + m_protocol = 0xFF; } MLX5_SET(fte_match_set_misc3, misc_m, outer_vxlan_gpe_next_protocol, m_protocol); @@ -9135,8 +9136,9 @@ flow_dv_translate_item_geneve(void *matcher, void *key, protocol_v = rte_be_to_cpu_16(geneve_v->protocol); if (!protocol_m) { /* Force next protocol to prevent matchers duplication */ - protocol_m = 0xFFFF; protocol_v = mlx5_translate_tunnel_etypes(pattern_flags); + if (protocol_v) + protocol_m = 0xFFFF; } MLX5_SET(fte_match_set_misc, misc_m, geneve_protocol_type, protocol_m); MLX5_SET(fte_match_set_misc, misc_v, geneve_protocol_type, -- 2.18.2