Thread (71 messages) 71 messages, 6 authors, 2016-06-20

Re: [RFC PATCH v1 2/3] drivers/net/ixgbe: change xstats to use integers

From: David Harton (dharton) <hidden>
Date: 2016-05-03 13:40:22

-----Original Message-----
From: Remy Horton [mailto:remy.horton@intel.com]
Sent: Tuesday, May 03, 2016 8:23 AM
To: David Harton (dharton) <redacted>; dev@dpdk.org; Helin Zhang
[off-list ref]
Subject: Re: [dpdk-dev] [RFC PATCH v1 2/3] drivers/net/ixgbe: change
xstats to use integers


On 29/04/2016 14:43, David Harton (dharton) wrote:
[..]
quoted
quoted
+		/* RX Priority Stats */
+		for (stat = 0; stat < IXGBE_NB_RXQ_PRIO_STATS; stat++) {
+			for (i = 0; i < 8; i++) {
8 seems magical.  Is there a constant somewhere that can be used?
Not that I'm aware of. I've made it a #define as a small cleanup.

quoted
quoted
+static int ixgbevf_dev_xstats_names(__rte_unused struct rte_eth_dev
*dev,
quoted
quoted
+	struct rte_eth_xstats_name *ptr_names, __rte_unused unsigned limit)
+{
+	unsigned i;
+
+	if (limit < IXGBEVF_NB_XSTATS)
Think this check has to be removed since rte_eth_xstats_count() calls
with limit == 0.
Well spotted. It should only error-out if ptr_names is non-NULL.

As an aside, I am wondering whether getting stats counts should itself be
a seperate driver hook.
I personally think it would be cleaner.  Bug, I can also see the argument of keeping
the vector table smaller and would conceded to others that felt strongly about it.

I do really like having a separate external API to the user.  A user should explicitly
ask for the count.

Cheers,
Dave

..Remy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help