All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: netdev@vger.kernel.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH net-next v2] net: Add sysctl to toggle early demux for tcp and udp
Date: Thu, 09 Mar 2017 20:25:36 -0800	[thread overview]
Message-ID: <1489119936.28631.28.camel@edumazet-glaptop3.roam.corp.google.com> (raw)
In-Reply-To: <1489116660-4244-1-git-send-email-subashab@codeaurora.org>

On Thu, 2017-03-09 at 20:31 -0700, Subash Abhinov Kasiviswanathan 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.

> +void tcp_v4_early_demux_configure(int enable)
> +{
> +	if (enable)
> +		tcp_protocol.early_demux = tcp_v4_early_demux;
> +	else
> +		tcp_protocol.early_demux = NULL;
> +}
> +
> +void udp_v4_early_demux_configure(int enable)
> +{
> +	if (enable)
> +		udp_protocol.early_demux = udp_v4_early_demux;
> +	else
> +		udp_protocol.early_demux = NULL;
> +}
> +


Well, then you need to make sure ipprot->early_demux is read once in the
callers, like ip_rcv_finish(), otherwise compiler could read it twice
and we could deref a NULL pointer.

ipprot = rcu_dereference(inet_protos[protocol]);
if (ipprot && ipprot->early_demux) {
    ipprot->early_demux(skb);   // crash

  parent reply	other threads:[~2017-03-10  4:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  3:31 [PATCH net-next v2] net: Add sysctl to toggle early demux for tcp and udp Subash Abhinov Kasiviswanathan
2017-03-10  3:42 ` Tom Herbert
2017-03-10  5:26   ` Subash Abhinov Kasiviswanathan
2017-03-10 16:33     ` Tom Herbert
2017-03-11  0:22       ` Eric Dumazet
2017-03-11  0:49         ` Tom Herbert
2017-03-18 17:32           ` Subash Abhinov Kasiviswanathan
2017-03-18 17:44             ` Tom Herbert
2017-03-19  2:07               ` Subash Abhinov Kasiviswanathan
2017-03-19 19:18                 ` Eric Dumazet
2017-03-21 22:49                 ` Tom Herbert
2017-03-10  4:25 ` Eric Dumazet [this message]
2017-03-10  7:34   ` Subash Abhinov Kasiviswanathan
2017-03-10 12:42 ` kbuild test robot
2017-03-10 12:44 ` kbuild test robot

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=1489119936.28631.28.camel@edumazet-glaptop3.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.