aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ntb/ntb_transport.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2016-07-09 11:36:09 +0000
committerAlexander Motin <mav@FreeBSD.org>2016-07-09 11:36:09 +0000
commitf7be35856a3353461246bb41810b45c095bcafb1 (patch)
tree6bf14a9bedadf923e1f4447869b5cff7c8286906 /sys/dev/ntb/ntb_transport.c
parentb86969a5a667d63b1e85fc0c619a0a613cf48f9e (diff)
downloadsrc-f7be35856a3353461246bb41810b45c095bcafb1.tar.gz
src-f7be35856a3353461246bb41810b45c095bcafb1.zip
Fix operation with multiple qps.
Notes
Notes: svn path=/head/; revision=302486
Diffstat (limited to 'sys/dev/ntb/ntb_transport.c')
-rw-r--r--sys/dev/ntb/ntb_transport.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ntb/ntb_transport.c b/sys/dev/ntb/ntb_transport.c
index 276b50d36605..e2c67772146b 100644
--- a/sys/dev/ntb/ntb_transport.c
+++ b/sys/dev/ntb/ntb_transport.c
@@ -470,7 +470,7 @@ ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num)
qp->event_handler = NULL;
ntb_qp_link_down_reset(qp);
- if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count)
+ if (mw_num < nt->qp_count % mw_count)
num_qps_mw = nt->qp_count / mw_count + 1;
else
num_qps_mw = nt->qp_count / mw_count;
@@ -567,7 +567,7 @@ ntb_transport_create_queue(void *data, device_t dev,
unsigned int free_queue;
int i;
- free_queue = ffs_bit(&nt->qp_bitmap);
+ free_queue = ffs_bit(&nt->qp_bitmap_free);
if (free_queue == 0)
return (NULL);
@@ -612,7 +612,7 @@ ntb_transport_link_up(struct ntb_transport_qp *qp)
qp->client_ready = true;
- ntb_printf(2, "qp client ready\n");
+ ntb_printf(2, "qp %d client ready\n", qp->qp_num);
if (nt->link_is_up)
callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp);
@@ -1161,7 +1161,7 @@ ntb_transport_setup_qp_mw(struct ntb_transport_ctx *nt, unsigned int qp_num)
if (mw->virt_addr == NULL)
return (ENOMEM);
- if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count)
+ if (mw_num < nt->qp_count % mw_count)
num_qps_mw = nt->qp_count / mw_count + 1;
else
num_qps_mw = nt->qp_count / mw_count;
@@ -1211,7 +1211,7 @@ ntb_qp_link_work(void *arg)
/* See if the remote side is up */
if ((val & (1ull << qp->qp_num)) != 0) {
- ntb_printf(2, "qp link up\n");
+ ntb_printf(2, "qp %d link up\n", qp->qp_num);
qp->link_is_up = true;
if (qp->event_handler != NULL)