From patchwork Sun Oct 25 17:54:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Octavian Purdila X-Patchwork-Id: 36865 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 6C9BCB7BDE for ; Mon, 26 Oct 2009 04:57:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753847AbZJYR5o (ORCPT ); Sun, 25 Oct 2009 13:57:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753788AbZJYR5o (ORCPT ); Sun, 25 Oct 2009 13:57:44 -0400 Received: from ixro-out-rtc.ixiacom.com ([92.87.192.98]:21687 "EHLO ixro-ex1.ixiacom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752843AbZJYR5n (ORCPT ); Sun, 25 Oct 2009 13:57:43 -0400 Received: from ixro-opurdila-lap.localnet ([10.205.9.179]) by ixro-ex1.ixiacom.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 25 Oct 2009 19:57:47 +0200 From: Octavian Purdila Organization: Ixia To: Eric Dumazet Subject: [RFC] make per interface sysctl entries configurable Date: Sun, 25 Oct 2009 19:54:49 +0200 User-Agent: KMail/1.12.2 (Linux/2.6.31-trunk-686; KDE/4.3.2; i686; ; ) MIME-Version: 1.0 Cc: Benjamin LaHaise , Stephen Hemminger , Cosmin Ratiu , netdev@vger.kernel.org Message-Id: <200910251954.49700.opurdila@ixiacom.com> X-OriginalArrivalTime: 25 Oct 2009 17:57:47.0218 (UTC) FILETIME=[A9016320:01CA559C] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org RFC patches are attached. Another possible approach: add an interface flag and use it to decide whether we want per interface sysctl entries or not. Benchmarks for creating 1000 interface (with the ndst module previously posted on the list, ppc750 @800Mhz machine): - without the patches: real 4m 38.27s user 0m 0.00s sys 2m 18.90s - with the patches: real 0m 0.10s user 0m 0.00s sys 0m 0.05s Thanks, tavi net: CONFIG_NET_SYSCTL_DEV: make per interface dev_snmp6 proc entries optional Use same CONFIG_NET_SYSCTL_DEV config option (we should probably rename it to a better name) to enable/disable per interface dev_snmp6 proc entries. --- //packages/linux_2.6.31/rc7/src/include/net/ipv6.h +++ //packages/linux_2.6.31/rc7/src/include/net/ipv6.h @@ -604,8 +604,14 @@ extern void udplite6_proc_exit(void); extern int ipv6_misc_proc_init(void); extern void ipv6_misc_proc_exit(void); + +#ifdef CONFIG_NET_SYSCTL_DEV extern int snmp6_register_dev(struct inet6_dev *idev); extern int snmp6_unregister_dev(struct inet6_dev *idev); +#else +static inline int snmp6_register_dev(struct inet6_dev *idev) { return 0; } +static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; } +#endif #else static inline int ac6_proc_init(struct net *net) { return 0; } --- //packages/linux_2.6.31/rc7/src/net/ipv6/proc.c +++ //packages/linux_2.6.31/rc7/src/net/ipv6/proc.c @@ -232,6 +232,7 @@ .release = single_release, }; +#ifdef CONFIG_NET_SYSCTL_DEV int snmp6_register_dev(struct inet6_dev *idev) { struct proc_dir_entry *p; @@ -266,6 +267,7 @@ idev->stats.proc_dir_entry = NULL; return 0; } +#endif static int ipv6_proc_init_net(struct net *net) {