sched: fix for demo failure in debug mode

Message ID 20230105122853.144440-1-megha.ajmera@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series sched: fix for demo failure in debug mode |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Ajmera, Megha Jan. 5, 2023, 12:28 p.m. UTC
  This issue is happening due to non-initialization of some
fields in “rte_eth_rxconf” structure in our application.
Doing a memset to zero before initialization in HQoS application.

Signed-off-by: Megha Ajmera <megha.ajmera@intel.com>
---
 examples/qos_sched/init.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Cristian Dumitrescu Jan. 9, 2023, 1:27 p.m. UTC | #1
> -----Original Message-----
> From: Ajmera, Megha <megha.ajmera@intel.com>
> Sent: Thursday, January 5, 2023 12:29 PM
> To: dev@dpdk.org; Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu,
> Cristian <cristian.dumitrescu@intel.com>
> Cc: stable@dpdk.org
> Subject: [PATCH] sched: fix for demo failure in debug mode
> 
> This issue is happening due to non-initialization of some
> fields in “rte_eth_rxconf” structure in our application.
> Doing a memset to zero before initialization in HQoS application.
> 
> Signed-off-by: Megha Ajmera <megha.ajmera@intel.com>
> ---
>  examples/qos_sched/init.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
> index 0709aec10c..d28350e14a 100644
> --- a/examples/qos_sched/init.c
> +++ b/examples/qos_sched/init.c


Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
  
Thomas Monjalon Feb. 6, 2023, 7:39 a.m. UTC | #2
> > This issue is happening due to non-initialization of some
> > fields in “rte_eth_rxconf” structure in our application.
> > Doing a memset to zero before initialization in HQoS application.
> > 
> > Signed-off-by: Megha Ajmera <megha.ajmera@intel.com>
> > ---
> >  examples/qos_sched/init.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
> > index 0709aec10c..d28350e14a 100644
> > --- a/examples/qos_sched/init.c
> > +++ b/examples/qos_sched/init.c
> 
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Fixes: de3cfa2c9823 ("sched: initial import")
Cc: stable@dpdk.org

Applied, thanks.
  

Patch

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 0709aec10c..d28350e14a 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -79,6 +79,7 @@  app_init_port(uint16_t portid, struct rte_mempool *mp)
 	if (app_inited_port_mask & (1u << portid))
 		return 0;
 
+	memset(&rx_conf, 0, sizeof(struct rte_eth_rxconf));
 	rx_conf.rx_thresh.pthresh = rx_thresh.pthresh;
 	rx_conf.rx_thresh.hthresh = rx_thresh.hthresh;
 	rx_conf.rx_thresh.wthresh = rx_thresh.wthresh;
@@ -86,6 +87,7 @@  app_init_port(uint16_t portid, struct rte_mempool *mp)
 	rx_conf.rx_drop_en = 0;
 	rx_conf.rx_deferred_start = 0;
 
+	memset(&tx_conf, 0, sizeof(struct rte_eth_txconf));
 	tx_conf.tx_thresh.pthresh = tx_thresh.pthresh;
 	tx_conf.tx_thresh.hthresh = tx_thresh.hthresh;
 	tx_conf.tx_thresh.wthresh = tx_thresh.wthresh;