[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <57E20CEC.4040600@gmail.com>
Date: Tue, 20 Sep 2016 21:30:36 -0700
From: John Fastabend <john.fastabend@...il.com>
To: zhuyj <zyjzyj2000@...il.com>
Cc: bblanco@...mgrid.com, alexei.starovoitov@...il.com,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>, brouer@...hat.com,
"David S. Miller" <davem@...emloft.net>,
Cong Wang <xiyou.wangcong@...il.com>,
intel-wired-lan <intel-wired-lan@...ts.osuosl.org>,
u9012063@...il.com, netdev <netdev@...r.kernel.org>
Subject: Re: [net-next PATCH v2 1/2] e1000: add initial XDP support
On 16-09-20 09:26 PM, zhuyj wrote:
> +static int e1000_xdp_set(struct net_device *netdev, struct bpf_prog *prog)
> +{
> + struct e1000_adapter *adapter = netdev_priv(netdev);
> + struct bpf_prog *old_prog;
> +
> + old_prog = xchg(&adapter->prog, prog);
> + if (old_prog) {
> + synchronize_net();
> + bpf_prog_put(old_prog);
> + }
> +
> + if (netif_running(netdev))
> + e1000_reinit_locked(adapter);
> + else
> + e1000_reset(adapter);
> + return 0;
> +}
>
> To this function, is it better to use "static void
> e1000_xdp_set(struct net_device *netdev, struct bpf_prog *prog)"?
> since it is always to return 0.
>
In general try to avoid top posting.
Yes making it void would be reasonable and probably a good idea. I'll
do it in v3.
[...]
Thanks,
John
Powered by blists - more mailing lists