af_xdp: fix missing recvmsg argument 71/43371/5
authorVladimir Zhigulin <[email protected]>
Fri, 4 Jul 2025 08:31:44 +0000 (10:31 +0200)
committerBenoit Ganne <[email protected]>
Tue, 12 Aug 2025 14:10:44 +0000 (14:10 +0000)
Because of missing argument syscall was failing
before reaching xdp system what could result in
degrated performance

Type: fix

Change-Id: I0ae1ce1bacf68457a02a31b3508e9c5100a754e6
Signed-off-by: Vladimir Zhigulin <[email protected]>
src/plugins/af_xdp/input.c

index 9177b3f..72c3738 100644 (file)
@@ -88,7 +88,12 @@ af_xdp_device_input_refill_db (vlib_main_t * vm,
 
   if (clib_spinlock_trylock_if_init (&rxq->syscall_lock))
     {
-      int ret = recvmsg (rxq->xsk_fd, 0, MSG_DONTWAIT);
+      struct msghdr msg = { 0 };
+      struct iovec iov = { 0 };
+      msg.msg_iov = &iov;
+      msg.msg_iovlen = 1;
+
+      int ret = recvmsg (rxq->xsk_fd, &msg, MSG_DONTWAIT);
       clib_spinlock_unlock_if_init (&rxq->syscall_lock);
       if (PREDICT_FALSE (ret < 0))
        {