Re: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-09 Thread Vitaly V. Bursov
07.06.2013 17:33, Daniel Borkmann пишет: On 06/07/2013 04:17 PM, Vitaly V. Bursov wrote: 07.06.2013 16:05, Daniel Borkmann пишет: [...] Ideas are welcome :) Probably, that depends on _your scenario_ and/or BPF filter, but would it be an alternative if you have only a few packet sockets (mayb

RE: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread Eric Dumazet
On Fri, 2013-06-07 at 15:09 +0100, David Laight wrote: > > > Looks like the ptype_base[] should be per 'dev'? > > > Or just put entries where ptype->dev != null_or_dev on a per-interface > > > list and do two searches? > > > > Yes, but then we would have two searches instead of one in fast path. >

Re: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread Daniel Borkmann
On 06/07/2013 04:17 PM, Vitaly V. Bursov wrote: 07.06.2013 16:05, Daniel Borkmann пишет: [...] Ideas are welcome :) Probably, that depends on _your scenario_ and/or BPF filter, but would it be an alternative if you have only a few packet sockets (maybe one pinned to each cpu) and cluster/load

Re: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread Vitaly V. Bursov
07.06.2013 16:05, Daniel Borkmann пишет: On 06/07/2013 02:41 PM, Mike Galbraith wrote: (CC's net-fu dojo) On Fri, 2013-06-07 at 14:56 +0300, Vitaly V. Bursov wrote: Hello, I have a Linux router with a lot of interfaces (hundreds or thousands of VLANs) and an application that creates AF_PACKET

RE: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread David Laight
> > Looks like the ptype_base[] should be per 'dev'? > > Or just put entries where ptype->dev != null_or_dev on a per-interface > > list and do two searches? > > Yes, but then we would have two searches instead of one in fast path. Usually it would be empty - so the search would be very quick!

RE: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread Eric Dumazet
On Fri, 2013-06-07 at 14:30 +0100, David Laight wrote: > Looks like the ptype_base[] should be per 'dev'? > Or just put entries where ptype->dev != null_or_dev on a per-interface > list and do two searches? Yes, but then we would have two searches instead of one in fast path. ptype_base[] is cur

RE: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread David Laight
> > I have a Linux router with a lot of interfaces (hundreds or > > thousands of VLANs) and an application that creates AF_PACKET > > socket per interface and bind()s sockets to interfaces. ... > > I noticed that box has strange performance problems with > > most of the CPU time spent in __netif_re

Re: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread Daniel Borkmann
On 06/07/2013 02:41 PM, Mike Galbraith wrote: (CC's net-fu dojo) On Fri, 2013-06-07 at 14:56 +0300, Vitaly V. Bursov wrote: Hello, I have a Linux router with a lot of interfaces (hundreds or thousands of VLANs) and an application that creates AF_PACKET socket per interface and bind()s sockets

Re: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread Mike Galbraith
(CC's net-fu dojo) On Fri, 2013-06-07 at 14:56 +0300, Vitaly V. Bursov wrote: > Hello, > > I have a Linux router with a lot of interfaces (hundreds or > thousands of VLANs) and an application that creates AF_PACKET > socket per interface and bind()s sockets to interfaces. > > Each socket has a

Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread Vitaly V. Bursov
Hello, I have a Linux router with a lot of interfaces (hundreds or thousands of VLANs) and an application that creates AF_PACKET socket per interface and bind()s sockets to interfaces. Each socket has attached BPF filter too. The problem is observed on linux-3.8.13, but as far I can see from th