-
Notifications
You must be signed in to change notification settings - Fork 177
xdp-forward: Introduce xdp-fwd-flowtable support #441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
03ad047
xdp-forward: Introduce xdp-fwd-flowtable bpf sample
LorenzoBianconi 30e9f7c
xdp-forward: Add the capability to load xdp_fwd_flowtable sample from…
LorenzoBianconi 3d59f38
xdp-forward: Add selftest for flowtable mode
LorenzoBianconi 9c35c0b
xdp-forward: splict fwd-mode in fib-mode and fwd-mode
LorenzoBianconi fdf6536
CI: add 6.12 kernel version
LorenzoBianconi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,114 @@ | ||
#ifndef _LINUX_NETFILTER_H | ||
#define _LINUX_NETFILTER_H | ||
|
||
#include <stdbool.h> | ||
#include <linux/types.h> | ||
#include <bpf/bpf_helpers.h> | ||
#include <xdp/parsing_helpers.h> | ||
|
||
#include "hlist.h" | ||
|
||
struct flow_ports { | ||
__be16 source, dest; | ||
}; | ||
|
||
enum ip_conntrack_dir { | ||
IP_CT_DIR_ORIGINAL, | ||
IP_CT_DIR_REPLY, | ||
IP_CT_DIR_MAX | ||
}; | ||
|
||
enum flow_offload_tuple_dir { | ||
FLOW_OFFLOAD_DIR_ORIGINAL = IP_CT_DIR_ORIGINAL, | ||
FLOW_OFFLOAD_DIR_REPLY = IP_CT_DIR_REPLY, | ||
FLOW_OFFLOAD_DIR_MAX = IP_CT_DIR_MAX, | ||
}; | ||
|
||
enum flow_offload_type { | ||
NF_FLOW_OFFLOAD_UNSPEC, | ||
NF_FLOW_OFFLOAD_ROUTE, | ||
}; | ||
|
||
enum nf_flow_flags { | ||
NF_FLOW_SNAT, | ||
NF_FLOW_DNAT, | ||
NF_FLOW_TEARDOWN, | ||
NF_FLOW_HW, | ||
NF_FLOW_HW_DYING, | ||
NF_FLOW_HW_DEAD, | ||
NF_FLOW_HW_PENDING, | ||
NF_FLOW_HW_BIDIRECTIONAL, | ||
NF_FLOW_HW_ESTABLISHED, | ||
}; | ||
|
||
enum flow_offload_xmit_type { | ||
FLOW_OFFLOAD_XMIT_UNSPEC, | ||
FLOW_OFFLOAD_XMIT_NEIGH, | ||
FLOW_OFFLOAD_XMIT_XFRM, | ||
FLOW_OFFLOAD_XMIT_DIRECT, | ||
FLOW_OFFLOAD_XMIT_TC, | ||
}; | ||
|
||
#define NF_FLOW_TABLE_ENCAP_MAX 2 | ||
struct flow_offload_tuple { | ||
union { | ||
struct in_addr src_v4; | ||
struct in6_addr src_v6; | ||
}; | ||
union { | ||
struct in_addr dst_v4; | ||
struct in6_addr dst_v6; | ||
}; | ||
struct { | ||
__be16 src_port; | ||
__be16 dst_port; | ||
}; | ||
|
||
int iifidx; | ||
|
||
__u8 l3proto; | ||
__u8 l4proto; | ||
struct { | ||
__u16 id; | ||
__be16 proto; | ||
} encap[NF_FLOW_TABLE_ENCAP_MAX]; | ||
|
||
/* All members above are keys for lookups, see flow_offload_hash(). */ | ||
struct { } __hash; | ||
|
||
__u8 dir:2, | ||
xmit_type:3, | ||
encap_num:2, | ||
in_vlan_ingress:2; | ||
__u16 mtu; | ||
union { | ||
struct { | ||
struct dst_entry *dst_cache; | ||
__u32 dst_cookie; | ||
}; | ||
struct { | ||
__u32 ifidx; | ||
__u32 hw_ifidx; | ||
__u8 h_source[ETH_ALEN]; | ||
__u8 h_dest[ETH_ALEN]; | ||
} out; | ||
struct { | ||
__u32 iifidx; | ||
} tc; | ||
}; | ||
}; | ||
|
||
struct flow_offload_tuple_rhash { | ||
struct rhash_head node; | ||
struct flow_offload_tuple tuple; | ||
}; | ||
|
||
struct flow_offload { | ||
struct flow_offload_tuple_rhash tuplehash[FLOW_OFFLOAD_DIR_MAX]; | ||
struct nf_conn *ct; | ||
unsigned long flags; | ||
__u16 type; | ||
__u32 timeout; | ||
}; | ||
|
||
#endif /* _LINUX_NETFILTER_H */ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.