Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Feb 2016 05:03:46 +0000
From:      Phabricator <phabric-noreply@FreeBSD.org>
To:        freebsd-net@freebsd.org
Subject:   [Differential] [Closed] D5316: hyperv/hn: Add option to bind TX taskqueues to the specified CPU
Message-ID:  <b2abbb7738470d41a9901bac2d9795fc@localhost.localdomain>
In-Reply-To: <differential-rev-PHID-DREV-y635bkwldqas7qzbgsje-req@FreeBSD.org>
References:  <differential-rev-PHID-DREV-y635bkwldqas7qzbgsje-req@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--b1_b2abbb7738470d41a9901bac2d9795fc
Content-Type: text/plain; charset = "utf-8"
Content-Transfer-Encoding: 8bit

This revision was automatically updated to reflect the committed changes.
Closed by commit rS295792: hyperv/hn: Add option to bind TX taskqueues to the specified CPU (authored by sephe).

CHANGED PRIOR TO COMMIT
  https://reviews.freebsd.org/D5316?vs=13407&id=13480#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D5316?vs=13407&id=13480

REVISION DETAIL
  https://reviews.freebsd.org/D5316

AFFECTED FILES
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

CHANGE DETAILS
  diff --git a/head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  --- a/head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  +++ b/head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  @@ -269,6 +269,10 @@
   SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD,
       &hn_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors");
   
  +static int hn_bind_tx_taskq = -1;
  +SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN,
  +    &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu");
  +
   /*
    * Forward declarations
    */
  @@ -383,8 +387,20 @@
   	if (hn_tx_taskq == NULL) {
   		sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK,
   		    taskqueue_thread_enqueue, &sc->hn_tx_taskq);
  -		taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx",
  -		    device_get_nameunit(dev));
  +		if (hn_bind_tx_taskq >= 0) {
  +			int cpu = hn_bind_tx_taskq;
  +			cpuset_t cpu_set;
  +
  +			if (cpu > mp_ncpus - 1)
  +				cpu = mp_ncpus - 1;
  +			CPU_SETOF(cpu, &cpu_set);
  +			taskqueue_start_threads_cpuset(&sc->hn_tx_taskq, 1,
  +			    PI_NET, &cpu_set, "%s tx",
  +			    device_get_nameunit(dev));
  +		} else {
  +			taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET,
  +			    "%s tx", device_get_nameunit(dev));
  +		}
   	} else {
   		sc->hn_tx_taskq = hn_tx_taskq;
   	}
  @@ -2409,7 +2425,18 @@
   
   	hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK,
   	    taskqueue_thread_enqueue, &hn_tx_taskq);
  -	taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx");
  +	if (hn_bind_tx_taskq >= 0) {
  +		int cpu = hn_bind_tx_taskq;
  +		cpuset_t cpu_set;
  +
  +		if (cpu > mp_ncpus - 1)
  +			cpu = mp_ncpus - 1;
  +		CPU_SETOF(cpu, &cpu_set);
  +		taskqueue_start_threads_cpuset(&hn_tx_taskq, 1, PI_NET,
  +		    &cpu_set, "hn tx");
  +	} else {
  +		taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx");
  +	}
   }
   SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_FIRST,
       hn_tx_taskq_create, NULL);

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: sepherosa_gmail.com, delphij, royger, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, adrian, network
Cc: freebsd-virtualization-list, freebsd-net-list

--b1_b2abbb7738470d41a9901bac2d9795fc
Content-Type: text/x-patch; charset=utf-8; name="D5316.13480.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="D5316.13480.patch"

ZGlmZiAtLWdpdCBhL2hlYWQvc3lzL2Rldi9oeXBlcnYvbmV0dnNjL2h2X25ldHZzY19kcnZfZnJl
ZWJzZC5jIGIvaGVhZC9zeXMvZGV2L2h5cGVydi9uZXR2c2MvaHZfbmV0dnNjX2Rydl9mcmVlYnNk
LmMKLS0tIGEvaGVhZC9zeXMvZGV2L2h5cGVydi9uZXR2c2MvaHZfbmV0dnNjX2Rydl9mcmVlYnNk
LmMKKysrIGIvaGVhZC9zeXMvZGV2L2h5cGVydi9uZXR2c2MvaHZfbmV0dnNjX2Rydl9mcmVlYnNk
LmMKQEAgLTI2OSw2ICsyNjksMTAgQEAKIFNZU0NUTF9JTlQoX2h3X2huLCBPSURfQVVUTywgdXNl
X3R4ZGVzY19idWZyaW5nLCBDVExGTEFHX1JELAogICAgICZobl91c2VfdHhkZXNjX2J1ZnJpbmcs
IDAsICJVc2UgYnVmX3JpbmcgZm9yIFRYIGRlc2NyaXB0b3JzIik7CiAKK3N0YXRpYyBpbnQgaG5f
YmluZF90eF90YXNrcSA9IC0xOworU1lTQ1RMX0lOVChfaHdfaG4sIE9JRF9BVVRPLCBiaW5kX3R4
X3Rhc2txLCBDVExGTEFHX1JEVFVOLAorICAgICZobl9iaW5kX3R4X3Rhc2txLCAwLCAiQmluZCBU
WCB0YXNrcXVldWUgdG8gdGhlIHNwZWNpZmllZCBjcHUiKTsKKwogLyoKICAqIEZvcndhcmQgZGVj
bGFyYXRpb25zCiAgKi8KQEAgLTM4Myw4ICszODcsMjAgQEAKIAlpZiAoaG5fdHhfdGFza3EgPT0g
TlVMTCkgewogCQlzYy0+aG5fdHhfdGFza3EgPSB0YXNrcXVldWVfY3JlYXRlKCJobl90eCIsIE1f
V0FJVE9L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4Iik7CisJaWYgKGhuX2JpbmRfdHhfdGFza3EgPj0gMCkgeworCQlpbnQgY3B1ID0gaG5f
YmluZF90eF90YXNrcTsKKwkJY3B1c2V0X3QgY3B1X3NldDsKKworCQlpZiAoY3B1ID4gbXBfbmNw
dXMgLSAxKQorCQkJY3B1ID0gbXBfbmNwdXMgLSAxOworCQlDUFVfU0VUT0YoY3B1LCAmY3B1X3Nl
dCk7CisJCXRhc2txdWV1ZV9zdGFydF90aHJlYWRzX2NwdXNldCgmaG5fdHhfdGFza3EsIDEsIFBJ
X05FVCwKKwkJICAgICZjcHVfc2V0LCAiaG4gdHgiKTsKKwl9IGVsc2UgeworCQl0YXNrcXVldWVf
c3RhcnRfdGhyZWFkcygmaG5fdHhfdGFza3EsIDEsIFBJX05FVCwgImhuIHR4Iik7CisJfQogfQog
U1lTSU5JVChobl90eHRxX2NyZWF0ZSwgU0lfU1VCX0RSSVZFUlMsIFNJX09SREVSX0ZJUlNULAog
ICAgIGhuX3R4X3Rhc2txX2NyZWF0ZSwgTlVMTCk7Cgo=


--b1_b2abbb7738470d41a9901bac2d9795fc--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b2abbb7738470d41a9901bac2d9795fc>