[v1] examples/l2fwd: add check for promiscuous no support

Message ID 20200226091501.27967-1-Sivaprasad.Tummala@intel.com (mailing list archive)
State Rejected, archived
Delegated to: David Marchand
Headers
Series [v1] examples/l2fwd: add check for promiscuous no support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed

Commit Message

Sivaprasad Tummala Feb. 26, 2020, 9:15 a.m. UTC
  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.

Signed-off-by: Sivaprasad Tummala <Sivaprasad.Tummala@intel.com>
---
 examples/l2fwd/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand Feb. 26, 2020, 9:22 a.m. UTC | #1
On Wed, Feb 26, 2020 at 10:15 AM Sivaprasad Tummala
<Sivaprasad.Tummala@intel.com> wrote:
>
> l2fwd application exits, if return for rte_eth_promiscuous_enable
> is 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")
  
Xiaolong Ye Feb. 26, 2020, 1:43 p.m. UTC | #2
Hi, David

On 02/26, David Marchand wrote:
>On Wed, Feb 26, 2020 at 10:15 AM Sivaprasad Tummala
><Sivaprasad.Tummala@intel.com> wrote:
>>
>> l2fwd application exits, if return for rte_eth_promiscuous_enable
>> is 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

>
>
>-- 
>David Marchand
>
  
David Marchand April 24, 2020, 8:33 p.m. UTC | #3
On Wed, Feb 26, 2020 at 2:46 PM Ye Xiaolong <xiaolong.ye@intel.com> wrote:
> On 02/26, David Marchand wrote:
> >On Wed, Feb 26, 2020 at 10:15 AM Sivaprasad Tummala
> ><Sivaprasad.Tummala@intel.com> wrote:
> >>
> >> l2fwd application exits, if return for rte_eth_promiscuous_enable
> >> is 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.

Now that vhost has been fixed [1], I'll mark this patch as rejected.
1: https://git.dpdk.org/dpdk/commit?id=a2154606ffa6b5ddacbebd8714facc7e2fda3262


Thanks.
  

Patch

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 09257aab1..ea9831f07 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -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);