socsvn commit: r287505 - soc2015/stefano/ptnetmap/head/sys/dev/netmap
stefano at FreeBSD.org
stefano at FreeBSD.org
Tue Jun 23 19:12:46 UTC 2015
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);
}
More information about the svn-soc-all
mailing list