From: Eric Dumazet
Date: Tue, 6 Nov 2018 14:51:15 -0800
> On Tue, Nov 6, 2018 at 2:41 PM David Miller wrote:
>>
>> From: Eric Dumazet
>> Date: Tue, 6 Nov 2018 14:25:52 -0800
>>
>> > + if (unlikely(nlen > sizeof(struct ipv6hdr))) {
>> > + if (memcmp(iph + 1, iph2
On Tue, Nov 6, 2018 at 2:41 PM David Miller wrote:
>
> From: Eric Dumazet
> Date: Tue, 6 Nov 2018 14:25:52 -0800
>
> > + if (unlikely(nlen > sizeof(struct ipv6hdr))) {
> > + if (memcmp(iph + 1, iph2 + 1,
> > +nlen - sizeof(struct ip
From: Eric Dumazet
Date: Tue, 6 Nov 2018 14:25:52 -0800
> + if (unlikely(nlen > sizeof(struct ipv6hdr))) {
> + if (memcmp(iph + 1, iph2 + 1,
> +nlen - sizeof(struct ipv6hdr)))
> + goto not_same_flow;
> +
ipv6_gro_receive() compares 34 bytes using slow memcmp(),
while handcoding with a couple of ipv6_addr_equal() is much faster.
Before this patch, "perf top -e cycles:pp -C " would
see memcmp() using ~10% of cpu cycles on a 40Gbit NIC
receiving IPv6 TCP traffic.
Signed-off-by: Eric Dumazet
---
ne