DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] pipeline: fix translation for mailbox fields
@ 2021-03-19 14:36 Cristian Dumitrescu
  2021-03-24  9:07 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  2021-03-24 11:36 ` [dpdk-dev] [PATCH v2] pipeline: fix instruction translation for table and " Cristian Dumitrescu
  0 siblings, 2 replies; 6+ messages in thread
From: Cristian Dumitrescu @ 2021-03-19 14:36 UTC (permalink / raw)
  To: dev; +Cc: churchill.khangar, stable

Fix to make the translation of extern object & function mailbox fields
(e.ext_obj.field and f.ext_func.field) work for the add/sub, shl/shr,
jmplt/jmpgt instructions.

Fixes: baf7999303d0 ("pipeline: introduce SWX add instruction")
Fixes: c88c62943818 ("pipeline: introduce SWX subtract instruction")
Fixes: b09ba6d0a3c2 ("pipeline: introduce SWX SHL instruction")
Fixes: e0f51638b715 ("pipeline: introduce SWX SHR instruction")
Fixes: b3947e25bed4 ("pipeline: introduce SWX jump and return instructions")
Cc: stable@dpdk.org

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/librte_pipeline/rte_swx_pipeline.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c
index 5257a5360..4455d9135 100644
--- a/lib/librte_pipeline/rte_swx_pipeline.c
+++ b/lib/librte_pipeline/rte_swx_pipeline.c
@@ -3697,9 +3697,9 @@ instr_alu_add_translate(struct rte_swx_pipeline *p,
 	fsrc = struct_field_parse(p, action, src, &src_struct_id);
 	if (fsrc) {
 		instr->type = INSTR_ALU_ADD;
-		if (dst[0] == 'h' && src[0] == 'm')
+		if (dst[0] == 'h' && src[0] != 'h')
 			instr->type = INSTR_ALU_ADD_HM;
-		if (dst[0] == 'm' && src[0] == 'h')
+		if (dst[0] != 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_ADD_MH;
 		if (dst[0] == 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_ADD_HH;
@@ -3750,9 +3750,9 @@ instr_alu_sub_translate(struct rte_swx_pipeline *p,
 	fsrc = struct_field_parse(p, action, src, &src_struct_id);
 	if (fsrc) {
 		instr->type = INSTR_ALU_SUB;
-		if (dst[0] == 'h' && src[0] == 'm')
+		if (dst[0] == 'h' && src[0] != 'h')
 			instr->type = INSTR_ALU_SUB_HM;
-		if (dst[0] == 'm' && src[0] == 'h')
+		if (dst[0] != 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SUB_MH;
 		if (dst[0] == 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SUB_HH;
@@ -3880,9 +3880,9 @@ instr_alu_shl_translate(struct rte_swx_pipeline *p,
 	fsrc = struct_field_parse(p, action, src, &src_struct_id);
 	if (fsrc) {
 		instr->type = INSTR_ALU_SHL;
-		if (dst[0] == 'h' && src[0] == 'm')
+		if (dst[0] == 'h' && src[0] != 'h')
 			instr->type = INSTR_ALU_SHL_HM;
-		if (dst[0] == 'm' && src[0] == 'h')
+		if (dst[0] != 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SHL_MH;
 		if (dst[0] == 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SHL_HH;
@@ -3933,9 +3933,9 @@ instr_alu_shr_translate(struct rte_swx_pipeline *p,
 	fsrc = struct_field_parse(p, action, src, &src_struct_id);
 	if (fsrc) {
 		instr->type = INSTR_ALU_SHR;
-		if (dst[0] == 'h' && src[0] == 'm')
+		if (dst[0] == 'h' && src[0] != 'h')
 			instr->type = INSTR_ALU_SHR_HM;
-		if (dst[0] == 'm' && src[0] == 'h')
+		if (dst[0] != 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SHR_MH;
 		if (dst[0] == 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SHR_HH;
@@ -6853,9 +6853,9 @@ instr_jmp_lt_translate(struct rte_swx_pipeline *p,
 	fb = struct_field_parse(p, action, b, &b_struct_id);
 	if (fb) {
 		instr->type = INSTR_JMP_LT;
-		if (a[0] == 'h' && b[0] == 'm')
+		if (a[0] == 'h' && b[0] != 'h')
 			instr->type = INSTR_JMP_LT_HM;
-		if (a[0] == 'm' && b[0] == 'h')
+		if (a[0] != 'h' && b[0] == 'h')
 			instr->type = INSTR_JMP_LT_MH;
 		if (a[0] == 'h' && b[0] == 'h')
 			instr->type = INSTR_JMP_LT_HH;
@@ -6910,9 +6910,9 @@ instr_jmp_gt_translate(struct rte_swx_pipeline *p,
 	fb = struct_field_parse(p, action, b, &b_struct_id);
 	if (fb) {
 		instr->type = INSTR_JMP_GT;
-		if (a[0] == 'h' && b[0] == 'm')
+		if (a[0] == 'h' && b[0] != 'h')
 			instr->type = INSTR_JMP_GT_HM;
-		if (a[0] == 'm' && b[0] == 'h')
+		if (a[0] != 'h' && b[0] == 'h')
 			instr->type = INSTR_JMP_GT_MH;
 		if (a[0] == 'h' && b[0] == 'h')
 			instr->type = INSTR_JMP_GT_HH;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] pipeline: fix translation for mailbox fields
  2021-03-19 14:36 [dpdk-dev] [PATCH] pipeline: fix translation for mailbox fields Cristian Dumitrescu
@ 2021-03-24  9:07 ` Thomas Monjalon
  2021-03-24 11:07   ` Dumitrescu, Cristian
  2021-03-24 11:36 ` [dpdk-dev] [PATCH v2] pipeline: fix instruction translation for table and " Cristian Dumitrescu
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2021-03-24  9:07 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, stable, churchill.khangar

19/03/2021 15:36, Cristian Dumitrescu:
> Fix to make the translation of extern object & function mailbox fields
> (e.ext_obj.field and f.ext_func.field) work for the add/sub, shl/shr,
> jmplt/jmpgt instructions.

I think it deserves it bit more explanations.

> Fixes: baf7999303d0 ("pipeline: introduce SWX add instruction")
> Fixes: c88c62943818 ("pipeline: introduce SWX subtract instruction")
> Fixes: b09ba6d0a3c2 ("pipeline: introduce SWX SHL instruction")
> Fixes: e0f51638b715 ("pipeline: introduce SWX SHR instruction")
> Fixes: b3947e25bed4 ("pipeline: introduce SWX jump and return instructions")




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] pipeline: fix translation for mailbox fields
  2021-03-24  9:07 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
@ 2021-03-24 11:07   ` Dumitrescu, Cristian
  2021-03-24 11:40     ` Dumitrescu, Cristian
  0 siblings, 1 reply; 6+ messages in thread
From: Dumitrescu, Cristian @ 2021-03-24 11:07 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, stable, Khangar, Churchill



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, March 24, 2021 9:07 AM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Khangar, Churchill
> <churchill.khangar@intel.com>
> Subject: Re: [dpdk-stable] [PATCH] pipeline: fix translation for mailbox fields
> 
> 19/03/2021 15:36, Cristian Dumitrescu:
> > Fix to make the translation of extern object & function mailbox fields
> > (e.ext_obj.field and f.ext_func.field) work for the add/sub, shl/shr,
> > jmplt/jmpgt instructions.
> 
> I think it deserves it bit more explanations.
> 
> > Fixes: baf7999303d0 ("pipeline: introduce SWX add instruction")
> > Fixes: c88c62943818 ("pipeline: introduce SWX subtract instruction")
> > Fixes: b09ba6d0a3c2 ("pipeline: introduce SWX SHL instruction")
> > Fixes: e0f51638b715 ("pipeline: introduce SWX SHR instruction")
> > Fixes: b3947e25bed4 ("pipeline: introduce SWX jump and return
> instructions")
> 
> 

Thanks, Thomas, this is a relatively low level issue, so I found it difficult to explain in just a few words, but I will give it another shot in v2 that I am going to send now.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] pipeline: fix instruction translation for table and mailbox fields
  2021-03-19 14:36 [dpdk-dev] [PATCH] pipeline: fix translation for mailbox fields Cristian Dumitrescu
  2021-03-24  9:07 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
@ 2021-03-24 11:36 ` Cristian Dumitrescu
  2021-03-24 17:39   ` Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: Cristian Dumitrescu @ 2021-03-24 11:36 UTC (permalink / raw)
  To: dev, thomas; +Cc: stable

The SWX pipeline instructions work with operands of different types:
header fields (h.header.field), packet meta-data (m.field), extern
object mailbox field (e.obj.field), extern function (f.field), action
data read from table entries (t.field), or immediate values; hence the
HMEFTI acronym.

For some pipeline instructions (add/sub, srl/shr, jmplt/jmpgt), only
the H, M and I cases were handled, while the E, F and T cases were
disregarded. This is what we fix here.

Fixes: baf7999303d0 ("pipeline: introduce SWX add instruction")
Fixes: c88c62943818 ("pipeline: introduce SWX subtract instruction")
Fixes: b09ba6d0a3c2 ("pipeline: introduce SWX SHL instruction")
Fixes: e0f51638b715 ("pipeline: introduce SWX SHR instruction")
Fixes: b3947e25bed4 ("pipeline: introduce SWX jump and return instructions")
Cc: stable@dpdk.org

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/librte_pipeline/rte_swx_pipeline.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c
index 5257a5360..4455d9135 100644
--- a/lib/librte_pipeline/rte_swx_pipeline.c
+++ b/lib/librte_pipeline/rte_swx_pipeline.c
@@ -3697,9 +3697,9 @@ instr_alu_add_translate(struct rte_swx_pipeline *p,
 	fsrc = struct_field_parse(p, action, src, &src_struct_id);
 	if (fsrc) {
 		instr->type = INSTR_ALU_ADD;
-		if (dst[0] == 'h' && src[0] == 'm')
+		if (dst[0] == 'h' && src[0] != 'h')
 			instr->type = INSTR_ALU_ADD_HM;
-		if (dst[0] == 'm' && src[0] == 'h')
+		if (dst[0] != 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_ADD_MH;
 		if (dst[0] == 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_ADD_HH;
@@ -3750,9 +3750,9 @@ instr_alu_sub_translate(struct rte_swx_pipeline *p,
 	fsrc = struct_field_parse(p, action, src, &src_struct_id);
 	if (fsrc) {
 		instr->type = INSTR_ALU_SUB;
-		if (dst[0] == 'h' && src[0] == 'm')
+		if (dst[0] == 'h' && src[0] != 'h')
 			instr->type = INSTR_ALU_SUB_HM;
-		if (dst[0] == 'm' && src[0] == 'h')
+		if (dst[0] != 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SUB_MH;
 		if (dst[0] == 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SUB_HH;
@@ -3880,9 +3880,9 @@ instr_alu_shl_translate(struct rte_swx_pipeline *p,
 	fsrc = struct_field_parse(p, action, src, &src_struct_id);
 	if (fsrc) {
 		instr->type = INSTR_ALU_SHL;
-		if (dst[0] == 'h' && src[0] == 'm')
+		if (dst[0] == 'h' && src[0] != 'h')
 			instr->type = INSTR_ALU_SHL_HM;
-		if (dst[0] == 'm' && src[0] == 'h')
+		if (dst[0] != 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SHL_MH;
 		if (dst[0] == 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SHL_HH;
@@ -3933,9 +3933,9 @@ instr_alu_shr_translate(struct rte_swx_pipeline *p,
 	fsrc = struct_field_parse(p, action, src, &src_struct_id);
 	if (fsrc) {
 		instr->type = INSTR_ALU_SHR;
-		if (dst[0] == 'h' && src[0] == 'm')
+		if (dst[0] == 'h' && src[0] != 'h')
 			instr->type = INSTR_ALU_SHR_HM;
-		if (dst[0] == 'm' && src[0] == 'h')
+		if (dst[0] != 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SHR_MH;
 		if (dst[0] == 'h' && src[0] == 'h')
 			instr->type = INSTR_ALU_SHR_HH;
@@ -6853,9 +6853,9 @@ instr_jmp_lt_translate(struct rte_swx_pipeline *p,
 	fb = struct_field_parse(p, action, b, &b_struct_id);
 	if (fb) {
 		instr->type = INSTR_JMP_LT;
-		if (a[0] == 'h' && b[0] == 'm')
+		if (a[0] == 'h' && b[0] != 'h')
 			instr->type = INSTR_JMP_LT_HM;
-		if (a[0] == 'm' && b[0] == 'h')
+		if (a[0] != 'h' && b[0] == 'h')
 			instr->type = INSTR_JMP_LT_MH;
 		if (a[0] == 'h' && b[0] == 'h')
 			instr->type = INSTR_JMP_LT_HH;
@@ -6910,9 +6910,9 @@ instr_jmp_gt_translate(struct rte_swx_pipeline *p,
 	fb = struct_field_parse(p, action, b, &b_struct_id);
 	if (fb) {
 		instr->type = INSTR_JMP_GT;
-		if (a[0] == 'h' && b[0] == 'm')
+		if (a[0] == 'h' && b[0] != 'h')
 			instr->type = INSTR_JMP_GT_HM;
-		if (a[0] == 'm' && b[0] == 'h')
+		if (a[0] != 'h' && b[0] == 'h')
 			instr->type = INSTR_JMP_GT_MH;
 		if (a[0] == 'h' && b[0] == 'h')
 			instr->type = INSTR_JMP_GT_HH;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] pipeline: fix translation for mailbox fields
  2021-03-24 11:07   ` Dumitrescu, Cristian
@ 2021-03-24 11:40     ` Dumitrescu, Cristian
  0 siblings, 0 replies; 6+ messages in thread
From: Dumitrescu, Cristian @ 2021-03-24 11:40 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, stable, Khangar, Churchill



> -----Original Message-----
> From: Dumitrescu, Cristian
> Sent: Wednesday, March 24, 2021 11:07 AM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: dev@dpdk.org; stable@dpdk.org; Khangar, Churchill
> <churchill.khangar@intel.com>
> Subject: RE: [dpdk-stable] [PATCH] pipeline: fix translation for mailbox fields
> 
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Sent: Wednesday, March 24, 2021 9:07 AM
> > To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> > Cc: dev@dpdk.org; stable@dpdk.org; Khangar, Churchill
> > <churchill.khangar@intel.com>
> > Subject: Re: [dpdk-stable] [PATCH] pipeline: fix translation for mailbox
> fields
> >
> > 19/03/2021 15:36, Cristian Dumitrescu:
> > > Fix to make the translation of extern object & function mailbox fields
> > > (e.ext_obj.field and f.ext_func.field) work for the add/sub, shl/shr,
> > > jmplt/jmpgt instructions.
> >
> > I think it deserves it bit more explanations.
> >
> > > Fixes: baf7999303d0 ("pipeline: introduce SWX add instruction")
> > > Fixes: c88c62943818 ("pipeline: introduce SWX subtract instruction")
> > > Fixes: b09ba6d0a3c2 ("pipeline: introduce SWX SHL instruction")
> > > Fixes: e0f51638b715 ("pipeline: introduce SWX SHR instruction")
> > > Fixes: b3947e25bed4 ("pipeline: introduce SWX jump and return
> > instructions")
> >
> >
> 
> Thanks, Thomas, this is a relatively low level issue, so I found it difficult to
> explain in just a few words, but I will give it another shot in v2 that I am going
> to send now.

Done, just sent v2.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] pipeline: fix instruction translation for table and mailbox fields
  2021-03-24 11:36 ` [dpdk-dev] [PATCH v2] pipeline: fix instruction translation for table and " Cristian Dumitrescu
@ 2021-03-24 17:39   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2021-03-24 17:39 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, stable

24/03/2021 12:36, Cristian Dumitrescu:
> The SWX pipeline instructions work with operands of different types:
> header fields (h.header.field), packet meta-data (m.field), extern
> object mailbox field (e.obj.field), extern function (f.field), action
> data read from table entries (t.field), or immediate values; hence the
> HMEFTI acronym.
> 
> For some pipeline instructions (add/sub, srl/shr, jmplt/jmpgt), only
> the H, M and I cases were handled, while the E, F and T cases were
> disregarded. This is what we fix here.
> 
> Fixes: baf7999303d0 ("pipeline: introduce SWX add instruction")
> Fixes: c88c62943818 ("pipeline: introduce SWX subtract instruction")
> Fixes: b09ba6d0a3c2 ("pipeline: introduce SWX SHL instruction")
> Fixes: e0f51638b715 ("pipeline: introduce SWX SHR instruction")
> Fixes: b3947e25bed4 ("pipeline: introduce SWX jump and return instructions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-24 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 14:36 [dpdk-dev] [PATCH] pipeline: fix translation for mailbox fields Cristian Dumitrescu
2021-03-24  9:07 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2021-03-24 11:07   ` Dumitrescu, Cristian
2021-03-24 11:40     ` Dumitrescu, Cristian
2021-03-24 11:36 ` [dpdk-dev] [PATCH v2] pipeline: fix instruction translation for table and " Cristian Dumitrescu
2021-03-24 17:39   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).