Re: [PATCH v3 2/2] netfilter: Create revision 2 of xt_hashlimit to support higher pps rates

2016-09-27 Thread Vishwanath Pai
On Tue, Sep 27, 2016 at 12:15 AM, Liping Zhang wrote: > Hi Vishwanath, > > 2016-09-23 0:43 GMT+08:00 Vishwanath Pai : >> >> /* Precision saver. */ >> -static u32 user2credits(u32 user) >> +static u64 user2credits(u64 user, int revision) >> { >> - /*

Re: [PATCH v3 2/2] netfilter: Create revision 2 of xt_hashlimit to support higher pps rates

2016-09-26 Thread Liping Zhang
Hi Vishwanath, 2016-09-23 0:43 GMT+08:00 Vishwanath Pai : > > /* Precision saver. */ > -static u32 user2credits(u32 user) > +static u64 user2credits(u64 user, int revision) > { > - /* If multiplying would overflow... */ > - if (user > 0x /

Re: [PATCH v3 2/2] netfilter: Create revision 2 of xt_hashlimit to support higher pps rates

2016-09-25 Thread Pablo Neira Ayuso
On Sun, Sep 25, 2016 at 01:35:01PM +0200, Pablo Neira Ayuso wrote: > On Thu, Sep 22, 2016 at 02:39:45PM -0400, Vishwanath Pai wrote: > > Thanks for pointing this out, I will reorder the fields to: > > > > struct hashlimit_cfg2 { > > __u64 avg;/* Average secs between packets * scale */ > >

Re: [PATCH v3 2/2] netfilter: Create revision 2 of xt_hashlimit to support higher pps rates

2016-09-25 Thread Pablo Neira Ayuso
On Thu, Sep 22, 2016 at 02:39:45PM -0400, Vishwanath Pai wrote: > Thanks for pointing this out, I will reorder the fields to: > > struct hashlimit_cfg2 { > __u64 avg;/* Average secs between packets * scale */ > __u64 burst; > __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */

Re: [PATCH v3 2/2] netfilter: Create revision 2 of xt_hashlimit to support higher pps rates

2016-09-22 Thread Vishwanath Pai
Thanks for pointing this out, I will reorder the fields to: struct hashlimit_cfg2 { __u64 avg;/* Average secs between packets * scale */ __u64 burst; __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */ This should fix the hole and avoid padding. -Vishwanath On

Re: [PATCH v3 2/2] netfilter: Create revision 2 of xt_hashlimit to support higher pps rates

2016-09-22 Thread Jan Engelhardt
On Thursday 2016-09-22 18:43, Vishwanath Pai wrote: >+struct hashlimit_cfg2 { >+ __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */ >+ __u64 avg;/* Average secs between packets * scale */ >+ __u64 burst; /* Period multiplier for upper limit. */ This would have different