From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6631C433DF for ; Tue, 20 Oct 2020 13:20:35 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 21EE822247 for ; Tue, 20 Oct 2020 13:20:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21EE822247 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3433ABAAC; Tue, 20 Oct 2020 15:20:33 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id E7265BAAA for ; Tue, 20 Oct 2020 15:20:31 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from elibr@nvidia.com) with SMTP; 20 Oct 2020 16:20:29 +0300 Received: from nvidia.com (dev-r-vrt-214.mtr.labs.mlnx [10.212.214.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09KDKTAm001757; Tue, 20 Oct 2020 16:20:29 +0300 From: Eli Britstein To: dev@dpdk.org Cc: Dekel Peled , Ori Kam , Eli Britstein Date: Tue, 20 Oct 2020 13:19:13 +0000 Message-Id: <20201020131913.19755-1-elibr@nvidia.com> X-Mailer: git-send-email 2.28.0.546.g385c171 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH V2 1/1] net/mlx5: fix IPv6 next proto validation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Previous patch added validation of the IPv6 next proto field, in order to overcome a known limitation. One of the values checked is IPPROTO_HOPOPTS, which is defined as 0. If proto field is not specified for matching, or mask=0, as in the following, a wrong validation takes place. flow create 0 ingress pattern eth / ipv6 has_frag_ext is 0 / end actions drop / end Fix the validation only on proto asked by the user. Fixes: 55e4c1d1ba73 ("net/mlx5: enforce limitation on IPv6 next proto") Signed-off-by: Eli Britstein Acked-by: Dekel Peled --- drivers/net/mlx5/mlx5_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index c56dac89f9..e0ca8e06b1 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1977,7 +1977,7 @@ mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item, RTE_FLOW_ERROR_TYPE_ITEM, item, "IPv6 cannot follow L2/VLAN layer " "which ether type is not IPv6"); - if (mask && spec) + if (mask && mask->hdr.proto && spec) next_proto = mask->hdr.proto & spec->hdr.proto; if (item_flags & MLX5_FLOW_LAYER_IPV6_ENCAP) { if (next_proto == IPPROTO_IPIP || next_proto == IPPROTO_IPV6) -- 2.28.0.546.g385c171