[dpdk-dev] [PATCH] vhost: support Generic Segmentation Offload

Maxime Coquelin maxime.coquelin at redhat.com
Wed Dec 6 09:33:43 CET 2017


Hi Jiayu,

On 11/28/2017 06:28 AM, Jiayu Hu wrote:
> In virtio, Generic Segmentation Offload (GSO) is the feature for the
> backend, which means the backend can receive packets with any GSO
> type.
> 
> Virtio-net enables the GSO feature by default, and vhost-net supports it.
> To make live migration from vhost-net to vhost-user possible, this patch
> enables GSO for vhost-user.

Please note that the application relying on Vhost library may disable
some features, breaking the migration from vhost-net to vhost-user even
if all features are supported in the vhost-user lib.

For example, ovs-dpdk disables the following features:
     err = rte_vhost_driver_disable_features(dev->vhost_id,
                                 1ULL << VIRTIO_NET_F_HOST_TSO4
                                 | 1ULL << VIRTIO_NET_F_HOST_TSO6
                                 | 1ULL << VIRTIO_NET_F_CSUM);


> Signed-off-by: Jiayu Hu <jiayu.hu at intel.com>
> ---
>   lib/librte_vhost/vhost.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> index 1cc81c1..04f54cb 100644
> --- a/lib/librte_vhost/vhost.h
> +++ b/lib/librte_vhost/vhost.h
> @@ -204,6 +204,7 @@ struct vhost_msg {
>   				(1ULL << VIRTIO_F_VERSION_1)   | \
>   				(1ULL << VHOST_F_LOG_ALL)      | \
>   				(1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \
> +				(1ULL << VIRTIO_NET_F_GSO) | \

This feature is also enabled by default in QEMU, and seems also to be
acked by default in the virtio-net kernel driver.

Does it have an impact on performance? Be it good or bad.

How to test it?

>   				(1ULL << VIRTIO_NET_F_HOST_TSO4) | \
>   				(1ULL << VIRTIO_NET_F_HOST_TSO6) | \
>   				(1ULL << VIRTIO_NET_F_CSUM)    | \
> 

Thanks,
Maxime


More information about the dev mailing list