nvmf: fix the error caculation for reactor mask

Since we used u64 to mask CPU cores, the available number of CPU
is 64, for default RTE_MAX_LCORE in DPDK, the value is 128, in some
cases(e.g.: when nr_io_queues > 4) we can get the wrong lcore ID.

Change-Id: Icc334b1bf5b068a310839118be341e61071cff65
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Changpeng Liu 2016-06-18 05:56:13 +08:00
parent 36981693aa
commit 389fcba814

View File

@ -1248,7 +1248,8 @@ nvmf_allocate_reactor(uint64_t cpumask)
min_pollers = INT_MAX;
selected_core = 0;
for (i = 0; i < RTE_MAX_LCORE; i++) {
/* we use u64 as CPU core mask */
for (i = 0; i < RTE_MAX_LCORE && i < 64; i++) {
if (!((1ULL << i) & cpumask)) {
continue;
}