diff mbox series

app/testpmd: fix bitmap of link speeds when force speed

Message ID 1617877348-16394-1-git-send-email-humin29@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series app/testpmd: fix bitmap of link speeds when force speed | expand

Checks

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

Commit Message

humin (Q) April 8, 2021, 10:22 a.m. UTC
From: Huisong Li <lihuisong@huawei.com>

Currently, when the user sets force link speed through 'link_speeds',
bit(0) of 'link_speeds' is not set to 1(ETH_LINK_SPEED_FIXED),
which conflicts with the definition.

Fixes: 88fbedcd5e5a ("app/testpmd: move speed and duplex parsing in a function")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 app/test-pmd/cmdline.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ferruh Yigit April 13, 2021, 5:08 p.m. UTC | #1
On 4/8/2021 11:22 AM, Min Hu (Connor) wrote:
> From: Huisong Li <lihuisong@huawei.com>
> 
> Currently, when the user sets force link speed through 'link_speeds',
> bit(0) of 'link_speeds' is not set to 1(ETH_LINK_SPEED_FIXED),
> which conflicts with the definition.
> 
> Fixes: 88fbedcd5e5a ("app/testpmd: move speed and duplex parsing in a function")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>   app/test-pmd/cmdline.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index f44116b..8c36de2 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -1523,6 +1523,9 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)
>   			printf("Unknown speed parameter\n");
>   			return -1;
>   		}
> +
> +		if (*speed != ETH_LINK_SPEED_AUTONEG)
> +			*speed |= ETH_LINK_SPEED_FIXED;
>   	}
>   
>   	return 0;
> 

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

This has a history, same patch has been done in the past by Andrew [1], later 
reverted [2] (by me) since some PMDs failed and we were close to release.

In recent discussion [3] already agreed to get the patch again before -rc1, and 
this time there will be time to fix failing PMDs.
Thanks for making the patch.


[1] Commit bdca79053b6a ("app/testpmd: set fixed flag for exact link speed")

[2] Commit f53cc91f412a ("app/testpmd: revert fixed flag for exact link speed")

[3] http://inbox.dpdk.org/dev/43d67012-7f6f-2de8-e5ee-50cbe025d3eb@intel.com/#t
Ajit Khaparde April 13, 2021, 5:10 p.m. UTC | #2
On Tue, Apr 13, 2021 at 10:08 AM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 4/8/2021 11:22 AM, Min Hu (Connor) wrote:
> > From: Huisong Li <lihuisong@huawei.com>
> >
> > Currently, when the user sets force link speed through 'link_speeds',
> > bit(0) of 'link_speeds' is not set to 1(ETH_LINK_SPEED_FIXED),
> > which conflicts with the definition.
> >
> > Fixes: 88fbedcd5e5a ("app/testpmd: move speed and duplex parsing in a function")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Huisong Li <lihuisong@huawei.com>
> > Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> > ---
> >   app/test-pmd/cmdline.c | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> > index f44116b..8c36de2 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -1523,6 +1523,9 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)
> >                       printf("Unknown speed parameter\n");
> >                       return -1;
> >               }
> > +
> > +             if (*speed != ETH_LINK_SPEED_AUTONEG)
> > +                     *speed |= ETH_LINK_SPEED_FIXED;
> >       }
> >
> >       return 0;
> >
>
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

>
> This has a history, same patch has been done in the past by Andrew [1], later
> reverted [2] (by me) since some PMDs failed and we were close to release.
>
> In recent discussion [3] already agreed to get the patch again before -rc1, and
> this time there will be time to fix failing PMDs.
> Thanks for making the patch.
+1

>
>
> [1] Commit bdca79053b6a ("app/testpmd: set fixed flag for exact link speed")
>
> [2] Commit f53cc91f412a ("app/testpmd: revert fixed flag for exact link speed")
>
> [3] http://inbox.dpdk.org/dev/43d67012-7f6f-2de8-e5ee-50cbe025d3eb@intel.com/#t
diff mbox series

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f44116b..8c36de2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1523,6 +1523,9 @@  parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed)
 			printf("Unknown speed parameter\n");
 			return -1;
 		}
+
+		if (*speed != ETH_LINK_SPEED_AUTONEG)
+			*speed |= ETH_LINK_SPEED_FIXED;
 	}
 
 	return 0;