Skip to content

Commit

Permalink
compat: erspan: use bitfield instead of mask and offset
Browse files Browse the repository at this point in the history
Upstream commit:
    commit c69de58ba84f480879de64571d9dae5102d10ed6
    Author: William Tu <[email protected]>
    Date:   Thu Jan 25 13:20:09 2018 -0800

    net: erspan: use bitfield instead of mask and offset

    Originally the erspan fields are defined as a group into a __be16 field,
    and use mask and offset to access each field.  This is more costly due to
    calling ntohs/htons.  The patch changes it to use bitfields.

    Signed-off-by: William Tu <[email protected]>
    Acked-by: Pravin B Shelar <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Folds in the ip_gre portions of this commit.  Other portions of this
commit are included in a previous patch where it is called out.

Cc: William Tu <[email protected]>
Signed-off-by: Greg Rose <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: William Tu <[email protected]>
  • Loading branch information
williamtu authored and blp committed May 22, 2018
1 parent e4120b1 commit e6aa9dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datapath/linux/compat/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,10 +973,11 @@ static netdev_tx_t erspan_xmit(struct sk_buff *skb,

/* Push ERSPAN header */
if (tunnel->erspan_ver == 1)
erspan_build_header(skb, tunnel->parms.o_key, tunnel->index,
erspan_build_header(skb, ntohl(tunnel->parms.o_key),
tunnel->index,
truncate, true);
else
erspan_build_header_v2(skb, tunnel->parms.o_key,
erspan_build_header_v2(skb, ntohl(tunnel->parms.o_key),
tunnel->dir, tunnel->hwid,
truncate, true);

Expand Down

0 comments on commit e6aa9dd

Please sign in to comment.