--- sys/dev/virtio/network/if_vtnetvar.h 2020-01-15 12:09:26.647383000 -0800 +++ sys/dev/virtio/network/if_vtnetvar.h 2020-01-15 12:10:29.726123000 -0800 @@ -82,9 +82,6 @@ struct taskqueue *vtnrx_tq; struct task vtnrx_intrtask; struct lro_ctrl vtnrx_lro; -#ifdef DEV_NETMAP - struct virtio_net_hdr_mrg_rxbuf vtnrx_shrhdr; -#endif /* DEV_NETMAP */ char vtnrx_name[16]; } __aligned(CACHE_LINE_SIZE); @@ -121,9 +118,6 @@ #ifndef VTNET_LEGACY_TX struct task vtntx_defrtask; #endif -#ifdef DEV_NETMAP - struct virtio_net_hdr_mrg_rxbuf vtntx_shrhdr; -#endif /* DEV_NETMAP */ char vtntx_name[16]; } __aligned(CACHE_LINE_SIZE); --- sys/dev/virtio/network/if_vtnet.c 2020-01-15 12:23:02.572500000 -0800 +++ sys/dev/virtio/network/if_vtnet.c 2020-01-15 12:24:11.731459000 -0800 @@ -347,10 +347,6 @@ DEVMETHOD_END }; -#ifdef DEV_NETMAP -#include -#endif - static driver_t vtnet_driver = { .name = "vtnet", .methods = vtnet_methods, @@ -364,9 +360,6 @@ DRIVER_MODULE(vtnet, vtpcim, vtnet_driver, vtnet_devclass, vtnet_modevent, 0); MODULE_VERSION(vtnet, 1); MODULE_DEPEND(vtnet, virtio, 1, 1, 1); -#ifdef DEV_NETMAP -MODULE_DEPEND(vtnet, netmap, 1, 1, 1); -#endif static int vtnet_modevent(module_t mod, int type, void *unused) @@ -472,9 +465,6 @@ goto fail; } -#ifdef DEV_NETMAP - vtnet_netmap_attach(sc); -#endif vtnet_start_taskqueues(sc); fail: @@ -504,10 +494,6 @@ ether_ifdetach(ifp); } -#ifdef DEV_NETMAP - netmap_detach(ifp); -#endif - vtnet_free_taskqueues(sc); if (sc->vtnet_vlan_attach != NULL) { @@ -2028,11 +2014,6 @@ VTNET_RXQ_LOCK_ASSERT(rxq); -#ifdef DEV_NETMAP - if (netmap_rx_irq(ifp, 0, &deq)) - return (0); -#endif - while (count-- > 0) { struct mbuf *m; int len, nbufs, adjsz; @@ -2763,13 +2744,6 @@ deq = 0; VTNET_TXQ_LOCK_ASSERT(txq); -#ifdef DEV_NETMAP - if (netmap_tx_irq(txq->vtntx_sc->vtnet_ifp, txq->vtntx_id)) { - virtqueue_disable_intr(vq); // XXX luigi - return (0); // XXX or 1 ? - } -#endif - while ((txhdr = virtqueue_dequeue(vq, NULL)) != NULL) { m = txhdr->vth_mbuf; deq++; @@ -3067,11 +3041,6 @@ struct vtnet_txq *txq; int i; -#ifdef DEV_NETMAP - if (nm_native_on(NA(sc->vtnet_ifp))) - return; -#endif - for (i = 0; i < sc->vtnet_max_vq_pairs; i++) { rxq = &sc->vtnet_rxqs[i]; vtnet_rxq_free_mbufs(rxq); @@ -3215,11 +3184,6 @@ } else sc->vtnet_rx_nmbufs = 1; -#ifdef DEV_NETMAP - if (vtnet_netmap_init_rx_buffers(sc)) - return (0); -#endif - for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { rxq = &sc->vtnet_rxqs[i]; @@ -3405,13 +3369,6 @@ struct vtnet_softc *sc; sc = xsc; - -#ifdef DEV_NETMAP - if (!NA(sc->vtnet_ifp)) { - D("try to attach again"); - vtnet_netmap_attach(sc); - } -#endif VTNET_CORE_LOCK(sc); vtnet_init_locked(sc); --- sys/dev/netmap/if_ptnet.c 2020-01-15 12:12:15.737556000 -0800 +++ sys/dev/netmap/if_ptnet.c 2020-01-15 12:28:16.007420000 -0800 @@ -87,6 +87,7 @@ #include #include +#ifdef WITH_PTNETMAP #ifndef INET #error "INET not defined, cannot support offloadings" #endif @@ -2291,3 +2292,4 @@ return count; } #endif /* DEVICE_POLLING */ +#endif /* WITH_PTNETMAP */ --- sys/dev/netmap/netmap_kern.h 2020-01-15 12:11:59.594489000 -0800 +++ sys/dev/netmap/netmap_kern.h 2020-01-15 12:17:31.618056000 -0800 @@ -76,7 +76,6 @@ #define WITH_PIPES #define WITH_MONITOR #define WITH_GENERIC -#define WITH_PTNETMAP /* ptnetmap guest support */ #define WITH_EXTMEM #define WITH_NMNULL #endif --- sys/net/netmap_virt.h 2020-01-15 12:11:38.276552000 -0800 +++ sys/net/netmap_virt.h 2020-01-15 12:18:16.788087000 -0800 @@ -44,8 +44,8 @@ /* PCI identifiers and PCI BARs for ptnetmap-memdev and ptnet. */ #define PTNETMAP_MEMDEV_NAME "ptnetmap-memdev" #define PTNETMAP_PCI_VENDOR_ID 0x1b36 /* QEMU virtual devices */ -#define PTNETMAP_PCI_DEVICE_ID 0x000c /* memory device */ -#define PTNETMAP_PCI_NETIF_ID 0x000d /* ptnet network interface */ +#define PTNETMAP_PCI_DEVICE_ID 0xcccc /* memory device */ +#define PTNETMAP_PCI_NETIF_ID 0xcccd /* ptnet network interface */ #define PTNETMAP_IO_PCI_BAR 0 #define PTNETMAP_MEM_PCI_BAR 1 #define PTNETMAP_MSIX_PCI_BAR 2