patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] app/testpmd: fix IP next proto in set raw decap/encap
@ 2019-10-31 10:11 Xiaoyu Min
  2019-10-31 18:22 ` Ori Kam
  2019-10-31 18:51 ` [dpdk-stable] [dpdk-dev] " Slava Ovsiienko
  0 siblings, 2 replies; 4+ messages in thread
From: Xiaoyu Min @ 2019-10-31 10:11 UTC (permalink / raw)
  To: orika, Adrien Mazarguil, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger
  Cc: dev, stable

The IP's next protocol will be specified by user when set IP-in-IP
tunnel header via set raw decap/encap commands.

Currently this field is wrongly set to zero if there is no upper layer.
This leads to the encapsulated IP-in-IP tunnel header is not correct.

This next protocol field should be leave it as-is if there is no upper
layer or value is already set.

Fixes: 30626def03d6 ("app/testpmd: support raw encap/decap actions")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
 app/test-pmd/cmdline_flow.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 0d0bc0a5b2..d5ad64bc8b 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -5996,11 +5996,13 @@ update_fields(uint8_t *buf, struct rte_flow_item *item, uint16_t next_proto)
 	case RTE_FLOW_ITEM_TYPE_IPV4:
 		ipv4 = (struct rte_flow_item_ipv4 *)buf;
 		ipv4->hdr.version_ihl = 0x45;
-		ipv4->hdr.next_proto_id = (uint8_t)next_proto;
+		if (next_proto && ipv4->hdr.next_proto_id == 0)
+			ipv4->hdr.next_proto_id = (uint8_t)next_proto;
 		break;
 	case RTE_FLOW_ITEM_TYPE_IPV6:
 		ipv6 = (struct rte_flow_item_ipv6 *)buf;
-		ipv6->hdr.proto = (uint8_t)next_proto;
+		if (next_proto && ipv6->hdr.proto == 0)
+			ipv6->hdr.proto = (uint8_t)next_proto;
 		ipv6_vtc_flow = rte_be_to_cpu_32(ipv6->hdr.vtc_flow);
 		ipv6_vtc_flow &= 0x0FFFFFFF; /*< reset version bits. */
 		ipv6_vtc_flow |= 0x60000000; /*< set ipv6 version. */
@@ -6182,9 +6184,11 @@ cmd_set_raw_parsed(const struct buffer *in)
 			break;
 		case RTE_FLOW_ITEM_TYPE_GRE_KEY:
 			size = sizeof(rte_be32_t);
+			proto = 0x0;
 			break;
 		case RTE_FLOW_ITEM_TYPE_MPLS:
 			size = sizeof(struct rte_flow_item_mpls);
+			proto = 0x0;
 			break;
 		case RTE_FLOW_ITEM_TYPE_NVGRE:
 			size = sizeof(struct rte_flow_item_nvgre);
-- 
2.24.0.rc0.3.g12a4aeaad8


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

* Re: [dpdk-stable] [PATCH] app/testpmd: fix IP next proto in set raw decap/encap
  2019-10-31 10:11 [dpdk-stable] [PATCH] app/testpmd: fix IP next proto in set raw decap/encap Xiaoyu Min
@ 2019-10-31 18:22 ` Ori Kam
  2019-11-06 17:48   ` Ferruh Yigit
  2019-10-31 18:51 ` [dpdk-stable] [dpdk-dev] " Slava Ovsiienko
  1 sibling, 1 reply; 4+ messages in thread
From: Ori Kam @ 2019-10-31 18:22 UTC (permalink / raw)
  To: Jack Min, Adrien Mazarguil, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger
  Cc: dev, stable



> -----Original Message-----
> From: Xiaoyu Min <jackmin@mellanox.com>
> Sent: Thursday, October 31, 2019 12:11 PM
> To: Ori Kam <orika@mellanox.com>; Adrien Mazarguil
> <adrien.mazarguil@6wind.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>;
> Jingjing Wu <jingjing.wu@intel.com>; Bernard Iremonger
> <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] app/testpmd: fix IP next proto in set raw decap/encap
> 
> The IP's next protocol will be specified by user when set IP-in-IP
> tunnel header via set raw decap/encap commands.
> 
> Currently this field is wrongly set to zero if there is no upper layer.
> This leads to the encapsulated IP-in-IP tunnel header is not correct.
> 
> This next protocol field should be leave it as-is if there is no upper
> layer or value is already set.
> 
> Fixes: 30626def03d6 ("app/testpmd: support raw encap/decap actions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>

Acked-by: Ori Kam <orika@mellanox.com>
Thanks,
Ori

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: fix IP next proto in set raw decap/encap
  2019-10-31 10:11 [dpdk-stable] [PATCH] app/testpmd: fix IP next proto in set raw decap/encap Xiaoyu Min
  2019-10-31 18:22 ` Ori Kam
@ 2019-10-31 18:51 ` " Slava Ovsiienko
  1 sibling, 0 replies; 4+ messages in thread
From: Slava Ovsiienko @ 2019-10-31 18:51 UTC (permalink / raw)
  To: Jack Min, Ori Kam, Adrien Mazarguil, Wenzhuo Lu, Jingjing Wu,
	Bernard Iremonger
  Cc: dev, stable

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiaoyu Min
> Sent: Thursday, October 31, 2019 12:11
> To: Ori Kam <orika@mellanox.com>; Adrien Mazarguil
> <adrien.mazarguil@6wind.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>;
> Jingjing Wu <jingjing.wu@intel.com>; Bernard Iremonger
> <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] app/testpmd: fix IP next proto in set raw
> decap/encap
> 
> The IP's next protocol will be specified by user when set IP-in-IP tunnel
> header via set raw decap/encap commands.
> 
> Currently this field is wrongly set to zero if there is no upper layer.
> This leads to the encapsulated IP-in-IP tunnel header is not correct.
> 
> This next protocol field should be leave it as-is if there is no upper layer or
> value is already set.
> 
> Fixes: 30626def03d6 ("app/testpmd: support raw encap/decap actions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

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

* Re: [dpdk-stable] [PATCH] app/testpmd: fix IP next proto in set raw decap/encap
  2019-10-31 18:22 ` Ori Kam
@ 2019-11-06 17:48   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2019-11-06 17:48 UTC (permalink / raw)
  To: Ori Kam, Jack Min, Adrien Mazarguil, Wenzhuo Lu, Jingjing Wu,
	Bernard Iremonger
  Cc: dev, stable

On 10/31/2019 6:22 PM, Ori Kam wrote:
> 
> 
>> -----Original Message-----
>> From: Xiaoyu Min <jackmin@mellanox.com>
>> Sent: Thursday, October 31, 2019 12:11 PM
>> To: Ori Kam <orika@mellanox.com>; Adrien Mazarguil
>> <adrien.mazarguil@6wind.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>;
>> Jingjing Wu <jingjing.wu@intel.com>; Bernard Iremonger
>> <bernard.iremonger@intel.com>
>> Cc: dev@dpdk.org; stable@dpdk.org
>> Subject: [PATCH] app/testpmd: fix IP next proto in set raw decap/encap
>>
>> The IP's next protocol will be specified by user when set IP-in-IP
>> tunnel header via set raw decap/encap commands.
>>
>> Currently this field is wrongly set to zero if there is no upper layer.
>> This leads to the encapsulated IP-in-IP tunnel header is not correct.
>>
>> This next protocol field should be leave it as-is if there is no upper
>> layer or value is already set.
>>
>> Fixes: 30626def03d6 ("app/testpmd: support raw encap/decap actions")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> 
> Acked-by: Ori Kam <orika@mellanox.com>

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

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 10:11 [dpdk-stable] [PATCH] app/testpmd: fix IP next proto in set raw decap/encap Xiaoyu Min
2019-10-31 18:22 ` Ori Kam
2019-11-06 17:48   ` Ferruh Yigit
2019-10-31 18:51 ` [dpdk-stable] [dpdk-dev] " Slava Ovsiienko

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox