On Tue,  1 Oct 2019 11:24:43 +0200
Lorenzo Bianconi <lore...@kernel.org> wrote:
> +static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog
> *prog,
> +                         struct netlink_ext_ack *extack)
> +{
> +     struct mvneta_port *pp = netdev_priv(dev);
> +     struct bpf_prog *old_prog;
> +
> +     if (prog && dev->mtu > MVNETA_MAX_RX_BUF_SIZE) {
> +             NL_SET_ERR_MSG_MOD(extack, "Jumbo frames not
> supported on XDP");
> +             return -EOPNOTSUPP;

-ENOTSUPP maybe?

> +     }
> +
> +     mvneta_stop(dev);

only stop and restart if already running

> +
> +     old_prog = xchg(&pp->xdp_prog, prog);
> +     if (old_prog)
> +             bpf_prog_put(old_prog);
> +
> +     mvneta_open(dev);

^^

-- 
Matteo Croce
per aspera ad upstream

Reply via email to