From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E8CFEA04DC; Tue, 20 Oct 2020 15:49:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A9C7BBCC; Tue, 20 Oct 2020 15:49:42 +0200 (CEST) Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by dpdk.org (Postfix) with ESMTP id 15B90BAD4 for ; Tue, 20 Oct 2020 15:49:40 +0200 (CEST) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 20 Oct 2020 06:49:26 -0700 Received: from [172.27.14.38] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 20 Oct 2020 13:49:37 +0000 To: CC: Dekel Peled , Ori Kam , Matan Azrad , Shahaf Shuler , "Slava Bogdanovich Ovsiienko" References: <20201020131913.19755-1-elibr@nvidia.com> From: Eli Britstein Message-ID: Date: Tue, 20 Oct 2020 16:49:27 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3 MIME-Version: 1.0 In-Reply-To: <20201020131913.19755-1-elibr@nvidia.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603201766; bh=4hUGdHg9EyvysOcqNPquzRVgLYzN5M4VMZoOTZZWVJo=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding: Content-Language:X-Originating-IP:X-ClientProxiedBy; b=gzDW62jWZ9LcuZbCyES+LrQ60WBwT09zJxovF/8evUW6vwnM++WQo49gTUlf5LN2g 28UiOAi/KZMcWbBcFsH0xPWaMqWB21l8VPM1hbZEe07c2QFshVd+KvTofS/iKYq0Zz VLpAIshvFJlQ4qEUNWvK/mYaxJweSdFM4+v6LgGEoO0wxIBaw5M4herq6S18YhRaEc PhhqiK0xnz/vAy4KkAACVHOQzf0NU0nPcnFIaxpjxHB0/7RHFZ0k5wdDA5oUghH08Y hyxT3up56ZMmyuw+Sy4rbvzVyFKAYOxOYHK8pwzgq9Z9op6jjDhbSyjg8+1Qrfz/nZ UTFD4JdrKJmqw== Subject: Re: [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" ++ On 10/20/2020 4:19 PM, Eli Britstein wrote: > 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)