DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/vhost: convert to new Rx/Tx offload API
@ 2018-05-22 12:22 Maxime Coquelin
  2018-05-22 12:34 ` Tiwei Bie
  0 siblings, 1 reply; 5+ messages in thread
From: Maxime Coquelin @ 2018-05-22 12:22 UTC (permalink / raw)
  To: dev, tiwei.bie, ferruh.yigit; +Cc: Maxime Coquelin

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
Changes since v2:
- Announce supported Rx & Tx offload features (Tiwei)

 drivers/net/vhost/rte_eth_vhost.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index f473bbbb3..229a5ba8d 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -491,9 +491,9 @@ eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
 	struct pmd_internal *internal = dev->data->dev_private;
 	const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
 
-	internal->vlan_strip = rxmode->hw_vlan_strip;
+	internal->vlan_strip = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
 
-	if (rxmode->hw_vlan_filter)
+	if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
 		VHOST_LOG(WARNING,
 			"vhost(%s): vlan filtering not available\n",
 			internal->dev_name);
@@ -1072,6 +1072,10 @@ eth_dev_info(struct rte_eth_dev *dev,
 	dev_info->max_rx_queues = internal->max_queues;
 	dev_info->max_tx_queues = internal->max_queues;
 	dev_info->min_rx_bufsize = 0;
+
+	dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS |
+				DEV_TX_OFFLOAD_VLAN_INSERT;
+	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
 }
 
 static int
-- 
2.14.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/vhost: convert to new Rx/Tx offload API
  2018-05-22 12:22 [dpdk-dev] [PATCH v2] net/vhost: convert to new Rx/Tx offload API Maxime Coquelin
@ 2018-05-22 12:34 ` Tiwei Bie
  2018-05-22 12:37   ` Maxime Coquelin
  2018-05-22 12:38   ` Ferruh Yigit
  0 siblings, 2 replies; 5+ messages in thread
From: Tiwei Bie @ 2018-05-22 12:34 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: dev, ferruh.yigit

On Tue, May 22, 2018 at 02:22:11PM +0200, Maxime Coquelin wrote:
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> Changes since v2:
> - Announce supported Rx & Tx offload features (Tiwei)
> 
>  drivers/net/vhost/rte_eth_vhost.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
> index f473bbbb3..229a5ba8d 100644
> --- a/drivers/net/vhost/rte_eth_vhost.c
> +++ b/drivers/net/vhost/rte_eth_vhost.c
> @@ -491,9 +491,9 @@ eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
>  	struct pmd_internal *internal = dev->data->dev_private;
>  	const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
>  
> -	internal->vlan_strip = rxmode->hw_vlan_strip;
> +	internal->vlan_strip = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
>  
> -	if (rxmode->hw_vlan_filter)
> +	if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
>  		VHOST_LOG(WARNING,
>  			"vhost(%s): vlan filtering not available\n",
>  			internal->dev_name);

I'm not quite sure whether we still need to log this warning.

> @@ -1072,6 +1072,10 @@ eth_dev_info(struct rte_eth_dev *dev,
>  	dev_info->max_rx_queues = internal->max_queues;
>  	dev_info->max_tx_queues = internal->max_queues;
>  	dev_info->min_rx_bufsize = 0;
> +
> +	dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS |
> +				DEV_TX_OFFLOAD_VLAN_INSERT;
> +	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
>  }

Other than that, it looks good to me. Thanks!

Best regards,
Tiwei Bie

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/vhost: convert to new Rx/Tx offload API
  2018-05-22 12:34 ` Tiwei Bie
@ 2018-05-22 12:37   ` Maxime Coquelin
  2018-05-22 12:38   ` Ferruh Yigit
  1 sibling, 0 replies; 5+ messages in thread
From: Maxime Coquelin @ 2018-05-22 12:37 UTC (permalink / raw)
  To: Tiwei Bie; +Cc: dev, ferruh.yigit



On 05/22/2018 02:34 PM, Tiwei Bie wrote:
> On Tue, May 22, 2018 at 02:22:11PM +0200, Maxime Coquelin wrote:
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>> Changes since v2:
>> - Announce supported Rx & Tx offload features (Tiwei)
>>
>>   drivers/net/vhost/rte_eth_vhost.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
>> index f473bbbb3..229a5ba8d 100644
>> --- a/drivers/net/vhost/rte_eth_vhost.c
>> +++ b/drivers/net/vhost/rte_eth_vhost.c
>> @@ -491,9 +491,9 @@ eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
>>   	struct pmd_internal *internal = dev->data->dev_private;
>>   	const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
>>   
>> -	internal->vlan_strip = rxmode->hw_vlan_strip;
>> +	internal->vlan_strip = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
>>   
>> -	if (rxmode->hw_vlan_filter)
>> +	if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
>>   		VHOST_LOG(WARNING,
>>   			"vhost(%s): vlan filtering not available\n",
>>   			internal->dev_name);
> 
> I'm not quite sure whether we still need to log this warning.

In theory we should not. But currently, my understanding is that no
error is returned in the current release (see 
lib/librte_ethdev/rte_ethdev.c:1174).

I think we can remove it in next release.

>> @@ -1072,6 +1072,10 @@ eth_dev_info(struct rte_eth_dev *dev,
>>   	dev_info->max_rx_queues = internal->max_queues;
>>   	dev_info->max_tx_queues = internal->max_queues;
>>   	dev_info->min_rx_bufsize = 0;
>> +
>> +	dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS |
>> +				DEV_TX_OFFLOAD_VLAN_INSERT;
>> +	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
>>   }
> 
> Other than that, it looks good to me. Thanks!


Thanks for the review.
Maxime

> Best regards,
> Tiwei Bie
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/vhost: convert to new Rx/Tx offload API
  2018-05-22 12:34 ` Tiwei Bie
  2018-05-22 12:37   ` Maxime Coquelin
@ 2018-05-22 12:38   ` Ferruh Yigit
  2018-05-22 12:48     ` Maxime Coquelin
  1 sibling, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2018-05-22 12:38 UTC (permalink / raw)
  To: Tiwei Bie, Maxime Coquelin; +Cc: dev

On 5/22/2018 1:34 PM, Tiwei Bie wrote:
> On Tue, May 22, 2018 at 02:22:11PM +0200, Maxime Coquelin wrote:
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>> Changes since v2:
>> - Announce supported Rx & Tx offload features (Tiwei)
>>
>>  drivers/net/vhost/rte_eth_vhost.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
>> index f473bbbb3..229a5ba8d 100644
>> --- a/drivers/net/vhost/rte_eth_vhost.c
>> +++ b/drivers/net/vhost/rte_eth_vhost.c
>> @@ -491,9 +491,9 @@ eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
>>  	struct pmd_internal *internal = dev->data->dev_private;
>>  	const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
>>  
>> -	internal->vlan_strip = rxmode->hw_vlan_strip;
>> +	internal->vlan_strip = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
>>  
>> -	if (rxmode->hw_vlan_filter)
>> +	if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
>>  		VHOST_LOG(WARNING,
>>  			"vhost(%s): vlan filtering not available\n",
>>  			internal->dev_name);
> 
> I'm not quite sure whether we still need to log this warning.

Similar warning exists in ethdev layer, when an offload requested that is not
reported in capability. So I agree to remove this.

And in next release that warning will be converted into error, so that PMD will
not get those values at all.

> 
>> @@ -1072,6 +1072,10 @@ eth_dev_info(struct rte_eth_dev *dev,
>>  	dev_info->max_rx_queues = internal->max_queues;
>>  	dev_info->max_tx_queues = internal->max_queues;
>>  	dev_info->min_rx_bufsize = 0;
>> +
>> +	dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS |
>> +				DEV_TX_OFFLOAD_VLAN_INSERT;
>> +	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
>>  }
> 
> Other than that, it looks good to me. Thanks!
> 
> Best regards,
> Tiwei Bie
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/vhost: convert to new Rx/Tx offload API
  2018-05-22 12:38   ` Ferruh Yigit
@ 2018-05-22 12:48     ` Maxime Coquelin
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Coquelin @ 2018-05-22 12:48 UTC (permalink / raw)
  To: Ferruh Yigit, Tiwei Bie; +Cc: dev



On 05/22/2018 02:38 PM, Ferruh Yigit wrote:
> On 5/22/2018 1:34 PM, Tiwei Bie wrote:
>> On Tue, May 22, 2018 at 02:22:11PM +0200, Maxime Coquelin wrote:
>>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>>> ---
>>> Changes since v2:
>>> - Announce supported Rx & Tx offload features (Tiwei)
>>>
>>>   drivers/net/vhost/rte_eth_vhost.c | 8 ++++++--
>>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
>>> index f473bbbb3..229a5ba8d 100644
>>> --- a/drivers/net/vhost/rte_eth_vhost.c
>>> +++ b/drivers/net/vhost/rte_eth_vhost.c
>>> @@ -491,9 +491,9 @@ eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
>>>   	struct pmd_internal *internal = dev->data->dev_private;
>>>   	const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
>>>   
>>> -	internal->vlan_strip = rxmode->hw_vlan_strip;
>>> +	internal->vlan_strip = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
>>>   
>>> -	if (rxmode->hw_vlan_filter)
>>> +	if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
>>>   		VHOST_LOG(WARNING,
>>>   			"vhost(%s): vlan filtering not available\n",
>>>   			internal->dev_name);
>>
>> I'm not quite sure whether we still need to log this warning.
> 
> Similar warning exists in ethdev layer, when an offload requested that is not
> reported in capability. So I agree to remove this.
> 
> And in next release that warning will be converted into error, so that PMD will
> not get those values at all.

Ok, I'll post a v3 removing the check.

Thanks,
Maxime

>>
>>> @@ -1072,6 +1072,10 @@ eth_dev_info(struct rte_eth_dev *dev,
>>>   	dev_info->max_rx_queues = internal->max_queues;
>>>   	dev_info->max_tx_queues = internal->max_queues;
>>>   	dev_info->min_rx_bufsize = 0;
>>> +
>>> +	dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS |
>>> +				DEV_TX_OFFLOAD_VLAN_INSERT;
>>> +	dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
>>>   }
>>
>> Other than that, it looks good to me. Thanks!
>>
>> Best regards,
>> Tiwei Bie
>>
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-22 12:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 12:22 [dpdk-dev] [PATCH v2] net/vhost: convert to new Rx/Tx offload API Maxime Coquelin
2018-05-22 12:34 ` Tiwei Bie
2018-05-22 12:37   ` Maxime Coquelin
2018-05-22 12:38   ` Ferruh Yigit
2018-05-22 12:48     ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).