[ovs-dev,3/3] compat: Clean up tunnel_id_to_key
diff mbox series

Message ID 1561754451-3305-4-git-send-email-gvrose8192@gmail.com
State Superseded
Headers show
Series
  • Cleanup gre related tunnel code
Related show

Commit Message

Gregory Rose June 28, 2019, 8:40 p.m. UTC
This function was just a duplicate of tunnel_id_to_key32 - I'm not sure
why it was ever needed but let's dump it now.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/linux/compat/ip_gre.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Comments

William Tu July 3, 2019, 4:45 p.m. UTC | #1
On Fri, Jun 28, 2019 at 1:40 PM Greg Rose <gvrose8192@gmail.com> wrote:
>
> This function was just a duplicate of tunnel_id_to_key32 - I'm not sure
> why it was ever needed but let's dump it now.
>
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> ---

LGTM
Acked-by: William Tu <u9012063@gmail.com>

<snip>
Gregory Rose July 3, 2019, 4:51 p.m. UTC | #2
On 7/3/2019 9:45 AM, William Tu wrote:
> On Fri, Jun 28, 2019 at 1:40 PM Greg Rose <gvrose8192@gmail.com> wrote:
>> This function was just a duplicate of tunnel_id_to_key32 - I'm not sure
>> why it was ever needed but let's dump it now.
>>
>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>> ---
> LGTM
> Acked-by: William Tu <u9012063@gmail.com>
>
> <snip>

Thanks for the acks William, I'll post V2 to remove that unwanted 
comment and add your tags.

- Greg

Patch
diff mbox series

diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index 6766661..2015d59 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -71,16 +71,6 @@  static void erspan_build_header(struct sk_buff *skb,
 
 static bool ip_gre_loaded = false;
 
-/* Returns the least-significant 32 bits of a __be64. */
-static __be32 tunnel_id_to_key(__be64 x)
-{
-#ifdef __BIG_ENDIAN
-	return (__force __be32)x;
-#else
-	return (__force __be32)((__force u64)x >> 32);
-#endif
-}
-
 /* Normally in net/core/dst.c but move it here */
 struct dst_ops md_dst_ops = {
 	.family =		AF_UNSPEC,
@@ -474,7 +464,7 @@  netdev_tx_t rpl_gre_fb_xmit(struct sk_buff *skb)
 
 	flags = tun_info->key.tun_flags & (TUNNEL_CSUM | TUNNEL_KEY);
 	build_header(skb, tunnel_hlen, flags, htons(ETH_P_TEB),
-		     tunnel_id_to_key(tun_info->key.tun_id), 0);
+		     tunnel_id_to_key32(tun_info->key.tun_id), 0);
 
 	df = key->tun_flags & TUNNEL_DONT_FRAGMENT ?  htons(IP_DF) : 0;
 	iptunnel_xmit(skb->sk, rt, skb, fl.saddr, key->u.ipv4.dst, IPPROTO_GRE,