@@ -86,6 +86,8 @@ static const struct enic_stat enic_rx_stats[] = {
static const struct enic_stat enic_gen_stats[] = {
ENIC_GEN_STAT(dma_map_error),
+ ENIC_GEN_STAT(cache_alloc_err),
+ ENIC_GEN_STAT(rq_alloc_err),
};
static const unsigned int enic_n_tx_stats = ARRAY_SIZE(enic_tx_stats);
@@ -962,6 +962,7 @@ struct enic_alloc_cache *enic_page_refill(struct enic *enic, size_t sz,
goto no_ec;
ec->frag.page = alloc_pages_node(NUMA_NO_NODE, gfp_comp, order);
if (unlikely(!ec->frag.page)) {
+ enic->gen_stats.cache_alloc_err++;
order = get_order(sz);
ec->frag.page = alloc_pages_node(NUMA_NO_NODE, gfp, order);
if (!ec->frag.page)
@@ -1105,6 +1106,8 @@ static int enic_rq_alloc_buf(struct vnic_rq *rq)
return 0;
alloc_fail:
+ enic->gen_stats.rq_alloc_err++;
+
return -ENOMEM;
}
@@ -65,6 +65,8 @@ struct vnic_rx_stats {
/* Generic statistics */
struct vnic_gen_stats {
u64 dma_map_error;
+ u64 cache_alloc_err; /* alloc_pages(enic->order) failures */
+ u64 rq_alloc_err; /* rq buf + skb alloc failures */
};
struct vnic_stats {
This patch adds rq buff allocation failure stats. cache_alloc_err: incremented when higher order page allocation fails. enic_rq_alloc_buf: incremented rq buff fails. Either due to page alloc failure or build_skb. Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> --- drivers/net/ethernet/cisco/enic/enic_ethtool.c | 2 ++ drivers/net/ethernet/cisco/enic/enic_main.c | 3 +++ drivers/net/ethernet/cisco/enic/vnic_stats.h | 2 ++ 3 files changed, 7 insertions(+)