Thread (157 messages) 157 messages, 5 authors, 2020-10-08

Re: [dpdk-dev] [PATCH v2 17/18] raw/ioat: add xstats tracking for idxd devices

From: Laatz, Kevin <hidden>
Date: 2020-08-24 09:56:58

On 21/08/2020 17:29, Bruce Richardson wrote:
Add update of the relevant stats for the data path functions and point the
overall device struct xstats function pointers to the existing ioat
functions.

At this point, all necessary hooks for supporting the existing unit tests
are in place so call them for each device.

Signed-off-by: Bruce Richardson <redacted>
---
  drivers/raw/ioat/idxd_pci.c            |  3 +++
  drivers/raw/ioat/idxd_vdev.c           |  3 +++
  drivers/raw/ioat/ioat_rawdev_test.c    |  2 +-
  drivers/raw/ioat/rte_ioat_rawdev_fns.h | 30 +++++++++++++++-----------
  4 files changed, 25 insertions(+), 13 deletions(-)
<snip>
quoted hunk ↗ jump to hunk
diff --git a/drivers/raw/ioat/rte_ioat_rawdev_fns.h b/drivers/raw/ioat/rte_ioat_rawdev_fns.h
index 66e3f1a836..db8608fa6b 100644
--- a/drivers/raw/ioat/rte_ioat_rawdev_fns.h
+++ b/drivers/raw/ioat/rte_ioat_rawdev_fns.h
@@ -182,6 +182,8 @@ struct rte_idxd_user_hdl {
   */
  struct rte_idxd_rawdev {
  	enum rte_ioat_dev_type type;
+	struct rte_ioat_xstats xstats;
+
  	void *portal; /* address to write the batch descriptor */
  
  	/* counters to track the batches and the individual op handles */
@@ -330,19 +332,15 @@ __idxd_enqueue_copy(int dev_id, rte_iova_t src, rte_iova_t dst,
  			IDXD_FLAG_CACHE_CONTROL;
  
  	/* check for room in the handle ring */
-	if (((idxd->next_free_hdl + 1) & (idxd->hdl_ring_sz - 1)) == idxd->next_ret_hdl) {
-		rte_errno = ENOSPC;
-		return 0;
-	}
-	if (b->op_count >= BATCH_SIZE) {
-		rte_errno = ENOSPC;
-		return 0;
-	}
+	if (((idxd->next_free_hdl + 1) & (idxd->hdl_ring_sz - 1)) == idxd->next_ret_hdl)
+		goto failed;
+
+	if (b->op_count >= BATCH_SIZE)
+		goto failed;
+
  	/* check that we can actually use the current batch */
-	if (b->submitted) {
-		rte_errno = ENOSPC;
-		return 0;
-	}
+	if (b->submitted)
+		goto failed;
This 'cleanup' can be done when initially adding the function in patch 
"raw/ioat: add data path for idxd devices", allowing for this patch to 
be more concise.

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