netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	oss-drivers@netronome.com,
	Stephen Hemminger <stephen@networkplumber.org>,
	kbuild test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Ben Hutchings <ben@decadent.org.uk>,
	Simon Horman <simon.horman@netronome.com>
Subject: Re: [PATCH net] net: netem: fix error path for corrupted GSO frames
Date: Wed, 16 Oct 2019 16:22:18 -0700	[thread overview]
Message-ID: <20191016162210.5f2a8256@cakuba.netronome.com> (raw)
In-Reply-To: <CAM_iQpXw7xBTGctD2oLdWGZHc+mpeUAMq5Z4AYvKSiw68e=5EQ@mail.gmail.com>

On Wed, 16 Oct 2019 15:42:28 -0700, Cong Wang wrote:
> > @@ -612,7 +613,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,
> >                         }
> >                         segs = skb2;
> >                 }
> > -               qdisc_tree_reduce_backlog(sch, -nb, prev_len - len);
> > +               qdisc_tree_reduce_backlog(sch, !skb - nb, prev_len - len);  
> 
> Am I the only one has trouble to understand the expression
> "!skb - nb"?

The backward logic of qdisc_tree_reduce_backlog() always gives me a
pause :S  

Is 
-nb + !skb 
any better?

The point is we have a "credit" for the "head" skb we dropped. If we
didn't manage to queue any of the segs then the expression becomes 
...reduce_backlog(sch, 1, prev_len) basically cleaning up after the
head.

My knee jerk reaction was -> we should return DROP if head got dropped,
but that just makes things more nasty because we requeue the segs
directly into netem so if we say DROP we have to special case all the
segs which succeeded, that gets even more hairy.

I'm open to suggestions.. :(

  reply	other threads:[~2019-10-16 23:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 16:00 [PATCH net] net: netem: fix error path for corrupted GSO frames Jakub Kicinski
2019-10-16 22:42 ` Cong Wang
2019-10-16 23:22   ` Jakub Kicinski [this message]
2019-10-17 18:10     ` Cong Wang
2019-10-17 18:44       ` Jakub Kicinski
2019-10-17 19:28         ` Cong Wang

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=20191016162210.5f2a8256@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=ben@decadent.org.uk \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=simon.horman@netronome.com \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.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).