From owner-freebsd-net@FreeBSD.ORG Tue May 14 18:43:06 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B304F9DD for ; Tue, 14 May 2013 18:43:06 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1B21B1 for ; Tue, 14 May 2013 18:43:06 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id ey16so818642wid.17 for ; Tue, 14 May 2013 11:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Ys/YhZDSQ5X5bWSvGc6KKCXWRro9SsBC3rt0OMxnuno=; b=u3He9ybwtDgAV3O2cJVKJw4v3ehIUgJ5LFDbuDH3l2zdumAUUjJPlHAwwFyvE+/VQX WOEyXrBxxSCf0SuiTkbnoOHPQgcOqb38zoPODRWN/JikgPVbxHOycwa4sYX1gfHY4E4O WK/E8xRlDd+p5c0I4T80u/WVkMEi5ETP71P6G/phNKMvePyCJd0uPEtXGrveIQ60dHDi 9MIoh+gq/jZOL+Ipqz3WOjOOshMMPooEBDA/nPt0HDK5Z1FrybMnH8mxlKOQsEitE0/W +KpToEjOKvvSGaq3TdfP/+766PUpvExbB04l2qiF6xlG+eFu4J0G6ZAbvXm9bGxd6Ede Cxig== X-Received: by 10.180.36.229 with SMTP id t5mr9211200wij.21.1368556985434; Tue, 14 May 2013 11:43:05 -0700 (PDT) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.194.234.72 with HTTP; Tue, 14 May 2013 11:42:45 -0700 (PDT) In-Reply-To: <519227E2.2090801@rdtc.ru> References: <20130124195056.GB1410@funkthat.com> <519227E2.2090801@rdtc.ru> From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= Date: Tue, 14 May 2013 20:42:45 +0200 X-Google-Sender-Auth: 6R8_MYitSIsi-6g_UsvOJ869fKk Message-ID: Subject: Re: how to completely makes an interface down? To: Eugene Grosbein Content-Type: text/plain; charset=KOI8-R Cc: h bagade , "freebsd-net@freebsd.org" , John-Mark Gurney , Jack Vogel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 May 2013 18:43:06 -0000 On Tue, May 14, 2013 at 2:02 PM, Eugene Grosbein wrote: > > I've needed this feature several years ago so I made a patch for igb(4) and em(4) drivers. > The patch introduces new per-interface sysctls with default zero values: > > dev.em.X.down_disables_link > dev.igb.X.down.disables_link > > With this patch, sysctl dev.em.0.down_disables_link=1 makes "ifconfig em0 down" bring link down. > For LACP mode this feature is very useful as it makes LACP peer reconfigure itself quickly. > Great ! but what about adding a generic ifconfig mediaopt option in place of adding another new sysctl ? Something like "poweroff", "linkdown" or your "disablelink" as example. Because with this kind of sysctl values we can imagine a non-homogeneous future: We have already this problem with flow-control on em(4). The sysctl option for configuring flowcontrol on em(4) (no idea how to configure it with other drivers) are: - dev.em.0.fc (if chipset depends of if_em.c) - dev.em.0.flow_control (if chipset depends of if_lem.c) => By using ifconfig like "ifconfig INTERFACE mediaopt flowcontrol off|rx|tx|full" we could prevent different sysctl names between all NIC drivers. Regards, Olivier