Commit 45ce0859 authored by Magnus Karlsson's avatar Magnus Karlsson Committed by Tony Nguyen

igc: add correct exception tracing for XDP

Add missing exception tracing to XDP when a number of different
errors can occur. The support was only partial. Several errors
where not logged which would confuse the user quite a lot not
knowing where and why the packets disappeared.

Fixes: 73f1071c ("igc: Add support for XDP_TX action")
Fixes: 4ff32036 ("igc: Add support for XDP_REDIRECT action")
Reported-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
Tested-by: default avatarDvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent faae8142
...@@ -2047,20 +2047,19 @@ static struct sk_buff *igc_xdp_run_prog(struct igc_adapter *adapter, ...@@ -2047,20 +2047,19 @@ static struct sk_buff *igc_xdp_run_prog(struct igc_adapter *adapter,
break; break;
case XDP_TX: case XDP_TX:
if (igc_xdp_xmit_back(adapter, xdp) < 0) if (igc_xdp_xmit_back(adapter, xdp) < 0)
res = IGC_XDP_CONSUMED; goto out_failure;
else res = IGC_XDP_TX;
res = IGC_XDP_TX;
break; break;
case XDP_REDIRECT: case XDP_REDIRECT:
if (xdp_do_redirect(adapter->netdev, xdp, prog) < 0) if (xdp_do_redirect(adapter->netdev, xdp, prog) < 0)
res = IGC_XDP_CONSUMED; goto out_failure;
else res = IGC_XDP_REDIRECT;
res = IGC_XDP_REDIRECT;
break; break;
default: default:
bpf_warn_invalid_xdp_action(act); bpf_warn_invalid_xdp_action(act);
fallthrough; fallthrough;
case XDP_ABORTED: case XDP_ABORTED:
out_failure:
trace_xdp_exception(adapter->netdev, prog, act); trace_xdp_exception(adapter->netdev, prog, act);
fallthrough; fallthrough;
case XDP_DROP: case XDP_DROP:
......
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