[ovs-dev] [PATCH] datapath: Fix tunnel source port selection for mega flow

Rajahalme, Jarno (NSN - FI/Espoo) jarno.rajahalme at nsn.com
Wed Jul 3 11:34:04 UTC 2013


On Jul 3, 2013, at 1:58 , ext Andy Zhou wrote:
> diff --git a/datapath/tunnel.c b/datapath/tunnel.c
> index 9102786..18c3622 100644
> --- a/datapath/tunnel.c
> +++ b/datapath/tunnel.c
> @@ -186,7 +186,9 @@ u16 ovs_tnl_get_src_port(struct sk_buff *skb)
> 	int low;
> 	int high;
> 	unsigned int range;
> -	u32 hash = OVS_CB(skb)->flow->hash;
> +	struct sw_flow_key *pkt_key = OVS_CB(skb)->pkt_key;
> +	u32 hash = jhash2((const u32 *)pkt_key,
> +			0, sizeof(*pkt_key) / sizeof(u32));
> 

Wouldn't skb_get_rxhash() be a lot cheaper and enough for this purpose?

  Jarno



More information about the dev mailing list