MCPcopy Create free account
hub / github.com/F-Stack/f-stack / iflib_netmap_attach

Function iflib_netmap_attach

freebsd/net/iflib.c:1264–1285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1262}
1263
1264static int
1265iflib_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
1287static int
1288iflib_netmap_txq_init(if_ctx_t ctx, iflib_txq_t txq)

Callers 1

iflib_device_registerFunction · 0.85

Calls 3

bzeroFunction · 0.85
iflib_num_tx_descsFunction · 0.85
iflib_num_rx_descsFunction · 0.85

Tested by

no test coverage detected