[Differential] [Closed] D5318: hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed

2016-02-18 Thread Phabricator
This revision was automatically updated to reflect the committed changes.
Closed by commit rS295794: hyperv/hn: Free the txdesc buf_ring when the TX ring 
is destroyed (authored by sephe).

CHANGED PRIOR TO COMMIT
  https://reviews.freebsd.org/D5318?vs=13409=13482#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D5318?vs=13409=13482

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

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
  @@ -2276,6 +2276,11 @@
bus_dma_tag_destroy(txr->hn_tx_data_dtag);
if (txr->hn_tx_rndis_dtag != NULL)
bus_dma_tag_destroy(txr->hn_tx_rndis_dtag);
  +
  +#ifdef HN_USE_TXDESC_BUFRING
  + buf_ring_free(txr->hn_txdesc_br, M_NETVSC);
  +#endif
  +
free(txr->hn_txdesc, M_NETVSC);
txr->hn_txdesc = 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
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
@@ -2276,6 +2276,11 @@
 		bus_dma_tag_destroy(txr->hn_tx_data_dtag);
 	if (txr->hn_tx_rndis_dtag != NULL)
 		bus_dma_tag_destroy(txr->hn_tx_rndis_dtag);
+
+#ifdef HN_USE_TXDESC_BUFRING
+	buf_ring_free(txr->hn_txdesc_br, M_NETVSC);
+#endif
+
 	free(txr->hn_txdesc, M_NETVSC);
 	txr->hn_txdesc = NULL;
 

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

[Differential] [Closed] D5317: hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012)

2016-02-18 Thread Phabricator
This revision was automatically updated to reflect the committed changes.
Closed by commit rS295793: hyperv/hn: Enable IP header checksum offloading for 
WIN8 (WinServ2012) (authored by sephe).

CHANGED PRIOR TO COMMIT
  https://reviews.freebsd.org/D5317?vs=13408=13481#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D5317?vs=13408=13481

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

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
  @@ -176,7 +176,7 @@
* later.  UDP checksum offloading doesn't work on earlier
* Windows releases.
*/
  -#define HN_CSUM_ASSIST_WIN8  (CSUM_TCP)
  +#define HN_CSUM_ASSIST_WIN8  (CSUM_IP | CSUM_TCP)
   #define HN_CSUM_ASSIST   (CSUM_IP | CSUM_UDP | CSUM_TCP)
   
   #define HN_LRO_LENLIM_DEF(25 * ETHERMTU)

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
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
@@ -176,7 +176,7 @@
  * later.  UDP checksum offloading doesn't work on earlier
  * Windows releases.
  */
-#define HN_CSUM_ASSIST_WIN8	(CSUM_TCP)
+#define HN_CSUM_ASSIST_WIN8	(CSUM_IP | CSUM_TCP)
 #define HN_CSUM_ASSIST		(CSUM_IP | CSUM_UDP | CSUM_TCP)
 
 #define HN_LRO_LENLIM_DEF		(25 * ETHERMTU)

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

[Differential] [Closed] D5316: hyperv/hn: Add option to bind TX taskqueues to the specified CPU

2016-02-18 Thread Phabricator
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=13480#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D5316?vs=13407=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,
   _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,
  +_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, >hn_tx_taskq);
  - taskqueue_start_threads(>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, _set);
  + taskqueue_start_threads_cpuset(>hn_tx_taskq, 1,
  + PI_NET, _set, "%s tx",
  + device_get_nameunit(dev));
  + } else {
  + taskqueue_start_threads(>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, _tx_taskq);
  - taskqueue_start_threads(_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, _set);
  + taskqueue_start_threads_cpuset(_tx_taskq, 1, PI_NET,
  + _set, "hn tx");
  + } else {
  + taskqueue_start_threads(_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
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,
 _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,
+_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, >hn_tx_taskq);
-		taskqueue_start_threads(>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, _set);
+			taskqueue_start_threads_cpuset(>hn_tx_taskq, 1,
+			PI_NET, _set, "%s tx",
+			device_get_nameunit(dev));
+		} else {
+			taskqueue_start_threads(>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, _tx_taskq);
-	taskqueue_start_threads(_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, _set);
+		taskqueue_start_threads_cpuset(_tx_taskq, 1, PI_NET,
+		_set, "hn tx");
+	} else {
+		taskqueue_start_threads(_tx_taskq, 1, PI_NET, "hn tx");
+	}
 }
 SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_FIRST,
 

[Bug 207297] [Hyper-V]FreeBSD 10.2 on hyperv lost network under heavy load for OACTIVE

2016-02-18 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207297

Mark Linimon  changed:

   What|Removed |Added

   Assignee|freebsd-b...@freebsd.org|freebsd-virtualization@Free
   ||BSD.org
   Keywords||patch

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Differential] [Accepted] D5318: hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed

2016-02-18 Thread adrian (Adrian Chadd)
adrian accepted this revision.
This revision has a positive review.

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

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
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Differential] [Accepted] D5317: hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012)

2016-02-18 Thread adrian (Adrian Chadd)
adrian accepted this revision.
This revision has a positive review.

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

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
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Differential] [Accepted] D5316: hyperv/hn: Add option to bind TX taskqueues to the specified CPU

2016-02-18 Thread adrian (Adrian Chadd)
adrian accepted this revision.
This revision has a positive review.

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

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
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Differential] [Closed] D5283: hyperv/hn: Split TX ring data structure out of softc

2016-02-18 Thread Phabricator
This revision was automatically updated to reflect the committed changes.
Closed by commit rS295747: hyperv/hn: Split TX ring data structure out of softc 
(authored by sephe).

CHANGED PRIOR TO COMMIT
  https://reviews.freebsd.org/D5283?vs=13312=13405#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D5283?vs=13312=13405

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

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

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
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
@@ -153,7 +153,7 @@
 struct hn_txdesc {
 	SLIST_ENTRY(hn_txdesc) link;
 	struct mbuf	*m;
-	struct hn_softc	*sc;
+	struct hn_tx_ring *txr;
 	int		refs;
 	uint32_t	flags;		/* HN_TXD_FLAG_ */
 	netvsc_packet	netvsc_pkt;	/* XXX to be removed */
@@ -193,7 +193,6 @@
 #define NV_LOCK_INIT(_sc, _name) \
 	mtx_init(&(_sc)->hn_lock, _name, MTX_NETWORK_LOCK, MTX_DEF)
 #define NV_LOCK(_sc)		mtx_lock(&(_sc)->hn_lock)
-#define NV_TRYLOCK(_sc)		mtx_trylock(&(_sc)->hn_lock)
 #define NV_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->hn_lock, MA_OWNED)
 #define NV_UNLOCK(_sc)		mtx_unlock(&(_sc)->hn_lock)
 #define NV_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->hn_lock)
@@ -266,25 +265,31 @@
 static void hn_ifinit_locked(hn_softc_t *sc);
 static void hn_ifinit(void *xsc);
 static int  hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
-static int hn_start_locked(struct ifnet *ifp, int len);
+static int hn_start_locked(struct hn_tx_ring *txr, int len);
 static void hn_start(struct ifnet *ifp);
-static void hn_start_txeof(struct ifnet *ifp);
+static void hn_start_txeof(struct hn_tx_ring *);
 static int hn_ifmedia_upd(struct ifnet *ifp);
 static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr);
 static int hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS);
 static int hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS);
 static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS);
 static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS);
 static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS);
 static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS);
+static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS);
+static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS);
 static int hn_check_iplen(const struct mbuf *, int);
-static int hn_create_tx_ring(struct hn_softc *sc);
-static void hn_destroy_tx_ring(struct hn_softc *sc);
+static int hn_create_tx_ring(struct hn_softc *, int);
+static void hn_destroy_tx_ring(struct hn_tx_ring *);
+static int hn_create_tx_data(struct hn_softc *);
+static void hn_destroy_tx_data(struct hn_softc *);
 static void hn_start_taskfunc(void *xsc, int pending);
 static void hn_txeof_taskfunc(void *xsc, int pending);
-static int hn_encap(struct hn_softc *, struct hn_txdesc *, struct mbuf **);
+static void hn_stop_tx_tasks(struct hn_softc *);
+static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **);
 static void hn_create_rx_data(struct hn_softc *sc);
 static void hn_destroy_rx_data(struct hn_softc *sc);
+static void hn_set_tx_chimney_size(struct hn_softc *, int);
 
 static int
 hn_ifmedia_upd(struct ifnet *ifp __unused)
@@ -350,8 +355,6 @@
 	hn_softc_t *sc;
 	int unit = device_get_unit(dev);
 	struct ifnet *ifp = NULL;
-	struct sysctl_oid_list *child;
-	struct sysctl_ctx_list *ctx;
 	int error;
 #if __FreeBSD_version >= 1100045
 	int tso_maxlen;
@@ -365,7 +368,6 @@
 	bzero(sc, sizeof(hn_softc_t));
 	sc->hn_unit = unit;
 	sc->hn_dev = dev;
-	sc->hn_direct_tx_size = hn_direct_tx_size;
 
 	if (hn_tx_taskq == NULL) {
 		sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK,
@@ -375,20 +377,17 @@
 	} else {
 		sc->hn_tx_taskq = hn_tx_taskq;
 	}
-	TASK_INIT(>hn_start_task, 0, hn_start_taskfunc, sc);
-	TASK_INIT(>hn_txeof_task, 0, hn_txeof_taskfunc, sc);
-
-	error = hn_create_tx_ring(sc);
-	if (error)
-		goto failed;
-
 	NV_LOCK_INIT(sc, "NetVSCLock");
 
 	sc->hn_dev_obj = device_ctx;
 
 	ifp = sc->hn_ifp = if_alloc(IFT_ETHER);
 	ifp->if_softc = sc;
 
+	error = hn_create_tx_data(sc);
+	if (error)
+		goto failed;
+
 	hn_create_rx_data(sc);
 
 	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
@@ -421,12 +420,7 @@
 	ifp->if_capenable |=
 	IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO |
 	IFCAP_LRO;
-
-	if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1)
-		sc->hn_csum_assist = HN_CSUM_ASSIST;
-	else
-		sc->hn_csum_assist = HN_CSUM_ASSIST_WIN8;
-	ifp->if_hwassist = sc->hn_csum_assist | CSUM_TSO;
+	ifp->if_hwassist = sc->hn_tx_ring[0].hn_csum_assist | CSUM_TSO;
 
 	

[Differential] [Updated] D5316: hyperv/hn: Add option to bind TX taskqueues to the specified CPU

2016-02-18 Thread sepherosa_gmail.com (Sepherosa Ziehau)
sepherosa_gmail.com updated the summary for this revision.

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

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

To: sepherosa_gmail.com, network, adrian, delphij, royger, decui_microsoft.com, 
honzhan_microsoft.com, howard0su_gmail.com
Cc: freebsd-virtualization-list, freebsd-net-list
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Differential] [Commented On] D5316: hyperv/hn: Add option to bind TX taskqueues to the specified CPU

2016-02-18 Thread sepherosa_gmail.com (Sepherosa Ziehau)
sepherosa_gmail.com added a comment.


  In https://reviews.freebsd.org/D5316#113452, @howard0su_gmail.com wrote:
  
  > I worried so many options just brings headache to the end user without the 
clearly instruction on how to tune it. Please introduce new option when it is 
really needed. Maybe it is good time now to write a man page for hn.
  
  
  Well, I will complete the description: I _do_ need this to tracking the 
_host_ side transmission ring selection issue; and chances are high that I will 
set it by default in the end.  If it's not necessary, I will not even bother to 
publish it.
  
  As for the man page, yeah, we should have one; I probably will do it after 
the if_transmit work.

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

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

To: sepherosa_gmail.com, network, adrian, delphij, royger, decui_microsoft.com, 
honzhan_microsoft.com, howard0su_gmail.com
Cc: freebsd-virtualization-list, freebsd-net-list
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Differential] [Updated] D5316: hyperv/hn: Add option to bind TX taskqueues to the specified CPU

2016-02-18 Thread howard0su_gmail.com (Howard Su)
howard0su_gmail.com added a comment.


  I worried so many options just brings headache to the end user without the 
clearly instruction on how to tune it. Please introduce new option when it is 
really needed. Maybe it is good time now to write a man page for hn.

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

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

To: sepherosa_gmail.com, network, adrian, delphij, royger, decui_microsoft.com, 
honzhan_microsoft.com, howard0su_gmail.com
Cc: freebsd-virtualization-list, freebsd-net-list
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Differential] [Request, 5 lines] D5318: hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed

2016-02-18 Thread sepherosa_gmail.com (Sepherosa Ziehau)
sepherosa_gmail.com created this revision.
sepherosa_gmail.com added reviewers: network, adrian, delphij, royger, 
decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com.
sepherosa_gmail.com added subscribers: freebsd-net-list, 
freebsd-virtualization-list.

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

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

CHANGE DETAILS
  diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 
b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  @@ -2276,6 +2276,11 @@
bus_dma_tag_destroy(txr->hn_tx_data_dtag);
if (txr->hn_tx_rndis_dtag != NULL)
bus_dma_tag_destroy(txr->hn_tx_rndis_dtag);
  +
  +#ifdef HN_USE_TXDESC_BUFRING
  + buf_ring_free(txr->hn_txdesc_br, M_NETVSC);
  +#endif
  +
free(txr->hn_txdesc, M_NETVSC);
txr->hn_txdesc = NULL;

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

To: sepherosa_gmail.com, network, adrian, delphij, royger, decui_microsoft.com, 
honzhan_microsoft.com, howard0su_gmail.com
Cc: freebsd-virtualization-list, freebsd-net-list
diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
--- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
+++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -2276,6 +2276,11 @@
 		bus_dma_tag_destroy(txr->hn_tx_data_dtag);
 	if (txr->hn_tx_rndis_dtag != NULL)
 		bus_dma_tag_destroy(txr->hn_tx_rndis_dtag);
+
+#ifdef HN_USE_TXDESC_BUFRING
+	buf_ring_free(txr->hn_txdesc_br, M_NETVSC);
+#endif
+
 	free(txr->hn_txdesc, M_NETVSC);
 	txr->hn_txdesc = NULL;
 

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

[Differential] [Request, 2 lines] D5317: hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012)

2016-02-18 Thread sepherosa_gmail.com (Sepherosa Ziehau)
sepherosa_gmail.com created this revision.
sepherosa_gmail.com added reviewers: network, adrian, delphij, royger, 
decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com.
sepherosa_gmail.com added subscribers: freebsd-net-list, 
freebsd-virtualization-list.

REVISION SUMMARY
  Tested on Windows Server 2012.

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

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

CHANGE DETAILS
  diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 
b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  @@ -176,7 +176,7 @@
* later.  UDP checksum offloading doesn't work on earlier
* Windows releases.
*/
  -#define HN_CSUM_ASSIST_WIN8  (CSUM_TCP)
  +#define HN_CSUM_ASSIST_WIN8  (CSUM_IP | CSUM_TCP)
   #define HN_CSUM_ASSIST   (CSUM_IP | CSUM_UDP | CSUM_TCP)
   
   #define HN_LRO_LENLIM_DEF(25 * ETHERMTU)

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

To: sepherosa_gmail.com, network, adrian, delphij, royger, decui_microsoft.com, 
honzhan_microsoft.com, howard0su_gmail.com
Cc: freebsd-virtualization-list, freebsd-net-list
diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
--- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
+++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -176,7 +176,7 @@
  * later.  UDP checksum offloading doesn't work on earlier
  * Windows releases.
  */
-#define HN_CSUM_ASSIST_WIN8	(CSUM_TCP)
+#define HN_CSUM_ASSIST_WIN8	(CSUM_IP | CSUM_TCP)
 #define HN_CSUM_ASSIST		(CSUM_IP | CSUM_UDP | CSUM_TCP)
 
 #define HN_LRO_LENLIM_DEF		(25 * ETHERMTU)

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

[Differential] [Request, 33 lines] D5316: hyperv/hn: Add option to bind TX taskqueues to the specified CPU

2016-02-18 Thread sepherosa_gmail.com (Sepherosa Ziehau)
sepherosa_gmail.com created this revision.
sepherosa_gmail.com added reviewers: network, adrian, delphij, royger, 
decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com.
sepherosa_gmail.com added subscribers: freebsd-net-list, 
freebsd-virtualization-list.

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

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

CHANGE DETAILS
  diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 
b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  @@ -269,6 +269,10 @@
   SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD,
   _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,
  +_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, >hn_tx_taskq);
  - taskqueue_start_threads(>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, _set);
  + taskqueue_start_threads_cpuset(>hn_tx_taskq, 1,
  + PI_NET, _set, "%s tx",
  + device_get_nameunit(dev));
  + } else {
  + taskqueue_start_threads(>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, _tx_taskq);
  - taskqueue_start_threads(_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, _set);
  + taskqueue_start_threads_cpuset(_tx_taskq, 1, PI_NET,
  + _set, "hn tx");
  + } else {
  + taskqueue_start_threads(_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, network, adrian, delphij, royger, decui_microsoft.com, 
honzhan_microsoft.com, howard0su_gmail.com
Cc: freebsd-virtualization-list, freebsd-net-list
diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
--- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
+++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -269,6 +269,10 @@
 SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD,
 _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,
+_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, >hn_tx_taskq);
-		taskqueue_start_threads(>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, _set);
+			taskqueue_start_threads_cpuset(>hn_tx_taskq, 1,
+			PI_NET, _set, "%s tx",
+			device_get_nameunit(dev));
+		} else {
+			taskqueue_start_threads(>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, _tx_taskq);
-	taskqueue_start_threads(_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, _set);
+		taskqueue_start_threads_cpuset(_tx_taskq, 1, PI_NET,
+		_set, "hn tx");
+	} else {
+		taskqueue_start_threads(_tx_taskq, 1, PI_NET, "hn tx");
+	}
 }
 SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_FIRST,
 hn_tx_taskq_create, NULL);

___
freebsd-virtualization@freebsd.org mailing list