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 DD912A0C48; Wed, 16 Jun 2021 09:01:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB7DD4067A; Wed, 16 Jun 2021 09:01:43 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2061.outbound.protection.outlook.com [40.107.223.61]) by mails.dpdk.org (Postfix) with ESMTP id CCEDE40140; Wed, 16 Jun 2021 09:01:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iExWUvym1PfF30ejiRB6Via2pc2Vx5zlCzTECUeL6WS5/wrvqruuL0gmfD7T1g2/Nylo80lgO7xhAx5cVcmKtHph/ngRbIF1NGKWqdwFze0pvY1UMyKpomIfBznv7jlfEAsbFwwvtJMwcK0QkIsPQ7J8AmVFLUCWmc6p3XFuTAJhlhhFjDjRiK/4fO1jrWhh67tt+mNn/6qB6Yyvp87jhL4fpTJ44TERzcOQwT0sUXL5nDo/rwf4+T6yHaRQHN6HIWzwPQoXHlzYtDHJ8BneX50fFcpf4wfbQZwxnYXOPd8vNgyFouo1wmL6S8y+fjGPeKvDNGLvaHDtj5o46/oY4g== 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-SenderADCheck; bh=4bbaZfi0rJPGzZRKnmCQRqRgWYq4OWEGluFXWm6u7dg=; b=aFfVIS6ZHmFIioTwPuTkxfRwWDIwmT2Wf8l1Et+7yQh57JEcC4JjLWvVM2ywUwEZ74NPGZVE+fnZv/RSRu++pgjGqHgHQ1TTwUWyxIR2zs7XSvjjRp1L36zwDe3bP3JfgdRhVWNVHoTBcdpbE9NbvRZw4RK0lgp2rPLKj2PChpE07YXXFLOHhkV20FV42eKMZqpjP62T74cEDNLIOL+NqKQZmRrP2pyYy9jLle05spVZiaml7ZwAr0XdnUWZ8GXnWR4DsvlMSsr7SAlr0/Um7wdt9Uzq87j1OnWuTs/bauNkipdhhaXQkyhY6TyEXAkPaOFHL3qXexQxcqWI9TfcTg== 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=none sp=none 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=4bbaZfi0rJPGzZRKnmCQRqRgWYq4OWEGluFXWm6u7dg=; b=XnPOxZrCzVRuIOwPTbcDFQQlp6spr0i1o29cFpHg1jDUjhWouXtqESeILAVOJqrzcE9iGyyWyudgKw+izvVlGN7h6/SiGS0dTFQQEnkjnDBQZ8IHIZBhCwoTi6Ob11eknhycTpfJrdgh8SEL0UrW34NqRTvGkrQ4UCcncFoP6u+n1L5KmL2TKauIxHhk32osgIEvZLi8lwlsp3wh4M1l79rRmIa6dTqz50wr3ejkdr3zYvjuNUMnhuhxIP8GEA52dN1Z3TsbwDQ3ea1mRwaXVKcLiNPS7+qJquKkwEczZ9ZksckOUoUINRcPEHz1IxT44+UQDQWmeyjq4RWv8rQVuw== Received: from DM3PR12CA0072.namprd12.prod.outlook.com (2603:10b6:0:57::16) by SN1PR12MB2494.namprd12.prod.outlook.com (2603:10b6:802:29::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Wed, 16 Jun 2021 07:01:41 +0000 Received: from DM6NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:0:57:cafe::33) by DM3PR12CA0072.outlook.office365.com (2603:10b6:0:57::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Wed, 16 Jun 2021 07:01:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 DM6NAM11FT008.mail.protection.outlook.com (10.13.172.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4242.16 via Frontend Transport; Wed, 16 Jun 2021 07:01:41 +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.2; Wed, 16 Jun 2021 07:01:38 +0000 From: Lior Margalit To: , Viacheslav Ovsiienko , Matan Azrad CC: Ori Kam , Lior Margalit , Date: Wed, 16 Jun 2021 10:01:18 +0300 Message-ID: <20210616070118.240681-1-lmargalit@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 972ca7d5-e352-45c3-793b-08d93094981d X-MS-TrafficTypeDiagnostic: SN1PR12MB2494: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FctyxAd0DqKqpna1OoRulH9qPysQAaZ7vV/ICE/Yp4LlEE9WbedjQTky3D2TgmQVgcWHv4j8dRmuTTSaXzgceQGmJr6G56mUdry+/W+EMgkJAE5D1s6zTboPWfhiS1BCSLlK5Avl2E4XW9fzrCDPtc5pvDZg9yQ+l/fd8pMzDYPs8Y/2YCgvmVJLMYTShcBer3hZU/qaj6wOrBB1gOKhOQc9uHl0p357zronlLow10nzIr3Sh7Tg3wJcRaAEojA1MA1IQ8+EYw5TgsT2JJ//YfR0yDCrmGmXFKQL2XZ5g0/gA8vzVkgbzkIuMmJ9U5qPyrgCrShoJzIgKrIlwWs07z4BumAA0zAGStD+29P5XFBmDvEEZR8EUZC+77/1TzEfUigc1PlYwRNMioNNklclhpCGrUZvKTw7NauFn9Lin1ZLxzILM8wRYQedB4g6bT6ZDD+h1pzvu7wWN+F+vrJcLNbmH36Y5Nc8vfS5g/78Z9UJ/UAAXLwjvOVSwso5tkek8+Id7h2G2Uezm2wQbLJMhYkv9fzUmVoMXzZXi84gC3wmjwsbC/Mq66TDZ2yS1iNHO3ag+No0aNfobCYmNmQwP4vUidNqjD3GOcdyCRCZKuFmPbmA70MsT1S8FFXSUwZReLU8f00+gWrciz8W/sxsVvBN/F63FsY/XUGVFJCyblo= 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)(39860400002)(346002)(136003)(396003)(376002)(46966006)(36840700001)(70586007)(16526019)(70206006)(2906002)(55016002)(36860700001)(7636003)(82740400003)(2616005)(36756003)(6636002)(86362001)(5660300002)(426003)(1076003)(47076005)(336012)(356005)(36906005)(83380400001)(186003)(6666004)(478600001)(26005)(54906003)(316002)(82310400003)(7696005)(8676002)(6286002)(110136005)(450100002)(4326008)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2021 07:01:41.3917 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 972ca7d5-e352-45c3-793b-08d93094981d 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: DM6NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2494 Subject: [dpdk-dev] [PATCH v1] net/mlx5: fix IPIP multi tunnel validation 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 Sender: "dev" A flow rule must not include multiple tunnel layers. An attempt to create such a rule, for example: testpmd> flow create .../ vxlan / eth / ipv4 proto is 4 / end results in an unclear error. In the current implementation there is a check for multiple IPIP tunnels, but not for combination of IPIP and a different kind of tunnel, such as VXLAN. The fix is to enhance the above check to use MLX5_FLOW_LAYER_TUNNEL that consists of all the tunnel masks. The error message will be "multiple tunnel not supported". Fixes: 5e33bebdd8d3 ("net/mlx5: support IP-in-IP tunnel") Cc: stable@dpdk.org Signed-off-by: Lior Margalit Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index e5e062d09a..c5c767aaee 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2124,7 +2124,7 @@ mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item, RTE_FLOW_ERROR_TYPE_ITEM, item, "IPv4 cannot follow L2/VLAN layer " "which ether type is not IPv4"); - if (item_flags & MLX5_FLOW_LAYER_IPIP) { + if (item_flags & MLX5_FLOW_LAYER_TUNNEL) { if (mask && spec) next_proto = mask->hdr.next_proto_id & spec->hdr.next_proto_id; @@ -2232,7 +2232,7 @@ mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item, "which ether type is not IPv6"); if (mask && mask->hdr.proto == UINT8_MAX && spec) next_proto = spec->hdr.proto; - if (item_flags & MLX5_FLOW_LAYER_IPV6_ENCAP) { + if (item_flags & MLX5_FLOW_LAYER_TUNNEL) { if (next_proto == IPPROTO_IPIP || next_proto == IPPROTO_IPV6) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, -- 2.21.0