[3/6] net/vhost: enable compliant offloading mode
Checks
Commit Message
This patch enables the compliant offloading flags mode by
default, which prevents the Rx path to set Tx offload flags,
which is illegal. A new legacy-ol-flags devarg is introduced
to enable the legacy behaviour.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
doc/guides/nics/vhost.rst | 6 ++++++
drivers/net/vhost/rte_eth_vhost.c | 19 ++++++++++++++++---
2 files changed, 22 insertions(+), 3 deletions(-)
Comments
Hi Maxime,
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Thursday, May 5, 2022 6:27 PM
> To: dev@dpdk.org; jasowang@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>;
> david.marchand@redhat.com; olivier.matz@6wind.com
> Cc: stable@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [PATCH 3/6] net/vhost: enable compliant offloading mode
>
> This patch enables the compliant offloading flags mode by
> default, which prevents the Rx path to set Tx offload flags,
> which is illegal. A new legacy-ol-flags devarg is introduced
> to enable the legacy behaviour.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> doc/guides/nics/vhost.rst | 6 ++++++
> drivers/net/vhost/rte_eth_vhost.c | 19 ++++++++++++++++---
> 2 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guides/nics/vhost.rst b/doc/guides/nics/vhost.rst
> index ee802ec4a8..d7c0e2ade8 100644
> --- a/doc/guides/nics/vhost.rst
> +++ b/doc/guides/nics/vhost.rst
> @@ -64,6 +64,12 @@ The user can specify below arguments in `--vdev` option.
> It is used to enable external buffer support in vhost library.
> (Default: 0 (disabled))
>
> +#. ``legacy-ol-flags``:
> +
> + It is used to restore legacy behavior for offloading that was not
> + compliant with offloading API.
> + (Default: 0 (disabled))
> +
> Vhost PMD event handling
> ------------------------
>
> diff --git a/drivers/net/vhost/rte_eth_vhost.c
> b/drivers/net/vhost/rte_eth_vhost.c
> index 070f0e6dfd..0a2e8d9b29 100644
> --- a/drivers/net/vhost/rte_eth_vhost.c
> +++ b/drivers/net/vhost/rte_eth_vhost.c
> @@ -31,9 +31,10 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
> #define ETH_VHOST_CLIENT_ARG "client"
> #define ETH_VHOST_IOMMU_SUPPORT "iommu-support"
> #define ETH_VHOST_POSTCOPY_SUPPORT "postcopy-support"
> -#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
> -#define ETH_VHOST_LINEAR_BUF "linear-buffer"
> -#define ETH_VHOST_EXT_BUF "ext-buffer"
> +#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
> +#define ETH_VHOST_LINEAR_BUF "linear-buffer"
> +#define ETH_VHOST_EXT_BUF "ext-buffer"
> +#define ETH_VHOST_LEGACY_OL_FLAGS "legacy-ol-flags"
> #define VHOST_MAX_PKT_BURST 32
>
> static const char *valid_arguments[] = {
> @@ -1563,6 +1564,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
> int tso = 0;
> int linear_buf = 0;
> int ext_buf = 0;
> + int legacy_ol_flags = 0;
> struct rte_eth_dev *eth_dev;
> const char *name = rte_vdev_device_name(dev);
>
> @@ -1672,6 +1674,17 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
> flags |= RTE_VHOST_USER_EXTBUF_SUPPORT;
> }
>
> + if (rte_kvargs_count(kvlist, ETH_VHOST_LEGACY_OL_FLAGS) == 1) {
> + ret = rte_kvargs_process(kvlist,
> + ETH_VHOST_LEGACY_OL_FLAGS,
> + &open_int, &legacy_ol_flags);
> + if (ret < 0)
> + goto out_free;
> + }
> +
> + if (legacy_ol_flags == 0)
> + flags |= RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
Putting this check into above '{}' like other option does, will look better.
Thanks,
Chenbo
> +
> if (dev->device.numa_node == SOCKET_ID_ANY)
> dev->device.numa_node = rte_socket_id();
>
> --
> 2.35.1
Hi Chenbo,
On 5/16/22 15:26, Xia, Chenbo wrote:
> Hi Maxime,
>
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Thursday, May 5, 2022 6:27 PM
>> To: dev@dpdk.org; jasowang@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>;
>> david.marchand@redhat.com; olivier.matz@6wind.com
>> Cc: stable@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
>> Subject: [PATCH 3/6] net/vhost: enable compliant offloading mode
>>
>> This patch enables the compliant offloading flags mode by
>> default, which prevents the Rx path to set Tx offload flags,
>> which is illegal. A new legacy-ol-flags devarg is introduced
>> to enable the legacy behaviour.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>> doc/guides/nics/vhost.rst | 6 ++++++
>> drivers/net/vhost/rte_eth_vhost.c | 19 ++++++++++++++++---
>> 2 files changed, 22 insertions(+), 3 deletions(-)
>>
>> diff --git a/doc/guides/nics/vhost.rst b/doc/guides/nics/vhost.rst
>> index ee802ec4a8..d7c0e2ade8 100644
>> --- a/doc/guides/nics/vhost.rst
>> +++ b/doc/guides/nics/vhost.rst
>> @@ -64,6 +64,12 @@ The user can specify below arguments in `--vdev` option.
>> It is used to enable external buffer support in vhost library.
>> (Default: 0 (disabled))
>>
>> +#. ``legacy-ol-flags``:
>> +
>> + It is used to restore legacy behavior for offloading that was not
>> + compliant with offloading API.
>> + (Default: 0 (disabled))
>> +
>> Vhost PMD event handling
>> ------------------------
>>
>> diff --git a/drivers/net/vhost/rte_eth_vhost.c
>> b/drivers/net/vhost/rte_eth_vhost.c
>> index 070f0e6dfd..0a2e8d9b29 100644
>> --- a/drivers/net/vhost/rte_eth_vhost.c
>> +++ b/drivers/net/vhost/rte_eth_vhost.c
>> @@ -31,9 +31,10 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
>> #define ETH_VHOST_CLIENT_ARG "client"
>> #define ETH_VHOST_IOMMU_SUPPORT "iommu-support"
>> #define ETH_VHOST_POSTCOPY_SUPPORT "postcopy-support"
>> -#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
>> -#define ETH_VHOST_LINEAR_BUF "linear-buffer"
>> -#define ETH_VHOST_EXT_BUF "ext-buffer"
>> +#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
>> +#define ETH_VHOST_LINEAR_BUF "linear-buffer"
>> +#define ETH_VHOST_EXT_BUF "ext-buffer"
>> +#define ETH_VHOST_LEGACY_OL_FLAGS "legacy-ol-flags"
>> #define VHOST_MAX_PKT_BURST 32
>>
>> static const char *valid_arguments[] = {
>> @@ -1563,6 +1564,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
>> int tso = 0;
>> int linear_buf = 0;
>> int ext_buf = 0;
>> + int legacy_ol_flags = 0;
>> struct rte_eth_dev *eth_dev;
>> const char *name = rte_vdev_device_name(dev);
>>
>> @@ -1672,6 +1674,17 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
>> flags |= RTE_VHOST_USER_EXTBUF_SUPPORT;
>> }
>>
>> + if (rte_kvargs_count(kvlist, ETH_VHOST_LEGACY_OL_FLAGS) == 1) {
>> + ret = rte_kvargs_process(kvlist,
>> + ETH_VHOST_LEGACY_OL_FLAGS,
>> + &open_int, &legacy_ol_flags);
>> + if (ret < 0)
>> + goto out_free;
>> + }
>> +
>> + if (legacy_ol_flags == 0)
>> + flags |= RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
>
> Putting this check into above '{}' like other option does, will look better.
Actually, it would change the behavior because we want to set the flag
even if legacy devrarg is not passed.
Regards,
Maxime
> Thanks,
> Chenbo
>
>> +
>> if (dev->device.numa_node == SOCKET_ID_ANY)
>> dev->device.numa_node = rte_socket_id();
>>
>> --
>> 2.35.1
>
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Monday, May 16, 2022 9:29 PM
> To: Xia, Chenbo <chenbo.xia@intel.com>; dev@dpdk.org; jasowang@redhat.com;
> david.marchand@redhat.com; olivier.matz@6wind.com
> Cc: stable@dpdk.org
> Subject: Re: [PATCH 3/6] net/vhost: enable compliant offloading mode
>
> Hi Chenbo,
>
> On 5/16/22 15:26, Xia, Chenbo wrote:
> > Hi Maxime,
> >
> >> -----Original Message-----
> >> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> Sent: Thursday, May 5, 2022 6:27 PM
> >> To: dev@dpdk.org; jasowang@redhat.com; Xia, Chenbo
> <chenbo.xia@intel.com>;
> >> david.marchand@redhat.com; olivier.matz@6wind.com
> >> Cc: stable@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
> >> Subject: [PATCH 3/6] net/vhost: enable compliant offloading mode
> >>
> >> This patch enables the compliant offloading flags mode by
> >> default, which prevents the Rx path to set Tx offload flags,
> >> which is illegal. A new legacy-ol-flags devarg is introduced
> >> to enable the legacy behaviour.
> >>
> >> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> ---
> >> doc/guides/nics/vhost.rst | 6 ++++++
> >> drivers/net/vhost/rte_eth_vhost.c | 19 ++++++++++++++++---
> >> 2 files changed, 22 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/doc/guides/nics/vhost.rst b/doc/guides/nics/vhost.rst
> >> index ee802ec4a8..d7c0e2ade8 100644
> >> --- a/doc/guides/nics/vhost.rst
> >> +++ b/doc/guides/nics/vhost.rst
> >> @@ -64,6 +64,12 @@ The user can specify below arguments in `--vdev`
> option.
> >> It is used to enable external buffer support in vhost library.
> >> (Default: 0 (disabled))
> >>
> >> +#. ``legacy-ol-flags``:
> >> +
> >> + It is used to restore legacy behavior for offloading that was not
> >> + compliant with offloading API.
> >> + (Default: 0 (disabled))
> >> +
> >> Vhost PMD event handling
> >> ------------------------
> >>
> >> diff --git a/drivers/net/vhost/rte_eth_vhost.c
> >> b/drivers/net/vhost/rte_eth_vhost.c
> >> index 070f0e6dfd..0a2e8d9b29 100644
> >> --- a/drivers/net/vhost/rte_eth_vhost.c
> >> +++ b/drivers/net/vhost/rte_eth_vhost.c
> >> @@ -31,9 +31,10 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
> >> #define ETH_VHOST_CLIENT_ARG "client"
> >> #define ETH_VHOST_IOMMU_SUPPORT "iommu-support"
> >> #define ETH_VHOST_POSTCOPY_SUPPORT "postcopy-support"
> >> -#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
> >> -#define ETH_VHOST_LINEAR_BUF "linear-buffer"
> >> -#define ETH_VHOST_EXT_BUF "ext-buffer"
> >> +#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
> >> +#define ETH_VHOST_LINEAR_BUF "linear-buffer"
> >> +#define ETH_VHOST_EXT_BUF "ext-buffer"
> >> +#define ETH_VHOST_LEGACY_OL_FLAGS "legacy-ol-flags"
> >> #define VHOST_MAX_PKT_BURST 32
> >>
> >> static const char *valid_arguments[] = {
> >> @@ -1563,6 +1564,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
> >> int tso = 0;
> >> int linear_buf = 0;
> >> int ext_buf = 0;
> >> + int legacy_ol_flags = 0;
> >> struct rte_eth_dev *eth_dev;
> >> const char *name = rte_vdev_device_name(dev);
> >>
> >> @@ -1672,6 +1674,17 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
> >> flags |= RTE_VHOST_USER_EXTBUF_SUPPORT;
> >> }
> >>
> >> + if (rte_kvargs_count(kvlist, ETH_VHOST_LEGACY_OL_FLAGS) == 1) {
> >> + ret = rte_kvargs_process(kvlist,
> >> + ETH_VHOST_LEGACY_OL_FLAGS,
> >> + &open_int, &legacy_ol_flags);
> >> + if (ret < 0)
> >> + goto out_free;
> >> + }
> >> +
> >> + if (legacy_ol_flags == 0)
> >> + flags |= RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
> >
> > Putting this check into above '{}' like other option does, will look
> better.
>
> Actually, it would change the behavior because we want to set the flag
> even if legacy devrarg is not passed.
You're right...
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
>
> Regards,
> Maxime
>
> > Thanks,
> > Chenbo
> >
> >> +
> >> if (dev->device.numa_node == SOCKET_ID_ANY)
> >> dev->device.numa_node = rte_socket_id();
> >>
> >> --
> >> 2.35.1
> >
Hi Maxime,
> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: 2022年5月16日 21:40
> To: Maxime Coquelin <maxime.coquelin@redhat.com>; dev@dpdk.org;
> jasowang@redhat.com; david.marchand@redhat.com;
> olivier.matz@6wind.com
> Cc: stable@dpdk.org
> Subject: RE: [PATCH 3/6] net/vhost: enable compliant offloading mode
>
> > -----Original Message-----
> > From: Maxime Coquelin <maxime.coquelin@redhat.com>
> > Sent: Monday, May 16, 2022 9:29 PM
> > To: Xia, Chenbo <chenbo.xia@intel.com>; dev@dpdk.org;
> > jasowang@redhat.com; david.marchand@redhat.com;
> olivier.matz@6wind.com
> > Cc: stable@dpdk.org
> > Subject: Re: [PATCH 3/6] net/vhost: enable compliant offloading mode
> >
> > Hi Chenbo,
> >
> > On 5/16/22 15:26, Xia, Chenbo wrote:
> > > Hi Maxime,
> > >
> > >> -----Original Message-----
> > >> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> > >> Sent: Thursday, May 5, 2022 6:27 PM
> > >> To: dev@dpdk.org; jasowang@redhat.com; Xia, Chenbo
> > <chenbo.xia@intel.com>;
> > >> david.marchand@redhat.com; olivier.matz@6wind.com
> > >> Cc: stable@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
> > >> Subject: [PATCH 3/6] net/vhost: enable compliant offloading mode
> > >>
> > >> This patch enables the compliant offloading flags mode by default,
> > >> which prevents the Rx path to set Tx offload flags, which is
> > >> illegal. A new legacy-ol-flags devarg is introduced to enable the
> > >> legacy behaviour.
> > >>
> > >> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> > >> ---
> > >> doc/guides/nics/vhost.rst | 6 ++++++
> > >> drivers/net/vhost/rte_eth_vhost.c | 19 ++++++++++++++++---
> > >> 2 files changed, 22 insertions(+), 3 deletions(-)
> > >>
> > >> diff --git a/doc/guides/nics/vhost.rst b/doc/guides/nics/vhost.rst
> > >> index ee802ec4a8..d7c0e2ade8 100644
> > >> --- a/doc/guides/nics/vhost.rst
> > >> +++ b/doc/guides/nics/vhost.rst
> > >> @@ -64,6 +64,12 @@ The user can specify below arguments in `--vdev`
> > option.
> > >> It is used to enable external buffer support in vhost library.
> > >> (Default: 0 (disabled))
> > >>
> > >> +#. ``legacy-ol-flags``:
> > >> +
> > >> + It is used to restore legacy behavior for offloading that was not
> > >> + compliant with offloading API.
> > >> + (Default: 0 (disabled))
> > >> +
> > >> Vhost PMD event handling
> > >> ------------------------
> > >>
> > >> diff --git a/drivers/net/vhost/rte_eth_vhost.c
> > >> b/drivers/net/vhost/rte_eth_vhost.c
> > >> index 070f0e6dfd..0a2e8d9b29 100644
> > >> --- a/drivers/net/vhost/rte_eth_vhost.c
> > >> +++ b/drivers/net/vhost/rte_eth_vhost.c
> > >> @@ -31,9 +31,10 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ,
> VIRTIO_QNUM};
> > >> #define ETH_VHOST_CLIENT_ARG "client"
> > >> #define ETH_VHOST_IOMMU_SUPPORT "iommu-support"
> > >> #define ETH_VHOST_POSTCOPY_SUPPORT "postcopy-support"
> > >> -#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
> > >> -#define ETH_VHOST_LINEAR_BUF "linear-buffer"
> > >> -#define ETH_VHOST_EXT_BUF "ext-buffer"
> > >> +#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
> > >> +#define ETH_VHOST_LINEAR_BUF "linear-buffer"
> > >> +#define ETH_VHOST_EXT_BUF "ext-buffer"
> > >> +#define ETH_VHOST_LEGACY_OL_FLAGS "legacy-ol-flags"
> > >> #define VHOST_MAX_PKT_BURST 32
> > >>
ETH_VHOST_LEGACY_OL_FLAGS should be added into valid_arguments array.
static const char *valid_arguments[] = {
ETH_VHOST_IFACE_ARG,
ETH_VHOST_QUEUES_ARG,
ETH_VHOST_CLIENT_ARG,
ETH_VHOST_IOMMU_SUPPORT,
ETH_VHOST_POSTCOPY_SUPPORT,
ETH_VHOST_VIRTIO_NET_F_HOST_TSO,
ETH_VHOST_LINEAR_BUF,
ETH_VHOST_EXT_BUF,
NULL
};
> > >> static const char *valid_arguments[] = { @@ -1563,6 +1564,7 @@
> > >> rte_pmd_vhost_probe(struct rte_vdev_device *dev)
> > >> int tso = 0;
> > >> int linear_buf = 0;
> > >> int ext_buf = 0;
> > >> + int legacy_ol_flags = 0;
> > >> struct rte_eth_dev *eth_dev;
> > >> const char *name = rte_vdev_device_name(dev);
> > >>
> > >> @@ -1672,6 +1674,17 @@ rte_pmd_vhost_probe(struct
> rte_vdev_device *dev)
> > >> flags |= RTE_VHOST_USER_EXTBUF_SUPPORT;
> > >> }
> > >>
> > >> + if (rte_kvargs_count(kvlist, ETH_VHOST_LEGACY_OL_FLAGS) == 1) {
> > >> + ret = rte_kvargs_process(kvlist,
> > >> + ETH_VHOST_LEGACY_OL_FLAGS,
> > >> + &open_int, &legacy_ol_flags);
> > >> + if (ret < 0)
> > >> + goto out_free;
> > >> + }
> > >> +
> > >> + if (legacy_ol_flags == 0)
> > >> + flags |= RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
> > >
> > > Putting this check into above '{}' like other option does, will look
> > better.
> >
> > Actually, it would change the behavior because we want to set the flag
> > even if legacy devrarg is not passed.
>
> You're right...
>
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
>
> >
> > Regards,
> > Maxime
> >
> > > Thanks,
> > > Chenbo
> > >
> > >> +
> > >> if (dev->device.numa_node == SOCKET_ID_ANY)
> > >> dev->device.numa_node = rte_socket_id();
> > >>
> > >> --
> > >> 2.35.1
> > >
Hi Wenwu,
On 6/7/22 03:19, Ma, WenwuX wrote:
> Hi Maxime,
>
>> -----Original Message-----
>> From: Xia, Chenbo <chenbo.xia@intel.com>
>> Sent: 2022年5月16日 21:40
>> To: Maxime Coquelin <maxime.coquelin@redhat.com>; dev@dpdk.org;
>> jasowang@redhat.com; david.marchand@redhat.com;
>> olivier.matz@6wind.com
>> Cc: stable@dpdk.org
>> Subject: RE: [PATCH 3/6] net/vhost: enable compliant offloading mode
>>
>>> -----Original Message-----
>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>> Sent: Monday, May 16, 2022 9:29 PM
>>> To: Xia, Chenbo <chenbo.xia@intel.com>; dev@dpdk.org;
>>> jasowang@redhat.com; david.marchand@redhat.com;
>> olivier.matz@6wind.com
>>> Cc: stable@dpdk.org
>>> Subject: Re: [PATCH 3/6] net/vhost: enable compliant offloading mode
>>>
>>> Hi Chenbo,
>>>
>>> On 5/16/22 15:26, Xia, Chenbo wrote:
>>>> Hi Maxime,
>>>>
>>>>> -----Original Message-----
>>>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>>> Sent: Thursday, May 5, 2022 6:27 PM
>>>>> To: dev@dpdk.org; jasowang@redhat.com; Xia, Chenbo
>>> <chenbo.xia@intel.com>;
>>>>> david.marchand@redhat.com; olivier.matz@6wind.com
>>>>> Cc: stable@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
>>>>> Subject: [PATCH 3/6] net/vhost: enable compliant offloading mode
>>>>>
>>>>> This patch enables the compliant offloading flags mode by default,
>>>>> which prevents the Rx path to set Tx offload flags, which is
>>>>> illegal. A new legacy-ol-flags devarg is introduced to enable the
>>>>> legacy behaviour.
>>>>>
>>>>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>>> ---
>>>>> doc/guides/nics/vhost.rst | 6 ++++++
>>>>> drivers/net/vhost/rte_eth_vhost.c | 19 ++++++++++++++++---
>>>>> 2 files changed, 22 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/doc/guides/nics/vhost.rst b/doc/guides/nics/vhost.rst
>>>>> index ee802ec4a8..d7c0e2ade8 100644
>>>>> --- a/doc/guides/nics/vhost.rst
>>>>> +++ b/doc/guides/nics/vhost.rst
>>>>> @@ -64,6 +64,12 @@ The user can specify below arguments in `--vdev`
>>> option.
>>>>> It is used to enable external buffer support in vhost library.
>>>>> (Default: 0 (disabled))
>>>>>
>>>>> +#. ``legacy-ol-flags``:
>>>>> +
>>>>> + It is used to restore legacy behavior for offloading that was not
>>>>> + compliant with offloading API.
>>>>> + (Default: 0 (disabled))
>>>>> +
>>>>> Vhost PMD event handling
>>>>> ------------------------
>>>>>
>>>>> diff --git a/drivers/net/vhost/rte_eth_vhost.c
>>>>> b/drivers/net/vhost/rte_eth_vhost.c
>>>>> index 070f0e6dfd..0a2e8d9b29 100644
>>>>> --- a/drivers/net/vhost/rte_eth_vhost.c
>>>>> +++ b/drivers/net/vhost/rte_eth_vhost.c
>>>>> @@ -31,9 +31,10 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ,
>> VIRTIO_QNUM};
>>>>> #define ETH_VHOST_CLIENT_ARG "client"
>>>>> #define ETH_VHOST_IOMMU_SUPPORT "iommu-support"
>>>>> #define ETH_VHOST_POSTCOPY_SUPPORT "postcopy-support"
>>>>> -#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
>>>>> -#define ETH_VHOST_LINEAR_BUF "linear-buffer"
>>>>> -#define ETH_VHOST_EXT_BUF "ext-buffer"
>>>>> +#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
>>>>> +#define ETH_VHOST_LINEAR_BUF "linear-buffer"
>>>>> +#define ETH_VHOST_EXT_BUF "ext-buffer"
>>>>> +#define ETH_VHOST_LEGACY_OL_FLAGS "legacy-ol-flags"
>>>>> #define VHOST_MAX_PKT_BURST 32
>>>>>
>
> ETH_VHOST_LEGACY_OL_FLAGS should be added into valid_arguments array.
>
> static const char *valid_arguments[] = {
> ETH_VHOST_IFACE_ARG,
> ETH_VHOST_QUEUES_ARG,
> ETH_VHOST_CLIENT_ARG,
> ETH_VHOST_IOMMU_SUPPORT,
> ETH_VHOST_POSTCOPY_SUPPORT,
> ETH_VHOST_VIRTIO_NET_F_HOST_TSO,
> ETH_VHOST_LINEAR_BUF,
> ETH_VHOST_EXT_BUF,
> NULL
> };
Thanks, good catch!
I missed to test this new devarg addition, fixing it for v2.
Maxime
@@ -64,6 +64,12 @@ The user can specify below arguments in `--vdev` option.
It is used to enable external buffer support in vhost library.
(Default: 0 (disabled))
+#. ``legacy-ol-flags``:
+
+ It is used to restore legacy behavior for offloading that was not
+ compliant with offloading API.
+ (Default: 0 (disabled))
+
Vhost PMD event handling
------------------------
@@ -31,9 +31,10 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
#define ETH_VHOST_CLIENT_ARG "client"
#define ETH_VHOST_IOMMU_SUPPORT "iommu-support"
#define ETH_VHOST_POSTCOPY_SUPPORT "postcopy-support"
-#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
-#define ETH_VHOST_LINEAR_BUF "linear-buffer"
-#define ETH_VHOST_EXT_BUF "ext-buffer"
+#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
+#define ETH_VHOST_LINEAR_BUF "linear-buffer"
+#define ETH_VHOST_EXT_BUF "ext-buffer"
+#define ETH_VHOST_LEGACY_OL_FLAGS "legacy-ol-flags"
#define VHOST_MAX_PKT_BURST 32
static const char *valid_arguments[] = {
@@ -1563,6 +1564,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
int tso = 0;
int linear_buf = 0;
int ext_buf = 0;
+ int legacy_ol_flags = 0;
struct rte_eth_dev *eth_dev;
const char *name = rte_vdev_device_name(dev);
@@ -1672,6 +1674,17 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
flags |= RTE_VHOST_USER_EXTBUF_SUPPORT;
}
+ if (rte_kvargs_count(kvlist, ETH_VHOST_LEGACY_OL_FLAGS) == 1) {
+ ret = rte_kvargs_process(kvlist,
+ ETH_VHOST_LEGACY_OL_FLAGS,
+ &open_int, &legacy_ol_flags);
+ if (ret < 0)
+ goto out_free;
+ }
+
+ if (legacy_ol_flags == 0)
+ flags |= RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
+
if (dev->device.numa_node == SOCKET_ID_ANY)
dev->device.numa_node = rte_socket_id();