diff mbox

[v2] linux-generic: packet: Remove packet l2/l3/l4 offset adjustments

Message ID 1418814896-18189-1-git-send-email-petri.savolainen@linaro.org
State Accepted
Commit 8abace557d1dd98e46be51391fb3e45126c81268
Headers show

Commit Message

Petri Savolainen Dec. 17, 2014, 11:14 a.m. UTC
Packet head push/pull calls do not automatically adjust
metadata offsets, only data pointer and headroom.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 platform/linux-generic/include/odp_packet_internal.h | 8 --------
 1 file changed, 8 deletions(-)

Comments

Maxim Uvarov Dec. 19, 2014, 9:21 p.m. UTC | #1
Merged to staging to be release in 0.6.0.

Maxim.

On 12/17/2014 02:14 PM, Petri Savolainen wrote:
> Packet head push/pull calls do not automatically adjust
> metadata offsets, only data pointer and headroom.
>
> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
> ---
>   platform/linux-generic/include/odp_packet_internal.h | 8 --------
>   1 file changed, 8 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
> index a0eff30..18e69b3 100644
> --- a/platform/linux-generic/include/odp_packet_internal.h
> +++ b/platform/linux-generic/include/odp_packet_internal.h
> @@ -192,24 +192,16 @@ static inline void *packet_map(odp_packet_hdr_t *pkt_hdr,
>   			  pkt_hdr->headroom + pkt_hdr->frame_len);
>   }
>   
> -#define pull_offset(x, len) (x = x < len ? 0 : x - len)
> -
>   static inline void push_head(odp_packet_hdr_t *pkt_hdr, size_t len)
>   {
>   	pkt_hdr->headroom  -= len;
>   	pkt_hdr->frame_len += len;
> -	pkt_hdr->l2_offset += len;
> -	pkt_hdr->l3_offset += len;
> -	pkt_hdr->l4_offset += len;
>   }
>   
>   static inline void pull_head(odp_packet_hdr_t *pkt_hdr, size_t len)
>   {
>   	pkt_hdr->headroom  += len;
>   	pkt_hdr->frame_len -= len;
> -	pull_offset(pkt_hdr->l2_offset, len);
> -	pull_offset(pkt_hdr->l3_offset, len);
> -	pull_offset(pkt_hdr->l4_offset, len);
>   }
>   
>   static inline void push_tail(odp_packet_hdr_t *pkt_hdr, size_t len)
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
index a0eff30..18e69b3 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -192,24 +192,16 @@  static inline void *packet_map(odp_packet_hdr_t *pkt_hdr,
 			  pkt_hdr->headroom + pkt_hdr->frame_len);
 }
 
-#define pull_offset(x, len) (x = x < len ? 0 : x - len)
-
 static inline void push_head(odp_packet_hdr_t *pkt_hdr, size_t len)
 {
 	pkt_hdr->headroom  -= len;
 	pkt_hdr->frame_len += len;
-	pkt_hdr->l2_offset += len;
-	pkt_hdr->l3_offset += len;
-	pkt_hdr->l4_offset += len;
 }
 
 static inline void pull_head(odp_packet_hdr_t *pkt_hdr, size_t len)
 {
 	pkt_hdr->headroom  += len;
 	pkt_hdr->frame_len -= len;
-	pull_offset(pkt_hdr->l2_offset, len);
-	pull_offset(pkt_hdr->l3_offset, len);
-	pull_offset(pkt_hdr->l4_offset, len);
 }
 
 static inline void push_tail(odp_packet_hdr_t *pkt_hdr, size_t len)