Skip to contentSkip to conversation

accel-config: Set wq name after setting mdev type

PATCH In review ramesh.thomas at intel.com 2 participants 2 messages Jul 20, 2021

lore
Share & tools
lore

ramesh.thomas at intel.com

#0 lore raw

PATCH 1/1 accel-config: Set wq name after setting mdev type

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Setting mdev type resets the name. After setting mdev set the name again from the template.

Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>
---
 test/libaccfg.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
test/libaccfg.c +8 -3
index 57d97f2..516adbc 100644
@@ -764,7 +764,8 @@ static int mdev_test(struct accfg_ctx *ctx, struct accfg_device *device,
 	return 0;
 }
 
-static int set_mdev_type(struct accfg_ctx *ctx, struct accfg_wq *wq)
+static int set_mdev_type(struct accfg_ctx *ctx, struct accfg_wq *wq,
+		struct wq_parameters *wq_param)
 {
 	int rc;
 
@@ -772,6 +773,10 @@ static int set_mdev_type(struct accfg_ctx *ctx, struct accfg_wq *wq)
 	if (rc)
 		fprintf(stderr, "Error setting mdev type\n");
 
+	rc = accfg_wq_set_str_name(wq, wq_param->name);
+	if (rc)
+		fprintf(stderr, "Error setting name for mdev type wq\n");
+
 	return rc;
 }
 
@@ -810,7 +815,7 @@ static int test_mdev_1swq(struct accfg_ctx *ctx)
 	if (rc)
 		return rc;
 
-	rc = set_mdev_type(ctx, test_ctx.wq[2]);
+	rc = set_mdev_type(ctx, test_ctx.wq[2], test_ctx.wq_param[2]);
 	if (rc)
 		return rc;
 
@@ -843,7 +848,7 @@ static int test_mdev_1dwq(struct accfg_ctx *ctx)
 	if (rc)
 		return rc;
 
-	rc = set_mdev_type(ctx, test_ctx.wq[3]);
+	rc = set_mdev_type(ctx, test_ctx.wq[3], test_ctx.wq_param[3]);
 	if (rc)
 		return rc;
 
Signature · 1 line
2.26.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · ramesh.thomas(a)intel.com

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Setting mdev type resets the name. After setting mdev set the name again from the template.

Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>
Reviewed-by Dave Jiang <dave.jiang(a)intel.com>
Quoted 47 lines
---
  test/libaccfg.c | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
test/libaccfg.c +8 -3
index 57d97f2..516adbc 100644
@@ -764,7 +764,8 @@ static int mdev_test(struct accfg_ctx *ctx, struct accfg_device *device,
  	return 0;
  }
 
-static int set_mdev_type(struct accfg_ctx *ctx, struct accfg_wq *wq)
+static int set_mdev_type(struct accfg_ctx *ctx, struct accfg_wq *wq,
+		struct wq_parameters *wq_param)
  {
  	int rc;
 
@@ -772,6 +773,10 @@ static int set_mdev_type(struct accfg_ctx *ctx, struct accfg_wq *wq)
  	if (rc)
  		fprintf(stderr, "Error setting mdev type\n");
 
+	rc = accfg_wq_set_str_name(wq, wq_param->name);
+	if (rc)
+		fprintf(stderr, "Error setting name for mdev type wq\n");
+
  	return rc;
  }
 
@@ -810,7 +815,7 @@ static int test_mdev_1swq(struct accfg_ctx *ctx)
  	if (rc)
  		return rc;
 
-	rc = set_mdev_type(ctx, test_ctx.wq[2]);
+	rc = set_mdev_type(ctx, test_ctx.wq[2], test_ctx.wq_param[2]);
  	if (rc)
  		return rc;
 
@@ -843,7 +848,7 @@ static int test_mdev_1dwq(struct accfg_ctx *ctx)
  	if (rc)
  		return rc;
 
-	rc = set_mdev_type(ctx, test_ctx.wq[3]);
+	rc = set_mdev_type(ctx, test_ctx.wq[3], test_ctx.wq_param[3]);
  	if (rc)
  		return rc;