netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ipset hash:net,iface - can not add more than 64 interfaces
@ 2023-11-28  4:29 Марк Коренберг
  2023-11-28  7:48 ` Jozsef Kadlecsik
  0 siblings, 1 reply; 7+ messages in thread
From: Марк Коренберг @ 2023-11-28  4:29 UTC (permalink / raw)
  To: Jozsef Kadlecsik, netfilter, netfilter-devel, kadlecsik.jozsef,
	kadlec

for i in `seq 0 70`; do ip link del dummy$i; done;
for i in `seq 0 70`; do ip link add type dummy; done;
for i in `seq 0 70`; do ipset add qwe 0.0.0.0/0,dummy$i; done;

Reveals the problem. Only 64 records can be added, but there are no
obvious restrictions on that. I s it possible to increase the limit ?

-- 
Segmentation fault

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ipset hash:net,iface - can not add more than 64 interfaces
  2023-11-28  4:29 ipset hash:net,iface - can not add more than 64 interfaces Марк Коренберг
@ 2023-11-28  7:48 ` Jozsef Kadlecsik
  2023-11-28  9:17   ` Марк Коренберг
  2023-11-28  9:18   ` Марк Коренберг
  0 siblings, 2 replies; 7+ messages in thread
From: Jozsef Kadlecsik @ 2023-11-28  7:48 UTC (permalink / raw)
  To: Марк Коренберг
  Cc: netfilter, netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]

Hi,

On Tue, 28 Nov 2023, Марк Коренберг wrote:

> for i in `seq 0 70`; do ip link del dummy$i; done;
> for i in `seq 0 70`; do ip link add type dummy; done;
> for i in `seq 0 70`; do ipset add qwe 0.0.0.0/0,dummy$i; done;
> 
> Reveals the problem. Only 64 records can be added, but there are no
> obvious restrictions on that. I s it possible to increase the limit ?

It is intentional. Such elements can be stored in the same hash bucket 
only and 64 is the max size I'm willing to sacrifice for that. Please 
note, that's a huge number and means linear evaluation, i.e. loosing 
performance.

Best regards,
Jozsef
-- 
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ipset hash:net,iface - can not add more than 64 interfaces
  2023-11-28  7:48 ` Jozsef Kadlecsik
@ 2023-11-28  9:17   ` Марк Коренберг
  2023-11-28  9:29     ` Jozsef Kadlecsik
  2023-11-28  9:18   ` Марк Коренберг
  1 sibling, 1 reply; 7+ messages in thread
From: Марк Коренберг @ 2023-11-28  9:17 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter, netfilter-devel

Okay, got it.

Is there any options to store interface indices internally (instead of
names) ? i.e. if I renamed an interface, it would also “rename” in
ipset (actually just listing it would resolve indices to current
names). This feature would speed up matching ipset in network stack
because it does not require resolving index to name.

вт, 28 нояб. 2023 г. в 09:48, Jozsef Kadlecsik <kadlec@netfilter.org>:
>
> Hi,
>
> On Tue, 28 Nov 2023, Марк Коренберг wrote:
>
> > for i in `seq 0 70`; do ip link del dummy$i; done;
> > for i in `seq 0 70`; do ip link add type dummy; done;
> > for i in `seq 0 70`; do ipset add qwe 0.0.0.0/0,dummy$i; done;
> >
> > Reveals the problem. Only 64 records can be added, but there are no
> > obvious restrictions on that. I s it possible to increase the limit ?
>
> It is intentional. Such elements can be stored in the same hash bucket
> only and 64 is the max size I'm willing to sacrifice for that. Please
> note, that's a huge number and means linear evaluation, i.e. loosing
> performance.
>
> Best regards,
> Jozsef
> --
> E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
> PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
> Address : Wigner Research Centre for Physics
>           H-1525 Budapest 114, POB. 49, Hungary



-- 
Segmentation fault

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ipset hash:net,iface - can not add more than 64 interfaces
  2023-11-28  7:48 ` Jozsef Kadlecsik
  2023-11-28  9:17   ` Марк Коренберг
@ 2023-11-28  9:18   ` Марк Коренберг
  2023-11-28  9:34     ` Jozsef Kadlecsik
  1 sibling, 1 reply; 7+ messages in thread
From: Марк Коренберг @ 2023-11-28  9:18 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter, netfilter-devel

Actually, I need an ipset that matches against list of interfaces
(without networks associated). Are there any ways ?

вт, 28 нояб. 2023 г. в 09:48, Jozsef Kadlecsik <kadlec@netfilter.org>:
>
> Hi,
>
> On Tue, 28 Nov 2023, Марк Коренберг wrote:
>
> > for i in `seq 0 70`; do ip link del dummy$i; done;
> > for i in `seq 0 70`; do ip link add type dummy; done;
> > for i in `seq 0 70`; do ipset add qwe 0.0.0.0/0,dummy$i; done;
> >
> > Reveals the problem. Only 64 records can be added, but there are no
> > obvious restrictions on that. I s it possible to increase the limit ?
>
> It is intentional. Such elements can be stored in the same hash bucket
> only and 64 is the max size I'm willing to sacrifice for that. Please
> note, that's a huge number and means linear evaluation, i.e. loosing
> performance.
>
> Best regards,
> Jozsef
> --
> E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
> PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
> Address : Wigner Research Centre for Physics
>           H-1525 Budapest 114, POB. 49, Hungary



-- 
Segmentation fault

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ipset hash:net,iface - can not add more than 64 interfaces
  2023-11-28  9:17   ` Марк Коренберг
@ 2023-11-28  9:29     ` Jozsef Kadlecsik
  0 siblings, 0 replies; 7+ messages in thread
From: Jozsef Kadlecsik @ 2023-11-28  9:29 UTC (permalink / raw)
  To: Марк Коренберг
  Cc: netfilter, netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]

On Tue, 28 Nov 2023, Марк Коренберг wrote:

> Is there any options to store interface indices internally (instead of 
> names) ? i.e. if I renamed an interface, it would also “rename” in ipset 
> (actually just listing it would resolve indices to current names). This 
> feature would speed up matching ipset in network stack because it does 
> not require resolving index to name.

No, ipset does not support storing interface indices instead of names.

Best regards,
Jozsef
 
> вт, 28 нояб. 2023 г. в 09:48, Jozsef Kadlecsik <kadlec@netfilter.org>:
> >
> > Hi,
> >
> > On Tue, 28 Nov 2023, Марк Коренберг wrote:
> >
> > > for i in `seq 0 70`; do ip link del dummy$i; done;
> > > for i in `seq 0 70`; do ip link add type dummy; done;
> > > for i in `seq 0 70`; do ipset add qwe 0.0.0.0/0,dummy$i; done;
> > >
> > > Reveals the problem. Only 64 records can be added, but there are no
> > > obvious restrictions on that. I s it possible to increase the limit ?
> >
> > It is intentional. Such elements can be stored in the same hash bucket
> > only and 64 is the max size I'm willing to sacrifice for that. Please
> > note, that's a huge number and means linear evaluation, i.e. loosing
> > performance.
> >
> > Best regards,
> > Jozsef
> > --
> > E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
> > PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
> > Address : Wigner Research Centre for Physics
> >           H-1525 Budapest 114, POB. 49, Hungary
> 
> 
> 
> -- 
> Segmentation fault
> 

-- 
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ipset hash:net,iface - can not add more than 64 interfaces
  2023-11-28  9:18   ` Марк Коренберг
@ 2023-11-28  9:34     ` Jozsef Kadlecsik
       [not found]       ` <CAN_K0LQJfH9D9TBMWBxnbUbgWrG5C9YYENU4tkP=WfxRGyAUMA@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Jozsef Kadlecsik @ 2023-11-28  9:34 UTC (permalink / raw)
  To: Марк Коренберг
  Cc: netfilter, netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 1781 bytes --]

On Tue, 28 Nov 2023, Марк Коренберг wrote:

> Actually, I need an ipset that matches against list of interfaces
> (without networks associated). Are there any ways ?

No, that's not possible in ipset either.

However, I'd suggest you to explore nftables where there are no such 
internal limitation than in ipset, supports matching interface indices or 
names and can store just interface names/indices in an nftables set too.

Best regards,
Jozsef 
> вт, 28 нояб. 2023 г. в 09:48, Jozsef Kadlecsik <kadlec@netfilter.org>:
> >
> > Hi,
> >
> > On Tue, 28 Nov 2023, Марк Коренберг wrote:
> >
> > > for i in `seq 0 70`; do ip link del dummy$i; done;
> > > for i in `seq 0 70`; do ip link add type dummy; done;
> > > for i in `seq 0 70`; do ipset add qwe 0.0.0.0/0,dummy$i; done;
> > >
> > > Reveals the problem. Only 64 records can be added, but there are no
> > > obvious restrictions on that. I s it possible to increase the limit ?
> >
> > It is intentional. Such elements can be stored in the same hash bucket
> > only and 64 is the max size I'm willing to sacrifice for that. Please
> > note, that's a huge number and means linear evaluation, i.e. loosing
> > performance.
> >
> > Best regards,
> > Jozsef
> > --
> > E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
> > PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
> > Address : Wigner Research Centre for Physics
> >           H-1525 Budapest 114, POB. 49, Hungary
> 
> 
> 
> -- 
> Segmentation fault
> 

-- 
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ipset hash:net,iface - can not add more than 64 interfaces
       [not found]       ` <CAN_K0LQJfH9D9TBMWBxnbUbgWrG5C9YYENU4tkP=WfxRGyAUMA@mail.gmail.com>
@ 2023-11-28 11:09         ` Марк Коренберг
  0 siblings, 0 replies; 7+ messages in thread
From: Марк Коренберг @ 2023-11-28 11:09 UTC (permalink / raw)
  To: Fatih USTA
  Cc: Jozsef Kadlecsik, Netfilter Users Mailing list, netfilter-devel

Thank you for the suggestion. Will benchmark in my conditions.

вт, 28 нояб. 2023 г. в 12:06, Fatih USTA <fatihusta86@gmail.com>:
>
> You can use type of list. Separate 64 elements per set. After that append into list.
>
> ipset create dummy_ifaces list:set
>
> ipset create dummy0_0 hash:net,iface
> ipset create dummy0_1 hash:net,iface
> ipset create dummy0_2 hash:net,iface
>
> ipset add dummy_ifaces dummy0_0
> ipset add dummy_ifaces dummy0_1
> ipset add dummy_ifaces dummy0_2
>
>
> On Tue, Nov 28, 2023, 12:34 Jozsef Kadlecsik <kadlec@netfilter.org> wrote:
>>
>> On Tue, 28 Nov 2023, Марк Коренберг wrote:
>>
>> > Actually, I need an ipset that matches against list of interfaces
>> > (without networks associated). Are there any ways ?
>>
>> No, that's not possible in ipset either.
>>
>> However, I'd suggest you to explore nftables where there are no such
>> internal limitation than in ipset, supports matching interface indices or
>> names and can store just interface names/indices in an nftables set too.
>>
>> Best regards,
>> Jozsef
>> > вт, 28 нояб. 2023 г. в 09:48, Jozsef Kadlecsik <kadlec@netfilter.org>:
>> > >
>> > > Hi,
>> > >
>> > > On Tue, 28 Nov 2023, Марк Коренберг wrote:
>> > >
>> > > > for i in `seq 0 70`; do ip link del dummy$i; done;
>> > > > for i in `seq 0 70`; do ip link add type dummy; done;
>> > > > for i in `seq 0 70`; do ipset add qwe 0.0.0.0/0,dummy$i; done;
>> > > >
>> > > > Reveals the problem. Only 64 records can be added, but there are no
>> > > > obvious restrictions on that. I s it possible to increase the limit ?
>> > >
>> > > It is intentional. Such elements can be stored in the same hash bucket
>> > > only and 64 is the max size I'm willing to sacrifice for that. Please
>> > > note, that's a huge number and means linear evaluation, i.e. loosing
>> > > performance.
>> > >
>> > > Best regards,
>> > > Jozsef
>> > > --
>> > > E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
>> > > PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
>> > > Address : Wigner Research Centre for Physics
>> > >           H-1525 Budapest 114, POB. 49, Hungary
>> >
>> >
>> >
>> > --
>> > Segmentation fault
>> >
>>
>> --
>> E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
>> PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
>> Address : Wigner Research Centre for Physics
>>           H-1525 Budapest 114, POB. 49, Hungary



-- 
Segmentation fault

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-11-28 11:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28  4:29 ipset hash:net,iface - can not add more than 64 interfaces Марк Коренберг
2023-11-28  7:48 ` Jozsef Kadlecsik
2023-11-28  9:17   ` Марк Коренберг
2023-11-28  9:29     ` Jozsef Kadlecsik
2023-11-28  9:18   ` Марк Коренберг
2023-11-28  9:34     ` Jozsef Kadlecsik
     [not found]       ` <CAN_K0LQJfH9D9TBMWBxnbUbgWrG5C9YYENU4tkP=WfxRGyAUMA@mail.gmail.com>
2023-11-28 11:09         ` Марк Коренберг

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).