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: <1450496335.30687.15.camel@decadent.org.uk>
Date:	Sat, 19 Dec 2015 03:38:55 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	kan.liang@...el.com, netdev@...r.kernel.org, davem@...emloft.net,
	bwh@...nel.org
Cc:	jesse.brandeburg@...el.com, andi@...stfloor.org,
	f.fainelli@...il.com, alexander.duyck@...il.com,
	jeffrey.t.kirsher@...el.com, shannon.nelson@...el.com,
	carolyn.wyborny@...el.com, donald.c.skidmore@...el.com,
	mitch.a.williams@...el.com, ogerlitz@...lanox.com,
	edumazet@...gle.com, jiri@...lanox.com, sfeldma@...il.com,
	gospo@...ulusnetworks.com, sasha.levin@...cle.com,
	dsahern@...il.com, tj@...nel.org, cascardo@...hat.com,
	corbet@....net
Subject: Re: [RFC 3/5] net/ethtool: support set coalesce per queue

On Thu, 2015-12-17 at 06:51 +0000, kan.liang@...el.com wrote:
[...]
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -1778,6 +1778,37 @@ static int ethtool_get_per_queue_coalesce(struct net_device *dev,
>  	return 0;
>  }
>  
> +static int ethtool_set_per_queue_coalesce(struct net_device *dev,
> +					  void __user *useraddr,
> +					  struct ethtool_per_queue_op *per_queue_opt)
> +{
> +	u64 queue_mask;
> +	int bit, i, ret;
> +
> +	if (!dev->ethtool_ops->set_per_queue_coalesce)
> +		return -EOPNOTSUPP;
> +
> +	useraddr += sizeof(*per_queue_opt);
> +	for (i = 0; i < MAX_QUEUE_MASK; i++) {
> +		queue_mask = per_queue_opt->queue_mask[i];
> +		if (queue_mask > 0) {
> +			for_each_set_bit(bit, (unsigned long *)&queue_mask, 64) {
> +				struct ethtool_coalesce coalesce;
> +
> +				if (copy_from_user(&coalesce, useraddr, sizeof(coalesce)))
> +					return -EFAULT;
> +
> +				ret = dev->ethtool_ops->set_per_queue_coalesce(dev, bit + i * 64, &coalesce);
> +				if (ret != 0)
> +					return ret;
[...]

So there's no attempt to roll back on failure?

Then, what is the benefit of doing this iteration in the kernel rather
than userland?

Ben.

-- 
Ben Hutchings
Always try to do things in chronological order;
it's less confusing that way.
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ