dpif-netdev: Avoid useless flow copy in dp_netdev_flow_add().
[cascardo/ovs.git] / lib / ofpbuf.c
index 446593d..198bbf6 100644 (file)
@@ -117,9 +117,6 @@ void
 ofpbuf_init_dpdk(struct ofpbuf *b, size_t allocated)
 {
     ofpbuf_init__(b, allocated, OFPBUF_DPDK);
-#ifdef DPDK_NETDEV
-    b->dpdk_buf = b;
-#endif
 }
 
 /* Initializes 'b' as an empty ofpbuf with an initial capacity of 'size'
@@ -139,8 +136,9 @@ ofpbuf_uninit(struct ofpbuf *b)
             free(ofpbuf_base(b));
         } else if (b->source == OFPBUF_DPDK) {
 #ifdef DPDK_NETDEV
-            ovs_assert(b != b->dpdk_buf);
-            free_dpdk_buf(b);
+            /* If this ofpbuf was allocated by DPDK it must have been
+             * created as a dpif_packet */
+            free_dpdk_buf((struct dpif_packet*) b);
 #else
             ovs_assert(b->source != OFPBUF_DPDK);
 #endif