lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161128191832.46191e1c@jkicinski-Precision-T1700>
Date:   Mon, 28 Nov 2016 19:18:32 +0000
From:   Jakub Kicinski <kubakici@...pl>
To:     Yuval Mintz <Yuval.Mintz@...ium.com>
Cc:     <davem@...emloft.net>, <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 10/11] qede: Add basic XDP support

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@...ium.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 :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ