All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matteo Croce <mcroce@redhat.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org, thomas.petazzoni@bootlin.com,
	ilias.apalodimas@linaro.org, brouer@redhat.com
Subject: Re: [RFC 3/4] net: mvneta: add basic XDP support
Date: Tue, 1 Oct 2019 12:37:00 +0200	[thread overview]
Message-ID: <20191001123700.5d1fa185@mcroce-redhat> (raw)
In-Reply-To: <5119bf5e9c33205196cf0e8b6dc7cf0d69a7e6e9.1569920973.git.lorenzo@kernel.org>

On Tue,  1 Oct 2019 11:24:43 +0200
Lorenzo Bianconi <lorenzo@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	other threads:[~2019-10-01 10:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  9:24 [RFC 0/4] add basic XDP support to mvneta driver Lorenzo Bianconi
2019-10-01  9:24 ` [RFC 1/4] net: mvneta: introduce page pool API for sw buffer manager Lorenzo Bianconi
2019-10-01 14:11   ` kbuild test robot
2019-10-01  9:24 ` [RFC 2/4] net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine Lorenzo Bianconi
2019-10-01  9:24 ` [RFC 3/4] net: mvneta: add basic XDP support Lorenzo Bianconi
2019-10-01 10:37   ` Matteo Croce [this message]
2019-10-01 11:02     ` Toke Høiland-Jørgensen
2019-10-01 10:52   ` Maciej Fijalkowski
2019-10-01 11:06     ` Toke Høiland-Jørgensen
2019-10-01 11:30       ` Jesper Dangaard Brouer
2019-10-01 11:47         ` Lorenzo Bianconi
2019-10-01 11:44     ` Lorenzo Bianconi
2019-10-02  3:41   ` Ilias Apalodimas
2019-10-02  8:59     ` Lorenzo Bianconi
2019-10-01  9:24 ` [RFC 4/4] net: mvneta: move header prefetch in mvneta_swbm_rx_frame Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191001123700.5d1fa185@mcroce-redhat \
    --to=mcroce@redhat.com \
    --cc=brouer@redhat.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.