[dpdk-dev,2/2] examples/tep_term: Fix packet len for multi-seg mbuf

Message ID 1476769747-23289-2-git-send-email-qiudayu@chinac.com
State Accepted, archived
Headers show

Commit Message

Michael Qiu Oct. 18, 2016, 5:49 a.m.
For multi-seg mbuf, ip->total_length should be pkt_len subtract
ether len.

Fixes: 4abe471ed6fc("examples/tep_term: implement VXLAN processing")

Signed-off-by: Michael Qiu <qiudayu@chinac.com>
---
 examples/tep_termination/vxlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jianfeng Tan Oct. 24, 2016, 5:41 a.m. | #1
> -----Original Message-----
> From: Michael Qiu [mailto:qdy220091330@gmail.com]
> Sent: Tuesday, October 18, 2016 1:49 PM
> To: dev@dpdk.org
> Cc: Tan, Jianfeng; Michael Qiu
> Subject: [PATCH 2/2] examples/tep_term: Fix packet len for multi-seg mbuf
> 
> For multi-seg mbuf, ip->total_length should be pkt_len subtract
> ether len.
> 
> Fixes: 4abe471ed6fc("examples/tep_term: implement VXLAN processing")
> 
> Signed-off-by: Michael Qiu <qiudayu@chinac.com>

Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>

Thanks,
Jianfeng
Thomas Monjalon Oct. 25, 2016, 3:53 p.m. | #2
> > For multi-seg mbuf, ip->total_length should be pkt_len subtract
> > ether len.
> > 
> > Fixes: 4abe471ed6fc("examples/tep_term: implement VXLAN processing")
> > 
> > Signed-off-by: Michael Qiu <qiudayu@chinac.com>
> 
> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>

Applied, thanks

Patch

diff --git a/examples/tep_termination/vxlan.c b/examples/tep_termination/vxlan.c
index b57f867..9142c8d 100644
--- a/examples/tep_termination/vxlan.c
+++ b/examples/tep_termination/vxlan.c
@@ -218,7 +218,7 @@  encapsulation(struct rte_mbuf *m, uint8_t queue_id)
 	/* copy in IP header */
 	ip = rte_memcpy(ip, &app_ip_hdr[vport_id],
 		sizeof(struct ipv4_hdr));
-	ip->total_length = rte_cpu_to_be_16(m->data_len
+	ip->total_length = rte_cpu_to_be_16(m->pkt_len
 				- sizeof(struct ether_hdr));
 
 	/* outer IP checksum */