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]
Date:   Tue, 20 Jun 2017 00:55:41 +0200
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>,
        netdev@...r.kernel.org
CC:     davem@...emloft.net, kafai@...com, netoptimizer@...uer.com,
        oss-drivers@...ronome.com
Subject: Re: [RFC net-next 2/8] xdp: add HW offload mode flag for installing
 programs

On 06/17/2017 01:57 AM, Jakub Kicinski wrote:
> Add an installation-time flag for requesting that the program
> be installed only if it can be offloaded to HW.
>
> Internally new command for ndo_xdp is added, this way we avoid
> putting checks into drivers since they all return -EINVAL on
> an unknown command.
>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
[...]
> diff --git a/net/core/dev.c b/net/core/dev.c
> index a04db264aa1c..05cec8e2cd82 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6959,7 +6959,10 @@ static int dev_xdp_install(struct net_device *dev, xdp_op_t xdp_op,
>   	struct netdev_xdp xdp;
>
>   	memset(&xdp, 0, sizeof(xdp));
> -	xdp.command = XDP_SETUP_PROG;
> +	if (flags & XDP_FLAGS_HW_MODE)
> +		xdp.command = XDP_SETUP_PROG_HW;
> +	else
> +		xdp.command = XDP_SETUP_PROG;
>   	xdp.extack = extack;
>   	xdp.flags = flags;
>   	xdp.prog = prog;

One thing I'm not sure I follow is that while you pass flags to the ndo
in patch 1, add a new XDP_SETUP_PROG_HW command here in patch 2 based on
the flags, and later on in patch 6, you don't really make use of it, but
look at the flags anyway? Then, why adding separate XDP_SETUP_PROG_HW
in the first place?

[patch 6:]
@@ -3338,6 +3341,7 @@ static int nfp_net_xdp(struct net_device *netdev, struct netdev_xdp *xdp)

  	switch (xdp->command) {
  	case XDP_SETUP_PROG:
+	case XDP_SETUP_PROG_HW:
  		return nfp_net_xdp_setup(nn, xdp->prog, xdp->flags,
  					 xdp->extack);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ