From patchwork Thu Aug 2 10:28:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 174716 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 5A7AD2C0096 for ; Thu, 2 Aug 2012 20:28:47 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754213Ab2HBK2j (ORCPT ); Thu, 2 Aug 2012 06:28:39 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:42256 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754086Ab2HBK2f (ORCPT ); Thu, 2 Aug 2012 06:28:35 -0400 Received: by bkwj10 with SMTP id j10so4172860bkw.19 for ; Thu, 02 Aug 2012 03:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=NL/a812NMwOk0KT8WqmxBuMTjBVCsWCpTXzX3h+phEA=; b=hobx4rmmC9sciOMoPdLqDVixZjj7lffr05DrXdAmEE/nfjAe8xUZmr3zmEOv997rCM RsthSBIsY2/zje9xD6h4jaKUjPQxOCwpKZp8Xfngje4VAwoqG4/xKFZALigE57JeiM9f tXwgbTaASf/xUr0+IiLBFRVQfgImUTKpbwsu7b3AnweMyq2CtpmsADZoT+nkCMncihka IDGt93VMovdyB/u9nJOExAxAr/7IZIYIS0OxLKlM/tu0xroLmq5sGWdf30jwudZodkfz cCavwo7G544zEKdoh17UldN9PWCLPl2h5yXg46Ea+k/K3/hB1k7jgz1lPqBMfNpCHC2M 2SWg== Received: by 10.204.129.27 with SMTP id m27mr7907625bks.115.1343903314494; Thu, 02 Aug 2012 03:28:34 -0700 (PDT) Received: from [172.28.91.175] ([74.125.122.49]) by mx.google.com with ESMTPS id g6sm3098371bkg.2.2012.08.02.03.28.32 (version=SSLv3 cipher=OTHER); Thu, 02 Aug 2012 03:28:33 -0700 (PDT) Subject: Re: [PATCH 1/2] net: Allow to create links with given ifindex From: Eric Dumazet To: "Eric W. Biederman" Cc: Pavel Emelyanov , Linux Netdev List , David Miller In-Reply-To: <878ve0dtw3.fsf@xmission.com> References: <50160EEF.6050406@parallels.com> <87pq7dh6b2.fsf@xmission.com> <87fw89h5zk.fsf@xmission.com> <50179F66.1000604@parallels.com> <878ve0dtw3.fsf@xmission.com> Date: Thu, 02 Aug 2012 12:28:30 +0200 Message-ID: <1343903310.9299.184.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 2012-07-31 at 04:58 -0700, Eric W. Biederman wrote: > Making lo the particularly interesting case. BTW, I noticed in my benchmarks, that once I remove the contention on dst refcnt (using a percpu cache of dsts), I have a strange performance cost accessing net->loopback_dev->ifindex in ip_route_output_key. Strange because I see no false sharing on this ifindex location for loopback device. So we probably can save some cycles adding a net->loopback_ifindex to remove one dereference. If ifindex are per network space, I guess we'll need to change arp_hashfn() or else we'll use some slots more than others. --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/net/arp.h b/include/net/arp.h index 7f7df93..37aac58 100644 --- a/include/net/arp.h +++ b/include/net/arp.h @@ -10,7 +10,7 @@ extern struct neigh_table arp_tbl; static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd) { - u32 val = key ^ dev->ifindex; + u32 val = key ^ (u32)(unsigned long)dev; return val * hash_rnd; }