From: Michael Chan <michael.c...@broadcom.com>
Date: Wed, 12 Apr 2017 23:48:22 -0700

> On Wed, Apr 12, 2017 at 11:54 AM, David Miller <da...@davemloft.net> wrote:
>>
>> +static struct static_key generic_xdp_needed __read_mostly;
>> +
>> +static int generic_xdp_install(struct net_device *dev, struct netdev_xdp 
>> *xdp)
>> +{
>> +       struct bpf_prog *new = xdp->prog;
>> +       int ret = 0;
>> +
>> +       switch (xdp->command) {
>> +       case XDP_SETUP_PROG: {
>> +               struct bpf_prog *old = rtnl_dereference(dev->xdp_prog);
>> +
>> +               rcu_assign_pointer(dev->xdp_prog, new);
>> +               if (old)
>> +                       bpf_prog_put(old);
>> +
>> +               if (old && !new)
>> +                       static_key_slow_dec(&generic_xdp_needed);
>> +               else if (new && !old)
>> +                       static_key_slow_inc(&generic_xdp_needed);
> 
> I think we need to call dev_disable_lro(dev) to disable LRO also when
> a BPF program is installed.

Agreed, I'll add this.

Thanks Michael.

Reply via email to