Uploaded image for project: 'vpp'
  1. vpp
  2. VPP-585

vhost-user: Memory leak in interface delete

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Open
    • Icon: Medium Medium
    • None
    • None
    • Devices
    • None

      Testing creation and deletion of many vhost-interfaces.
      There is a memory leak, where vui->vring_locks[q] aren't freed.

      The below patch seems to fix it:

      diff --git a/src/vnet/devices/virtio/vhost-user.c b/src/vnet/devices/virtio/vhost-user.c
      index 3fbcee9..b427bfe 100644
      — a/src/vnet/devices/virtio/vhost-user.c
      +++ b/src/vnet/devices/virtio/vhost-user.c
      @@ -2386,12 +2386,19 @@ VLIB_REGISTER_NODE (vhost_user_process_node,static) = {
      static void
      vhost_user_term_if (vhost_user_intf_t * vui)
      {
      + int q;
      +
      // Delete configured thread pinning
      vec_reset_length (vui->workers);
      // disconnect interface sockets
      vhost_user_if_disconnect (vui);
      vhost_user_update_iface_state (vui);

      + for (q = 0; q < VHOST_VRING_MAX_N; q++)
      +

      { + clib_mem_free((void *) vui->vring_locks[q]); + }

      +

            ppfister Pierre Pfister
            otroan Ole Trøan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: