From patchwork Tue Nov 30 15:57:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Octavian Purdila X-Patchwork-Id: 73622 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 E456F1007D5 for ; Wed, 1 Dec 2010 03:12:53 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754357Ab0K3QMp (ORCPT ); Tue, 30 Nov 2010 11:12:45 -0500 Received: from ixro-out-rtc.ixiacom.com ([92.87.192.98]:21121 "EHLO ixro-ex1.ixiacom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754221Ab0K3QMp (ORCPT ); Tue, 30 Nov 2010 11:12:45 -0500 X-Greylist: delayed 912 seconds by postgrey-1.27 at vger.kernel.org; Tue, 30 Nov 2010 11:12:44 EST Received: from ixro-opurdila.ixiacom.com ([10.205.21.27]) by ixro-ex1.ixiacom.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 30 Nov 2010 17:57:30 +0200 From: Octavian Purdila To: netdev@vger.kernel.org Cc: Vlad Dogaru , Lucian Grijincu , Octavian Purdila Subject: [PATCH net-next-2.6] net: dummy: add auto_up module parameter Date: Tue, 30 Nov 2010 17:57:27 +0200 Message-Id: <1291132647-15018-1-git-send-email-opurdila@ixiacom.com> X-Mailer: git-send-email 1.7.1 X-OriginalArrivalTime: 30 Nov 2010 15:57:30.0361 (UTC) FILETIME=[4B122690:01CB90A7] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add auto_up module parameter to automatically bring up the created devices. This is useful when using the dummy driver for testing net device register / unregister performance. Signed-off-by: Octavian Purdila --- drivers/net/dummy.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index ff2d29b..ce653b0 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c @@ -39,6 +39,7 @@ #include static int numdummies = 1; +static int auto_up; static int dummy_set_address(struct net_device *dev, void *p) { @@ -132,6 +133,8 @@ static void dummy_setup(struct net_device *dev) /* Fill in device structure with ethernet-generic values. */ dev->tx_queue_len = 0; dev->flags |= IFF_NOARP; + if (auto_up) + dev->flags |= IFF_UP; dev->flags &= ~IFF_MULTICAST; dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO; dev->features |= NETIF_F_NO_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX; @@ -159,6 +162,9 @@ static struct rtnl_link_ops dummy_link_ops __read_mostly = { module_param(numdummies, int, 0); MODULE_PARM_DESC(numdummies, "Number of dummy pseudo devices"); +module_param(auto_up, int, 0); +MODULE_PARM_DESC(auto_up, "Automatically bring up the device when created"); + static int __init dummy_init_one(void) { struct net_device *dev_dummy;