Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 2015 19:12:45 GMT
From:      stefano@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r287505 - soc2015/stefano/ptnetmap/head/sys/dev/netmap
Message-ID:  <201506231912.t5NJCjPY061077@socsvn.freebsd.org>

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



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