| a5289563 | 22-Sep-2025 |
Paolo Abeni <pabeni@redhat.com> |
net: implement UDP tunnel features offloading
When any host or guest GSO over UDP tunnel offload is enabled the virtio net header includes the additional tunnel-related fields, update the size accor
net: implement UDP tunnel features offloading
When any host or guest GSO over UDP tunnel offload is enabled the virtio net header includes the additional tunnel-related fields, update the size accordingly.
Push the GSO over UDP tunnel offloads all the way down to the tap device extending the newly introduced NetFeatures struct, and eventually enable the associated features.
As per virtio specification, to convert features bit to offload bit, map the extended features into the reserved range.
Finally, make the vhost backend aware of the exact header layout, to copy it correctly. The tunnel-related field are present if either the guest or the host negotiated any UDP tunnel related feature: add them to the kernel supported features list, to allow qemu transfer to the backend the needed information.
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Tested-by: Lei Yang <leiyang@redhat.com> Acked-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <093b4bc68368046bffbcab2202227632d6e4e83b.1758549625.git.pabeni@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
| fffac046 | 22-Sep-2025 |
Paolo Abeni <pabeni@redhat.com> |
net: implement tunnel probing
Tap devices support GSO over UDP tunnel offload. Probe for such feature in a similar manner to other offloads.
GSO over UDP tunnel needs to be enabled in addition to a
net: implement tunnel probing
Tap devices support GSO over UDP tunnel offload. Probe for such feature in a similar manner to other offloads.
GSO over UDP tunnel needs to be enabled in addition to a "plain" offload (TSO or USO).
No need to check separately for the outer header checksum offload: the kernel is going to support both of them or none.
The new features are disabled by default to avoid compat issues, and could be enabled, after that hw_compat_10_1 will be added, together with the related compat entries.
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Tested-by: Lei Yang <leiyang@redhat.com> Acked-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <a987a8a7613cbf33bb2209c7c7f5889b512638a7.1758549625.git.pabeni@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
| ba5acc5d | 09-Jul-2025 |
Laurent Vivier <lvivier@redhat.com> |
net: Add is_vhost_user flag to vhost_net struct
Introduce a boolean is_vhost_user field to the vhost_net structure. This flag is initialized during vhost_net_init based on whether the backend is vho
net: Add is_vhost_user flag to vhost_net struct
Introduce a boolean is_vhost_user field to the vhost_net structure. This flag is initialized during vhost_net_init based on whether the backend is vhost-user.
This refactoring simplifies checks for vhost-user specific behavior, replacing direct comparisons of 'net->nc->info->type' with the new flag. It improves readability and encapsulates the backend type information directly within the vhost_net instance.
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
| 33b78a30 | 09-Jul-2025 |
Laurent Vivier <lvivier@redhat.com> |
net: Allow network backends to advertise max TX queue size
This commit refactors how the maximum transmit queue size for virtio-net devices is determined, making the mechanism more generic and exten
net: Allow network backends to advertise max TX queue size
This commit refactors how the maximum transmit queue size for virtio-net devices is determined, making the mechanism more generic and extensible.
Previously, virtio_net_max_tx_queue_size() contained hardcoded checks for specific network backend types (vhost-user and vhost-vdpa) to determine their supported maximum queue size. This created direct dependencies and would require modifications for every new backend that supports variable queue sizes.
To improve flexibility, a new max_tx_queue_size field is added to the vhost_net structure. This allows each network backend to advertise its supported maximum transmit queue size directly.
The virtio_net_max_tx_queue_size() function now retrieves the max TX queue size from the vhost_net struct, if available and set. Otherwise, it defaults to VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE.
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
| 1652f1b3 | 09-Jul-2025 |
Laurent Vivier <lvivier@redhat.com> |
net: Add save_acked_features callback to vhost_net
This commit introduces a save_acked_features function pointer to vhost_net and converts the vhost_net function into a generic dispatcher.
The vhos
net: Add save_acked_features callback to vhost_net
This commit introduces a save_acked_features function pointer to vhost_net and converts the vhost_net function into a generic dispatcher.
The vhost-user backend provides the callback, making its function static. With this change, no other module has a direct dependency on the vhost-user implementation.
This cleanup allows for the complete removal of the net/vhost-user.h header file.
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
| bd38794a | 09-Jul-2025 |
Laurent Vivier <lvivier@redhat.com> |
net: Add get_acked_features callback to VhostNetOptions
This patch continues the effort to decouple the generic vhost layer from specific network backend implementations.
Previously, the vhost_net
net: Add get_acked_features callback to VhostNetOptions
This patch continues the effort to decouple the generic vhost layer from specific network backend implementations.
Previously, the vhost_net initialization code contained a hardcoded check for the vhost-user client type to retrieve its acked features by calling vhost_user_get_acked_features(). This exposed an internal vhost-user function in a public header and coupled the two modules.
The vhost-user backend is updated to provide a callback, and its getter function is now static. The call site in vhost_net.c is simplified to use the new generic helper, removing the type check and the direct dependency.
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
| effdacbf | 09-Jul-2025 |
Laurent Vivier <lvivier@redhat.com> |
net: Consolidate vhost feature bits into vhost_net structure
Previously, the vhost_net_get_feature_bits() function in hw/net/vhost_net.c used a large switch statement to determine the appropriate fe
net: Consolidate vhost feature bits into vhost_net structure
Previously, the vhost_net_get_feature_bits() function in hw/net/vhost_net.c used a large switch statement to determine the appropriate feature bits based on the NetClientDriver type.
This created unnecessary coupling between the generic vhost layer and specific network backends (like TAP, vhost-user, and vhost-vdpa).
This patch moves the definition of vhost feature bits directly into the vhost_net structure for each relevant network client.
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
| 8f6e5c62 | 09-Jul-2025 |
Laurent Vivier <lvivier@redhat.com> |
net: Add get_vhost_net callback to NetClientInfo
The get_vhost_net() function previously contained a large switch statement to find the VHostNetState pointer based on the net client's type. This cre
net: Add get_vhost_net callback to NetClientInfo
The get_vhost_net() function previously contained a large switch statement to find the VHostNetState pointer based on the net client's type. This created a tight coupling, requiring the generic vhost layer to be aware of every specific backend that supported vhost, such as tap, vhost-user, and vhost-vdpa.
This approach is not scalable and requires modifying a central function for any new backend. It also forced each backend to expose its internal getter function in a public header file.
This patch refactors the logic by introducing a new get_vhost_net function pointer to the NetClientInfo struct. The central get_vhost_net() function is now a simple, generic dispatcher that invokes the callback provided by the net client.
Each backend now implements its own private getter and registers it in its NetClientInfo.
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
| 7136352b | 09-Jul-2025 |
Laurent Vivier <lvivier@redhat.com> |
vhost_net: Rename vhost_set_vring_enable() for clarity
This is a cosmetic change with no functional impact.
The function vhost_set_vring_enable() is specific to vhost_net and is used outside of vho
vhost_net: Rename vhost_set_vring_enable() for clarity
This is a cosmetic change with no functional impact.
The function vhost_set_vring_enable() is specific to vhost_net and is used outside of vhost_net.c (specifically, in hw/net/virtio-net.c). To prevent confusion with other similarly named vhost functions, such as the one found in cryptodev-vhost.c, it has been renamed to vhost_net_set_vring_enable(). This clarifies that the function belongs to the vhost_net module.
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
| b9ad513e | 28-Apr-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
net: Remove receive_raw()
While netmap implements virtio-net header, it does not implement receive_raw(). Instead of implementing receive_raw for netmap, add virtio-net headers in the common code an
net: Remove receive_raw()
While netmap implements virtio-net header, it does not implement receive_raw(). Instead of implementing receive_raw for netmap, add virtio-net headers in the common code and use receive_iov()/receive() instead. This also fixes the buffer size for the virtio-net header.
Fixes: fbbdbddec0 ("tap: allow extended virtio header with hash info") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
show more ...
|
| e8c5c452 | 23-Oct-2023 |
David Woodhouse <dwmw@amazon.co.uk> |
net: make nb_nics and nd_table[] static in net/net.c
Also remove the stale declaration of host_net_devices; the actual definition was removed long ago in commit 7cc28cb06104 ("net: Remove the deprec
net: make nb_nics and nd_table[] static in net/net.c
Also remove the stale declaration of host_net_devices; the actual definition was removed long ago in commit 7cc28cb06104 ("net: Remove the deprecated 'host_net_add' and 'host_net_remove' HMP commands")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Thomas Huth <thuth@redhat.com>
show more ...
|
| 481434f9 | 23-Oct-2023 |
David Woodhouse <dwmw@amazon.co.uk> |
net: remove qemu_show_nic_models(), qemu_find_nic_model()
These old functions can be removed now too. Let net_param_nic() print the full set of network devices directly, and also make it note that a
net: remove qemu_show_nic_models(), qemu_find_nic_model()
These old functions can be removed now too. Let net_param_nic() print the full set of network devices directly, and also make it note that a list more specific to this platform/config will be available by using '-nic model=help' instead.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Thomas Huth <thuth@redhat.com>
show more ...
|