[dpdk-dev] [PATCH v2 2/2] gro: support VxLAN GRO

Stephen Hemminger stephen at networkplumber.org
Thu Dec 14 03:58:01 CET 2017


On Thu, 14 Dec 2017 10:49:39 +0800
Jiayu Hu <jiayu.hu at intel.com> wrote:

> +
> +static inline int
> +is_same_vxlan_tcp4_flow(struct vxlan_tcp4_flow_key k1,
> +		struct vxlan_tcp4_flow_key k2)
> +{
> +	return (is_same_ether_addr(&k1.outer_eth_saddr, &k2.outer_eth_saddr) &&
> +			is_same_ether_addr(&k1.outer_eth_daddr,
> +				&k2.outer_eth_daddr) &&
> +			(k1.outer_ip_src_addr == k2.outer_ip_src_addr) &&
> +			(k1.outer_ip_dst_addr == k2.outer_ip_dst_addr) &&
> +			(k1.outer_src_port == k2.outer_src_port) &&
> +			(k1.outer_dst_port == k2.outer_dst_port) &&
> +			(k1.vxlan_hdr.vx_flags == k2.vxlan_hdr.vx_flags) &&
> +			(k1.vxlan_hdr.vx_vni == k2.vxlan_hdr.vx_vni) &&
> +			is_same_tcp4_flow(k1.inner_key, k2.inner_key));

Maybe this could be optimized with memcmp because many of the fields are contiguous.


More information about the dev mailing list