[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191001123700.5d1fa185@mcroce-redhat>
Date: Tue, 1 Oct 2019 12:37:00 +0200
From: Matteo Croce <mcroce@...hat.com>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: netdev@...r.kernel.org, thomas.petazzoni@...tlin.com,
ilias.apalodimas@...aro.org, brouer@...hat.com
Subject: Re: [RFC 3/4] net: mvneta: add basic XDP support
On Tue, 1 Oct 2019 11:24:43 +0200
Lorenzo Bianconi <lorenzo@...nel.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
Powered by blists - more mailing lists