From owner-freebsd-net@freebsd.org Fri Jul 24 19:38:22 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E64B9A9E32 for ; Fri, 24 Jul 2015 19:38:22 +0000 (UTC) (envelope-from rpokala@panasas.com) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0092.outbound.protection.outlook.com [65.55.169.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF71D1532 for ; Fri, 24 Jul 2015 19:38:20 +0000 (UTC) (envelope-from rpokala@panasas.com) Received: from CY1PR08MB1803.namprd08.prod.outlook.com (10.162.218.25) by SN2PR0801MB0765.namprd08.prod.outlook.com (10.160.58.140) with Microsoft SMTP Server (TLS) id 15.1.225.19; Fri, 24 Jul 2015 19:23:00 +0000 Received: from CY1PR08MB1803.namprd08.prod.outlook.com ([10.162.218.25]) by CY1PR08MB1803.namprd08.prod.outlook.com ([10.162.218.25]) with mapi id 15.01.0225.018; Fri, 24 Jul 2015 19:23:00 +0000 From: "Pokala, Ravi" To: "Sundararajan, Lakshmi" , "freebsd-net@freebsd.org" CC: "panasas-network@msystechnologies.com" , "Lewis, Fred" , "Tallam, Sreen" Subject: Re: FreeBSD LAG LACP timeout tunable through IOCTL Thread-Topic: FreeBSD LAG LACP timeout tunable through IOCTL Thread-Index: AQHQxUOd4kytvOwYpUeJ3Hwdx+cXh53qjGiA Date: Fri, 24 Jul 2015 19:23:00 +0000 Message-ID: References: <55b0decc.2a80460a.3a90.ffffa91a@mx.google.com> In-Reply-To: <55b0decc.2a80460a.3a90.ffffa91a@mx.google.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.5.3.150624 authentication-results: msystechnologies.com; dkim=none (message not signed) header.d=none; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [64.80.217.3] x-microsoft-exchange-diagnostics: 1; SN2PR0801MB0765; 5:EB02wJDcaghNoVz5GRWxMeTTfzPwaJ2Xg7A9Rk5UZc2WjXyViV16EkhR/i7xk9si29iFZ+S16TIILUNiO5AMj5ct+csz/Sxfw3os5G03TK5cu99tJMOIp9QEcw+h8ZRoOLG+0F8ZISpnaaZR9O32jQ==; 24:JvQcHJZWxRtRGvcfp1CXCRdY2H/RLBVf7L5yXw1CWXACc2ch0+21/uCz5JGA7qcYmm+0EgKsgs6fxBGZLMAeJ7vOP7C1Kca6gL62B7wMFVQ=; 20:oBnQ5yBnq2GeldTx6KdoTm43OZx3/gGYJK5xbo60fEXyKE9RzDo1GaQQyd9cN8E25hFTv2HbuPjzHDzS9Q9qpA== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR0801MB0765; sn2pr0801mb0765: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:SN2PR0801MB0765; BCL:0; PCL:0; RULEID:; SRVR:SN2PR0801MB0765; x-forefront-prvs: 0647963F84 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(377424004)(13464003)(164054003)(106116001)(107886002)(122556002)(99286002)(5001960100002)(40100003)(2501003)(2656002)(66066001)(77156002)(62966003)(5001770100001)(2900100001)(87936001)(54356999)(19580405001)(5002640100001)(77096005)(2950100001)(76176999)(36756003)(102836002)(46102003)(189998001)(83506001)(86362001)(4001350100001)(92566002)(50986999)(19580395003)(4001430100001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR0801MB0765; H:CY1PR08MB1803.namprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: panasas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2015 19:23:00.1179 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: acf01c9d-c699-42af-bdbb-44bf582e60b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR0801MB0765 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2015 19:38:22 -0000 Hi LN, You also need to teach `ifconfig' how to toggle this new setting. See sbin/ifconfig/iflagg.c:lagg_cmds[] and how the other LACP options are handled. (Thanks to Genesys on #bsdcode for pointing that out.) Also, please confirm that you don't need to do any locking to walk the list or modify any of the list elements. Thanks, Ravi -----Original Message----- From: Lakshmi Narasimhan Sundararajan Date: 2015-07-23, Thursday at 05:25 To: "freebsd-net@freebsd.org" Cc: "panasas-network@msystechnologies.com" , "Lewis, Fred" , Ravi Pokala , "Tallam, Sreen" Subject: FreeBSD LAG LACP timeout tunable through IOCTL >Hi FreeBSD team, >In FreeBSD-10 and in Current, by default LACP supports only long timeout. >FreeBSD does not provide the way to configure LACP timeout period. >We made code changes for LACP Fast-timeout (Using IOCTL, both GET / SET) >on FreeBSD-11. > >And we were able to successfully test the operation using IOCtl calls >from userland. > > >Initially we wanted to use sysctl, but found in FreeBSD revision history, >that sysctl in LAG results in LOR and has to be converted to IOCTL. >Please let us know your comments to take this forward. > > > > >Diffs inline: >Index: sys/net/ieee8023ad_lacp.h >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- sys/net/ieee8023ad_lacp.h (revision 285195) >+++ sys/net/ieee8023ad_lacp.h (working copy) >@@ -251,6 +251,7 @@ > u_int32_t lsc_tx_test; > } lsc_debug; > u_int32_t lsc_strict_mode; >+ u_int32_t lsc_fast_timeout; /* if set, fast / short timeout */ > }; >=20 > #define LACP_TYPE_ACTORINFO 1 >Index: sys/net/if_lagg.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- sys/net/if_lagg.c (revision 285195) >+++ sys/net/if_lagg.c (working copy) >@@ -1257,6 +1257,8 @@ > ro->ro_opts |=3D LAGG_OPT_LACP_RXTEST; > if (lsc->lsc_strict_mode !=3D 0) > ro->ro_opts |=3D LAGG_OPT_LACP_STRICT; >+ if (lsc->lsc_fast_timeout !=3D 0) >+ ro->ro_opts |=3D LAGG_OPT_LACP_TIMEOUT; >=20 > ro->ro_active =3D sc->sc_active; > } else { >@@ -1292,6 +1294,8 @@ > case -LAGG_OPT_LACP_RXTEST: > case LAGG_OPT_LACP_STRICT: > case -LAGG_OPT_LACP_STRICT: >+ case LAGG_OPT_LACP_TIMEOUT: >+ case -LAGG_OPT_LACP_TIMEOUT: > valid =3D lacp =3D 1; > break; > default: >@@ -1320,6 +1324,7 @@ > sc->sc_opts &=3D ~ro->ro_opts; > } else { > struct lacp_softc *lsc; >+ struct lacp_port *lp; >=20 > lsc =3D (struct lacp_softc *)sc->sc_psc; >=20 >@@ -1342,6 +1347,16 @@ > case -LAGG_OPT_LACP_STRICT: > lsc->lsc_strict_mode =3D 0; > break; >+ case LAGG_OPT_LACP_TIMEOUT: >+ LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) >+ lp->lp_state |=3D LACP_STATE_TIMEOUT; >+ lsc->lsc_fast_timeout =3D 1; >+ break; >+ case -LAGG_OPT_LACP_TIMEOUT: >+ LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) >+ lp->lp_state &=3D ~LACP_STATE_TIMEOUT; >+ lsc->lsc_fast_timeout =3D 0; >+ break; > } > } > LAGG_WUNLOCK(sc); >Index: sys/net/if_lagg.h >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- sys/net/if_lagg.h (revision 285195) >+++ sys/net/if_lagg.h (working copy) >@@ -150,6 +150,7 @@ > #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ > #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ > #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ >+#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP Fast timeout */ > u_int ro_count; /* number of ports */ > u_int ro_active; /* active port count */ > u_int ro_flapping; /* number of flapping */ > > >Thanks, >LN > > >MSYS Technologies > > >