From patchwork Fri Feb 22 17:30:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pravin B Shelar X-Patchwork-Id: 222662 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C9B6D2C0299 for ; Sat, 23 Feb 2013 08:49:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757379Ab3BVVtl (ORCPT ); Fri, 22 Feb 2013 16:49:41 -0500 Received: from na3sys009aog116.obsmtp.com ([74.125.149.240]:53290 "HELO na3sys009aog116.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756963Ab3BVVtk (ORCPT ); Fri, 22 Feb 2013 16:49:40 -0500 Received: from mail-vc0-f200.google.com ([209.85.220.200]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKUSfn8WGt7MN/uZhcXC+wMThTJ7cWfGRR@postini.com; Fri, 22 Feb 2013 13:49:40 PST Received: by mail-vc0-f200.google.com with SMTP id p1so1634091vcq.3 for ; Fri, 22 Feb 2013 13:49:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=er3q9YSSRFmzAmkMegJ3ScJ4aPQ6v3aBI4IygFlSjog=; b=L/O/fdgfBBYzEk0DXc22TeHFAjLqZAYpUOjginGUTC9F9jQPDkEdn3UxwmaTihGGqi 8O6SDAK2GMu8iZ47IZr4HOBc5ABCgo3+VuDNcq/KztchXcRgIPo/dJqCfSPMI2Kq8j0J RB4AbqZDn0/Iqn0NSRfDyytk0zJMqt4G/UNwBy0THgEyNrw7qPLZeb/A6MqW79rdNVQG RllggLVsgACq+MfJ8onDYg33I7mg/BIH8rhp2wa2IfHoj4lxjrIazgIc5sRVX22oZW3y y7VTE7UotjVbhyMBzJ3LqmqcMF/4WAMrZNbMnUM+2w1U33Se3xbx+BYxT1VYeWe9YBJM 2f4Q== X-Received: by 10.236.128.42 with SMTP id e30mr7022834yhi.7.1361569777600; Fri, 22 Feb 2013 13:49:37 -0800 (PST) X-Received: by 10.236.128.42 with SMTP id e30mr7022816yhi.7.1361569777440; Fri, 22 Feb 2013 13:49:37 -0800 (PST) Received: from localhost ([64.125.181.92]) by mx.google.com with ESMTPS id w2sm8731916yhh.7.2013.02.22.13.49.36 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 22 Feb 2013 13:49:37 -0800 (PST) From: Pravin B Shelar To: netdev@vger.kernel.org Cc: edumazet@google.com, jesse@nicira.com, stephen@networkplumber.org, Pravin B Shelar Subject: [PATCH net-next 2/2] VXLAN: Use tunnel_ip_select_ident() for tunnel IP-Identification. Date: Fri, 22 Feb 2013 09:30:40 -0800 Message-Id: <1361554240-1678-1-git-send-email-pshelar@nicira.com> X-Mailer: git-send-email 1.7.12.315.g682ce8b X-Gm-Message-State: ALoCoQnt0T1odQEA+NLXijas59Kiu0sOr/u4SEqJGIaRlRLSWBIjAJVfsptVJGQTzfCNCqLjSU67qV7fMwXfOOmTemWb+GD2HeJYlbvjYwn/f6iUXNtTgzJ70/m4RtezJWMJ3myRECR6pBB/3tKRer9GFeY+z3Okt3mqcehr7NDmonOqzzIF0yM= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org tunnel_ip_select_ident() is more efficient when generating ip-header id given inner packet is of ipv4 type. Signed-off-by: Pravin B Shelar --- drivers/net/vxlan.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 9d70421..f736823 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -962,13 +963,13 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) iph->daddr = dst; iph->saddr = fl4.saddr; iph->ttl = ttl ? : ip4_dst_hoplimit(&rt->dst); + tunnel_ip_select_ident(skb, old_iph, &rt->dst); vxlan_set_owner(dev, skb); /* See iptunnel_xmit() */ if (skb->ip_summed != CHECKSUM_PARTIAL) skb->ip_summed = CHECKSUM_NONE; - ip_select_ident(iph, &rt->dst, NULL); err = ip_local_out(skb); if (likely(net_xmit_eval(err) == 0)) {