[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171124192848.049a73f2@cakuba.netronome.com>
Date: Fri, 24 Nov 2017 19:28:48 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: netdev@...r.kernel.org, oss-drivers@...ronome.com,
alexei.starovoitov@...il.com, jiri@...nulli.us,
Saeed Mahameed <saeedm@...lanox.com>,
Michael Chan <michael.chan@...adcom.com>,
Ariel Elior <Ariel.Elior@...ium.com>,
John Fastabend <john.fastabend@...il.com>
Subject: Re: [RFC net-next 3/6] net: xdp: make the stack take care of the
tear down
On Sat, 25 Nov 2017 00:24:50 +0100, Daniel Borkmann wrote:
> > +static void dev_xdp_uninstall(struct net_device *dev)
> > +{
> > + struct netdev_bpf xdp;
> > + bpf_op_t ndo_bpf;
>
> Can you add a comment here stating that generic XDP does not
> need to be handled since we drop the prog from free_netdev()?
> Potentially we could also drop the generic one from here, that
> way we'd make no difference and have a dev_xdp_install() and
> one dev_xdp_uninstall() for all kind of attach types. Given
> generic XDP should simulate native XDP anyway, probably better
> to just do that.
I will move the freeing of generic XDP here and add a simple test to
the last patch. Thanks!
> > + ndo_bpf = dev->netdev_ops->ndo_bpf;
> > + if (!ndo_bpf)
> > + return;
> > +
> > + __dev_xdp_query(dev, ndo_bpf, &xdp);
> > + if (xdp.prog_attached == XDP_ATTACHED_NONE)
> > + return;
> > +
> > + /* Program removal should always succeed */
> > + WARN_ON(dev_xdp_install(dev, ndo_bpf, NULL, xdp.prog_flags, NULL));
> > +}
Powered by blists - more mailing lists