aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ntb
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2015-10-14 23:47:35 +0000
committerConrad Meyer <cem@FreeBSD.org>2015-10-14 23:47:35 +0000
commitfe9621016e1540855e77cc21090000959049db18 (patch)
treef067bd73df4cff8dfb7c3b4ed6a2d7f847694f7d /sys/dev/ntb
parent937a702523d8b0f73dfa234d7307a4dfebe12fca (diff)
downloadsrc-fe9621016e1540855e77cc21090000959049db18.tar.gz
src-fe9621016e1540855e77cc21090000959049db18.zip
NTB: MFV a1413cfb: correct the spread of queues over mw's
The detection of an uneven number of queues on the given memory windows was not correct. The mw_num is zero based and the mod should be division to spread them evenly over the mw's. Authored by: Jon Mason Obtained from: Linux (Dual BSD/GPL driver) Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=289345
Diffstat (limited to 'sys/dev/ntb')
-rw-r--r--sys/dev/ntb/if_ntb/if_ntb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ntb/if_ntb/if_ntb.c b/sys/dev/ntb/if_ntb/if_ntb.c
index 751d24d28f06..13c77fab70d2 100644
--- a/sys/dev/ntb/if_ntb/if_ntb.c
+++ b/sys/dev/ntb/if_ntb/if_ntb.c
@@ -566,7 +566,7 @@ ntb_transport_init_queue(struct ntb_netdev *nt, unsigned int qp_num)
qp->client_ready = NTB_LINK_DOWN;
qp->event_handler = NULL;
- if (nt->max_qps % NTB_NUM_MW && mw_num < nt->max_qps % NTB_NUM_MW)
+ if (nt->max_qps % NTB_NUM_MW && mw_num + 1 < nt->max_qps / NTB_NUM_MW)
num_qps_mw = nt->max_qps / NTB_NUM_MW + 1;
else
num_qps_mw = nt->max_qps / NTB_NUM_MW;
@@ -1197,7 +1197,7 @@ ntb_transport_setup_qp_mw(struct ntb_netdev *nt, unsigned int qp_num)
uint8_t mw_num = QP_TO_MW(qp_num);
unsigned int i;
- if (nt->max_qps % NTB_NUM_MW && mw_num < nt->max_qps % NTB_NUM_MW)
+ if (nt->max_qps % NTB_NUM_MW && mw_num + 1 < nt->max_qps / NTB_NUM_MW)
num_qps_mw = nt->max_qps / NTB_NUM_MW + 1;
else
num_qps_mw = nt->max_qps / NTB_NUM_MW;