From: Jakub Kicinski <kubakici@wp.pl>
To: Yuval Mintz <Yuval.Mintz@cavium.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 10/11] qede: Add basic XDP support
Date: Mon, 28 Nov 2016 19:18:32 +0000 [thread overview]
Message-ID: <20161128191832.46191e1c@jkicinski-Precision-T1700> (raw)
In-Reply-To: <1480258273-24973-11-git-send-email-Yuval.Mintz@cavium.com>
On Sun, 27 Nov 2016 16:51:12 +0200, Yuval Mintz wrote:
> Add support for the ndo_xdp callback. This patch would support XDP_PASS,
> XDP_DROP and XDP_ABORTED commands.
>
> This also adds a per Rx queue statistic which counts number of packets
> which didn't reach the stack [due to XDP].
>
> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
> ---
> [...]
> +static int qede_xdp_set(struct qede_dev *edev, struct bpf_prog *prog)
> +{
> + bool reload_required = true;
> + struct qede_reload_args args;
> + int rc = 0;
> +
> + /* Protect against various other internal-reload flows */
> + __qede_lock(edev);
> + if (edev->state != QEDE_STATE_OPEN) {
> + rc = -EINVAL;
> + goto out;
> + }
> +
> + /* If we're called, there was already a bpf reference increment */
> + args.func = &qede_xdp_reload_func;
> + args.u.new_prog = prog;
> + if (reload_required)
> + qede_reload(edev, &args, true);
> + else
> + args.func(edev, &args);
> +
> +out:
> + __qede_unlock(edev);
> + return rc;
> +}
Any particular reason not to allow the XDP prog being set while the
device is closed? You seem to preserve the program across
close()/open() cycles so the edev->xdp_prog is alive and valid while
device is closed IIUC.
I think other drivers are allowing setting XDP while closed and it
would be cool to keep the behaviour identical across drivers :)
next prev parent reply other threads:[~2016-11-28 19:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-27 14:51 [PATCH net-next 00/11] qed*: Add XDP support Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 01/11] qede: Optimize aggregation information size Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 02/11] qed: Optimize qed_chain datapath usage Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 03/11] qede: Remove 'num_tc' Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 04/11] qede: Refactor statistics gathering Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 05/11] qede: Refactor data-path Rx flow Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 06/11] qede: Revise state locking scheme Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 07/11] qed*: Handle-based L2-queues Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 08/11] qede: Don't check netdevice for rx-hash Yuval Mintz
2016-11-27 14:51 ` [PATCH net-next 09/11] qede: Better utilize the qede_[rt]x_queue Yuval Mintz
2016-11-27 15:51 ` kbuild test robot
2016-11-27 16:15 ` Mintz, Yuval
2016-11-27 20:16 ` David Miller
2016-11-27 21:17 ` Mintz, Yuval
2016-11-27 14:51 ` [PATCH net-next 10/11] qede: Add basic XDP support Yuval Mintz
2016-11-28 19:18 ` Jakub Kicinski [this message]
2016-11-28 20:20 ` Mintz, Yuval
[not found] ` <CALx6S36kiAiMeZoszx=5uBrUecwCodJx2tg3kL4HBk=4eVMSLg@mail.gmail.com>
2016-11-28 20:53 ` Mintz, Yuval
2016-11-27 14:51 ` [PATCH net-next 11/11] qede: Add support for XDP_TX Yuval Mintz
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=20161128191832.46191e1c@jkicinski-Precision-T1700 \
--to=kubakici@wp.pl \
--cc=Yuval.Mintz@cavium.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox