From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 58B5E2BCD for ; Thu, 3 May 2018 11:22:07 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id t11so27181961wmt.0 for ; Thu, 03 May 2018 02:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=2192yQ7291+VRtJ6JSiqlKunSdZ0oyVheyOLvpK4Bpw=; b=UVOFszBUsizk33CAQteK7bd0K65jN8m2hbteoUe7Ors/TkWID3i/7LJjth0WG0Za/M yqS3VIbrSi4Qe9vtbqg9kQ3mkTyGRA8AlTKSpgFWALVft6wmmryhD5wY0fe5BOTS8ApG 4y9xLArik2R2G8Dv59Tf0b23e+zr288Gy4ICym6R0/PxQUOy0DT3sMqknZdwsh2TpYFa L7+j71j550JwZ6n4gnbbCKNqB+7lhWsdCT23qTGLohVwUAnLMVdjj4214CfTYt8ta3id AF8h8Vs2iTsBFSw7ORik/WWUFjAYb63vsPmroxfzDRBxRF5a5BZWJwhOMev4SsO1ufro 8eoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=2192yQ7291+VRtJ6JSiqlKunSdZ0oyVheyOLvpK4Bpw=; b=jfx2GpZuJvkxlGLUS0wY+S5VTt6OufRIOblCtEoMEoLjpnNvbHVjGAjS0pqriXAHG4 9PZQs+3O/8EFZ+zbkON0Y0REjC7AecH7r5Hjm5IPs4k72fUZFCA2ibe1RIO1UbPAgZnB GLSpuKvvvbE6fwKZ3nuK4CMZTD+ymPWXZlR4wj+pW9oGa8XRTxgIVXLglmaIrP4XUnvL ZBZZgTH58x3NHcM6SCbETQddyv7i1HwtgmVsGqA/wE26XPFiTdoGvtYk8RQsoURbnUo5 L9SfJOF7TEkcAc/zgj184Ao5Re91WZ2rz+boKmKh8KWMZKl/FpooUMVTE84Cqp/sIrTF VkPw== X-Gm-Message-State: ALQs6tDVvqmQXblYK5RUODaboYmx3UaYq2nro/iHgLM1LjK4bD7U4zTi W+7sRR7WQf6tk1FZCVCQYsOm X-Google-Smtp-Source: AB8JxZrAGwQf73NUoEYFVHfSlNBMthgQYgPeM9WUabqeeJ74QWd6GV8vGPui6sk1FX3elRnCkvokRQ== X-Received: by 10.28.142.149 with SMTP id q143mr14011409wmd.161.1525339327085; Thu, 03 May 2018 02:22:07 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id m15-v6sm14599023wri.8.2018.05.03.02.22.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 02:22:06 -0700 (PDT) Date: Thu, 3 May 2018 11:23:14 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: "dev@dpdk.org" , Adrien Mazarguil , Yongseok Koh , "stable@dpdk.org" Message-ID: <20180503092314.ianfr2xllm7ner5c@laranjeiro-vm.dev.6wind.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix: flow validation X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 09:22:07 -0000 On Thu, May 03, 2018 at 07:07:54AM +0000, Shahaf Shuler wrote: > Hi Nelio, > > Wednesday, May 2, 2018 5:43 PM, Nelio Laranjeiro: > > Subject: [dpdk-stable] [PATCH] net/mlx5: fix: flow validation > > The title is wrong the : after the fix should be removed. Right, > > Item spec and last are wrongly compared to the NIC capability causing a > > validation failure when the mask is null. > > This validation function should only verify the user is not configuring > > unsupported matching fields. > > > > Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions") > > Cc: stable@dpdk.org > > > > Signed-off-by: Nelio Laranjeiro > > --- >[...] > > - rte_errno = EINVAL; > > - return -rte_errno; > > - } > > + if (!spec && (item->mask || last)) > > + goto error; > > + if (!spec) > > + return 0; > > + for (i = 0; i < size; i++) { > > > I think inline comment which explains what each code section below > verifies would much help. Adding it, > > + if (spec) > > + if (((spec[i] & m[i]) | mask[i]) != mask[i]) > > + goto error; > > Am wondering. > Which the below check of m ... > > > + if (last) > > + if ((((last[i] & m[i]) | mask[i]) != mask[i]) || > > + ((spec[i] & m[i]) != (last[i] & m[i]))) > > + goto error; > > + if (m) > > + if ((m[i] | mask[i]) != mask[i]) > > + goto error; > > Do we really need to spec check? > Meaning if above one passes it is guarantee m is contained in mask. > And if so, then the spec check will always succeed. Indeed, > > } > > return 0; > > +error: > > + rte_errno = ENOTSUP; > > + return -rte_errno; > > } > > > > /** > > -- > > 2.17.0 I am making a v2 accordingly. Thanks, -- Nélio Laranjeiro 6WIND