mbox series

[API-NEXT,PATCHv3,0/5] Packet function inline

Message ID 20170209115352.16271-1-bill.fischofer@linaro.org
Headers show
Series Packet function inline | expand

Message

Bill Fischofer Feb. 9, 2017, 11:53 a.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%).

v3:
 * Add internal macro _odp_pkt_get() to simplify inline addressing
 * Rebased to API-NEXT. Note that this patch series applies on top of
   the pkt reference optimization patch:
   http://patches.opendataplane.org/patch/7879/

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     |  93 +++++++
 .../include/odp/api/plat/packet_flag_inlines_api.h |  41 +++
 .../include/odp/api/plat/packet_inlines.h          | 156 ++++++++++++
 .../include/odp/api/plat/packet_inlines_api.h      |  97 ++++++++
 .../include/odp/api/plat/packet_types.h            |  95 ++++++-
 .../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    |  91 ++-----
 platform/linux-generic/odp_packet.c                | 276 +++++++++------------
 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, 791 insertions(+), 381 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.11.0.295.gd7dffce