* [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR
@ 2022-01-29 6:24 Jie Wang
2022-01-29 6:24 ` [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
` (7 more replies)
0 siblings, 8 replies; 41+ messages in thread
From: Jie Wang @ 2022-01-29 6:24 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow
director. Required to distribute packets based on outer MAC src
address and L2TPv2 session ID.
Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute
packets based on inner IP src+dest address and TCP/UDP src+dest port.
---
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.
Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR
app/test-pmd/cmdline.c | 10 +-
app/test-pmd/cmdline_flow.c | 313 +++++++++++++++++++++----
app/test-pmd/config.c | 3 +-
doc/guides/rel_notes/release_22_03.rst | 15 ++
drivers/common/iavf/virtchnl.h | 4 +
drivers/net/iavf/iavf.h | 2 +
drivers/net/iavf/iavf_fdir.c | 174 +++++++++++---
drivers/net/iavf/iavf_generic_flow.c | 34 +++
drivers/net/iavf/iavf_generic_flow.h | 10 +
drivers/net/iavf/iavf_hash.c | 83 ++++++-
lib/ethdev/rte_ethdev.h | 7 +
lib/net/rte_l2tpv2.h | 33 ++-
12 files changed, 590 insertions(+), 98 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
@ 2022-01-29 6:24 ` Jie Wang
2022-01-30 9:15 ` Ori Kam
2022-02-01 12:19 ` Ferruh Yigit
2022-01-29 6:24 ` [PATCH v3 2/6] net: fix L2TPv2 common header Jie Wang
` (6 subsequent siblings)
7 siblings, 2 replies; 41+ messages in thread
From: Jie Wang @ 2022-01-29 6:24 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
This patch defines new RSS offload type for L2TPv2, which
is required when users want to distribute packets based on
the L2TPv2 session ID field.
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
app/test-pmd/cmdline.c | 10 ++++++----
app/test-pmd/config.c | 3 ++-
doc/guides/rel_notes/release_22_03.rst | 5 +++++
lib/ethdev/rte_ethdev.h | 7 +++++++
4 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index e626b1c7d9..d535311f21 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
- RTE_ETH_RSS_ECPRI;
+ RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
else if (!strcmp(res->value, "eth"))
rss_conf.rss_hf = RTE_ETH_RSS_ETH;
else if (!strcmp(res->value, "vlan"))
@@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
} else if (!strcmp(res->value, "default"))
use_default = 1;
+ else if (!strcmp(res->value, "l2tpv2"))
+ rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
atoi(res->value) < 64)
rss_conf.rss_hf = 1ULL << atoi(res->value);
@@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
.help_str = "port config all rss "
"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
- "level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+ "level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
.tokens = {
(void *)&cmd_config_rss_port,
(void *)&cmd_config_rss_keyword,
@@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
"ipv6-tcp-ex#ipv6-udp-ex#"
"l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
"l2-src-only#l2-dst-only#s-vlan#c-vlan#"
- "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
+ "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
@@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
- "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+ "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
"<string of hex digits (variable length, NIC dependent)>",
.tokens = {
(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1722d6c8f8..ec922bd304 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
{ "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
- RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+ RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
{ "none", 0 },
{ "eth", RTE_ETH_RSS_ETH },
{ "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
{ "mpls", RTE_ETH_RSS_MPLS },
{ "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
{ "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+ { "l2tpv2", RTE_ETH_RSS_L2TPV2 },
{ NULL, 0 },
};
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 33be3241b9..9a507ab9ea 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -55,6 +55,11 @@ New Features
Also, make sure to start the actual text at the margin.
=======================================================
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+ Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+ input set for RSS.
+
* **Updated Cisco enic driver.**
* Added rte_flow support for matching GENEVE packets.
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 147cc1ced3..29e6091bc8 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -651,6 +651,13 @@ struct rte_eth_rss_conf {
#define RTE_ETH_RSS_L4_CHKSUM RTE_BIT64(35)
#define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
+/*
+ * Below macro is defined for RSS offload type, it can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define RTE_ETH_RSS_L2TPV2 RTE_BIT64(36)
+#define ETH_RSS_L2TPV2 RTE_ETH_RSS_L2TPV2
+
/*
* We use the following macros to combine with above RTE_ETH_RSS_* for
* more specific input set selection. These bits are defined starting
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 2/6] net: fix L2TPv2 common header
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
2022-01-29 6:24 ` [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
@ 2022-01-29 6:24 ` Jie Wang
2022-01-30 9:17 ` Ori Kam
2022-01-29 6:24 ` [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
` (5 subsequent siblings)
7 siblings, 1 reply; 41+ messages in thread
From: Jie Wang @ 2022-01-29 6:24 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang, stable
The fields of L2TPv2 common header were reversed in big endian and
little endian.
This patch fixes this error to ensure L2TPv2 can be parsed correctly.
Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
Cc: stable@dpdk.org
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
lib/net/rte_l2tpv2.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 938a993b48..1f3ad3f03c 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
__extension__
struct {
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
- uint16_t t:1; /**< message Type */
- uint16_t l:1; /**< length option bit */
- uint16_t res1:2; /**< reserved */
- uint16_t s:1; /**< ns/nr option bit */
- uint16_t res2:1; /**< reserved */
- uint16_t o:1; /**< offset option bit */
- uint16_t p:1; /**< priority option bit */
- uint16_t res3:4; /**< reserved */
- uint16_t ver:4; /**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
uint16_t ver:4; /**< protocol version */
uint16_t res3:4; /**< reserved */
uint16_t p:1; /**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
uint16_t res1:2; /**< reserved */
uint16_t l:1; /**< length option bit */
uint16_t t:1; /**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+ uint16_t t:1; /**< message Type */
+ uint16_t l:1; /**< length option bit */
+ uint16_t res1:2; /**< reserved */
+ uint16_t s:1; /**< ns/nr option bit */
+ uint16_t res2:1; /**< reserved */
+ uint16_t o:1; /**< offset option bit */
+ uint16_t p:1; /**< priority option bit */
+ uint16_t res3:4; /**< reserved */
+ uint16_t ver:4; /**< protocol version */
#endif
};
};
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
2022-01-29 6:24 ` [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-01-29 6:24 ` [PATCH v3 2/6] net: fix L2TPv2 common header Jie Wang
@ 2022-01-29 6:24 ` Jie Wang
2022-01-30 9:19 ` Ori Kam
2022-01-29 6:24 ` [PATCH v3 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
` (4 subsequent siblings)
7 siblings, 1 reply; 41+ messages in thread
From: Jie Wang @ 2022-01-29 6:24 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
This patch adds L2TPv2 control message and 5 types of data message
support for testpmd.
The added L2TPv2 message types are listed below:
1. L2TPv2 control
2. L2TPv2
3. L2TPv2 + length option
4. L2TPv2 + sequence option
5. L2TPv2 + offset option
6. L2TPv2 + length option + sequence option
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
app/test-pmd/cmdline_flow.c | 313 ++++++++++++++++++++++++++++++------
lib/net/rte_l2tpv2.h | 13 ++
2 files changed, 275 insertions(+), 51 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index bbaf18d76e..4e2ed3d6a3 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -322,13 +322,30 @@ enum index {
ITEM_FLEX_ITEM_HANDLE,
ITEM_FLEX_PATTERN_HANDLE,
ITEM_L2TPV2,
- ITEM_L2TPV2_COMMON,
- ITEM_L2TPV2_COMMON_TYPE,
- ITEM_L2TPV2_COMMON_TYPE_DATA_L,
- ITEM_L2TPV2_COMMON_TYPE_CTRL,
+ ITEM_L2TPV2_TYPE,
+ ITEM_L2TPV2_TYPE_DATA,
+ ITEM_L2TPV2_TYPE_DATA_L,
+ ITEM_L2TPV2_TYPE_DATA_S,
+ ITEM_L2TPV2_TYPE_DATA_O,
+ ITEM_L2TPV2_TYPE_DATA_L_S,
+ ITEM_L2TPV2_TYPE_CTRL,
+ ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_SESSION_ID,
ITEM_L2TPV2_MSG_DATA_L_LENGTH,
ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_NS,
+ ITEM_L2TPV2_MSG_DATA_S_NR,
+ ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+ ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_NS,
+ ITEM_L2TPV2_MSG_DATA_L_S_NR,
ITEM_L2TPV2_MSG_CTRL_LENGTH,
ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
@@ -1449,19 +1466,70 @@ static const enum index item_flex[] = {
};
static const enum index item_l2tpv2[] = {
- ITEM_L2TPV2_COMMON,
+ ITEM_L2TPV2_TYPE,
ITEM_NEXT,
ZERO,
};
-static const enum index item_l2tpv2_common[] = {
- ITEM_L2TPV2_COMMON_TYPE,
+static const enum index item_l2tpv2_type[] = {
+ ITEM_L2TPV2_TYPE_DATA,
+ ITEM_L2TPV2_TYPE_DATA_L,
+ ITEM_L2TPV2_TYPE_DATA_S,
+ ITEM_L2TPV2_TYPE_DATA_O,
+ ITEM_L2TPV2_TYPE_DATA_L_S,
+ ITEM_L2TPV2_TYPE_CTRL,
ZERO,
};
-static const enum index item_l2tpv2_common_type[] = {
- ITEM_L2TPV2_COMMON_TYPE_DATA_L,
- ITEM_L2TPV2_COMMON_TYPE_CTRL,
+static const enum index item_l2tpv2_type_data[] = {
+ ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_SESSION_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l[] = {
+ ITEM_L2TPV2_MSG_DATA_L_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_s[] = {
+ ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_NS,
+ ITEM_L2TPV2_MSG_DATA_S_NR,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_o[] = {
+ ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l_s[] = {
+ ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_NS,
+ ITEM_L2TPV2_MSG_DATA_L_S_NR,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_ctrl[] = {
+ ITEM_L2TPV2_MSG_CTRL_LENGTH,
+ ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
+ ITEM_L2TPV2_MSG_CTRL_NS,
+ ITEM_L2TPV2_MSG_CTRL_NR,
+ ITEM_NEXT,
ZERO,
};
@@ -3843,31 +3911,46 @@ static const struct token token_list[] = {
.next = NEXT(item_l2tpv2),
.call = parse_vc,
},
- [ITEM_L2TPV2_COMMON] = {
- .name = "common",
- .help = "L2TPv2 common header",
- .next = NEXT(item_l2tpv2_common),
- },
- [ITEM_L2TPV2_COMMON_TYPE] = {
+ [ITEM_L2TPV2_TYPE] = {
.name = "type",
- .help = "type of common header",
- .next = NEXT(item_l2tpv2_common_type),
+ .help = "type of l2tpv2",
+ .next = NEXT(item_l2tpv2_type),
.args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)),
},
- [ITEM_L2TPV2_COMMON_TYPE_DATA_L] = {
+ [ITEM_L2TPV2_TYPE_DATA] = {
+ .name = "data",
+ .help = "Type #7: data message without any options",
+ .next = NEXT(item_l2tpv2_type_data),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type7.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type7.session_id)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_L] = {
.name = "data_l",
.help = "Type #6: data message with length option",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
- ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
- ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
- ITEM_NEXT)),
+ .next = NEXT(item_l2tpv2_type_data_l),
.call = parse_vc_item_l2tpv2_type,
},
[ITEM_L2TPV2_MSG_DATA_L_LENGTH] = {
.name = "length",
.help = "message length",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3876,8 +3959,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] = {
.name = "tunnel_id",
.help = "tunnel identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3886,29 +3968,150 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] = {
.name = "session_id",
.help = "session identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
hdr.type6.session_id)),
},
- [ITEM_L2TPV2_COMMON_TYPE_CTRL] = {
+ [ITEM_L2TPV2_TYPE_DATA_S] = {
+ .name = "data_s",
+ .help = "Type #5: data message with ns, nr option",
+ .next = NEXT(item_l2tpv2_type_data_s),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_NS] = {
+ .name = "ns",
+ .help = "sequence number for message",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.ns)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_NR] = {
+ .name = "nr",
+ .help = "sequence number for next receive message",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.nr)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_O] = {
+ .name = "data_o",
+ .help = "Type #4: data message with offset option",
+ .next = NEXT(item_l2tpv2_type_data_o),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type4.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_OFFSET] = {
+ .name = "offset_size",
+ .help = "the size of offset padding",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type4.offset_size)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_L_S] = {
+ .name = "data_l_s",
+ .help = "Type #3: data message contains length, ns, nr "
+ "options",
+ .next = NEXT(item_l2tpv2_type_data_l_s),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_LENGTH] = {
+ .name = "length",
+ .help = "message length",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.length)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_NS] = {
+ .name = "ns",
+ .help = "sequence number for message",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.ns)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_NR] = {
+ .name = "nr",
+ .help = "sequence number for next receive message",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.nr)),
+ },
+ [ITEM_L2TPV2_TYPE_CTRL] = {
.name = "control",
- .help = "Type #3: conrtol message contains length, ns, nr options",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
- ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
- ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
- ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_MSG_CTRL_NR,
- ITEM_NEXT)),
+ .help = "Type #3: conrtol message contains length, ns, nr "
+ "options",
+ .next = NEXT(item_l2tpv2_type_ctrl),
.call = parse_vc_item_l2tpv2_type,
},
[ITEM_L2TPV2_MSG_CTRL_LENGTH] = {
.name = "length",
.help = "message length",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3917,8 +4120,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] = {
.name = "tunnel_id",
.help = "tunnel identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3927,8 +4129,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_SESSION_ID] = {
.name = "session_id",
.help = "session identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3937,8 +4138,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_NS] = {
.name = "ns",
.help = "sequence number for message",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3947,8 +4147,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_NR] = {
.name = "nr",
.help = "sequence number for next receive message",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -5889,11 +6088,23 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token,
if (parse_default(ctx, token, str, len, NULL, 0) < 0)
return -1;
switch (ctx->curr) {
- case ITEM_L2TPV2_COMMON_TYPE_DATA_L:
- msg_type |= 0x4000;
+ case ITEM_L2TPV2_TYPE_DATA:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_L:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_S:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_S;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_O:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_O;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_L_S:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L_S;
break;
- case ITEM_L2TPV2_COMMON_TYPE_CTRL:
- msg_type |= 0xC800;
+ case ITEM_L2TPV2_TYPE_CTRL:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_CONTROL;
break;
default:
return -1;
diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 1f3ad3f03c..d41123a504 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -78,6 +78,19 @@
extern "C" {
#endif
+/*
+ * L2TPv2 Message Type
+ */
+#define RTE_L2TPV2_MSG_TYPE_CONTROL 0xC802
+#define RTE_L2TPV2_MSG_TYPE_DATA 0x0002
+#define RTE_L2TPV2_MSG_TYPE_DATA_L 0x4002
+#define RTE_L2TPV2_MSG_TYPE_DATA_S 0x0802
+#define RTE_L2TPV2_MSG_TYPE_DATA_O 0x0202
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S 0x4802
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_O 0x4202
+#define RTE_L2TPV2_MSG_TYPE_DATA_S_O 0x0A02
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O 0x4A02
+
/**
* L2TPv2 Common Header
*/
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 4/6] common/iavf: add session ID fields for L2TPv2
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
` (2 preceding siblings ...)
2022-01-29 6:24 ` [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
@ 2022-01-29 6:24 ` Jie Wang
2022-01-29 6:24 ` [PATCH v3 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
` (3 subsequent siblings)
7 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-01-29 6:24 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add virtchnl fields session ID of L2TPv2 for AVF HASH.
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
drivers/common/iavf/virtchnl.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 80e754a1b2..3e44eca7d8 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -1653,6 +1653,10 @@ enum virtchnl_proto_hdr_field {
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN),
VIRTCHNL_PROTO_HDR_GTPU_UP_QFI =
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP),
+ /* L2TPv2 */
+ VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID =
+ PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_L2TPV2),
+ VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID,
};
struct virtchnl_proto_hdr {
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 5/6] net/iavf: support L2TPv2 for AVF HASH
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
` (3 preceding siblings ...)
2022-01-29 6:24 ` [PATCH v3 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
@ 2022-01-29 6:24 ` Jie Wang
2022-01-29 6:24 ` [PATCH v3 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
` (2 subsequent siblings)
7 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-01-29 6:24 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add support for PPP over L2TPv2 over UDP protocol and L2TPv2
protocol RSS hash based on outer MAC src address and L2TPv2
session ID.
Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
doc/guides/rel_notes/release_22_03.rst | 6 ++
drivers/net/iavf/iavf.h | 2 +
drivers/net/iavf/iavf_generic_flow.c | 34 +++++++++++
drivers/net/iavf/iavf_generic_flow.h | 6 ++
drivers/net/iavf/iavf_hash.c | 83 ++++++++++++++++++++++++--
5 files changed, 127 insertions(+), 4 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 9a507ab9ea..0d1e4a0b61 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -64,6 +64,12 @@ New Features
* Added rte_flow support for matching GENEVE packets.
+* **Updated Intel iavf driver.**
+
+ Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+ based on outer MAC src address and L2TPv2 session ID.
+
+
Removed Items
-------------
diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 0bb5698583..a01d18e61b 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -93,6 +93,8 @@
#define IAVF_VLAN_TAG_PCP_OFFSET 13
+#define IAVF_L2TPV2_FLAGS_LEN 0x4000
+
struct iavf_adapter;
struct iavf_rx_queue;
struct iavf_tx_queue;
diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 2befa125ac..1de4187e67 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -1611,6 +1611,40 @@ enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
RTE_FLOW_ITEM_TYPE_END,
};
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_PPP,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV6,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV6,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_PPP,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
/* PPPoL2TPv2oUDP */
enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
RTE_FLOW_ITEM_TYPE_ETH,
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index 3681a96b31..107bbc1a23 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -410,6 +410,12 @@ extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_tcp[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[];
+/* L2TPv2 */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[];
+
/* PPPoL2TPv2oUDP */
extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6[];
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 5e0888ea68..f568239b71 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -36,6 +36,7 @@
#define IAVF_PHINT_MID_IPV6 BIT_ULL(8)
/* L2TPv2 */
#define IAVF_PHINT_L2TPV2 BIT_ULL(9)
+#define IAVF_PHINT_L2TPV2_LEN BIT_ULL(10)
#define IAVF_PHINT_GTPU_MSK (IAVF_PHINT_GTPU | \
IAVF_PHINT_GTPU_EH | \
@@ -167,7 +168,9 @@ iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID), {BUFF_NOUSED} }
#define proto_hdr_l2tpv2 { \
- VIRTCHNL_PROTO_HDR_L2TPV2, 0, {BUFF_NOUSED} }
+ VIRTCHNL_PROTO_HDR_L2TPV2, \
+ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID) | \
+ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID), {BUFF_NOUSED} }
#define proto_hdr_ppp { \
VIRTCHNL_PROTO_HDR_PPP, 0, {BUFF_NOUSED} }
@@ -392,6 +395,40 @@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
proto_hdr_tcp}
};
+struct virtchnl_proto_hdrs ipv4_l2tpv2_tmplt = {
+ TUNNEL_LEVEL_OUTER, 4,
+ {proto_hdr_eth,
+ proto_hdr_ipv4,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2}
+};
+
+struct virtchnl_proto_hdrs ipv6_l2tpv2_tmplt = {
+ TUNNEL_LEVEL_OUTER, 4,
+ {proto_hdr_eth,
+ proto_hdr_ipv6,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2}
+};
+
+struct virtchnl_proto_hdrs ipv4_l2tpv2_ppp_tmplt = {
+ TUNNEL_LEVEL_OUTER, 5,
+ {proto_hdr_eth,
+ proto_hdr_ipv4,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2,
+ proto_hdr_ppp}
+};
+
+struct virtchnl_proto_hdrs ipv6_l2tpv2_ppp_tmplt = {
+ TUNNEL_LEVEL_OUTER, 5,
+ {proto_hdr_eth,
+ proto_hdr_ipv6,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2,
+ proto_hdr_ppp}
+};
+
/* rss type super set */
/* IPv4 outer */
@@ -480,6 +517,11 @@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
#define IAVF_RSS_TYPE_IPV4_PFCP (RTE_ETH_RSS_PFCP | RTE_ETH_RSS_IPV4)
#define IAVF_RSS_TYPE_IPV6_PFCP (RTE_ETH_RSS_PFCP | RTE_ETH_RSS_IPV6)
+/* L2TPv2 */
+#define IAVF_RSS_TYPE_ETH_L2TPV2 (RTE_ETH_RSS_L2TPV2 | \
+ RTE_ETH_RSS_ETH | \
+ RTE_ETH_RSS_L2_SRC_ONLY)
+
/**
* Supported pattern for hash.
* The first member is pattern item type,
@@ -547,6 +589,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
{iavf_pattern_eth_ipv6_gre_ipv4_tcp, IAVF_RSS_TYPE_INNER_IPV4_TCP, &inner_ipv4_tcp_tmplt},
{iavf_pattern_eth_ipv4_gre_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
{iavf_pattern_eth_ipv6_gre_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_tmplt},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_ppp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4, IAVF_RSS_TYPE_INNER_IPV4, &udp_l2tpv2_ppp_ipv4_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &udp_l2tpv2_ppp_ipv4_udp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp, IAVF_RSS_TYPE_INNER_IPV4_TCP, &udp_l2tpv2_ppp_ipv4_tcp_tmplt},
@@ -614,6 +658,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
{iavf_pattern_eth_ipv6_gre_ipv6_tcp, IAVF_RSS_TYPE_INNER_IPV6_TCP, &inner_ipv6_tcp_tmplt},
{iavf_pattern_eth_ipv4_gre_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
{iavf_pattern_eth_ipv6_gre_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_tmplt},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_ppp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6, IAVF_RSS_TYPE_INNER_IPV6, &udp_l2tpv2_ppp_ipv6_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &udp_l2tpv2_ppp_ipv6_udp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp, IAVF_RSS_TYPE_INNER_IPV6_TCP, &udp_l2tpv2_ppp_ipv6_tcp_tmplt},
@@ -744,6 +790,8 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
const struct rte_flow_item_gtp_psc *psc;
const struct rte_flow_item_ecpri *ecpri;
struct rte_ecpri_common_hdr ecpri_common;
+ const struct rte_flow_item_l2tpv2 *l2tpv2;
+ uint16_t flags_version;
for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
if (item->last) {
@@ -802,7 +850,18 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
*phint |= IAVF_PHINT_GRE;
break;
case RTE_FLOW_ITEM_TYPE_L2TPV2:
- *phint |= IAVF_PHINT_L2TPV2;
+ l2tpv2 = item->spec;
+
+ if (l2tpv2) {
+ flags_version = rte_be_to_cpu_16(
+ l2tpv2->hdr.common.flags_version);
+ if (flags_version & IAVF_L2TPV2_FLAGS_LEN)
+ *phint |= IAVF_PHINT_L2TPV2_LEN;
+ else
+ *phint |= IAVF_PHINT_L2TPV2;
+ } else {
+ *phint |= IAVF_PHINT_L2TPV2;
+ }
break;
default:
break;
@@ -1024,6 +1083,10 @@ iavf_refine_proto_hdrs_l234(struct virtchnl_proto_hdrs *proto_hdrs,
if (!(rss_type & RTE_ETH_RSS_ECPRI))
hdr->field_selector = 0;
break;
+ case VIRTCHNL_PROTO_HDR_L2TPV2:
+ if (!(rss_type & RTE_ETH_RSS_L2TPV2))
+ hdr->field_selector = 0;
+ break;
default:
break;
}
@@ -1130,10 +1193,10 @@ static void
iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
uint64_t phint)
{
- struct virtchnl_proto_hdr *hdr1;
+ struct virtchnl_proto_hdr *hdr, *hdr1;
int i;
- if (!(phint & IAVF_PHINT_L2TPV2))
+ if (!(phint & IAVF_PHINT_L2TPV2) && !(phint & IAVF_PHINT_L2TPV2_LEN))
return;
if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) {
@@ -1150,7 +1213,19 @@ iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4);
else if (phint & IAVF_PHINT_OUTER_IPV6)
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV6);
+ } else {
+ for (i = 0; i < proto_hdrs->count; i++) {
+ hdr = &proto_hdrs->proto_hdr[i];
+ if (hdr->type == VIRTCHNL_PROTO_HDR_L2TPV2) {
+ if (phint & IAVF_PHINT_L2TPV2) {
+ REFINE_PROTO_FLD(DEL, L2TPV2_LEN_SESS_ID);
+ } else if (phint & IAVF_PHINT_L2TPV2_LEN) {
+ REFINE_PROTO_FLD(DEL, L2TPV2_SESS_ID);
+ }
+ }
+ }
}
+
}
static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v3 6/6] net/iavf: support L2TPv2 for AVF FDIR
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
` (4 preceding siblings ...)
2022-01-29 6:24 ` [PATCH v3 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
@ 2022-01-29 6:24 ` Jie Wang
2022-02-01 12:22 ` [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
7 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-01-29 6:24 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR
based on outer MAC src address and L2TPv2 session ID.
Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP
src/dst address and UDP/TCP src/dst port.
Patterns are listed below:
eth/ipv4(6)/udp/l2tpv2
eth/ipv4(6)/udp/l2tpv2/ppp
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/udp
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/tcp
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
doc/guides/rel_notes/release_22_03.rst | 8 +-
drivers/net/iavf/iavf_fdir.c | 174 +++++++++++++++++++++----
drivers/net/iavf/iavf_generic_flow.h | 4 +
3 files changed, 156 insertions(+), 30 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 0d1e4a0b61..5a73ccc14e 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -66,8 +66,12 @@ New Features
* **Updated Intel iavf driver.**
- Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
- based on outer MAC src address and L2TPv2 session ID.
+ * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+ based on outer MAC src address and L2TPv2 session ID.
+ * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
+ based on outer MAC src address and L2TPv2 session ID.
+ * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
+ src/dst address and UDP/TCP src/dst port.
Removed Items
diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index b63aaca91d..2583b899aa 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -168,6 +168,31 @@
IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
IAVF_INSET_TUN_UDP_DST_PORT)
+#define IAVF_FDIR_INSET_L2TPV2 (\
+ IAVF_INSET_SMAC | IAVF_INSET_L2TPV2)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 (\
+ IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 | IAVF_INSET_TUN_UDP_SRC_PORT | \
+ IAVF_INSET_TUN_UDP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 | IAVF_INSET_TUN_TCP_SRC_PORT | \
+ IAVF_INSET_TUN_TCP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 (\
+ IAVF_INSET_TUN_IPV6_SRC | IAVF_INSET_TUN_IPV6_DST)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
+ IAVF_INSET_TUN_UDP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 | IAVF_INSET_TUN_TCP_SRC_PORT | \
+ IAVF_INSET_TUN_TCP_DST_PORT)
+
static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
{iavf_pattern_ethertype, IAVF_FDIR_INSET_ETH, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv4, IAVF_FDIR_INSET_ETH_IPV4, IAVF_INSET_NONE},
@@ -275,6 +300,28 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
{iavf_pattern_eth_ipv6_gre_ipv6, IAVF_FDIR_INSET_GRE_IPV6, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv6_gre_ipv6_tcp, IAVF_FDIR_INSET_GRE_IPV6_TCP, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv6_gre_ipv6_udp, IAVF_FDIR_INSET_GRE_IPV6_UDP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv4_udp_l2tpv2, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv6_udp_l2tpv2, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP, IAVF_INSET_NONE},
};
static struct iavf_flow_parser iavf_fdir_parser;
@@ -694,6 +741,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
const struct rte_flow_item_pfcp *pfcp_spec, *pfcp_mask;
const struct rte_flow_item_ecpri *ecpri_spec, *ecpri_mask;
const struct rte_flow_item_gre *gre_spec, *gre_mask;
+ const struct rte_flow_item_l2tpv2 *l2tpv2_spec, *l2tpv2_mask;
+ const struct rte_flow_item_ppp *ppp_spec, *ppp_mask;
const struct rte_flow_item *item = pattern;
struct virtchnl_proto_hdr *hdr, *hdr1 = NULL;
struct rte_ecpri_common_hdr ecpri_common;
@@ -701,7 +750,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
enum rte_flow_item_type item_type;
enum rte_flow_item_type next_type;
uint8_t tun_inner = 0;
- uint16_t ether_type;
+ uint16_t ether_type, flags_version;
int layer = 0;
uint8_t ipv6_addr_mask[16] = {
@@ -739,37 +788,41 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (eth_spec && eth_mask) {
- if (!rte_is_zero_ether_addr(ð_mask->src) ||
- !rte_is_zero_ether_addr(ð_mask->dst)) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM, item,
- "Invalid MAC_addr mask.");
- return -rte_errno;
- }
- }
-
- if (eth_spec && eth_mask && eth_mask->type) {
- if (eth_mask->type != RTE_BE16(0xffff)) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM,
- item, "Invalid type mask.");
- return -rte_errno;
+ if (!rte_is_zero_ether_addr(ð_mask->dst)) {
+ input_set |= IAVF_INSET_DMAC;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1,
+ ETH,
+ DST);
+ } else if (!rte_is_zero_ether_addr(ð_mask->src)) {
+ input_set |= IAVF_INSET_SMAC;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1,
+ ETH,
+ SRC);
}
- ether_type = rte_be_to_cpu_16(eth_spec->type);
- if (ether_type == RTE_ETHER_TYPE_IPV4 ||
- ether_type == RTE_ETHER_TYPE_IPV6) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM,
- item,
- "Unsupported ether_type.");
- return -rte_errno;
+ if (eth_mask->type) {
+ if (eth_mask->type != RTE_BE16(0xffff)) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item, "Invalid type mask.");
+ return -rte_errno;
+ }
+
+ ether_type = rte_be_to_cpu_16(eth_spec->type);
+ if (ether_type == RTE_ETHER_TYPE_IPV4 ||
+ ether_type == RTE_ETHER_TYPE_IPV6) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Unsupported ether_type.");
+ return -rte_errno;
+ }
+
+ input_set |= IAVF_INSET_ETHERTYPE;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
+ ETHERTYPE);
}
- input_set |= IAVF_INSET_ETHERTYPE;
- VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
- ETHERTYPE);
-
rte_memcpy(hdr1->buffer, eth_spec,
sizeof(struct rte_ether_hdr));
}
@@ -1319,6 +1372,71 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
hdrs->count = ++layer;
break;
+ case RTE_FLOW_ITEM_TYPE_L2TPV2:
+ l2tpv2_spec = item->spec;
+ l2tpv2_mask = item->mask;
+
+ hdr = &hdrs->proto_hdr[layer];
+
+ VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, L2TPV2);
+
+ if (l2tpv2_spec && l2tpv2_mask) {
+ flags_version =
+ rte_be_to_cpu_16(l2tpv2_spec->hdr.common.flags_version);
+ if ((flags_version == RTE_L2TPV2_MSG_TYPE_CONTROL &&
+ l2tpv2_mask->hdr.type3.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA &&
+ l2tpv2_mask->hdr.type7.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L &&
+ l2tpv2_mask->hdr.type6.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_S &&
+ l2tpv2_mask->hdr.type5.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_O &&
+ l2tpv2_mask->hdr.type4.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_S &&
+ l2tpv2_mask->hdr.type3.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_O &&
+ l2tpv2_mask->hdr.type2.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_S_O &&
+ l2tpv2_mask->hdr.type1.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_S_O &&
+ l2tpv2_mask->hdr.type0.session_id == UINT16_MAX)) {
+ input_set |= IAVF_L2TPV2_SESSION_ID;
+ if (flags_version & IAVF_L2TPV2_FLAGS_LEN)
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr,
+ L2TPV2,
+ LEN_SESS_ID);
+ else
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr,
+ L2TPV2,
+ SESS_ID);
+ }
+
+ rte_memcpy(hdr->buffer, l2tpv2_spec,
+ sizeof(*l2tpv2_spec));
+ }
+
+ tun_inner = 1;
+
+ hdrs->count = ++layer;
+ break;
+
+ case RTE_FLOW_ITEM_TYPE_PPP:
+ ppp_spec = item->spec;
+ ppp_mask = item->mask;
+
+ hdr = &hdrs->proto_hdr[layer];
+
+ VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, PPP);
+
+ if (ppp_spec && ppp_mask) {
+ rte_memcpy(hdr->buffer, ppp_spec,
+ sizeof(*ppp_spec));
+ }
+
+ hdrs->count = ++layer;
+ break;
+
case RTE_FLOW_ITEM_TYPE_VOID:
break;
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index 107bbc1a23..f6af176073 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -35,6 +35,7 @@
#define IAVF_PROT_L2TPV3OIP (1ULL << 24)
#define IAVF_PROT_PFCP (1ULL << 25)
#define IAVF_PROT_ECPRI (1ULL << 26)
+#define IAVF_PROT_L2TPV2 (1ULL << 27)
/* field */
@@ -62,6 +63,7 @@
#define IAVF_PFCP_SEID (1ULL << 43)
#define IAVF_ECPRI_PC_RTC_ID (1ULL << 42)
#define IAVF_IP_PKID (1ULL << 41)
+#define IAVF_L2TPV2_SESSION_ID (1ULL << 40)
/* input set */
@@ -175,6 +177,8 @@
(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
#define IAVF_INSET_ECPRI \
(IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
+#define IAVF_INSET_L2TPV2 \
+ (IAVF_PROT_L2TPV2 | IAVF_L2TPV2_SESSION_ID)
/* empty pattern */
extern enum rte_flow_item_type iavf_pattern_empty[];
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type
2022-01-29 6:24 ` [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
@ 2022-01-30 9:15 ` Ori Kam
2022-02-01 12:19 ` Ferruh Yigit
1 sibling, 0 replies; 41+ messages in thread
From: Ori Kam @ 2022-01-30 9:15 UTC (permalink / raw)
To: 20220126063016.2384393-1-jie1x.wang, dev
Cc: stevex.yang, aman.deep.singh, ferruh.yigit,
NBU-Contact-Thomas Monjalon (EXTERNAL),
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz
Hi Jie,
> -----Original Message-----
> From: Jie Wang <jie1x.wang@intel.com>
> Sent: Saturday, January 29, 2022 8:24 AM
> Subject: [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type
>
> This patch defines new RSS offload type for L2TPv2, which
> is required when users want to distribute packets based on
> the L2TPv2 session ID field.
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> ---
> app/test-pmd/cmdline.c | 10 ++++++----
> app/test-pmd/config.c | 3 ++-
> doc/guides/rel_notes/release_22_03.rst | 5 +++++
> lib/ethdev/rte_ethdev.h | 7 +++++++
> 4 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index e626b1c7d9..d535311f21 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
> RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
> RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
> RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
> - RTE_ETH_RSS_ECPRI;
> + RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
> else if (!strcmp(res->value, "eth"))
> rss_conf.rss_hf = RTE_ETH_RSS_ETH;
> else if (!strcmp(res->value, "vlan"))
> @@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
> rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
> } else if (!strcmp(res->value, "default"))
> use_default = 1;
> + else if (!strcmp(res->value, "l2tpv2"))
> + rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
> else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
> atoi(res->value) < 64)
> rss_conf.rss_hf = 1ULL << atoi(res->value);
> @@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
> .help_str = "port config all rss "
> "all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
> "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
> - "level-outer|level-inner|ipv4-chksum|<flowtype_id>",
> + "level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
> .tokens = {
> (void *)&cmd_config_rss_port,
> (void *)&cmd_config_rss_keyword,
> @@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
> "ipv6-tcp-ex#ipv6-udp-ex#"
> "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
> "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
> - "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
> + "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
> cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
> TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
>
> @@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
> "l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
> "l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
> "l2-src-only|l2-dst-only|s-vlan|c-vlan|"
> - "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
> + "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
> "<string of hex digits (variable length, NIC dependent)>",
> .tokens = {
> (void *)&cmd_config_rss_hash_key_port,
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 1722d6c8f8..ec922bd304 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
> { "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
> RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
> RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP
> |
> - RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
> + RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS |
> RTE_ETH_RSS_L2TPV2},
> { "none", 0 },
> { "eth", RTE_ETH_RSS_ETH },
> { "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
> @@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
> { "mpls", RTE_ETH_RSS_MPLS },
> { "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
> { "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
> + { "l2tpv2", RTE_ETH_RSS_L2TPV2 },
> { NULL, 0 },
> };
>
> diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
> index 33be3241b9..9a507ab9ea 100644
> --- a/doc/guides/rel_notes/release_22_03.rst
> +++ b/doc/guides/rel_notes/release_22_03.rst
> @@ -55,6 +55,11 @@ New Features
> Also, make sure to start the actual text at the margin.
> =======================================================
>
> +* **Added new RSS offload types for L2TPv2 in RSS flow.**
> +
> + Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
> + input set for RSS.
> +
> * **Updated Cisco enic driver.**
>
> * Added rte_flow support for matching GENEVE packets.
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 147cc1ced3..29e6091bc8 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -651,6 +651,13 @@ struct rte_eth_rss_conf {
> #define RTE_ETH_RSS_L4_CHKSUM RTE_BIT64(35)
> #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
>
> +/*
> + * Below macro is defined for RSS offload type, it can be used to
> + * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
> + */
> +#define RTE_ETH_RSS_L2TPV2 RTE_BIT64(36)
> +#define ETH_RSS_L2TPV2 RTE_ETH_RSS_L2TPV2
> +
> /*
> * We use the following macros to combine with above RTE_ETH_RSS_* for
> * more specific input set selection. These bits are defined starting
> --
> 2.25.1
Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v3 2/6] net: fix L2TPv2 common header
2022-01-29 6:24 ` [PATCH v3 2/6] net: fix L2TPv2 common header Jie Wang
@ 2022-01-30 9:17 ` Ori Kam
2022-02-01 12:20 ` Ferruh Yigit
0 siblings, 1 reply; 41+ messages in thread
From: Ori Kam @ 2022-01-30 9:17 UTC (permalink / raw)
To: 20220126063016.2384393-1-jie1x.wang, dev
Cc: stevex.yang, aman.deep.singh, ferruh.yigit,
NBU-Contact-Thomas Monjalon (EXTERNAL),
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, stable
> -----Original Message-----
> From: Jie Wang <jie1x.wang@intel.com>
> Sent: Saturday, January 29, 2022 8:25 AM
> To: dev@dpdk.org
> Cc: stevex.yang@intel.com; Ori Kam <orika@nvidia.com>; aman.deep.singh@intel.com;
> ferruh.yigit@intel.com; NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> andrew.rybchenko@oktetlabs.ru; jingjing.wu@intel.com; beilei.xing@intel.com;
> qi.z.zhang@intel.com; olivier.matz@6wind.com; Jie Wang <jie1x.wang@intel.com>; stable@dpdk.org
> Subject: [PATCH v3 2/6] net: fix L2TPv2 common header
>
> The fields of L2TPv2 common header were reversed in big endian and
> little endian.
>
> This patch fixes this error to ensure L2TPv2 can be parsed correctly.
>
> Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
> Cc: stable@dpdk.org
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> ---
> lib/net/rte_l2tpv2.h | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
> index 938a993b48..1f3ad3f03c 100644
> --- a/lib/net/rte_l2tpv2.h
> +++ b/lib/net/rte_l2tpv2.h
> @@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
> __extension__
> struct {
> #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
> - uint16_t t:1; /**< message Type */
> - uint16_t l:1; /**< length option bit */
> - uint16_t res1:2; /**< reserved */
> - uint16_t s:1; /**< ns/nr option bit */
> - uint16_t res2:1; /**< reserved */
> - uint16_t o:1; /**< offset option bit */
> - uint16_t p:1; /**< priority option bit */
> - uint16_t res3:4; /**< reserved */
> - uint16_t ver:4; /**< protocol version */
> -#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
> uint16_t ver:4; /**< protocol version */
> uint16_t res3:4; /**< reserved */
> uint16_t p:1; /**< priority option bit */
> @@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
> uint16_t res1:2; /**< reserved */
> uint16_t l:1; /**< length option bit */
> uint16_t t:1; /**< message Type */
> +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
> + uint16_t t:1; /**< message Type */
> + uint16_t l:1; /**< length option bit */
> + uint16_t res1:2; /**< reserved */
> + uint16_t s:1; /**< ns/nr option bit */
> + uint16_t res2:1; /**< reserved */
> + uint16_t o:1; /**< offset option bit */
> + uint16_t p:1; /**< priority option bit */
> + uint16_t res3:4; /**< reserved */
> + uint16_t ver:4; /**< protocol version */
> #endif
> };
> };
> --
> 2.25.1
Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message
2022-01-29 6:24 ` [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
@ 2022-01-30 9:19 ` Ori Kam
0 siblings, 0 replies; 41+ messages in thread
From: Ori Kam @ 2022-01-30 9:19 UTC (permalink / raw)
To: Wang, Jie1X, dev
Cc: stevex.yang, aman.deep.singh, ferruh.yigit,
NBU-Contact-Thomas Monjalon (EXTERNAL),
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz
> -----Original Message-----
> From: Jie Wang <jie1x.wang@intel.com>
> Sent: Saturday, January 29, 2022 8:25 AM
> Subject: [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message
>
> This patch adds L2TPv2 control message and 5 types of data message
> support for testpmd.
>
> The added L2TPv2 message types are listed below:
> 1. L2TPv2 control
> 2. L2TPv2
> 3. L2TPv2 + length option
> 4. L2TPv2 + sequence option
> 5. L2TPv2 + offset option
> 6. L2TPv2 + length option + sequence option
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> ---
Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type
2022-01-29 6:24 ` [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-01-30 9:15 ` Ori Kam
@ 2022-02-01 12:19 ` Ferruh Yigit
1 sibling, 0 replies; 41+ messages in thread
From: Ferruh Yigit @ 2022-02-01 12:19 UTC (permalink / raw)
To: 20220126063016.2384393-1-jie1x.wang, dev
Cc: stevex.yang, orika, aman.deep.singh, thomas, andrew.rybchenko,
jingjing.wu, beilei.xing, qi.z.zhang, olivier.matz, Jie Wang
On 1/29/2022 6:24 AM, Jie Wang wrote:
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 147cc1ced3..29e6091bc8 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -651,6 +651,13 @@ struct rte_eth_rss_conf {
> #define RTE_ETH_RSS_L4_CHKSUM RTE_BIT64(35)
> #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
>
> +/*
> + * Below macro is defined for RSS offload type, it can be used to
> + * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
> + */
> +#define RTE_ETH_RSS_L2TPV2 RTE_BIT64(36)
> +#define ETH_RSS_L2TPV2 RTE_ETH_RSS_L2TPV2
Perhaps I wasn't clear, don't have 'ETH_RSS_L2TPV2' at all.
Old macros were missing 'RTE_' prefix, so new ones added with prefix,
and old ones marked as deprecated.
When you are adding a new macro that already starts with 'RTE_' prefix
no need to add old/deprecated style of macro.
Please keep existing acks in next version of the patch.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 2/6] net: fix L2TPv2 common header
2022-01-30 9:17 ` Ori Kam
@ 2022-02-01 12:20 ` Ferruh Yigit
0 siblings, 0 replies; 41+ messages in thread
From: Ferruh Yigit @ 2022-02-01 12:20 UTC (permalink / raw)
To: Ori Kam, 20220126063016.2384393-1-jie1x.wang, dev
Cc: stevex.yang, aman.deep.singh,
NBU-Contact-Thomas Monjalon (EXTERNAL),
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, stable
On 1/30/2022 9:17 AM, Ori Kam wrote:
>
>
>> -----Original Message-----
>> From: Jie Wang <jie1x.wang@intel.com>
>> Sent: Saturday, January 29, 2022 8:25 AM
>> To: dev@dpdk.org
>> Cc: stevex.yang@intel.com; Ori Kam <orika@nvidia.com>; aman.deep.singh@intel.com;
>> ferruh.yigit@intel.com; NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
>> andrew.rybchenko@oktetlabs.ru; jingjing.wu@intel.com; beilei.xing@intel.com;
>> qi.z.zhang@intel.com; olivier.matz@6wind.com; Jie Wang <jie1x.wang@intel.com>; stable@dpdk.org
>> Subject: [PATCH v3 2/6] net: fix L2TPv2 common header
>>
>> The fields of L2TPv2 common header were reversed in big endian and
>> little endian.
>>
>> This patch fixes this error to ensure L2TPv2 can be parsed correctly.
>>
>> Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
>> ---
>> lib/net/rte_l2tpv2.h | 20 ++++++++++----------
>> 1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
>> index 938a993b48..1f3ad3f03c 100644
>> --- a/lib/net/rte_l2tpv2.h
>> +++ b/lib/net/rte_l2tpv2.h
>> @@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
>> __extension__
>> struct {
>> #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
>> - uint16_t t:1; /**< message Type */
>> - uint16_t l:1; /**< length option bit */
>> - uint16_t res1:2; /**< reserved */
>> - uint16_t s:1; /**< ns/nr option bit */
>> - uint16_t res2:1; /**< reserved */
>> - uint16_t o:1; /**< offset option bit */
>> - uint16_t p:1; /**< priority option bit */
>> - uint16_t res3:4; /**< reserved */
>> - uint16_t ver:4; /**< protocol version */
>> -#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
>> uint16_t ver:4; /**< protocol version */
>> uint16_t res3:4; /**< reserved */
>> uint16_t p:1; /**< priority option bit */
>> @@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
>> uint16_t res1:2; /**< reserved */
>> uint16_t l:1; /**< length option bit */
>> uint16_t t:1; /**< message Type */
>> +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
>> + uint16_t t:1; /**< message Type */
>> + uint16_t l:1; /**< length option bit */
>> + uint16_t res1:2; /**< reserved */
>> + uint16_t s:1; /**< ns/nr option bit */
>> + uint16_t res2:1; /**< reserved */
>> + uint16_t o:1; /**< offset option bit */
>> + uint16_t p:1; /**< priority option bit */
>> + uint16_t res3:4; /**< reserved */
>> + uint16_t ver:4; /**< protocol version */
>> #endif
>> };
>> };
>> --
>> 2.25.1
>
> Acked-by: Ori Kam <orika@nvidia.com>
>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
What do you think putting the link of the related RFC in the commit log
for reference: https://datatracker.ietf.org/doc/html/rfc2661#section-3.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
` (5 preceding siblings ...)
2022-01-29 6:24 ` [PATCH v3 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
@ 2022-02-01 12:22 ` Ferruh Yigit
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
7 siblings, 0 replies; 41+ messages in thread
From: Ferruh Yigit @ 2022-02-01 12:22 UTC (permalink / raw)
To: dev, jingjing.wu, beilei.xing
Cc: stevex.yang, orika, aman.deep.singh, thomas, andrew.rybchenko,
qi.z.zhang, olivier.matz, Jie Wang
On 1/29/2022 6:24 AM, Jie Wang wrote:
> Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow
> director. Required to distribute packets based on outer MAC src
> address and L2TPv2 session ID.
>
> Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute
> packets based on inner IP src+dest address and TCP/UDP src+dest port.
>
> ---
> v3:
> * update new macros in ethdev.
> * update commit log.
> * rebase the main branch code.
> v2:
> * upadte release notes.
> * add comment for RTE_ETH_RSS_L2TPV2.
> * update ipv6 l2tpv2 flow item.
> * rebase the main branch code.
>
> Jie Wang (6):
> ethdev: add L2TPv2 RSS offload type
> net: fix L2TPv2 common header
> app/testpmd: add 6 types of L2TPv2 message
> common/iavf: add session ID fields for L2TPv2
> net/iavf: support L2TPv2 for AVF HASH
> net/iavf: support L2TPv2 for AVF FDIR
>
Hi Jingjing, Beilei,
Can you please review the iavf patches, so we can proceed with the set?
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
` (6 preceding siblings ...)
2022-02-01 12:22 ` [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
@ 2022-02-08 8:38 ` Jie Wang
2022-02-08 8:38 ` [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
` (7 more replies)
7 siblings, 8 replies; 41+ messages in thread
From: Jie Wang @ 2022-02-08 8:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow
director. Required to distribute packets based on outer MAC src
address and L2TPv2 session ID.
Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute
packets based on inner IP src+dest address and TCP/UDP src+dest port.
---
v4:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.
Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR
app/test-pmd/cmdline.c | 10 +-
app/test-pmd/cmdline_flow.c | 313 +++++++++++++++++++++----
app/test-pmd/config.c | 3 +-
doc/guides/rel_notes/release_22_03.rst | 15 ++
drivers/common/iavf/virtchnl.h | 4 +
drivers/net/iavf/iavf.h | 2 +
drivers/net/iavf/iavf_fdir.c | 174 +++++++++++---
drivers/net/iavf/iavf_generic_flow.c | 34 +++
drivers/net/iavf/iavf_generic_flow.h | 10 +
drivers/net/iavf/iavf_hash.c | 83 ++++++-
lib/ethdev/rte_ethdev.h | 6 +
lib/net/rte_l2tpv2.h | 33 ++-
12 files changed, 589 insertions(+), 98 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
@ 2022-02-08 8:38 ` Jie Wang
2022-02-08 13:13 ` Ferruh Yigit
2022-02-08 8:38 ` [PATCH v4 2/6] net: fix L2TPv2 common header Jie Wang
` (6 subsequent siblings)
7 siblings, 1 reply; 41+ messages in thread
From: Jie Wang @ 2022-02-08 8:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
This patch defines new RSS offload type for L2TPv2, which
is required when users want to distribute packets based on
the L2TPv2 session ID field.
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
app/test-pmd/cmdline.c | 10 ++++++----
app/test-pmd/config.c | 3 ++-
doc/guides/rel_notes/release_22_03.rst | 5 +++++
lib/ethdev/rte_ethdev.h | 6 ++++++
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index e626b1c7d9..d535311f21 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
- RTE_ETH_RSS_ECPRI;
+ RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
else if (!strcmp(res->value, "eth"))
rss_conf.rss_hf = RTE_ETH_RSS_ETH;
else if (!strcmp(res->value, "vlan"))
@@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
} else if (!strcmp(res->value, "default"))
use_default = 1;
+ else if (!strcmp(res->value, "l2tpv2"))
+ rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
atoi(res->value) < 64)
rss_conf.rss_hf = 1ULL << atoi(res->value);
@@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
.help_str = "port config all rss "
"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
"nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
- "level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+ "level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
.tokens = {
(void *)&cmd_config_rss_port,
(void *)&cmd_config_rss_keyword,
@@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
"ipv6-tcp-ex#ipv6-udp-ex#"
"l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
"l2-src-only#l2-dst-only#s-vlan#c-vlan#"
- "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
+ "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
@@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
- "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+ "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
"<string of hex digits (variable length, NIC dependent)>",
.tokens = {
(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1722d6c8f8..ec922bd304 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
{ "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
- RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+ RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
{ "none", 0 },
{ "eth", RTE_ETH_RSS_ETH },
{ "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
{ "mpls", RTE_ETH_RSS_MPLS },
{ "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
{ "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+ { "l2tpv2", RTE_ETH_RSS_L2TPV2 },
{ NULL, 0 },
};
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 33be3241b9..9a507ab9ea 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -55,6 +55,11 @@ New Features
Also, make sure to start the actual text at the margin.
=======================================================
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+ Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+ input set for RSS.
+
* **Updated Cisco enic driver.**
* Added rte_flow support for matching GENEVE packets.
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 147cc1ced3..b7e78618c8 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -651,6 +651,12 @@ struct rte_eth_rss_conf {
#define RTE_ETH_RSS_L4_CHKSUM RTE_BIT64(35)
#define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
+/*
+ * Below macro is defined for RSS offload type, it can be used to
+ * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
+ */
+#define RTE_ETH_RSS_L2TPV2 RTE_BIT64(36)
+
/*
* We use the following macros to combine with above RTE_ETH_RSS_* for
* more specific input set selection. These bits are defined starting
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v4 2/6] net: fix L2TPv2 common header
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
2022-02-08 8:38 ` [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
@ 2022-02-08 8:38 ` Jie Wang
2022-02-08 8:38 ` [PATCH v4 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
` (5 subsequent siblings)
7 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-02-08 8:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang, stable
The fields of L2TPv2 common header were reversed in big endian and
little endian.
This patch fixes this error to ensure L2TPv2 can be parsed correctly.
For L2TP reference:
https://datatracker.ietf.org/doc/html/rfc2661#section-3.1
Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
Cc: stable@dpdk.org
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/net/rte_l2tpv2.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 938a993b48..1f3ad3f03c 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
__extension__
struct {
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
- uint16_t t:1; /**< message Type */
- uint16_t l:1; /**< length option bit */
- uint16_t res1:2; /**< reserved */
- uint16_t s:1; /**< ns/nr option bit */
- uint16_t res2:1; /**< reserved */
- uint16_t o:1; /**< offset option bit */
- uint16_t p:1; /**< priority option bit */
- uint16_t res3:4; /**< reserved */
- uint16_t ver:4; /**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
uint16_t ver:4; /**< protocol version */
uint16_t res3:4; /**< reserved */
uint16_t p:1; /**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
uint16_t res1:2; /**< reserved */
uint16_t l:1; /**< length option bit */
uint16_t t:1; /**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+ uint16_t t:1; /**< message Type */
+ uint16_t l:1; /**< length option bit */
+ uint16_t res1:2; /**< reserved */
+ uint16_t s:1; /**< ns/nr option bit */
+ uint16_t res2:1; /**< reserved */
+ uint16_t o:1; /**< offset option bit */
+ uint16_t p:1; /**< priority option bit */
+ uint16_t res3:4; /**< reserved */
+ uint16_t ver:4; /**< protocol version */
#endif
};
};
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v4 3/6] app/testpmd: add 6 types of L2TPv2 message
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
2022-02-08 8:38 ` [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-02-08 8:38 ` [PATCH v4 2/6] net: fix L2TPv2 common header Jie Wang
@ 2022-02-08 8:38 ` Jie Wang
2022-02-08 8:38 ` [PATCH v4 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
` (4 subsequent siblings)
7 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-02-08 8:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
This patch adds L2TPv2 control message and 5 types of data message
support for testpmd.
The added L2TPv2 message types are listed below:
1. L2TPv2 control
2. L2TPv2
3. L2TPv2 + length option
4. L2TPv2 + sequence option
5. L2TPv2 + offset option
6. L2TPv2 + length option + sequence option
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
app/test-pmd/cmdline_flow.c | 313 ++++++++++++++++++++++++++++++------
lib/net/rte_l2tpv2.h | 13 ++
2 files changed, 275 insertions(+), 51 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index bbaf18d76e..4e2ed3d6a3 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -322,13 +322,30 @@ enum index {
ITEM_FLEX_ITEM_HANDLE,
ITEM_FLEX_PATTERN_HANDLE,
ITEM_L2TPV2,
- ITEM_L2TPV2_COMMON,
- ITEM_L2TPV2_COMMON_TYPE,
- ITEM_L2TPV2_COMMON_TYPE_DATA_L,
- ITEM_L2TPV2_COMMON_TYPE_CTRL,
+ ITEM_L2TPV2_TYPE,
+ ITEM_L2TPV2_TYPE_DATA,
+ ITEM_L2TPV2_TYPE_DATA_L,
+ ITEM_L2TPV2_TYPE_DATA_S,
+ ITEM_L2TPV2_TYPE_DATA_O,
+ ITEM_L2TPV2_TYPE_DATA_L_S,
+ ITEM_L2TPV2_TYPE_CTRL,
+ ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_SESSION_ID,
ITEM_L2TPV2_MSG_DATA_L_LENGTH,
ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_NS,
+ ITEM_L2TPV2_MSG_DATA_S_NR,
+ ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+ ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_NS,
+ ITEM_L2TPV2_MSG_DATA_L_S_NR,
ITEM_L2TPV2_MSG_CTRL_LENGTH,
ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
@@ -1449,19 +1466,70 @@ static const enum index item_flex[] = {
};
static const enum index item_l2tpv2[] = {
- ITEM_L2TPV2_COMMON,
+ ITEM_L2TPV2_TYPE,
ITEM_NEXT,
ZERO,
};
-static const enum index item_l2tpv2_common[] = {
- ITEM_L2TPV2_COMMON_TYPE,
+static const enum index item_l2tpv2_type[] = {
+ ITEM_L2TPV2_TYPE_DATA,
+ ITEM_L2TPV2_TYPE_DATA_L,
+ ITEM_L2TPV2_TYPE_DATA_S,
+ ITEM_L2TPV2_TYPE_DATA_O,
+ ITEM_L2TPV2_TYPE_DATA_L_S,
+ ITEM_L2TPV2_TYPE_CTRL,
ZERO,
};
-static const enum index item_l2tpv2_common_type[] = {
- ITEM_L2TPV2_COMMON_TYPE_DATA_L,
- ITEM_L2TPV2_COMMON_TYPE_CTRL,
+static const enum index item_l2tpv2_type_data[] = {
+ ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_SESSION_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l[] = {
+ ITEM_L2TPV2_MSG_DATA_L_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_s[] = {
+ ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_NS,
+ ITEM_L2TPV2_MSG_DATA_S_NR,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_o[] = {
+ ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l_s[] = {
+ ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_NS,
+ ITEM_L2TPV2_MSG_DATA_L_S_NR,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_ctrl[] = {
+ ITEM_L2TPV2_MSG_CTRL_LENGTH,
+ ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
+ ITEM_L2TPV2_MSG_CTRL_NS,
+ ITEM_L2TPV2_MSG_CTRL_NR,
+ ITEM_NEXT,
ZERO,
};
@@ -3843,31 +3911,46 @@ static const struct token token_list[] = {
.next = NEXT(item_l2tpv2),
.call = parse_vc,
},
- [ITEM_L2TPV2_COMMON] = {
- .name = "common",
- .help = "L2TPv2 common header",
- .next = NEXT(item_l2tpv2_common),
- },
- [ITEM_L2TPV2_COMMON_TYPE] = {
+ [ITEM_L2TPV2_TYPE] = {
.name = "type",
- .help = "type of common header",
- .next = NEXT(item_l2tpv2_common_type),
+ .help = "type of l2tpv2",
+ .next = NEXT(item_l2tpv2_type),
.args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)),
},
- [ITEM_L2TPV2_COMMON_TYPE_DATA_L] = {
+ [ITEM_L2TPV2_TYPE_DATA] = {
+ .name = "data",
+ .help = "Type #7: data message without any options",
+ .next = NEXT(item_l2tpv2_type_data),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type7.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type7.session_id)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_L] = {
.name = "data_l",
.help = "Type #6: data message with length option",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
- ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
- ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
- ITEM_NEXT)),
+ .next = NEXT(item_l2tpv2_type_data_l),
.call = parse_vc_item_l2tpv2_type,
},
[ITEM_L2TPV2_MSG_DATA_L_LENGTH] = {
.name = "length",
.help = "message length",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3876,8 +3959,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] = {
.name = "tunnel_id",
.help = "tunnel identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3886,29 +3968,150 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] = {
.name = "session_id",
.help = "session identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
hdr.type6.session_id)),
},
- [ITEM_L2TPV2_COMMON_TYPE_CTRL] = {
+ [ITEM_L2TPV2_TYPE_DATA_S] = {
+ .name = "data_s",
+ .help = "Type #5: data message with ns, nr option",
+ .next = NEXT(item_l2tpv2_type_data_s),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_NS] = {
+ .name = "ns",
+ .help = "sequence number for message",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.ns)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_NR] = {
+ .name = "nr",
+ .help = "sequence number for next receive message",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.nr)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_O] = {
+ .name = "data_o",
+ .help = "Type #4: data message with offset option",
+ .next = NEXT(item_l2tpv2_type_data_o),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type4.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_OFFSET] = {
+ .name = "offset_size",
+ .help = "the size of offset padding",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type4.offset_size)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_L_S] = {
+ .name = "data_l_s",
+ .help = "Type #3: data message contains length, ns, nr "
+ "options",
+ .next = NEXT(item_l2tpv2_type_data_l_s),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_LENGTH] = {
+ .name = "length",
+ .help = "message length",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.length)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_NS] = {
+ .name = "ns",
+ .help = "sequence number for message",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.ns)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_NR] = {
+ .name = "nr",
+ .help = "sequence number for next receive message",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.nr)),
+ },
+ [ITEM_L2TPV2_TYPE_CTRL] = {
.name = "control",
- .help = "Type #3: conrtol message contains length, ns, nr options",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
- ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
- ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
- ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_MSG_CTRL_NR,
- ITEM_NEXT)),
+ .help = "Type #3: conrtol message contains length, ns, nr "
+ "options",
+ .next = NEXT(item_l2tpv2_type_ctrl),
.call = parse_vc_item_l2tpv2_type,
},
[ITEM_L2TPV2_MSG_CTRL_LENGTH] = {
.name = "length",
.help = "message length",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3917,8 +4120,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] = {
.name = "tunnel_id",
.help = "tunnel identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3927,8 +4129,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_SESSION_ID] = {
.name = "session_id",
.help = "session identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3937,8 +4138,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_NS] = {
.name = "ns",
.help = "sequence number for message",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3947,8 +4147,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_NR] = {
.name = "nr",
.help = "sequence number for next receive message",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -5889,11 +6088,23 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token,
if (parse_default(ctx, token, str, len, NULL, 0) < 0)
return -1;
switch (ctx->curr) {
- case ITEM_L2TPV2_COMMON_TYPE_DATA_L:
- msg_type |= 0x4000;
+ case ITEM_L2TPV2_TYPE_DATA:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_L:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_S:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_S;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_O:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_O;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_L_S:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L_S;
break;
- case ITEM_L2TPV2_COMMON_TYPE_CTRL:
- msg_type |= 0xC800;
+ case ITEM_L2TPV2_TYPE_CTRL:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_CONTROL;
break;
default:
return -1;
diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 1f3ad3f03c..d41123a504 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -78,6 +78,19 @@
extern "C" {
#endif
+/*
+ * L2TPv2 Message Type
+ */
+#define RTE_L2TPV2_MSG_TYPE_CONTROL 0xC802
+#define RTE_L2TPV2_MSG_TYPE_DATA 0x0002
+#define RTE_L2TPV2_MSG_TYPE_DATA_L 0x4002
+#define RTE_L2TPV2_MSG_TYPE_DATA_S 0x0802
+#define RTE_L2TPV2_MSG_TYPE_DATA_O 0x0202
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S 0x4802
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_O 0x4202
+#define RTE_L2TPV2_MSG_TYPE_DATA_S_O 0x0A02
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O 0x4A02
+
/**
* L2TPv2 Common Header
*/
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v4 4/6] common/iavf: add session ID fields for L2TPv2
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
` (2 preceding siblings ...)
2022-02-08 8:38 ` [PATCH v4 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
@ 2022-02-08 8:38 ` Jie Wang
2022-02-08 8:38 ` [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
` (3 subsequent siblings)
7 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-02-08 8:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add virtchnl fields session ID of L2TPv2 for AVF HASH.
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
drivers/common/iavf/virtchnl.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 80e754a1b2..3e44eca7d8 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -1653,6 +1653,10 @@ enum virtchnl_proto_hdr_field {
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN),
VIRTCHNL_PROTO_HDR_GTPU_UP_QFI =
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP),
+ /* L2TPv2 */
+ VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID =
+ PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_L2TPV2),
+ VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID,
};
struct virtchnl_proto_hdr {
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
` (3 preceding siblings ...)
2022-02-08 8:38 ` [PATCH v4 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
@ 2022-02-08 8:38 ` Jie Wang
2022-02-09 7:01 ` Xing, Beilei
2022-02-08 8:38 ` [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
` (2 subsequent siblings)
7 siblings, 1 reply; 41+ messages in thread
From: Jie Wang @ 2022-02-08 8:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add support for PPP over L2TPv2 over UDP protocol and L2TPv2
protocol RSS hash based on outer MAC src address and L2TPv2
session ID.
Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
doc/guides/rel_notes/release_22_03.rst | 6 ++
drivers/net/iavf/iavf.h | 2 +
drivers/net/iavf/iavf_generic_flow.c | 34 +++++++++++
drivers/net/iavf/iavf_generic_flow.h | 6 ++
drivers/net/iavf/iavf_hash.c | 83 ++++++++++++++++++++++++--
5 files changed, 127 insertions(+), 4 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 9a507ab9ea..0d1e4a0b61 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -64,6 +64,12 @@ New Features
* Added rte_flow support for matching GENEVE packets.
+* **Updated Intel iavf driver.**
+
+ Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+ based on outer MAC src address and L2TPv2 session ID.
+
+
Removed Items
-------------
diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 0bb5698583..a01d18e61b 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -93,6 +93,8 @@
#define IAVF_VLAN_TAG_PCP_OFFSET 13
+#define IAVF_L2TPV2_FLAGS_LEN 0x4000
+
struct iavf_adapter;
struct iavf_rx_queue;
struct iavf_tx_queue;
diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 2befa125ac..1de4187e67 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -1611,6 +1611,40 @@ enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
RTE_FLOW_ITEM_TYPE_END,
};
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_PPP,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV6,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV6,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_PPP,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
/* PPPoL2TPv2oUDP */
enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
RTE_FLOW_ITEM_TYPE_ETH,
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index 3681a96b31..107bbc1a23 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -410,6 +410,12 @@ extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_tcp[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[];
+/* L2TPv2 */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[];
+
/* PPPoL2TPv2oUDP */
extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6[];
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 5e0888ea68..f568239b71 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -36,6 +36,7 @@
#define IAVF_PHINT_MID_IPV6 BIT_ULL(8)
/* L2TPv2 */
#define IAVF_PHINT_L2TPV2 BIT_ULL(9)
+#define IAVF_PHINT_L2TPV2_LEN BIT_ULL(10)
#define IAVF_PHINT_GTPU_MSK (IAVF_PHINT_GTPU | \
IAVF_PHINT_GTPU_EH | \
@@ -167,7 +168,9 @@ iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID), {BUFF_NOUSED} }
#define proto_hdr_l2tpv2 { \
- VIRTCHNL_PROTO_HDR_L2TPV2, 0, {BUFF_NOUSED} }
+ VIRTCHNL_PROTO_HDR_L2TPV2, \
+ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID) | \
+ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID), {BUFF_NOUSED} }
#define proto_hdr_ppp { \
VIRTCHNL_PROTO_HDR_PPP, 0, {BUFF_NOUSED} }
@@ -392,6 +395,40 @@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
proto_hdr_tcp}
};
+struct virtchnl_proto_hdrs ipv4_l2tpv2_tmplt = {
+ TUNNEL_LEVEL_OUTER, 4,
+ {proto_hdr_eth,
+ proto_hdr_ipv4,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2}
+};
+
+struct virtchnl_proto_hdrs ipv6_l2tpv2_tmplt = {
+ TUNNEL_LEVEL_OUTER, 4,
+ {proto_hdr_eth,
+ proto_hdr_ipv6,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2}
+};
+
+struct virtchnl_proto_hdrs ipv4_l2tpv2_ppp_tmplt = {
+ TUNNEL_LEVEL_OUTER, 5,
+ {proto_hdr_eth,
+ proto_hdr_ipv4,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2,
+ proto_hdr_ppp}
+};
+
+struct virtchnl_proto_hdrs ipv6_l2tpv2_ppp_tmplt = {
+ TUNNEL_LEVEL_OUTER, 5,
+ {proto_hdr_eth,
+ proto_hdr_ipv6,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2,
+ proto_hdr_ppp}
+};
+
/* rss type super set */
/* IPv4 outer */
@@ -480,6 +517,11 @@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
#define IAVF_RSS_TYPE_IPV4_PFCP (RTE_ETH_RSS_PFCP | RTE_ETH_RSS_IPV4)
#define IAVF_RSS_TYPE_IPV6_PFCP (RTE_ETH_RSS_PFCP | RTE_ETH_RSS_IPV6)
+/* L2TPv2 */
+#define IAVF_RSS_TYPE_ETH_L2TPV2 (RTE_ETH_RSS_L2TPV2 | \
+ RTE_ETH_RSS_ETH | \
+ RTE_ETH_RSS_L2_SRC_ONLY)
+
/**
* Supported pattern for hash.
* The first member is pattern item type,
@@ -547,6 +589,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
{iavf_pattern_eth_ipv6_gre_ipv4_tcp, IAVF_RSS_TYPE_INNER_IPV4_TCP, &inner_ipv4_tcp_tmplt},
{iavf_pattern_eth_ipv4_gre_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
{iavf_pattern_eth_ipv6_gre_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_tmplt},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_ppp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4, IAVF_RSS_TYPE_INNER_IPV4, &udp_l2tpv2_ppp_ipv4_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &udp_l2tpv2_ppp_ipv4_udp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp, IAVF_RSS_TYPE_INNER_IPV4_TCP, &udp_l2tpv2_ppp_ipv4_tcp_tmplt},
@@ -614,6 +658,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
{iavf_pattern_eth_ipv6_gre_ipv6_tcp, IAVF_RSS_TYPE_INNER_IPV6_TCP, &inner_ipv6_tcp_tmplt},
{iavf_pattern_eth_ipv4_gre_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
{iavf_pattern_eth_ipv6_gre_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_tmplt},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_ppp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6, IAVF_RSS_TYPE_INNER_IPV6, &udp_l2tpv2_ppp_ipv6_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &udp_l2tpv2_ppp_ipv6_udp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp, IAVF_RSS_TYPE_INNER_IPV6_TCP, &udp_l2tpv2_ppp_ipv6_tcp_tmplt},
@@ -744,6 +790,8 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
const struct rte_flow_item_gtp_psc *psc;
const struct rte_flow_item_ecpri *ecpri;
struct rte_ecpri_common_hdr ecpri_common;
+ const struct rte_flow_item_l2tpv2 *l2tpv2;
+ uint16_t flags_version;
for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
if (item->last) {
@@ -802,7 +850,18 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
*phint |= IAVF_PHINT_GRE;
break;
case RTE_FLOW_ITEM_TYPE_L2TPV2:
- *phint |= IAVF_PHINT_L2TPV2;
+ l2tpv2 = item->spec;
+
+ if (l2tpv2) {
+ flags_version = rte_be_to_cpu_16(
+ l2tpv2->hdr.common.flags_version);
+ if (flags_version & IAVF_L2TPV2_FLAGS_LEN)
+ *phint |= IAVF_PHINT_L2TPV2_LEN;
+ else
+ *phint |= IAVF_PHINT_L2TPV2;
+ } else {
+ *phint |= IAVF_PHINT_L2TPV2;
+ }
break;
default:
break;
@@ -1024,6 +1083,10 @@ iavf_refine_proto_hdrs_l234(struct virtchnl_proto_hdrs *proto_hdrs,
if (!(rss_type & RTE_ETH_RSS_ECPRI))
hdr->field_selector = 0;
break;
+ case VIRTCHNL_PROTO_HDR_L2TPV2:
+ if (!(rss_type & RTE_ETH_RSS_L2TPV2))
+ hdr->field_selector = 0;
+ break;
default:
break;
}
@@ -1130,10 +1193,10 @@ static void
iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
uint64_t phint)
{
- struct virtchnl_proto_hdr *hdr1;
+ struct virtchnl_proto_hdr *hdr, *hdr1;
int i;
- if (!(phint & IAVF_PHINT_L2TPV2))
+ if (!(phint & IAVF_PHINT_L2TPV2) && !(phint & IAVF_PHINT_L2TPV2_LEN))
return;
if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) {
@@ -1150,7 +1213,19 @@ iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4);
else if (phint & IAVF_PHINT_OUTER_IPV6)
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV6);
+ } else {
+ for (i = 0; i < proto_hdrs->count; i++) {
+ hdr = &proto_hdrs->proto_hdr[i];
+ if (hdr->type == VIRTCHNL_PROTO_HDR_L2TPV2) {
+ if (phint & IAVF_PHINT_L2TPV2) {
+ REFINE_PROTO_FLD(DEL, L2TPV2_LEN_SESS_ID);
+ } else if (phint & IAVF_PHINT_L2TPV2_LEN) {
+ REFINE_PROTO_FLD(DEL, L2TPV2_SESS_ID);
+ }
+ }
+ }
}
+
}
static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
` (4 preceding siblings ...)
2022-02-08 8:38 ` [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
@ 2022-02-08 8:38 ` Jie Wang
2022-02-09 7:30 ` Xing, Beilei
2022-02-08 14:44 ` [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
7 siblings, 1 reply; 41+ messages in thread
From: Jie Wang @ 2022-02-08 8:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR
based on outer MAC src address and L2TPv2 session ID.
Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP
src/dst address and UDP/TCP src/dst port.
Patterns are listed below:
eth/ipv4(6)/udp/l2tpv2
eth/ipv4(6)/udp/l2tpv2/ppp
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/udp
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/tcp
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
doc/guides/rel_notes/release_22_03.rst | 8 +-
drivers/net/iavf/iavf_fdir.c | 174 +++++++++++++++++++++----
drivers/net/iavf/iavf_generic_flow.h | 4 +
3 files changed, 156 insertions(+), 30 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 0d1e4a0b61..5a73ccc14e 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -66,8 +66,12 @@ New Features
* **Updated Intel iavf driver.**
- Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
- based on outer MAC src address and L2TPv2 session ID.
+ * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+ based on outer MAC src address and L2TPv2 session ID.
+ * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
+ based on outer MAC src address and L2TPv2 session ID.
+ * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
+ src/dst address and UDP/TCP src/dst port.
Removed Items
diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index b63aaca91d..2583b899aa 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -168,6 +168,31 @@
IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
IAVF_INSET_TUN_UDP_DST_PORT)
+#define IAVF_FDIR_INSET_L2TPV2 (\
+ IAVF_INSET_SMAC | IAVF_INSET_L2TPV2)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 (\
+ IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 | IAVF_INSET_TUN_UDP_SRC_PORT | \
+ IAVF_INSET_TUN_UDP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 | IAVF_INSET_TUN_TCP_SRC_PORT | \
+ IAVF_INSET_TUN_TCP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 (\
+ IAVF_INSET_TUN_IPV6_SRC | IAVF_INSET_TUN_IPV6_DST)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
+ IAVF_INSET_TUN_UDP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 | IAVF_INSET_TUN_TCP_SRC_PORT | \
+ IAVF_INSET_TUN_TCP_DST_PORT)
+
static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
{iavf_pattern_ethertype, IAVF_FDIR_INSET_ETH, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv4, IAVF_FDIR_INSET_ETH_IPV4, IAVF_INSET_NONE},
@@ -275,6 +300,28 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
{iavf_pattern_eth_ipv6_gre_ipv6, IAVF_FDIR_INSET_GRE_IPV6, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv6_gre_ipv6_tcp, IAVF_FDIR_INSET_GRE_IPV6_TCP, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv6_gre_ipv6_udp, IAVF_FDIR_INSET_GRE_IPV6_UDP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv4_udp_l2tpv2, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv6_udp_l2tpv2, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP, IAVF_INSET_NONE},
};
static struct iavf_flow_parser iavf_fdir_parser;
@@ -694,6 +741,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
const struct rte_flow_item_pfcp *pfcp_spec, *pfcp_mask;
const struct rte_flow_item_ecpri *ecpri_spec, *ecpri_mask;
const struct rte_flow_item_gre *gre_spec, *gre_mask;
+ const struct rte_flow_item_l2tpv2 *l2tpv2_spec, *l2tpv2_mask;
+ const struct rte_flow_item_ppp *ppp_spec, *ppp_mask;
const struct rte_flow_item *item = pattern;
struct virtchnl_proto_hdr *hdr, *hdr1 = NULL;
struct rte_ecpri_common_hdr ecpri_common;
@@ -701,7 +750,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
enum rte_flow_item_type item_type;
enum rte_flow_item_type next_type;
uint8_t tun_inner = 0;
- uint16_t ether_type;
+ uint16_t ether_type, flags_version;
int layer = 0;
uint8_t ipv6_addr_mask[16] = {
@@ -739,37 +788,41 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (eth_spec && eth_mask) {
- if (!rte_is_zero_ether_addr(ð_mask->src) ||
- !rte_is_zero_ether_addr(ð_mask->dst)) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM, item,
- "Invalid MAC_addr mask.");
- return -rte_errno;
- }
- }
-
- if (eth_spec && eth_mask && eth_mask->type) {
- if (eth_mask->type != RTE_BE16(0xffff)) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM,
- item, "Invalid type mask.");
- return -rte_errno;
+ if (!rte_is_zero_ether_addr(ð_mask->dst)) {
+ input_set |= IAVF_INSET_DMAC;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1,
+ ETH,
+ DST);
+ } else if (!rte_is_zero_ether_addr(ð_mask->src)) {
+ input_set |= IAVF_INSET_SMAC;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1,
+ ETH,
+ SRC);
}
- ether_type = rte_be_to_cpu_16(eth_spec->type);
- if (ether_type == RTE_ETHER_TYPE_IPV4 ||
- ether_type == RTE_ETHER_TYPE_IPV6) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM,
- item,
- "Unsupported ether_type.");
- return -rte_errno;
+ if (eth_mask->type) {
+ if (eth_mask->type != RTE_BE16(0xffff)) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item, "Invalid type mask.");
+ return -rte_errno;
+ }
+
+ ether_type = rte_be_to_cpu_16(eth_spec->type);
+ if (ether_type == RTE_ETHER_TYPE_IPV4 ||
+ ether_type == RTE_ETHER_TYPE_IPV6) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Unsupported ether_type.");
+ return -rte_errno;
+ }
+
+ input_set |= IAVF_INSET_ETHERTYPE;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
+ ETHERTYPE);
}
- input_set |= IAVF_INSET_ETHERTYPE;
- VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
- ETHERTYPE);
-
rte_memcpy(hdr1->buffer, eth_spec,
sizeof(struct rte_ether_hdr));
}
@@ -1319,6 +1372,71 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
hdrs->count = ++layer;
break;
+ case RTE_FLOW_ITEM_TYPE_L2TPV2:
+ l2tpv2_spec = item->spec;
+ l2tpv2_mask = item->mask;
+
+ hdr = &hdrs->proto_hdr[layer];
+
+ VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, L2TPV2);
+
+ if (l2tpv2_spec && l2tpv2_mask) {
+ flags_version =
+ rte_be_to_cpu_16(l2tpv2_spec->hdr.common.flags_version);
+ if ((flags_version == RTE_L2TPV2_MSG_TYPE_CONTROL &&
+ l2tpv2_mask->hdr.type3.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA &&
+ l2tpv2_mask->hdr.type7.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L &&
+ l2tpv2_mask->hdr.type6.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_S &&
+ l2tpv2_mask->hdr.type5.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_O &&
+ l2tpv2_mask->hdr.type4.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_S &&
+ l2tpv2_mask->hdr.type3.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_O &&
+ l2tpv2_mask->hdr.type2.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_S_O &&
+ l2tpv2_mask->hdr.type1.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_S_O &&
+ l2tpv2_mask->hdr.type0.session_id == UINT16_MAX)) {
+ input_set |= IAVF_L2TPV2_SESSION_ID;
+ if (flags_version & IAVF_L2TPV2_FLAGS_LEN)
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr,
+ L2TPV2,
+ LEN_SESS_ID);
+ else
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr,
+ L2TPV2,
+ SESS_ID);
+ }
+
+ rte_memcpy(hdr->buffer, l2tpv2_spec,
+ sizeof(*l2tpv2_spec));
+ }
+
+ tun_inner = 1;
+
+ hdrs->count = ++layer;
+ break;
+
+ case RTE_FLOW_ITEM_TYPE_PPP:
+ ppp_spec = item->spec;
+ ppp_mask = item->mask;
+
+ hdr = &hdrs->proto_hdr[layer];
+
+ VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, PPP);
+
+ if (ppp_spec && ppp_mask) {
+ rte_memcpy(hdr->buffer, ppp_spec,
+ sizeof(*ppp_spec));
+ }
+
+ hdrs->count = ++layer;
+ break;
+
case RTE_FLOW_ITEM_TYPE_VOID:
break;
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index 107bbc1a23..f6af176073 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -35,6 +35,7 @@
#define IAVF_PROT_L2TPV3OIP (1ULL << 24)
#define IAVF_PROT_PFCP (1ULL << 25)
#define IAVF_PROT_ECPRI (1ULL << 26)
+#define IAVF_PROT_L2TPV2 (1ULL << 27)
/* field */
@@ -62,6 +63,7 @@
#define IAVF_PFCP_SEID (1ULL << 43)
#define IAVF_ECPRI_PC_RTC_ID (1ULL << 42)
#define IAVF_IP_PKID (1ULL << 41)
+#define IAVF_L2TPV2_SESSION_ID (1ULL << 40)
/* input set */
@@ -175,6 +177,8 @@
(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
#define IAVF_INSET_ECPRI \
(IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
+#define IAVF_INSET_L2TPV2 \
+ (IAVF_PROT_L2TPV2 | IAVF_L2TPV2_SESSION_ID)
/* empty pattern */
extern enum rte_flow_item_type iavf_pattern_empty[];
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type
2022-02-08 8:38 ` [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
@ 2022-02-08 13:13 ` Ferruh Yigit
2022-02-08 14:43 ` Ferruh Yigit
0 siblings, 1 reply; 41+ messages in thread
From: Ferruh Yigit @ 2022-02-08 13:13 UTC (permalink / raw)
To: Jie Wang, dev
Cc: stevex.yang, orika, aman.deep.singh, thomas, andrew.rybchenko,
jingjing.wu, beilei.xing, qi.z.zhang, olivier.matz
On 2/8/2022 8:38 AM, Jie Wang wrote:
> This patch defines new RSS offload type for L2TPv2, which
> is required when users want to distribute packets based on
> the L2TPv2 session ID field.
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> ---
> app/test-pmd/cmdline.c | 10 ++++++----
> app/test-pmd/config.c | 3 ++-
> doc/guides/rel_notes/release_22_03.rst | 5 +++++
> lib/ethdev/rte_ethdev.h | 6 ++++++
> 4 files changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index e626b1c7d9..d535311f21 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
> RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
> RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
> RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
> - RTE_ETH_RSS_ECPRI;
> + RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
> else if (!strcmp(res->value, "eth"))
> rss_conf.rss_hf = RTE_ETH_RSS_ETH;
> else if (!strcmp(res->value, "vlan"))
> @@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
> rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
> } else if (!strcmp(res->value, "default"))
> use_default = 1;
> + else if (!strcmp(res->value, "l2tpv2"))
> + rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
> else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
> atoi(res->value) < 64)
> rss_conf.rss_hf = 1ULL << atoi(res->value);
> @@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
> .help_str = "port config all rss "
> "all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
> "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
> - "level-outer|level-inner|ipv4-chksum|<flowtype_id>",
> + "level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
> .tokens = {
> (void *)&cmd_config_rss_port,
> (void *)&cmd_config_rss_keyword,
> @@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
> "ipv6-tcp-ex#ipv6-udp-ex#"
> "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
> "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
> - "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
> + "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
> cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
> TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
>
> @@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
> "l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
> "l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
> "l2-src-only|l2-dst-only|s-vlan|c-vlan|"
> - "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
> + "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
> "<string of hex digits (variable length, NIC dependent)>",
> .tokens = {
> (void *)&cmd_config_rss_hash_key_port,
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 1722d6c8f8..ec922bd304 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
> { "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
> RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
> RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
> - RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
> + RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
> { "none", 0 },
> { "eth", RTE_ETH_RSS_ETH },
> { "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
> @@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
> { "mpls", RTE_ETH_RSS_MPLS },
> { "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
> { "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
> + { "l2tpv2", RTE_ETH_RSS_L2TPV2 },
> { NULL, 0 },
> };
>
> diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
> index 33be3241b9..9a507ab9ea 100644
> --- a/doc/guides/rel_notes/release_22_03.rst
> +++ b/doc/guides/rel_notes/release_22_03.rst
> @@ -55,6 +55,11 @@ New Features
> Also, make sure to start the actual text at the margin.
> =======================================================
>
> +* **Added new RSS offload types for L2TPv2 in RSS flow.**
> +
> + Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
> + input set for RSS.
> +
> * **Updated Cisco enic driver.**
>
> * Added rte_flow support for matching GENEVE packets.
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 147cc1ced3..b7e78618c8 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -651,6 +651,12 @@ struct rte_eth_rss_conf {
> #define RTE_ETH_RSS_L4_CHKSUM RTE_BIT64(35)
> #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
>
> +/*
> + * Below macro is defined for RSS offload type, it can be used to
> + * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
> + */
Why this comment is duplicated here? (There is exact same above, and it is wrong to
have it here.)
If this is the only comment, I can remove it while merging.
> +#define RTE_ETH_RSS_L2TPV2 RTE_BIT64(36)
> +
> /*
> * We use the following macros to combine with above RTE_ETH_RSS_* for
> * more specific input set selection. These bits are defined starting
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type
2022-02-08 13:13 ` Ferruh Yigit
@ 2022-02-08 14:43 ` Ferruh Yigit
0 siblings, 0 replies; 41+ messages in thread
From: Ferruh Yigit @ 2022-02-08 14:43 UTC (permalink / raw)
To: Jie Wang, dev
Cc: stevex.yang, orika, aman.deep.singh, thomas, andrew.rybchenko,
jingjing.wu, beilei.xing, qi.z.zhang, olivier.matz
On 2/8/2022 1:13 PM, Ferruh Yigit wrote:
> On 2/8/2022 8:38 AM, Jie Wang wrote:
>> This patch defines new RSS offload type for L2TPv2, which
>> is required when users want to distribute packets based on
>> the L2TPv2 session ID field.
>>
>> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
>> ---
>> app/test-pmd/cmdline.c | 10 ++++++----
>> app/test-pmd/config.c | 3 ++-
>> doc/guides/rel_notes/release_22_03.rst | 5 +++++
>> lib/ethdev/rte_ethdev.h | 6 ++++++
>> 4 files changed, 19 insertions(+), 5 deletions(-)
>>
>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
>> index e626b1c7d9..d535311f21 100644
>> --- a/app/test-pmd/cmdline.c
>> +++ b/app/test-pmd/cmdline.c
>> @@ -2178,7 +2178,7 @@ cmd_config_rss_parsed(void *parsed_result,
>> RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
>> RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
>> RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
>> - RTE_ETH_RSS_ECPRI;
>> + RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
>> else if (!strcmp(res->value, "eth"))
>> rss_conf.rss_hf = RTE_ETH_RSS_ETH;
>> else if (!strcmp(res->value, "vlan"))
>> @@ -2256,6 +2256,8 @@ cmd_config_rss_parsed(void *parsed_result,
>> rss_conf.rss_hf = (rss_hf | RTE_ETH_RSS_LEVEL_INNERMOST);
>> } else if (!strcmp(res->value, "default"))
>> use_default = 1;
>> + else if (!strcmp(res->value, "l2tpv2"))
>> + rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
I think better to keep 'default' as last check, can you please add new one
above the 'default' check?
>> else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
>> atoi(res->value) < 64)
>> rss_conf.rss_hf = 1ULL << atoi(res->value);
>> @@ -2314,7 +2316,7 @@ cmdline_parse_inst_t cmd_config_rss = {
>> .help_str = "port config all rss "
>> "all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
>> "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
>> - "level-outer|level-inner|ipv4-chksum|<flowtype_id>",
>> + "level-outer|level-inner|ipv4-chksum|l2tpv2|<flowtype_id>",
Can you please update
- cmd_help_long_parsed() in same file
- documentation, doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> .tokens = {
>> (void *)&cmd_config_rss_port,
>> (void *)&cmd_config_rss_keyword,
>> @@ -2429,7 +2431,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
>> "ipv6-tcp-ex#ipv6-udp-ex#"
>> "l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
>> "l2-src-only#l2-dst-only#s-vlan#c-vlan#"
>> - "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
>> + "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
>> cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
>> TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
>> @@ -2442,7 +2444,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
>> "l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
>> "l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
>> "l2-src-only|l2-dst-only|s-vlan|c-vlan|"
>> - "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
>> + "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
Same for this command
>> "<string of hex digits (variable length, NIC dependent)>",
>> .tokens = {
>> (void *)&cmd_config_rss_hash_key_port,
>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
>> index 1722d6c8f8..ec922bd304 100644
>> --- a/app/test-pmd/config.c
>> +++ b/app/test-pmd/config.c
>> @@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
>> { "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
>> RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
>> RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
>> - RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
>> + RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
>> { "none", 0 },
>> { "eth", RTE_ETH_RSS_ETH },
>> { "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
>> @@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
>> { "mpls", RTE_ETH_RSS_MPLS },
>> { "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
>> { "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
>> + { "l2tpv2", RTE_ETH_RSS_L2TPV2 },
>> { NULL, 0 },
>> };
>> diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
>> index 33be3241b9..9a507ab9ea 100644
>> --- a/doc/guides/rel_notes/release_22_03.rst
>> +++ b/doc/guides/rel_notes/release_22_03.rst
>> @@ -55,6 +55,11 @@ New Features
>> Also, make sure to start the actual text at the margin.
>> =======================================================
>> +* **Added new RSS offload types for L2TPv2 in RSS flow.**
>> +
>> + Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
>> + input set for RSS.
>> +
>> * **Updated Cisco enic driver.**
>> * Added rte_flow support for matching GENEVE packets.
>> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
>> index 147cc1ced3..b7e78618c8 100644
>> --- a/lib/ethdev/rte_ethdev.h
>> +++ b/lib/ethdev/rte_ethdev.h
>> @@ -651,6 +651,12 @@ struct rte_eth_rss_conf {
>> #define RTE_ETH_RSS_L4_CHKSUM RTE_BIT64(35)
>> #define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
>> +/*
>> + * Below macro is defined for RSS offload type, it can be used to
>> + * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
>> + */
>
> Why this comment is duplicated here? (There is exact same above, and it is wrong to
> have it here.)
>
Please remove above comment too
> If this is the only comment, I can remove it while merging.
>
>> +#define RTE_ETH_RSS_L2TPV2 RTE_BIT64(36)
>> +
>> /*
>> * We use the following macros to combine with above RTE_ETH_RSS_* for
>> * more specific input set selection. These bits are defined starting
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
` (5 preceding siblings ...)
2022-02-08 8:38 ` [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
@ 2022-02-08 14:44 ` Ferruh Yigit
2022-02-09 8:20 ` Zhang, Qi Z
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
7 siblings, 1 reply; 41+ messages in thread
From: Ferruh Yigit @ 2022-02-08 14:44 UTC (permalink / raw)
To: Jie Wang, dev, qi.z.zhang
Cc: stevex.yang, orika, aman.deep.singh, thomas, andrew.rybchenko,
jingjing.wu, beilei.xing, olivier.matz
On 2/8/2022 8:38 AM, Jie Wang wrote:
> Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow
> director. Required to distribute packets based on outer MAC src
> address and L2TPv2 session ID.
>
> Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute
> packets based on inner IP src+dest address and TCP/UDP src+dest port.
>
> ---
> v4:
> * update new macros in ethdev.
> * update commit log.
> * rebase the main branch code.
> v3:
> * update new macros in ethdev.
> * update commit log.
> * rebase the main branch code.
> v2:
> * upadte release notes.
> * add comment for RTE_ETH_RSS_L2TPV2.
> * update ipv6 l2tpv2 flow item.
> * rebase the main branch code.
>
> Jie Wang (6):
> ethdev: add L2TPv2 RSS offload type
> net: fix L2TPv2 common header
> app/testpmd: add 6 types of L2TPv2 message
> common/iavf: add session ID fields for L2TPv2
> net/iavf: support L2TPv2 for AVF HASH
> net/iavf: support L2TPv2 for AVF FDIR
>
Hi Jie, Qi,
Can you please make iavf patches reviewed, so the set can be merged as whole,
or driver changes will block the ethdev changes.
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
2022-02-08 8:38 ` [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
@ 2022-02-09 7:01 ` Xing, Beilei
2022-02-09 7:43 ` Wang, Jie1X
2022-02-09 8:17 ` Zhang, Qi Z
0 siblings, 2 replies; 41+ messages in thread
From: Xing, Beilei @ 2022-02-09 7:01 UTC (permalink / raw)
To: Wang, Jie1X, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, Yigit, Ferruh, thomas,
andrew.rybchenko, Wu, Jingjing, Zhang, Qi Z, olivier.matz
> -----Original Message-----
> From: Wang, Jie1X <jie1x.wang@intel.com>
> Sent: Tuesday, February 8, 2022 4:39 PM
> To: dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> thomas@monjalon.net; andrew.rybchenko@oktetlabs.ru; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; olivier.matz@6wind.com; Wang, Jie1X
> <jie1x.wang@intel.com>
> Subject: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
>
> Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS
> hash based on outer MAC src address and L2TPv2 session ID.
>
> Patterns are listed below:
> eth/ipv4/udp/l2tpv2
> eth/ipv4/udp/l2tpv2/ppp
> eth/ipv6/udp/l2tpv2
> eth/ipv6/udp/l2tpv2/ppp
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> ---
> doc/guides/rel_notes/release_22_03.rst | 6 ++
> drivers/net/iavf/iavf.h | 2 +
> drivers/net/iavf/iavf_generic_flow.c | 34 +++++++++++
> drivers/net/iavf/iavf_generic_flow.h | 6 ++
> drivers/net/iavf/iavf_hash.c | 83 ++++++++++++++++++++++++--
> 5 files changed, 127 insertions(+), 4 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_22_03.rst
> b/doc/guides/rel_notes/release_22_03.rst
> index 9a507ab9ea..0d1e4a0b61 100644
> --- a/doc/guides/rel_notes/release_22_03.rst
> +++ b/doc/guides/rel_notes/release_22_03.rst
> @@ -64,6 +64,12 @@ New Features
>
> * Added rte_flow support for matching GENEVE packets.
>
> +* **Updated Intel iavf driver.**
> +
> + Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
> + based on outer MAC src address and L2TPv2 session ID.
Add * on the front.
> +
> +
> Removed Items
> -------------
>
> diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> 0bb5698583..a01d18e61b 100644
> --- a/drivers/net/iavf/iavf.h
> +++ b/drivers/net/iavf/iavf.h
> @@ -93,6 +93,8 @@
>
> #define IAVF_VLAN_TAG_PCP_OFFSET 13
>
<...>
> +/* L2TPv2 */
> +#define IAVF_RSS_TYPE_ETH_L2TPV2 (RTE_ETH_RSS_L2TPV2 | \
> + RTE_ETH_RSS_ETH | \
> + RTE_ETH_RSS_L2_SRC_ONLY)
Should we limit with L2_SRC_ONLY?
> +
> /**
> * Supported pattern for hash.
> * The first member is pattern item type, @@ -547,6 +589,8 @@ static struct
> iavf_pattern_match_item iavf_hash_pattern_list[] = {
<...>
> --
> 2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR
2022-02-08 8:38 ` [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
@ 2022-02-09 7:30 ` Xing, Beilei
2022-02-09 7:45 ` Wang, Jie1X
0 siblings, 1 reply; 41+ messages in thread
From: Xing, Beilei @ 2022-02-09 7:30 UTC (permalink / raw)
To: Wang, Jie1X, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, Yigit, Ferruh, thomas,
andrew.rybchenko, Wu, Jingjing, Zhang, Qi Z, olivier.matz
> -----Original Message-----
> From: Wang, Jie1X <jie1x.wang@intel.com>
> Sent: Tuesday, February 8, 2022 4:39 PM
> To: dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> thomas@monjalon.net; andrew.rybchenko@oktetlabs.ru; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; olivier.matz@6wind.com; Wang, Jie1X
> <jie1x.wang@intel.com>
> Subject: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR
>
> Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR based on outer
> MAC src address and L2TPv2 session ID.
>
> Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP src/dst
> address and UDP/TCP src/dst port.
>
> Patterns are listed below:
> eth/ipv4(6)/udp/l2tpv2
> eth/ipv4(6)/udp/l2tpv2/ppp
>
> eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)
> eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/udp
> eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/tcp
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> ---
> doc/guides/rel_notes/release_22_03.rst | 8 +-
> drivers/net/iavf/iavf_fdir.c | 174 +++++++++++++++++++++----
> drivers/net/iavf/iavf_generic_flow.h | 4 +
> 3 files changed, 156 insertions(+), 30 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_22_03.rst
> b/doc/guides/rel_notes/release_22_03.rst
> index 0d1e4a0b61..5a73ccc14e 100644
> --- a/doc/guides/rel_notes/release_22_03.rst
> +++ b/doc/guides/rel_notes/release_22_03.rst
> @@ -66,8 +66,12 @@ New Features
>
> * **Updated Intel iavf driver.**
>
> - Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
> - based on outer MAC src address and L2TPv2 session ID.
> + * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
> + based on outer MAC src address and L2TPv2 session ID.
Should fix in the patch 5/6.
> + * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
> + based on outer MAC src address and L2TPv2 session ID.
> + * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
> + src/dst address and UDP/TCP src/dst port.
>
>
> Removed Items
> diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c index
> b63aaca91d..2583b899aa 100644
> --- a/drivers/net/iavf/iavf_fdir.c
> +++ b/drivers/net/iavf/iavf_fdir.c
> @@ -168,6 +168,31 @@
> IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
> IAVF_INSET_TUN_UDP_DST_PORT)
>
> +#define IAVF_FDIR_INSET_L2TPV2 (\
> + IAVF_INSET_SMAC | IAVF_INSET_L2TPV2)
The same comment for FDIR: should we limit with source MAC?
> +
> +#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 (\
> + IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST)
> +
<...>
BR,
Beilei
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
2022-02-09 7:01 ` Xing, Beilei
@ 2022-02-09 7:43 ` Wang, Jie1X
2022-02-09 8:17 ` Zhang, Qi Z
1 sibling, 0 replies; 41+ messages in thread
From: Wang, Jie1X @ 2022-02-09 7:43 UTC (permalink / raw)
To: Xing, Beilei, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, Yigit, Ferruh, thomas,
andrew.rybchenko, Wu, Jingjing, Zhang, Qi Z, olivier.matz
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Wednesday, February 9, 2022 3:02 PM
> To: Wang, Jie1X <jie1x.wang@intel.com>; dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> thomas@monjalon.net; andrew.rybchenko@oktetlabs.ru; Wu, Jingjing
> <jingjing.wu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> olivier.matz@6wind.com
> Subject: RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
>
>
>
> > -----Original Message-----
> > From: Wang, Jie1X <jie1x.wang@intel.com>
> > Sent: Tuesday, February 8, 2022 4:39 PM
> > To: dev@dpdk.org
> > Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh,
> > Aman Deep <aman.deep.singh@intel.com>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; thomas@monjalon.net;
> > andrew.rybchenko@oktetlabs.ru; Wu, Jingjing <jingjing.wu@intel.com>;
> > Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; olivier.matz@6wind.com; Wang, Jie1X
> > <jie1x.wang@intel.com>
> > Subject: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
> >
> > Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol
> > RSS hash based on outer MAC src address and L2TPv2 session ID.
> >
> > Patterns are listed below:
> > eth/ipv4/udp/l2tpv2
> > eth/ipv4/udp/l2tpv2/ppp
> > eth/ipv6/udp/l2tpv2
> > eth/ipv6/udp/l2tpv2/ppp
> >
> > Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> > ---
> > doc/guides/rel_notes/release_22_03.rst | 6 ++
> > drivers/net/iavf/iavf.h | 2 +
> > drivers/net/iavf/iavf_generic_flow.c | 34 +++++++++++
> > drivers/net/iavf/iavf_generic_flow.h | 6 ++
> > drivers/net/iavf/iavf_hash.c | 83 ++++++++++++++++++++++++--
> > 5 files changed, 127 insertions(+), 4 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/release_22_03.rst
> > b/doc/guides/rel_notes/release_22_03.rst
> > index 9a507ab9ea..0d1e4a0b61 100644
> > --- a/doc/guides/rel_notes/release_22_03.rst
> > +++ b/doc/guides/rel_notes/release_22_03.rst
> > @@ -64,6 +64,12 @@ New Features
> >
> > * Added rte_flow support for matching GENEVE packets.
> >
> > +* **Updated Intel iavf driver.**
> > +
> > + Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
> > + based on outer MAC src address and L2TPv2 session ID.
>
> Add * on the front.
>
I'll update it.
> > +
> > +
> > Removed Items
> > -------------
> >
> > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> > 0bb5698583..a01d18e61b 100644
> > --- a/drivers/net/iavf/iavf.h
> > +++ b/drivers/net/iavf/iavf.h
> > @@ -93,6 +93,8 @@
> >
> > #define IAVF_VLAN_TAG_PCP_OFFSET 13
> >
>
>
> <...>
>
> > +/* L2TPv2 */
> > +#define IAVF_RSS_TYPE_ETH_L2TPV2 (RTE_ETH_RSS_L2TPV2 | \
> > + RTE_ETH_RSS_ETH | \
> > + RTE_ETH_RSS_L2_SRC_ONLY)
>
> Should we limit with L2_SRC_ONLY?
>
In the requirement, it only requires MAC SA to be used as RSS hash input set.
> > +
> > /**
> > * Supported pattern for hash.
> > * The first member is pattern item type, @@ -547,6 +589,8 @@ static
> > struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
>
>
> <...>
>
>
> > --
> > 2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR
2022-02-09 7:30 ` Xing, Beilei
@ 2022-02-09 7:45 ` Wang, Jie1X
0 siblings, 0 replies; 41+ messages in thread
From: Wang, Jie1X @ 2022-02-09 7:45 UTC (permalink / raw)
To: Xing, Beilei, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, Yigit, Ferruh, thomas,
andrew.rybchenko, Wu, Jingjing, Zhang, Qi Z, olivier.matz
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Wednesday, February 9, 2022 3:31 PM
> To: Wang, Jie1X <jie1x.wang@intel.com>; dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> thomas@monjalon.net; andrew.rybchenko@oktetlabs.ru; Wu, Jingjing
> <jingjing.wu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> olivier.matz@6wind.com
> Subject: RE: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR
>
>
>
> > -----Original Message-----
> > From: Wang, Jie1X <jie1x.wang@intel.com>
> > Sent: Tuesday, February 8, 2022 4:39 PM
> > To: dev@dpdk.org
> > Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh,
> > Aman Deep <aman.deep.singh@intel.com>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; thomas@monjalon.net;
> > andrew.rybchenko@oktetlabs.ru; Wu, Jingjing <jingjing.wu@intel.com>;
> > Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; olivier.matz@6wind.com; Wang, Jie1X
> > <jie1x.wang@intel.com>
> > Subject: [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR
> >
> > Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR based
> > on outer MAC src address and L2TPv2 session ID.
> >
> > Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP
> > src/dst address and UDP/TCP src/dst port.
> >
> > Patterns are listed below:
> > eth/ipv4(6)/udp/l2tpv2
> > eth/ipv4(6)/udp/l2tpv2/ppp
> >
> > eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)
> > eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/udp
> > eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/tcp
> >
> > Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> > ---
> > doc/guides/rel_notes/release_22_03.rst | 8 +-
> > drivers/net/iavf/iavf_fdir.c | 174 +++++++++++++++++++++----
> > drivers/net/iavf/iavf_generic_flow.h | 4 +
> > 3 files changed, 156 insertions(+), 30 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/release_22_03.rst
> > b/doc/guides/rel_notes/release_22_03.rst
> > index 0d1e4a0b61..5a73ccc14e 100644
> > --- a/doc/guides/rel_notes/release_22_03.rst
> > +++ b/doc/guides/rel_notes/release_22_03.rst
> > @@ -66,8 +66,12 @@ New Features
> >
> > * **Updated Intel iavf driver.**
> >
> > - Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
> > - based on outer MAC src address and L2TPv2 session ID.
> > + * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
> > + based on outer MAC src address and L2TPv2 session ID.
>
> Should fix in the patch 5/6.
>
> > + * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
> > + based on outer MAC src address and L2TPv2 session ID.
> > + * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
> > + src/dst address and UDP/TCP src/dst port.
> >
> >
> > Removed Items
> > diff --git a/drivers/net/iavf/iavf_fdir.c
> > b/drivers/net/iavf/iavf_fdir.c index b63aaca91d..2583b899aa 100644
> > --- a/drivers/net/iavf/iavf_fdir.c
> > +++ b/drivers/net/iavf/iavf_fdir.c
> > @@ -168,6 +168,31 @@
> > IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
> > IAVF_INSET_TUN_UDP_DST_PORT)
> >
> > +#define IAVF_FDIR_INSET_L2TPV2 (\
> > + IAVF_INSET_SMAC | IAVF_INSET_L2TPV2)
>
> The same comment for FDIR: should we limit with source MAC?
>
It is same as the RSS hash input set.
> > +
> > +#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 (\
> > + IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST)
> > +
>
> <...>
>
> BR,
> Beilei
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
2022-02-09 7:01 ` Xing, Beilei
2022-02-09 7:43 ` Wang, Jie1X
@ 2022-02-09 8:17 ` Zhang, Qi Z
1 sibling, 0 replies; 41+ messages in thread
From: Zhang, Qi Z @ 2022-02-09 8:17 UTC (permalink / raw)
To: Xing, Beilei, Wang, Jie1X, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, Yigit, Ferruh, thomas,
andrew.rybchenko, Wu, Jingjing, olivier.matz
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Wednesday, February 9, 2022 3:02 PM
> To: Wang, Jie1X <jie1x.wang@intel.com>; dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> thomas@monjalon.net; andrew.rybchenko@oktetlabs.ru; Wu, Jingjing
> <jingjing.wu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> olivier.matz@6wind.com
> Subject: RE: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
>
>
>
> > -----Original Message-----
> > From: Wang, Jie1X <jie1x.wang@intel.com>
> > Sent: Tuesday, February 8, 2022 4:39 PM
> > To: dev@dpdk.org
> > Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh,
> > Aman Deep <aman.deep.singh@intel.com>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; thomas@monjalon.net;
> > andrew.rybchenko@oktetlabs.ru; Wu, Jingjing <jingjing.wu@intel.com>;
> > Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; olivier.matz@6wind.com; Wang, Jie1X
> > <jie1x.wang@intel.com>
> > Subject: [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH
> >
> > Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol
> > RSS hash based on outer MAC src address and L2TPv2 session ID.
> >
> > Patterns are listed below:
> > eth/ipv4/udp/l2tpv2
> > eth/ipv4/udp/l2tpv2/ppp
> > eth/ipv6/udp/l2tpv2
> > eth/ipv6/udp/l2tpv2/ppp
> >
> > Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> > ---
> > doc/guides/rel_notes/release_22_03.rst | 6 ++
> > drivers/net/iavf/iavf.h | 2 +
> > drivers/net/iavf/iavf_generic_flow.c | 34 +++++++++++
> > drivers/net/iavf/iavf_generic_flow.h | 6 ++
> > drivers/net/iavf/iavf_hash.c | 83 ++++++++++++++++++++++++--
> > 5 files changed, 127 insertions(+), 4 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/release_22_03.rst
> > b/doc/guides/rel_notes/release_22_03.rst
> > index 9a507ab9ea..0d1e4a0b61 100644
> > --- a/doc/guides/rel_notes/release_22_03.rst
> > +++ b/doc/guides/rel_notes/release_22_03.rst
> > @@ -64,6 +64,12 @@ New Features
> >
> > * Added rte_flow support for matching GENEVE packets.
> >
> > +* **Updated Intel iavf driver.**
> > +
> > + Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
> > + based on outer MAC src address and L2TPv2 session ID.
>
> Add * on the front.
>
> > +
> > +
> > Removed Items
> > -------------
> >
> > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> > 0bb5698583..a01d18e61b 100644
> > --- a/drivers/net/iavf/iavf.h
> > +++ b/drivers/net/iavf/iavf.h
> > @@ -93,6 +93,8 @@
> >
> > #define IAVF_VLAN_TAG_PCP_OFFSET 13
> >
>
>
> <...>
>
> > +/* L2TPv2 */
> > +#define IAVF_RSS_TYPE_ETH_L2TPV2 (RTE_ETH_RSS_L2TPV2 | \
> > + RTE_ETH_RSS_ETH | \
> > + RTE_ETH_RSS_L2_SRC_ONLY)
>
> Should we limit with L2_SRC_ONLY?
+1, no need to intent to limit the driver's capability, src/dst could be enabled at the same time.
>
> > +
> > /**
> > * Supported pattern for hash.
> > * The first member is pattern item type, @@ -547,6 +589,8 @@ static
> > struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
>
>
> <...>
>
>
> > --
> > 2.25.1
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR
2022-02-08 14:44 ` [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
@ 2022-02-09 8:20 ` Zhang, Qi Z
0 siblings, 0 replies; 41+ messages in thread
From: Zhang, Qi Z @ 2022-02-09 8:20 UTC (permalink / raw)
To: Yigit, Ferruh, Wang, Jie1X, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, thomas, andrew.rybchenko,
Wu, Jingjing, Xing, Beilei, olivier.matz
> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Tuesday, February 8, 2022 10:45 PM
> To: Wang, Jie1X <jie1x.wang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; thomas@monjalon.net;
> andrew.rybchenko@oktetlabs.ru; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>; olivier.matz@6wind.com
> Subject: Re: [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR
>
> On 2/8/2022 8:38 AM, Jie Wang wrote:
> > Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow
> > director. Required to distribute packets based on outer MAC src
> > address and L2TPv2 session ID.
> >
> > Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute
> > packets based on inner IP src+dest address and TCP/UDP src+dest port.
> >
> > ---
> > v4:
> > * update new macros in ethdev.
> > * update commit log.
> > * rebase the main branch code.
> > v3:
> > * update new macros in ethdev.
> > * update commit log.
> > * rebase the main branch code.
> > v2:
> > * upadte release notes.
> > * add comment for RTE_ETH_RSS_L2TPV2.
> > * update ipv6 l2tpv2 flow item.
> > * rebase the main branch code.
> >
> > Jie Wang (6):
> > ethdev: add L2TPv2 RSS offload type
> > net: fix L2TPv2 common header
> > app/testpmd: add 6 types of L2TPv2 message
> > common/iavf: add session ID fields for L2TPv2
> > net/iavf: support L2TPv2 for AVF HASH
> > net/iavf: support L2TPv2 for AVF FDIR
> >
>
> Hi Jie, Qi,
>
> Can you please make iavf patches reviewed, so the set can be merged as
> whole, or driver changes will block the ethdev changes.
Hi Ferruh:
The pmd part overall looks ok for me, but still need some rework, I think it should not block the part of ethdev merge, if we are close to deadline.
Thanks
Qi
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
` (6 preceding siblings ...)
2022-02-08 14:44 ` [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
@ 2022-02-09 9:38 ` Jie Wang
2022-02-09 9:38 ` [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
` (6 more replies)
7 siblings, 7 replies; 41+ messages in thread
From: Jie Wang @ 2022-02-09 9:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow
director. Required to distribute packets based on outer MAC src
address and L2TPv2 session ID.
Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute
packets based on inner IP src+dest address and TCP/UDP src+dest port.
---
v5:
* remove the comment of new macros.
* update cmd_help_long_parsed() and testpmd_funcs.rst.
* update RSS hash/FDIR input set.
* rebase the main branch code.
v4:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v3:
* update new macros in ethdev.
* update commit log.
* rebase the main branch code.
v2:
* upadte release notes.
* add comment for RTE_ETH_RSS_L2TPV2.
* update ipv6 l2tpv2 flow item.
* rebase the main branch code.
Jie Wang (6):
ethdev: add L2TPv2 RSS offload type
net: fix L2TPv2 common header
app/testpmd: add 6 types of L2TPv2 message
common/iavf: add session ID fields for L2TPv2
net/iavf: support L2TPv2 for AVF HASH
net/iavf: support L2TPv2 for AVF FDIR
app/test-pmd/cmdline.c | 16 +-
app/test-pmd/cmdline_flow.c | 313 ++++++++++++++++----
app/test-pmd/config.c | 3 +-
doc/guides/rel_notes/release_22_03.rst | 14 +
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 39 ++-
drivers/common/iavf/virtchnl.h | 4 +
drivers/net/iavf/iavf.h | 2 +
drivers/net/iavf/iavf_fdir.c | 169 +++++++++--
drivers/net/iavf/iavf_generic_flow.c | 34 +++
drivers/net/iavf/iavf_generic_flow.h | 10 +
drivers/net/iavf/iavf_hash.c | 81 ++++-
lib/ethdev/rte_ethdev.h | 2 +
lib/net/rte_l2tpv2.h | 33 ++-
13 files changed, 615 insertions(+), 105 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
@ 2022-02-09 9:38 ` Jie Wang
2022-02-09 20:42 ` Ferruh Yigit
2022-02-09 9:38 ` [PATCH v5 2/6] net: fix L2TPv2 common header Jie Wang
` (5 subsequent siblings)
6 siblings, 1 reply; 41+ messages in thread
From: Jie Wang @ 2022-02-09 9:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
This patch defines new RSS offload type for L2TPv2, which
is required when users want to distribute packets based on
the L2TPv2 session ID field.
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
app/test-pmd/cmdline.c | 16 +++++++++-------
app/test-pmd/config.c | 3 ++-
doc/guides/rel_notes/release_22_03.rst | 5 +++++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++--
lib/ethdev/rte_ethdev.h | 2 ++
5 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9f10f35b40..e2fb7c9905 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -798,8 +798,8 @@ static void cmd_help_long_parsed(void *parsed_result,
"receive buffers available.\n\n"
"port config all rss (all|default|ip|tcp|udp|sctp|"
- "ether|port|vxlan|geneve|nvgre|vxlan-gpe|ecpri|mpls|none|level-default|"
- "level-outer|level-inner|<flowtype_id>)\n"
+ "ether|port|vxlan|geneve|nvgre|vxlan-gpe|ecpri|mpls|ipv4-chksum|l2tpv2|"
+ "none|level-default|level-outer|level-inner|<flowtype_id>)\n"
" Set the RSS mode.\n\n"
"port config port-id rss reta (hash,queue)[,(hash,queue)]\n"
@@ -2183,7 +2183,7 @@ cmd_config_rss_parsed(void *parsed_result,
RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP |
RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP |
RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP | RTE_ETH_RSS_GTPU |
- RTE_ETH_RSS_ECPRI;
+ RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_L2TPV2;
else if (!strcmp(res->value, "eth"))
rss_conf.rss_hf = RTE_ETH_RSS_ETH;
else if (!strcmp(res->value, "vlan"))
@@ -2248,6 +2248,8 @@ cmd_config_rss_parsed(void *parsed_result,
rss_conf.rss_hf = RTE_ETH_RSS_MPLS;
else if (!strcmp(res->value, "ipv4-chksum"))
rss_conf.rss_hf = RTE_ETH_RSS_IPV4_CHKSUM;
+ else if (!strcmp(res->value, "l2tpv2"))
+ rss_conf.rss_hf = RTE_ETH_RSS_L2TPV2;
else if (!strcmp(res->value, "none"))
rss_conf.rss_hf = 0;
else if (!strcmp(res->value, "level-default")) {
@@ -2318,8 +2320,8 @@ cmdline_parse_inst_t cmd_config_rss = {
.data = NULL,
.help_str = "port config all rss "
"all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
- "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
- "level-outer|level-inner|ipv4-chksum|<flowtype_id>",
+ "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|ipv4-chksum|l2tpv2|"
+ "none|level-default|level-outer|level-inner|<flowtype_id>",
.tokens = {
(void *)&cmd_config_rss_port,
(void *)&cmd_config_rss_keyword,
@@ -2434,7 +2436,7 @@ cmdline_parse_token_string_t cmd_config_rss_hash_key_rss_type =
"ipv6-tcp-ex#ipv6-udp-ex#"
"l3-src-only#l3-dst-only#l4-src-only#l4-dst-only#"
"l2-src-only#l2-dst-only#s-vlan#c-vlan#"
- "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls");
+ "l2tpv3#esp#ah#pfcp#pppoe#gtpu#ecpri#mpls#l2tpv2");
cmdline_parse_token_string_t cmd_config_rss_hash_key_value =
TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_key, key, NULL);
@@ -2447,7 +2449,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
"l2-payload|ipv6-ex|ipv6-tcp-ex|ipv6-udp-ex|"
"l3-src-only|l3-dst-only|l4-src-only|l4-dst-only|"
"l2-src-only|l2-dst-only|s-vlan|c-vlan|"
- "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls "
+ "l2tpv3|esp|ah|pfcp|pppoe|gtpu|ecpri|mpls|l2tpv2 "
"<string of hex digits (variable length, NIC dependent)>",
.tokens = {
(void *)&cmd_config_rss_hash_key_port,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index e812f57151..de1ec14bc7 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -90,7 +90,7 @@ const struct rss_type_info rss_type_table[] = {
{ "all", RTE_ETH_RSS_ETH | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |
RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_PAYLOAD |
RTE_ETH_RSS_L2TPV3 | RTE_ETH_RSS_ESP | RTE_ETH_RSS_AH | RTE_ETH_RSS_PFCP |
- RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS},
+ RTE_ETH_RSS_GTPU | RTE_ETH_RSS_ECPRI | RTE_ETH_RSS_MPLS | RTE_ETH_RSS_L2TPV2},
{ "none", 0 },
{ "eth", RTE_ETH_RSS_ETH },
{ "l2-src-only", RTE_ETH_RSS_L2_SRC_ONLY },
@@ -143,6 +143,7 @@ const struct rss_type_info rss_type_table[] = {
{ "mpls", RTE_ETH_RSS_MPLS },
{ "ipv4-chksum", RTE_ETH_RSS_IPV4_CHKSUM },
{ "l4-chksum", RTE_ETH_RSS_L4_CHKSUM },
+ { "l2tpv2", RTE_ETH_RSS_L2TPV2 },
{ NULL, 0 },
};
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index f03183ee86..17c25d899c 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -64,6 +64,11 @@ New Features
- ``rte_ipv6_udptcp_cksum_mbuf()``
- ``rte_ipv6_udptcp_cksum_mbuf_verify()``
+* **Added new RSS offload types for L2TPv2 in RSS flow.**
+
+ Added macro RTE_ETH_RSS_L2TPV2, now L2TPv2 session ID field can be used as
+ input set for RSS.
+
* **Added an API to enable queue based priority flow ctrl(PFC).**
New APIs, ``rte_eth_dev_priority_flow_ctrl_queue_info_get()`` and
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index b2e98df6e1..f8adcb0a40 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2308,11 +2308,11 @@ port config - RSS
Set the RSS (Receive Side Scaling) mode on or off::
- testpmd> port config all rss (all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none)
+ testpmd> port config all rss (all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|l2tpv2|none)
RSS is on by default.
-The ``all`` option is equivalent to eth|vlan|ip|tcp|udp|sctp|ether|l2tpv3|esp|ah|pfcp.
+The ``all`` option is equivalent to eth|vlan|ip|tcp|udp|sctp|ether|l2tpv3|esp|ah|pfcp|l2tpv2.
The ``default`` option enables all supported RSS types reported by device info.
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 2660e4f374..e6bc1c808a 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -651,6 +651,8 @@ struct rte_eth_rss_conf {
#define RTE_ETH_RSS_L4_CHKSUM RTE_BIT64(35)
#define ETH_RSS_L4_CHKSUM RTE_DEPRECATED(ETH_RSS_L4_CHKSUM) RTE_ETH_RSS_L4_CHKSUM
+#define RTE_ETH_RSS_L2TPV2 RTE_BIT64(36)
+
/*
* We use the following macros to combine with above RTE_ETH_RSS_* for
* more specific input set selection. These bits are defined starting
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 2/6] net: fix L2TPv2 common header
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
2022-02-09 9:38 ` [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
@ 2022-02-09 9:38 ` Jie Wang
2022-02-09 9:38 ` [PATCH v5 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
` (4 subsequent siblings)
6 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-02-09 9:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang, stable
The fields of L2TPv2 common header were reversed in big endian and
little endian.
This patch fixes this error to ensure L2TPv2 can be parsed correctly.
For L2TP reference:
https://datatracker.ietf.org/doc/html/rfc2661#section-3.1
Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
Cc: stable@dpdk.org
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/net/rte_l2tpv2.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 938a993b48..1f3ad3f03c 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
__extension__
struct {
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
- uint16_t t:1; /**< message Type */
- uint16_t l:1; /**< length option bit */
- uint16_t res1:2; /**< reserved */
- uint16_t s:1; /**< ns/nr option bit */
- uint16_t res2:1; /**< reserved */
- uint16_t o:1; /**< offset option bit */
- uint16_t p:1; /**< priority option bit */
- uint16_t res3:4; /**< reserved */
- uint16_t ver:4; /**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
uint16_t ver:4; /**< protocol version */
uint16_t res3:4; /**< reserved */
uint16_t p:1; /**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
uint16_t res1:2; /**< reserved */
uint16_t l:1; /**< length option bit */
uint16_t t:1; /**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+ uint16_t t:1; /**< message Type */
+ uint16_t l:1; /**< length option bit */
+ uint16_t res1:2; /**< reserved */
+ uint16_t s:1; /**< ns/nr option bit */
+ uint16_t res2:1; /**< reserved */
+ uint16_t o:1; /**< offset option bit */
+ uint16_t p:1; /**< priority option bit */
+ uint16_t res3:4; /**< reserved */
+ uint16_t ver:4; /**< protocol version */
#endif
};
};
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 3/6] app/testpmd: add 6 types of L2TPv2 message
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
2022-02-09 9:38 ` [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-02-09 9:38 ` [PATCH v5 2/6] net: fix L2TPv2 common header Jie Wang
@ 2022-02-09 9:38 ` Jie Wang
2022-02-09 9:38 ` [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
` (3 subsequent siblings)
6 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-02-09 9:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
This patch adds L2TPv2 control message and 5 types of data message
support for testpmd.
The added L2TPv2 message types are listed below:
1. L2TPv2 control
2. L2TPv2
3. L2TPv2 + length option
4. L2TPv2 + sequence option
5. L2TPv2 + offset option
6. L2TPv2 + length option + sequence option
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
app/test-pmd/cmdline_flow.c | 313 ++++++++++++++++----
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 ++-
lib/net/rte_l2tpv2.h | 13 +
3 files changed, 308 insertions(+), 53 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 7b56b1b0ff..e0c79d57a3 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -323,13 +323,30 @@ enum index {
ITEM_FLEX_ITEM_HANDLE,
ITEM_FLEX_PATTERN_HANDLE,
ITEM_L2TPV2,
- ITEM_L2TPV2_COMMON,
- ITEM_L2TPV2_COMMON_TYPE,
- ITEM_L2TPV2_COMMON_TYPE_DATA_L,
- ITEM_L2TPV2_COMMON_TYPE_CTRL,
+ ITEM_L2TPV2_TYPE,
+ ITEM_L2TPV2_TYPE_DATA,
+ ITEM_L2TPV2_TYPE_DATA_L,
+ ITEM_L2TPV2_TYPE_DATA_S,
+ ITEM_L2TPV2_TYPE_DATA_O,
+ ITEM_L2TPV2_TYPE_DATA_L_S,
+ ITEM_L2TPV2_TYPE_CTRL,
+ ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_SESSION_ID,
ITEM_L2TPV2_MSG_DATA_L_LENGTH,
ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_NS,
+ ITEM_L2TPV2_MSG_DATA_S_NR,
+ ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+ ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_NS,
+ ITEM_L2TPV2_MSG_DATA_L_S_NR,
ITEM_L2TPV2_MSG_CTRL_LENGTH,
ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
@@ -1451,19 +1468,70 @@ static const enum index item_flex[] = {
};
static const enum index item_l2tpv2[] = {
- ITEM_L2TPV2_COMMON,
+ ITEM_L2TPV2_TYPE,
ITEM_NEXT,
ZERO,
};
-static const enum index item_l2tpv2_common[] = {
- ITEM_L2TPV2_COMMON_TYPE,
+static const enum index item_l2tpv2_type[] = {
+ ITEM_L2TPV2_TYPE_DATA,
+ ITEM_L2TPV2_TYPE_DATA_L,
+ ITEM_L2TPV2_TYPE_DATA_S,
+ ITEM_L2TPV2_TYPE_DATA_O,
+ ITEM_L2TPV2_TYPE_DATA_L_S,
+ ITEM_L2TPV2_TYPE_CTRL,
ZERO,
};
-static const enum index item_l2tpv2_common_type[] = {
- ITEM_L2TPV2_COMMON_TYPE_DATA_L,
- ITEM_L2TPV2_COMMON_TYPE_CTRL,
+static const enum index item_l2tpv2_type_data[] = {
+ ITEM_L2TPV2_MSG_DATA_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_SESSION_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l[] = {
+ ITEM_L2TPV2_MSG_DATA_L_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_s[] = {
+ ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_S_NS,
+ ITEM_L2TPV2_MSG_DATA_S_NR,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_o[] = {
+ ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_O_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_O_OFFSET,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_data_l_s[] = {
+ ITEM_L2TPV2_MSG_DATA_L_S_LENGTH,
+ ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID,
+ ITEM_L2TPV2_MSG_DATA_L_S_NS,
+ ITEM_L2TPV2_MSG_DATA_L_S_NR,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_l2tpv2_type_ctrl[] = {
+ ITEM_L2TPV2_MSG_CTRL_LENGTH,
+ ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
+ ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
+ ITEM_L2TPV2_MSG_CTRL_NS,
+ ITEM_L2TPV2_MSG_CTRL_NR,
+ ITEM_NEXT,
ZERO,
};
@@ -3858,31 +3926,46 @@ static const struct token token_list[] = {
.next = NEXT(item_l2tpv2),
.call = parse_vc,
},
- [ITEM_L2TPV2_COMMON] = {
- .name = "common",
- .help = "L2TPv2 common header",
- .next = NEXT(item_l2tpv2_common),
- },
- [ITEM_L2TPV2_COMMON_TYPE] = {
+ [ITEM_L2TPV2_TYPE] = {
.name = "type",
- .help = "type of common header",
- .next = NEXT(item_l2tpv2_common_type),
+ .help = "type of l2tpv2",
+ .next = NEXT(item_l2tpv2_type),
.args = ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)),
},
- [ITEM_L2TPV2_COMMON_TYPE_DATA_L] = {
+ [ITEM_L2TPV2_TYPE_DATA] = {
+ .name = "data",
+ .help = "Type #7: data message without any options",
+ .next = NEXT(item_l2tpv2_type_data),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type7.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type7.session_id)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_L] = {
.name = "data_l",
.help = "Type #6: data message with length option",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
- ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
- ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
- ITEM_NEXT)),
+ .next = NEXT(item_l2tpv2_type_data_l),
.call = parse_vc_item_l2tpv2_type,
},
[ITEM_L2TPV2_MSG_DATA_L_LENGTH] = {
.name = "length",
.help = "message length",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3891,8 +3974,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] = {
.name = "tunnel_id",
.help = "tunnel identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3901,29 +3983,150 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] = {
.name = "session_id",
.help = "session identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_data_l,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
hdr.type6.session_id)),
},
- [ITEM_L2TPV2_COMMON_TYPE_CTRL] = {
+ [ITEM_L2TPV2_TYPE_DATA_S] = {
+ .name = "data_s",
+ .help = "Type #5: data message with ns, nr option",
+ .next = NEXT(item_l2tpv2_type_data_s),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_NS] = {
+ .name = "ns",
+ .help = "sequence number for message",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.ns)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_S_NR] = {
+ .name = "nr",
+ .help = "sequence number for next receive message",
+ .next = NEXT(item_l2tpv2_type_data_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.nr)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_O] = {
+ .name = "data_o",
+ .help = "Type #4: data message with offset option",
+ .next = NEXT(item_l2tpv2_type_data_o),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type4.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type5.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_O_OFFSET] = {
+ .name = "offset_size",
+ .help = "the size of offset padding",
+ .next = NEXT(item_l2tpv2_type_data_o,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type4.offset_size)),
+ },
+ [ITEM_L2TPV2_TYPE_DATA_L_S] = {
+ .name = "data_l_s",
+ .help = "Type #3: data message contains length, ns, nr "
+ "options",
+ .next = NEXT(item_l2tpv2_type_data_l_s),
+ .call = parse_vc_item_l2tpv2_type,
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_LENGTH] = {
+ .name = "length",
+ .help = "message length",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.length)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_TUNNEL_ID] = {
+ .name = "tunnel_id",
+ .help = "tunnel identifier",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.tunnel_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_SESSION_ID] = {
+ .name = "session_id",
+ .help = "session identifier",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.session_id)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_NS] = {
+ .name = "ns",
+ .help = "sequence number for message",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.ns)),
+ },
+ [ITEM_L2TPV2_MSG_DATA_L_S_NR] = {
+ .name = "nr",
+ .help = "sequence number for next receive message",
+ .next = NEXT(item_l2tpv2_type_data_l_s,
+ NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
+ hdr.type3.nr)),
+ },
+ [ITEM_L2TPV2_TYPE_CTRL] = {
.name = "control",
- .help = "Type #3: conrtol message contains length, ns, nr options",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
- ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
- ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
- ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_MSG_CTRL_NR,
- ITEM_NEXT)),
+ .help = "Type #3: conrtol message contains length, ns, nr "
+ "options",
+ .next = NEXT(item_l2tpv2_type_ctrl),
.call = parse_vc_item_l2tpv2_type,
},
[ITEM_L2TPV2_MSG_CTRL_LENGTH] = {
.name = "length",
.help = "message length",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3932,8 +4135,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] = {
.name = "tunnel_id",
.help = "tunnel identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3942,8 +4144,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_SESSION_ID] = {
.name = "session_id",
.help = "session identifier",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3952,8 +4153,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_NS] = {
.name = "ns",
.help = "sequence number for message",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -3962,8 +4162,7 @@ static const struct token token_list[] = {
[ITEM_L2TPV2_MSG_CTRL_NR] = {
.name = "nr",
.help = "sequence number for next receive message",
- .next = NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS,
- ITEM_L2TPV2_COMMON, ITEM_NEXT),
+ .next = NEXT(item_l2tpv2_type_ctrl,
NEXT_ENTRY(COMMON_UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2,
@@ -5904,11 +6103,23 @@ parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token,
if (parse_default(ctx, token, str, len, NULL, 0) < 0)
return -1;
switch (ctx->curr) {
- case ITEM_L2TPV2_COMMON_TYPE_DATA_L:
- msg_type |= 0x4000;
+ case ITEM_L2TPV2_TYPE_DATA:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_L:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_S:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_S;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_O:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_O;
+ break;
+ case ITEM_L2TPV2_TYPE_DATA_L_S:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_DATA_L_S;
break;
- case ITEM_L2TPV2_COMMON_TYPE_CTRL:
- msg_type |= 0xC800;
+ case ITEM_L2TPV2_TYPE_CTRL:
+ msg_type |= RTE_L2TPV2_MSG_TYPE_CONTROL;
break;
default:
return -1;
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f8adcb0a40..f957f2b0ab 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3857,6 +3857,7 @@ This section lists supported pattern items and their attributes, if any.
- ``session_id {unsigned}``: L2TPv2 session identifier.
- ``ns {unsigned}``: L2TPv2 option ns.
- ``nr {unsigned}``: L2TPv2 option nr.
+ - ``offset_size {unsigned}``: L2TPv2 option offset.
- ``ppp``: match PPP header.
@@ -5090,11 +5091,19 @@ The meter policy action list: ``green -> green, yellow -> yellow, red -> red``.
testpmd> create port meter 0 1 13 1 yes 0xffff 0 0
testpmd> flow create 0 priority 0 ingress group 1 pattern eth / end actions meter mtr_id 1 / end
-Sample PPPoL2TPv2oUDP RSS rules
+Sample L2TPv2 RSS rules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-PPPoL2TPv2oUDP RSS rules can be created by the following commands::
+L2TPv2 RSS rules can be created by the following commands:
+::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type control
+ / end actions rss types l2tpv2 end queues end / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / end
+ actions rss types eth l2-src-only end queues end / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / end
+ actions rss types l2tpv2 end queues end / end
testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
/ end actions rss types ipv4 end queues end / end
testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv6
@@ -5104,6 +5113,28 @@ PPPoL2TPv2oUDP RSS rules can be created by the following commands::
testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
/ end actions rss types ipv6 end queues end / end
+Sample L2TPv2 FDIR rules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+L2TPv2 FDIR rules can be created by the following commands:
+
+::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type control
+ session_id is 0x1111 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth src is 00:00:00:00:00:01 / ipv4
+ / udp / l2tpv2 type data / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 type data
+ session_id is 0x1111 / ppp / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
+ src is 10.0.0.1 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
+ dst is ABAB:910B:6666:3457:8295:3333:1800:2929 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
+ / udp src is 22 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / l2tpv2 / ppp / ipv4
+ / tcp dst is 23 / end actions queue index 3 / end
+
Sample RAW rule
~~~~~~~~~~~~~~~
diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 1f3ad3f03c..d41123a504 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -78,6 +78,19 @@
extern "C" {
#endif
+/*
+ * L2TPv2 Message Type
+ */
+#define RTE_L2TPV2_MSG_TYPE_CONTROL 0xC802
+#define RTE_L2TPV2_MSG_TYPE_DATA 0x0002
+#define RTE_L2TPV2_MSG_TYPE_DATA_L 0x4002
+#define RTE_L2TPV2_MSG_TYPE_DATA_S 0x0802
+#define RTE_L2TPV2_MSG_TYPE_DATA_O 0x0202
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S 0x4802
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_O 0x4202
+#define RTE_L2TPV2_MSG_TYPE_DATA_S_O 0x0A02
+#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O 0x4A02
+
/**
* L2TPv2 Common Header
*/
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
` (2 preceding siblings ...)
2022-02-09 9:38 ` [PATCH v5 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
@ 2022-02-09 9:38 ` Jie Wang
2022-02-11 1:37 ` Zhang, Qi Z
2022-02-09 9:38 ` [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
` (2 subsequent siblings)
6 siblings, 1 reply; 41+ messages in thread
From: Jie Wang @ 2022-02-09 9:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add virtchnl fields session ID of L2TPv2 for AVF HASH.
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
drivers/common/iavf/virtchnl.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 80e754a1b2..3e44eca7d8 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -1653,6 +1653,10 @@ enum virtchnl_proto_hdr_field {
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN),
VIRTCHNL_PROTO_HDR_GTPU_UP_QFI =
PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP),
+ /* L2TPv2 */
+ VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID =
+ PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_L2TPV2),
+ VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID,
};
struct virtchnl_proto_hdr {
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
` (3 preceding siblings ...)
2022-02-09 9:38 ` [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
@ 2022-02-09 9:38 ` Jie Wang
2022-02-09 12:21 ` Xing, Beilei
2022-02-09 9:38 ` [PATCH v5 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
2022-02-09 20:44 ` [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
6 siblings, 1 reply; 41+ messages in thread
From: Jie Wang @ 2022-02-09 9:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add support for PPP over L2TPv2 over UDP protocol and L2TPv2
protocol RSS hash based on outer MAC src address and L2TPv2
session ID.
Patterns are listed below:
eth/ipv4/udp/l2tpv2
eth/ipv4/udp/l2tpv2/ppp
eth/ipv6/udp/l2tpv2
eth/ipv6/udp/l2tpv2/ppp
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
doc/guides/rel_notes/release_22_03.rst | 5 ++
drivers/net/iavf/iavf.h | 2 +
drivers/net/iavf/iavf_generic_flow.c | 34 +++++++++++
drivers/net/iavf/iavf_generic_flow.h | 6 ++
drivers/net/iavf/iavf_hash.c | 81 ++++++++++++++++++++++++--
5 files changed, 124 insertions(+), 4 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 17c25d899c..37921fc44f 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -83,6 +83,11 @@ New Features
* Added rte_flow support for matching GENEVE packets.
* Added rte_flow support for matching eCPRI packets.
+* **Updated Intel iavf driver.**
+
+ * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
+ based on outer MAC src address and L2TPv2 session ID.
+
* **Updated Marvell cnxk crypto PMD.**
* Added SHA256-HMAC support in lookaside protocol (IPsec) for CN10K.
diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 0bb5698583..a01d18e61b 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -93,6 +93,8 @@
#define IAVF_VLAN_TAG_PCP_OFFSET 13
+#define IAVF_L2TPV2_FLAGS_LEN 0x4000
+
struct iavf_adapter;
struct iavf_rx_queue;
struct iavf_tx_queue;
diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 2befa125ac..1de4187e67 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -1611,6 +1611,40 @@ enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
RTE_FLOW_ITEM_TYPE_END,
};
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_PPP,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV6,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] = {
+ RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV6,
+ RTE_FLOW_ITEM_TYPE_UDP,
+ RTE_FLOW_ITEM_TYPE_L2TPV2,
+ RTE_FLOW_ITEM_TYPE_PPP,
+ RTE_FLOW_ITEM_TYPE_END,
+};
+
/* PPPoL2TPv2oUDP */
enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
RTE_FLOW_ITEM_TYPE_ETH,
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index 3681a96b31..107bbc1a23 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -410,6 +410,12 @@ extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_tcp[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[];
+/* L2TPv2 */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[];
+
/* PPPoL2TPv2oUDP */
extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[];
extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6[];
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 5e0888ea68..f35a07653b 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -36,6 +36,7 @@
#define IAVF_PHINT_MID_IPV6 BIT_ULL(8)
/* L2TPv2 */
#define IAVF_PHINT_L2TPV2 BIT_ULL(9)
+#define IAVF_PHINT_L2TPV2_LEN BIT_ULL(10)
#define IAVF_PHINT_GTPU_MSK (IAVF_PHINT_GTPU | \
IAVF_PHINT_GTPU_EH | \
@@ -167,7 +168,9 @@ iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID), {BUFF_NOUSED} }
#define proto_hdr_l2tpv2 { \
- VIRTCHNL_PROTO_HDR_L2TPV2, 0, {BUFF_NOUSED} }
+ VIRTCHNL_PROTO_HDR_L2TPV2, \
+ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID) | \
+ FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID), {BUFF_NOUSED} }
#define proto_hdr_ppp { \
VIRTCHNL_PROTO_HDR_PPP, 0, {BUFF_NOUSED} }
@@ -392,6 +395,40 @@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
proto_hdr_tcp}
};
+struct virtchnl_proto_hdrs ipv4_l2tpv2_tmplt = {
+ TUNNEL_LEVEL_OUTER, 4,
+ {proto_hdr_eth,
+ proto_hdr_ipv4,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2}
+};
+
+struct virtchnl_proto_hdrs ipv6_l2tpv2_tmplt = {
+ TUNNEL_LEVEL_OUTER, 4,
+ {proto_hdr_eth,
+ proto_hdr_ipv6,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2}
+};
+
+struct virtchnl_proto_hdrs ipv4_l2tpv2_ppp_tmplt = {
+ TUNNEL_LEVEL_OUTER, 5,
+ {proto_hdr_eth,
+ proto_hdr_ipv4,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2,
+ proto_hdr_ppp}
+};
+
+struct virtchnl_proto_hdrs ipv6_l2tpv2_ppp_tmplt = {
+ TUNNEL_LEVEL_OUTER, 5,
+ {proto_hdr_eth,
+ proto_hdr_ipv6,
+ proto_hdr_udp,
+ proto_hdr_l2tpv2,
+ proto_hdr_ppp}
+};
+
/* rss type super set */
/* IPv4 outer */
@@ -480,6 +517,9 @@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
#define IAVF_RSS_TYPE_IPV4_PFCP (RTE_ETH_RSS_PFCP | RTE_ETH_RSS_IPV4)
#define IAVF_RSS_TYPE_IPV6_PFCP (RTE_ETH_RSS_PFCP | RTE_ETH_RSS_IPV6)
+/* L2TPv2 */
+#define IAVF_RSS_TYPE_ETH_L2TPV2 (RTE_ETH_RSS_ETH | RTE_ETH_RSS_L2TPV2)
+
/**
* Supported pattern for hash.
* The first member is pattern item type,
@@ -547,6 +587,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
{iavf_pattern_eth_ipv6_gre_ipv4_tcp, IAVF_RSS_TYPE_INNER_IPV4_TCP, &inner_ipv4_tcp_tmplt},
{iavf_pattern_eth_ipv4_gre_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
{iavf_pattern_eth_ipv6_gre_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_tmplt},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_ppp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4, IAVF_RSS_TYPE_INNER_IPV4, &udp_l2tpv2_ppp_ipv4_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp, IAVF_RSS_TYPE_INNER_IPV4_UDP, &udp_l2tpv2_ppp_ipv4_udp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp, IAVF_RSS_TYPE_INNER_IPV4_TCP, &udp_l2tpv2_ppp_ipv4_tcp_tmplt},
@@ -614,6 +656,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
{iavf_pattern_eth_ipv6_gre_ipv6_tcp, IAVF_RSS_TYPE_INNER_IPV6_TCP, &inner_ipv6_tcp_tmplt},
{iavf_pattern_eth_ipv4_gre_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
{iavf_pattern_eth_ipv6_gre_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_tmplt},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp, IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_ppp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6, IAVF_RSS_TYPE_INNER_IPV6, &udp_l2tpv2_ppp_ipv6_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp, IAVF_RSS_TYPE_INNER_IPV6_UDP, &udp_l2tpv2_ppp_ipv6_udp_tmplt},
{iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp, IAVF_RSS_TYPE_INNER_IPV6_TCP, &udp_l2tpv2_ppp_ipv6_tcp_tmplt},
@@ -744,6 +788,8 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
const struct rte_flow_item_gtp_psc *psc;
const struct rte_flow_item_ecpri *ecpri;
struct rte_ecpri_common_hdr ecpri_common;
+ const struct rte_flow_item_l2tpv2 *l2tpv2;
+ uint16_t flags_version;
for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
if (item->last) {
@@ -802,7 +848,18 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
*phint |= IAVF_PHINT_GRE;
break;
case RTE_FLOW_ITEM_TYPE_L2TPV2:
- *phint |= IAVF_PHINT_L2TPV2;
+ l2tpv2 = item->spec;
+
+ if (l2tpv2) {
+ flags_version =
+ rte_be_to_cpu_16(l2tpv2->hdr.common.flags_version);
+ if (flags_version & IAVF_L2TPV2_FLAGS_LEN)
+ *phint |= IAVF_PHINT_L2TPV2_LEN;
+ else
+ *phint |= IAVF_PHINT_L2TPV2;
+ } else {
+ *phint |= IAVF_PHINT_L2TPV2;
+ }
break;
default:
break;
@@ -1024,6 +1081,10 @@ iavf_refine_proto_hdrs_l234(struct virtchnl_proto_hdrs *proto_hdrs,
if (!(rss_type & RTE_ETH_RSS_ECPRI))
hdr->field_selector = 0;
break;
+ case VIRTCHNL_PROTO_HDR_L2TPV2:
+ if (!(rss_type & RTE_ETH_RSS_L2TPV2))
+ hdr->field_selector = 0;
+ break;
default:
break;
}
@@ -1130,10 +1191,10 @@ static void
iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
uint64_t phint)
{
- struct virtchnl_proto_hdr *hdr1;
+ struct virtchnl_proto_hdr *hdr, *hdr1;
int i;
- if (!(phint & IAVF_PHINT_L2TPV2))
+ if (!(phint & IAVF_PHINT_L2TPV2) && !(phint & IAVF_PHINT_L2TPV2_LEN))
return;
if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) {
@@ -1150,7 +1211,19 @@ iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4);
else if (phint & IAVF_PHINT_OUTER_IPV6)
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV6);
+ } else {
+ for (i = 0; i < proto_hdrs->count; i++) {
+ hdr = &proto_hdrs->proto_hdr[i];
+ if (hdr->type == VIRTCHNL_PROTO_HDR_L2TPV2) {
+ if (phint & IAVF_PHINT_L2TPV2) {
+ REFINE_PROTO_FLD(DEL, L2TPV2_LEN_SESS_ID);
+ } else if (phint & IAVF_PHINT_L2TPV2_LEN) {
+ REFINE_PROTO_FLD(DEL, L2TPV2_SESS_ID);
+ }
+ }
+ }
}
+
}
static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 6/6] net/iavf: support L2TPv2 for AVF FDIR
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
` (4 preceding siblings ...)
2022-02-09 9:38 ` [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
@ 2022-02-09 9:38 ` Jie Wang
2022-02-09 20:44 ` [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
6 siblings, 0 replies; 41+ messages in thread
From: Jie Wang @ 2022-02-09 9:38 UTC (permalink / raw)
To: dev
Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
olivier.matz, Jie Wang
Add support for L2TPv2(include PPP over L2TPv2) protocols FDIR
based on outer MAC src address and L2TPv2 session ID.
Add support for PPPoL2TPv2oUDP protocols FDIR based on inner IP
src/dst address and UDP/TCP src/dst port.
Patterns are listed below:
eth/ipv4(6)/udp/l2tpv2
eth/ipv4(6)/udp/l2tpv2/ppp
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/udp
eth/ipv4(6)/udp/l2tpv2/ppp/ipv4(6)/tcp
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
doc/guides/rel_notes/release_22_03.rst | 4 +
drivers/net/iavf/iavf_fdir.c | 169 +++++++++++++++++++++----
drivers/net/iavf/iavf_generic_flow.h | 4 +
3 files changed, 149 insertions(+), 28 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst
index 37921fc44f..a05a07dd52 100644
--- a/doc/guides/rel_notes/release_22_03.rst
+++ b/doc/guides/rel_notes/release_22_03.rst
@@ -87,6 +87,10 @@ New Features
* Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
based on outer MAC src address and L2TPv2 session ID.
+ * Added L2TPv2(include PPP over L2TPv2) FDIR distribute packets
+ based on outer MAC src address and L2TPv2 session ID.
+ * Added PPPoL2TPv2oUDP FDIR distribute packets based on inner IP
+ src/dst address and UDP/TCP src/dst port.
* **Updated Marvell cnxk crypto PMD.**
diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index b63aaca91d..e9a3566c0d 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -168,6 +168,31 @@
IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
IAVF_INSET_TUN_UDP_DST_PORT)
+#define IAVF_FDIR_INSET_L2TPV2 (\
+ IAVF_INSET_SMAC | IAVF_INSET_DMAC | IAVF_INSET_L2TPV2)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 (\
+ IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 | IAVF_INSET_TUN_UDP_SRC_PORT | \
+ IAVF_INSET_TUN_UDP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV4 | IAVF_INSET_TUN_TCP_SRC_PORT | \
+ IAVF_INSET_TUN_TCP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 (\
+ IAVF_INSET_TUN_IPV6_SRC | IAVF_INSET_TUN_IPV6_DST)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
+ IAVF_INSET_TUN_UDP_DST_PORT)
+
+#define IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP (\
+ IAVF_FDIR_INSET_L2TPV2_PPP_IPV6 | IAVF_INSET_TUN_TCP_SRC_PORT | \
+ IAVF_INSET_TUN_TCP_DST_PORT)
+
static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
{iavf_pattern_ethertype, IAVF_FDIR_INSET_ETH, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv4, IAVF_FDIR_INSET_ETH_IPV4, IAVF_INSET_NONE},
@@ -275,6 +300,23 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
{iavf_pattern_eth_ipv6_gre_ipv6, IAVF_FDIR_INSET_GRE_IPV6, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv6_gre_ipv6_tcp, IAVF_FDIR_INSET_GRE_IPV6_TCP, IAVF_INSET_NONE},
{iavf_pattern_eth_ipv6_gre_ipv6_udp, IAVF_FDIR_INSET_GRE_IPV6_UDP, IAVF_INSET_NONE},
+
+ {iavf_pattern_eth_ipv4_udp_l2tpv2, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp, IAVF_FDIR_INSET_L2TPV2, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv4_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV4_TCP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_udp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_UDP, IAVF_INSET_NONE},
+ {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp_ipv6_tcp, IAVF_FDIR_INSET_L2TPV2_PPP_IPV6_TCP, IAVF_INSET_NONE},
};
static struct iavf_flow_parser iavf_fdir_parser;
@@ -694,6 +736,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
const struct rte_flow_item_pfcp *pfcp_spec, *pfcp_mask;
const struct rte_flow_item_ecpri *ecpri_spec, *ecpri_mask;
const struct rte_flow_item_gre *gre_spec, *gre_mask;
+ const struct rte_flow_item_l2tpv2 *l2tpv2_spec, *l2tpv2_mask;
+ const struct rte_flow_item_ppp *ppp_spec, *ppp_mask;
const struct rte_flow_item *item = pattern;
struct virtchnl_proto_hdr *hdr, *hdr1 = NULL;
struct rte_ecpri_common_hdr ecpri_common;
@@ -701,7 +745,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
enum rte_flow_item_type item_type;
enum rte_flow_item_type next_type;
uint8_t tun_inner = 0;
- uint16_t ether_type;
+ uint16_t ether_type, flags_version;
int layer = 0;
uint8_t ipv6_addr_mask[16] = {
@@ -739,37 +783,41 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (eth_spec && eth_mask) {
- if (!rte_is_zero_ether_addr(ð_mask->src) ||
- !rte_is_zero_ether_addr(ð_mask->dst)) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM, item,
- "Invalid MAC_addr mask.");
- return -rte_errno;
+ if (!rte_is_zero_ether_addr(ð_mask->dst)) {
+ input_set |= IAVF_INSET_DMAC;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1,
+ ETH,
+ DST);
+ } else if (!rte_is_zero_ether_addr(ð_mask->src)) {
+ input_set |= IAVF_INSET_SMAC;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1,
+ ETH,
+ SRC);
}
- }
- if (eth_spec && eth_mask && eth_mask->type) {
- if (eth_mask->type != RTE_BE16(0xffff)) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM,
- item, "Invalid type mask.");
- return -rte_errno;
+ if (eth_mask->type) {
+ if (eth_mask->type != RTE_BE16(0xffff)) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item, "Invalid type mask.");
+ return -rte_errno;
+ }
+
+ ether_type = rte_be_to_cpu_16(eth_spec->type);
+ if (ether_type == RTE_ETHER_TYPE_IPV4 ||
+ ether_type == RTE_ETHER_TYPE_IPV6) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Unsupported ether_type.");
+ return -rte_errno;
+ }
+
+ input_set |= IAVF_INSET_ETHERTYPE;
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
+ ETHERTYPE);
}
- ether_type = rte_be_to_cpu_16(eth_spec->type);
- if (ether_type == RTE_ETHER_TYPE_IPV4 ||
- ether_type == RTE_ETHER_TYPE_IPV6) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM,
- item,
- "Unsupported ether_type.");
- return -rte_errno;
- }
-
- input_set |= IAVF_INSET_ETHERTYPE;
- VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
- ETHERTYPE);
-
rte_memcpy(hdr1->buffer, eth_spec,
sizeof(struct rte_ether_hdr));
}
@@ -1319,6 +1367,71 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
hdrs->count = ++layer;
break;
+ case RTE_FLOW_ITEM_TYPE_L2TPV2:
+ l2tpv2_spec = item->spec;
+ l2tpv2_mask = item->mask;
+
+ hdr = &hdrs->proto_hdr[layer];
+
+ VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, L2TPV2);
+
+ if (l2tpv2_spec && l2tpv2_mask) {
+ flags_version =
+ rte_be_to_cpu_16(l2tpv2_spec->hdr.common.flags_version);
+ if ((flags_version == RTE_L2TPV2_MSG_TYPE_CONTROL &&
+ l2tpv2_mask->hdr.type3.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA &&
+ l2tpv2_mask->hdr.type7.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L &&
+ l2tpv2_mask->hdr.type6.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_S &&
+ l2tpv2_mask->hdr.type5.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_O &&
+ l2tpv2_mask->hdr.type4.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_S &&
+ l2tpv2_mask->hdr.type3.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_O &&
+ l2tpv2_mask->hdr.type2.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_S_O &&
+ l2tpv2_mask->hdr.type1.session_id == UINT16_MAX) ||
+ (flags_version == RTE_L2TPV2_MSG_TYPE_DATA_L_S_O &&
+ l2tpv2_mask->hdr.type0.session_id == UINT16_MAX)) {
+ input_set |= IAVF_L2TPV2_SESSION_ID;
+ if (flags_version & IAVF_L2TPV2_FLAGS_LEN)
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr,
+ L2TPV2,
+ LEN_SESS_ID);
+ else
+ VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr,
+ L2TPV2,
+ SESS_ID);
+ }
+
+ rte_memcpy(hdr->buffer, l2tpv2_spec,
+ sizeof(*l2tpv2_spec));
+ }
+
+ tun_inner = 1;
+
+ hdrs->count = ++layer;
+ break;
+
+ case RTE_FLOW_ITEM_TYPE_PPP:
+ ppp_spec = item->spec;
+ ppp_mask = item->mask;
+
+ hdr = &hdrs->proto_hdr[layer];
+
+ VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, PPP);
+
+ if (ppp_spec && ppp_mask) {
+ rte_memcpy(hdr->buffer, ppp_spec,
+ sizeof(*ppp_spec));
+ }
+
+ hdrs->count = ++layer;
+ break;
+
case RTE_FLOW_ITEM_TYPE_VOID:
break;
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index 107bbc1a23..f6af176073 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -35,6 +35,7 @@
#define IAVF_PROT_L2TPV3OIP (1ULL << 24)
#define IAVF_PROT_PFCP (1ULL << 25)
#define IAVF_PROT_ECPRI (1ULL << 26)
+#define IAVF_PROT_L2TPV2 (1ULL << 27)
/* field */
@@ -62,6 +63,7 @@
#define IAVF_PFCP_SEID (1ULL << 43)
#define IAVF_ECPRI_PC_RTC_ID (1ULL << 42)
#define IAVF_IP_PKID (1ULL << 41)
+#define IAVF_L2TPV2_SESSION_ID (1ULL << 40)
/* input set */
@@ -175,6 +177,8 @@
(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
#define IAVF_INSET_ECPRI \
(IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
+#define IAVF_INSET_L2TPV2 \
+ (IAVF_PROT_L2TPV2 | IAVF_L2TPV2_SESSION_ID)
/* empty pattern */
extern enum rte_flow_item_type iavf_pattern_empty[];
--
2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH
2022-02-09 9:38 ` [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
@ 2022-02-09 12:21 ` Xing, Beilei
0 siblings, 0 replies; 41+ messages in thread
From: Xing, Beilei @ 2022-02-09 12:21 UTC (permalink / raw)
To: Wang, Jie1X, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, Yigit, Ferruh, thomas,
andrew.rybchenko, Wu, Jingjing, Zhang, Qi Z, olivier.matz
> -----Original Message-----
> From: Wang, Jie1X <jie1x.wang@intel.com>
> Sent: Wednesday, February 9, 2022 5:39 PM
> To: dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> thomas@monjalon.net; andrew.rybchenko@oktetlabs.ru; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; olivier.matz@6wind.com; Wang, Jie1X
> <jie1x.wang@intel.com>
> Subject: [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH
>
> Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS
> hash based on outer MAC src address and L2TPv2 session ID.
The commit log and the release notes for RSS/FDIR should be changed, too.
>
> Patterns are listed below:
> eth/ipv4/udp/l2tpv2
> eth/ipv4/udp/l2tpv2/ppp
> eth/ipv6/udp/l2tpv2
> eth/ipv6/udp/l2tpv2/ppp
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> ---
> doc/guides/rel_notes/release_22_03.rst | 5 ++
> drivers/net/iavf/iavf.h | 2 +
> drivers/net/iavf/iavf_generic_flow.c | 34 +++++++++++
> drivers/net/iavf/iavf_generic_flow.h | 6 ++
> drivers/net/iavf/iavf_hash.c | 81 ++++++++++++++++++++++++--
> 5 files changed, 124 insertions(+), 4 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_22_03.rst
> b/doc/guides/rel_notes/release_22_03.rst
> index 17c25d899c..37921fc44f 100644
> --- a/doc/guides/rel_notes/release_22_03.rst
> +++ b/doc/guides/rel_notes/release_22_03.rst
> @@ -83,6 +83,11 @@ New Features
> * Added rte_flow support for matching GENEVE packets.
> * Added rte_flow support for matching eCPRI packets.
>
> +* **Updated Intel iavf driver.**
> +
> + * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets
> + based on outer MAC src address and L2TPv2 session ID.
> +
> * **Updated Marvell cnxk crypto PMD.**
>
> * Added SHA256-HMAC support in lookaside protocol (IPsec) for CN10K.
> diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> 0bb5698583..a01d18e61b 100644
> --- a/drivers/net/iavf/iavf.h
> +++ b/drivers/net/iavf/iavf.h
> @@ -93,6 +93,8 @@
>
> #define IAVF_VLAN_TAG_PCP_OFFSET 13
>
> +#define IAVF_L2TPV2_FLAGS_LEN 0x4000
> +
> struct iavf_adapter;
> struct iavf_rx_queue;
> struct iavf_tx_queue;
> diff --git a/drivers/net/iavf/iavf_generic_flow.c
> b/drivers/net/iavf/iavf_generic_flow.c
> index 2befa125ac..1de4187e67 100644
> --- a/drivers/net/iavf/iavf_generic_flow.c
> +++ b/drivers/net/iavf/iavf_generic_flow.c
> @@ -1611,6 +1611,40 @@ enum rte_flow_item_type
> iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
> RTE_FLOW_ITEM_TYPE_END,
> };
>
> +enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] = {
> + RTE_FLOW_ITEM_TYPE_ETH,
> + RTE_FLOW_ITEM_TYPE_IPV4,
> + RTE_FLOW_ITEM_TYPE_UDP,
> + RTE_FLOW_ITEM_TYPE_L2TPV2,
> + RTE_FLOW_ITEM_TYPE_END,
> +};
> +
> +enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] = {
> + RTE_FLOW_ITEM_TYPE_ETH,
> + RTE_FLOW_ITEM_TYPE_IPV4,
> + RTE_FLOW_ITEM_TYPE_UDP,
> + RTE_FLOW_ITEM_TYPE_L2TPV2,
> + RTE_FLOW_ITEM_TYPE_PPP,
> + RTE_FLOW_ITEM_TYPE_END,
> +};
> +
> +enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] = {
> + RTE_FLOW_ITEM_TYPE_ETH,
> + RTE_FLOW_ITEM_TYPE_IPV6,
> + RTE_FLOW_ITEM_TYPE_UDP,
> + RTE_FLOW_ITEM_TYPE_L2TPV2,
> + RTE_FLOW_ITEM_TYPE_END,
> +};
> +
> +enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] = {
> + RTE_FLOW_ITEM_TYPE_ETH,
> + RTE_FLOW_ITEM_TYPE_IPV6,
> + RTE_FLOW_ITEM_TYPE_UDP,
> + RTE_FLOW_ITEM_TYPE_L2TPV2,
> + RTE_FLOW_ITEM_TYPE_PPP,
> + RTE_FLOW_ITEM_TYPE_END,
> +};
> +
> /* PPPoL2TPv2oUDP */
> enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] = {
> RTE_FLOW_ITEM_TYPE_ETH,
> diff --git a/drivers/net/iavf/iavf_generic_flow.h
> b/drivers/net/iavf/iavf_generic_flow.h
> index 3681a96b31..107bbc1a23 100644
> --- a/drivers/net/iavf/iavf_generic_flow.h
> +++ b/drivers/net/iavf/iavf_generic_flow.h
> @@ -410,6 +410,12 @@ extern enum rte_flow_item_type
> iavf_pattern_eth_ipv6_gre_ipv6_tcp[];
> extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[];
> extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[];
>
> +/* L2TPv2 */
> +extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[];
> +extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[];
> +extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[];
> +extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[];
> +
> /* PPPoL2TPv2oUDP */
> extern enum rte_flow_item_type
> iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[];
> extern enum rte_flow_item_type
> iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6[];
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> 5e0888ea68..f35a07653b 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -36,6 +36,7 @@
> #define IAVF_PHINT_MID_IPV6 BIT_ULL(8)
> /* L2TPv2 */
> #define IAVF_PHINT_L2TPV2 BIT_ULL(9)
> +#define IAVF_PHINT_L2TPV2_LEN BIT_ULL(10)
>
> #define IAVF_PHINT_GTPU_MSK (IAVF_PHINT_GTPU | \
> IAVF_PHINT_GTPU_EH | \
> @@ -167,7 +168,9 @@ iavf_hash_parse_pattern_action(struct iavf_adapter
> *ad,
> FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID),
> {BUFF_NOUSED} }
>
> #define proto_hdr_l2tpv2 { \
> - VIRTCHNL_PROTO_HDR_L2TPV2, 0, {BUFF_NOUSED} }
> + VIRTCHNL_PROTO_HDR_L2TPV2, \
> + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID) | \
> + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID),
> {BUFF_NOUSED} }
>
> #define proto_hdr_ppp { \
> VIRTCHNL_PROTO_HDR_PPP, 0, {BUFF_NOUSED} } @@ -392,6 +395,40
> @@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
> proto_hdr_tcp}
> };
>
> +struct virtchnl_proto_hdrs ipv4_l2tpv2_tmplt = {
> + TUNNEL_LEVEL_OUTER, 4,
> + {proto_hdr_eth,
> + proto_hdr_ipv4,
> + proto_hdr_udp,
> + proto_hdr_l2tpv2}
> +};
> +
> +struct virtchnl_proto_hdrs ipv6_l2tpv2_tmplt = {
> + TUNNEL_LEVEL_OUTER, 4,
> + {proto_hdr_eth,
> + proto_hdr_ipv6,
> + proto_hdr_udp,
> + proto_hdr_l2tpv2}
> +};
> +
> +struct virtchnl_proto_hdrs ipv4_l2tpv2_ppp_tmplt = {
> + TUNNEL_LEVEL_OUTER, 5,
> + {proto_hdr_eth,
> + proto_hdr_ipv4,
> + proto_hdr_udp,
> + proto_hdr_l2tpv2,
> + proto_hdr_ppp}
> +};
> +
> +struct virtchnl_proto_hdrs ipv6_l2tpv2_ppp_tmplt = {
> + TUNNEL_LEVEL_OUTER, 5,
> + {proto_hdr_eth,
> + proto_hdr_ipv6,
> + proto_hdr_udp,
> + proto_hdr_l2tpv2,
> + proto_hdr_ppp}
> +};
> +
> /* rss type super set */
>
> /* IPv4 outer */
> @@ -480,6 +517,9 @@ struct virtchnl_proto_hdrs
> udp_l2tpv2_ppp_ipv6_tcp_tmplt = {
> #define IAVF_RSS_TYPE_IPV4_PFCP (RTE_ETH_RSS_PFCP |
> RTE_ETH_RSS_IPV4)
> #define IAVF_RSS_TYPE_IPV6_PFCP (RTE_ETH_RSS_PFCP |
> RTE_ETH_RSS_IPV6)
>
> +/* L2TPv2 */
> +#define IAVF_RSS_TYPE_ETH_L2TPV2 (RTE_ETH_RSS_ETH |
> RTE_ETH_RSS_L2TPV2)
> +
> /**
> * Supported pattern for hash.
> * The first member is pattern item type, @@ -547,6 +587,8 @@ static struct
> iavf_pattern_match_item iavf_hash_pattern_list[] = {
> {iavf_pattern_eth_ipv6_gre_ipv4_tcp,
> IAVF_RSS_TYPE_INNER_IPV4_TCP, &inner_ipv4_tcp_tmplt},
> {iavf_pattern_eth_ipv4_gre_ipv4_udp,
> IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
> {iavf_pattern_eth_ipv6_gre_ipv4_udp,
> IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
> + {iavf_pattern_eth_ipv4_udp_l2tpv2,
> IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_tmplt},
> + {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp,
> IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_ppp_tmplt},
> {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4,
> IAVF_RSS_TYPE_INNER_IPV4, &udp_l2tpv2_ppp_ipv4_tmplt},
> {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp,
> IAVF_RSS_TYPE_INNER_IPV4_UDP,
> &udp_l2tpv2_ppp_ipv4_udp_tmplt},
> {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp,
> IAVF_RSS_TYPE_INNER_IPV4_TCP,
> &udp_l2tpv2_ppp_ipv4_tcp_tmplt},
> @@ -614,6 +656,8 @@ static struct iavf_pattern_match_item
> iavf_hash_pattern_list[] = {
> {iavf_pattern_eth_ipv6_gre_ipv6_tcp,
> IAVF_RSS_TYPE_INNER_IPV6_TCP, &inner_ipv6_tcp_tmplt},
> {iavf_pattern_eth_ipv4_gre_ipv6_udp,
> IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
> {iavf_pattern_eth_ipv6_gre_ipv6_udp,
> IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
> + {iavf_pattern_eth_ipv6_udp_l2tpv2,
> IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_tmplt},
> + {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp,
> IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_ppp_tmplt},
> {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6,
> IAVF_RSS_TYPE_INNER_IPV6, &udp_l2tpv2_ppp_ipv6_tmplt},
> {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp,
> IAVF_RSS_TYPE_INNER_IPV6_UDP,
> &udp_l2tpv2_ppp_ipv6_udp_tmplt},
> {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp,
> IAVF_RSS_TYPE_INNER_IPV6_TCP,
> &udp_l2tpv2_ppp_ipv6_tcp_tmplt},
> @@ -744,6 +788,8 @@ iavf_hash_parse_pattern(const struct rte_flow_item
> pattern[], uint64_t *phint,
> const struct rte_flow_item_gtp_psc *psc;
> const struct rte_flow_item_ecpri *ecpri;
> struct rte_ecpri_common_hdr ecpri_common;
> + const struct rte_flow_item_l2tpv2 *l2tpv2;
> + uint16_t flags_version;
>
> for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++)
> {
> if (item->last) {
> @@ -802,7 +848,18 @@ iavf_hash_parse_pattern(const struct rte_flow_item
> pattern[], uint64_t *phint,
> *phint |= IAVF_PHINT_GRE;
> break;
> case RTE_FLOW_ITEM_TYPE_L2TPV2:
> - *phint |= IAVF_PHINT_L2TPV2;
> + l2tpv2 = item->spec;
> +
> + if (l2tpv2) {
> + flags_version =
> + rte_be_to_cpu_16(l2tpv2-
> >hdr.common.flags_version);
> + if (flags_version & IAVF_L2TPV2_FLAGS_LEN)
> + *phint |= IAVF_PHINT_L2TPV2_LEN;
> + else
> + *phint |= IAVF_PHINT_L2TPV2;
> + } else {
> + *phint |= IAVF_PHINT_L2TPV2;
> + }
> break;
> default:
> break;
> @@ -1024,6 +1081,10 @@ iavf_refine_proto_hdrs_l234(struct
> virtchnl_proto_hdrs *proto_hdrs,
> if (!(rss_type & RTE_ETH_RSS_ECPRI))
> hdr->field_selector = 0;
> break;
> + case VIRTCHNL_PROTO_HDR_L2TPV2:
> + if (!(rss_type & RTE_ETH_RSS_L2TPV2))
> + hdr->field_selector = 0;
> + break;
> default:
> break;
> }
> @@ -1130,10 +1191,10 @@ static void
> iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs,
> uint64_t phint)
> {
> - struct virtchnl_proto_hdr *hdr1;
> + struct virtchnl_proto_hdr *hdr, *hdr1;
> int i;
>
> - if (!(phint & IAVF_PHINT_L2TPV2))
> + if (!(phint & IAVF_PHINT_L2TPV2) && !(phint &
> IAVF_PHINT_L2TPV2_LEN))
> return;
>
> if (proto_hdrs->tunnel_level == TUNNEL_LEVEL_INNER) { @@ -1150,7
> +1211,19 @@ iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs
> *proto_hdrs,
> VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4);
> else if (phint & IAVF_PHINT_OUTER_IPV6)
> VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV6);
> + } else {
> + for (i = 0; i < proto_hdrs->count; i++) {
> + hdr = &proto_hdrs->proto_hdr[i];
> + if (hdr->type == VIRTCHNL_PROTO_HDR_L2TPV2) {
> + if (phint & IAVF_PHINT_L2TPV2) {
> + REFINE_PROTO_FLD(DEL,
> L2TPV2_LEN_SESS_ID);
> + } else if (phint & IAVF_PHINT_L2TPV2_LEN) {
> + REFINE_PROTO_FLD(DEL,
> L2TPV2_SESS_ID);
> + }
> + }
> + }
> }
> +
> }
>
> static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
> --
> 2.25.1
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type
2022-02-09 9:38 ` [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
@ 2022-02-09 20:42 ` Ferruh Yigit
0 siblings, 0 replies; 41+ messages in thread
From: Ferruh Yigit @ 2022-02-09 20:42 UTC (permalink / raw)
To: Jie Wang, dev
Cc: stevex.yang, orika, aman.deep.singh, thomas, andrew.rybchenko,
jingjing.wu, beilei.xing, qi.z.zhang, olivier.matz
On 2/9/2022 9:38 AM, Jie Wang wrote:
> This patch defines new RSS offload type for L2TPv2, which
> is required when users want to distribute packets based on
> the L2TPv2 session ID field.
>
> Signed-off-by: Jie Wang<jie1x.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
` (5 preceding siblings ...)
2022-02-09 9:38 ` [PATCH v5 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
@ 2022-02-09 20:44 ` Ferruh Yigit
2022-02-10 2:13 ` Wang, Jie1X
6 siblings, 1 reply; 41+ messages in thread
From: Ferruh Yigit @ 2022-02-09 20:44 UTC (permalink / raw)
To: Jie Wang, dev
Cc: stevex.yang, orika, aman.deep.singh, thomas, andrew.rybchenko,
jingjing.wu, beilei.xing, qi.z.zhang, olivier.matz
On 2/9/2022 9:38 AM, Jie Wang wrote:
> Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow
> director. Required to distribute packets based on outer MAC src
> address and L2TPv2 session ID.
>
> Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute
> packets based on inner IP src+dest address and TCP/UDP src+dest port.
>
> ---
> v5:
> * remove the comment of new macros.
> * update cmd_help_long_parsed() and testpmd_funcs.rst.
> * update RSS hash/FDIR input set.
> * rebase the main branch code.
> v4:
> * update new macros in ethdev.
> * update commit log.
> * rebase the main branch code.
> v3:
> * update new macros in ethdev.
> * update commit log.
> * rebase the main branch code.
> v2:
> * upadte release notes.
> * add comment for RTE_ETH_RSS_L2TPV2.
> * update ipv6 l2tpv2 flow item.
> * rebase the main branch code.
>
> Jie Wang (6):
> ethdev: add L2TPv2 RSS offload type
> net: fix L2TPv2 common header
> app/testpmd: add 6 types of L2TPv2 message
> common/iavf: add session ID fields for L2TPv2
> net/iavf: support L2TPv2 for AVF HASH
> net/iavf: support L2TPv2 for AVF FDIR
>
Applied first three patch to dpdk-next-net/main, thanks.
Set applied partially to make library (etdev) part in -rc1,
last three patches are driver (iavf) patches and can be merged
after -rc1.
Can you please send remaining patches as separate patchset, to
help maintainer and CI?
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR
2022-02-09 20:44 ` [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
@ 2022-02-10 2:13 ` Wang, Jie1X
0 siblings, 0 replies; 41+ messages in thread
From: Wang, Jie1X @ 2022-02-10 2:13 UTC (permalink / raw)
To: Yigit, Ferruh, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, thomas, andrew.rybchenko,
Wu, Jingjing, Xing, Beilei, Zhang, Qi Z, olivier.matz
> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Thursday, February 10, 2022 4:45 AM
> To: Wang, Jie1X <jie1x.wang@intel.com>; dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; thomas@monjalon.net;
> andrew.rybchenko@oktetlabs.ru; Wu, Jingjing <jingjing.wu@intel.com>; Xing,
> Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> olivier.matz@6wind.com
> Subject: Re: [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR
>
> On 2/9/2022 9:38 AM, Jie Wang wrote:
> > Support IAVF L2TPv2(include PPP over L2tpv2) RSS hash and flow
> > director. Required to distribute packets based on outer MAC src
> > address and L2TPv2 session ID.
> >
> > Support IAVF PPPoL2TPv2oUDP flow director. Required to distribute
> > packets based on inner IP src+dest address and TCP/UDP src+dest port.
> >
> > ---
> > v5:
> > * remove the comment of new macros.
> > * update cmd_help_long_parsed() and testpmd_funcs.rst.
> > * update RSS hash/FDIR input set.
> > * rebase the main branch code.
> > v4:
> > * update new macros in ethdev.
> > * update commit log.
> > * rebase the main branch code.
> > v3:
> > * update new macros in ethdev.
> > * update commit log.
> > * rebase the main branch code.
> > v2:
> > * upadte release notes.
> > * add comment for RTE_ETH_RSS_L2TPV2.
> > * update ipv6 l2tpv2 flow item.
> > * rebase the main branch code.
> >
> > Jie Wang (6):
> > ethdev: add L2TPv2 RSS offload type
> > net: fix L2TPv2 common header
> > app/testpmd: add 6 types of L2TPv2 message
> > common/iavf: add session ID fields for L2TPv2
> > net/iavf: support L2TPv2 for AVF HASH
> > net/iavf: support L2TPv2 for AVF FDIR
> >
>
> Applied first three patch to dpdk-next-net/main, thanks.
>
> Set applied partially to make library (etdev) part in -rc1, last three patches are
> driver (iavf) patches and can be merged after -rc1.
>
> Can you please send remaining patches as separate patchset, to help maintainer
> and CI?
Yes, I'll send remaining patches as new patch set.
^ permalink raw reply [flat|nested] 41+ messages in thread
* RE: [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2
2022-02-09 9:38 ` [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
@ 2022-02-11 1:37 ` Zhang, Qi Z
0 siblings, 0 replies; 41+ messages in thread
From: Zhang, Qi Z @ 2022-02-11 1:37 UTC (permalink / raw)
To: Wang, Jie1X, dev
Cc: Yang, SteveX, orika, Singh, Aman Deep, Yigit, Ferruh, thomas,
andrew.rybchenko, Wu, Jingjing, Xing, Beilei, olivier.matz
> -----Original Message-----
> From: Wang, Jie1X <jie1x.wang@intel.com>
> Sent: Wednesday, February 9, 2022 5:39 PM
> To: dev@dpdk.org
> Cc: Yang, SteveX <stevex.yang@intel.com>; orika@nvidia.com; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> thomas@monjalon.net; andrew.rybchenko@oktetlabs.ru; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; olivier.matz@6wind.com; Wang, Jie1X
> <jie1x.wang@intel.com>
> Subject: [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2
>
> Add virtchnl fields session ID of L2TPv2 for AVF HASH.
>
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2022-02-11 1:37 UTC | newest]
Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 6:24 [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Jie Wang
2022-01-29 6:24 ` [PATCH v3 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-01-30 9:15 ` Ori Kam
2022-02-01 12:19 ` Ferruh Yigit
2022-01-29 6:24 ` [PATCH v3 2/6] net: fix L2TPv2 common header Jie Wang
2022-01-30 9:17 ` Ori Kam
2022-02-01 12:20 ` Ferruh Yigit
2022-01-29 6:24 ` [PATCH v3 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
2022-01-30 9:19 ` Ori Kam
2022-01-29 6:24 ` [PATCH v3 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
2022-01-29 6:24 ` [PATCH v3 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
2022-01-29 6:24 ` [PATCH v3 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
2022-02-01 12:22 ` [PATCH v3 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
2022-02-08 8:38 ` [PATCH v4 " Jie Wang
2022-02-08 8:38 ` [PATCH v4 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-02-08 13:13 ` Ferruh Yigit
2022-02-08 14:43 ` Ferruh Yigit
2022-02-08 8:38 ` [PATCH v4 2/6] net: fix L2TPv2 common header Jie Wang
2022-02-08 8:38 ` [PATCH v4 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
2022-02-08 8:38 ` [PATCH v4 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
2022-02-08 8:38 ` [PATCH v4 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
2022-02-09 7:01 ` Xing, Beilei
2022-02-09 7:43 ` Wang, Jie1X
2022-02-09 8:17 ` Zhang, Qi Z
2022-02-08 8:38 ` [PATCH v4 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
2022-02-09 7:30 ` Xing, Beilei
2022-02-09 7:45 ` Wang, Jie1X
2022-02-08 14:44 ` [PATCH v4 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
2022-02-09 8:20 ` Zhang, Qi Z
2022-02-09 9:38 ` [PATCH v5 " Jie Wang
2022-02-09 9:38 ` [PATCH v5 1/6] ethdev: add L2TPv2 RSS offload type Jie Wang
2022-02-09 20:42 ` Ferruh Yigit
2022-02-09 9:38 ` [PATCH v5 2/6] net: fix L2TPv2 common header Jie Wang
2022-02-09 9:38 ` [PATCH v5 3/6] app/testpmd: add 6 types of L2TPv2 message Jie Wang
2022-02-09 9:38 ` [PATCH v5 4/6] common/iavf: add session ID fields for L2TPv2 Jie Wang
2022-02-11 1:37 ` Zhang, Qi Z
2022-02-09 9:38 ` [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH Jie Wang
2022-02-09 12:21 ` Xing, Beilei
2022-02-09 9:38 ` [PATCH v5 6/6] net/iavf: support L2TPv2 for AVF FDIR Jie Wang
2022-02-09 20:44 ` [PATCH v5 0/6] support L2TPv2 for AVF RSS hash and FDIR Ferruh Yigit
2022-02-10 2:13 ` Wang, Jie1X
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).