[v9,06/10] app/testpmd: fix parse_fec_mode return type

Message ID 1619805162-10684-7-git-send-email-jizh@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: enable testpmd on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jie Zhou April 30, 2021, 5:52 p.m. UTC
  Fix parse_fec_mode to return fec_capa instead of mode

Signed-off-by: Jie Zhou <jizh@microsoft.com>
Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
---
 app/test-pmd/cmdline.c | 6 +++---
 app/test-pmd/config.c  | 4 ++--
 app/test-pmd/testpmd.h | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
  

Comments

Tal Shnaiderman May 3, 2021, 5:38 p.m. UTC | #1
> Subject: [PATCH v9 06/10] app/testpmd: fix parse_fec_mode return type
> 

I think you should name this patch " app/testpmd: fix parse_fec_mode misleading return type name"

Do we need a fixes/CC stable tags here?

> External email: Use caution opening links or attachments
> 
> 
> Fix parse_fec_mode to return fec_capa instead of mode
> 
> Signed-off-by: Jie Zhou <jizh@microsoft.com>
> Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
> ---
>  app/test-pmd/cmdline.c | 6 +++---
>  app/test-pmd/config.c  | 4 ++--
>  app/test-pmd/testpmd.h | 2 +-
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 12efbc0ca..d804ee233 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -16984,17 +16984,17 @@ cmd_set_port_fec_mode_parsed(  {
>         struct cmd_set_port_fec_mode *res = parsed_result;
>         uint16_t port_id = res->port_id;
> -       uint32_t mode;
> +       uint32_t fec_capa;
>         int ret;
> 
> -       ret = parse_fec_mode(res->fec_value, &mode);
> +       ret = parse_fec_mode(res->fec_value, &fec_capa);
>         if (ret < 0) {
>                 printf("Unknown fec mode: %s for Port %d\n", res->fec_value,
>                         port_id);
>                 return;
>         }
> 
> -       ret = rte_eth_fec_set(port_id, mode);
> +       ret = rte_eth_fec_set(port_id, fec_capa);
>         if (ret == -ENOTSUP) {
>                 printf("Function not implemented\n");
>                 return;
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> 0e86ed02f..c626d5ce8 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -3549,13 +3549,13 @@ set_tx_pkt_split(const char *name)  }
> 
>  int
> -parse_fec_mode(const char *name, uint32_t *mode)
> +parse_fec_mode(const char *name, uint32_t *fec_capa)
>  {
>         uint8_t i;
> 
>         for (i = 0; i < RTE_DIM(fec_mode_name); i++) {
>                 if (strcmp(fec_mode_name[i].name, name) == 0) {
> -                       *mode =
> RTE_ETH_FEC_MODE_TO_CAPA(fec_mode_name[i].mode);
> +                       *fec_capa =
> + RTE_ETH_FEC_MODE_TO_CAPA(fec_mode_name[i].mode);
>                         return 0;
>                 }
>         }
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index
> 6ca872db8..1d104213b 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -886,7 +886,7 @@ void show_tx_pkt_segments(void);  void
> set_tx_pkt_times(unsigned int *tx_times);  void show_tx_pkt_times(void);
> void set_tx_pkt_split(const char *name); -int parse_fec_mode(const char
> *name, enum rte_eth_fec_mode *mode);
> +int parse_fec_mode(const char *name, uint32_t *fec_capa);
>  void show_fec_capability(uint32_t num, struct rte_eth_fec_capa
> *speed_fec_capa);  void set_nb_pkt_per_burst(uint16_t pkt_burst);  char
> *list_pkt_forwarding_modes(void);
> --
> 2.30.0.vfs.0.2
  
Jie Zhou May 3, 2021, 9:43 p.m. UTC | #2
On Mon, May 03, 2021 at 05:38:21PM +0000, Tal Shnaiderman wrote:
> > Subject: [PATCH v9 06/10] app/testpmd: fix parse_fec_mode return type
> > 
> 
> I think you should name this patch " app/testpmd: fix parse_fec_mode misleading return type name"
> 
> Do we need a fixes/CC stable tags here?

Will add CC stable, but not sure how to find the original patch which introduced this.

> 
> > External email: Use caution opening links or attachments
> > 
> > 
> > Fix parse_fec_mode to return fec_capa instead of mode
> > 
> > Signed-off-by: Jie Zhou <jizh@microsoft.com>
> > Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
> > ---
> >  app/test-pmd/cmdline.c | 6 +++---
> >  app/test-pmd/config.c  | 4 ++--
> >  app/test-pmd/testpmd.h | 2 +-
> >  3 files changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 12efbc0ca..d804ee233 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -16984,17 +16984,17 @@ cmd_set_port_fec_mode_parsed(  {
> >         struct cmd_set_port_fec_mode *res = parsed_result;
> >         uint16_t port_id = res->port_id;
> > -       uint32_t mode;
> > +       uint32_t fec_capa;
> >         int ret;
> > 
> > -       ret = parse_fec_mode(res->fec_value, &mode);
> > +       ret = parse_fec_mode(res->fec_value, &fec_capa);
> >         if (ret < 0) {
> >                 printf("Unknown fec mode: %s for Port %d\n", res->fec_value,
> >                         port_id);
> >                 return;
> >         }
> > 
> > -       ret = rte_eth_fec_set(port_id, mode);
> > +       ret = rte_eth_fec_set(port_id, fec_capa);
> >         if (ret == -ENOTSUP) {
> >                 printf("Function not implemented\n");
> >                 return;
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> > 0e86ed02f..c626d5ce8 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -3549,13 +3549,13 @@ set_tx_pkt_split(const char *name)  }
> > 
> >  int
> > -parse_fec_mode(const char *name, uint32_t *mode)
> > +parse_fec_mode(const char *name, uint32_t *fec_capa)
> >  {
> >         uint8_t i;
> > 
> >         for (i = 0; i < RTE_DIM(fec_mode_name); i++) {
> >                 if (strcmp(fec_mode_name[i].name, name) == 0) {
> > -                       *mode =
> > RTE_ETH_FEC_MODE_TO_CAPA(fec_mode_name[i].mode);
> > +                       *fec_capa =
> > + RTE_ETH_FEC_MODE_TO_CAPA(fec_mode_name[i].mode);
> >                         return 0;
> >                 }
> >         }
> > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index
> > 6ca872db8..1d104213b 100644
> > --- a/app/test-pmd/testpmd.h
> > +++ b/app/test-pmd/testpmd.h
> > @@ -886,7 +886,7 @@ void show_tx_pkt_segments(void);  void
> > set_tx_pkt_times(unsigned int *tx_times);  void show_tx_pkt_times(void);
> > void set_tx_pkt_split(const char *name); -int parse_fec_mode(const char
> > *name, enum rte_eth_fec_mode *mode);
> > +int parse_fec_mode(const char *name, uint32_t *fec_capa);
> >  void show_fec_capability(uint32_t num, struct rte_eth_fec_capa
> > *speed_fec_capa);  void set_nb_pkt_per_burst(uint16_t pkt_burst);  char
> > *list_pkt_forwarding_modes(void);
> > --
> > 2.30.0.vfs.0.2
  
Jie Zhou May 3, 2021, 10:53 p.m. UTC | #3
On Mon, May 03, 2021 at 02:43:32PM -0700, Jie Zhou wrote:
> On Mon, May 03, 2021 at 05:38:21PM +0000, Tal Shnaiderman wrote:
> > > Subject: [PATCH v9 06/10] app/testpmd: fix parse_fec_mode return type
> > > 
> > 
> > I think you should name this patch " app/testpmd: fix parse_fec_mode misleading return type name"
> > 
> > Do we need a fixes/CC stable tags here?
> 
> Will add CC stable, but not sure how to find the original patch which introduced this.

Found the patch which introduced this. Will add the Fixes and Cc in V10.
> 
> > 
> > > External email: Use caution opening links or attachments
> > > 
> > > 
> > > Fix parse_fec_mode to return fec_capa instead of mode
> > > 
> > > Signed-off-by: Jie Zhou <jizh@microsoft.com>
> > > Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
> > > ---
> > >  app/test-pmd/cmdline.c | 6 +++---
> > >  app/test-pmd/config.c  | 4 ++--
> > >  app/test-pmd/testpmd.h | 2 +-
> > >  3 files changed, 6 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > > 12efbc0ca..d804ee233 100644
> > > --- a/app/test-pmd/cmdline.c
> > > +++ b/app/test-pmd/cmdline.c
> > > @@ -16984,17 +16984,17 @@ cmd_set_port_fec_mode_parsed(  {
> > >         struct cmd_set_port_fec_mode *res = parsed_result;
> > >         uint16_t port_id = res->port_id;
> > > -       uint32_t mode;
> > > +       uint32_t fec_capa;
> > >         int ret;
> > > 
> > > -       ret = parse_fec_mode(res->fec_value, &mode);
> > > +       ret = parse_fec_mode(res->fec_value, &fec_capa);
> > >         if (ret < 0) {
> > >                 printf("Unknown fec mode: %s for Port %d\n", res->fec_value,
> > >                         port_id);
> > >                 return;
> > >         }
> > > 
> > > -       ret = rte_eth_fec_set(port_id, mode);
> > > +       ret = rte_eth_fec_set(port_id, fec_capa);
> > >         if (ret == -ENOTSUP) {
> > >                 printf("Function not implemented\n");
> > >                 return;
> > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> > > 0e86ed02f..c626d5ce8 100644
> > > --- a/app/test-pmd/config.c
> > > +++ b/app/test-pmd/config.c
> > > @@ -3549,13 +3549,13 @@ set_tx_pkt_split(const char *name)  }
> > > 
> > >  int
> > > -parse_fec_mode(const char *name, uint32_t *mode)
> > > +parse_fec_mode(const char *name, uint32_t *fec_capa)
> > >  {
> > >         uint8_t i;
> > > 
> > >         for (i = 0; i < RTE_DIM(fec_mode_name); i++) {
> > >                 if (strcmp(fec_mode_name[i].name, name) == 0) {
> > > -                       *mode =
> > > RTE_ETH_FEC_MODE_TO_CAPA(fec_mode_name[i].mode);
> > > +                       *fec_capa =
> > > + RTE_ETH_FEC_MODE_TO_CAPA(fec_mode_name[i].mode);
> > >                         return 0;
> > >                 }
> > >         }
> > > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index
> > > 6ca872db8..1d104213b 100644
> > > --- a/app/test-pmd/testpmd.h
> > > +++ b/app/test-pmd/testpmd.h
> > > @@ -886,7 +886,7 @@ void show_tx_pkt_segments(void);  void
> > > set_tx_pkt_times(unsigned int *tx_times);  void show_tx_pkt_times(void);
> > > void set_tx_pkt_split(const char *name); -int parse_fec_mode(const char
> > > *name, enum rte_eth_fec_mode *mode);
> > > +int parse_fec_mode(const char *name, uint32_t *fec_capa);
> > >  void show_fec_capability(uint32_t num, struct rte_eth_fec_capa
> > > *speed_fec_capa);  void set_nb_pkt_per_burst(uint16_t pkt_burst);  char
> > > *list_pkt_forwarding_modes(void);
> > > --
> > > 2.30.0.vfs.0.2
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 12efbc0ca..d804ee233 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -16984,17 +16984,17 @@  cmd_set_port_fec_mode_parsed(
 {
 	struct cmd_set_port_fec_mode *res = parsed_result;
 	uint16_t port_id = res->port_id;
-	uint32_t mode;
+	uint32_t fec_capa;
 	int ret;
 
-	ret = parse_fec_mode(res->fec_value, &mode);
+	ret = parse_fec_mode(res->fec_value, &fec_capa);
 	if (ret < 0) {
 		printf("Unknown fec mode: %s for Port %d\n", res->fec_value,
 			port_id);
 		return;
 	}
 
-	ret = rte_eth_fec_set(port_id, mode);
+	ret = rte_eth_fec_set(port_id, fec_capa);
 	if (ret == -ENOTSUP) {
 		printf("Function not implemented\n");
 		return;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 0e86ed02f..c626d5ce8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3549,13 +3549,13 @@  set_tx_pkt_split(const char *name)
 }
 
 int
-parse_fec_mode(const char *name, uint32_t *mode)
+parse_fec_mode(const char *name, uint32_t *fec_capa)
 {
 	uint8_t i;
 
 	for (i = 0; i < RTE_DIM(fec_mode_name); i++) {
 		if (strcmp(fec_mode_name[i].name, name) == 0) {
-			*mode = RTE_ETH_FEC_MODE_TO_CAPA(fec_mode_name[i].mode);
+			*fec_capa = RTE_ETH_FEC_MODE_TO_CAPA(fec_mode_name[i].mode);
 			return 0;
 		}
 	}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 6ca872db8..1d104213b 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -886,7 +886,7 @@  void show_tx_pkt_segments(void);
 void set_tx_pkt_times(unsigned int *tx_times);
 void show_tx_pkt_times(void);
 void set_tx_pkt_split(const char *name);
-int parse_fec_mode(const char *name, enum rte_eth_fec_mode *mode);
+int parse_fec_mode(const char *name, uint32_t *fec_capa);
 void show_fec_capability(uint32_t num, struct rte_eth_fec_capa *speed_fec_capa);
 void set_nb_pkt_per_burst(uint16_t pkt_burst);
 char *list_pkt_forwarding_modes(void);