From: Govindarajulu Varadarajan <_govind@gmx.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: ssujith@cisco.com, benve@cisco.com, edumazet@google.com,
ben@decadent.org.uk, Govindarajulu Varadarajan <_govind@gmx.com>
Subject: [PATCH net-next 2/4] enic: Add rq allocation failure stats
Date: Sat, 31 Jan 2015 17:58:08 +0530 [thread overview]
Message-ID: <1422707290-939-3-git-send-email-_govind@gmx.com> (raw)
In-Reply-To: <1422707290-939-1-git-send-email-_govind@gmx.com>
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(+)
diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
index 0c396c1..3f9d91b 100644
--- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c
+++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
@@ -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);
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index d9cad93..f15687d 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -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;
}
diff --git a/drivers/net/ethernet/cisco/enic/vnic_stats.h b/drivers/net/ethernet/cisco/enic/vnic_stats.h
index 74c81ed..b2a4528 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_stats.h
+++ b/drivers/net/ethernet/cisco/enic/vnic_stats.h
@@ -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 {
--
2.2.2
next prev parent reply other threads:[~2015-01-31 12:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-31 12:28 [PATCH net-next 0/4] enic: improve rq buff allocation and reduce dma mapping Govindarajulu Varadarajan
2015-01-31 12:28 ` [PATCH net-next 1/4] enic: implement frag allocator Govindarajulu Varadarajan
2015-01-31 12:28 ` Govindarajulu Varadarajan [this message]
2015-01-31 12:28 ` [PATCH net-next 3/4] ethtool: add RX_ALLOC_ORDER to tunable Govindarajulu Varadarajan
2015-02-03 3:21 ` David Miller
2015-02-03 9:49 ` Govindarajulu Varadarajan
2015-02-05 17:28 ` Govindarajulu Varadarajan
2015-01-31 12:28 ` [PATCH net-next 4/4] enic: add ethtool support for changing alloc order Govindarajulu Varadarajan
2015-02-02 15:56 ` [PATCH net-next 0/4] enic: improve rq buff allocation and reduce dma mapping David Laight
2015-02-02 17:49 ` Govindarajulu Varadarajan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422707290-939-3-git-send-email-_govind@gmx.com \
--to=_govind@gmx.com \
--cc=ben@decadent.org.uk \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=ssujith@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).