[2/2] raw/ioat: remove special case for no status reporting

Message ID 20210512145000.249215-2-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] raw/ioat: fix ring space checks |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Functional fail Functional Testing issues

Commit Message

Bruce Richardson May 12, 2021, 2:50 p.m. UTC
  The special fast-path for returning completed descriptors without
reporting status or user-handles returns the number of completed ring
slots used, rather than the number of actual user-submitted jobs. This
means that the counts returned are too high, as the batch descriptor
slots would be included in the total. Therefore remove this special
case, and use the normal status-processing path so that the returned
count is correct in all cases.

Fixes: 245efe544d8e ("raw/ioat: report status of completed jobs")

Reported-by: Jiayu Hu <jiayu.hu@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/raw/ioat/rte_idxd_rawdev_fns.h | 9 ---------
 1 file changed, 9 deletions(-)
  

Comments

Kevin Laatz May 12, 2021, 4:11 p.m. UTC | #1
> The special fast-path for returning completed descriptors without
> reporting status or user-handles returns the number of completed ring
> slots used, rather than the number of actual user-submitted jobs. This
> means that the counts returned are too high, as the batch descriptor
> slots would be included in the total. Therefore remove this special
> case, and use the normal status-processing path so that the returned
> count is correct in all cases.
> 
> Fixes: 245efe544d8e ("raw/ioat: report status of completed jobs")
> 
> Reported-by: Jiayu Hu <jiayu.hu@intel.com>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
<...>

Acked-by: Kevin Laatz <kevin.laatz@intel.com>
  
Thomas Monjalon May 12, 2021, 6:49 p.m. UTC | #2
> > The special fast-path for returning completed descriptors without
> > reporting status or user-handles returns the number of completed ring
> > slots used, rather than the number of actual user-submitted jobs. This
> > means that the counts returned are too high, as the batch descriptor
> > slots would be included in the total. Therefore remove this special
> > case, and use the normal status-processing path so that the returned
> > count is correct in all cases.
> > 
> > Fixes: 245efe544d8e ("raw/ioat: report status of completed jobs")
> > 
> > Reported-by: Jiayu Hu <jiayu.hu@intel.com>
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Acked-by: Kevin Laatz <kevin.laatz@intel.com>

Series applied, thanks
  

Patch

diff --git a/drivers/raw/ioat/rte_idxd_rawdev_fns.h b/drivers/raw/ioat/rte_idxd_rawdev_fns.h
index 6ed67d77e..6c5334cb3 100644
--- a/drivers/raw/ioat/rte_idxd_rawdev_fns.h
+++ b/drivers/raw/ioat/rte_idxd_rawdev_fns.h
@@ -343,14 +343,6 @@  __idxd_completed_ops(int dev_id, uint8_t max_ops, uint32_t *status, uint8_t *num
 			idxd->batch_idx_read = 0;
 	}
 
-	if (idxd->cfg.hdls_disable && status == NULL) {
-		n = (idxd->hdls_avail < idxd->hdls_read) ?
-				(idxd->hdls_avail + idxd->desc_ring_mask + 1 - idxd->hdls_read) :
-				(idxd->hdls_avail - idxd->hdls_read);
-		idxd->hdls_read = idxd->hdls_avail;
-		goto out;
-	}
-
 	n = 0;
 	h_idx = idxd->hdls_read;
 	while (h_idx != idxd->hdls_avail) {
@@ -386,7 +378,6 @@  __idxd_completed_ops(int dev_id, uint8_t max_ops, uint32_t *status, uint8_t *num
 	}
 	idxd->hdls_read = h_idx;
 
-out:
 	idxd->xstats.completed += n;
 	return n;
 }