提交 45ce0859 编写于 作者: M Magnus Karlsson 提交者: 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: NJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: NMagnus Karlsson <magnus.karlsson@intel.com>
Tested-by: NDvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册