mirror of
https://github.com/torvalds/linux.git
synced 2024-12-22 02:52:56 +00:00
be2net: Get rid of net_device_stats from adapter.
adapter doesnot need to maintain a copy of net_device_stats. Use the one already available in net_device. This patch takes care of the same. Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3295354322
commit
78122a52b3
@ -181,7 +181,6 @@ struct be_drvr_stats {
|
|||||||
|
|
||||||
struct be_stats_obj {
|
struct be_stats_obj {
|
||||||
struct be_drvr_stats drvr_stats;
|
struct be_drvr_stats drvr_stats;
|
||||||
struct net_device_stats net_stats;
|
|
||||||
struct be_dma_mem cmd;
|
struct be_dma_mem cmd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ be_get_ethtool_stats(struct net_device *netdev,
|
|||||||
struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
|
struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
|
||||||
struct be_port_rxf_stats *port_stats =
|
struct be_port_rxf_stats *port_stats =
|
||||||
&rxf_stats->port[adapter->port_num];
|
&rxf_stats->port[adapter->port_num];
|
||||||
struct net_device_stats *net_stats = &adapter->stats.net_stats;
|
struct net_device_stats *net_stats = &netdev->stats;
|
||||||
struct be_erx_stats *erx_stats = &hw_stats->erx;
|
struct be_erx_stats *erx_stats = &hw_stats->erx;
|
||||||
void *p = NULL;
|
void *p = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
@ -141,7 +141,7 @@ void netdev_stats_update(struct be_adapter *adapter)
|
|||||||
struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
|
struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
|
||||||
struct be_port_rxf_stats *port_stats =
|
struct be_port_rxf_stats *port_stats =
|
||||||
&rxf_stats->port[adapter->port_num];
|
&rxf_stats->port[adapter->port_num];
|
||||||
struct net_device_stats *dev_stats = &adapter->stats.net_stats;
|
struct net_device_stats *dev_stats = &adapter->netdev->stats;
|
||||||
struct be_erx_stats *erx_stats = &hw_stats->erx;
|
struct be_erx_stats *erx_stats = &hw_stats->erx;
|
||||||
|
|
||||||
dev_stats->rx_packets = port_stats->rx_total_frames;
|
dev_stats->rx_packets = port_stats->rx_total_frames;
|
||||||
@ -269,9 +269,7 @@ static void be_rx_eqd_update(struct be_adapter *adapter)
|
|||||||
|
|
||||||
static struct net_device_stats *be_get_stats(struct net_device *dev)
|
static struct net_device_stats *be_get_stats(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct be_adapter *adapter = netdev_priv(dev);
|
return &dev->stats;
|
||||||
|
|
||||||
return &adapter->stats.net_stats;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 be_calc_rate(u64 bytes, unsigned long ticks)
|
static u32 be_calc_rate(u64 bytes, unsigned long ticks)
|
||||||
|
Loading…
Reference in New Issue
Block a user