lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABoNC82c2G+2ubS8it+dAdQBK3EvyaArdGxhZh-KY=3YraMdNA@mail.gmail.com>
Date:	Tue, 6 Mar 2012 12:38:50 +0800
From:	Junchang Wang <junchangwang@...il.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: export netdev_stats_to_stats64

> Some drivers use internal netdev stats member to store part of their
> stats, yet advertize ndo_get_stats64() to implement some 64bit fields.
>
> Allow them to use netdev_stats_to_stats64() helper to make the copy of
> netdev stats before they compute their 64bit counters.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>

Hi Eric,
And I think we can add a netdev_stats_add_to_stats64() helper to avoid
following duplicate code. Is that acceptable? Thanks.

drivers/net/bonding/bond_main.c
                stats->rx_packets += sstats->rx_packets;
                stats->rx_bytes += sstats->rx_bytes;
                stats->rx_errors += sstats->rx_errors;
                stats->rx_dropped += sstats->rx_dropped;

                stats->tx_packets += sstats->tx_packets;
                stats->tx_bytes += sstats->tx_bytes;
                stats->tx_errors += sstats->tx_errors;
                stats->tx_dropped += sstats->tx_dropped;

                stats->multicast += sstats->multicast;
                stats->collisions += sstats->collisions;

                stats->rx_length_errors += sstats->rx_length_errors;
                stats->rx_over_errors += sstats->rx_over_errors;
                stats->rx_crc_errors += sstats->rx_crc_errors;
                stats->rx_frame_errors += sstats->rx_frame_errors;
                stats->rx_fifo_errors += sstats->rx_fifo_errors;
                stats->rx_missed_errors += sstats->rx_missed_errors;

                stats->tx_aborted_errors += sstats->tx_aborted_errors;
                stats->tx_carrier_errors += sstats->tx_carrier_errors;
                stats->tx_fifo_errors += sstats->tx_fifo_errors;
                stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
                stats->tx_window_errors += sstats->tx_window_errors;

-- 
--Junchang
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ