[ovs-dev,v15,13/15] Fix build without DPDK
diff mbox series

Message ID 20190911080828.2087-14-michalx.obrembski@intel.com
State Superseded
Headers show
Series
  • Support multi-segment mbufs
Related show

Commit Message

Michal Obrembski Sept. 11, 2019, 8:08 a.m. UTC
From: Michal Obrembski <michalx.obrembski@intel.com>

It looks like in dp_packet_clone_with_headroom() was used a DPDK functions when
DPDK was not enabled.

Signed-off-by: Michal Obrembski <michalx.obrembski@intel.com>
---
 lib/dp-packet.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

Patch
diff mbox series

diff --git a/lib/dp-packet.c b/lib/dp-packet.c
index ce78b0a..d6a4175 100644
--- a/lib/dp-packet.c
+++ b/lib/dp-packet.c
@@ -240,22 +240,25 @@  dp_packet_clone_with_headroom(const struct dp_packet *buffer, size_t headroom)
 {
     struct dp_packet *new_buffer;
     uint32_t mark;
-    uint32_t pkt_len = dp_packet_size(buffer);
 
     new_buffer = dp_packet_clone_data_with_headroom(dp_packet_data(buffer),
-                                                    pkt_len, headroom);
-
-    dp_packet_copy_comon_members(new_buffer, buffer);
-
-    new_buffer->rss_hash_valid = buffer->rss_hash_valid;
-    if (dp_packet_rss_valid(new_buffer)) {
-        new_buffer->rss_hash = buffer->rss_hash;
+                                                 dp_packet_size(buffer),
+                                                 headroom);
+    /* Copy the following fields into the returned buffer: l2_pad_size,
+     * l2_5_ofs, l3_ofs, l4_ofs, cutlen, packet_type and md. */
+    memcpy(&new_buffer->l2_pad_size, &buffer->l2_pad_size,
+            sizeof(struct dp_packet) -
+            offsetof(struct dp_packet, l2_pad_size));
+
+    if (dp_packet_rss_valid(buffer)) {
+        dp_packet_set_rss_hash(new_buffer, dp_packet_get_rss_hash(buffer));
     }
     if (dp_packet_has_flow_mark(buffer, &mark)) {
         dp_packet_set_flow_mark(new_buffer, mark);
     }
 
     return new_buffer;
+
 }
 #endif