Skip to contentSkip to conversation

app/testpmd: distinguish ICMP identifier fields in packet

RFC Superseded lizh 3 participants 9 messages Sep 8, 2020 – Sep 30, 2020

lore
Share & tools
lore

lizh

author
#0 lore raw

RFC 1/1 app/testpmd: distinguish ICMP identifier fields in packet

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /
icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end
The ICMP packet with code 1, identifier 5 and
sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

---
 app/test-pmd/cmdline_flow.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
app/test-pmd/cmdline_flow.c +18 -0
index 6263d307ed..6e04d538ea 100644
@@ -143,6 +143,8 @@ enum index {
 	ITEM_ICMP,
 	ITEM_ICMP_TYPE,
 	ITEM_ICMP_CODE,
+	ITEM_ICMP_IDENT,
+	ITEM_ICMP_SEQ,
 	ITEM_UDP,
 	ITEM_UDP_SRC,
 	ITEM_UDP_DST,
@@ -893,6 +895,8 @@ static const enum index item_ipv6[] = {
 static const enum index item_icmp[] = {
 	ITEM_ICMP_TYPE,
 	ITEM_ICMP_CODE,
+	ITEM_ICMP_IDENT,
+	ITEM_ICMP_SEQ,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -2193,6 +2197,20 @@ static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
 					     hdr.icmp_code)),
 	},
+	[ITEM_ICMP_IDENT] = {
+		.name = "ident",
+		.help = "ICMP packet identifier",
+		.next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+					     hdr.icmp_ident)),
+	},
+	[ITEM_ICMP_SEQ] = {
+		.name = "seq",
+		.help = "ICMP packet sequence number",
+		.next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+					     hdr.icmp_seq_nb)),
+	},
 	[ITEM_UDP] = {
 		.name = "udp",
 		.help = "match UDP header",
Signature · 1 line
2.21.0
#1 lore raw

Hi,

Quoted 9 lines · lizh

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /

Quoted 8 lines

icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end

The ICMP packet with code 1, identifier 5 and sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

Signed-off-by: lizh <[email protected]>

Please configure your git environment so that your full name is filled. Then redo the Signed-off so that it appears as:
Li Zhang <[email protected]>

As you are new to DPDK, I suggest reading the guidelines for contributing:
https://core.dpdk.org/contribute/#send

author
#2 lore raw

Thanks! I update it now.

Regards,
Li Zhang

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, September 8, 2020 8:56 PM
To: Li Zhang <[email protected]>
Cc: Dekel Peled <[email protected]>; Ori Kam <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; [email protected]; Raslan Darawsheh <[email protected]>
Subject: Re: [RFC] app/testpmd: distinguish ICMP identifier fields in packet

External email: Use caution opening links or attachments

Hi,

Quoted 9 lines · lizh

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /

Quoted 8 lines

icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end

The ICMP packet with code 1, identifier 5 and sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

Please configure your git environment so that your full name is filled. Then redo the Signed-off so that it appears as:
Li Zhang <[email protected]>

As you are new to DPDK, I suggest reading the guidelines for contributing:

        https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcore.dpdk.org%2Fcontribute%2F%23send&amp;data=02%7C01%7Clizh%40nvidia.com%7C4d1f647de21844be83a408d853f69ab5%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637351665917806609&amp;sdata=dPG6VLa5HejKvwcGlqGKtfLwl%2BNEiybFSc5RUmmJDps%3D&amp;reserved=0
author
#3 lore raw

RFC v2 1/1 app/testpmd: distinguish ICMP identifier fields in packet

In reply to lizh

From: lizh <[email protected]>

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /
icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end
The ICMP packet with code 1, identifier 5 and
sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

---
 app/test-pmd/cmdline_flow.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
app/test-pmd/cmdline_flow.c +18 -0
index 6263d307ed..6e04d538ea 100644
@@ -143,6 +143,8 @@ enum index {
 	ITEM_ICMP,
 	ITEM_ICMP_TYPE,
 	ITEM_ICMP_CODE,
+	ITEM_ICMP_IDENT,
+	ITEM_ICMP_SEQ,
 	ITEM_UDP,
 	ITEM_UDP_SRC,
 	ITEM_UDP_DST,
@@ -893,6 +895,8 @@ static const enum index item_ipv6[] = {
 static const enum index item_icmp[] = {
 	ITEM_ICMP_TYPE,
 	ITEM_ICMP_CODE,
+	ITEM_ICMP_IDENT,
+	ITEM_ICMP_SEQ,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -2193,6 +2197,20 @@ static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
 					     hdr.icmp_code)),
 	},
+	[ITEM_ICMP_IDENT] = {
+		.name = "ident",
+		.help = "ICMP packet identifier",
+		.next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+					     hdr.icmp_ident)),
+	},
+	[ITEM_ICMP_SEQ] = {
+		.name = "seq",
+		.help = "ICMP packet sequence number",
+		.next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+					     hdr.icmp_seq_nb)),
+	},
 	[ITEM_UDP] = {
 		.name = "udp",
 		.help = "match UDP header",
Signature · 1 line
2.21.0
#4 lore raw
Quoted 16 lines · Li Zhang

From: lizh <[email protected]>

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /
icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end
The ICMP packet with code 1, identifier 5 and
sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

Overall looks good. @Ori, any objection?

@Li, is there any PMD implementation planned to use these icmp fields?

Quoted 49 lines
---
  app/test-pmd/cmdline_flow.c | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
app/test-pmd/cmdline_flow.c +18 -0
index 6263d307ed..6e04d538ea 100644
@@ -143,6 +143,8 @@ enum index {
  	ITEM_ICMP,
  	ITEM_ICMP_TYPE,
  	ITEM_ICMP_CODE,
+	ITEM_ICMP_IDENT,
+	ITEM_ICMP_SEQ,
  	ITEM_UDP,
  	ITEM_UDP_SRC,
  	ITEM_UDP_DST,
@@ -893,6 +895,8 @@ static const enum index item_ipv6[] = {
  static const enum index item_icmp[] = {
  	ITEM_ICMP_TYPE,
  	ITEM_ICMP_CODE,
+	ITEM_ICMP_IDENT,
+	ITEM_ICMP_SEQ,
  	ITEM_NEXT,
  	ZERO,
  };
@@ -2193,6 +2197,20 @@ static const struct token token_list[] = {
  		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
  					     hdr.icmp_code)),
  	},
+	[ITEM_ICMP_IDENT] = {
+		.name = "ident",
+		.help = "ICMP packet identifier",
+		.next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+					     hdr.icmp_ident)),
+	},
+	[ITEM_ICMP_SEQ] = {
+		.name = "seq",
+		.help = "ICMP packet sequence number",
+		.next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+					     hdr.icmp_seq_nb)),
+	},
  	[ITEM_UDP] = {
  		.name = "udp",
  		.help = "match UDP header",
author
#5 lore raw

Yes, There is PMD code change to support it.
https://patchwork.dpdk.org/patch/78488/

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Sent: Tuesday, September 22, 2020 11:38 PM
To: Li Zhang <[email protected]>; Dekel Peled <[email protected]>; Ori Kam <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; NBU-Contact-Thomas Monjalon <[email protected]>; Raslan Darawsheh <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/1] app/testpmd: distinguish ICMP identifier fields in packet

External email: Use caution opening links or attachments

Quoted 15 lines · Li Zhang

From: lizh <[email protected]>

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /
icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end The ICMP packet with code 1,
identifier 5 and sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

Overall looks good. @Ori, any objection?

@Li, is there any PMD implementation planned to use these icmp fields?

Quoted 49 lines
---
  app/test-pmd/cmdline_flow.c | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
app/test-pmd/cmdline_flow.c +18 -0
index 6263d307ed..6e04d538ea 100644
@@ -143,6 +143,8 @@ enum index {
      ITEM_ICMP,
      ITEM_ICMP_TYPE,
      ITEM_ICMP_CODE,
+     ITEM_ICMP_IDENT,
+     ITEM_ICMP_SEQ,
      ITEM_UDP,
      ITEM_UDP_SRC,
      ITEM_UDP_DST,
@@ -893,6 +895,8 @@ static const enum index item_ipv6[] = {
  static const enum index item_icmp[] = {
      ITEM_ICMP_TYPE,
      ITEM_ICMP_CODE,
+     ITEM_ICMP_IDENT,
+     ITEM_ICMP_SEQ,
      ITEM_NEXT,
      ZERO,
  };
@@ -2193,6 +2197,20 @@ static const struct token token_list[] = {
              .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
                                           hdr.icmp_code)),
      },
+     [ITEM_ICMP_IDENT] = {
+             .name = "ident",
+             .help = "ICMP packet identifier",
+             .next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+             .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+                                          hdr.icmp_ident)),
+     },
+     [ITEM_ICMP_SEQ] = {
+             .name = "seq",
+             .help = "ICMP packet sequence number",
+             .next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+             .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+                                          hdr.icmp_seq_nb)),
+     },
      [ITEM_UDP] = {
              .name = "udp",
              .help = "match UDP header",
Reviewed-by on v2 1/1
#6 lore raw
In reply to Li Zhang
Quoted 16 lines · Li Zhang

From: lizh <[email protected]>

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /
icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end
The ICMP packet with code 1, identifier 5 and
sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

Quoted 1 line
Applied
#7 lore raw
Quoted 17 lines · Ferruh Yigit
Quoted 16 lines · Li Zhang

From: lizh <[email protected]>

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /
  icmp code is 1 ident is 5 seq is 6 /
  end actions count / queue index 0 / end
The ICMP packet with code 1, identifier 5 and
sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

Quoted 4 lines
Quoted 1 line

Applied to dpdk-next-net/main, thanks.

author
#8 lore raw

RFC v2 1/1 app/testpmd: distinguish ICMP identifier fields in packet

In reply to lizh

Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example:
flow create 0 ingress pattern eth / ipv4 /
icmp code is 1 ident is 5 seq is 6 /
end actions count / queue index 0 / end
The ICMP packet with code 1, identifier 5 and
sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

---
 app/test-pmd/cmdline_flow.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
app/test-pmd/cmdline_flow.c +18 -0
index 6263d307ed..6e04d538ea 100644
@@ -143,6 +143,8 @@ enum index {
 	ITEM_ICMP,
 	ITEM_ICMP_TYPE,
 	ITEM_ICMP_CODE,
+	ITEM_ICMP_IDENT,
+	ITEM_ICMP_SEQ,
 	ITEM_UDP,
 	ITEM_UDP_SRC,
 	ITEM_UDP_DST,
@@ -893,6 +895,8 @@ static const enum index item_ipv6[] = {
 static const enum index item_icmp[] = {
 	ITEM_ICMP_TYPE,
 	ITEM_ICMP_CODE,
+	ITEM_ICMP_IDENT,
+	ITEM_ICMP_SEQ,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -2193,6 +2197,20 @@ static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
 					     hdr.icmp_code)),
 	},
+	[ITEM_ICMP_IDENT] = {
+		.name = "ident",
+		.help = "ICMP packet identifier",
+		.next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+					     hdr.icmp_ident)),
+	},
+	[ITEM_ICMP_SEQ] = {
+		.name = "seq",
+		.help = "ICMP packet sequence number",
+		.next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp,
+					     hdr.icmp_seq_nb)),
+	},
 	[ITEM_UDP] = {
 		.name = "udp",
 		.help = "match UDP header",
Signature · 1 line
2.21.0