History log of /dpdk/drivers/net/virtio/virtio_user/vhost_kernel.c (Results 1 – 25 of 33)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v22.03, v22.03-rc4, v22.03-rc3
# 666ff776 02-Mar-2022 Harold Huang <[email protected]>

net/virtio: support NAPI when using vhost-net backend

In patch [1], NAPI has been supported in kernel tun driver to accelerate
packet processing received from vhost-net. This will greatly improve th

net/virtio: support NAPI when using vhost-net backend

In patch [1], NAPI has been supported in kernel tun driver to accelerate
packet processing received from vhost-net. This will greatly improve the
throughput of the tap device in the vhost-net backend.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=fb3f903769e8

Signed-off-by: Harold Huang <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>

show more ...


Revision tags: v22.03-rc2, v22.03-rc1, v21.11, v21.11-rc4, v21.11-rc3, v21.11-rc2, v21.11-rc1
# b72099be 28-Sep-2021 David Marchand <[email protected]>

net/virtio-user: fix init when using existing tap

When attaching to an existing mono queue tap, the virtio-user was not
reporting that the virtio device was not properly initialised which
prevented

net/virtio-user: fix init when using existing tap

When attaching to an existing mono queue tap, the virtio-user was not
reporting that the virtio device was not properly initialised which
prevented from starting the port later.

$ ip tuntap add test mode tap
$ dpdk-testpmd --vdev \
net_virtio_user0,iface=test,path=/dev/vhost-net,queues=2 -- -i

...
virtio_user_dev_init_mac(): (/dev/vhost-net) No valid MAC in devargs or
device, use random
vhost_kernel_open_tap(): TUNSETIFF failed: Invalid argument
vhost_kernel_enable_queue_pair(): fail to open tap for vhost kernel
virtio_user_start_device(): (/dev/vhost-net) Failed to start device
...
Configuring Port 0 (socket 0)
vhost_kernel_open_tap(): TUNSETIFF failed: Invalid argument
vhost_kernel_enable_queue_pair(): fail to open tap for vhost kernel
virtio_set_multiple_queues(): Multiqueue configured but send command
failed, this is too late now...
Fail to start port 0: Invalid argument
Please stop the ports first
Done

The virtio-user with vhost-kernel backend was going through a lot
of complications to initialise tap fds only when using them.

For each qp enabled for the first time, a tapfd was created via
TUNSETIFF with unneeded additional steps (see below) and then mapped to
the right qp in the vhost-net backend.
Unneeded steps (as long as it has been done once for the port):
- tap features were queried while this is a constant on a running
system,
- the device name in DPDK was updated,
- the mac address of the tap was set,

On subsequent qps state change, the vhost-net backend fd mapping was
updated and the associated queue/tapfd were disabled/enabled via
TUNSETQUEUE.

Now, this patch simplifies the whole logic by keeping all tapfds opened
and in enabled state (from the tap point of view) at all time.

Unused ioctl defines are removed.

Tap features are validated earlier to fail initialisation asap.
Tap name discovery and mac address configuration are moved when
configuring qp 0.

To support attaching to mono queue tap, the virtio-user driver now tries
to attach in multi queue first, then fallbacks to mono queue.

Finally (but this is more for consistency), VIRTIO_NET_F_MQ feature is
exposed only if the underlying tap supports multi queue.

Signed-off-by: David Marchand <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>

show more ...


Revision tags: v21.08, v21.08-rc4, v21.08-rc3, v21.08-rc2, v21.08-rc1
# cf412ff7 28-May-2021 Thierry Herbelot <[email protected]>

net/virtio: fix kernel set features for multi-queue device

Restore the original code, where VHOST_SET_FEATURES is applied to
all vhostfds of the device.

Fixes: cc0151b34dee ("net/virtio: add virtio

net/virtio: fix kernel set features for multi-queue device

Restore the original code, where VHOST_SET_FEATURES is applied to
all vhostfds of the device.

Fixes: cc0151b34dee ("net/virtio: add virtio-user features ops")
Cc: [email protected]

Signed-off-by: Thierry Herbelot <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>

show more ...


Revision tags: v21.05, v21.05-rc4, v21.05-rc3, v21.05-rc2
# b01e1e9a 23-Apr-2021 Thierry Herbelot <[email protected]>

net/virtio: fix kernel set memtable for multi-queue device

Restore the original code, where VHOST_SET_MEM_TABLE is applied to
all vhostfds of the device.

Fixes: 539d910c9c76 ("net/virtio: add virti

net/virtio: fix kernel set memtable for multi-queue device

Restore the original code, where VHOST_SET_MEM_TABLE is applied to
all vhostfds of the device.

Fixes: 539d910c9c76 ("net/virtio: add virtio-user memory tables ops")
Cc: [email protected]

Signed-off-by: Thierry Herbelot <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>

show more ...


Revision tags: v21.05-rc1
# 3c503b24 08-Apr-2021 Thierry Herbelot <[email protected]>

net/virtio: fix kernel set owner for multi-queue devices

Restore the original code, where VHOST_SET_OWNER is applied to
all vhostfds of the device.

Fixes: 06856cabb89b ("net/virtio: add virtio-user

net/virtio: fix kernel set owner for multi-queue devices

Restore the original code, where VHOST_SET_OWNER is applied to
all vhostfds of the device.

Fixes: 06856cabb89b ("net/virtio: add virtio-user ops to set owner")
Cc: [email protected]

Signed-off-by: Thierry Herbelot <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>

show more ...


Revision tags: v21.02, v21.02-rc4, v21.02-rc3, v21.02-rc2
# 86388a3a 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: move vhost-kernel data to its backend

As done earlier for Vhost-user, this patch moves the
Vhost-Kernel specific data to its backend file.

Signed-off-by: Maxime Coquelin <maxime.coqueli

net/virtio: move vhost-kernel data to its backend

As done earlier for Vhost-user, this patch moves the
Vhost-Kernel specific data to its backend file.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# 94973531 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: move vhost-user specifics to its backend

This patch moves all the Vhost-user backend specific
logic like Vhost FD, listen FD and interrupt handling
to the vhost-user backend implementati

net/virtio: move vhost-user specifics to its backend

This patch moves all the Vhost-user backend specific
logic like Vhost FD, listen FD and interrupt handling
to the vhost-user backend implementation.

In order to achieve that, new ops are created to update
the link status, disconnect and reconnect the server,
and fetch the link state interrupt FD.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# 748e5ea5 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: introduce backend data

The goal of this patch is to introduce backend-specific
data in order to better isolate what is backend-specific
from what is generic to Virtio-user.

For now, onl

net/virtio: introduce backend data

The goal of this patch is to introduce backend-specific
data in order to better isolate what is backend-specific
from what is generic to Virtio-user.

For now, only Vhost-user protocol features are moved to
Vhost-user backend data.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# 5b75b63c 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: move protocol features to vhost-user

Since only protocol features are specific to Vhost-user
backend, this patch moves all related code to Vhost-user
file.

Signed-off-by: Maxime Coqueli

net/virtio: move protocol features to vhost-user

Since only protocol features are specific to Vhost-user
backend, this patch moves all related code to Vhost-user
file.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# 1b34ad28 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: remove useless request ops

Now that all the ops have been implemented, we
can remove the send_request ops for all backends.

Signed-off-by: Maxime Coquelin <[email protected]>
R

net/virtio: remove useless request ops

Now that all the ops have been implemented, we
can remove the send_request ops for all backends.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# 8723c894 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: add virtio-user status ops

This patch introduces new callbacks to
get and set the device status.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <che

net/virtio: add virtio-user status ops

This patch introduces new callbacks to
get and set the device status.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# dc65db73 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: add virtio-user vring address ops

This patch introduces a new callback for setting
vrings addresses.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia

net/virtio: add virtio-user vring address ops

This patch introduces a new callback for setting
vrings addresses.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# ce399c36 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: add virtio-user vring file ops

This patch introduces new callbacks for setting
vring files (kick and call).

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chen

net/virtio: add virtio-user vring file ops

This patch introduces new callbacks for setting
vring files (kick and call).

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# ab9098d2 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: add virtio-user vring setting ops

This patch introduces new callbacks for setting
and getting vring state.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenb

net/virtio: add virtio-user vring setting ops

This patch introduces new callbacks for setting
and getting vring state.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# 539d910c 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: add virtio-user memory tables ops

This patch implements a dedicated callback for
preparing and sending memory table to the backends.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redh

net/virtio: add virtio-user memory tables ops

This patch implements a dedicated callback for
preparing and sending memory table to the backends.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# cc0151b3 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: add virtio-user features ops

This patch introduces new callbacks for getting
and setting Virtio features, and implements them
for the different backend types.

Signed-off-by: Maxime Coqu

net/virtio: add virtio-user features ops

This patch introduces new callbacks for getting
and setting Virtio features, and implements them
for the different backend types.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


# 06856cab 26-Jan-2021 Maxime Coquelin <[email protected]>

net/virtio: add virtio-user ops to set owner

This patch implements a dedicated callback for
sending owner request. All the requests will be
converted that way so that backends other than
Vhost-user

net/virtio: add virtio-user ops to set owner

This patch implements a dedicated callback for
sending owner request. All the requests will be
converted that way so that backends other than
Vhost-user don't have to work around being it.

Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Chenbo Xia <[email protected]>

show more ...


Revision tags: v21.02-rc1, v20.11, v20.11-rc5, v20.11-rc4, v20.11-rc3, v20.11-rc2, v20.11-rc1, v20.08, v20.08-rc4, v20.08-rc3, v20.08-rc2, v20.08-rc1, v20.05, v20.05-rc4, v20.05-rc3, v20.05-rc2, v20.05-rc1, v20.02, v20.02-rc4, v20.02-rc3, v20.02-rc2, v20.02-rc1, v19.11, v19.11-rc4
# 47ac9661 25-Nov-2019 Tiwei Bie <[email protected]>

net/virtio-user: do not close tap when disabling queue pairs

Do not close the tap fds when disabling queue pairs, instead,
we just need to unbind the backend. Otherwise, tap port can be
destroyed un

net/virtio-user: do not close tap when disabling queue pairs

Do not close the tap fds when disabling queue pairs, instead,
we just need to unbind the backend. Otherwise, tap port can be
destroyed unexpectedly.

Fixes: e3b434818bbb ("net/virtio-user: support kernel vhost")
Cc: [email protected]

Reported-by: Stephen Hemminger <[email protected]>
Signed-off-by: Tiwei Bie <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>

show more ...


Revision tags: v19.11-rc3, v19.11-rc2, v19.11-rc1
# 8ac35916 12-Aug-2019 David Marchand <[email protected]>

remove useless include of EAL memory config header

Restrict this header inclusion to its real users.

Fixes: 028669bc9f0d ("eal: hide shared memory config")
Cc: [email protected]

Signed-off-by: David

remove useless include of EAL memory config header

Restrict this header inclusion to its real users.

Fixes: 028669bc9f0d ("eal: hide shared memory config")
Cc: [email protected]

Signed-off-by: David Marchand <[email protected]>
Acked-by: Anatoly Burakov <[email protected]>

show more ...


Revision tags: v19.08, v19.08-rc4, v19.08-rc3, v19.08-rc2, v19.08-rc1, v19.05, v19.05-rc4, v19.05-rc3, v19.05-rc2, v19.05-rc1, v19.02, v19.02-rc4, v19.02-rc3, v19.02-rc2, v19.02-rc1, v18.11, v18.11-rc5, v18.11-rc4, v18.11-rc3, v18.11-rc2, v18.11-rc1
# 520dd992 28-Oct-2018 Ferruh Yigit <[email protected]>

drivers: prefix global variables with module name

Some global variables are defined with generic names, add component name
as prefix to variables to prevent collusion with application variables.

Si

drivers: prefix global variables with module name

Some global variables are defined with generic names, add component name
as prefix to variables to prevent collusion with application variables.

Signed-off-by: Ferruh Yigit <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>
Acked-by: Shreyansh Jain <[email protected]>
Acked-by: Tianfei Zhang <[email protected]>

show more ...


# 5282bb1c 02-Oct-2018 Anatoly Burakov <[email protected]>

mem: allow memseg lists to be marked as external

When we allocate and use DPDK memory, we need to be able to
differentiate between DPDK hugepage segments and segments that
were made part of DPDK but

mem: allow memseg lists to be marked as external

When we allocate and use DPDK memory, we need to be able to
differentiate between DPDK hugepage segments and segments that
were made part of DPDK but are externally allocated. Add such
a property to memseg lists.

This breaks the ABI, so document the change in release notes.
This also breaks a few internal assumptions about memory
contiguousness, so adjust malloc code in a few places.

All current calls for memseg walk functions were adjusted to
ignore external segments where it made sense.

Mempools is a special case, because we may be asked to allocate
a mempool on a specific socket, and we need to ignore all page
sizes on other heaps or other sockets. Previously, this
assumption of knowing all page sizes was not a problem, but it
will be now, so we have to match socket ID with page size when
calculating minimum page size for a mempool.

Signed-off-by: Anatoly Burakov <[email protected]>
Acked-by: Andrew Rybchenko <[email protected]>
Acked-by: Yongseok Koh <[email protected]>

show more ...


# 75728654 05-Sep-2018 Tiwei Bie <[email protected]>

net/virtio-user: fix memory hotplug support in vhost-kernel

It's possible to have much more hugepage backed memory regions
than what vhost-kernel supports due to the memory hotplug, which
may cause

net/virtio-user: fix memory hotplug support in vhost-kernel

It's possible to have much more hugepage backed memory regions
than what vhost-kernel supports due to the memory hotplug, which
may cause problems. A better solution is to have the virtio-user
pass all the memory ranges reserved by DPDK to vhost-kernel.

Fixes: 12ecb2f63b12 ("net/virtio-user: support memory hotplug")
Cc: [email protected]

Signed-off-by: Tiwei Bie <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>

show more ...


# 7ff26957 05-Sep-2018 Tiwei Bie <[email protected]>

net/virtio-user: fix deadlock in memory events callback

Deadlock can occur when allocating memory if a vhost-kernel
based virtio-user device is in use. To fix the deadlock,
we will take memory hotpl

net/virtio-user: fix deadlock in memory events callback

Deadlock can occur when allocating memory if a vhost-kernel
based virtio-user device is in use. To fix the deadlock,
we will take memory hotplug lock explicitly in virtio-user
when necessary, and always call the _thread_unsafe memory
functions.

Bugzilla ID: 81
Fixes: 12ecb2f63b12 ("net/virtio-user: support memory hotplug")
Cc: [email protected]

Reported-by: Seán Harte <[email protected]>
Signed-off-by: Tiwei Bie <[email protected]>
Tested-by: Seán Harte <[email protected]>
Reviewed-by: Seán Harte <[email protected]>
Reviewed-by: Anatoly Burakov <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>

show more ...


# 1db4d233 29-Aug-2018 Eric Zhang <[email protected]>

net/virtio-user: check negotiated features before set

This patch checks negotiated features to see if necessary to offload
before set the tap device offload capabilities. It also checks if kernel
su

net/virtio-user: check negotiated features before set

This patch checks negotiated features to see if necessary to offload
before set the tap device offload capabilities. It also checks if kernel
support the TUNSETOFFLOAD operation.

Fixes: 5e97e4202563 ("net/virtio-user: enable offloading")
Cc: [email protected]

Signed-off-by: Eric Zhang <[email protected]>
Reviewed-by: Tiwei Bie <[email protected]>

show more ...


Revision tags: v18.08, v18.08-rc3, v18.08-rc2, v18.08-rc1, v18.05, v18.05-rc6, v18.05-rc5, v18.05-rc4, v18.05-rc3, v18.05-rc2, v18.05-rc1
# 66cc45e2 11-Apr-2018 Anatoly Burakov <[email protected]>

mem: replace memseg with memseg lists

Before, we were aggregating multiple pages into one memseg, so the
number of memsegs was small. Now, each page gets its own memseg,
so the list of memsegs is hu

mem: replace memseg with memseg lists

Before, we were aggregating multiple pages into one memseg, so the
number of memsegs was small. Now, each page gets its own memseg,
so the list of memsegs is huge. To accommodate the new memseg list
size and to keep the under-the-hood workings sane, the memseg list
is now not just a single list, but multiple lists. To be precise,
each hugepage size available on the system gets one or more memseg
lists, per socket.

In order to support dynamic memory allocation, we reserve all
memory in advance (unless we're in 32-bit legacy mode, in which
case we do not preallocate memory). As in, we do an anonymous
mmap() of the entire maximum size of memory per hugepage size, per
socket (which is limited to either RTE_MAX_MEMSEG_PER_TYPE pages or
RTE_MAX_MEM_MB_PER_TYPE megabytes worth of memory, whichever is the
smaller one), split over multiple lists (which are limited to
either RTE_MAX_MEMSEG_PER_LIST memsegs or RTE_MAX_MEM_MB_PER_LIST
megabytes per list, whichever is the smaller one). There is also
a global limit of CONFIG_RTE_MAX_MEM_MB megabytes, which is mainly
used for 32-bit targets to limit amounts of preallocated memory,
but can be used to place an upper limit on total amount of VA
memory that can be allocated by DPDK application.

So, for each hugepage size, we get (by default) up to 128G worth
of memory, per socket, split into chunks of up to 32G in size.
The address space is claimed at the start, in eal_common_memory.c.
The actual page allocation code is in eal_memalloc.c (Linux-only),
and largely consists of copied EAL memory init code.

Pages in the list are also indexed by address. That is, in order
to figure out where the page belongs, one can simply look at base
address for a memseg list. Similarly, figuring out IOVA address
of a memzone is a matter of finding the right memseg list, getting
offset and dividing by page size to get the appropriate memseg.

This commit also removes rte_eal_dump_physmem_layout() call,
according to deprecation notice [1], and removes that deprecation
notice as well.

On 32-bit targets due to limited VA space, DPDK will no longer
spread memory to different sockets like before. Instead, it will
(by default) allocate all of the memory on socket where master
lcore is. To override this behavior, --socket-mem must be used.

The rest of the changes are really ripple effects from the memseg
change - heap changes, compile fixes, and rewrites to support
fbarray-backed memseg lists. Due to earlier switch to _walk()
functions, most of the changes are simple fixes, however some
of the _walk() calls were switched to memseg list walk, where
it made sense to do so.

Additionally, we are also switching locks from flock() to fcntl().
Down the line, we will be introducing single-file segments option,
and we cannot use flock() locks to lock parts of the file. Therefore,
we will use fcntl() locks for legacy mem as well, in case someone is
unfortunate enough to accidentally start legacy mem primary process
alongside an already working non-legacy mem-based primary process.

[1] http://dpdk.org/dev/patchwork/patch/34002/

Signed-off-by: Anatoly Burakov <[email protected]>
Tested-by: Santosh Shukla <[email protected]>
Tested-by: Hemant Agrawal <[email protected]>
Tested-by: Gowrishankar Muthukrishnan <[email protected]>

show more ...


12