patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: Shahaf Shuler <shahafs@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Yongseok Koh <yskoh@mellanox.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix: flow validation
Date: Thu, 3 May 2018 11:23:14 +0200	[thread overview]
Message-ID: <20180503092314.ianfr2xllm7ner5c@laranjeiro-vm.dev.6wind.com> (raw)
In-Reply-To: <DB7PR05MB44260BC7AF56086BC4B2FE17C3870@DB7PR05MB4426.eurprd05.prod.outlook.com>

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 <nelio.laranjeiro@6wind.com>
> > ---
>[...]
> > -			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

  reply	other threads:[~2018-05-03  9:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 14:42 Nelio Laranjeiro
2018-05-03  7:07 ` Shahaf Shuler
2018-05-03  9:23   ` Nélio Laranjeiro [this message]
2018-05-03  9:31 ` [dpdk-stable] [PATCH v2] net/mlx5: fix " Nelio Laranjeiro
2018-05-03 10:40   ` Shahaf Shuler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180503092314.ianfr2xllm7ner5c@laranjeiro-vm.dev.6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=shahafs@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).