Update code to use new network counter API.
Fix some minor compile warnings while at it. Sponsored by: Mellanox Technologies Suggested by: glebius@ MFC after: 1 week
This commit is contained in:
parent
6a9bcacfcf
commit
7b8455ae34
@ -546,17 +546,27 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
|
||||
}
|
||||
|
||||
if (!mlx4_is_mfunc(mdev->dev)) {
|
||||
/* netdevice stats format */
|
||||
dev = mdev->pndev[port];
|
||||
dev->if_ipackets = priv->pkstats.rx_packets;
|
||||
dev->if_opackets = priv->pkstats.tx_packets;
|
||||
dev->if_ibytes = priv->pkstats.rx_bytes;
|
||||
dev->if_obytes = priv->pkstats.tx_bytes;
|
||||
dev->if_ierrors = priv->pkstats.rx_errors;
|
||||
dev->if_iqdrops = priv->pkstats.rx_dropped;
|
||||
dev->if_imcasts = priv->pkstats.rx_multicast_packets;
|
||||
dev->if_omcasts = priv->pkstats.tx_multicast_packets;
|
||||
dev->if_collisions = 0;
|
||||
if (reset == 0) {
|
||||
/* netdevice stats format */
|
||||
dev = mdev->pndev[port];
|
||||
if_inc_counter(dev, IFCOUNTER_IPACKETS,
|
||||
priv->pkstats.rx_packets - priv->pkstats_last.rx_packets);
|
||||
if_inc_counter(dev, IFCOUNTER_OPACKETS,
|
||||
priv->pkstats.tx_packets - priv->pkstats_last.tx_packets);
|
||||
if_inc_counter(dev, IFCOUNTER_IBYTES,
|
||||
priv->pkstats.rx_bytes - priv->pkstats_last.rx_bytes);
|
||||
if_inc_counter(dev, IFCOUNTER_OBYTES,
|
||||
priv->pkstats.tx_bytes - priv->pkstats_last.tx_bytes);
|
||||
if_inc_counter(dev, IFCOUNTER_IERRORS,
|
||||
priv->pkstats.rx_errors - priv->pkstats_last.rx_errors);
|
||||
if_inc_counter(dev, IFCOUNTER_IQDROPS,
|
||||
priv->pkstats.rx_dropped - priv->pkstats_last.rx_dropped);
|
||||
if_inc_counter(dev, IFCOUNTER_IMCASTS,
|
||||
priv->pkstats.rx_multicast_packets - priv->pkstats_last.rx_multicast_packets);
|
||||
if_inc_counter(dev, IFCOUNTER_OMCASTS,
|
||||
priv->pkstats.tx_multicast_packets - priv->pkstats_last.tx_multicast_packets);
|
||||
}
|
||||
priv->pkstats_last = priv->pkstats;
|
||||
}
|
||||
|
||||
spin_unlock(&priv->stats_lock);
|
||||
|
@ -1028,9 +1028,6 @@ mlx4_en_transmit_locked(struct ifnet *dev, int tx_ind, struct mbuf *m)
|
||||
}
|
||||
drbr_advance(dev, ring->br);
|
||||
enqueued++;
|
||||
dev->if_obytes += next->m_pkthdr.len;
|
||||
if (next->m_flags & M_MCAST)
|
||||
if_inc_counter(dev, IFCOUNTER_OMCASTS, 1);
|
||||
if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0)
|
||||
break;
|
||||
}
|
||||
|
@ -223,8 +223,6 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param);
|
||||
int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic);
|
||||
int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt);
|
||||
int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages);
|
||||
int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
|
||||
int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
|
||||
int mlx4_NOP(struct mlx4_dev *dev);
|
||||
int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg);
|
||||
void mlx4_opreq_action(struct work_struct *work);
|
||||
|
@ -605,6 +605,7 @@ struct mlx4_en_priv {
|
||||
struct delayed_work service_task;
|
||||
struct mlx4_en_perf_stats pstats;
|
||||
struct mlx4_en_pkt_stats pkstats;
|
||||
struct mlx4_en_pkt_stats pkstats_last;
|
||||
struct mlx4_en_flow_stats flowstats[MLX4_NUM_PRIORITIES];
|
||||
struct mlx4_en_port_stats port_stats;
|
||||
struct mlx4_en_vport_stats vport_stats;
|
||||
|
@ -1843,7 +1843,7 @@ static int mac_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd,
|
||||
int err = -EINVAL;
|
||||
int port;
|
||||
u64 mac;
|
||||
u8 smac_index;
|
||||
u8 smac_index = 0;
|
||||
|
||||
if (op != RES_OP_RESERVE_AND_MAP)
|
||||
return err;
|
||||
|
Loading…
x
Reference in New Issue
Block a user