From owner-svn-soc-all@FreeBSD.ORG Tue Jun 23 19:12:45 2015 Return-Path: Delivered-To: svn-soc-all@nevdull.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDAF7DD2 for ; Tue, 23 Jun 2015 19:12:45 +0000 (UTC) (envelope-from stefano@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 CC20CFAA for ; Tue, 23 Jun 2015 19:12:45 +0000 (UTC) (envelope-from stefano@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5NJCjhE061083 for ; Tue, 23 Jun 2015 19:12:45 GMT (envelope-from stefano@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5NJCjPY061077 for svn-soc-all@FreeBSD.org; Tue, 23 Jun 2015 19:12:45 GMT (envelope-from stefano@FreeBSD.org) Date: Tue, 23 Jun 2015 19:12:45 GMT Message-Id: <201506231912.t5NJCjPY061077@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to stefano@FreeBSD.org using -f From: stefano@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287505 - soc2015/stefano/ptnetmap/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.20 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: Tue, 23 Jun 2015 19:12:46 -0000 Author: stefano Date: Tue Jun 23 19:12:44 2015 New Revision: 287505 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287505 Log: [ptnetmap/virtio] call vtnet_init() only on UNREGIF If we call vtnet_init() during the regif, it removes the fake packets. Modified: soc2015/stefano/ptnetmap/head/sys/dev/netmap/if_vtnet_netmap.h Modified: soc2015/stefano/ptnetmap/head/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- soc2015/stefano/ptnetmap/head/sys/dev/netmap/if_vtnet_netmap.h Tue Jun 23 19:11:09 2015 (r287504) +++ soc2015/stefano/ptnetmap/head/sys/dev/netmap/if_vtnet_netmap.h Tue Jun 23 19:12:44 2015 (r287505) @@ -665,7 +665,6 @@ return EINVAL; VTNET_CORE_LOCK(sc); - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); /* enable or disable flags and callbacks in na and ifp */ if (onoff) { int i; @@ -678,7 +677,7 @@ m0->m_len = 64; if (m0) { - vtnet_txq_encap(txq, &m0); + ret = vtnet_txq_encap(txq, &m0); } } ret = vtnet_ptnetmap_ptctl(na->ifp, NET_PARAVIRT_PTCTL_REGIF); @@ -708,12 +707,13 @@ kring->nr_hwcur = csb->tx_ring.hwcur; kring->nr_hwtail = kring->rtail = kring->ring->tail = csb->tx_ring.hwtail; } else { + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); //na->na_flags &= ~NAF_NETMAP_ON; nm_clear_native_flags(na); ret = vtnet_ptnetmap_ptctl(na->ifp, NET_PARAVIRT_PTCTL_UNREGIF); + vtnet_init_locked(sc); /* also enable intr */ } out: - vtnet_init_locked(sc); /* also enable intr */ VTNET_CORE_UNLOCK(sc); return (ifp->if_drv_flags & IFF_DRV_RUNNING ? ret : 1); }