mbox series

[v2,0/5] Packet function inline

Message ID 1486556256-22167-1-git-send-email-petri.savolainen@linaro.org
Headers show
Series Packet function inline | expand

Message

Petri Savolainen Feb. 8, 2017, 12:17 p.m. UTC
First set of packet and packet flag functions are inlined. Inline functions are
used (can be used) internally always, but are exposed through API only when 
builing for non-ABI compatibility.

Packet handle value is changed from index(es) to a packet header pointer. 
Packet/buffer header structure or other internal types are not exposed to 
applications, but offsets to header fields are used instead.

Ticketlock inlining was changed to the same file structure, which allows now 
also application to use inlined functions.

Performance is improved significantly on both packet microbench 
(e.g. odp_packet_len() from 9 to 4 cycles per call) and l2fwd 
(packet rate +20%).

v2:
 * Moved test code changes into a separate patch set


Petri Savolainen (5):
  linux-gen: inline: rename _STATIC to _ODP_INLINE
  linux-gen: ticketlock: inline also in application
  linux-gen: packet: packet handle is hdr pointer
  linux-gen: packet: inline functions
  linux-gen: packet: inline flag functions

 platform/linux-generic/Makefile.am                 |   5 +
 platform/linux-generic/include/odp/api/packet.h    |  11 +-
 .../linux-generic/include/odp/api/packet_flags.h   |  11 +-
 .../include/odp/api/plat/atomic_inlines.h          | 114 +++++----
 .../include/odp/api/plat/byteorder_inlines.h       |  24 +-
 .../include/odp/api/plat/packet_flag_inlines.h     |  90 +++++++
 .../include/odp/api/plat/packet_flag_inlines_api.h |  41 +++
 .../include/odp/api/plat/packet_inlines.h          | 173 +++++++++++++
 .../include/odp/api/plat/packet_inlines_api.h      | 113 +++++++++
 .../include/odp/api/plat/packet_types.h            |  87 ++++++-
 .../include/odp/api/plat/static_inline.h.in        |   8 +-
 .../include/odp/api/plat/std_clib_inlines.h        |   6 +-
 .../include/odp/api/plat/sync_inlines.h            |   6 +-
 .../include/odp/api/plat/ticketlock_inlines.h      |  19 +-
 .../include/odp/api/plat/ticketlock_inlines_api.h  |  36 +++
 .../linux-generic/include/odp/api/ticketlock.h     |   4 +
 .../linux-generic/include/odp_packet_internal.h    |  57 +----
 platform/linux-generic/odp_packet.c                | 278 ++++++++-------------
 platform/linux-generic/odp_packet_flags.c          |  41 +--
 platform/linux-generic/odp_ticketlock.c            |  24 +-
 platform/linux-generic/pktio/dpdk.c                |   5 +-
 platform/linux-generic/pktio/netmap.c              |   5 +-
 test/common_plat/performance/Makefile.am           |   4 +
 23 files changed, 788 insertions(+), 374 deletions(-)
 create mode 100644 platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h
 create mode 100644 platform/linux-generic/include/odp/api/plat/packet_flag_inlines_api.h
 create mode 100644 platform/linux-generic/include/odp/api/plat/packet_inlines.h
 create mode 100644 platform/linux-generic/include/odp/api/plat/packet_inlines_api.h
 create mode 100644 platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h

-- 
2.8.1

Comments

Savolainen, Petri (Nokia - FI/Espoo) Feb. 21, 2017, 8:37 a.m. UTC | #1
Ping. This can be merged to master now, since there's no merge conflicts between this one and the copy based reference code.

-Petri

> -----Original Message-----

> From: Bill Fischofer [mailto:bill.fischofer@linaro.org]

> Sent: Thursday, February 09, 2017 1:59 PM

> To: Petri Savolainen <petri.savolainen@linaro.org>

> Cc: lng-odp-forward <lng-odp@lists.linaro.org>

> Subject: Re: [lng-odp] [PATCH v2 0/5] Packet function inline

> 

> For this series:

> 

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

> 

> Note: The rebase of this series onto api-next is non-trivial and not

> something that's reasonable to do as part of merge processing. To

> address this I've posted a v3 of this series that is properly rebased

> on top of api-next + the packet ref optimization patch

> http://patches.opendataplane.org/patch/7879/

> 

> On Wed, Feb 8, 2017 at 6:17 AM, Petri Savolainen

> <petri.savolainen@linaro.org> wrote:

> > First set of packet and packet flag functions are inlined. Inline

> functions are

> > used (can be used) internally always, but are exposed through API only

> when

> > builing for non-ABI compatibility.

> >

> > Packet handle value is changed from index(es) to a packet header

> pointer.

> > Packet/buffer header structure or other internal types are not exposed

> to

> > applications, but offsets to header fields are used instead.

> >

> > Ticketlock inlining was changed to the same file structure, which allows

> now

> > also application to use inlined functions.

> >

> > Performance is improved significantly on both packet microbench

> > (e.g. odp_packet_len() from 9 to 4 cycles per call) and l2fwd

> > (packet rate +20%).

> >

> > v2:

> >  * Moved test code changes into a separate patch set

> >

> >

> > Petri Savolainen (5):

> >   linux-gen: inline: rename _STATIC to _ODP_INLINE

> >   linux-gen: ticketlock: inline also in application

> >   linux-gen: packet: packet handle is hdr pointer

> >   linux-gen: packet: inline functions

> >   linux-gen: packet: inline flag functions