Best Regards,
Sun, Chenmin

> -----Original Message-----
> From: Wang, Haiyue <[email protected]>
> Sent: Wednesday, July 8, 2020 4:41 PM
> To: Sun, Chenmin <[email protected]>; Zhang, Qi Z
> <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing
> <[email protected]>
> Cc: [email protected]; Sun, Chenmin <[email protected]>
> Subject: RE: [dpdk-dev] [PATCH] net/i40e: i40e FDIR update rate optimization
> 
> > -----Original Message-----
> > From: dev <[email protected]> On Behalf Of [email protected]
> > Sent: Saturday, June 13, 2020 02:00
> > To: Zhang, Qi Z <[email protected]>; Xing, Beilei
> > <[email protected]>; Wu, Jingjing <[email protected]>
> > Cc: [email protected]; Sun, Chenmin <[email protected]>
> > Subject: [dpdk-dev] [PATCH] net/i40e: i40e FDIR update rate
> > optimization
> >
> > From: Chenmin Sun <[email protected]>
> >
> > This patch optimized the fdir update rate for i40e PF, by tracking the
> > fdir rule will be inserted into guaranteed space or shared space.
> > For the flows that are inserted to the guaranteed space, it returns
> > success directly without retrieving the result for NIC.
> >
> > This patch changes the global register GLQF_CTL. Therefore, when
> > devarg ``Support multiple driver`` is set, the patch will not take
> > effect to avoid affecting the normal behavior of other i40e drivers,
> > e.g., Linux kernel driver.
> >
> > Signed-off-by: Chenmin Sun <[email protected]>
> > ---
> >  drivers/net/i40e/i40e_ethdev.c  |  96 ++++++++++++++++-
> > drivers/net/i40e/i40e_ethdev.h  |  57 +++++++---
> >  drivers/net/i40e/i40e_fdir.c    | 182 +++++++++++++++++++++-----------
> >  drivers/net/i40e/i40e_flow.c    | 181 +++++++++++++++++++++++++------
> >  drivers/net/i40e/i40e_rxtx.c    |  15 ++-
> >  drivers/net/i40e/rte_pmd_i40e.c |   2 +-
> >  6 files changed, 417 insertions(+), 116 deletions(-)
> >
> 
> 
> >
> > +static
> > +uint32_t bin_search(uint64_t data)
> > +{
> > +   uint32_t pos = 0;
> > +
> > +   if ((data & 0xFFFFFFFF) == 0) {
> > +           data >>= 32;
> > +           pos += 32;
> > +   }
> > +
> > +   if ((data & 0xFFFF) == 0) {
> > +           data >>= 16;
> > +           pos += 16;
> > +   }
> > +   if ((data & 0xFF) == 0) {
> > +           data >>= 8;
> > +           pos += 8;
> > +   }
> > +   if ((data & 0xF) == 0) {
> > +           data >>= 4;
> > +           pos += 4;
> > +   }
> > +   if ((data & 0x3) == 0) {
> > +           data >>= 2;
> > +           pos += 2;
> > +   }
> > +   if ((data & 0x1) == 0)
> > +           pos += 1;
> > +
> > +   return pos;
> > +}
> > +
> 
> Try " __builtin_ctzll ", DPDK has many examples to use it. ;-)
> 

Thanks, I have replaced it with rte_bsf64()

> > --
> > 2.17.1

Reply via email to