> -----Original Message-----
> From: Stillwell Jr, Paul M
> Sent: Wednesday, June 12, 2019 12:28 AM
> To: Rong, Leyi <leyi.r...@intel.com>; Zhang, Qi Z <qi.z.zh...@intel.com>
> Cc: dev@dpdk.org; Keller, Jacob E <jacob.e.kel...@intel.com>
> Subject: RE: [PATCH v2 24/66] net/ice/base: add support for reading REPC 
> statistics
> 
> > -----Original Message-----
> > From: Rong, Leyi
> > Sent: Tuesday, June 11, 2019 8:52 AM
> > To: Zhang, Qi Z <qi.z.zh...@intel.com>
> > Cc: dev@dpdk.org; Rong, Leyi <leyi.r...@intel.com>; Keller, Jacob E
> > <jacob.e.kel...@intel.com>; Stillwell Jr, Paul M
> > <paul.m.stillwell...@intel.com>
> > Subject: [PATCH v2 24/66] net/ice/base: add support for reading REPC
> > statistics
> >
> > Add a new ice_stat_update_repc function which will read the register
> > and increment the appropriate statistics in the ice_eth_stats structure.
> >
> > Signed-off-by: Jacob Keller <jacob.e.kel...@intel.com>
> > Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell...@intel.com>
> > Signed-off-by: Leyi Rong <leyi.r...@intel.com>
> > ---
> >  drivers/net/ice/base/ice_common.c | 51
> > +++++++++++++++++++++++++++++++
> > drivers/net/ice/base/ice_common.h |  3 ++
> >  drivers/net/ice/base/ice_type.h   |  2 ++
> >  3 files changed, 56 insertions(+)
> >
> > diff --git a/drivers/net/ice/base/ice_common.c
> > b/drivers/net/ice/base/ice_common.c
> > index da72434d3..b4a9172b9 100644
> > --- a/drivers/net/ice/base/ice_common.c
> > +++ b/drivers/net/ice/base/ice_common.c
> > @@ -4138,6 +4138,57 @@ ice_stat_update32(struct ice_hw *hw, u32 reg,
> > bool prev_stat_loaded,
> >             *cur_stat = (new_data + BIT_ULL(32)) - *prev_stat;  }
> >
> > +/**
> > + * ice_stat_update_repc - read GLV_REPC stats from chip and update
> > +stat values
> > + * @hw: ptr to the hardware info
> > + * @vsi_handle: VSI handle
> > + * @prev_stat_loaded: bool to specify if the previous stat values are
> > +loaded
> > + * @cur_stats: ptr to current stats structure
> > + *
> > + * The GLV_REPC statistic register actually tracks two 16bit
> > +statistics, and
> > + * thus cannot be read using the normal ice_stat_update32 function.
> > + *
> > + * Read the GLV_REPC register associated with the given VSI, and
> > +update the
> > + * rx_no_desc and rx_error values in the ice_eth_stats structure.
> > + *
> > + * Because the statistics in GLV_REPC stick at 0xFFFF, the register
> > +must be
> > + * cleared each time it's read.
> > + *
> > + * Note that the GLV_RDPC register also counts the causes that would
> > +trigger
> > + * GLV_REPC. However, it does not give the finer grained detail about
> > +why the
> > + * packets are being dropped. The GLV_REPC values can be used to
> > +distinguish
> > + * whether Rx packets are dropped due to errors or due to no
> > +available
> > + * descriptors.
> > + */
> > +void
> > +ice_stat_update_repc(struct ice_hw *hw, u16 vsi_handle, bool
> > prev_stat_loaded,
> > +                struct ice_eth_stats *cur_stats) {
> > +   u16 vsi_num, no_desc, error_cnt;
> > +   u32 repc;
> > +
> > +   if (!ice_is_vsi_valid(hw, vsi_handle))
> > +           return;
> > +
> > +   vsi_num = ice_get_hw_vsi_num(hw, vsi_handle);
> > +
> > +   /* If we haven't loaded stats yet, just clear the current value */
> > +   if (!prev_stat_loaded) {
> > +           wr32(hw, GLV_REPC(vsi_num), 0);
> > +           return;
> > +   }
> > +
> > +   repc = rd32(hw, GLV_REPC(vsi_num));
> > +   no_desc = (repc & GLV_REPC_NO_DESC_CNT_M) >>
> > GLV_REPC_NO_DESC_CNT_S;
> > +   error_cnt = (repc & GLV_REPC_ERROR_CNT_M) >>
> > GLV_REPC_ERROR_CNT_S;
> > +
> > +   /* Clear the count by writing to the stats register */
> > +   wr32(hw, GLV_REPC(vsi_num), 0);
> > +
> > +   cur_stats->rx_no_desc += no_desc;
> > +   cur_stats->rx_errors += error_cnt;
> > +}
> > +
> >
> 
> Is there code in DPDK to call these functions? If not then drop this patch.
> 

This function will not be called.

Reply via email to