Currently, pkt_sock->frame_offset for eth buffers is 2 bytes (assuming
pkt_buf is 32bit aligned).

Add some more headroom, to allow fast header expansion.

Signed-off-by: Shmulik Ladkani <[email protected]>
---
 platform/linux-generic/odp_packet_socket.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/platform/linux-generic/odp_packet_socket.c 
b/platform/linux-generic/odp_packet_socket.c
index 0492d1e988..14465a6fe5 100644
--- a/platform/linux-generic/odp_packet_socket.c
+++ b/platform/linux-generic/odp_packet_socket.c
@@ -96,10 +96,16 @@ static odp_spinlock_t raw_sockets_lock;
 #define ETHBUF_OFFSET (ODP_ALIGN_ROUNDUP(ODPH_ETHHDR_LEN, sizeof(uint32_t)) \
                                - ODPH_ETHHDR_LEN)
 
+/** Eth buffer headroom reserve */
+#define ETHBUF_RESERVE 32
+
 /** Round up buffer address to get a properly aliged eth buffer, i.e. aligned
  * so that the next header always starts at a 32bit aligned address.
+ * Allow some headroom in case header needs to grow.
  */
 #define ETHBUF_ALIGN(buf_ptr) ((uint8_t *)ODP_ALIGN_ROUNDUP_PTR((buf_ptr), \
+                               sizeof(uint32_t)) + \
+                               ODP_ALIGN_ROUNDUP(ETHBUF_RESERVE, \
                                sizeof(uint32_t)) + ETHBUF_OFFSET)
 
 
-- 
1.9.1


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to