[v3,3/5] common/sfc_efx/base: use the updated definitions of cidx/pidx

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

abhimanyu.saini@xilinx.com July 14, 2022, 1:48 p.m. UTC
  From: Abhimanyu Saini <absaini@amd.com>

Change cidx and pidx definition to mean used queue and avail
queue index respectively.

Signed-off-by: Abhimanyu Saini <absaini@amd.com>
---
v2:
* Fix checkpatch warnings
* Add a cover letter
v3:
* Restructure patchset

 drivers/common/sfc_efx/base/efx.h          | 12 ++++++------
 drivers/common/sfc_efx/base/rhead_virtio.c | 16 ++++++++--------
 drivers/vdpa/sfc/sfc_vdpa_ops.c            |  8 ++++----
 3 files changed, 18 insertions(+), 18 deletions(-)
  

Comments

Andrew Rybchenko July 28, 2022, 11:34 a.m. UTC | #1
On 7/14/22 16:48, abhimanyu.saini@xilinx.com wrote:
> From: Abhimanyu Saini <absaini@amd.com>

Please, try to stick to one E-mail address.

> 
> Change cidx and pidx definition to mean used queue and avail
> queue index respectively.
> 
> Signed-off-by: Abhimanyu Saini <absaini@amd.com>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  

Patch

diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 95f5fb6..c19205c 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -4886,17 +4886,17 @@  extern	__checkReturn	__success(return != B_FALSE)	boolean_t
 
 typedef struct efx_virtio_vq_dyncfg_s {
 	/*
-	 * If queue is being created to be migrated then this
-	 * should be the FINAL_PIDX value returned by MC_CMD_VIRTIO_FINI_QUEUE
+	 * If queue is being created to be migrated then this should be
+	 * the FINAL_AVAIL_IDX value returned by MC_CMD_VIRTIO_FINI_QUEUE
 	 * of the queue being migrated from. Otherwise, it should be zero.
 	 */
-	uint32_t		evvd_vq_pidx;
+	uint32_t		evvd_vq_avail_idx;
 	/*
-	 * If this queue is being created to be migrated then this
-	 * should be the FINAL_CIDX value returned by MC_CMD_VIRTIO_FINI_QUEUE
+	 * If queue is being created to be migrated then this should be
+	 * the FINAL_USED_IDX value returned by MC_CMD_VIRTIO_FINI_QUEUE
 	 * of the queue being migrated from. Otherwise, it should be zero.
 	 */
-	uint32_t		evvd_vq_cidx;
+	uint32_t		evvd_vq_used_idx;
 } efx_virtio_vq_dyncfg_t;
 
 /*
diff --git a/drivers/common/sfc_efx/base/rhead_virtio.c b/drivers/common/sfc_efx/base/rhead_virtio.c
index 7f08717..5a2ebe8 100644
--- a/drivers/common/sfc_efx/base/rhead_virtio.c
+++ b/drivers/common/sfc_efx/base/rhead_virtio.c
@@ -95,10 +95,10 @@ 
 		evvcp->evcc_features >> 32);
 
 	if (evvdp != NULL) {
-		MCDI_IN_SET_DWORD(req, VIRTIO_INIT_QUEUE_REQ_INITIAL_PIDX,
-			evvdp->evvd_vq_pidx);
-		MCDI_IN_SET_DWORD(req, VIRTIO_INIT_QUEUE_REQ_INITIAL_CIDX,
-			evvdp->evvd_vq_cidx);
+		MCDI_IN_SET_DWORD(req, VIRTIO_INIT_QUEUE_REQ_INITIAL_AVAIL_IDX,
+			evvdp->evvd_vq_avail_idx);
+		MCDI_IN_SET_DWORD(req, VIRTIO_INIT_QUEUE_REQ_INITIAL_USED_IDX,
+			evvdp->evvd_vq_used_idx);
 	}
 
 	MCDI_IN_SET_DWORD(req, VIRTIO_INIT_QUEUE_REQ_MPORT_SELECTOR,
@@ -161,10 +161,10 @@ 
 	}
 
 	if (evvdp != NULL) {
-		evvdp->evvd_vq_pidx =
-		    MCDI_OUT_DWORD(req, VIRTIO_FINI_QUEUE_RESP_FINAL_PIDX);
-		evvdp->evvd_vq_cidx =
-		    MCDI_OUT_DWORD(req, VIRTIO_FINI_QUEUE_RESP_FINAL_CIDX);
+		evvdp->evvd_vq_avail_idx =
+		    MCDI_OUT_DWORD(req, VIRTIO_FINI_QUEUE_RESP_FINAL_AVAIL_IDX);
+		evvdp->evvd_vq_used_idx =
+		    MCDI_OUT_DWORD(req, VIRTIO_FINI_QUEUE_RESP_FINAL_USED_IDX);
 	}
 
 	return (0);
diff --git a/drivers/vdpa/sfc/sfc_vdpa_ops.c b/drivers/vdpa/sfc/sfc_vdpa_ops.c
index b84699d..e2f119b 100644
--- a/drivers/vdpa/sfc/sfc_vdpa_ops.c
+++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c
@@ -258,8 +258,8 @@ 
 	vq_cfg.evvc_used_ring_addr  = vring.used;
 	vq_cfg.evvc_vq_size = vring.size;
 
-	vq_dyncfg.evvd_vq_pidx = vring.last_used_idx;
-	vq_dyncfg.evvd_vq_cidx = vring.last_avail_idx;
+	vq_dyncfg.evvd_vq_used_idx  = vring.last_used_idx;
+	vq_dyncfg.evvd_vq_avail_idx = vring.last_avail_idx;
 
 	/* MSI-X vector is function-relative */
 	vq_cfg.evvc_msix_vector = RTE_INTR_VEC_RXTX_OFFSET + vq_num;
@@ -321,8 +321,8 @@ 
 	/* stop the vq */
 	rc = efx_virtio_qstop(vq, &vq_idx);
 	if (rc == 0) {
-		ops_data->vq_cxt[vq_num].cidx = vq_idx.evvd_vq_cidx;
-		ops_data->vq_cxt[vq_num].pidx = vq_idx.evvd_vq_pidx;
+		ops_data->vq_cxt[vq_num].cidx = vq_idx.evvd_vq_used_idx;
+		ops_data->vq_cxt[vq_num].pidx = vq_idx.evvd_vq_avail_idx;
 	}
 	ops_data->vq_cxt[vq_num].enable = B_FALSE;