On 4/22/2019 3:18 AM, Qiming Yang wrote: > stats_reset has been missed when support stats in iavf driver. > This patch add statistics reset function. > > Fixes: f4a41a6953af ("net/avf: support stats") > Cc: sta...@dpdk.org > > Signed-off-by: Qiming Yang <qiming.y...@intel.com>
<...> > @@ -977,16 +979,71 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, > return 0; > } > > +static void > +iavf_stat_update_48(uint64_t *offset, > + uint64_t *stat) > +{ > + if (*stat >= *offset) > + *stat = *stat - *offset; > + else > + *stat = (uint64_t)((*stat + > + ((uint64_t)1 << IAVF_48_BIT_WIDTH)) - *offset); > + > + *stat &= IAVF_48_BIT_MASK; > +} > + > +static void > +iavf_stat_update_32(uint64_t *offset, > + uint64_t *stat) > +{ > + if (*stat >= *offset) > + *stat = (uint64_t)(*stat - *offset); > + else > + *stat = (uint64_t)((*stat + > + ((uint64_t)1 << IAVF_32_BIT_WIDTH)) - *offset); > +} > + > +static void > +iavf_update_stats(struct iavf_vsi *vsi, > + struct virtchnl_eth_stats *nes) This syntax looks odd, will fix while merging, similar to above functions, no need to break parameter lines into multiple line, will update them too.