diff mbox series

[v2,1/5] common/sfc_efx/base: remove VQ index check during VQ start

Message ID 20220714084451.38375-2-asaini@xilinx.com (mailing list archive)
State Superseded, archived
Delegated to: Andrew Rybchenko
Headers show
Series Add support for live migration and cleanup MCDI headers | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

abhimanyu.saini@xilinx.com July 14, 2022, 8:44 a.m. UTC
From: Abhimanyu Saini <absaini@amd.com>

The used/avail queue indexes are not bound by queue
size, because HW calculates descriptor entry index by
performing a simple modulo between queue index and queue_size.

So, do not check initial used and avail queue indexes
against queue size because it is possible for these
indexes to be greater than queue size in the
following cases:
1) The queue is created to be migrated into, or
2) The client issues a qstop/qstart after running datapath

Fixes: 4dda72dbdeab3 ("common/sfc_efx/base: add base virtio support for vDPA")
Cc: stable@dpdk.org

Signed-off-by: Abhimanyu Saini <absaini@amd.com>
---
v2:
* Fix checkpatch warnings
* Add a cover letter
 
 drivers/common/sfc_efx/base/rhead_virtio.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/drivers/common/sfc_efx/base/rhead_virtio.c b/drivers/common/sfc_efx/base/rhead_virtio.c
index 335cb747d1..7f087170fe 100644
--- a/drivers/common/sfc_efx/base/rhead_virtio.c
+++ b/drivers/common/sfc_efx/base/rhead_virtio.c
@@ -47,14 +47,6 @@  rhead_virtio_qstart(
 		goto fail2;
 	}
 
-	if (evvdp != NULL) {
-		if ((evvdp->evvd_vq_cidx > evvcp->evvc_vq_size) ||
-		    (evvdp->evvd_vq_pidx > evvcp->evvc_vq_size)) {
-			rc = EINVAL;
-			goto fail3;
-		}
-	}
-
 	req.emr_cmd = MC_CMD_VIRTIO_INIT_QUEUE;
 	req.emr_in_buf = payload;
 	req.emr_in_length = MC_CMD_VIRTIO_INIT_QUEUE_REQ_LEN;
@@ -116,15 +108,13 @@  rhead_virtio_qstart(
 
 	if (req.emr_rc != 0) {
 		rc = req.emr_rc;
-		goto fail4;
+		goto fail3;
 	}
 
 	evvp->evv_vi_index = vi_index;
 
 	return (0);
 
-fail4:
-	EFSYS_PROBE(fail4);
 fail3:
 	EFSYS_PROBE(fail3);
 fail2: