@@ -251,6 +251,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();
@@ -321,7 +323,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))) {
@@ -481,7 +483,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);
@@ -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
This will be used by ODP for zero copy IO. Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org> --- lib/ofpbuf.c | 6 ++++-- lib/ofpbuf.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-)