diff mbox

linux-generic: classification: use proper accessor to set packet length

Message ID 1465836387-32671-1-git-send-email-zoltan.kiss@linaro.org
State Accepted
Commit 165897bfd094d824e2dd83c968ad9fde28146ef9
Headers show

Commit Message

Zoltan Kiss June 13, 2016, 4:46 p.m. UTC
And repurpose packet_set_len() for this, as it is no longer used.
This was introduced by the following commit, and break compatibility with
ODP-DPDK:

bd18047a "linux-gen: pktio: don't allocate new packets in classifier"

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
 platform/linux-generic/include/odp_packet_internal.h | 4 ++--
 platform/linux-generic/odp_classification.c          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Bill Fischofer June 13, 2016, 8:21 p.m. UTC | #1
On Mon, Jun 13, 2016 at 11:46 AM, Zoltan Kiss <zoltan.kiss@linaro.org>
wrote:

> And repurpose packet_set_len() for this, as it is no longer used.
> This was introduced by the following commit, and break compatibility with
> ODP-DPDK:
>
> bd18047a "linux-gen: pktio: don't allocate new packets in classifier"
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  platform/linux-generic/include/odp_packet_internal.h | 4 ++--
>  platform/linux-generic/odp_classification.c          | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp_packet_internal.h
> b/platform/linux-generic/include/odp_packet_internal.h
> index d5ace12..a84a6f8 100644
> --- a/platform/linux-generic/include/odp_packet_internal.h
> +++ b/platform/linux-generic/include/odp_packet_internal.h
> @@ -278,9 +278,9 @@ static inline uint32_t packet_len(odp_packet_hdr_t
> *pkt_hdr)
>         return pkt_hdr->frame_len;
>  }
>
> -static inline void packet_set_len(odp_packet_t pkt, uint32_t len)
> +static inline void packet_set_len(odp_packet_hdr_t *pkt_hdr, uint32_t len)
>  {
> -       odp_packet_hdr(pkt)->frame_len = len;
> +       pkt_hdr->frame_len = len;
>  }
>
>  static inline int packet_parse_l2_not_done(odp_packet_hdr_t *pkt_hdr)
> diff --git a/platform/linux-generic/odp_classification.c
> b/platform/linux-generic/odp_classification.c
> index 7520bdc..d2cc081 100644
> --- a/platform/linux-generic/odp_classification.c
> +++ b/platform/linux-generic/odp_classification.c
> @@ -815,7 +815,7 @@ int cls_classify_packet(pktio_entry_t *entry, const
> uint8_t *base, uint16_t len,
>         cos_t *cos;
>
>         packet_parse_reset(pkt_hdr);
> -       pkt_hdr->frame_len = len;
> +       packet_set_len(pkt_hdr, len);
>
>         _odp_parse_common(pkt_hdr, base);
>         cos = cls_select_cos(entry, base, pkt_hdr);
> --
> 1.9.1
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Balasubramanian Manoharan June 14, 2016, 5:56 a.m. UTC | #2
Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Regards,
Bala


On 13 June 2016 at 22:16, Zoltan Kiss <zoltan.kiss@linaro.org> wrote:
> And repurpose packet_set_len() for this, as it is no longer used.
> This was introduced by the following commit, and break compatibility with
> ODP-DPDK:
>
> bd18047a "linux-gen: pktio: don't allocate new packets in classifier"
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
> ---
>  platform/linux-generic/include/odp_packet_internal.h | 4 ++--
>  platform/linux-generic/odp_classification.c          | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
> index d5ace12..a84a6f8 100644
> --- a/platform/linux-generic/include/odp_packet_internal.h
> +++ b/platform/linux-generic/include/odp_packet_internal.h
> @@ -278,9 +278,9 @@ static inline uint32_t packet_len(odp_packet_hdr_t *pkt_hdr)
>         return pkt_hdr->frame_len;
>  }
>
> -static inline void packet_set_len(odp_packet_t pkt, uint32_t len)
> +static inline void packet_set_len(odp_packet_hdr_t *pkt_hdr, uint32_t len)
>  {
> -       odp_packet_hdr(pkt)->frame_len = len;
> +       pkt_hdr->frame_len = len;
>  }
>
>  static inline int packet_parse_l2_not_done(odp_packet_hdr_t *pkt_hdr)
> diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
> index 7520bdc..d2cc081 100644
> --- a/platform/linux-generic/odp_classification.c
> +++ b/platform/linux-generic/odp_classification.c
> @@ -815,7 +815,7 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, uint16_t len,
>         cos_t *cos;
>
>         packet_parse_reset(pkt_hdr);
> -       pkt_hdr->frame_len = len;
> +       packet_set_len(pkt_hdr, len);
>
>         _odp_parse_common(pkt_hdr, base);
>         cos = cls_select_cos(entry, base, pkt_hdr);
> --
> 1.9.1
>
Maxim Uvarov June 14, 2016, 1:09 p.m. UTC | #3
Merged,
Maxim.

On 06/14/16 08:56, Bala Manoharan wrote:
> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
> Regards,
> Bala
>
>
> On 13 June 2016 at 22:16, Zoltan Kiss <zoltan.kiss@linaro.org> wrote:
>> And repurpose packet_set_len() for this, as it is no longer used.
>> This was introduced by the following commit, and break compatibility with
>> ODP-DPDK:
>>
>> bd18047a "linux-gen: pktio: don't allocate new packets in classifier"
>>
>> Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
>> ---
>>   platform/linux-generic/include/odp_packet_internal.h | 4 ++--
>>   platform/linux-generic/odp_classification.c          | 2 +-
>>   2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
>> index d5ace12..a84a6f8 100644
>> --- a/platform/linux-generic/include/odp_packet_internal.h
>> +++ b/platform/linux-generic/include/odp_packet_internal.h
>> @@ -278,9 +278,9 @@ static inline uint32_t packet_len(odp_packet_hdr_t *pkt_hdr)
>>          return pkt_hdr->frame_len;
>>   }
>>
>> -static inline void packet_set_len(odp_packet_t pkt, uint32_t len)
>> +static inline void packet_set_len(odp_packet_hdr_t *pkt_hdr, uint32_t len)
>>   {
>> -       odp_packet_hdr(pkt)->frame_len = len;
>> +       pkt_hdr->frame_len = len;
>>   }
>>
>>   static inline int packet_parse_l2_not_done(odp_packet_hdr_t *pkt_hdr)
>> diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
>> index 7520bdc..d2cc081 100644
>> --- a/platform/linux-generic/odp_classification.c
>> +++ b/platform/linux-generic/odp_classification.c
>> @@ -815,7 +815,7 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, uint16_t len,
>>          cos_t *cos;
>>
>>          packet_parse_reset(pkt_hdr);
>> -       pkt_hdr->frame_len = len;
>> +       packet_set_len(pkt_hdr, len);
>>
>>          _odp_parse_common(pkt_hdr, base);
>>          cos = cls_select_cos(entry, base, pkt_hdr);
>> --
>> 1.9.1
>>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://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 d5ace12..a84a6f8 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -278,9 +278,9 @@  static inline uint32_t packet_len(odp_packet_hdr_t *pkt_hdr)
 	return pkt_hdr->frame_len;
 }
 
-static inline void packet_set_len(odp_packet_t pkt, uint32_t len)
+static inline void packet_set_len(odp_packet_hdr_t *pkt_hdr, uint32_t len)
 {
-	odp_packet_hdr(pkt)->frame_len = len;
+	pkt_hdr->frame_len = len;
 }
 
 static inline int packet_parse_l2_not_done(odp_packet_hdr_t *pkt_hdr)
diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
index 7520bdc..d2cc081 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -815,7 +815,7 @@  int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base, uint16_t len,
 	cos_t *cos;
 
 	packet_parse_reset(pkt_hdr);
-	pkt_hdr->frame_len = len;
+	packet_set_len(pkt_hdr, len);
 
 	_odp_parse_common(pkt_hdr, base);
 	cos = cls_select_cos(entry, base, pkt_hdr);