On 02/28/17 15:55, Bill Fischofer wrote:
> 
> 
> On Tue, Feb 28, 2017 at 1:45 AM, Savolainen, Petri (Nokia - FI/Espoo)
> <petri.savolai...@nokia-bell-labs.com
> <mailto:petri.savolai...@nokia-bell-labs.com>> wrote:
> 
> 
> 
>     > -----Original Message-----
>     > From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org
>     <mailto:lng-odp-boun...@lists.linaro.org>] On Behalf Of Maxim
>     > Uvarov
>     > Sent: Monday, February 27, 2017 6:10 PM
>     > To: lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     > Subject: Re: [lng-odp] [PATCH 1/2] linux-gen: ipc: use hdr to handle
>     > conversion function
>     >
>     > On 02/27/17 19:02, Bill Fischofer wrote:
>     > > On Mon, Feb 27, 2017 at 9:57 AM, Petri Savolainen <
>     > > petri.savolai...@linaro.org
>     <mailto:petri.savolai...@linaro.org>> wrote:
>     > >
>     > >> Use conversion function instead of casting.
>     > >>
>     > >> Signed-off-by: Petri Savolainen <petri.savolai...@linaro.org
>     <mailto:petri.savolai...@linaro.org>>
>     > >> ---
>     > >>  platform/linux-generic/include/odp_packet_internal.h | 6 ++++++
>     > >>  platform/linux-generic/odp_packet.c                  | 5 -----
>     > >>  platform/linux-generic/pktio/ipc.c                   | 2 +-
>     > >>  3 files changed, 7 insertions(+), 6 deletions(-)
>     > >>
>     > >> diff --git a/platform/linux-generic/include/odp_packet_internal.h
>     > >> b/platform/linux-generic/include/odp_packet_internal.h
>     > >> index 4f844d1..7a394dd 100644
>     > >> --- a/platform/linux-generic/include/odp_packet_internal.h
>     > >> +++ b/platform/linux-generic/include/odp_packet_internal.h
>     > >> @@ -163,6 +163,12 @@ static inline odp_packet_hdr_t
>     > >> *odp_packet_hdr(odp_packet_t pkt)
>     > >>         return (odp_packet_hdr_t *)(uintptr_t)pkt;
>     > >>  }
>     > >>
>     > >> +/* Only one using this outside of packet.c is ipc.c */
>     > >>
>     > >
>     > > I'd delete this comment but otherwise this series looks good.
>     Who else
>     > is
>     > > using this function is potentially anyone who includes
>     packet_internal.h
>     > > and that will change over time.
>     > >
>     >
>     > +1 to remove.
>     >
>     > Maxim.
> 
>     It's there to remind that maybe IPC should not have this dependency
>     either. All other pktios manage to do their job without this
>     conversion. So, I'm not expecting anyone adding this call outside of
>     packet.c, but instead ipc.c to remove the call after which we can
>     move the function back into packet.c.
> 
> 
> If ipc can operate without that conversion then it can be converted now,
> but my understanding is that because it operates between ODP instances
> it's something of a special case. I'll add this topic to today's ODP call.
>  
> 
> 
>     -Petri
> 
> 

In ipc we can write something like:

odp_packet_t pkt;
void *mbase = pktio_entry->s.ipc.pool_mdata_base;

pkt = (odp_packet_t)((uint8_t *)mbase + offsets[i]);


But comment we need to remove due to other platforms can inherit packet
include with symlink and may not have ipc pktio. For them that comment
will be useless.

Maxim.

Reply via email to