Skip to content

Commit

Permalink
igc: add correct exception tracing for XDP
Browse files Browse the repository at this point in the history
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: 73f1071 ("igc: Add support for XDP_TX action")
Fixes: 4ff3203 ("igc: Add support for XDP_REDIRECT action")
Reported-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Magnus Karlsson authored and Tony Nguyen committed Jun 3, 2021
1 parent faae814 commit 45ce085
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/net/ethernet/intel/igc/igc_main.c
Original file line number Diff line number Diff line change
@@ -2047,20 +2047,19 @@ static struct sk_buff *igc_xdp_run_prog(struct igc_adapter *adapter,
break;
case XDP_TX:
if (igc_xdp_xmit_back(adapter, xdp) < 0)
res = IGC_XDP_CONSUMED;
else
res = IGC_XDP_TX;
goto out_failure;
res = IGC_XDP_TX;
break;
case XDP_REDIRECT:
if (xdp_do_redirect(adapter->netdev, xdp, prog) < 0)
res = IGC_XDP_CONSUMED;
else
res = IGC_XDP_REDIRECT;
goto out_failure;
res = IGC_XDP_REDIRECT;
break;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
case XDP_ABORTED:
out_failure:
trace_xdp_exception(adapter->netdev, prog, act);
fallthrough;
case XDP_DROP:

0 comments on commit 45ce085

Please sign in to comment.