Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203423
b: refs/heads/master
c: 5d07bf2
h: refs/heads/master
i:
  203421: b49919b
  203419: 4b62474
  203415: 1139c62
  203407: d9375e5
  203391: d5ababb
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jul 9, 2010
1 parent 24c7fb7 commit bcfc0fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 122e28ebac2cc2378101d1d37a5886c3ac1f8b18
refs/heads/master: 5d07bf264746b7c22d7104e0e2232eeea3d32296
25 changes: 7 additions & 18 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6589,36 +6589,25 @@ bnx2_save_stats(struct bnx2 *bp)
temp_stats[i] += hw_stats[i];
}

#define GET_64BIT_NET_STATS64(ctr) \
(unsigned long) ((unsigned long) (ctr##_hi) << 32) + \
(unsigned long) (ctr##_lo)
#define GET_64BIT_NET_STATS64(ctr) \
(((u64) (ctr##_hi) << 32) + (u64) (ctr##_lo))

#define GET_64BIT_NET_STATS32(ctr) \
(ctr##_lo)

#if (BITS_PER_LONG == 64)
#define GET_64BIT_NET_STATS(ctr) \
GET_64BIT_NET_STATS64(bp->stats_blk->ctr) + \
GET_64BIT_NET_STATS64(bp->temp_stats_blk->ctr)
#else
#define GET_64BIT_NET_STATS(ctr) \
GET_64BIT_NET_STATS32(bp->stats_blk->ctr) + \
GET_64BIT_NET_STATS32(bp->temp_stats_blk->ctr)
#endif

#define GET_32BIT_NET_STATS(ctr) \
(unsigned long) (bp->stats_blk->ctr + \
bp->temp_stats_blk->ctr)

static struct net_device_stats *
bnx2_get_stats(struct net_device *dev)
static struct rtnl_link_stats64 *
bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
{
struct bnx2 *bp = netdev_priv(dev);
struct net_device_stats *net_stats = &dev->stats;

if (bp->stats_blk == NULL) {
if (bp->stats_blk == NULL)
return net_stats;
}

net_stats->rx_packets =
GET_64BIT_NET_STATS(stat_IfHCInUcastPkts) +
GET_64BIT_NET_STATS(stat_IfHCInMulticastPkts) +
Expand Down Expand Up @@ -8289,7 +8278,7 @@ static const struct net_device_ops bnx2_netdev_ops = {
.ndo_open = bnx2_open,
.ndo_start_xmit = bnx2_start_xmit,
.ndo_stop = bnx2_close,
.ndo_get_stats = bnx2_get_stats,
.ndo_get_stats64 = bnx2_get_stats64,
.ndo_set_rx_mode = bnx2_set_rx_mode,
.ndo_do_ioctl = bnx2_ioctl,
.ndo_validate_addr = eth_validate_addr,
Expand Down

0 comments on commit bcfc0fd

Please sign in to comment.