Exemple #1
0
/* Frees memory that 'b' points to. */
void
dp_packet_uninit(struct dp_packet *b)
{
    if (b) {
        if (b->source == DPBUF_MALLOC) {
            free(dp_packet_base(b));
        } else if (b->source == DPBUF_DPDK) {
#ifdef DPDK_NETDEV
            /* If this dp_packet was allocated by DPDK it must have been
             * created as a dp_packet */
            free_dpdk_buf((struct dp_packet*) b);
#endif
        }
    }
}
Exemple #2
0
/* Frees memory that 'b' points to. */
void
ofpbuf_uninit(struct ofpbuf *b)
{
    if (b) {
        if (b->source == OFPBUF_MALLOC) {
            free(ofpbuf_base(b));
        } else if (b->source == OFPBUF_DPDK) {
#ifdef DPDK_NETDEV
            /* 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
        }
    }
}