History log of /dpdk/lib/vhost/socket.c (Results 1 – 25 of 35)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 4d2aa150 14-Jan-2025 Ariel Otilibili <otilibil@eurecom.fr>

vhost: remove check around mutex init

pthread_mutex_init always returns 0. The other mutex functions
return 0 on success and a non-zero error code on error.

Link: https://man7.org/linux/man-pages/m

vhost: remove check around mutex init

pthread_mutex_init always returns 0. The other mutex functions
return 0 on success and a non-zero error code on error.

Link: https://man7.org/linux/man-pages/man3/pthread_mutex_lock.3.html
Bugzilla ID: 1586

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

show more ...


# c171a2d5 19-Dec-2024 Stephen Hemminger <stephen@networkplumber.org>

vhost: use strlcpy instead of strncpy

Some tools such as gcc address sanitizer will complain if strncpy
is used to completely fill a string since it will not be null
terminated. Since the previous c

vhost: use strlcpy instead of strncpy

Some tools such as gcc address sanitizer will complain if strncpy
is used to completely fill a string since it will not be null
terminated. Since the previous code forced as null at end,
use strlcpy() to get the same effect.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

show more ...


# 27429219 09-Jan-2025 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: fix log when setting max queue num

rte_vhost_driver_set_max_queue_num API returns early when
called for a Vhost-user device, as this API is intended to
limit the maximum number of queue pairs

vhost: fix log when setting max queue num

rte_vhost_driver_set_max_queue_num API returns early when
called for a Vhost-user device, as this API is intended to
limit the maximum number of queue pairs supported by VDUSE
devices. However, a log mentioning the maximum number of
queue pairs is being set is emitted unconditionally, which
may confuse the end user.

This patch moves this log after the backend type is
checked, so that it is only called with VDUSE backends.
The check on the requested value is also moved at the same
place.

Fixes: e1808999d36b ("vhost: restrict set max queue pair API to VDUSE")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Chenbo Xia <chenbox@nvidia.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>

show more ...


Revision tags: v24.11, v24.11-rc4, v24.11-rc3, v24.11-rc2, v24.11-rc1
# e1808999 03-Oct-2024 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: restrict set max queue pair API to VDUSE

In order to avoid breaking Vhost-user live-migration, we want the
rte_vhost_driver_set_max_queue_num API to only be effective with
VDUSE.

Furthermore

vhost: restrict set max queue pair API to VDUSE

In order to avoid breaking Vhost-user live-migration, we want the
rte_vhost_driver_set_max_queue_num API to only be effective with
VDUSE.

Furthermore, this API is only really needed for VDUSE where the
device number of queues is defined by the backend. For Vhost-user,
this is defined by the frontend (e.g. QEMU), so the advantages of
restricting more the maximum number of queue pairs is limited to
a small memory gain (a handful of pointers).

Fixes: 4aa1f88ac13d ("vhost: add API to set max queue pairs")
Cc: stable@dpdk.org

Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


Revision tags: v24.07, v24.07-rc4, v24.07-rc3, v24.07-rc2, v24.07-rc1
# e68a6fea 11-Jun-2024 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: improve fdset initialization

This patch heavily reworks fdset initialization:
- fdsets are now dynamically allocated by the FD manager
- the event dispatcher is now created by the FD manage

vhost: improve fdset initialization

This patch heavily reworks fdset initialization:
- fdsets are now dynamically allocated by the FD manager
- the event dispatcher is now created by the FD manager
- struct fdset is now opaque to VDUSE and Vhost

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# 0c18e4fb 11-Jun-2024 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: hide synchronization within FD manager

This patch forces synchronization for all FDs additions
or deletions in the FD set. With that, it is no more
necessary for the user to know about the FD

vhost: hide synchronization within FD manager

This patch forces synchronization for all FDs additions
or deletions in the FD set. With that, it is no more
necessary for the user to know about the FD set pipe, so
hide its initialization in the FD manager.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# 7945769c 11-Jun-2024 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: make use of FD manager init function

Instead of statically initialize the fdset, this patch
converts VDUSE and Vhost-user to use fdset_init() function,
which now also initialize the mutexes.

vhost: make use of FD manager init function

Instead of statically initialize the fdset, this patch
converts VDUSE and Vhost-user to use fdset_init() function,
which now also initialize the mutexes.

This is preliminary rework to hide FDs manager pipe from
its users.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# ff8989c4 14-May-2024 Daniil Ushkov <daniil.ushkov@yandex.ru>

vhost: add flag for async connection in client mode

This patch introduces a new flag RTE_VHOST_USER_ASYNC_CONNECT,
which in combination with the flag RTE_VHOST_USER_CLIENT makes
rte_vhost_driver_sta

vhost: add flag for async connection in client mode

This patch introduces a new flag RTE_VHOST_USER_ASYNC_CONNECT,
which in combination with the flag RTE_VHOST_USER_CLIENT makes
rte_vhost_driver_start connect asynchronously to the vhost server.

Signed-off-by: Daniil Ushkov <daniil.ushkov@yandex.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

show more ...


Revision tags: v24.03, v24.03-rc4, v24.03-rc3, v24.03-rc2
# deedfb86 29-Feb-2024 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: fix VDUSE device destruction failure

VDUSE_DESTROY_DEVICE ioctl can fail because the device's
chardev is not released despite close syscall having been
called. It happens because the events h

vhost: fix VDUSE device destruction failure

VDUSE_DESTROY_DEVICE ioctl can fail because the device's
chardev is not released despite close syscall having been
called. It happens because the events handler thread is
still polling the file descriptor.

fdset_pipe_notify() is not enough because it does not
ensure the notification has been handled by the event
thread, it just returns once the notification is sent.

To fix this, this patch introduces a synchronization
mechanism based on pthread's condition, so that
fdset_pipe_notify_sync() only returns once the pipe's
read callback has been executed.

Fixes: 51d018fdac4e ("vhost: add VDUSE events handler")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

show more ...


Revision tags: v24.03-rc1
# 0e21c7c0 07-Dec-2023 David Marchand <david.marchand@redhat.com>

lib: replace logging helpers

This is a preparation step before the next change.

Many libraries have their own logging helpers that do not add a newline
in their format string.
Some previous changes

lib: replace logging helpers

This is a preparation step before the next change.

Many libraries have their own logging helpers that do not add a newline
in their format string.
Some previous changes fixed places where some of those helpers are
called without a trailing newline.
Using RTE_LOG_LINE in the existing helpers will ensure we don't
introduce new issues in the future.

The problem is that if we simply convert to the RTE_LOG_LINE helper,
a future fix may introduce a regression since the logging helper
change won't be backported.

To address this concern, rename existing helpers: backporting a call to
them will trigger some conflict or build issue in LTS branches.

Note:
- bpf and vhost that still has some debug multilines messages, a direct
call to RTE_LOG/RTE_LOG_DP is used: this will make it easier to notice
such special cases,
- about previously publicly exposed logging helpers, when such helper is
not publicly used (iow in public inline API), it is removed from the
public API (this is the case for the member library),

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

show more ...


Revision tags: v23.11, v23.11-rc4, v23.11-rc3, v23.11-rc2, v23.11-rc1
# 1c1abf17 13-Sep-2023 Thomas Monjalon <thomas@monjalon.net>

lib: convert to internal control threads

Calls to rte_ctrl_thread_create() are replaced with
rte_thread_create_internal_control().
Other pthread-related functions are replaced with the rte_thread AP

lib: convert to internal control threads

Calls to rte_ctrl_thread_create() are replaced with
rte_thread_create_internal_control().
Other pthread-related functions are replaced with the rte_thread API.
Only pthread_cancel() has no replacement.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>

show more ...


Revision tags: v23.07, v23.07-rc4, v23.07-rc3
# 62774b78 03-Jul-2023 Thomas Monjalon <thomas@monjalon.net>

set namespace prefix to threads

When looking at threads in a system, it can be confusing
to find some unknown threads without a clue it is started by DPDK.

Let's start all thread names with "dpdk-"

set namespace prefix to threads

When looking at threads in a system, it can be confusing
to find some unknown threads without a clue it is started by DPDK.

Let's start all thread names with "dpdk-"
plus the driver name if it comes from a driver.

One more constraint: the thread names are generally limited
to 16 characters, including the NUL character.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

show more ...


# 0ae35ece 31-Jul-2023 David Marchand <david.marchand@redhat.com>

vhost: remove v23 ABI compatibility

v23.11 is a ABI breaking release, remove compatibility code for the
previous major ABI version.

Signed-off-by: David Marchand <david.marchand@redhat.com>


# fcfc1301 13-Jul-2023 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: force vIOMMU enablement with VDUSE

Unlike Vhost-user, VDUSE requires vIOMMU support.
This patch ignores whether RTE_VHOST_USER_IOMMU_SUPPORT
flag is passed at register time to avoid having ap

vhost: force vIOMMU enablement with VDUSE

Unlike Vhost-user, VDUSE requires vIOMMU support.
This patch ignores whether RTE_VHOST_USER_IOMMU_SUPPORT
flag is passed at register time to avoid having application
to pass it for having working VDUSE device creation.

Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>

show more ...


# 927d2aef 13-Jul-2023 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: fix net offload compliance in VDUSE

Initial VDUSE support assumed the application always used
the net offload compliant mode, which is not the case for
OVS.

This patch propagates the value s

vhost: fix net offload compliance in VDUSE

Initial VDUSE support assumed the application always used
the net offload compliant mode, which is not the case for
OVS.

This patch propagates the value set by the application.

Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>

show more ...


# 4789eb43 06-Jul-2023 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: fix VDUSE features negotiation

The series introducing VDUSE support missed the
application capability to disable supported features.

This results in TSO being negotiated while not supported

vhost: fix VDUSE features negotiation

The series introducing VDUSE support missed the
application capability to disable supported features.

This results in TSO being negotiated while not supported by
the application.

Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

show more ...


Revision tags: v23.07-rc2, v23.07-rc1
# 0adb8ecc 25-May-2023 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: add VDUSE device creation and destruction

This patch adds initial support for VDUSE, which includes
the device creation and destruction.

It does not include the virtqueues configuration, so

vhost: add VDUSE device creation and destruction

This patch adds initial support for VDUSE, which includes
the device creation and destruction.

It does not include the virtqueues configuration, so this is
not functional at this point.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# 4aa1f88a 25-May-2023 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: add API to set max queue pairs

This patch introduces a new rte_vhost_driver_set_max_queues
API as preliminary work for multiqueue support with VDUSE.

Indeed, with VDUSE we need to pre-alloca

vhost: add API to set max queue pairs

This patch introduces a new rte_vhost_driver_set_max_queues
API as preliminary work for multiqueue support with VDUSE.

Indeed, with VDUSE we need to pre-allocate the vrings at
device creation time, so we need such API not to allocate
the 128 queue pairs supported by the Vhost library.

Calling the API is optional, 128 queue pairs remaining the
default.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# 4dbf9316 25-May-2023 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: introduce backend operations

This patch introduces backend ops struct, that will enable
calling backend specifics callbacks (Vhost-user, VDUSE), in
shared code.

This is an empty shell for no

vhost: introduce backend operations

This patch introduces backend ops struct, that will enable
calling backend specifics callbacks (Vhost-user, VDUSE), in
shared code.

This is an empty shell for now, it will be filled in later
patches.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# d761d455 17-May-2023 Eelco Chaudron <echaudro@redhat.com>

vhost: add operation to offload the interrupt kick

This patch adds an operation callback which gets called every time the
library wants to call eventfd_write(). This eventfd_write() call could
resul

vhost: add operation to offload the interrupt kick

This patch adds an operation callback which gets called every time the
library wants to call eventfd_write(). This eventfd_write() call could
result in a system call, which could potentially block the PMD thread.

The callback function can decide whether it's ok to handle the
eventfd_write() now or have the newly introduced function,
rte_vhost_notify_guest(), called at a later time.

This can be used by 3rd party applications, like OVS, to avoid system
calls being called as part of the PMD threads.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

show more ...


Revision tags: v23.03, v23.03-rc4, v23.03-rc3, v23.03-rc2, v23.03-rc1
# 218daf16 07-Feb-2023 Maxime Coquelin <maxime.coquelin@redhat.com>

vhost: fix possible FD leaks on truncation

This patch fixes possible FDs leaks when truncation happens
on either the message buffer or its control data. Indeed,
by returning early, it did not let a

vhost: fix possible FD leaks on truncation

This patch fixes possible FDs leaks when truncation happens
on either the message buffer or its control data. Indeed,
by returning early, it did not let a chance to retrieve the
FDs passed as ancillary data, and so caused a potential FDs
leak.

This patch fixes this by extracting the FDs from the
ancillary data as long as recvmsg() call succeeded. It also
improves the logs to differentiate between MSG_TRUNC and
MSG_CTRUNC.

Fixes: bf472259dde6 ("vhost: fix possible denial of service by leaking FDs")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

show more ...


Revision tags: v22.11, v22.11-rc4, v22.11-rc3, v22.11-rc2
# f92ab3f0 19-Oct-2022 Andy Pei <andy.pei@intel.com>

vhost: add type to vDPA device

Add type to rte_vdpa_device to store device type.
Call vdpa ops get_dev_type to fill type when register
vdpa device.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Revi

vhost: add type to vDPA device

Add type to rte_vdpa_device to store device type.
Call vdpa ops get_dev_type to fill type when register
vdpa device.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

show more ...


Revision tags: v22.11-rc1
# 1a44f67a 16-Sep-2022 David Marchand <david.marchand@redhat.com>

vhost: reduce memory footprint when IOMMU is disabled

If an application does not request IOMMU support, we can avoid
allocating a IOMMU pool.

This saves 112kB (IOTLB_CACHE_SIZE * sizeof(struct vhos

vhost: reduce memory footprint when IOMMU is disabled

If an application does not request IOMMU support, we can avoid
allocating a IOMMU pool.

This saves 112kB (IOTLB_CACHE_SIZE * sizeof(struct vhost_iotlb_entry))
per vq.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

show more ...


Revision tags: v22.07, v22.07-rc4, v22.07-rc3
# 36c525a0 01-Jul-2022 David Marchand <david.marchand@redhat.com>

vhost: prefix logs with context

We recently improved the log messages in the vhost library, adding some
context that helps filtering for a given vhost-user device.
However, some parts of the code we

vhost: prefix logs with context

We recently improved the log messages in the vhost library, adding some
context that helps filtering for a given vhost-user device.
However, some parts of the code were missed, and some later code changes
broke this new convention (fixes were sent previous to this patch).

Change the VHOST_LOG_CONFIG/DATA helpers and always ask for a string
used as context. This should help limit regressions on this topic.

Most of the time, the context is the vhost-user device socket path.
For the rest when a vhost-user device can not be related, generic
names were chosen:
- "dma", for vhost-user async DMA operations,
- "device", for vhost-user device creation and lookup,
- "thread", for threads management,

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

show more ...


# 1ef468a7 01-Jul-2022 David Marchand <david.marchand@redhat.com>

vhost: add some trailing newline in log messages

VHOST_LOG_* macros don't append a newline.
Add missing ones.

Fixes: e623e0c6d8a5 ("vhost: add reconnect ability")
Fixes: af1475918124 ("vhost: intro

vhost: add some trailing newline in log messages

VHOST_LOG_* macros don't append a newline.
Add missing ones.

Fixes: e623e0c6d8a5 ("vhost: add reconnect ability")
Fixes: af1475918124 ("vhost: introduce API to start a specific driver")
Fixes: 2dfeebe26546 ("vhost: check return of mutex initialization")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

show more ...


12