diff options
-rw-r--r-- | lib/ofpbuf.c | 6 | ||||
-rw-r--r-- | lib/ofpbuf.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c index 4946e6fc8..08fefbeb4 100644 --- a/lib/ofpbuf.c +++ b/lib/ofpbuf.c @@ -253,6 +253,8 @@ ofpbuf_resize__(struct ofpbuf *b, size_t new_headroom, size_t new_tailroom) new_allocated = new_headroom + ofpbuf_size(b) + new_tailroom; switch (b->source) { + case OFPBUF_ODP: + OVS_NOT_REACHED(); case OFPBUF_DPDK: OVS_NOT_REACHED(); @@ -323,7 +325,7 @@ ofpbuf_prealloc_headroom(struct ofpbuf *b, size_t size) void ofpbuf_trim(struct ofpbuf *b) { - ovs_assert(b->source != OFPBUF_DPDK); + ovs_assert(b->source != OFPBUF_DPDK && b->source != OFPBUF_ODP); if (b->source == OFPBUF_MALLOC && (ofpbuf_headroom(b) || ofpbuf_tailroom(b))) { @@ -484,7 +486,7 @@ void * ofpbuf_steal_data(struct ofpbuf *b) { void *p; - ovs_assert(b->source != OFPBUF_DPDK); + ovs_assert(b->source != OFPBUF_DPDK && b->source != OFPBUF_ODP); if (b->source == OFPBUF_MALLOC && ofpbuf_data(b) == ofpbuf_base(b)) { p = ofpbuf_data(b); diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h index 4c0f7eaa4..6ceed88f5 100644 --- a/lib/ofpbuf.h +++ b/lib/ofpbuf.h @@ -34,6 +34,8 @@ enum OVS_PACKED_ENUM ofpbuf_source { OFPBUF_STUB, /* Starts on stack, may expand into heap. */ OFPBUF_DPDK, /* buffer data is from DPDK allocated memory. ref to build_ofpbuf() in netdev-dpdk. */ + OFPBUF_ODP, /* buffer data is from DPDK allocated memory. + ref to build_ofpbuf() in netdev-odp. */ }; /* Buffer for holding arbitrary data. An ofpbuf is automatically reallocated |