patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v4 8/9] app/test-pmd: refine encap content
       [not found]   ` <20230815165050.86595-1-yuying.zhang@intel.com>
@ 2023-08-15 16:50     ` Zhang, Yuying
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Yuying @ 2023-08-15 16:50 UTC (permalink / raw)
  To: yuying.zhang, dev, qi.z.zhang, beilei.xing, jingjing.wu
  Cc: mingxia.liu, stable

From: Yuying Zhang <yuying.zhang@intel.com>

Refine vxlan encap content of all protocol headers.

Fixes: 1960be7d32f8 ("app/testpmd: add VXLAN encap/decap")
Cc: stable@dpdk.org

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
 app/test-pmd/cmdline_flow.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 94827bcc4a..b6cc0d9620 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -8514,7 +8514,7 @@ parse_setup_vxlan_encap_data(struct action_vxlan_encap_data *action_vxlan_encap_
 				.type = RTE_FLOW_ITEM_TYPE_END,
 			},
 		},
-		.item_eth.hdr.ether_type = 0,
+		.item_eth.hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4),
 		.item_vlan = {
 			.hdr.vlan_tci = vxlan_encap_conf.vlan_tci,
 			.hdr.eth_proto = 0,
@@ -8522,24 +8522,32 @@ parse_setup_vxlan_encap_data(struct action_vxlan_encap_data *action_vxlan_encap_
 		.item_ipv4.hdr = {
 			.src_addr = vxlan_encap_conf.ipv4_src,
 			.dst_addr = vxlan_encap_conf.ipv4_dst,
+			.version_ihl = RTE_IPV4_VHL_DEF,
+			.next_proto_id = IPPROTO_UDP,
+			.time_to_live = IPDEFTTL,
+			.hdr_checksum = rte_cpu_to_be_16(1),
 		},
 		.item_udp.hdr = {
 			.src_port = vxlan_encap_conf.udp_src,
 			.dst_port = vxlan_encap_conf.udp_dst,
+			.dgram_cksum = RTE_BE16(0x01),
 		},
-		.item_vxlan.hdr.flags = 0,
+		.item_vxlan.hdr.flags = 0x08,
 	};
 	memcpy(action_vxlan_encap_data->item_eth.hdr.dst_addr.addr_bytes,
 	       vxlan_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
 	memcpy(action_vxlan_encap_data->item_eth.hdr.src_addr.addr_bytes,
 	       vxlan_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
 	if (!vxlan_encap_conf.select_ipv4) {
+		action_vxlan_encap_data->item_eth.type = RTE_BE16(RTE_ETHER_TYPE_IPV6);
 		memcpy(&action_vxlan_encap_data->item_ipv6.hdr.src_addr,
 		       &vxlan_encap_conf.ipv6_src,
 		       sizeof(vxlan_encap_conf.ipv6_src));
 		memcpy(&action_vxlan_encap_data->item_ipv6.hdr.dst_addr,
 		       &vxlan_encap_conf.ipv6_dst,
 		       sizeof(vxlan_encap_conf.ipv6_dst));
+		action_vxlan_encap_data->item_ipv6.hdr.proto = IPPROTO_UDP;
+		action_vxlan_encap_data->item_ipv6.hdr.hop_limits = IPDEFTTL;
 		action_vxlan_encap_data->items[2] = (struct rte_flow_item){
 			.type = RTE_FLOW_ITEM_TYPE_IPV6,
 			.spec = &action_vxlan_encap_data->item_ipv6,
-- 
2.34.1


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

* [PATCH v3 9/9] app/test-pmd: refine encap content
       [not found] ` <20230906093407.3635038-1-wenjing.qiao@intel.com>
       [not found]   ` <20230815165050.86595-1-yuying.zhang@intel.com>
@ 2023-09-06  9:34   ` Wenjing Qiao
       [not found]   ` <20230915100047.90153-1-yuying.zhang@intel.com>
  2 siblings, 0 replies; 3+ messages in thread
From: Wenjing Qiao @ 2023-09-06  9:34 UTC (permalink / raw)
  To: yuying.zhang, dev, qi.z.zhang, jingjing.wu, beilei.xing
  Cc: mingxia.liu, stable

From: Yuying Zhang <yuying.zhang@intel.com>

Refine vxlan encap content of all protocol headers.

Fixes: 1960be7d32f8 ("app/testpmd: add VXLAN encap/decap")
Cc: stable@dpdk.org

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
 app/test-pmd/cmdline_flow.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 94827bcc4a..b6cc0d9620 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -8514,7 +8514,7 @@ parse_setup_vxlan_encap_data(struct action_vxlan_encap_data *action_vxlan_encap_
 				.type = RTE_FLOW_ITEM_TYPE_END,
 			},
 		},
-		.item_eth.hdr.ether_type = 0,
+		.item_eth.hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4),
 		.item_vlan = {
 			.hdr.vlan_tci = vxlan_encap_conf.vlan_tci,
 			.hdr.eth_proto = 0,
@@ -8522,24 +8522,32 @@ parse_setup_vxlan_encap_data(struct action_vxlan_encap_data *action_vxlan_encap_
 		.item_ipv4.hdr = {
 			.src_addr = vxlan_encap_conf.ipv4_src,
 			.dst_addr = vxlan_encap_conf.ipv4_dst,
+			.version_ihl = RTE_IPV4_VHL_DEF,
+			.next_proto_id = IPPROTO_UDP,
+			.time_to_live = IPDEFTTL,
+			.hdr_checksum = rte_cpu_to_be_16(1),
 		},
 		.item_udp.hdr = {
 			.src_port = vxlan_encap_conf.udp_src,
 			.dst_port = vxlan_encap_conf.udp_dst,
+			.dgram_cksum = RTE_BE16(0x01),
 		},
-		.item_vxlan.hdr.flags = 0,
+		.item_vxlan.hdr.flags = 0x08,
 	};
 	memcpy(action_vxlan_encap_data->item_eth.hdr.dst_addr.addr_bytes,
 	       vxlan_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
 	memcpy(action_vxlan_encap_data->item_eth.hdr.src_addr.addr_bytes,
 	       vxlan_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
 	if (!vxlan_encap_conf.select_ipv4) {
+		action_vxlan_encap_data->item_eth.type = RTE_BE16(RTE_ETHER_TYPE_IPV6);
 		memcpy(&action_vxlan_encap_data->item_ipv6.hdr.src_addr,
 		       &vxlan_encap_conf.ipv6_src,
 		       sizeof(vxlan_encap_conf.ipv6_src));
 		memcpy(&action_vxlan_encap_data->item_ipv6.hdr.dst_addr,
 		       &vxlan_encap_conf.ipv6_dst,
 		       sizeof(vxlan_encap_conf.ipv6_dst));
+		action_vxlan_encap_data->item_ipv6.hdr.proto = IPPROTO_UDP;
+		action_vxlan_encap_data->item_ipv6.hdr.hop_limits = IPDEFTTL;
 		action_vxlan_encap_data->items[2] = (struct rte_flow_item){
 			.type = RTE_FLOW_ITEM_TYPE_IPV6,
 			.spec = &action_vxlan_encap_data->item_ipv6,
-- 
2.34.1


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

* [PATCH v5 8/9] app/test-pmd: refine encap content
       [not found]   ` <20230915100047.90153-1-yuying.zhang@intel.com>
@ 2023-09-15 10:00     ` Zhang, Yuying
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Yuying @ 2023-09-15 10:00 UTC (permalink / raw)
  To: yuying.zhang, dev, qi.z.zhang, beilei.xing, jingjing.wu
  Cc: mingxia.liu, stable

From: Yuying Zhang <yuying.zhang@intel.com>

Refine vxlan encap content of all protocol headers.

Fixes: 1960be7d32f8 ("app/testpmd: add VXLAN encap/decap")
Cc: stable@dpdk.org

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
 app/test-pmd/cmdline_flow.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 94827bcc4a..b6cc0d9620 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -8514,7 +8514,7 @@ parse_setup_vxlan_encap_data(struct action_vxlan_encap_data *action_vxlan_encap_
 				.type = RTE_FLOW_ITEM_TYPE_END,
 			},
 		},
-		.item_eth.hdr.ether_type = 0,
+		.item_eth.hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4),
 		.item_vlan = {
 			.hdr.vlan_tci = vxlan_encap_conf.vlan_tci,
 			.hdr.eth_proto = 0,
@@ -8522,24 +8522,32 @@ parse_setup_vxlan_encap_data(struct action_vxlan_encap_data *action_vxlan_encap_
 		.item_ipv4.hdr = {
 			.src_addr = vxlan_encap_conf.ipv4_src,
 			.dst_addr = vxlan_encap_conf.ipv4_dst,
+			.version_ihl = RTE_IPV4_VHL_DEF,
+			.next_proto_id = IPPROTO_UDP,
+			.time_to_live = IPDEFTTL,
+			.hdr_checksum = rte_cpu_to_be_16(1),
 		},
 		.item_udp.hdr = {
 			.src_port = vxlan_encap_conf.udp_src,
 			.dst_port = vxlan_encap_conf.udp_dst,
+			.dgram_cksum = RTE_BE16(0x01),
 		},
-		.item_vxlan.hdr.flags = 0,
+		.item_vxlan.hdr.flags = 0x08,
 	};
 	memcpy(action_vxlan_encap_data->item_eth.hdr.dst_addr.addr_bytes,
 	       vxlan_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
 	memcpy(action_vxlan_encap_data->item_eth.hdr.src_addr.addr_bytes,
 	       vxlan_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
 	if (!vxlan_encap_conf.select_ipv4) {
+		action_vxlan_encap_data->item_eth.type = RTE_BE16(RTE_ETHER_TYPE_IPV6);
 		memcpy(&action_vxlan_encap_data->item_ipv6.hdr.src_addr,
 		       &vxlan_encap_conf.ipv6_src,
 		       sizeof(vxlan_encap_conf.ipv6_src));
 		memcpy(&action_vxlan_encap_data->item_ipv6.hdr.dst_addr,
 		       &vxlan_encap_conf.ipv6_dst,
 		       sizeof(vxlan_encap_conf.ipv6_dst));
+		action_vxlan_encap_data->item_ipv6.hdr.proto = IPPROTO_UDP;
+		action_vxlan_encap_data->item_ipv6.hdr.hop_limits = IPDEFTTL;
 		action_vxlan_encap_data->items[2] = (struct rte_flow_item){
 			.type = RTE_FLOW_ITEM_TYPE_IPV6,
 			.spec = &action_vxlan_encap_data->item_ipv6,
-- 
2.34.1


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

end of thread, other threads:[~2023-09-15  9:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230901113158.1654044-1-yuying.zhang@intel.com>
     [not found] ` <20230906093407.3635038-1-wenjing.qiao@intel.com>
     [not found]   ` <20230815165050.86595-1-yuying.zhang@intel.com>
2023-08-15 16:50     ` [PATCH v4 8/9] app/test-pmd: refine encap content Zhang, Yuying
2023-09-06  9:34   ` [PATCH v3 9/9] " Wenjing Qiao
     [not found]   ` <20230915100047.90153-1-yuying.zhang@intel.com>
2023-09-15 10:00     ` [PATCH v5 8/9] " Zhang, Yuying

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).