diff options
author | David Arinzon <darinzon@amazon.com> | 2022-12-29 10:30:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-12-30 10:43:44 +0300 |
commit | 59811faa2c54dbcf44d575b5a8f6e7077da88dc2 (patch) | |
tree | 045a26b7741573f6a0837ebfdc9cb050f52867cc /tools/perf/scripts/python/task-analyzer.py | |
parent | c7f5e34d906320fdc996afa616676161c029cc02 (diff) | |
download | linux-59811faa2c54dbcf44d575b5a8f6e7077da88dc2.tar.xz |
net: ena: Use bitmask to indicate packet redirection
Redirecting packets with XDP Redirect is done in two phases:
1. A packet is passed by the driver to the kernel using
xdp_do_redirect().
2. After finishing polling for new packets the driver lets the kernel
know that it can now process the redirected packet using
xdp_do_flush_map().
The packets' redirection is handled in the napi context of the
queue that called xdp_do_redirect()
To avoid calling xdp_do_flush_map() each time the driver first checks
whether any packets were redirected, using
xdp_flags |= xdp_verdict;
and
if (xdp_flags & XDP_REDIRECT)
xdp_do_flush_map()
essentially treating XDP instructions as a bitmask, which isn't the case:
enum xdp_action {
XDP_ABORTED = 0,
XDP_DROP,
XDP_PASS,
XDP_TX,
XDP_REDIRECT,
};
Given the current possible values of xdp_action, the current design
doesn't have a bug (since XDP_REDIRECT = 100b), but it is still
flawed.
This patch makes the driver use a bitmask instead, to avoid future
issues.
Fixes: a318c70ad152 ("net: ena: introduce XDP redirect implementation")
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: David Arinzon <darinzon@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions