All of lore.kernel.org
 help / color / mirror / Atom feed
* High packet rate udp receive
@ 2022-05-09 16:55 David Laight
  2022-05-09 17:00 ` Eric Dumazet
  2022-05-09 17:09 ` Dave Taht
  0 siblings, 2 replies; 3+ messages in thread
From: David Laight @ 2022-05-09 16:55 UTC (permalink / raw)
  To: netdev; +Cc: David S . Miller, Jakub Kicinski, 'Eric Dumazet'

I'm testing some high channel count RTP (UDP audio).
When I get much over 250000 receive packets/second the
network receive softint processing seems to overload
one cpu and then packets are silently discarded somewhere.

I (probably) can see all the packets in /sys/class/net/em2/statistics/rx_packets
but the counts from 'netstat -s' are a lot lower.

The packets are destined for a lot of UDP sockets - each gets 50/sec.
These can't be 'connected' because the source address is allowed to change.
For testing the source IP is pretty fixed.
But I've not tried to look for the actual bottleneck.

Are we stuck with one cpu doing all the ethernet, IP and UDP
receive processing?
(and the end of transmit reaping).
Or is there a way to get another cpu to do some of the work?

Since this is UDP things like gro can't help.
We do have to handle very large numbers of packets.

Would a multi-queue ethernet adapter help?
This system has a BCM5720 (tg3 driver) which I don't think is multi-Q.

OTOH I've also had issues with a similar packet rate on an intel
nic that would be multi-q because the interrupt mitigation logic
is completely broken for high packet rates.
Only increasing the ring size to 4096 stopped it dropping packets.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


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

* Re: High packet rate udp receive
  2022-05-09 16:55 High packet rate udp receive David Laight
@ 2022-05-09 17:00 ` Eric Dumazet
  2022-05-09 17:09 ` Dave Taht
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2022-05-09 17:00 UTC (permalink / raw)
  To: David Laight; +Cc: netdev, David S . Miller, Jakub Kicinski

On Mon, May 9, 2022 at 9:55 AM David Laight <David.Laight@aculab.com> wrote:
>
> I'm testing some high channel count RTP (UDP audio).
> When I get much over 250000 receive packets/second the
> network receive softint processing seems to overload
> one cpu and then packets are silently discarded somewhere.
>
> I (probably) can see all the packets in /sys/class/net/em2/statistics/rx_packets
> but the counts from 'netstat -s' are a lot lower.
>
> The packets are destined for a lot of UDP sockets - each gets 50/sec.
> These can't be 'connected' because the source address is allowed to change.
> For testing the source IP is pretty fixed.
> But I've not tried to look for the actual bottleneck.
>
> Are we stuck with one cpu doing all the ethernet, IP and UDP
> receive processing?

RPS can help, if your NIC has a single queue.

Please look at Documentation/networking/scaling.rst for details.

You might have to tune the number of cpus you want to be able to
process these packets.

> (and the end of transmit reaping).
> Or is there a way to get another cpu to do some of the work?
>
> Since this is UDP things like gro can't help.
> We do have to handle very large numbers of packets.
>
> Would a multi-queue ethernet adapter help?

Might be, at least by having a more efficient bus.

> This system has a BCM5720 (tg3 driver) which I don't think is multi-Q.
>
> OTOH I've also had issues with a similar packet rate on an intel
> nic that would be multi-q because the interrupt mitigation logic
> is completely broken for high packet rates.
> Only increasing the ring size to 4096 stopped it dropping packets.
>
>         David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>

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

* Re: High packet rate udp receive
  2022-05-09 16:55 High packet rate udp receive David Laight
  2022-05-09 17:00 ` Eric Dumazet
@ 2022-05-09 17:09 ` Dave Taht
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Taht @ 2022-05-09 17:09 UTC (permalink / raw)
  To: David Laight; +Cc: netdev, David S . Miller, Jakub Kicinski, Eric Dumazet

On Mon, May 9, 2022 at 10:01 AM David Laight <David.Laight@aculab.com> wrote:
>
> I'm testing some high channel count RTP (UDP audio).
> When I get much over 250000 receive packets/second the
> network receive softint processing seems to overload
> one cpu and then packets are silently discarded somewhere.
>
> I (probably) can see all the packets in /sys/class/net/em2/statistics/rx_packets
> but the counts from 'netstat -s' are a lot lower.
>
> The packets are destined for a lot of UDP sockets - each gets 50/sec.
> These can't be 'connected' because the source address is allowed to change.
> For testing the source IP is pretty fixed.
> But I've not tried to look for the actual bottleneck.
>
> Are we stuck with one cpu doing all the ethernet, IP and UDP
> receive processing?
> (and the end of transmit reaping).
> Or is there a way to get another cpu to do some of the work?
>
> Since this is UDP things like gro can't help.
> We do have to handle very large numbers of packets.
>
> Would a multi-queue ethernet adapter help?
> This system has a BCM5720 (tg3 driver) which I don't think is multi-Q.
>
> OTOH I've also had issues with a similar packet rate on an intel
> nic that would be multi-q because the interrupt mitigation logic
> is completely broken for high packet rates.
> Only increasing the ring size to 4096 stopped it dropping packets.
>
>         David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>

In general I favor larger rx rings these days as linux presently seems
to be very batchy on rx.
-- 
FQ World Domination pending: https://blog.cerowrt.org/post/state_of_fq_codel/
Dave Täht CEO, TekLibre, LLC

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

end of thread, other threads:[~2022-05-09 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 16:55 High packet rate udp receive David Laight
2022-05-09 17:00 ` Eric Dumazet
2022-05-09 17:09 ` Dave Taht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.