summaryrefslogtreecommitdiffstats
path: root/src/vlib/buffer_funcs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/buffer_funcs.h')
-rw-r--r--src/vlib/buffer_funcs.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vlib/buffer_funcs.h b/src/vlib/buffer_funcs.h
index 438bf7e5ee4..1110c206e52 100644
--- a/src/vlib/buffer_funcs.h
+++ b/src/vlib/buffer_funcs.h
@@ -314,18 +314,21 @@ vlib_buffer_contents (vlib_main_t * vm, u32 buffer_index, u8 * contents)
return content_len;
}
-/* Return physical address of buffer->data start. */
-always_inline u64
-vlib_get_buffer_data_physical_address (vlib_main_t * vm, u32 buffer_index)
+always_inline uword
+vlib_buffer_get_pa (vlib_main_t * vm, vlib_buffer_t * b)
{
vlib_buffer_main_t *bm = &buffer_main;
- vlib_buffer_t *b = vlib_get_buffer (vm, buffer_index);
vlib_buffer_pool_t *pool = vec_elt_at_index (bm->buffer_pools,
b->buffer_pool_index);
-
return vlib_physmem_virtual_to_physical (vm, pool->physmem_region, b->data);
}
+always_inline uword
+vlib_buffer_get_current_pa (vlib_main_t * vm, vlib_buffer_t * b)
+{
+ return vlib_buffer_get_pa (vm, b) + b->current_data;
+}
+
/** \brief Prefetch buffer metadata by buffer index
The first 64 bytes of buffer contains most header information