[lng-odp-dpk,19/24] linux-dpdk: fixing validation bugs

Message ID 1491483222-32154-10-git-send-email-balakrishna.garapati@linaro.org
State New
Headers show
Series
  • Untitled series #123
Related show

Commit Message

Krishna Garapati April 6, 2017, 12:53 p.m.
Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
---
 platform/linux-dpdk/include/odp/api/plat/packet_types.h | 7 -------
 platform/linux-dpdk/odp_packet.c                        | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)

Comments

Yi He April 11, 2017, 6:16 a.m. | #1
On 6 April 2017 at 20:53, Balakrishna Garapati <
balakrishna.garapati@linaro.org> wrote:

> Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
> ---
>  platform/linux-dpdk/include/odp/api/plat/packet_types.h | 7 -------
>  platform/linux-dpdk/odp_packet.c                        | 2 +-
>  2 files changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_types.h
> b/platform/linux-dpdk/include/odp/api/plat/packet_types.h
> index af8b422..1043d58 100644
> --- a/platform/linux-dpdk/include/odp/api/plat/packet_types.h
> +++ b/platform/linux-dpdk/include/odp/api/plat/packet_types.h
> @@ -18,11 +18,6 @@
>  extern "C" {
>  #endif
>
> -#include <odp/api/plat/static_inline.h>
> -#if ODP_ABI_COMPAT == 1
> -#include <odp/api/abi/packet.h>
> -#else
> -
>

In [03/24] linux-dpdk: porting "abi: packet: added initial definitions",
these lines are added and here removed, may be can do some combination to
reduce the addition/removal?

 #include <odp/api/std_types.h>
>  #include <odp/api/plat/strong_types.h>
>
> @@ -53,8 +48,6 @@ typedef enum {
>   * @}
>   */
>
> -#endif
> -
>

In [03/24] linux-dpdk: porting "abi: packet: added initial definitions",
these lines are added and here removed, may be can do some combination to
reduce the addition/removal?


>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_
> packet.c
> index c52c892..7972970 100644
> --- a/platform/linux-dpdk/odp_packet.c
> +++ b/platform/linux-dpdk/odp_packet.c
> @@ -707,7 +707,7 @@ void *odp_packet_seg_data(odp_packet_t pkt
> ODP_UNUSED, odp_packet_seg_t seg)
>  uint32_t odp_packet_seg_data_len(odp_packet_t pkt ODP_UNUSED,
>                                  odp_packet_seg_t seg)
>  {
> -       return odp_packet_seg_len((odp_packet_t)&seg);
> +       return odp_packet_seg_len((odp_packet_t)(uintptr_t)seg);
>  }
>
>  /*
> --
> 1.9.1
>
> _______________________________________________
> lng-odp-dpdk mailing list
> lng-odp-dpdk@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp-dpdk
>
Krishna Garapati April 11, 2017, 10:55 a.m. | #2
On 11 April 2017 at 08:16, Yi He <yi.he@linaro.org> wrote:

>
>
> On 6 April 2017 at 20:53, Balakrishna Garapati <
> balakrishna.garapati@linaro.org> wrote:
>
>> Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
>> ---
>>  platform/linux-dpdk/include/odp/api/plat/packet_types.h | 7 -------
>>  platform/linux-dpdk/odp_packet.c                        | 2 +-
>>  2 files changed, 1 insertion(+), 8 deletions(-)
>>
>> diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_types.h
>> b/platform/linux-dpdk/include/odp/api/plat/packet_types.h
>> index af8b422..1043d58 100644
>> --- a/platform/linux-dpdk/include/odp/api/plat/packet_types.h
>> +++ b/platform/linux-dpdk/include/odp/api/plat/packet_types.h
>> @@ -18,11 +18,6 @@
>>  extern "C" {
>>  #endif
>>
>> -#include <odp/api/plat/static_inline.h>
>> -#if ODP_ABI_COMPAT == 1
>> -#include <odp/api/abi/packet.h>
>> -#else
>> -
>>
>
> In [03/24] linux-dpdk: porting "abi: packet: added initial definitions",
> these lines are added and here removed, may be can do some combination to
> reduce the addition/removal?
>
>  #include <odp/api/std_types.h>
>>  #include <odp/api/plat/strong_types.h>
>>
>> @@ -53,8 +48,6 @@ typedef enum {
>>   * @}
>>   */
>>
>> -#endif
>> -
>>
>
> In [03/24] linux-dpdk: porting "abi: packet: added initial definitions",
> these lines are added and here removed, may be can do some combination to
> reduce the addition/removal?
>
Thank you for raising the doubt.  Actually I need to discuss about this
change in ODP Arch call as it effects the abi compatibility. the issue is
odp_packet_seg_t has been defined as uint8_t variable in odp-linux where as
in liux-dpdk case it's a pointer type.

/Krishna

>
>
>>  #ifdef __cplusplus
>>  }
>>  #endif
>> diff --git a/platform/linux-dpdk/odp_packet.c
>> b/platform/linux-dpdk/odp_packet.c
>> index c52c892..7972970 100644
>> --- a/platform/linux-dpdk/odp_packet.c
>> +++ b/platform/linux-dpdk/odp_packet.c
>> @@ -707,7 +707,7 @@ void *odp_packet_seg_data(odp_packet_t pkt
>> ODP_UNUSED, odp_packet_seg_t seg)
>>  uint32_t odp_packet_seg_data_len(odp_packet_t pkt ODP_UNUSED,
>>                                  odp_packet_seg_t seg)
>>  {
>> -       return odp_packet_seg_len((odp_packet_t)&seg);
>> +       return odp_packet_seg_len((odp_packet_t)(uintptr_t)seg);
>>  }
>>
>>  /*
>> --
>> 1.9.1
>>
>> _______________________________________________
>> lng-odp-dpdk mailing list
>> lng-odp-dpdk@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp-dpdk
>>
>
>

Patch hide | download patch | download mbox

diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_types.h b/platform/linux-dpdk/include/odp/api/plat/packet_types.h
index af8b422..1043d58 100644
--- a/platform/linux-dpdk/include/odp/api/plat/packet_types.h
+++ b/platform/linux-dpdk/include/odp/api/plat/packet_types.h
@@ -18,11 +18,6 @@ 
 extern "C" {
 #endif
 
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 1
-#include <odp/api/abi/packet.h>
-#else
-
 #include <odp/api/std_types.h>
 #include <odp/api/plat/strong_types.h>
 
@@ -53,8 +48,6 @@  typedef enum {
  * @}
  */
 
-#endif
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c
index c52c892..7972970 100644
--- a/platform/linux-dpdk/odp_packet.c
+++ b/platform/linux-dpdk/odp_packet.c
@@ -707,7 +707,7 @@  void *odp_packet_seg_data(odp_packet_t pkt ODP_UNUSED, odp_packet_seg_t seg)
 uint32_t odp_packet_seg_data_len(odp_packet_t pkt ODP_UNUSED,
 				 odp_packet_seg_t seg)
 {
-	return odp_packet_seg_len((odp_packet_t)&seg);
+	return odp_packet_seg_len((odp_packet_t)(uintptr_t)seg);
 }
 
 /*