[dpdk-dev,v3] net/vhost: convert to new Rx/Tx offload API

Message ID 20180522125019.26977-1-maxime.coquelin@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Maxime Coquelin May 22, 2018, 12:50 p.m. UTC
  Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
Changes since v2:
- Remove check for unsupported offload feature (Tiwei)

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

Comments

Tiwei Bie May 22, 2018, 12:54 p.m. UTC | #1
On Tue, May 22, 2018 at 02:50:19PM +0200, Maxime Coquelin wrote:
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

Thanks for the work!

Best regards,
Tiwei Bie
  
Ferruh Yigit May 22, 2018, 1:19 p.m. UTC | #2
On 5/22/2018 1:54 PM, Tiwei Bie wrote:
> On Tue, May 22, 2018 at 02:50:19PM +0200, Maxime Coquelin wrote:
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index f473bbbb3..ba9d768a0 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -491,12 +491,7 @@  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;
-
-	if (rxmode->hw_vlan_filter)
-		VHOST_LOG(WARNING,
-			"vhost(%s): vlan filtering not available\n",
-			internal->dev_name);
+	internal->vlan_strip = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
 
 	return 0;
 }
@@ -1072,6 +1067,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