Skip to content

Commit 78122a5

Browse files
Ajit Khapardedavem330
authored andcommitted
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>
1 parent 3295354 commit 78122a5

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎drivers/net/benet/be.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ struct be_drvr_stats {
181181

182182
struct be_stats_obj {
183183
struct be_drvr_stats drvr_stats;
184-
struct net_device_stats net_stats;
185184
struct be_dma_mem cmd;
186185
};
187186

‎drivers/net/benet/be_ethtool.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ be_get_ethtool_stats(struct net_device *netdev,
234234
struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
235235
struct be_port_rxf_stats *port_stats =
236236
&rxf_stats->port[adapter->port_num];
237-
struct net_device_stats *net_stats = &adapter->stats.net_stats;
237+
struct net_device_stats *net_stats = &netdev->stats;
238238
struct be_erx_stats *erx_stats = &hw_stats->erx;
239239
void *p = NULL;
240240
int i;

‎drivers/net/benet/be_main.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void netdev_stats_update(struct be_adapter *adapter)
141141
struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
142142
struct be_port_rxf_stats *port_stats =
143143
&rxf_stats->port[adapter->port_num];
144-
struct net_device_stats *dev_stats = &adapter->stats.net_stats;
144+
struct net_device_stats *dev_stats = &adapter->netdev->stats;
145145
struct be_erx_stats *erx_stats = &hw_stats->erx;
146146

147147
dev_stats->rx_packets = port_stats->rx_total_frames;
@@ -269,9 +269,7 @@ static void be_rx_eqd_update(struct be_adapter *adapter)
269269

270270
static struct net_device_stats *be_get_stats(struct net_device *dev)
271271
{
272-
struct be_adapter *adapter = netdev_priv(dev);
273-
274-
return &adapter->stats.net_stats;
272+
return &dev->stats;
275273
}
276274

277275
static u32 be_calc_rate(u64 bytes, unsigned long ticks)

0 commit comments

Comments
 (0)