From 4f95df0e925fd3a3d7489f7f49c65c4cbb122a19 Mon Sep 17 00:00:00 2001 From: np Date: Fri, 9 Dec 2016 02:21:27 +0000 Subject: [PATCH] cxgbe(4): netmap does not set IFCAP_NETMAP in an ifnet's if_capabilities any more (since r307394). Do it in the driver instead. MFC after: 1 week --- sys/dev/cxgbe/t4_main.c | 6 +++++- sys/dev/cxgbe/t4_netmap.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 40090cecc36b..76e0b545f9c8 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1416,6 +1416,10 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) #ifdef TCP_OFFLOAD if (vi->nofldrxq != 0) ifp->if_capabilities |= IFCAP_TOE; +#endif +#ifdef DEV_NETMAP + if (vi->nnmrxq != 0) + ifp->if_capabilities |= IFCAP_NETMAP; #endif ifp->if_capenable = T4_CAP_ENABLE; ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | @@ -1435,7 +1439,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ether_ifattach(ifp, vi->hw_addr); #ifdef DEV_NETMAP - if (vi->nnmrxq != 0) + if (ifp->if_capabilities & IFCAP_NETMAP) cxgbe_nm_attach(vi); #endif sb = sbuf_new_auto(); diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index a1722ee7dd70..d9a74cf75d02 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -870,7 +870,7 @@ cxgbe_nm_attach(struct vi_info *vi) na.nm_register = cxgbe_netmap_reg; na.num_tx_rings = vi->nnmtxq; na.num_rx_rings = vi->nnmrxq; - netmap_attach(&na); /* This adds IFCAP_NETMAP to if_capabilities */ + netmap_attach(&na); } void -- 2.39.5