From patchwork Thu Feb 9 11:53:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 93694 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp208467qgi; Thu, 9 Feb 2017 03:56:08 -0800 (PST) X-Received: by 10.237.56.68 with SMTP id j62mr2433121qte.185.1486641368299; Thu, 09 Feb 2017 03:56:08 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l81si7821861qkh.98.2017.02.09.03.56.08; Thu, 09 Feb 2017 03:56:08 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id EC9B7634C8; Thu, 9 Feb 2017 11:56:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 323E1634C9; Thu, 9 Feb 2017 11:54:12 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 93A2D62EB3; Thu, 9 Feb 2017 11:54:02 +0000 (UTC) Received: from mail-ot0-f180.google.com (mail-ot0-f180.google.com [74.125.82.180]) by lists.linaro.org (Postfix) with ESMTPS id 085AD60C1D for ; Thu, 9 Feb 2017 11:53:57 +0000 (UTC) Received: by mail-ot0-f180.google.com with SMTP id f9so976933otd.1 for ; Thu, 09 Feb 2017 03:53:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=y8VihJKeIdFxJ5T4rAWjaEvtQ/x6dAg4pwHp2Scm2xw=; b=cXqOIw/Xa20YJkYOr/sT72ugoxByFey2N64DKopN3fF1q0mxm2/2Ubvo3uoEccHySr g/GYCZ63liuyF/5lpDG33Qdk+gNdWBNduCsz2CnuYMuBt7DEhhFFD0J5Foj710URzb0Z Ux7s1jjPgcerqMaZ9Bkl6Ev6iKczo0LIcnUa4C6hoWqjeDdphdivR7hpvSR1IhhT9zCo vu80ocWbCpKcdGYs3hfJw7xWZ/pcCj11G8VkBEhJA6IxjZg8rycg0BHfTLTSpkK+KHdz dt/6eFdeQzoHUH1HzQBqXE/wMLNimew3MTZK5k9lnMFlGNLAPOU0r+bo9HR2UqA15ybb NqjQ== X-Gm-Message-State: AMke39kZEybyPeao602wtWWhl9pJXC1m1dfAZd9QRLvOgoPfKCeGUHBAWH74cgFeCEqpWR5zqbY= X-Received: by 10.157.33.46 with SMTP id i43mr1319920otb.220.1486641236425; Thu, 09 Feb 2017 03:53:56 -0800 (PST) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id t53sm5767383otd.6.2017.02.09.03.53.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 03:53:55 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 9 Feb 2017 05:53:47 -0600 Message-Id: <20170209115352.16271-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Subject: [lng-odp] [API-NEXT PATCHv3 0/5] Packet function inline X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" 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