Re: [PATCH v4, under testing] nvme-rdma: support devices with queue size < 32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello Marta, Sagi and Leon,

How about changing nvme_rdma_init_sig_count() such that it always returns
a power of two? The "+ 1" in the code below makes sure that the argument of
ilog2() is larger than zero even if queue_size == 1. I'm not sure whether
the time needed to compute ilog2() would make it necessary to cache the
nvme_rdma_init_sig_count() return value.

ilog2 is pretty fast.

static inline int nvme_rdma_init_sig_count(int queue_size)
{
        /* Return the largest power of two that is not above half of (queue size + 1) */
        return 1 << ilog2((queue_size + 1) / 2);
}

That'd work too I think...
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux