All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Saeed Mahameed <saeedm@mellanox.com>
Cc: "dsahern@gmail.com" <dsahern@gmail.com>,
	"Toke Høiland-Jørgensen" <thoiland@redhat.com>,
	"hawk@kernel.org" <hawk@kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"borkmann@iogearbox.net" <borkmann@iogearbox.net>,
	"Tariq Toukan" <tariqt@mellanox.com>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"makita.toshiaki@lab.ntt.co.jp" <makita.toshiaki@lab.ntt.co.jp>,
	brouer@redhat.com, "Toke Høiland-Jørgensen" <toke@toke.dk>
Subject: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)
Date: Thu, 7 Feb 2019 08:48:15 +0100	[thread overview]
Message-ID: <20190207084815.1e8bd817@carbon> (raw)
In-Reply-To: <140ecbe1e25f54f90d859cc696c4119aa96bc6eb.camel@mellanox.com>


On Wed, 6 Feb 2019 00:06:33 +0000 Saeed Mahameed <saeedm@mellanox.com> wrote:

> On Mon, 2019-02-04 at 19:13 -0800, David Ahern wrote:
[...]
> > 
> > mlx5 needs some work. As I recall it still has the bug/panic
> > removing xdp programs - at least I don't recall seeing a patch for
> > it.  
> 
> Only when xdp_redirect to mlx5, and removing the program while
> redirect is happening, this is actually due to a lack of
> synchronization means between different drivers, we have some ideas
> to overcome this using a standard XDP API, or just use a hack in mlx5
> driver which i don't like:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git/commit/?h=topic/xdp-redirect-fix&id=a3652d03cc35fd3ad62744986c8ccaca74c9f20c
> 
> I will be working on this towards the end of this week.

Toke and I have been discussing how to solve this.

The main idea for fixing this is to tie resource allocation to interface
insertion into interface maps (kernel/bpf/devmap.c). As the =devmap=
already have the needed synchronisation mechanisms and steps for safely
adding and removing =net_devices= (e.g. stopping RX side, flushing
remaining frames, waiting RCU period before freeing objects, etc.)

As described here:
 https://github.com/xdp-project/xdp-project/blob/master/xdp-project.org#better-ndo_xdp_xmit-resource-management

--Jesper

  parent reply	other threads:[~2019-02-07  7:48 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 11:40 [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames Toshiaki Makita
2019-01-31 15:25 ` Michael S. Tsirkin
2019-01-31 17:45   ` David Miller
2019-01-31 20:15     ` Jesper Dangaard Brouer
2019-01-31 20:15     ` Jesper Dangaard Brouer
2019-02-01  1:53       ` Toshiaki Makita
2019-02-01  1:53       ` Toshiaki Makita
2019-02-02 21:27       ` David Ahern
2019-02-04 11:53         ` Jesper Dangaard Brouer
2019-02-05  3:13           ` David Ahern
2019-02-06  0:06             ` Saeed Mahameed
2019-02-06 13:48               ` Jesper Dangaard Brouer
2019-02-06 13:48               ` Jesper Dangaard Brouer
2019-02-06 15:52                 ` Jakub Kicinski
2019-02-06 15:52                 ` Jakub Kicinski
2019-02-07  7:48               ` Jesper Dangaard Brouer [this message]
2019-02-07 19:08                 ` Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames) Saeed Mahameed
2019-02-08 16:55                   ` Toke Høiland-Jørgensen
2019-02-08 22:49                     ` Saeed Mahameed
2019-02-08 23:17                   ` Saeed Mahameed
2019-02-09  0:18                     ` Saeed Mahameed
2019-02-09  2:05                       ` Jakub Kicinski
2019-02-09 16:56                         ` Toke Høiland-Jørgensen
2019-02-09  2:05                       ` Jakub Kicinski
2019-02-09 16:56                       ` Toke Høiland-Jørgensen
2019-02-07  7:48               ` Jesper Dangaard Brouer
2019-02-08 16:02               ` [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames Jesper Dangaard Brouer
2019-02-08 16:02               ` Jesper Dangaard Brouer
2019-04-18 14:24             ` Stats for XDP actions (was: Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames) Toke Høiland-Jørgensen
2019-04-18 14:24             ` Toke Høiland-Jørgensen
2019-04-21  0:16               ` Stats for XDP actions David Ahern
2019-04-21  0:16                 ` David Ahern
2019-06-20 20:42                 ` Toke Høiland-Jørgensen
2019-06-21  0:42                   ` David Ahern
2019-06-21  0:42                     ` David Ahern
2019-06-21 13:57                     ` Toke Høiland-Jørgensen
2019-06-21 13:57                     ` Toke Høiland-Jørgensen
2019-06-20 20:42                 ` Toke Høiland-Jørgensen
2019-02-04 11:53         ` [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames Jesper Dangaard Brouer
2019-01-31 17:45   ` David Miller
2019-01-31 15:25 ` Michael S. Tsirkin
2019-02-04  4:18 ` David Miller
2019-02-04  4:18 ` David Miller

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=20190207084815.1e8bd817@carbon \
    --to=brouer@redhat.com \
    --cc=borkmann@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=hawk@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=makita.toshiaki@lab.ntt.co.jp \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=tariqt@mellanox.com \
    --cc=thoiland@redhat.com \
    --cc=toke@toke.dk \
    --cc=virtualization@lists.linux-foundation.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.