From owner-svn-src-all@freebsd.org Thu Aug 18 09:19:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED621BBC451; Thu, 18 Aug 2016 09:19:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3B991AAD; Thu, 18 Aug 2016 09:19:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9J1aY089849; Thu, 18 Aug 2016 09:19:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9J1uF089848; Thu, 18 Aug 2016 09:19:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180919.u7I9J1uF089848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304347 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2016 09:19:03 -0000 Author: mav Date: Thu Aug 18 09:19:01 2016 New Revision: 304347 URL: https://svnweb.freebsd.org/changeset/base/304347 Log: MFC r302486: Fix operation with multiple qps. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:18:23 2016 (r304346) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:19:01 2016 (r304347) @@ -470,7 +470,7 @@ ntb_transport_init_queue(struct ntb_tran 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, d 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_transpo 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_tra 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)