VCL: remove vrf from vppcom api.
[vpp.git] / src / vcl / vppcom.c
index 373304b..7edb69c 100644 (file)
@@ -157,7 +157,6 @@ typedef struct
   u32 wait_cont_idx;
   vppcom_epoll_t vep;
   int libc_epfd;
-  u32 vrf;
   vppcom_ip46_t lcl_addr;
   vppcom_ip46_t peer_addr;
   u16 lcl_port;                        // network order
@@ -441,6 +440,10 @@ vppcom_connect_to_vpp (char *app_name)
       vcm->vl_input_queue = am->shmem_hdr->vl_input_queue;
       vcm->my_client_index = am->my_client_index;
       vcm->app_state = STATE_APP_CONN_VPP;
+
+      if (VPPCOM_DEBUG > 0)
+       clib_warning ("VCL<%d>: app (%s) is connected to VPP!",
+                     getpid (), app_name);
     }
 
   if (VPPCOM_DEBUG > 0)
@@ -471,9 +474,6 @@ vppcom_connect_to_vpp (char *app_name)
       ed->data = rv;
       /* *INDENT-ON* */
     }
-
-  clib_warning ("VCL<%d>: app (%s) is connected to VPP!",
-               getpid (), app_name);
   return rv;
 }
 
@@ -1042,7 +1042,6 @@ vppcom_send_connect_sock (session_t * session, u32 session_index)
   cmp->client_index = vcm->my_client_index;
   cmp->context = session_index;
 
-  cmp->vrf = session->vrf;
   cmp->is_ip4 = session->peer_addr.is_ip4;
   clib_memcpy (cmp->ip, &session->peer_addr.ip46, sizeof (cmp->ip));
   cmp->port = session->peer_port;
@@ -1487,7 +1486,6 @@ vppcom_send_bind_sock (session_t * session, u32 session_index)
   bmp->_vl_msg_id = ntohs (VL_API_BIND_SOCK);
   bmp->client_index = vcm->my_client_index;
   bmp->context = session_index;
-  bmp->vrf = session->vrf;
   bmp->is_ip4 = session->lcl_addr.is_ip4;
   clib_memcpy (bmp->ip, &session->lcl_addr.ip46, sizeof (bmp->ip));
   bmp->port = session->lcl_port;
@@ -1632,7 +1630,6 @@ vppcom_session_disconnect (u32 session_index)
     {
       if (is_server)
        {
-         svm_fifo_segment_main_t *sm = &svm_fifo_segment_main;
          svm_fifo_segment_private_t *seg;
 
          VCL_LOCK_AND_GET_SESSION (session_index, &session);
@@ -1648,7 +1645,7 @@ vppcom_session_disconnect (u32 session_index)
                          session->server_tx_fifo,
                          session->server_tx_fifo->refcnt);
 
-         seg = vec_elt_at_index (sm->segments, session->sm_seg_index);
+         seg = svm_fifo_segment_get_segment (session->sm_seg_index);
          svm_fifo_segment_free_fifo (seg, session->server_rx_fifo,
                                      FIFO_SEGMENT_RX_FREELIST);
          svm_fifo_segment_free_fifo (seg, session->server_tx_fifo,
@@ -2304,8 +2301,8 @@ vppcom_app_create (char *app_name)
 
       clib_time_init (&vcm->clib_time);
       vppcom_init_error_string_table ();
-      svm_fifo_segment_init (vcl_cfg->segment_baseva,
-                            20 /* timeout in secs */ );
+      svm_fifo_segment_main_init (vcl_cfg->segment_baseva,
+                                 20 /* timeout in secs */ );
       clib_spinlock_init (&vcm->sessions_lockp);
     }
 
@@ -2402,7 +2399,7 @@ vppcom_app_destroy (void)
 }
 
 int
-vppcom_session_create (u32 vrf, u8 proto, u8 is_nonblocking)
+vppcom_session_create (u8 proto, u8 is_nonblocking)
 {
   session_t *session;
   u32 session_index;
@@ -2412,7 +2409,6 @@ vppcom_session_create (u32 vrf, u8 proto, u8 is_nonblocking)
   memset (session, 0, sizeof (*session));
   session_index = session - vcm->sessions;
 
-  session->vrf = vrf;
   session->proto = proto;
   session->state = STATE_START;
   session->is_nonblocking = is_nonblocking ? 1 : 0;
@@ -2432,20 +2428,19 @@ vppcom_session_create (u32 vrf, u8 proto, u8 is_nonblocking)
       /* *INDENT-OFF* */
       ELOG_TYPE_DECLARE (e) =
       {
-       .format = "session_create:vrf:%d proto:%d state:%d is_nonblocking:%d",
-       .format_args = "i4i4i4i4",
+       .format = "session_create:proto:%d state:%d is_nonblocking:%d",
+       .format_args = "i4i4i4",
       };
 
       struct
       {
-       u32 data[4];
+       u32 data[3];
       } *ed;
 
       ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
-      ed->data[0] = session->vrf;
-      ed->data[1] = session->proto;
-      ed->data[2] = session->state;
-      ed->data[3] = session->is_nonblocking;
+      ed->data[0] = session->proto;
+      ed->data[1] = session->state;
+      ed->data[2] = session->is_nonblocking;
       /* *INDENT-ON* */
     }
 
@@ -2607,7 +2602,6 @@ vppcom_session_bind (uint32_t session_index, vppcom_endpt_t * ep)
       goto done;
     }
 
-  session->vrf = ep->vrf;
   session->lcl_addr.is_ip4 = ep->is_ip4;
   session->lcl_addr.ip46 = to_ip46 (!ep->is_ip4, ep->ip);
   session->lcl_port = ep->port;
@@ -2722,7 +2716,7 @@ vppcom_session_accept (uint32_t listen_session_index, vppcom_endpt_t * ep,
 {
   session_t *listen_session = 0;
   session_t *client_session = 0;
-  u32 client_session_index = ~0;
+  u32 client_session_index = ~0, n_fifos;
   int rv;
   f64 wait_for;
   char *cut_thru_str;
@@ -2795,7 +2789,6 @@ vppcom_session_accept (uint32_t listen_session_index, vppcom_endpt_t * ep,
 
   if (ep)
     {
-      ep->vrf = client_session->vrf;
       ep->is_cut_thru = client_session->is_cut_thru;
       ep->is_ip4 = client_session->peer_addr.is_ip4;
       ep->port = client_session->peer_port;
@@ -2821,9 +2814,6 @@ vppcom_session_accept (uint32_t listen_session_index, vppcom_endpt_t * ep,
        format ((u8 *) a->segment_name, "%d:segment%d%c",
                getpid (), vcm->unique_segment_index++, 0);
       a->segment_size = vcm->cfg.segment_size;
-      a->preallocated_fifo_pairs = vcm->cfg.preallocated_fifo_pairs;
-      a->rx_fifo_size = vcm->cfg.rx_fifo_size;
-      a->tx_fifo_size = vcm->cfg.tx_fifo_size;
 
       rv = svm_fifo_segment_create (a);
       if (PREDICT_FALSE (rv))
@@ -2850,6 +2840,14 @@ vppcom_session_accept (uint32_t listen_session_index, vppcom_endpt_t * ep,
       vec_free (a->new_segment_indices);
 
       seg = svm_fifo_segment_get_segment (client_session->sm_seg_index);
+      if (vcm->cfg.preallocated_fifo_pairs)
+       {
+         n_fifos = vcm->cfg.preallocated_fifo_pairs;
+         svm_fifo_segment_preallocate_fifo_pairs (seg, vcm->cfg.rx_fifo_size,
+                                                  vcm->cfg.tx_fifo_size,
+                                                  &n_fifos);
+       }
+
       client_session->server_rx_fifo =
        svm_fifo_segment_alloc_fifo (seg, vcm->cfg.rx_fifo_size,
                                     FIFO_SEGMENT_RX_FREELIST);
@@ -3049,7 +3047,6 @@ vppcom_session_connect (uint32_t session_index, vppcom_endpt_t * server_ep)
       goto done;
     }
 
-  session->vrf = server_ep->vrf;
   session->peer_addr.is_ip4 = server_ep->is_ip4;
   session->peer_addr.ip46 = to_ip46 (!server_ep->is_ip4, server_ep->ip);
   session->peer_port = server_ep->port;
@@ -4418,7 +4415,6 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
       if (PREDICT_TRUE (buffer && buflen &&
                        (*buflen >= sizeof (*ep)) && ep->ip))
        {
-         ep->vrf = session->vrf;
          ep->is_ip4 = session->peer_addr.is_ip4;
          ep->port = session->peer_port;
          if (session->peer_addr.is_ip4)
@@ -4485,7 +4481,6 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
       if (PREDICT_TRUE (buffer && buflen &&
                        (*buflen >= sizeof (*ep)) && ep->ip))
        {
-         ep->vrf = session->vrf;
          ep->is_ip4 = session->lcl_addr.is_ip4;
          ep->port = session->lcl_port;
          if (session->lcl_addr.is_ip4)
@@ -4558,21 +4553,15 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
          /* *INDENT-OFF* */
          ELOG_TYPE_DECLARE (e) =
            {
-             .format = "VPPCOM_ATTR_GET_LIBC_EPFD: libc_epfd=%s%d buflen=%d",
-             .format_args = "t1i4i4",
-             .n_enum_strings = 2,
-             .enum_strings = {"", "-",},
+             .format = "VPPCOM_ATTR_GET_LIBC_EPFD: libc_epfd=%d",
+             .format_args = "i4",
            };
          CLIB_PACKED (struct {
-           u8 sign;
-           u32 data[2];
+           i32 data;
          }) * ed;
 
          ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
-
-         ed->sign = (session->libc_epfd < 0);
-         ed->data[0] = abs(session->libc_epfd);
-         ed->data[1] = *buflen;
+         ed->data = session->libc_epfd;
          /* *INDENT-ON* */
        }
 
@@ -4839,7 +4828,7 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
          /* VPP-TBD */
          session->rcvbuf_size = *(u32 *) buffer;
          if (VPPCOM_DEBUG > 2)
-           clib_warning ("VCL<%d>: VPPCOM_ATTR_SET_TX_FIFO_LEN: %u (0x%x), "
+           clib_warning ("VCL<%d>: VPPCOM_ATTR_SET_RX_FIFO_LEN: %u (0x%x), "
                          "buflen %d, #VPP-TBD#", getpid (),
                          session->sndbuf_size, session->sndbuf_size,
                          *buflen);
@@ -4848,7 +4837,7 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
              /* *INDENT-OFF* */
              ELOG_TYPE_DECLARE (e) =
                {
-                 .format = "VPPCOM_ATTR_SET_TX_FIFO_LEN: 0x%x buflen=%d",
+                 .format = "VPPCOM_ATTR_SET_RX_FIFO_LEN: 0x%x buflen=%d",
                  .format_args = "i4i4",
                };
 
@@ -5066,6 +5055,25 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
                          VCL_SESS_ATTR_TEST (session->attr,
                                              VCL_SESS_ATTR_BROADCAST),
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_SET_BROADCAST: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = VCL_SESS_ATTR_TEST (session->attr,
+                                               VCL_SESS_ATTR_BROADCAST);
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5083,6 +5091,24 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
            clib_warning ("VCL<%d>: VPPCOM_ATTR_GET_V6ONLY: %d, "
                          "buflen %d, #VPP-TBD#", getpid (), *(int *) buffer,
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_GET_V6ONLY: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = *(int *) buffer;
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5102,6 +5128,25 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
                          "buflen %d, #VPP-TBD#", getpid (),
                          VCL_SESS_ATTR_TEST (session->attr,
                                              VCL_SESS_ATTR_V6ONLY), *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_SET_V6ONLY: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = VCL_SESS_ATTR_TEST (session->attr,
+                                               VCL_SESS_ATTR_V6ONLY);
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5119,6 +5164,24 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
            clib_warning ("VCL<%d>: VPPCOM_ATTR_GET_KEEPALIVE: %d, "
                          "buflen %d, #VPP-TBD#", getpid (), *(int *) buffer,
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_GET_KEEPALIVE: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = *(int *) buffer;
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5139,6 +5202,25 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
                          VCL_SESS_ATTR_TEST (session->attr,
                                              VCL_SESS_ATTR_KEEPALIVE),
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_SET_KEEPALIVE: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = VCL_SESS_ATTR_TEST (session->attr,
+                                               VCL_SESS_ATTR_KEEPALIVE);
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5156,6 +5238,24 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
            clib_warning ("VCL<%d>: VPPCOM_ATTR_GET_TCP_NODELAY: %d, "
                          "buflen %d, #VPP-TBD#", getpid (), *(int *) buffer,
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_GET_TCP_NODELAY: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = *(int *) buffer;
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5176,6 +5276,25 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
                          VCL_SESS_ATTR_TEST (session->attr,
                                              VCL_SESS_ATTR_TCP_NODELAY),
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_SET_TCP_NODELAY: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = VCL_SESS_ATTR_TEST (session->attr,
+                                               VCL_SESS_ATTR_TCP_NODELAY);
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5193,6 +5312,24 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
            clib_warning ("VCL<%d>: VPPCOM_ATTR_GET_TCP_KEEPIDLE: %d, "
                          "buflen %d, #VPP-TBD#", getpid (), *(int *) buffer,
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_GET_TCP_KEEPIDLE: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = *(int *) buffer;
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5213,6 +5350,25 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
                          VCL_SESS_ATTR_TEST (session->attr,
                                              VCL_SESS_ATTR_TCP_KEEPIDLE),
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_SET_TCP_KEEPIDLE: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = VCL_SESS_ATTR_TEST (session->attr,
+                                               VCL_SESS_ATTR_TCP_KEEPIDLE);
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5230,6 +5386,24 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
            clib_warning ("VCL<%d>: VPPCOM_ATTR_GET_TCP_KEEPINTVL: %d, "
                          "buflen %d, #VPP-TBD#", getpid (), *(int *) buffer,
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_GET_TCP_KEEPIDLE: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = *(int *) buffer;
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5250,6 +5424,25 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
                          VCL_SESS_ATTR_TEST (session->attr,
                                              VCL_SESS_ATTR_TCP_KEEPINTVL),
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_SET_TCP_KEEPINTVL: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = VCL_SESS_ATTR_TEST (session->attr,
+                                               VCL_SESS_ATTR_TCP_KEEPINTVL);
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5266,6 +5459,24 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
            clib_warning ("VCL<%d>: VPPCOM_ATTR_GET_TCP_USER_MSS: %d, "
                          "buflen %d, #VPP-TBD#", getpid (), *(int *) buffer,
                          *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_GET_TCP_USER_MSS: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = *(int *) buffer;
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5278,9 +5489,27 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
          session->user_mss = *(u32 *) buffer;
 
          if (VPPCOM_DEBUG > 2)
-           clib_warning ("VCL<%d>: VPPCOM_ATTR_SET_TCP_KEEPINTVL: %u, "
+           clib_warning ("VCL<%d>: VPPCOM_ATTR_SET_TCP_USER_MSS: %u, "
                          "buflen %d, #VPP-TBD#", getpid (),
                          session->user_mss, *buflen);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "VPPCOM_ATTR_SET_TCP_USER_MSS: %d buflen=%d",
+                 .format_args = "i4i4",
+               };
+
+             struct {
+               u32 data[2];
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, session->elog_track);
+             ed->data[0] = session->user_mss;
+             ed->data[1] = *buflen;
+             /* *INDENT-ON* */
+           }
        }
       else
        rv = VPPCOM_EINVAL;
@@ -5314,11 +5543,27 @@ vppcom_session_recvfrom (uint32_t session_index, void *buffer,
            clib_warning ("VCL<%d>: invalid session, "
                          "sid (%u) has been closed!",
                          getpid (), session_index);
+         if (VPPCOM_DEBUG > 0)
+           {
+             /* *INDENT-OFF* */
+             ELOG_TYPE_DECLARE (e) =
+               {
+                 .format = "invalid session: %d closed",
+                 .format_args = "i4",
+               };
+
+             struct {
+               u32 data;
+             } * ed;
+
+             ed = ELOG_TRACK_DATA (&vcm->elog_main, e, vcm->elog_track);
+             ed->data = session_index;
+             /* *INDENT-ON* */
+           }
          rv = VPPCOM_EBADFD;
          clib_spinlock_unlock (&vcm->sessions_lockp);
          goto done;
        }
-      ep->vrf = session->vrf;
       ep->is_ip4 = session->peer_addr.is_ip4;
       ep->port = session->peer_port;
       if (session->peer_addr.is_ip4)