[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1432814539.16878.10.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 28 May 2015 05:02:19 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
Cc: "David S . Miller" <davem@...emloft.net>,
Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] vlan: Add GRO support for non hardware
accelerated vlan
On Thu, 2015-05-28 at 20:17 +0900, Toshiaki Makita wrote:
> Currently packets with non-hardware-accelerated vlan cannot be handled
> by GRO. This causes low performance for 802.1ad and stacked vlan, as their
> vlan tags are currently not stripped by hardware.
>
> This patch adds GRO support for non-hardware-accelerated vlan and
> improves receive performance of them.
Very nice patch !
>
> Signed-off-by: Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
> ---
> net/8021q/vlan.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 94 insertions(+)
>
> diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
> index 59555f0..0a9e8e1 100644
> --- a/net/8021q/vlan.c
> +++ b/net/8021q/vlan.c
> @@ -618,6 +618,90 @@ out:
> return err;
> }
>
> + vhdr2 = (struct vlan_hdr *)(p->data + off_vlan);
> + if (memcmp(vhdr, vhdr2, VLAN_HLEN))
> + NAPI_GRO_CB(p)->same_flow = 0;
> + }
This memcmp() is quite expensive, you better use a helper like :
/* vlan header only guaranteed to be 16bit aligned */
static bool vlan_hdr_compare(const struct vlan_hdr *h1, const struct vlan_hdr *h2)
{
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
return *(u32 *)h1 != *(u32 *)h2;
#else
return (((__force u32)h1->h_vlan_TCI ^ (__force u32)h2->h_vlan_TCI) |
((__force u32)h1->h_vlan_encapsulated_proto ^
(__force u32)h2->h_vlan_encapsulated_proto)) != 0;
#endif
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists