From owner-svn-soc-all@freebsd.org Fri Jul 8 15:44:29 2016 Return-Path: Delivered-To: svn-soc-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 4A435B8258D for ; Fri, 8 Jul 2016 15:44:29 +0000 (UTC) (envelope-from vincenzo@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (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 3DC381220 for ; Fri, 8 Jul 2016 15:44:29 +0000 (UTC) (envelope-from vincenzo@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u68FiTNp008336 for ; Fri, 8 Jul 2016 15:44:29 GMT (envelope-from vincenzo@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u68FiSF9008332 for svn-soc-all@FreeBSD.org; Fri, 8 Jul 2016 15:44:28 GMT (envelope-from vincenzo@FreeBSD.org) Date: Fri, 8 Jul 2016 15:44:28 GMT Message-Id: <201607081544.u68FiSF9008332@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to vincenzo@FreeBSD.org using -f From: vincenzo@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r305829 - soc2016/vincenzo/head/sys/dev/netmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 15:44:29 -0000 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);