Hi, Our path is: pktio = odp_packet_input(pkt); ifnet = ofp_get_ifnet_pktio(pktio);
(Our current workaround is to iterate through the list of interfaces to find which interface has this pktio.) You are saying: pktio_id = odp_packet_input_id(pkt); ifnet = ofp_get_ifnet_pktio_id(pktio_id); I guess we should use an array stored in a shared memory and use pktio_id as index to get interface. I wonder if there are more/less cache misses like this than accessing a context pointer from pktio? I don’t know when/where to connect. Can you send me the details? Regards, Bogdan From: Bill Fischofer [mailto:bill.fischo...@linaro.org] Sent: Friday, April 08, 2016 3:05 PM To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolai...@nokia.com>; Bogdan Pricope <bogdan.pric...@enea.com> Cc: lng-odp@lists.linaro.org Subject: Re: [lng-odp] [API-NEXT PATCH 1/3] api: pktio: add user context support for interfaces These are good points. Can we get OFP participation in Monday's ARCH call to discuss this? Alternately I'll put it on the agenda for Tuesday's public call. On Fri, Apr 8, 2016 at 6:57 AM, Savolainen, Petri (Nokia - FI/Espoo) <petri.savolai...@nokia.com<mailto:petri.savolai...@nokia.com>> wrote: I wonder what would be the HW offload here? Scheduler would prefetch queue context for odp_queue_t queues which may be millions, but pktio interfaces (or pktin/pktout queues) are few. Application could store/load/prefetch the context also itself before or after it polls an interface. I know the request comes from OFP which used to store interface struct pointer into pktio default queue context pointer. This could be solved also in other ways, e.g. introduce a pktio ID (0...max num pktios) which would be stored into packet (which is many time there anyway) and avoid two lookups inside implementation (ID->pktio handle ->context pointer). -Petri > -----Original Message----- > From: lng-odp > [mailto:lng-odp-boun...@lists.linaro.org<mailto:lng-odp-boun...@lists.linaro.org>] > On Behalf Of EXT > Bill Fischofer > Sent: Friday, April 08, 2016 12:22 AM > To: lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> > Subject: [lng-odp] [API-NEXT PATCH 1/3] api: pktio: add user context > support for interfaces > > Add the APIs odp_pktio_context() and odp_pktio_context_set() to permit > applications to associate contexts with PktIO interfaces. > > Suggested-by: Bogdan Pricope > <bogdan.pric...@enea.com<mailto:bogdan.pric...@enea.com>> > Signed-off-by: Bill Fischofer > <bill.fischo...@linaro.org<mailto:bill.fischo...@linaro.org>> > --- > include/odp/api/spec/packet_io.h | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/include/odp/api/spec/packet_io.h > b/include/odp/api/spec/packet_io.h > index 466cab6..4880432 100644 > --- a/include/odp/api/spec/packet_io.h > +++ b/include/odp/api/spec/packet_io.h > @@ -908,6 +908,27 @@ int odp_pktio_skip_set(odp_pktio_t pktio, uint32_t > offset); > int odp_pktio_headroom_set(odp_pktio_t pktio, uint32_t headroom); > > /** > + * Get pktio user context pointer > + * > + * @param pktio Pktio handle > + * > + * @return Pointer to the pktio user context > + * @retval NULL on failure > + */ > +void *odp_pktio_context(odp_pktio_t pktio); > + > +/** > + * Set pktio user context pointer > + * > + * @param pktio Pktio handle > + * @param context Address of the pktio context > + * > + * @retval 0 on success > + * @retval <0 on failure > + */ > +int odp_pktio_context_set(odp_pktio_t pktio, void *context); > + > +/** > * Get printable value for an odp_pktio_t > * > * @param pktio odp_pktio_t handle to be printed > -- > 2.5.0 > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org<mailto:lng-odp@lists.linaro.org> > https://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp