Add "uint8_t last_rsvd" as union with origin rsvd1.
Add RTE_FLOW_FIELD_VXLAN_LAST_RSVD into rte flow packet
field.

The new union is used by testpmd matching item VXLAN
"last_rsvd" and modify target "vxlan_last_rsvd".

Signed-off-by: Rongwei Liu <rongw...@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnow...@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 1 +
 lib/ethdev/rte_flow.h       | 1 +
 lib/net/rte_vxlan.h         | 5 ++++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 775ce20fc4..f3d6a2cfd7 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
        "ipv6_flow_label", "ipv6_traffic_class",
        "esp_spi", "esp_seq_num", "esp_proto",
        "random",
+       "vxlan_last_rsvd",
        NULL
 };
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 6e8ab1d4c7..74cf2e0f59 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
        RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
        RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
        RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+       RTE_FLOW_FIELD_VXLAN_LAST_RSVD, /**< VXLAN last reserved byte. */
 };
 
 /**
diff --git a/lib/net/rte_vxlan.h b/lib/net/rte_vxlan.h
index 997fc784fc..57300fb442 100644
--- a/lib/net/rte_vxlan.h
+++ b/lib/net/rte_vxlan.h
@@ -41,7 +41,10 @@ struct rte_vxlan_hdr {
                        uint8_t    flags;    /**< Should be 8 (I flag). */
                        uint8_t    rsvd0[3]; /**< Reserved. */
                        uint8_t    vni[3];   /**< VXLAN identifier. */
-                       uint8_t    rsvd1;    /**< Reserved. */
+                       union {
+                               uint8_t    rsvd1;        /**< Reserved. */
+                               uint8_t    last_rsvd;    /**< Reserved. */
+                       };
                };
        };
 } __rte_packed;
-- 
2.27.0

Reply via email to