patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@mellanox.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Thomas Monjalon <thomas@monjalon.net>,
	"Olga Shern" <olgas@mellanox.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH v1] net/mlx4: fix RSS actions with no parameters
Date: Sat, 24 Feb 2018 23:18:54 +0000	[thread overview]
Message-ID: <AM0PR0502MB3875B60E5F7A99A98304972DD1C30@AM0PR0502MB3875.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20180223165239.GL4256@6wind.com>

Hi,
Please see below

> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Friday, February 23, 2018 6:53 PM
> To: Ophir Munk <ophirmu@mellanox.com>
> Cc: dev@dpdk.org; Thomas Monjalon <thomas@monjalon.net>; Olga Shern
> <olgas@mellanox.com>; stable@dpdk.org
> Subject: Re: [PATCH v1] net/mlx4: fix RSS actions with no parameters
> 
> On Wed, Feb 21, 2018 at 01:38:38PM +0000, Ophir Munk wrote:
> > When creating an RSS flow with missing actions parameters, for example:
> > flow create 0 ingress pattern <list of patterns>  / end actions rss /
> > end
> >
> > testpmd aborts with segmentation fault.
> > In the corrupted code mlx4_flow_prepare() accesses RSS action->conf
> > pointer without verifying its validity.
> > In case of missing RSS actions parameters this pointer is NULL and
> > must not  be accessed.
> 
> Problem is that testpmd is far from perfect and shouldn't feed PMDs with
> invalid pointers in the first place. The configuration structure is not
> documented as optional with actions that take one.
> 
> > The fix is to return an error in such cases "missing rss actions".
> >
> > Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> 
> I suggest to fix this at once for all present and future PMDs in testpmd
> directly. It may be added as a workaround in mlx4 but not as a fix since the
> cause is not in that PMD.
> 

I am not sure if missing rss queues in testpmd is not by design. For example a PMD can theoretically
interpreted it as an rss default action to split traffic over all existing device queues, or giving it any other meaning.
The lack of rss queues should be left to the interpretation of the PMD. 

For example:
* ixgbe PMD seems to handle an NULL rss configuration pointer in its own way
* mlx5 PMD checks for this and return an error in such a case

Changes to testpmd will have to be coordinated and accepted by all dpdk PMDs.

> > ---
> >  drivers/net/mlx4/mlx4_flow.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/mlx4/mlx4_flow.c
> > b/drivers/net/mlx4/mlx4_flow.c index 2d55bfe..7a127a8 100644
> > --- a/drivers/net/mlx4/mlx4_flow.c
> > +++ b/drivers/net/mlx4/mlx4_flow.c
> > @@ -735,6 +735,10 @@ mlx4_flow_prepare(struct priv *priv,
> >  			if (flow->rss)
> >  				break;
> >  			rss = action->conf;
> > +			if (!rss) {
> > +				msg = "missing rss actions";
> > +				goto exit_action_not_supported;
> > +			}
> 
> This message may be understood as a lack of RSS action, while it is in fact
> present. This error can be more accurately described as:
> 
>  "RSS action configuration wasn't provided"
> 

mlx5 PMD printout for missing rss queues is: "no valid queues"

I suggest that both mlx4 and mlx5 print the same error for the same rss flow w/o queues.
Do you confirm using mlx5 message printed above?

> Note the same issue exists with the QUEUE action handled just prior to this
> one and probably affects other PMDs as well. You really should consider
> fixing testpmd instead.
> 
> --
> Adrien Mazarguil
> 6WIND

  reply	other threads:[~2018-02-24 23:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 13:38 Ophir Munk
2018-02-23 16:52 ` Adrien Mazarguil
2018-02-24 23:18   ` Ophir Munk [this message]
2018-02-26  9:31     ` Adrien Mazarguil

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=AM0PR0502MB3875B60E5F7A99A98304972DD1C30@AM0PR0502MB3875.eurprd05.prod.outlook.com \
    --to=ophirmu@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=olgas@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).