[4/4] net/vhost: make secondary probe complete

Message ID 20200108232209.5460-5-oda@valinux.co.jp (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series [1/4] net/vhost: remove an unused member |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK

Commit Message

Itsuro Oda Jan. 8, 2020, 11:22 p.m. UTC
  add lacking member setting and make secondary probe complete.

Signed-off-by: Itsuro Oda <oda@valinux.co.jp>
---
 drivers/net/vhost/rte_eth_vhost.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Maxime Coquelin Feb. 4, 2020, 6:08 p.m. UTC | #1
On 1/9/20 12:22 AM, Itsuro Oda wrote:
> add lacking member setting and make secondary probe complete.

Add

> Signed-off-by: Itsuro Oda <oda@valinux.co.jp>
> ---
>  drivers/net/vhost/rte_eth_vhost.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
> index 44f44cea3..485a88794 100644
> --- a/drivers/net/vhost/rte_eth_vhost.c
> +++ b/drivers/net/vhost/rte_eth_vhost.c
> @@ -1390,8 +1390,11 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
>  			VHOST_LOG(ERR, "Failed to probe %s\n", name);
>  			return -1;
>  		}
> -		/* TODO: request info from primary to set up Rx and Tx */
> +		eth_dev->rx_pkt_burst = eth_vhost_rx;
> +		eth_dev->tx_pkt_burst = eth_vhost_tx;
>  		eth_dev->dev_ops = &ops;
> +		if (dev->device.numa_node == SOCKET_ID_ANY)
> +			dev->device.numa_node = rte_socket_id();
>  		eth_dev->device = &dev->device;
>  		rte_eth_dev_probing_finish(eth_dev);
>  		return 0;
> 

Other than that
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  

Patch

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 44f44cea3..485a88794 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1390,8 +1390,11 @@  rte_pmd_vhost_probe(struct rte_vdev_device *dev)
 			VHOST_LOG(ERR, "Failed to probe %s\n", name);
 			return -1;
 		}
-		/* TODO: request info from primary to set up Rx and Tx */
+		eth_dev->rx_pkt_burst = eth_vhost_rx;
+		eth_dev->tx_pkt_burst = eth_vhost_tx;
 		eth_dev->dev_ops = &ops;
+		if (dev->device.numa_node == SOCKET_ID_ANY)
+			dev->device.numa_node = rte_socket_id();
 		eth_dev->device = &dev->device;
 		rte_eth_dev_probing_finish(eth_dev);
 		return 0;