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:	Fri, 12 Sep 2014 11:58:47 +0100
From:	David Vrabel <david.vrabel@...rix.com>
To:	Arianna Avanzini <avanzini.arianna@...il.com>,
	<konrad.wilk@...cle.com>, <boris.ostrovsky@...cle.com>,
	<xen-devel@...ts.xenproject.org>, <linux-kernel@...r.kernel.org>
CC:	<hch@...radead.org>, <bob.liu@...cle.com>,
	<felipe.franciosi@...rix.com>, <axboe@...com>
Subject: Re: [PATCH RFC v2 5/5] xen, blkback: negotiate of the number of block
 rings with the frontend

On 12/09/14 00:57, Arianna Avanzini wrote:
> This commit lets the backend driver advertise the number of available
> hardware queues; it also implements gathering from the frontend driver
> the number of rings actually available for mapping.
[...]
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -477,6 +477,34 @@ static void xen_vbd_free(struct xen_vbd *vbd)
>  	vbd->bdev = NULL;
>  }
>  
> +static int xen_advertise_hw_queues(struct xen_blkif *blkif,
> +				   struct request_queue *q)
> +{
> +	struct xen_vbd *vbd = &blkif->vbd;
> +	struct xenbus_transaction xbt;
> +	int err;
> +
> +	if (q && q->mq_ops)
> +		vbd->nr_supported_hw_queues = q->nr_hw_queues;
> +
> +	err = xenbus_transaction_start(&xbt);
> +	if (err) {
> +		BUG_ON(!blkif->be);

This BUG_ON() isn't useful.

> +		xenbus_dev_fatal(blkif->be->dev, err, "starting transaction (hw queues)");
> +		return err;
> +	}
> +
> +	err = xenbus_printf(xbt, blkif->be->dev->nodename, "nr_supported_hw_queues", "%u",
> +			    blkif->vbd.nr_supported_hw_queues);
> +	if (err)
> +		xenbus_dev_error(blkif->be->dev, err, "writing %s/nr_supported_hw_queues",
> +				 blkif->be->dev->nodename);
> +
> +	xenbus_transaction_end(xbt, 0);

Transactions are expensive and not needed to write a single key.

Can you use the same key names as netback (multi-queue-max-queues I
think)? I don't see why we can't use a common set of key names for this.

See interface/io/netif.h for full set of keys VIFs use.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ