netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Davide Caratti <dcaratti@redhat.com>,
	Boris Pismenny <borisp@mellanox.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Dave Watson <davejwatson@fb.com>,
	Aviad Yehezkel <aviadye@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] tcp: ulp: add functions to dump ulp-specific information
Date: Thu, 15 Aug 2019 20:46:01 +0200	[thread overview]
Message-ID: <228db5cc-9b10-521f-9031-e0f86f5ded3e@gmail.com> (raw)
In-Reply-To: <f9b5663d28547b0d1c187d874c7b5e5ece8fe8fa.1565882584.git.dcaratti@redhat.com>



On 8/15/19 6:00 PM, Davide Caratti wrote:

>  
> +	if (net_admin) {
> +		const struct tcp_ulp_ops *ulp_ops;
> +
> +		rcu_read_lock();
> +		ulp_ops = icsk->icsk_ulp_ops;
> +		if (ulp_ops)
> +			err = tcp_diag_put_ulp(skb, sk, ulp_ops);
> +		rcu_read_unlock();
> +		if (err)
> +			return err;
> +	}
>  	return 0;


Why is rcu_read_lock() and rcu_read_unlock() used at all ?

icsk->icsk_ulp_ops does not seem to be rcu protected ?

If this was, then an rcu_dereference() would be appropriate.


  reply	other threads:[~2019-08-15 18:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15 16:00 [PATCH net-next 0/3] net: tls: add socket diag Davide Caratti
2019-08-15 16:00 ` [PATCH net-next 1/3] net/tls: use RCU protection on icsk->icsk_ulp_data Davide Caratti
2019-08-15 21:32   ` Jakub Kicinski
2019-08-19 13:23     ` Davide Caratti
2019-08-15 16:00 ` [PATCH net-next 2/3] tcp: ulp: add functions to dump ulp-specific information Davide Caratti
2019-08-15 18:46   ` Eric Dumazet [this message]
2019-08-15 21:38     ` Jakub Kicinski
2019-08-19 13:32       ` Davide Caratti
2019-08-19 20:40         ` Jakub Kicinski
2019-08-15 16:00 ` [PATCH net-next 3/3] net: tls: export protocol version, cipher, tx_conf/rx_conf to socket diag Davide Caratti

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=228db5cc-9b10-521f-9031-e0f86f5ded3e@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=aviadye@mellanox.com \
    --cc=borisp@mellanox.com \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.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).