aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorVijayabhaskar Katamreddy <vkatamre@cisco.com>2018-01-25 15:12:11 -0800
committerFlorin Coras <florin.coras@gmail.com>2018-01-29 15:50:36 +0000
commitc592ca527acee041ef330bb27de35764d746202c (patch)
tree837f31279e01636c1e9b02f68e33dc41d7c20786 /src/vnet
parent30349b075cf939549980f2a32e030b32f6d07e9a (diff)
DRAFT ip4/6_frag to support DPO Style based Next Node
Change-Id: I1df3d23c1c5668b83d52b41f51c0e3f24183af9e Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/buffer.h1
-rw-r--r--src/vnet/ip/ip_frag.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h
index 097f68f6c06..dfab874070d 100644
--- a/src/vnet/buffer.h
+++ b/src/vnet/buffer.h
@@ -289,6 +289,7 @@ typedef struct
/* IP Fragmentation */
struct
{
+ u32 pad[2]; /* do not overlay w/ ip.adj_index[0,1] */
u16 header_offset;
u16 mtu;
u8 next_index;
diff --git a/src/vnet/ip/ip_frag.c b/src/vnet/ip/ip_frag.c
index 2af697e96b6..fba25fffff7 100644
--- a/src/vnet/ip/ip_frag.c
+++ b/src/vnet/ip/ip_frag.c
@@ -131,6 +131,12 @@ ip4_frag_do_fragment (vlib_main_t * vm, u32 pi, u32 ** buffer,
vnet_buffer (p)->sw_if_index[VLIB_RX];
vnet_buffer (b)->sw_if_index[VLIB_TX] =
vnet_buffer (p)->sw_if_index[VLIB_TX];
+ /* Copy Adj_index in case DPO based node is sending for the fragmentation,
+ the packet would be sent back to the proper DPO next node and Index */
+ vnet_buffer (b)->ip.adj_index[VLIB_RX] =
+ vnet_buffer (p)->ip.adj_index[VLIB_RX];
+ vnet_buffer (b)->ip.adj_index[VLIB_TX] =
+ vnet_buffer (p)->ip.adj_index[VLIB_TX];
fip4 = (ip4_header_t *) (vlib_buffer_get_current (b) + offset);
//Copy offset and ip4 header
@@ -393,6 +399,14 @@ ip6_frag_do_fragment (vlib_main_t * vm, u32 pi, u32 ** buffer,
vnet_buffer (p)->sw_if_index[VLIB_RX];
vnet_buffer (b)->sw_if_index[VLIB_TX] =
vnet_buffer (p)->sw_if_index[VLIB_TX];
+
+ /* Copy Adj_index in case DPO based node is sending for the fragmentation,
+ the packet would be sent back to the proper DPO next node and Index */
+ vnet_buffer (b)->ip.adj_index[VLIB_RX] =
+ vnet_buffer (p)->ip.adj_index[VLIB_RX];
+ vnet_buffer (b)->ip.adj_index[VLIB_TX] =
+ vnet_buffer (p)->ip.adj_index[VLIB_TX];
+
clib_memcpy (vlib_buffer_get_current (b),
vlib_buffer_get_current (p), headers_len);
clib_memcpy (vlib_buffer_get_current (b) + headers_len,