Thread (102 messages) 102 messages, 12 authors, 2019-07-04

Re: [dpdk-dev] [PATCH v3 7/8] raw/ioat: add statistics functions

From: Bruce Richardson <hidden>
Date: 2019-07-01 12:57:02

On Mon, Jul 01, 2019 at 11:11:20AM +0100, Pattan, Reshma wrote:
quoted
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
Sent: Thursday, June 27, 2019 11:41 AM
To: dev@dpdk.org

<snip>
quoted
+static int
+ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],
+		uint64_t values[], unsigned int n)
+{
+	const struct rte_ioat_rawdev *ioat = dev->dev_private;
+	unsigned int i;
+
+	for (i = 0; i < n; i++) {
+		switch (ids[i]) {
+		case 0: values[i] = ioat->enqueue_failed; break;
+		case 1: values[i] = ioat->enqueued; break;
+		case 2: values[i] = ioat->started; break;
+		case 3: values[i] = ioat->completed; break;
+		default: values[i] = 0; break;
+		}
+	}
+	return n;
Should this return n or  how many actually filled ?
They should both be "n", since we never break out of the loop early.

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