net/iavf: fix error devargs parsing

Message ID 20231113104436.86555-1-mingjinx.ye@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix error devargs parsing |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing warning Testing issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Mingjin Ye Nov. 13, 2023, 10:44 a.m. UTC
  This patch fixes an unknown parsing result without
devarg "no-poll-on-link-down".

Fixes: 5b3124a0a6ef ("net/iavf: support no polling when link down")
Cc: stable@dpdk.org

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
  

Comments

Qi Zhang Nov. 15, 2023, 8:24 a.m. UTC | #1
> -----Original Message-----
> From: Mingjin Ye <mingjinx.ye@intel.com>
> Sent: Monday, November 13, 2023 6:45 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Ye, MingjinX
> <mingjinx.ye@intel.com>; stable@dpdk.org; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH] net/iavf: fix error devargs parsing
> 
> This patch fixes an unknown parsing result without devarg "no-poll-on-link-
> down".
> 
> Fixes: 5b3124a0a6ef ("net/iavf: support no polling when link down")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
> ---
>  drivers/net/iavf/iavf_ethdev.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index 0c6ab4ac5a..d1edb0dd5c 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -2294,7 +2294,6 @@ static int iavf_parse_devargs(struct rte_eth_dev
> *dev)
>  	struct rte_kvargs *kvlist;
>  	int ret;
>  	int watchdog_period = -1;
> -	uint16_t no_poll_on_link_down;
> 
>  	if (!devargs)
>  		return 0;
> @@ -2329,13 +2328,9 @@ static int iavf_parse_devargs(struct rte_eth_dev
> *dev)
>  		ad->devargs.watchdog_period = watchdog_period;
> 
>  	ret = rte_kvargs_process(kvlist,
> IAVF_NO_POLL_ON_LINK_DOWN_ARG,
> -				 &parse_u16, &no_poll_on_link_down);
> +				 &parse_bool, &ad-
> >devargs.no_poll_on_link_down);

This will be a problem, the parse_bool accept an argument as size of int , but no_poll_on_link_down is a uint16_t
Please also fix the issue for auto_reset ....
  

Patch

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 0c6ab4ac5a..d1edb0dd5c 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2294,7 +2294,6 @@  static int iavf_parse_devargs(struct rte_eth_dev *dev)
 	struct rte_kvargs *kvlist;
 	int ret;
 	int watchdog_period = -1;
-	uint16_t no_poll_on_link_down;
 
 	if (!devargs)
 		return 0;
@@ -2329,13 +2328,9 @@  static int iavf_parse_devargs(struct rte_eth_dev *dev)
 		ad->devargs.watchdog_period = watchdog_period;
 
 	ret = rte_kvargs_process(kvlist, IAVF_NO_POLL_ON_LINK_DOWN_ARG,
-				 &parse_u16, &no_poll_on_link_down);
+				 &parse_bool, &ad->devargs.no_poll_on_link_down);
 	if (ret)
 		goto bail;
-	if (no_poll_on_link_down == 0)
-		ad->devargs.no_poll_on_link_down = 0;
-	else
-		ad->devargs.no_poll_on_link_down = 1;
 
 	if (ad->devargs.quanta_size != 0 &&
 	    (ad->devargs.quanta_size < 256 || ad->devargs.quanta_size > 4096 ||