bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	xdp-newbies@vger.kernel.org, bpf@vger.kernel.org,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [PATCH v2 net 2/2] net: core: generic XDP support for stacked device
Date: Tue, 21 May 2019 13:54:26 +0800	[thread overview]
Message-ID: <2abc3bd0-dccb-9885-b152-ef144ad12f29@redhat.com> (raw)
In-Reply-To: <20190520085340.4f44ac8b@hermes.lan>


On 2019/5/20 下午11:53, Stephen Hemminger wrote:
> On Mon, 20 May 2019 11:11:05 +0200
> Jiri Pirko <jiri@resnulli.us> wrote:
>
>> Sun, May 19, 2019 at 05:10:46AM CEST, stephen@networkplumber.org wrote:
>>> When a device is stacked like (team, bonding, failsafe or netvsc) the
>>> XDP generic program for the parent device is not called.  In these
>>> cases, the rx handler changes skb->dev to its own in the receive
>>> handler, and returns RX_HANDLER_ANOTHER.  Fix this by calling
>>> do_xdp_generic if necessary before starting another round.
>>>
>>> Review of all the places RX_HANDLER_ANOTHER is returned
>>> show that the current devices do correctly change skb->dev.
>>>
>>> There was an older patch that got abandoned that did the
>>> same thing, this is just a rewrite.
>>>
>>> Suggested-by: Jason Wang <jasowang@redhat.com>
>>> Fixes: d445516966dc ("net: xdp: support xdp generic on virtual devices")
>>> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
>>> Acked-by: Jason Wang <jasowang@redhat.com>
>>> ---
>> I'm always scarred of changes like this. The history tells us that this
>> codepaths are very fragile. It took us non-trivial efford to fix bonding
>> here, not to mention vlans (that was pain).
>>
>> The reason for troubles was often fact that different flows were treated
>> differently (vlan accel/non-accel).
> Yes, this is a sensitive path. Another alternative is to fix it
> inside each device (netvsc). That is what my earlier patch did and that
> is what is being done now (probably will make it into the RHEL on Azure
> drivers).
>   
>> This patch calls do_xdp_generic for master device in different point in
>> the receive patch comparing to lower device. Would it be possible to
>> unify this? E.g. by moving do_xdp_generice() call from
>> netif_rx_internal()/netif_receive_skb_internal() here,
>> to the beginning of __netif_receive_skb_core()?
>>
> That could work, but has the question about doing XDP farther down
> call stack (lower performance).
>
> There is also the case what if both paths support XDP in driver.
> This would be the ideal case, how would this work?
>
>

I think we have a clear request of allowing native XDP to work on 
stacked device. We're missing some generic building blocks (like XDP rx 
handler) here.

Thanks



  reply	other threads:[~2019-05-21  5:54 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 [this message]
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
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=2abc3bd0-dccb-9885-b152-ef144ad12f29@redhat.com \
    --to=jasowang@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --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).