diff mbox series

[bpf-next,1/2] ixgbe: xsk: get rid of redundant 'fallthrough'

Message ID 20220421132126.471515-2-maciej.fijalkowski@intel.com (mailing list archive)
State Accepted
Commit e130e8d5434b8732926c3eb71f678dda0d77da61
Delegated to: BPF
Headers show
Series xsk: remove reduntant 'falltrough' attributes | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1 this patch: 0
netdev/cc_maintainers warning 12 maintainers not CCed: songliubraving@fb.com kuba@kernel.org davem@davemloft.net pabeni@redhat.com kafai@fb.com anthony.l.nguyen@intel.com intel-wired-lan@lists.osuosl.org jesse.brandeburg@intel.com john.fastabend@gmail.com yhs@fb.com hawk@kernel.org kpsingh@kernel.org
netdev/build_clang fail Errors and warnings before: 13 this patch: 9
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-1 success Logs for Kernel LATEST on ubuntu-latest + selftests
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-2 success Logs for Kernel LATEST on z15 + selftests

Commit Message

Maciej Fijalkowski April 21, 2022, 1:21 p.m. UTC
Intel drivers translate actions returned from XDP programs to their own
return codes that have the following mapping:

XDP_REDIRECT -> IXGBE_XDP_{REDIR,CONSUMED}
XDP_TX -> IXGBE_XDP_{TX,CONSUMED}
XDP_DROP -> IXGBE_XDP_CONSUMED
XDP_ABORTED -> IXGBE_XDP_CONSUMED
XDP_PASS -> IXGBE_XDP_PASS

Commit c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx
queue gets full") introduced new translation

XDP_REDIRECT -> IXGBE_XDP_EXIT

which is set when XSK RQ gets full and to indicate that driver should
stop further Rx processing. This happens for unsuccessful
xdp_do_redirect() so it is valuable to call trace_xdp_exception() for
this case. In order to avoid IXGBE_XDP_EXIT -> IXGBE_XDP_CONSUMED
overwrite, XDP_DROP case was moved above which in turn made the
'fallthrough' that is in XDP_ABORTED useless as it became the last label
in the switch statement.

Simply drop this leftover.

Fixes: c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Stephen Rothwell April 21, 2022, 10:23 p.m. UTC | #1
Hi Maciej,

On Thu, 21 Apr 2022 15:21:25 +0200 Maciej Fijalkowski <maciej.fijalkowski@intel.com> wrote:
>
> Intel drivers translate actions returned from XDP programs to their own
> return codes that have the following mapping:
> 
> XDP_REDIRECT -> IXGBE_XDP_{REDIR,CONSUMED}
> XDP_TX -> IXGBE_XDP_{TX,CONSUMED}
> XDP_DROP -> IXGBE_XDP_CONSUMED
> XDP_ABORTED -> IXGBE_XDP_CONSUMED
> XDP_PASS -> IXGBE_XDP_PASS
> 
> Commit c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx
> queue gets full") introduced new translation
> 
> XDP_REDIRECT -> IXGBE_XDP_EXIT
> 
> which is set when XSK RQ gets full and to indicate that driver should
> stop further Rx processing. This happens for unsuccessful
> xdp_do_redirect() so it is valuable to call trace_xdp_exception() for
> this case. In order to avoid IXGBE_XDP_EXIT -> IXGBE_XDP_CONSUMED
> overwrite, XDP_DROP case was moved above which in turn made the
> 'fallthrough' that is in XDP_ABORTED useless as it became the last label
> in the switch statement.
> 
> Simply drop this leftover.
> 
> Fixes: c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full")
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Reported-by ?
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
index 68532cffd453..1703c640a434 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
@@ -144,7 +144,6 @@  static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter,
 		result = IXGBE_XDP_CONSUMED;
 out_failure:
 		trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
-		fallthrough; /* handle aborts by dropping packet */
 	}
 	return result;
 }