When adjusting the size of a dp_packet, dp_packet_set_data()
should be invoked before dp_packet_set_size(),since for DPDK
multi-segment mbufs, the former will use the segments's data_off
and buf_len to derive the frame size that should be set (this
behaviour is introduced in a subsequent commit).

Currently, in dp_packet_reset_packet(), that order is reversed.
Swap the order of same to resolve.

Signed-off-by: Mark Kavanagh <mark.b.kavan...@intel.com>
---
 lib/dp-packet.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index b4b721c..47502ad 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -569,8 +569,8 @@ dp_packet_set_data(struct dp_packet *b, void *data)
 static inline void
 dp_packet_reset_packet(struct dp_packet *b, int off)
 {
-    dp_packet_set_size(b, dp_packet_size(b) - off);
     dp_packet_set_data(b, ((unsigned char *) dp_packet_data(b) + off));
+    dp_packet_set_size(b, dp_packet_size(b) - off);
     dp_packet_reset_offsets(b);
 }
 
-- 
1.9.3

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to