From owner-svn-src-all@freebsd.org Thu Jul 14 07:48:28 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 3D23FB98724; Thu, 14 Jul 2016 07:48:28 +0000 (UTC) (envelope-from sephe@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 EEEC5168B; Thu, 14 Jul 2016 07:48:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6E7mRqt090790; Thu, 14 Jul 2016 07:48:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6E7mQ4F090786; Thu, 14 Jul 2016 07:48:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201607140748.u6E7mQ4F090786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 14 Jul 2016 07:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302817 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head 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, 14 Jul 2016 07:48:28 -0000 Author: sephe Date: Thu Jul 14 07:48:26 2016 New Revision: 302817 URL: https://svnweb.freebsd.org/changeset/base/302817 Log: hyperv/vmbus: Field renaming to reflect reality MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7111 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Thu Jul 14 07:39:34 2016 (r302816) +++ head/sys/dev/hyperv/include/hyperv.h Thu Jul 14 07:48:26 2016 (r302817) @@ -326,7 +326,7 @@ typedef struct hv_vmbus_channel { void *hv_chan_priv3; struct task ch_detach_task; - TAILQ_ENTRY(hv_vmbus_channel) ch_link; + TAILQ_ENTRY(hv_vmbus_channel) ch_prilink; /* primary chan link */ uint32_t ch_subidx; /* subchan index */ volatile uint32_t ch_stflags; /* atomic-op */ /* VMBUS_CHAN_ST_ */ Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 07:39:34 2016 (r302816) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 07:48:26 2016 (r302817) @@ -134,8 +134,8 @@ vmbus_chan_add(struct hv_vmbus_channel * newchan->ch_id, newchan->ch_subidx); } - mtx_lock(&sc->vmbus_chlist_lock); - TAILQ_FOREACH(prichan, &sc->vmbus_chlist, ch_link) { + mtx_lock(&sc->vmbus_prichan_lock); + TAILQ_FOREACH(prichan, &sc->vmbus_prichans, ch_prilink) { if (memcmp(&prichan->ch_guid_type, &newchan->ch_guid_type, sizeof(struct hyperv_guid)) == 0 && memcmp(&prichan->ch_guid_inst, &newchan->ch_guid_inst, @@ -145,18 +145,19 @@ vmbus_chan_add(struct hv_vmbus_channel * if (VMBUS_CHAN_ISPRIMARY(newchan)) { if (prichan == NULL) { /* Install the new primary channel */ - TAILQ_INSERT_TAIL(&sc->vmbus_chlist, newchan, ch_link); - mtx_unlock(&sc->vmbus_chlist_lock); + TAILQ_INSERT_TAIL(&sc->vmbus_prichans, newchan, + ch_prilink); + mtx_unlock(&sc->vmbus_prichan_lock); return 0; } else { - mtx_unlock(&sc->vmbus_chlist_lock); + mtx_unlock(&sc->vmbus_prichan_lock); device_printf(sc->vmbus_dev, "duplicated primary " "chan%u\n", newchan->ch_id); return EINVAL; } } else { /* Sub-channel */ if (prichan == NULL) { - mtx_unlock(&sc->vmbus_chlist_lock); + mtx_unlock(&sc->vmbus_prichan_lock); device_printf(sc->vmbus_dev, "no primary chan for " "chan%u\n", newchan->ch_id); return EINVAL; @@ -168,7 +169,7 @@ vmbus_chan_add(struct hv_vmbus_channel * * XXX refcnt prichan */ } - mtx_unlock(&sc->vmbus_chlist_lock); + mtx_unlock(&sc->vmbus_prichan_lock); /* * This is a sub-channel; link it with the primary channel. @@ -406,20 +407,20 @@ vmbus_chan_destroy_all(struct vmbus_soft { struct hv_vmbus_channel *chan; - mtx_lock(&sc->vmbus_chlist_lock); - while ((chan = TAILQ_FIRST(&sc->vmbus_chlist)) != NULL) { + mtx_lock(&sc->vmbus_prichan_lock); + while ((chan = TAILQ_FIRST(&sc->vmbus_prichans)) != NULL) { KASSERT(VMBUS_CHAN_ISPRIMARY(chan), ("not primary channel")); - TAILQ_REMOVE(&sc->vmbus_chlist, chan, ch_link); - mtx_unlock(&sc->vmbus_chlist_lock); + TAILQ_REMOVE(&sc->vmbus_prichans, chan, ch_prilink); + mtx_unlock(&sc->vmbus_prichan_lock); hv_vmbus_child_device_unregister(chan); vmbus_chan_free(chan); - mtx_lock(&sc->vmbus_chlist_lock); + mtx_lock(&sc->vmbus_prichan_lock); } bzero(sc->vmbus_chmap, sizeof(struct hv_vmbus_channel *) * VMBUS_CHAN_MAX); - mtx_unlock(&sc->vmbus_chlist_lock); + mtx_unlock(&sc->vmbus_prichan_lock); } /** Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 14 07:39:34 2016 (r302816) +++ head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 14 07:48:26 2016 (r302817) @@ -1104,8 +1104,8 @@ vmbus_doattach(struct vmbus_softc *sc) mtx_init(&sc->vmbus_scan_lock, "vmbus scan", NULL, MTX_DEF); sc->vmbus_gpadl = VMBUS_GPADL_START; - mtx_init(&sc->vmbus_chlist_lock, "vmbus chlist", NULL, MTX_DEF); - TAILQ_INIT(&sc->vmbus_chlist); + mtx_init(&sc->vmbus_prichan_lock, "vmbus prichan", NULL, MTX_DEF); + TAILQ_INIT(&sc->vmbus_prichans); sc->vmbus_chmap = malloc( sizeof(struct hv_vmbus_channel *) * VMBUS_CHAN_MAX, M_DEVBUF, M_WAITOK | M_ZERO); @@ -1176,7 +1176,7 @@ cleanup: } free(sc->vmbus_chmap, M_DEVBUF); mtx_destroy(&sc->vmbus_scan_lock); - mtx_destroy(&sc->vmbus_chlist_lock); + mtx_destroy(&sc->vmbus_prichan_lock); return (ret); } @@ -1258,7 +1258,7 @@ vmbus_detach(device_t dev) free(sc->vmbus_chmap, M_DEVBUF); mtx_destroy(&sc->vmbus_scan_lock); - mtx_destroy(&sc->vmbus_chlist_lock); + mtx_destroy(&sc->vmbus_prichan_lock); return (0); } Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Thu Jul 14 07:39:34 2016 (r302816) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Thu Jul 14 07:48:26 2016 (r302817) @@ -102,8 +102,9 @@ struct vmbus_softc { #define VMBUS_SCAN_CHCNT_DONE 0x80000000 uint32_t vmbus_scan_devcnt; - struct mtx vmbus_chlist_lock; - TAILQ_HEAD(, hv_vmbus_channel) vmbus_chlist; + /* Primary channels */ + struct mtx vmbus_prichan_lock; + TAILQ_HEAD(, hv_vmbus_channel) vmbus_prichans; }; #define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */