net: fec: add exception tracing for XDP
As we already added the exception tracing for XDP_TX, I think it is necessary to add the exception tracing for other XDP actions, such as XDP_REDIRECT, XDP_ABORTED and unknown error actions. Signed-off-by: Wei Fang <wei.fang@nxp.com> Suggested-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20230822065255.606739-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
664c84c26d
commit
e83fabb797
|
@ -1583,25 +1583,18 @@ fec_enet_run_xdp(struct fec_enet_private *fep, struct bpf_prog *prog,
|
|||
case XDP_REDIRECT:
|
||||
rxq->stats[RX_XDP_REDIRECT]++;
|
||||
err = xdp_do_redirect(fep->netdev, xdp, prog);
|
||||
if (!err) {
|
||||
ret = FEC_ENET_XDP_REDIR;
|
||||
} else {
|
||||
ret = FEC_ENET_XDP_CONSUMED;
|
||||
page = virt_to_head_page(xdp->data);
|
||||
page_pool_put_page(rxq->page_pool, page, sync, true);
|
||||
}
|
||||
if (unlikely(err))
|
||||
goto xdp_err;
|
||||
|
||||
ret = FEC_ENET_XDP_REDIR;
|
||||
break;
|
||||
|
||||
case XDP_TX:
|
||||
err = fec_enet_xdp_tx_xmit(fep, cpu, xdp, sync);
|
||||
if (unlikely(err)) {
|
||||
ret = FEC_ENET_XDP_CONSUMED;
|
||||
page = virt_to_head_page(xdp->data);
|
||||
page_pool_put_page(rxq->page_pool, page, sync, true);
|
||||
trace_xdp_exception(fep->netdev, prog, act);
|
||||
} else {
|
||||
ret = FEC_ENET_XDP_TX;
|
||||
}
|
||||
if (unlikely(err))
|
||||
goto xdp_err;
|
||||
|
||||
ret = FEC_ENET_XDP_TX;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1613,9 +1606,12 @@ fec_enet_run_xdp(struct fec_enet_private *fep, struct bpf_prog *prog,
|
|||
|
||||
case XDP_DROP:
|
||||
rxq->stats[RX_XDP_DROP]++;
|
||||
xdp_err:
|
||||
ret = FEC_ENET_XDP_CONSUMED;
|
||||
page = virt_to_head_page(xdp->data);
|
||||
page_pool_put_page(rxq->page_pool, page, sync, true);
|
||||
if (act != XDP_DROP)
|
||||
trace_xdp_exception(fep->netdev, prog, act);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue