hs-test: cache docker build in local filesystem
[vpp.git] / src / vcl / ldp.c
index 0338ce6..bd3457f 100644 (file)
@@ -195,7 +195,7 @@ ldp_alloc_workers (void)
 {
   if (ldp->workers)
     return;
-  pool_alloc (ldp->workers, LDP_MAX_NWORKERS);
+  ldp->workers = vec_new (ldp_worker_ctx_t, LDP_MAX_NWORKERS);
 }
 
 static void
@@ -312,11 +312,9 @@ ldp_init (void)
     }
   ldp->vcl_needs_real_epoll = 0;
   ldp_alloc_workers ();
-  ldpw = ldp_worker_get_current ();
 
-  pool_foreach (ldpw, ldp->workers)  {
+  vec_foreach (ldpw, ldp->workers)
     clib_memset (&ldpw->clib_time, 0, sizeof (ldpw->clib_time));
-  }
 
   LDBG (0, "LDP initialization: done!");
 
@@ -615,7 +613,13 @@ ioctl (int fd, unsigned long int cmd, ...)
        case FIONREAD:
          rv = vls_attr (vlsh, VPPCOM_ATTR_GET_NREAD, 0, 0);
          break;
-
+       case TIOCOUTQ:
+         {
+           u32 *buf = va_arg (ap, void *);
+           u32 *buflen = va_arg (ap, u32 *);
+           rv = vls_attr (vlsh, VPPCOM_ATTR_GET_NWRITEQ, buf, buflen);
+         }
+         break;
        case FIONBIO:
          {
            u32 flags = *(va_arg (ap, int *)) ? O_NONBLOCK : 0;
@@ -664,7 +668,6 @@ ldp_select_init_maps (fd_set * __restrict original,
   clib_memcpy_fast (*resultb, original, n_bytes);
   memset (original, 0, n_bytes);
 
-  /* *INDENT-OFF* */
   clib_bitmap_foreach (fd, *resultb)  {
     if (fd > nfds)
       break;
@@ -674,7 +677,6 @@ ldp_select_init_maps (fd_set * __restrict original,
     else
       *vclb = clib_bitmap_set (*vclb, vlsh_to_session_index (vlsh), 1);
   }
-  /* *INDENT-ON* */
 
   si_bits_set = clib_bitmap_last_set (*vclb) + 1;
   *si_bits = (si_bits_set > *si_bits) ? si_bits_set : *si_bits;
@@ -694,7 +696,6 @@ ldp_select_vcl_map_to_libc (clib_bitmap_t * vclb, fd_set * __restrict libcb)
   if (!libcb)
     return 0;
 
-  /* *INDENT-OFF* */
   clib_bitmap_foreach (si, vclb)  {
     vlsh = vls_session_index_to_vlsh (si);
     ASSERT (vlsh != VLS_INVALID_HANDLE);
@@ -706,7 +707,6 @@ ldp_select_vcl_map_to_libc (clib_bitmap_t * vclb, fd_set * __restrict libcb)
       }
     FD_SET (fd, libcb);
   }
-  /* *INDENT-ON* */
 
   return 0;
 }
@@ -719,10 +719,8 @@ ldp_select_libc_map_merge (clib_bitmap_t * result, fd_set * __restrict libcb)
   if (!libcb)
     return;
 
-  /* *INDENT-OFF* */
   clib_bitmap_foreach (fd, result)
     FD_SET ((int)fd, libcb);
-  /* *INDENT-ON* */
 }
 
 int
@@ -1867,7 +1865,6 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
       if (size < 0)
        {
          int errno_val = errno;
-         perror (func_str);
          clib_warning ("LDP<%d>: ERROR: fd %d (0x%x): %s() failed! "
                        "rv %d, errno = %d", getpid (), fd, fd,
                        func_str, size, errno_val);