socsvn commit: r305829 - soc2016/vincenzo/head/sys/dev/netmap

vincenzo at FreeBSD.org vincenzo at FreeBSD.org
Fri Jul 8 15:44:29 UTC 2016


Author: vincenzo
Date: Fri Jul  8 15:44:28 2016
New Revision: 305829
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305829

Log:
   freebsd: ptnet_drain_transmit_queue: cache VNET_HDR flag

Modified:
  soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c

Modified: soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c
==============================================================================
--- soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Fri Jul  8 15:44:18 2016	(r305828)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Fri Jul  8 15:44:28 2016	(r305829)
@@ -1336,6 +1336,7 @@
 ptnet_drain_transmit_queue(struct ptnet_queue *pq)
 {
 	struct ptnet_softc *sc = pq->sc;
+	bool use_vnet_hdr = (sc->ptfeatures & NET_PTN_FEATURES_VNET_HDR);
 	struct netmap_adapter *na = &sc->ptna_dr.hwup.up;
 	struct ifnet *ifp = sc->ifp;
 	unsigned int batch_count = 0;
@@ -1414,7 +1415,7 @@
 
 		/* If needed, prepare the virtio-net header at the beginning
 		 * of the first slot. */
-		if (sc->ptfeatures & NET_PTN_FEATURES_VNET_HDR) {
+		if (use_vnet_hdr) {
 			/* For performance, we could replace this memset() with
 			 * two 8-bytes-wide writes. */
 			memset(nmbuf, 0, PTNET_HDR_SIZE);


More information about the svn-soc-all mailing list