[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190207084815.1e8bd817@carbon>
Date: Thu, 7 Feb 2019 08:48:15 +0100
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Saeed Mahameed <saeedm@...lanox.com>
Cc: "dsahern@...il.com" <dsahern@...il.com>,
Toke Høiland-Jørgensen
<thoiland@...hat.com>, "hawk@...nel.org" <hawk@...nel.org>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"borkmann@...earbox.net" <borkmann@...earbox.net>,
Tariq Toukan <tariqt@...lanox.com>,
"john.fastabend@...il.com" <john.fastabend@...il.com>,
"mst@...hat.com" <mst@...hat.com>,
"jakub.kicinski@...ronome.com" <jakub.kicinski@...ronome.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"makita.toshiaki@....ntt.co.jp" <makita.toshiaki@....ntt.co.jp>,
brouer@...hat.com,
Toke Høiland-Jørgensen <toke@...e.dk>
Subject: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net:
Account for tx bytes and packets on sending xdp_frames)
On Wed, 6 Feb 2019 00:06:33 +0000 Saeed Mahameed <saeedm@...lanox.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
Powered by blists - more mailing lists