mirror of https://gitee.com/openkylin/linux.git
dpaa2-eth: Cleanup channel stats
Remove unused counter. Reorder fields in channel stats structure to match the ethtool strings order and make it easier to print them with ethtool -S. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
99e43521a0
commit
0ff8f0aab4
|
@ -467,7 +467,6 @@ static int consume_frames(struct dpaa2_eth_channel *ch,
|
|||
return 0;
|
||||
|
||||
fq->stats.frames += cleaned;
|
||||
ch->stats.frames += cleaned;
|
||||
|
||||
/* A dequeue operation only pulls frames from a single queue
|
||||
* into the store. Return the frame queue as an out param.
|
||||
|
|
|
@ -245,12 +245,10 @@ struct dpaa2_eth_fq_stats {
|
|||
struct dpaa2_eth_ch_stats {
|
||||
/* Volatile dequeues retried due to portal busy */
|
||||
__u64 dequeue_portal_busy;
|
||||
/* Number of CDANs; useful to estimate avg NAPI len */
|
||||
__u64 cdan;
|
||||
/* Number of frames received on queues from this channel */
|
||||
__u64 frames;
|
||||
/* Pull errors */
|
||||
__u64 pull_err;
|
||||
/* Number of CDANs; useful to estimate avg NAPI len */
|
||||
__u64 cdan;
|
||||
};
|
||||
|
||||
/* Maximum number of queues associated with a DPNI */
|
||||
|
|
|
@ -174,8 +174,6 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev,
|
|||
int j, k, err;
|
||||
int num_cnt;
|
||||
union dpni_statistics dpni_stats;
|
||||
u64 cdan = 0;
|
||||
u64 portal_busy = 0, pull_err = 0;
|
||||
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
|
||||
struct dpaa2_eth_drv_stats *extras;
|
||||
struct dpaa2_eth_ch_stats *ch_stats;
|
||||
|
@ -212,16 +210,12 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev,
|
|||
}
|
||||
i += j;
|
||||
|
||||
for (j = 0; j < priv->num_channels; j++) {
|
||||
ch_stats = &priv->channel[j]->stats;
|
||||
cdan += ch_stats->cdan;
|
||||
portal_busy += ch_stats->dequeue_portal_busy;
|
||||
pull_err += ch_stats->pull_err;
|
||||
/* Per-channel stats */
|
||||
for (k = 0; k < priv->num_channels; k++) {
|
||||
ch_stats = &priv->channel[k]->stats;
|
||||
for (j = 0; j < sizeof(*ch_stats) / sizeof(__u64); j++)
|
||||
*((__u64 *)data + i + j) += *((__u64 *)ch_stats + j);
|
||||
}
|
||||
|
||||
*(data + i++) = portal_busy;
|
||||
*(data + i++) = pull_err;
|
||||
*(data + i++) = cdan;
|
||||
}
|
||||
|
||||
static int prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask,
|
||||
|
|
Loading…
Reference in New Issue