[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191016162210.5f2a8256@cakuba.netronome.com>
Date: Wed, 16 Oct 2019 16:22:18 -0700
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: David Miller <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
oss-drivers@...ronome.com,
Stephen Hemminger <stephen@...workplumber.org>,
kbuild test robot <lkp@...el.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Ben Hutchings <ben@...adent.org.uk>,
Simon Horman <simon.horman@...ronome.com>
Subject: Re: [PATCH net] net: netem: fix error path for corrupted GSO frames
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.. :(
Powered by blists - more mailing lists