Re: [PATCH net-next] ipv6: gro: do not use slow memcmp() in ipv6_gro_receive()

2018-11-06 Thread David Miller
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

Re: [PATCH net-next] ipv6: gro: do not use slow memcmp() in ipv6_gro_receive()

2018-11-06 Thread Eric Dumazet
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

Re: [PATCH net-next] ipv6: gro: do not use slow memcmp() in ipv6_gro_receive()

2018-11-06 Thread David Miller
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; > +

[PATCH net-next] ipv6: gro: do not use slow memcmp() in ipv6_gro_receive()

2018-11-06 Thread Eric Dumazet
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