Re: [PATCH net-next V2 1/3] net: Add GRO support for UDP encapsulating protocols
From: Eric Dumazet <hidden>
Date: 2014-01-07 20:32:18
On Tue, 2014-01-07 at 22:19 +0200, Or Gerlitz wrote:
On Tue, Jan 7, 2014 at 6:33 PM, Eric Dumazet [off-list ref] wrote:quoted
On Tue, 2014-01-07 at 17:29 +0200, Or Gerlitz wrote:quoted
+ +#define MAX_UDP_PORT (1 << 16) +extern const struct net_offload __rcu *udp_offloads[MAX_UDP_PORT];Thats 512 KB of memory. This will greatly impact forwarding performance of UDP packets with random ports, and will increase kernel memory size for embedded devices.Re forwarding, are you referring to the case where the forwarded packets are encapsulated? packets which are not encapusalted will be flushed in the gro receive handler (this went out by mistake in V2 but exists in V1) if skb->encapsulation isn't set.
How do you know encapsulation must be tried for a given incoming packet ? NIC do not magically sets skb->encapsulation I think... You access udp_offloads[XXX], with XXX being in 0..65535 range, right ?
As for encapsulated packets, when you say random ports, are you referring to a router which has multiple udp encapsulating protocols where each uses different udp port? for this case and also to reduce the memory footprint, we can use lookup in a list as done for the L2 protocols gro handlers in the list_for_each loop of dev_gro_receive(), makes sense?
I am speaking of a normal router, running linux kernel, and having GRO/TSO enabled. If each incoming UDP packet has to access one extra cache line in a 512KB array, its likely to be an extra cache line miss, if UDP dest port is mostly random (compared to ports used by very recent UDP packets)