summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2021-08-06 09:03:45 +0000
committerNeale Ranns <neale@graphiant.com>2021-10-03 16:18:06 +0000
commit9bd92abc7cef482ce67a80ecbbeabb5eb586a06c (patch)
tree05b9dfc4a70c0ef56c2044c5ec73ccb60f78b1fe
parentf5462369f3ad22c9d19f54832faa2b6e61449f66 (diff)
mpls: Save the L3 header offset in the meta-data before label imposition
Type: improvement Subsequent features in the data-path can thus easily find the l3 header without parsing the label stack. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I26f7d4bbe9186aeb8654706579c72424e8ecca2c
-rw-r--r--src/vnet/dpo/mpls_label_dpo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vnet/dpo/mpls_label_dpo.c b/src/vnet/dpo/mpls_label_dpo.c
index b87cb1efcd2..7856f050cb0 100644
--- a/src/vnet/dpo/mpls_label_dpo.c
+++ b/src/vnet/dpo/mpls_label_dpo.c
@@ -439,8 +439,14 @@ mpls_label_imposition_inline (vlib_main_t * vm,
if (DPO_PROTO_MPLS != dproto)
{
/*
- * These are the non-MPLS payload imposition cases
+ * These are the non-MPLS payload imposition cases.
+ * Save the l3 offset
*/
+ vnet_buffer (b0)->l3_hdr_offset = b0->current_data;
+ vnet_buffer (b1)->l3_hdr_offset = b1->current_data;
+ vnet_buffer (b2)->l3_hdr_offset = b2->current_data;
+ vnet_buffer (b3)->l3_hdr_offset = b3->current_data;
+
if (DPO_PROTO_IP4 == dproto)
{
ip4_header_t * ip0 = vlib_buffer_get_current(b0);
@@ -785,6 +791,8 @@ mpls_label_imposition_inline (vlib_main_t * vm,
if (DPO_PROTO_MPLS != dproto)
{
+ vnet_buffer (b0)->l3_hdr_offset = b0->current_data;
+
if (DPO_PROTO_IP4 == dproto)
{
/*