-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xdp-bench: Use basic_program_mode enum in BPF code as well
Instead of converting the basic_program_mode enum into boolean variables, just use it directly in the BPF code. This makes it easier to add new modes in the future, as the boolean variables quickly explodes. Move the struct definition itself into its own shared header file so it's kept in sync. This includes a small functional change in that we no longer perform the "touch data" action when we're swapping MACs. However, since swapping MACs touches the same part of the packet data, the performance impact of this should be negligible (it's just a single inline branch that's being removed). Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
- Loading branch information
Showing
5 changed files
with
29 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
#ifndef _XDP_BASIC_SHARED_H | ||
#define _XDP_BASIC_SHARED_H | ||
|
||
enum basic_program_mode { | ||
BASIC_NO_TOUCH, | ||
BASIC_READ_DATA, | ||
BASIC_PARSE_IPHDR, | ||
BASIC_SWAP_MACS, | ||
}; | ||
|
||
#endif |