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. -- Totus tuus, Glebius. _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"