netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: netdev@vger.kernel.org, john.r.fastabend@intel.com,
	sridhar.samudrala@intel.com
Subject: Re: [PATCHv2 net 2/2] net: cls_u32: be more strict about skip-sw flag
Date: Tue, 7 Jun 2016 17:06:03 +0100	[thread overview]
Message-ID: <20160607170603.1ab175a4@jkicinski-Precision-T1700> (raw)
In-Reply-To: <5756EDFF.2000301@gmail.com>

On Tue, 7 Jun 2016 08:53:35 -0700, John Fastabend wrote:
> On 16-06-07 03:46 AM, Jakub Kicinski wrote:
> > Return an error if user requested skip-sw and the underlaying
> > hardware cannot handle tc offloads (or offloads are disabled).
> > 
> > Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> > Reviewed-by: Dinan Gunawardena <dgunawardena@netronome.com>
> > Reviewed-by: Simon Horman <simon.horman@netronome.com>
> > ---
> > v2:
> >   - handle both knode and hnodes
> > ---
> >  net/sched/cls_u32.c | 58 +++++++++++++++++++++++++++--------------------------
> >  1 file changed, 30 insertions(+), 28 deletions(-)
> > 
> > diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
> > index b17e090f2fe1..0fc1d47885f8 100644
> > --- a/net/sched/cls_u32.c
> > +++ b/net/sched/cls_u32.c
> > @@ -457,20 +457,21 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp,
> >  	struct tc_to_netdev offload;
> >  	int err;
> >  
> > +	if (!tc_should_offload(dev, flags))
> > +		return tc_skip_sw(flags) ? -EINVAL : 0;
> > +
> >  	offload.type = TC_SETUP_CLSU32;
> >  	offload.cls_u32 = &u32_offload;
> >  
> > -	if (tc_should_offload(dev, flags)) {
> > -		offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
> > -		offload.cls_u32->hnode.divisor = h->divisor;
> > -		offload.cls_u32->hnode.handle = h->handle;
> > -		offload.cls_u32->hnode.prio = h->prio;
> > +	offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
> > +	offload.cls_u32->hnode.divisor = h->divisor;
> > +	offload.cls_u32->hnode.handle = h->handle;
> > +	offload.cls_u32->hnode.prio = h->prio;
> >  
> > -		err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
> > -						    tp->protocol, &offload);
> > -		if (tc_skip_sw(flags))
> > -			return err;
> > -	}
> > +	err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
> > +					    tp->protocol, &offload);
> > +	if (tc_skip_sw(flags))
> > +		return err;
> >  
> >  	return 0;
> >  }  
> 
> Looks like we also need to catch the error at u32_replace_hw_hnode call
> sites?
> 
> 
>                 u32_replace_hw_hnode(tp, ht, flags);
>                 return 0;
>         }
> 
> should be
> 
> 		return replace_hw_hnode(tp, ht,flags)

Indeed. I'll add a third patch to the series, seems like a separate bug.

  reply	other threads:[~2016-06-07 16:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 15:16 [PATCH net 0/2] cls_u32 hardware offload fixes Jakub Kicinski
2016-06-06 15:16 ` [PATCH net 1/2] net: cls_u32: fix error code for invalid flags Jakub Kicinski
2016-06-06 17:16   ` Samudrala, Sridhar
2016-06-07 15:46   ` John Fastabend
2016-06-06 15:16 ` [PATCH net 2/2] net: cls_u32: be more strict about skip-sw flag Jakub Kicinski
2016-06-06 17:25   ` Samudrala, Sridhar
2016-06-07 10:46 ` [PATCHv2 net 0/2] cls_u32 hardware offload fixes Jakub Kicinski
2016-06-07 10:46   ` [PATCHv2 net 1/2] net: cls_u32: fix error code for invalid flags Jakub Kicinski
2016-06-07 15:47     ` John Fastabend
2016-06-07 10:46   ` [PATCHv2 net 2/2] net: cls_u32: be more strict about skip-sw flag Jakub Kicinski
2016-06-07 15:53     ` John Fastabend
2016-06-07 16:06       ` Jakub Kicinski [this message]
2016-06-07 22:17 ` [PATCHv3 net 0/3] cls_u32 hardware offload fixes Jakub Kicinski
2016-06-07 22:17   ` [PATCHv3 net 1/3] net: cls_u32: fix error code for invalid flags Jakub Kicinski
2016-06-07 22:17   ` [PATCHv3 net 2/3] net: cls_u32: be more strict about skip-sw flag Jakub Kicinski
2016-06-07 22:36     ` Samudrala, Sridhar
2016-06-07 22:17   ` [PATCHv3 net 3/3] net: cls_u32: catch all hardware offload errors Jakub Kicinski
2016-06-07 22:38     ` Samudrala, Sridhar
2016-06-07 23:27 ` [PATCH net 0/2] cls_u32 hardware offload fixes David Miller
2016-06-08 10:18   ` Jakub Kicinski
2016-06-08 18:09     ` David Miller
2016-06-08 19:18       ` Jakub Kicinski

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=20160607170603.1ab175a4@jkicinski-Precision-T1700 \
    --to=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sridhar.samudrala@intel.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).