From: Stephen Hemminger <stephen@networkplumber.org>
To: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH net-next] net: Add sysctl to toggle early demux for tcp and udp
Date: Thu, 9 Mar 2017 15:50:37 -0800 [thread overview]
Message-ID: <20170309155037.07fa7e98@xeon-e3> (raw)
In-Reply-To: <1489093758-17731-1-git-send-email-subashab@codeaurora.org>
On Thu, 9 Mar 2017 14:09:18 -0700
Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> wrote:
> Certain system process significant unconnected UDP workload.
> It would be preferrable to disable UDP early demux for those systems
> and enable it for TCP only.
>
> Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
> Suggested-by: Eric Dumazet <edumazet@google.com>
> ---
This makes sense.
> diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
> index d6feabb..187feae 100644
> --- a/net/ipv4/ip_input.c
> +++ b/net/ipv4/ip_input.c
> @@ -329,7 +329,7 @@ static int ip_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
> int protocol = iph->protocol;
>
> ipprot = rcu_dereference(inet_protos[protocol]);
> - if (ipprot && ipprot->early_demux) {
> + if (ipprot && ipprot->early_demux && *ipprot->early_demux_enabled) {
> ipprot->early_demux(skb);
> /* must reload iph, skb->head might have changed */
> iph = ip_hdr(skb);
Another possible option would be change the function pointer for early_demux instead of having
an additional conditional test (and cache line read). The downside of doing it that way
is the code to turn the sysctl on/off gets more complicated than simple standard proc_int_vec.
prev parent reply other threads:[~2017-03-09 23:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 21:09 [PATCH net-next] net: Add sysctl to toggle early demux for tcp and udp Subash Abhinov Kasiviswanathan
2017-03-09 23:50 ` Stephen Hemminger [this message]
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=20170309155037.07fa7e98@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=subashab@codeaurora.org \
/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).