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] [day] [month] [year] [list]
Date:	Mon, 21 Dec 2015 20:33:42 +0000
From:	"Liang, Kan" <kan.liang@...el.com>
To:	Ben Hutchings <ben@...adent.org.uk>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"bwh@...nel.org" <bwh@...nel.org>
CC:	"Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
	"andi@...stfloor.org" <andi@...stfloor.org>,
	"f.fainelli@...il.com" <f.fainelli@...il.com>,
	"alexander.duyck@...il.com" <alexander.duyck@...il.com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	"Nelson, Shannon" <shannon.nelson@...el.com>,
	"Wyborny, Carolyn" <carolyn.wyborny@...el.com>,
	"Skidmore, Donald C" <donald.c.skidmore@...el.com>,
	"Williams, Mitch A" <mitch.a.williams@...el.com>,
	"ogerlitz@...lanox.com" <ogerlitz@...lanox.com>,
	"edumazet@...gle.com" <edumazet@...gle.com>,
	"jiri@...lanox.com" <jiri@...lanox.com>,
	"sfeldma@...il.com" <sfeldma@...il.com>,
	"gospo@...ulusnetworks.com" <gospo@...ulusnetworks.com>,
	"sasha.levin@...cle.com" <sasha.levin@...cle.com>,
	"dsahern@...il.com" <dsahern@...il.com>,
	"tj@...nel.org" <tj@...nel.org>,
	"cascardo@...hat.com" <cascardo@...hat.com>,
	"corbet@....net" <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?
> 
No, ethtool core doesn’t save the old value for this version. So it's hard to
Rollback.
If we want this feature, the kernel will alloc a chunk of memory to store
coalesce value for masked queues. Is it OK?

> Then, what is the benefit of doing this iteration in the kernel rather than
> userland?
> 
It should save many ioctls.

Thanks,
Kan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ