DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] dumpcap: correctly disable promiscuous mode at exit
@ 2024-02-27  9:23 Isaac Boukris
  2024-02-27 18:07 ` Stephen Hemminger
  2024-03-07 22:37 ` [PATCH v2] " Stephen Hemminger
  0 siblings, 2 replies; 6+ messages in thread
From: Isaac Boukris @ 2024-02-27  9:23 UTC (permalink / raw)
  To: stephen; +Cc: dev, Isaac Boukris

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
---
 app/dumpcap/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index d57db0589a..88cec43086 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -830,11 +830,12 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp)
 				intf->opts.promisc_mode = false;
 			} else {
 				ret = rte_eth_promiscuous_enable(intf->port);
-				if (ret != 0)
+				if (ret != 0) {
 					fprintf(stderr,
 						"port %u set promiscuous enable failed: %d\n",
 						intf->port, ret);
-				intf->opts.promisc_mode = false;
+					intf->opts.promisc_mode = false;
+				}
 			}
 		}
 		++count;
-- 
2.43.2


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

* Re: [PATCH] dumpcap: correctly disable promiscuous mode at exit
  2024-02-27  9:23 [PATCH] dumpcap: correctly disable promiscuous mode at exit Isaac Boukris
@ 2024-02-27 18:07 ` Stephen Hemminger
  2024-03-06 21:45   ` Thomas Monjalon
  2024-03-07 22:37 ` [PATCH v2] " Stephen Hemminger
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2024-02-27 18:07 UTC (permalink / raw)
  To: Isaac Boukris; +Cc: dev

On Tue, 27 Feb 2024 11:23:26 +0200
Isaac Boukris <iboukris@gmail.com> wrote:

> Signed-off-by: Isaac Boukris <iboukris@gmail.com>
> ---
>  app/dumpcap/main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
> index d57db0589a..88cec43086 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -830,11 +830,12 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp)
>  				intf->opts.promisc_mode = false;
>  			} else {
>  				ret = rte_eth_promiscuous_enable(intf->port);
> -				if (ret != 0)
> +				if (ret != 0) {
>  					fprintf(stderr,
>  						"port %u set promiscuous enable failed: %d\n",
>  						intf->port, ret);
> -				intf->opts.promisc_mode = false;
> +					intf->opts.promisc_mode = false;
> +				}
>  			}
>  		}
>  		++count;

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>

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

* Re: [PATCH] dumpcap: correctly disable promiscuous mode at exit
  2024-02-27 18:07 ` Stephen Hemminger
@ 2024-03-06 21:45   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2024-03-06 21:45 UTC (permalink / raw)
  To: Isaac Boukris, Stephen Hemminger; +Cc: dev

27/02/2024 19:07, Stephen Hemminger:
> On Tue, 27 Feb 2024 11:23:26 +0200
> Isaac Boukris <iboukris@gmail.com> wrote:
> 
> > Signed-off-by: Isaac Boukris <iboukris@gmail.com>
> 
> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>

Please could you help providing a message for the commit log?




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

* [PATCH v2] dumpcap: correctly disable promiscuous mode at exit
  2024-02-27  9:23 [PATCH] dumpcap: correctly disable promiscuous mode at exit Isaac Boukris
  2024-02-27 18:07 ` Stephen Hemminger
@ 2024-03-07 22:37 ` Stephen Hemminger
  2024-03-08  7:09   ` Isaac Boukris
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2024-03-07 22:37 UTC (permalink / raw)
  To: dev; +Cc: Isaac Boukris, Stephen Hemminger

From: Isaac Boukris <iboukris@gmail.com>

If request to set promiscious mode failed at startup,
then it is not necessary to disable it when shutting down.

This should only be issue if with a buggy driver because if
driver does not support setting promiscious it would just
ignore request to disable it as well.

Fixes: 6026bfae07d4 ("app/dumpcap: support multiple interfaces")
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
v2 - add more to commit log, and simplify the logic

 app/dumpcap/main.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 76c747511444..11e470391edb 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -828,12 +828,9 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp)
 			if (rte_eth_promiscuous_get(intf->port) == 1) {
 				/* promiscuous already enabled */
 				intf->opts.promisc_mode = false;
-			} else {
-				ret = rte_eth_promiscuous_enable(intf->port);
-				if (ret != 0)
-					fprintf(stderr,
-						"port %u set promiscuous enable failed: %d\n",
-						intf->port, ret);
+			} else if (rte_eth_promiscuous_enable(intf->port) < 0) {
+				fprintf(stderr, "port %u:%s set promiscuous failed\n",
+					intf->port, intf->name);
 				intf->opts.promisc_mode = false;
 			}
 		}
-- 
2.43.0


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

* Re: [PATCH v2] dumpcap: correctly disable promiscuous mode at exit
  2024-03-07 22:37 ` [PATCH v2] " Stephen Hemminger
@ 2024-03-08  7:09   ` Isaac Boukris
  2024-03-18  3:04     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Isaac Boukris @ 2024-03-08  7:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Fri, Mar 8, 2024 at 12:39 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> From: Isaac Boukris <iboukris@gmail.com>
>
> If request to set promiscious mode failed at startup,
> then it is not necessary to disable it when shutting down.
>
> This should only be issue if with a buggy driver because if
> driver does not support setting promiscious it would just
> ignore request to disable it as well.
>
> Fixes: 6026bfae07d4 ("app/dumpcap: support multiple interfaces")
> Signed-off-by: Isaac Boukris <iboukris@gmail.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> v2 - add more to commit log, and simplify the logic
>
>  app/dumpcap/main.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
> index 76c747511444..11e470391edb 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -828,12 +828,9 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp)
>                         if (rte_eth_promiscuous_get(intf->port) == 1) {
>                                 /* promiscuous already enabled */
>                                 intf->opts.promisc_mode = false;
> -                       } else {
> -                               ret = rte_eth_promiscuous_enable(intf->port);
> -                               if (ret != 0)
> -                                       fprintf(stderr,
> -                                               "port %u set promiscuous enable failed: %d\n",
> -                                               intf->port, ret);
> +                       } else if (rte_eth_promiscuous_enable(intf->port) < 0) {
> +                               fprintf(stderr, "port %u:%s set promiscuous failed\n",
> +                                       intf->port, intf->name);
>                                 intf->opts.promisc_mode = false;
>                         }
>                 }
> --
> 2.43.0
>

V2 looks good to me.

Thanks!

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

* Re: [PATCH v2] dumpcap: correctly disable promiscuous mode at exit
  2024-03-08  7:09   ` Isaac Boukris
@ 2024-03-18  3:04     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2024-03-18  3:04 UTC (permalink / raw)
  To: Stephen Hemminger, Isaac Boukris; +Cc: dev

08/03/2024 08:09, Isaac Boukris:
> On Fri, Mar 8, 2024 at 12:39 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > From: Isaac Boukris <iboukris@gmail.com>
> >
> > If request to set promiscious mode failed at startup,
> > then it is not necessary to disable it when shutting down.
> >
> > This should only be issue if with a buggy driver because if
> > driver does not support setting promiscious it would just
> > ignore request to disable it as well.
> >
> > Fixes: 6026bfae07d4 ("app/dumpcap: support multiple interfaces")
> > Signed-off-by: Isaac Boukris <iboukris@gmail.com>
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> V2 looks good to me.
> 
> Thanks!

Applied, thanks.



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

end of thread, other threads:[~2024-03-18  3:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-27  9:23 [PATCH] dumpcap: correctly disable promiscuous mode at exit Isaac Boukris
2024-02-27 18:07 ` Stephen Hemminger
2024-03-06 21:45   ` Thomas Monjalon
2024-03-07 22:37 ` [PATCH v2] " Stephen Hemminger
2024-03-08  7:09   ` Isaac Boukris
2024-03-18  3:04     ` Thomas Monjalon

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).