From owner-freebsd-net@FreeBSD.ORG Sat Sep 13 23:20:45 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFB7CD55; Sat, 13 Sep 2014 23:20:45 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5A73753; Sat, 13 Sep 2014 23:20:45 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XSsdu-000GZz-W3; Sat, 13 Sep 2014 23:05:55 +0400 Message-ID: <5414D10E.7020000@FreeBSD.org> Date: Sun, 14 Sep 2014 03:19:42 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "net@freebsd.org" Subject: if_lagg(4) accounting changes X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 23:20:46 -0000 Hello list. I'd like to commit some changes to lagg counters which might be worth discussion. Diff is available at https://reviews.freebsd.org/D781 Quoting its summary: While counting packets using per-cpu counters might not introduce any significant overhead at current rates, we do not need to do such accounting at all. lagg in general is pure control-plane interface, its action on receive should be just to change packet src if pointer. Its action on transmit should be just selecting output interface based on flowid. It should not generate any errors on its own. In fact, RX lagg path can be skipped by setting correct ifp inside NIC driver. TX path should be handled by generic multipath L2 nexthops inside routing code. This is first step for implementing this scenario. One side effect is that we're now collecting all counters (including errors) from underlying interfaces. Generally most networking HW vendors implement this behavior for their equipment and this is really the reasonable thing to do.