[dpdk-dev,v2] examples: fix ip_reassembly not work with some NICs

Message ID 1485156509-4919-1-git-send-email-yong.liu@intel.com
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show

Checks

Context Check Description
ci/Intel compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Liu, Yong Jan. 23, 2017, 7:28 a.m.
Some network device drivers like Fortville may not fill packet type by
default. Changed the method for detecting packet type from mbuf packet
type to ethernet header MAC type will make sure this example compatible
with all NICs.

Fixes: b84fb4cb88ff ("examples/ip_reassembly: overhaul")

v2:
* fix code style issue

Signed-off-by: Yong Liu <yong.liu@intel.com>

Comments

Luca Boccassi Aug. 27, 2018, 1:20 p.m. | #1
Hi Thomas and Yong,

This patch:

https://patches.dpdk.org/patch/19868/

Fixes an error in the Intel regression tests when backported to the
16.11.x LTS branch, but was never committed to master.
It's marked as superseded, and the error does not appear on master.

Do you remember what other change superseded this patch? I can't
find anything on the mailing list.

Thanks!

Kind regards,
Luca Boccassi
Liu, Yong Aug. 27, 2018, 1:57 p.m. | #2
Boccassi,
Packet type is supported in both vector and normal Rx functions of Fortville pmd. So I think this patch was superseded because of it do not fix the real issue.

Thanks,
Marvin

> -----Original Message-----
> From: Luca Boccassi [mailto:luca.boccassi@gmail.com]
> Sent: Monday, August 27, 2018 9:20 PM
> To: dev@dpdk.org
> Cc: Liu, Yong <yong.liu@intel.com>; thomas@monjalon.net; Yigit, Ferruh
> <ferruh.yigit@intel.com>
> Subject: Re: [PATCH v2] examples: fix ip_reassembly not work with some NICs
> 
> Hi Thomas and Yong,
> 
> This patch:
> 
> https://patches.dpdk.org/patch/19868/
> 
> Fixes an error in the Intel regression tests when backported to the
> 16.11.x LTS branch, but was never committed to master.
> It's marked as superseded, and the error does not appear on master.
> 
> Do you remember what other change superseded this patch? I can't
> find anything on the mailing list.
> 
> Thanks!
> 
> Kind regards,
> Luca Boccassi

Patch

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 50fe422..974fabc 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -356,7 +356,7 @@  struct rte_lpm6_config lpm6_config = {
 	dst_port = portid;
 
 	/* if packet is IPv4 */
-	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
+	if (eth_hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
 		struct ipv4_hdr *ip_hdr;
 		uint32_t ip_dst;
 
@@ -395,8 +395,7 @@  struct rte_lpm6_config lpm6_config = {
 			dst_port = next_hop_ipv4;
 		}
 
-		eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4);
-	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
+	} else if (eth_hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv6)) {
 		/* if packet is IPv6 */
 		struct ipv6_extension_fragment *frag_hdr;
 		struct ipv6_hdr *ip_hdr;
@@ -431,8 +430,6 @@  struct rte_lpm6_config lpm6_config = {
 				(enabled_port_mask & 1 << next_hop_ipv6) != 0) {
 			dst_port = next_hop_ipv6;
 		}
-
-		eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv6);
 	}
 	/* if packet wasn't IPv4 or IPv6, it's forwarded to the port it came from */