From: Eric Dumazet <eric.dumazet@gmail.com>
To: Felix Fietkau <nbd@nbd.name>, David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
"Johannes Berg" <johannes.berg@intel.com>,
"Toke Høiland-Jørgensen" <toke@toke.dk>,
"Kir Kolyshkin" <kir@openvz.org>
Subject: Re: [PATCH v2 net-next] tcp: allow drivers to tweak TSQ logic
Date: Tue, 28 Nov 2017 09:33:49 -0800 [thread overview]
Message-ID: <1511890429.16595.20.camel@gmail.com> (raw)
In-Reply-To: <5cc376a2-895e-68f6-cddd-1011b0fc26bd@nbd.name>
On Tue, 2017-11-28 at 14:10 +0100, Felix Fietkau wrote:
> On 2017-11-12 00:54, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> >
> > I had many reports that TSQ logic breaks wifi aggregation.
> >
> > Current logic is to allow up to 1 ms of bytes to be queued into
> > qdisc
> > and drivers queues.
> >
> > But Wifi aggregation needs a bigger budget to allow bigger rates to
> > be discovered by various TCP Congestion Controls algorithms.
> >
> > This patch adds an extra socket field, allowing wifi drivers to
> > select
> > another log scale to derive TCP Small Queue credit from current
> > pacing
> > rate.
> >
> > Initial value is 10, meaning that this patch does not change
> > current
> > behavior.
> >
> > We expect wifi drivers to set this field to smaller values (tests
> > have
> > been done with values from 6 to 9)
> >
> > They would have to use following template :
> >
> > if (skb->sk && skb->sk->sk_pacing_shift != MY_PACING_SHIFT)
> > skb->sk->sk_pacing_shift = MY_PACING_SHIFT;
>
> I did some experiments with this approach (with your patch backported
> to
> a 4.9 kernel), and I got some crashes.
> After looking at the crashes and code some more, it seems that this
> would need some extra checks to ensure that skb->sk is a full struct
> sock, instead of just a struct request_sock.
> Should this be done by checking for skb->sk->sk_state ==
> TCP_ESTABLISHED? It seems to me that this might introduce some extra
> overhead.
>
Hi Felix.
Answer is in the question, the pseudo code in the changelog was not
100% correct.
I will add following helper to net-next I guess :
void sk_pacing_shift_update(struct sock *sk, int val)
{
if (!sk || !sk_fullsock(sk) || sk->sk_pacing_shift == val)
return;
sk->sk_pacing_shift = val;
}
Then you might use it like that :
sk_pacing_shift_update(skb->sk, 7);
Thanks.
next prev parent reply other threads:[~2017-11-28 17:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 2:41 [PATCH net-next] tcp: allow drivers to tweak TSQ logic Eric Dumazet
2017-11-11 14:27 ` [net-next] " Johannes Berg
2017-11-11 23:38 ` Eric Dumazet
2017-11-13 9:21 ` Johannes Berg
2017-11-12 14:35 ` Toke Høiland-Jørgensen
2017-11-11 23:54 ` [PATCH v2 net-next] " Eric Dumazet
2017-11-12 13:39 ` Neal Cardwell
2017-11-14 7:18 ` David Miller
2017-11-28 13:10 ` Felix Fietkau
2017-11-28 17:33 ` Eric Dumazet [this message]
2017-12-12 14:34 ` [PATCH net-next] net: sk_pacing_shift_update() helper Eric Dumazet
2017-12-13 20:11 ` David Miller
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=1511890429.16595.20.camel@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=johannes.berg@intel.com \
--cc=kir@openvz.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=toke@toke.dk \
/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).