bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	xdp-newbies@vger.kernel.org, bpf@vger.kernel.org,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH v2 net 2/2] net: core: generic XDP support for stacked device
Date: Tue, 21 May 2019 17:21:45 +0200	[thread overview]
Message-ID: <20190521152145.GA2165@nanopsycho.orion> (raw)
In-Reply-To: <20190521074553.12329dd5@hermes.lan>

Tue, May 21, 2019 at 04:45:53PM CEST, stephen@networkplumber.org wrote:
>On Tue, 21 May 2019 08:15:36 +0200
>Jiri Pirko <jiri@resnulli.us> wrote:
>
>> +	if (static_branch_unlikely(&generic_xdp_needed_key)) {
>> +		int ret2;
>> +
>> +		preempt_disable();
>> +		rcu_read_lock();
>> +		ret2 = do_xdp_generic(rcu_dereference(skb->dev->xdp_prog), skb);
>> +		rcu_read_unlock();
>> +		preempt_enable();
>> +
>> +		if (ret2 != XDP_PASS)
>> +			return NET_RX_DROP;
>> +	}
>> +
>
>rcu_read_lock is already held by callers of __netif_receive_skb_core

Sure, the purpose of the draft was just to show the idea.

  reply	other threads:[~2019-05-21 15:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-19  3:10 [PATCH v2 net 0/2] XDP generic related fixes Stephen Hemminger
2019-05-19  3:10 ` [PATCH v2 net 1/2] netvsc: unshare skb in VF rx handler Stephen Hemminger
2019-05-19  3:10 ` [PATCH v2 net 2/2] net: core: generic XDP support for stacked device Stephen Hemminger
2019-05-20  9:11   ` Jiri Pirko
2019-05-20 15:53     ` Stephen Hemminger
2019-05-21  5:54       ` Jason Wang
2019-05-20 16:04     ` Stephen Hemminger
2019-05-21  6:15       ` Jiri Pirko
2019-05-21 14:45         ` Stephen Hemminger
2019-05-21 15:21           ` Jiri Pirko [this message]
2019-05-21  4:47     ` Jason Wang
2019-05-21  6:08       ` Jiri Pirko

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=20190521152145.GA2165@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=sthemmin@microsoft.com \
    --cc=xdp-newbies@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).