examples/l2fwd: add check for promiscuous no support
PATCH 1/1 examples/l2fwd: add check for promiscuous no support
l2fwd application exits, if return for rte_eth_promiscuous_enable is not success. But for vHost PMD, promiscuous enable returns "Not Supported".
This patch validates success and no support of promiscuous enable.
--- examples/l2fwd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/l2fwd/main.c +1 -1
@@ -727,7 +727,7 @@ main(int argc, char **argv)printf ("done: \n" ); ret =rte_eth_promiscuous_enable (portid); -if (ret !=0 ) +if ((ret !=0 ) && (ret != -ENOTSUP ))rte_exit (EXIT_FAILURE ,"rte_eth_promiscuous_enable:err=%s, port=%u\n" ,rte_strerror (-ret), portid);
Signature · 1 line
2.17.1
Quoted 4 lines · Sivaprasad Tummala
l2fwd application exits, if return for
rte_eth_promiscuous_enableis not success. But for vHost PMD, promiscuous enable returns "Not Supported".
Could the vhost pmd announce that it is already in promiscuous mode? Like in f165210321c4 ("drivers/net: enable promiscuous and multicast by default")
Signature · 1 line
David Marchand
Hi, David
Quoted 10 lines · David Marchand
Quoted 4 lines · Sivaprasad Tummala
l2fwd application exits, if return for
rte_eth_promiscuous_enableis not success. But for vHost PMD, promiscuous enable returns "Not Supported".Could the vhost pmd announce that it is already in promiscuous mode? Like in
f165210321c4("drivers/net: enable promiscuous and multicast by default")
I think it makes sense, I don't see any risk of doing it. I'll cook a patch for it soon.
Thanks,
Xiaolong
Quoted 5 lines
Signature · 2 lines
-- David Marchand
Quoted 8 lines · Ye Xiaolong
Quoted 7 lines · David Marchand
Quoted 4 lines · Sivaprasad Tummala
l2fwd application exits, if return for
rte_eth_promiscuous_enableis not success. But for vHost PMD, promiscuous enable returns "Not Supported".
Quoted 6 lines
Quoted 3 lines
Could the vhost pmd announce that it is already in promiscuous mode? Like in
f165210321c4("drivers/net: enable promiscuous and multicast by default")I think it makes sense, I don't see any risk of doing it. I'll cook a patch for it soon.
Now that vhost has been fixed [1], I'll mark this patch as rejected. 1: https://git.dpdk.org/dpdk/commit?id=a2154606ffa6b5ddacbebd8714facc7e2fda3262
Thanks.
Signature · 1 line
David Marchand
PATCH 1/1 net/vhost: enable promiscuous and multicast by default
In reply to David MarchandWith this patch, the promiscuous and multicast fields are initialized as enabled for vhost PMD by default, this allows the devices to be used when running applications that attempt to enable promiscuous or multicast mode. Similar things have done for other virtual PMDs by commit f165210321c4 ("drivers/net: enable promiscuous and multicast by default")
--- drivers/net/vhost/rte_eth_vhost.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/vhost/rte_eth_vhost.c +2 -0
@@ -1331,6 +1331,8 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name, internal->disable_flags = disable_flags; data->dev_link = pmd_link; data->dev_flags =RTE_ETH_DEV_INTR_LSC |RTE_ETH_DEV_CLOSE_REMOVE ; + data->promiscuous =1 ; + data->all_multicast =1 ; eth_dev->dev_ops = &ops;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH] net/vhost: enable promiscuous and multicast by default
Quoted 17 lines · Xiaolong Ye
With this patch, the promiscuous and multicast fields are initialized as enabled for vhost PMD by default, this allows the devices to be used when running applications that attempt to enable promiscuous or multicast mode. Similar things have done for other virtual PMDs by commit
f165210321c4("drivers/net: enable promiscuous and multicast by default")Signed-off-by Xiaolong Ye <[email protected]>--- drivers/net/vhost/rte_eth_vhost.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/vhost/rte_eth_vhost.c +0
-0
drivers/net/vhost/rte_eth_vhost.c eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name, · line 1338
Quoted 8 lines
drivers/net/vhost/rte_eth_vhost.c +2
-0@@ -1331,6 +1331,8 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name, internal->disable_flags = disable_flags; data->dev_link = pmd_link; data->dev_flags =RTE_ETH_DEV_INTR_LSC |RTE_ETH_DEV_CLOSE_REMOVE ; + data->promiscuous =1 ; + data->all_multicast =1 ; eth_dev->dev_ops = &ops;
Thanks,
Maxime
Maxime Coquelin
AppliedRe: [dpdk-dev] [PATCH] net/vhost: enable promiscuous and multicast by default
In reply to Xiaolong YeQuoted 10 lines · Xiaolong Ye
With this patch, the promiscuous and multicast fields are initialized as enabled for vhost PMD by default, this allows the devices to be used when running applications that attempt to enable promiscuous or multicast mode. Similar things have done for other virtual PMDs by commit
f165210321c4("drivers/net: enable promiscuous and multicast by default")Signed-off-by Xiaolong Ye <[email protected]>--- drivers/net/vhost/rte_eth_vhost.c | 2 ++ 1 file changed, 2 insertions(+)
Applied to dpdk-next-virtio/master.
Thanks,
Maxime