Re: [PATCH v2 bpf-next] bpf: optimize hashmap lookups when key_size is divisible by 4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 01, 2023 at 03:10:46PM -0700, Alexei Starovoitov wrote:
> On Sat, Apr 1, 2023 at 1:05 PM Anton Protopopov <aspsk@xxxxxxxxxxxxx> wrote:
> >
> > [...]
> >
> >  static inline u32 htab_map_hash(const void *key, u32 key_len, u32 hashrnd)
> >  {
> > +       if (likely(key_len % 4 == 0))
> > +               return jhash2(key, key_len / 4, hashrnd);
> >         return jhash(key, key_len, hashrnd);
> >  }
> 
> This looks much cleaner than v1. Applied.

Thanks!

> Do you mind doing similar patch for bloomfilter?
> (removing aligned_u32_count variable)

Sure, done.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux