tcp: add option to pass opaque to next node 70/20270/2
authorFlorin Coras <fcoras@cisco.com>
Thu, 20 Jun 2019 19:18:31 +0000 (12:18 -0700)
committerJohn Lo <loj@cisco.com>
Fri, 21 Jun 2019 00:57:08 +0000 (00:57 +0000)
Type:feature

Change-Id: I0b72954a6ae6a05abe0761cb4f227072863f127b
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/buffer.h
src/vnet/tcp/tcp.h
src/vnet/tcp/tcp_output.c

index 812fe74..324c903 100644 (file)
@@ -327,7 +327,11 @@ typedef struct
     struct
     {
       u32 connection_index;
-      u32 seq_number;
+      union
+      {
+       u32 seq_number;
+       u32 next_node_opaque;
+      };
       u32 seq_end;
       u32 ack_number;
       u16 hdr_offset;          /**< offset relative to ip hdr */
index 132ec13..bc1e3c0 100644 (file)
@@ -323,7 +323,8 @@ typedef struct _tcp_connection
   u32 tx_fifo_size;    /**< Tx fifo size. Used to constrain cwnd */
 
   u32 psh_seq;         /**< Add psh header for seg that includes this */
-  u32 out_next_index;  /**< Can be used to control next node in output */
+  u32 next_node_index; /**< Can be used to control next node in output */
+  u32 next_node_opaque;        /**< Opaque to pass to next node */
 } tcp_connection_t;
 
 /* *INDENT-OFF* */
index abd674d..1adac95 100644 (file)
@@ -2063,7 +2063,11 @@ tcp_output_handle_packet (tcp_connection_t * tc0, vlib_buffer_t * b0,
     }
 
   /* If next_index is not drop use it */
-  *next0 = tc0->out_next_index ? tc0->out_next_index : *next0;
+  if (tc0->next_node_index)
+    {
+      *next0 = tc0->next_node_index;
+      vnet_buffer (b0)->tcp.next_node_opaque = tc0->next_node_opaque;
+    }
 
   vnet_buffer (b0)->sw_if_index[VLIB_TX] = tc0->c_fib_index;
   vnet_buffer (b0)->sw_if_index[VLIB_RX] = 0;