| 3919 | } |
| 3920 | |
| 3921 | static void |
| 3922 | _task_fn_rx(void *context) |
| 3923 | { |
| 3924 | iflib_rxq_t rxq = context; |
| 3925 | if_ctx_t ctx = rxq->ifr_ctx; |
| 3926 | uint8_t more; |
| 3927 | uint16_t budget; |
| 3928 | #ifdef DEV_NETMAP |
| 3929 | u_int work = 0; |
| 3930 | int nmirq; |
| 3931 | #endif |
| 3932 | |
| 3933 | #ifdef IFLIB_DIAGNOSTICS |
| 3934 | rxq->ifr_cpu_exec_count[curcpu]++; |
| 3935 | #endif |
| 3936 | DBG_COUNTER_INC(task_fn_rxs); |
| 3937 | if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) |
| 3938 | return; |
| 3939 | #ifdef DEV_NETMAP |
| 3940 | nmirq = netmap_rx_irq(ctx->ifc_ifp, rxq->ifr_id, &work); |
| 3941 | if (nmirq != NM_IRQ_PASS) { |
| 3942 | more = (nmirq == NM_IRQ_RESCHED) ? IFLIB_RXEOF_MORE : 0; |
| 3943 | goto skip_rxeof; |
| 3944 | } |
| 3945 | #endif |
| 3946 | budget = ctx->ifc_sysctl_rx_budget; |
| 3947 | if (budget == 0) |
| 3948 | budget = 16; /* XXX */ |
| 3949 | more = iflib_rxeof(rxq, budget); |
| 3950 | #ifdef DEV_NETMAP |
| 3951 | skip_rxeof: |
| 3952 | #endif |
| 3953 | if ((more & IFLIB_RXEOF_MORE) == 0) { |
| 3954 | if (ctx->ifc_flags & IFC_LEGACY) |
| 3955 | IFDI_INTR_ENABLE(ctx); |
| 3956 | else |
| 3957 | IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); |
| 3958 | DBG_COUNTER_INC(rx_intr_enables); |
| 3959 | } |
| 3960 | if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) |
| 3961 | return; |
| 3962 | |
| 3963 | if (more & IFLIB_RXEOF_MORE) |
| 3964 | GROUPTASK_ENQUEUE(&rxq->ifr_task); |
| 3965 | else if (more & IFLIB_RXEOF_EMPTY) |
| 3966 | callout_reset_curcpu(&rxq->ifr_watchdog, 1, &_task_fn_rx_watchdog, rxq); |
| 3967 | } |
| 3968 | |
| 3969 | static void |
| 3970 | _task_fn_admin(void *context) |
nothing calls this directly
no test coverage detected