Changeset View
Standalone View
sys/net/iflib.c
Show First 20 Lines • Show All 1,279 Lines • ▼ Show 20 Lines | iflib_netmap_attach(if_ctx_t ctx) | ||||
na.nm_register = iflib_netmap_register; | na.nm_register = iflib_netmap_register; | ||||
na.nm_intr = iflib_netmap_intr; | na.nm_intr = iflib_netmap_intr; | ||||
na.num_tx_rings = ctx->ifc_softc_ctx.isc_ntxqsets; | na.num_tx_rings = ctx->ifc_softc_ctx.isc_ntxqsets; | ||||
na.num_rx_rings = ctx->ifc_softc_ctx.isc_nrxqsets; | na.num_rx_rings = ctx->ifc_softc_ctx.isc_nrxqsets; | ||||
return (netmap_attach(&na)); | return (netmap_attach(&na)); | ||||
} | } | ||||
static int | static int | ||||
iflib_netmap_txq_init(if_ctx_t ctx, iflib_txq_t txq) | iflib_netmap_txq_init(if_ctx_t ctx, iflib_txq_t txq) | ||||
erj: I think @vmaffione would be the responsible one for these functions? But, why not just make… | |||||
jhbAuthorUnsubmitted Done Inline Actions
I considered that, but wanted to defer. The other option is that if the driver wants to explicitly ignore the return value it could use '(void)' when calling the function which might also quiet the compiler complaint. jhb: > I think @vmaffione would be the responsible one for these functions? But, why not just make… | |||||
vmaffioneUnsubmitted Done Inline ActionsI would prefer to leave the return value as an int, even if the return value is not used right now by this particular driver. It's a matter of uniformity within netmap (RX counterpart, other drivers, Linux drivers, etc.). vmaffione: I would prefer to leave the return value as an int, even if the return value is not used right… | |||||
{ | { | ||||
struct netmap_adapter *na = NA(ctx->ifc_ifp); | struct netmap_adapter *na = NA(ctx->ifc_ifp); | ||||
struct netmap_slot *slot; | struct netmap_slot *slot; | ||||
slot = netmap_reset(na, NR_TX, txq->ift_id, 0); | slot = netmap_reset(na, NR_TX, txq->ift_id, 0); | ||||
if (slot == NULL) | if (slot == NULL) | ||||
return (0); | return (0); | ||||
for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxd[0]; i++) { | for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxd[0]; i++) { | ||||
Show All 37 Lines | iflib_netmap_timer(void *arg) | ||||
* call txsync and reclaim more completed TX buffers. | * call txsync and reclaim more completed TX buffers. | ||||
*/ | */ | ||||
netmap_tx_irq(ctx->ifc_ifp, txq->ift_id); | netmap_tx_irq(ctx->ifc_ifp, txq->ift_id); | ||||
} | } | ||||
#define iflib_netmap_detach(ifp) netmap_detach(ifp) | #define iflib_netmap_detach(ifp) netmap_detach(ifp) | ||||
#else | #else | ||||
#define iflib_netmap_txq_init(ctx, txq) (0) | #define iflib_netmap_txq_init(ctx, txq) | ||||
#define iflib_netmap_rxq_init(ctx, rxq) (0) | #define iflib_netmap_rxq_init(ctx, rxq) (0) | ||||
#define iflib_netmap_detach(ifp) | #define iflib_netmap_detach(ifp) | ||||
#define netmap_enable_all_rings(ifp) | #define netmap_enable_all_rings(ifp) | ||||
#define netmap_disable_all_rings(ifp) | #define netmap_disable_all_rings(ifp) | ||||
#define iflib_netmap_attach(ctx) (0) | #define iflib_netmap_attach(ctx) (0) | ||||
#define netmap_rx_irq(ifp, qid, budget) (0) | #define netmap_rx_irq(ifp, qid, budget) (0) | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 5,643 Lines • Show Last 20 Lines |
I think @vmaffione would be the responsible one for these functions? But, why not just make this a void, too, since it only is called in one place and the return value is never checked there.