diff mbox

Remove packet l2/l3/l4 offset adjustments

Message ID 1418807557-17790-1-git-send-email-petri.savolainen@linaro.org
State Superseded
Headers show

Commit Message

Petri Savolainen Dec. 17, 2014, 9:12 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

Bill Fischofer Dec. 17, 2014, 11:32 a.m. UTC | #1
If we do this we really need a documentation note that says:

Note: After doing a head push/pull, applications cannot use routines like
odp_packet_l3_ptr(), etc., until they make appropriate  calls to
odp_packet_l3_offset_set(), etc., to reflect the previous operation.
Otherwise they will receive pointers to incorrect areas of the packet.

On Wed, Dec 17, 2014 at 3:12 AM, Petri Savolainen <
petri.savolainen@linaro.org> 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)
> --
> 2.2.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Ola Liljedahl Dec. 17, 2014, 11:42 a.m. UTC | #2
On 17 December 2014 at 12:32, Bill Fischofer <bill.fischofer@linaro.org> wrote:
> If we do this we really need a documentation note that says:
>
> Note: After doing a head push/pull, applications cannot use routines like
> odp_packet_l3_ptr(), etc., until they make appropriate  calls to
> odp_packet_l3_offset_set(), etc., to reflect the previous operation.
> Otherwise they will receive pointers to incorrect areas of the packet.
And since you set absolute Lx offset values, you need to first read
the different Lx offsets, pull a header and then reset the Lx offsets
(old offset - pull size). Complicated. Will require a lot of
boiler-plate code in the applications and many will get it wrong. Also
doesn't seem very efficient to me.

I think we should look at what the applications does and expects in
different situations and then define the API's that make the
applications simple.

>
> On Wed, Dec 17, 2014 at 3:12 AM, Petri Savolainen
> <petri.savolainen@linaro.org> 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)
>> --
>> 2.2.0
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Anders Roxell Dec. 17, 2014, 12:02 p.m. UTC | #3
On 17 December 2014 at 12:51, Savolainen, Petri (NSN - FI/Espoo)
<petri.savolainen@nsn.com> wrote:
> The API says already:
>
>
>
> “Operation does not modify packet segmentation or move data. Handles and
>
> pointers remain valid. User is responsible to update packet meta-data
>
> offsets when needed.”

We are still not consistent how we spell metadata.
$ git grep "metadata"
Binary file doc/images/overview.eps matches
platform/linux-generic/include/api/odp_buffer.h:#define
ODP_BUFFER_TYPE_RAW       1  /**< Raw buffer, no additional metadata
*/
platform/linux-generic/include/api/odp_buffer.h: * Print buffer
metadata to STDOUT
platform/linux-generic/include/api/odp_packet.h: * other packet
metadata are set to their default values.
platform/linux-generic/include/odp_buffer_internal.h:/* We can
optimize storage of small raw buffers within metadata area */
platform/linux-generic/include/odp_buffer_internal.h:           void
         *udata_addr; /* user metadata addr */
platform/linux-generic/include/odp_buffer_internal.h:   size_t
          udata_size; /* size of user metadata */
platform/linux-generic/include/odp_buffer_pool_internal.h: * buffer is
allocated to initialize the user metadata
platform/linux-generic/include/odp_buffer_pool_internal.h:      size_t
udata_size;         /**< Size of user metadata for each buffer */
platform/linux-generic/include/odp_packet_internal.h:   * Reset parser
metadata.  Note that we clear via memset to make
platform/linux-generic/include/odp_packet_internal.h:   * this routine
indepenent of any additional adds to packet metadata.
platform/linux-generic/odp_buffer_pool.c:       /* Calculate space
needed for buffer blocks and metadata */
platform/linux-generic/odp_buffer_pool.c:               /* Pool mdata
addr is used for indexing buffer metadata */
platform/linux-generic/odp_buffer_pool.c:                       /*
Iniitalize buffer metadata */
platform/linux-generic/odp_packet.c:    /* Reset parser metadata for
new parse */

 $ git grep "meta data"
platform/linux-generic/include/api/odp_classification.h: * flow
signature type, only used for packet meta data field.
platform/linux-generic/odp_packet.c:            /* Must copy meta data
first, followed by packet data */

 $ git grep meta-data
platform/linux-generic/include/api/odp_packet.h: *   and meta-data)
and thus is preserved over packet ownership changes.
platform/linux-generic/include/api/odp_packet.h: * Resets all packet
meta-data to their default values. Packet length is used
platform/linux-generic/include/api/odp_packet.h: * pointers remain
valid. User is responsible to update packet meta-data
platform/linux-generic/include/api/odp_packet.h: * pointers remain
valid. User is responsible to update packet meta-data
platform/linux-generic/include/api/odp_packet.h: * pointers remain
valid. User is responsible to update packet meta-data
platform/linux-generic/include/api/odp_packet.h: * after the
operation. User is responsible to update packet meta-data offsets
platform/linux-generic/include/api/odp_packet.h: * after the
operation. User is responsible to update packet meta-data offsets
platform/linux-generic/include/api/odp_packet.h: * packet (incl. data
and meta-data). The pool must have been created with


We should choose one spelling and I propose this again:
http://en.wikipedia.org/wiki/Metadata

Cheers,
Anders

>
>
>
> If application modifies packet headers (adds/removes/changes them), it must
> update those offsets that it or some other block after it in the chain cares
> about (reloads from the packet). It may leave some offsets unchanged because
> it knows that those are not needed any more.
>
>
>
> Some more words can be added, if the current text is not clear enough. The
> current implementation does not implement the spec. This patch fixes that
> issue.
>
>
>
>
>
> -Petri
>
>
>
>
>
>
>
>
>
> From: ext Bill Fischofer [mailto:bill.fischofer@linaro.org]
> Sent: Wednesday, December 17, 2014 1:33 PM
> To: Petri Savolainen
> Cc: lng-odp-forward
> Subject: Re: [lng-odp] [PATCH] Remove packet l2/l3/l4 offset adjustments
>
>
>
> If we do this we really need a documentation note that says:
>
>
>
> Note: After doing a head push/pull, applications cannot use routines like
> odp_packet_l3_ptr(), etc., until they make appropriate  calls to
> odp_packet_l3_offset_set(), etc., to reflect the previous operation.
> Otherwise they will receive pointers to incorrect areas of the packet.
>
>
>
> On Wed, Dec 17, 2014 at 3:12 AM, Petri Savolainen
> <petri.savolainen@linaro.org> 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)
> --
> 2.2.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Bill Fischofer Dec. 17, 2014, 12:05 p.m. UTC | #4
You are correct that the API states this. What others are pointing out are
the non-intutive implications of choosing to define the API this way.
You've not provided a convincing rationale for making this choice.   While
you can assert your right not to do so, it would be helpful to others if
you did.

On Wed, Dec 17, 2014 at 5:51 AM, Savolainen, Petri (NSN - FI/Espoo) <
petri.savolainen@nsn.com> wrote:
>
>  The API says already:
>
>
>
> “Operation does not modify packet segmentation or move data. Handles and
>
> pointers remain valid. *User is responsible to update packet meta-data*
>
> *offsets* when needed.”
>
>
>
> If application modifies packet headers (adds/removes/changes them), it
> must update those offsets that it or some other block after it in the chain
> cares about (reloads from the packet). It may leave some offsets unchanged
> because it knows that those are not needed any more.
>
>
>
> Some more words can be added, if the current text is not clear enough. The
> current implementation does not implement the spec. This patch fixes that
> issue.
>
>
>
>
>
> -Petri
>
>
>
>
>
>
>
>
>
> *From:* ext Bill Fischofer [mailto:bill.fischofer@linaro.org]
> *Sent:* Wednesday, December 17, 2014 1:33 PM
> *To:* Petri Savolainen
> *Cc:* lng-odp-forward
> *Subject:* Re: [lng-odp] [PATCH] Remove packet l2/l3/l4 offset adjustments
>
>
>
> If we do this we really need a documentation note that says:
>
>
>
> Note: After doing a head push/pull, applications cannot use routines like
> odp_packet_l3_ptr(), etc., until they make appropriate  calls to
> odp_packet_l3_offset_set(), etc., to reflect the previous operation.
> Otherwise they will receive pointers to incorrect areas of the packet.
>
>
>
> On Wed, Dec 17, 2014 at 3:12 AM, Petri Savolainen <
> petri.savolainen@linaro.org> 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)
> --
> 2.2.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Ola Liljedahl Dec. 17, 2014, 12:11 p.m. UTC | #5
On 17 December 2014 at 12:51, Savolainen, Petri (NSN - FI/Espoo)
<petri.savolainen@nsn.com> wrote:
> The API says already:
>
>
>
> “Operation does not modify packet segmentation or move data. Handles and
>
> pointers remain valid. User is responsible to update packet meta-data
>
> offsets when needed.”
But does the application get the proper tools for (simple and
efficient) updating of the packet meta-data offsets?

Pull makes a relative change (subtract N). Set offset do not make
relative changes. This forces the user to read the offsets, pull the
header and then set the offsets(old_offset - N). The application needs
to be aware of all meta-data fields that need to updated. What if we
add more meta-data fields of the offset type?

>
>
>
> If application modifies packet headers (adds/removes/changes them), it must
> update those offsets that it or some other block after it in the chain cares
> about (reloads from the packet). It may leave some offsets unchanged because
> it knows that those are not needed any more.
>
>
>
> Some more words can be added, if the current text is not clear enough. The
> current implementation does not implement the spec. This patch fixes that
> issue.
I think we have the wrong spec. Pulling headers should not make the
remaining packet Lx offsets invalid.

>
>
>
>
>
> -Petri
>
>
>
>
>
>
>
>
>
> From: ext Bill Fischofer [mailto:bill.fischofer@linaro.org]
> Sent: Wednesday, December 17, 2014 1:33 PM
> To: Petri Savolainen
> Cc: lng-odp-forward
> Subject: Re: [lng-odp] [PATCH] Remove packet l2/l3/l4 offset adjustments
>
>
>
> If we do this we really need a documentation note that says:
>
>
>
> Note: After doing a head push/pull, applications cannot use routines like
> odp_packet_l3_ptr(), etc., until they make appropriate  calls to
> odp_packet_l3_offset_set(), etc., to reflect the previous operation.
> Otherwise they will receive pointers to incorrect areas of the packet.
>
>
>
> On Wed, Dec 17, 2014 at 3:12 AM, Petri Savolainen
> <petri.savolainen@linaro.org> 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)
> --
> 2.2.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Bill Fischofer Dec. 17, 2014, 12:39 p.m. UTC | #6
While ODP may not know why an application is choosing to make a specific
push/pull request, the implications of any given call are precise.  After
pushing the head by X bytes, all of the other packet offset metadata are
now in error until and unless they are adjusted.  If it is part of the API
definition that the implementation MUST NOT assist in these adjustments,
then there are several implications:

1. Other ODP APIs that reference these now-erroneous metadata are
invalidated and will silently return incorrect values.  Does this help
promote good programming?

2. The application takes responsibility for knowing which metadata items
have been invalidated, even if additional metadata is added to ODP in
subsequent releases.  How does it know this?

3. As has been pointed out, since the API does not provide relative offset
adjustment APIs, for an application to adjust a given offset value
correctly, it must read/modify/write each individually.  Hardly efficient.

4.  Implementations that support push/pull operations with HW assistance
may need to add special code to undo any automatic metadata adjustments to
comply with the API.

So it's not at all clear how the application benefits from this stipulation
or how it would be harmed if it was the implementations responsibility to
maintain the system metadata in a consistent state.

On Wed, Dec 17, 2014 at 6:24 AM, Savolainen, Petri (NSN - FI/Espoo) <
petri.savolainen@nsn.com> wrote:
>
>
>
> Once again. There’s no point of implementation speculating what will
> happen to the packet after the pull/push operation. Which L2/L3/L4/…
> offsets are going to be changed and in which direction? Between which
> headers the application is going to add/remove layers? What header are
> moved?  What happens next in the chain? What offsets really need an update?
> Application has all that knowledge and can do only those updates that are
> needed. We keep it simple – if application modifies the packet it is
> responsible to maintain metadata offsets accurate.
>
>
>
> -Petri
>
>
>
>
>
>
>
> *From:* ext Bill Fischofer [mailto:bill.fischofer@linaro.org]
> *Sent:* Wednesday, December 17, 2014 2:06 PM
> *To:* Savolainen, Petri (NSN - FI/Espoo)
> *Cc:* Petri Savolainen; lng-odp-forward
>
> *Subject:* Re: [lng-odp] [PATCH] Remove packet l2/l3/l4 offset adjustments
>
>
>
> You are correct that the API states this. What others are pointing out are
> the non-intutive implications of choosing to define the API this way.
> You've not provided a convincing rationale for making this choice.   While
> you can assert your right not to do so, it would be helpful to others if
> you did.
>
>
>
> On Wed, Dec 17, 2014 at 5:51 AM, Savolainen, Petri (NSN - FI/Espoo) <
> petri.savolainen@nsn.com> wrote:
>
> The API says already:
>
>
>
> “Operation does not modify packet segmentation or move data. Handles and
>
> pointers remain valid. *User is responsible to update packet meta-data*
>
> *offsets* when needed.”
>
>
>
> If application modifies packet headers (adds/removes/changes them), it
> must update those offsets that it or some other block after it in the chain
> cares about (reloads from the packet). It may leave some offsets unchanged
> because it knows that those are not needed any more.
>
>
>
> Some more words can be added, if the current text is not clear enough. The
> current implementation does not implement the spec. This patch fixes that
> issue.
>
>
>
>
>
> -Petri
>
>
>
>
>
>
>
>
>
> *From:* ext Bill Fischofer [mailto:bill.fischofer@linaro.org]
> *Sent:* Wednesday, December 17, 2014 1:33 PM
> *To:* Petri Savolainen
> *Cc:* lng-odp-forward
> *Subject:* Re: [lng-odp] [PATCH] Remove packet l2/l3/l4 offset adjustments
>
>
>
> If we do this we really need a documentation note that says:
>
>
>
> Note: After doing a head push/pull, applications cannot use routines like
> odp_packet_l3_ptr(), etc., until they make appropriate  calls to
> odp_packet_l3_offset_set(), etc., to reflect the previous operation.
> Otherwise they will receive pointers to incorrect areas of the packet.
>
>
>
> On Wed, Dec 17, 2014 at 3:12 AM, Petri Savolainen <
> petri.savolainen@linaro.org> 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)
> --
> 2.2.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
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)