From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 20:23:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1AB775; Tue, 23 Sep 2014 20:23:04 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C50E2BA; Tue, 23 Sep 2014 20:23:04 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A13A41FE027; Tue, 23 Sep 2014 22:23:00 +0200 (CEST) Message-ID: <5421D69B.3000206@selasky.org> Date: Tue, 23 Sep 2014 22:22:51 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r272027 - in head: contrib/ofed/libibverbs/examples contrib/ofed/libmlx4/src sys/conf sys/modules/mlx4 sys/modules/mlxen sys/ofed/drivers/infiniband/hw/mlx4 sys/ofed/drivers/infiniband/... References: <201409231237.s8NCb27N061223@svn.freebsd.org> <20140923182549.GG884@FreeBSD.org> In-Reply-To: <20140923182549.GG884@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 20:23:04 -0000 On 09/23/14 20:25, Gleb Smirnoff wrote: > Hans, > > On Tue, Sep 23, 2014 at 12:37:02PM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Tue Sep 23 12:37:01 2014 > H> New Revision: 272027 > H> URL: http://svnweb.freebsd.org/changeset/base/272027 > H> > H> Log: > H> Hardware driver update from Mellanox Technologies, including: > H> - improved performance > H> - better stability > H> - new features > H> - bugfixes > ... > H> @@ -240,7 +240,7 @@ ipoib_ib_handle_rx_wc(struct ipoib_dev_p > H> */ > H> if (unlikely(!ipoib_alloc_rx_mb(priv, wr_id))) { > H> memcpy(&priv->rx_ring[wr_id], &saverx, sizeof(saverx)); > H> - dev->if_iqdrops++; > H> + if_inc_counter(dev, IFCOUNTER_IQDROPS, 1); > H> goto repost; > H> } > > Thanks a lot for these changes :) > > However, to fully convert driver to new stats we need to 1) stop > writing to ifnet if_foo fields, 2) provide if_get_counter() method, > that will return current counter values. > > This can be achieved in two ways: > > 1) Dumb solution. Remove assignments for if_foo counters from > mlx4_en_DUMP_ETH_STATS(). Provide if_get_counter() method, that will > return the values using the same code we deleted. > The cons of the solution is that we still run a useless callout > to gather statistics, and that statistics are updated only on callout. > If we query the interface faster than 1 time per second, we will get > same results in two queries. > > Example of dumb solution can be found in igb(4). > > Since the code is shared between OSes, it could be that dumb solution > is the best, since it is less disruptive. > > 2) Smarter solution. Remove assignments for if_foo counters from > mlx4_en_DUMP_ETH_STATS(). Do not run mlx4_en_DUMP_ETH_STATS() periodically. > Provide if_get_counter() method, that will first run mlx4_en_DUMP_ETH_STATS(), > and then do a switch on counter type and return it. > > Example of smarter solution is vtnet(4). > > 3) Smart solution. Remove assignments for if_foo counters from > mlx4_en_DUMP_ETH_STATS(). Do not run mlx4_en_DUMP_ETH_STATS() periodically. > Provide if_get_counter() method, that will switch on the counter type > and query the proper hardware register to fetch the value and return it. > > No examples available, yet :) > > Can you help me with this, please? I can code the dumb one quickly, but > probably committing it w/o hardware test is a risky plan. > Hi Gleb, I can give you a hand on this. It's currently late where I am, and I will look into this tomorrow. Thank you! --HPS