Thread (15 messages) 15 messages, 9 authors, 2012-03-14

Re: [PATCH 0001/001] xen: multi page ring support for block devices

flat view

From: Rusty Russell <hidden>
Date: 2012-03-06 03:27:44
Also in: linux-pci, lkml

On Mon, 5 Mar 2012 13:49:07 -0800, Santosh Jodh [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+/* Order of maximum shared ring size advertised to the front end. */
+int xen_blkif_max_ring_order = XENBUS_MAX_RING_ORDER;
+
+#define BLK_RING_SIZE(_order) __CONST_RING_SIZE(blkif, PAGE_SIZE << (_order))
+
+static int set_max_ring_order(const char *buf, struct kernel_param *kp)
+{
+       int err;
+       unsigned long order;
+
+       err = kstrtol(buf, 0, &order);
+       if (err ||
+           order < 0 ||
+           order > XENBUS_MAX_RING_ORDER)
+               return -EINVAL;
Hmm, order can't be < 0, since it's unsigned.  So did you mean
kstrtoull?

And I think returning err is cleaner (it's -EINVAL for malformed
strings, -ERANGE for ones too big).
quoted hunk ↗ jump to hunk
+       if (xen_blkif_reqs < BLK_RING_SIZE(order))
+               printk(KERN_WARNING "WARNING: "
+                      "I/O request space (%d reqs) < ring order %ld, "
+                      "consider increasing %s.reqs to >= %ld.",
+                      xen_blkif_reqs, order, KBUILD_MODNAME,
+                      roundup_pow_of_two(BLK_RING_SIZE(order)));
This message doesn't mention the module namr or parameter name
anywhere.  Think of the poor sysadmins!

Thanks,
Rusty.
-- 
  How could I marry someone with more hair than me?  http://baldalex.org
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help