On 10/27/2017 12:49 AM, Ben Pfaff wrote: > valgrind reported use of uninitialized data in port_reconfigure(), which > was due to xrealloc() not initializing the newly added data, combined with > dp_netdev_rxq_set_intrvl_cycles() reading 'intrvl_idx' from the added data. > This avoids the warning. >
Thanks. Actually, with this change I can remove some of the other reset code also. Will send patch after PTO. Acked-by: Kevin Traynor <[email protected]> > Signed-off-by: Ben Pfaff <[email protected]> > --- > lib/dpif-netdev.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c > index d5eb8305c8a2..1418175bdfef 100644 > --- a/lib/dpif-netdev.c > +++ b/lib/dpif-netdev.c > @@ -3285,9 +3285,14 @@ port_reconfigure(struct dp_netdev_port *port) > port->txq_used = xcalloc(netdev_n_txq(netdev), sizeof *port->txq_used); > > for (i = 0; i < netdev_n_rxq(netdev); i++) { > + bool new_queue = i >= last_nrxq; > + if (new_queue) { > + memset(&port->rxqs[i], 0, sizeof port->rxqs[i]); > + } > + > port->rxqs[i].port = port; > - if (i >= last_nrxq) { > - /* Only reset cycle stats for new queues */ > + > + if (new_queue) { > dp_netdev_rxq_set_cycles(&port->rxqs[i], RXQ_CYCLES_PROC_CURR, > 0); > dp_netdev_rxq_set_cycles(&port->rxqs[i], RXQ_CYCLES_PROC_HIST, > 0); > for (unsigned j = 0; j < PMD_RXQ_INTERVAL_MAX; j++) { > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
