@@ -271,6 +271,10 @@ enum index {
ITEM_META_DATA,
ITEM_GRE_KEY,
ITEM_GRE_KEY_VALUE,
+ ITEM_GRE_OPTION,
+ ITEM_GRE_OPTION_CHECKSUM,
+ ITEM_GRE_OPTION_KEY,
+ ITEM_GRE_OPTION_SEQUENCE,
ITEM_GTP_PSC,
ITEM_GTP_PSC_QFI,
ITEM_GTP_PSC_PDU_T,
@@ -1042,6 +1046,7 @@ struct parse_action_priv {
ITEM_ICMP6_ND_OPT_TLA_ETH,
ITEM_META,
ITEM_GRE_KEY,
+ ITEM_GRE_OPTION,
ITEM_GTP_PSC,
ITEM_PPPOES,
ITEM_PPPOED,
@@ -1232,6 +1237,14 @@ struct parse_action_priv {
ZERO,
};
+static const enum index item_gre_option[] = {
+ ITEM_GRE_OPTION_CHECKSUM,
+ ITEM_GRE_OPTION_KEY,
+ ITEM_GRE_OPTION_SEQUENCE,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index item_gtp[] = {
ITEM_GTP_FLAGS,
ITEM_GTP_MSG_TYPE,
@@ -3479,6 +3492,37 @@ static int comp_set_modify_field_id(struct context *, const struct token *,
item_param),
.args = ARGS(ARG_ENTRY_HTON(rte_be32_t)),
},
+ [ITEM_GRE_OPTION] = {
+ .name = "gre_option",
+ .help = "match GRE optional fields",
+ .priv = PRIV_ITEM(GRE_OPTION, sizeof(struct rte_gre_hdr_option)),
+ .next = NEXT(item_gre_option),
+ .call = parse_vc,
+ },
+ [ITEM_GRE_OPTION_CHECKSUM] = {
+ .name = "checksum",
+ .help = "match GRE checksum",
+ .next = NEXT(item_gre_option, NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_gre_hdr_option,
+ checksum)),
+ },
+ [ITEM_GRE_OPTION_KEY] = {
+ .name = "key",
+ .help = "match GRE key",
+ .next = NEXT(item_gre_option, NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_gre_hdr_option,
+ key)),
+ },
+ [ITEM_GRE_OPTION_SEQUENCE] = {
+ .name = "sequence",
+ .help = "match GRE sequence",
+ .next = NEXT(item_gre_option, NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_gre_hdr_option,
+ sequence)),
+ },
[ITEM_GTP_PSC] = {
.name = "gtp_psc",
.help = "match GTP extension header with type 0x85",
@@ -9235,6 +9279,19 @@ static int comp_set_modify_field_id(struct context *, const struct token *,
((const struct rte_flow_item_flex *)
item->spec)->length : 0;
break;
+ case RTE_FLOW_ITEM_TYPE_GRE_OPTION:
+ size = 0;
+ if (item->spec) {
+ const struct rte_gre_hdr_option *opt = item->spec;
+ if (opt->checksum)
+ size += 4;
+ if (opt->key)
+ size += 4;
+ if (opt->sequence)
+ size += 4;
+ }
+ proto = 0x2F;
+ break;
default:
fprintf(stderr, "Error - Not supported item\n");
goto error;
@@ -3714,6 +3714,12 @@ This section lists supported pattern items and their attributes, if any.
- ``value {unsigned}``: key value.
+- ``gre_option``: match GRE optional fields(checksum/key/sequence).
+
+ - ``checksum {unsigned}``: checksum value.
+ - ``key {unsigned}``: key value.
+ - ``sequence {unsigned}``: sequence number value.
+
- ``fuzzy``: fuzzy pattern match, expect faster than default.
- ``thresh {unsigned}``: accuracy threshold.