Subject: Re: [net-next 05/10] net: Add Geneve tunneling protocol driver

From: Stephen Hemminger <[email-masked]>
Date: Wed, 23 Jul 2014 11:20:12 -0700

On Tue, 22 Jul 2014 03:19:48 -0700
Andy Zhou <[email-masked]> wrote:

> +	geneveh->ver = GENEVE_VER;
> +	geneveh->opt_len = options_len / 4;
> +	geneveh->oam = !!(tun_flags & TUNNEL_OAM);
> +	geneveh->critical = !!(tun_flags & TUNNEL_CRIT_OPT);
> +	geneveh->rsvd1 = 0;

Bitfield's suck in C.

Setting bitfield values individually generates slow code because
the compiler has to generate multiple mask operations.

Better to change this part to one set of shifts and do one load.