diff options
author | Ting Xu <ting.xu@intel.com> | 2021-09-16 08:37:25 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2022-03-15 16:15:19 +0000 |
commit | 3a3668201734fddb614cba025fafc4578ddf5482 (patch) | |
tree | c8dddf2ac1a050825eb8a00804a9fa4170e2a0e0 /src/vnet/flow/flow.h | |
parent | 218e4ec5302a88d4400cc3b0897310f4d59675be (diff) |
flow: add generic flow pattern for 5G flow enhancement
In order to support the requirement of RSS and packet steering of new
protocols, such as GTPU PDU-type and QFI, for 5G UPF, a generic pattern
is introduced in vnet flow. The generic flow pattern is based on DDP
(Dynamic Device Personalization) function and Parser Library module in
DPDK. Using generic flow pattern, we do not need to create new packet
and field type and offset in API parser for every new protocols. We can
create flows for any protocol immediately as long as supported by DDP.
The generic flow can be used to support 5G related protocols in
different scenarios.
The input of this generic pattern are two binary strings for spec and
mask. Spec is the binary presentation of the target packet type, and
mask is used to mark the target fields.
In this patch DPDK plugins is enabled for POC. Next step we will enable
generic flow in native IAVF, which is the main target.
Here is an example. If we want to create a flow for GTPU QFI,
spec is:
00000000000100000000000208004500003C00000000001100000101010102020202000
008680028000034FF001C00000000000000850100010045000014000000000000000001
01010102020202
mask is:
00000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000007F0000000000000000000000000000
00000000000000
A naming API POC is created via VAPI to help create the rule with
the target packet format similar to Scapy. It is based on a function
module called PacketForge. In this way, the user no need to create
binary string spec and mask by themselves.
Type: feature
Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Id3444f95c158bdcdfeeee19d795cd9ecbeeec07c
Diffstat (limited to 'src/vnet/flow/flow.h')
-rw-r--r-- | src/vnet/flow/flow.h | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/src/vnet/flow/flow.h b/src/vnet/flow/flow.h index 4945f4367c7..313e85c45f9 100644 --- a/src/vnet/flow/flow.h +++ b/src/vnet/flow/flow.h @@ -24,26 +24,28 @@ #include <vnet/ip/ip6_packet.h> #include <vnet/ethernet/packet.h> -#define foreach_flow_type \ - /* l2 flow*/ \ - _(ETHERNET, ethernet, "ethernet") \ - /* l3 IP flow */ \ - _(IP4, ip4, "ipv4") \ - _(IP6, ip6, "ipv6") \ - /* IP tunnel flow */ \ - _(IP4_L2TPV3OIP, ip4_l2tpv3oip, "ipv4-l2tpv3oip") \ - _(IP4_IPSEC_ESP, ip4_ipsec_esp, "ipv4-ipsec-esp") \ - _(IP4_IPSEC_AH, ip4_ipsec_ah, "ipv4-ipsec-ah") \ - /* l4 flow*/ \ - _(IP4_N_TUPLE, ip4_n_tuple, "ipv4-n-tuple") \ - _(IP6_N_TUPLE, ip6_n_tuple, "ipv6-n-tuple") \ - _(IP4_N_TUPLE_TAGGED, ip4_n_tuple_tagged, "ipv4-n-tuple-tagged") \ - _(IP6_N_TUPLE_TAGGED, ip6_n_tuple_tagged, "ipv6-n-tuple-tagged") \ - /* L4 tunnel flow*/ \ - _(IP4_VXLAN, ip4_vxlan, "ipv4-vxlan") \ - _(IP6_VXLAN, ip6_vxlan, "ipv6-vxlan") \ - _(IP4_GTPC, ip4_gtpc, "ipv4-gtpc") \ - _(IP4_GTPU, ip4_gtpu, "ipv4-gtpu") +#define foreach_flow_type \ + /* l2 flow*/ \ + _ (ETHERNET, ethernet, "ethernet") \ + /* l3 IP flow */ \ + _ (IP4, ip4, "ipv4") \ + _ (IP6, ip6, "ipv6") \ + /* IP tunnel flow */ \ + _ (IP4_L2TPV3OIP, ip4_l2tpv3oip, "ipv4-l2tpv3oip") \ + _ (IP4_IPSEC_ESP, ip4_ipsec_esp, "ipv4-ipsec-esp") \ + _ (IP4_IPSEC_AH, ip4_ipsec_ah, "ipv4-ipsec-ah") \ + /* l4 flow*/ \ + _ (IP4_N_TUPLE, ip4_n_tuple, "ipv4-n-tuple") \ + _ (IP6_N_TUPLE, ip6_n_tuple, "ipv6-n-tuple") \ + _ (IP4_N_TUPLE_TAGGED, ip4_n_tuple_tagged, "ipv4-n-tuple-tagged") \ + _ (IP6_N_TUPLE_TAGGED, ip6_n_tuple_tagged, "ipv6-n-tuple-tagged") \ + /* L4 tunnel flow*/ \ + _ (IP4_VXLAN, ip4_vxlan, "ipv4-vxlan") \ + _ (IP6_VXLAN, ip6_vxlan, "ipv6-vxlan") \ + _ (IP4_GTPC, ip4_gtpc, "ipv4-gtpc") \ + _ (IP4_GTPU, ip4_gtpu, "ipv4-gtpu") \ + /* generic flow */ \ + _ (GENERIC, generic, "generic") #define foreach_flow_entry_ethernet \ _fe(ethernet_header_t, eth_hdr) @@ -104,6 +106,8 @@ foreach_flow_entry_ip4_n_tuple \ _fe(u32, teid) +#define foreach_flow_entry_generic _fe (generic_pattern_t, pattern) + #define foreach_flow_action \ _(0, COUNT, "count") \ _(1, MARK, "mark") \ @@ -190,6 +194,12 @@ typedef struct u8 mask; } ip_prot_and_mask_t; +typedef struct +{ + u8 spec[1024]; + u8 mask[1024]; +} generic_pattern_t; + typedef enum { VNET_FLOW_TYPE_UNKNOWN, |