Commit 9440a875 authored by Arthur Fabre's avatar Arthur Fabre Committed by David S. Miller

sfc: trace_xdp_exception on XDP failure

The sfc driver can drop packets processed with XDP, notably when running
out of buffer space on XDP_TX, or returning an unknown XDP action.
This increments the rx_xdp_bad_drops ethtool counter.

Call trace_xdp_exception everywhere rx_xdp_bad_drops is incremented,
except for fragmented RX packets as the XDP program hasn't run yet.
This allows it to easily be monitored from userspace.

This mirrors the behavior of other drivers.
Signed-off-by: default avatarArthur Fabre <afabre@cloudflare.com>
Acked-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1e86606b
...@@ -724,6 +724,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel, ...@@ -724,6 +724,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
netif_err(efx, rx_err, efx->net_dev, netif_err(efx, rx_err, efx->net_dev,
"XDP TX failed (%d)\n", err); "XDP TX failed (%d)\n", err);
channel->n_rx_xdp_bad_drops++; channel->n_rx_xdp_bad_drops++;
trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
} else { } else {
channel->n_rx_xdp_tx++; channel->n_rx_xdp_tx++;
} }
...@@ -737,6 +738,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel, ...@@ -737,6 +738,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
netif_err(efx, rx_err, efx->net_dev, netif_err(efx, rx_err, efx->net_dev,
"XDP redirect failed (%d)\n", err); "XDP redirect failed (%d)\n", err);
channel->n_rx_xdp_bad_drops++; channel->n_rx_xdp_bad_drops++;
trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
} else { } else {
channel->n_rx_xdp_redirect++; channel->n_rx_xdp_redirect++;
} }
...@@ -746,6 +748,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel, ...@@ -746,6 +748,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
bpf_warn_invalid_xdp_action(xdp_act); bpf_warn_invalid_xdp_action(xdp_act);
efx_free_rx_buffers(rx_queue, rx_buf, 1); efx_free_rx_buffers(rx_queue, rx_buf, 1);
channel->n_rx_xdp_bad_drops++; channel->n_rx_xdp_bad_drops++;
trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
break; break;
case XDP_ABORTED: case XDP_ABORTED:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment