Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jul 2016 15:44:28 GMT
From:      vincenzo@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r305829 - soc2016/vincenzo/head/sys/dev/netmap
Message-ID:  <201607081544.u68FiSF9008332@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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