| 1262 | } |
| 1263 | |
| 1264 | static int |
| 1265 | iflib_netmap_attach(if_ctx_t ctx) |
| 1266 | { |
| 1267 | struct netmap_adapter na; |
| 1268 | |
| 1269 | bzero(&na, sizeof(na)); |
| 1270 | |
| 1271 | na.ifp = ctx->ifc_ifp; |
| 1272 | na.na_flags = NAF_BDG_MAYSLEEP | NAF_MOREFRAG; |
| 1273 | MPASS(ctx->ifc_softc_ctx.isc_ntxqsets); |
| 1274 | MPASS(ctx->ifc_softc_ctx.isc_nrxqsets); |
| 1275 | |
| 1276 | na.num_tx_desc = iflib_num_tx_descs(ctx); |
| 1277 | na.num_rx_desc = iflib_num_rx_descs(ctx); |
| 1278 | na.nm_txsync = iflib_netmap_txsync; |
| 1279 | na.nm_rxsync = iflib_netmap_rxsync; |
| 1280 | na.nm_register = iflib_netmap_register; |
| 1281 | na.nm_intr = iflib_netmap_intr; |
| 1282 | na.num_tx_rings = ctx->ifc_softc_ctx.isc_ntxqsets; |
| 1283 | na.num_rx_rings = ctx->ifc_softc_ctx.isc_nrxqsets; |
| 1284 | return (netmap_attach(&na)); |
| 1285 | } |
| 1286 | |
| 1287 | static int |
| 1288 | iflib_netmap_txq_init(if_ctx_t ctx, iflib_txq_t txq) |
no test coverage detected