From patchwork Thu Sep 14 21:00:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 112654 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp1047361edb; Thu, 14 Sep 2017 14:13:29 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBP/UIWTJqtgmGBDSYI2utwwVWEu6C7Yhc49BxzGHLcPWitPy/8jLhVyg+cj4N9tx9WQFj3 X-Received: by 10.200.15.13 with SMTP id e13mr33182052qtk.295.1505423609460; Thu, 14 Sep 2017 14:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505423609; cv=none; d=google.com; s=arc-20160816; b=BU2zWEIgbdPE+cjfuOUeE6smt9TArKb6tZSrA3ddTDYY+zXpvzauW+iKPbpdhK6I8Q VHyXOZSVrwX54D8l/uLrAemoefej2KGtpcmauBUY8wUuJvgkJUxt1g+NHLhMOOLM/WNR gRdyCyjpv7S8k2/uDslr18s+tIrAgzgq1yupRwIjyzxrbdK2KnO2wopVf/XbiM2FY2VP shlFwEplRtIyE6ROxkr+CG+BCznWsbYr88mIfD6Kr8Ex+jeGpz4hAiCY46frwkT+ri0P yKbVfe4OHbgHLHvUFiqVUpbT7zT44ZGNDopRUR0yBn3zRkLYqab4dpEYgRacS3RTdA69 TGBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=POuzboPe6XpsX3qB1mMa6r9OmwIb7WAH52dxOO8XYd8=; b=cLXQ0Llz4dh1G8+3Bc0/NymYzrJOqIbLAb/OC8Xf2vwJmFpVP3pcw9nfNt0LAnc7uQ TDaNmGKIAwhxhm0VzOQ/iesx9lM3qXE8eyk7wHF5c6kR4sfxBrOXNH51E7gFYCEfnCH2 p4CqDZO4fseJslIQQJ1m51iwkZ5CiidAMTaSjbnGbQ5jqZZZP+iePj/TkZ0Yv6+ud9CK d97foYWYE+K4JAs/oiI7YlE2yNXZBYKHJ1CvhJvT6vi9Xpnb1xYakAiqkni2FqspMK6M 8aw3SZS8MS4BIxvvkvrSIJCT3scgt0n+ITxJKmHgDTsz1pf3quqwJIQiavv+Gd/Wcvxg Bo9A== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z126si17220599qkc.72.2017.09.14.14.13.29; Thu, 14 Sep 2017 14:13:29 -0700 (PDT) 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 03C29609E5; Thu, 14 Sep 2017 21:13:28 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 B208D60B4E; Thu, 14 Sep 2017 21:02:45 +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 3F82E608E6; Thu, 14 Sep 2017 21:02:36 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 3A39B60943 for ; Thu, 14 Sep 2017 21:00:30 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 229A32D8457B for ; Fri, 15 Sep 2017 00:00:29 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0Z4PLiuwlI-0TJWEm5n; Fri, 15 Sep 2017 00:00:29 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id wNwc7KZcGv-0SmmmBgj; Fri, 15 Sep 2017 00:00:28 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 15 Sep 2017 00:00:03 +0300 Message-Id: <1505422809-5632-14-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505422809-5632-1-git-send-email-odpbot@yandex.ru> References: <1505422809-5632-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 179 Subject: [lng-odp] [PATCH API-NEXT v1 13/19] linux-gen: buffer: optimize header layout 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" From: Petri Savolainen Pack most often used buffer header fields (including seg[0]) into the first cache line. Signed-off-by: Petri Savolainen Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov --- /** Email created from pull request 179 (muvarov:api-next) ** https://github.com/Linaro/odp/pull/179 ** Patch: https://github.com/Linaro/odp/pull/179.patch ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1 ** Merge commit sha: ada61f5ba5f940d03a95893940c21028d4c75d19 **/ .../linux-generic/include/odp_buffer_internal.h | 43 ++++++++++++---------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 309094658..0c873d2d2 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -43,41 +43,46 @@ typedef struct seg_entry_t { /* Common buffer header */ struct odp_buffer_hdr_t { - /* Buffer index in the pool */ - uint32_t index; - /* Initial buffer data pointer and length */ - uint8_t *base_data; - uint8_t *buf_end; + /* Buffer index in the pool */ + uint32_t index; - /* Max data size */ - uint32_t size; + /* Total segment count */ + uint16_t segcount; /* Pool type */ int8_t type; - /* Burst counts */ - uint8_t burst_num; - uint8_t burst_first; - /* Number of seg[] entries used */ uint8_t num_seg; - /* Total segment count */ - uint32_t segcount; - /* Next header which continues the segment list */ void *next_seg; /* Last header of the segment list */ void *last_seg; + /* Initial buffer data pointer and length */ + uint8_t *base_data; + uint8_t *buf_end; + + /* --- 40 bytes --- */ + /* Segments */ seg_entry_t seg[CONFIG_PACKET_MAX_SEGS]; + /* Burst counts */ + uint8_t burst_num; + uint8_t burst_first; + /* Next buf in a list */ struct odp_buffer_hdr_t *next; + /* Burst table */ + struct odp_buffer_hdr_t *burst[BUFFER_BURST_SIZE]; + + /* --- Mostly read only data --- */ + /* User context pointer or u64 */ union { uint64_t buf_u64; @@ -85,6 +90,9 @@ struct odp_buffer_hdr_t { const void *buf_cctx; /* const alias for ctx */ }; + /* Pool pointer */ + void *pool_ptr; + /* User area pointer */ void *uarea_addr; @@ -94,9 +102,6 @@ struct odp_buffer_hdr_t { /* Event type. Maybe different than pool type (crypto compl event) */ int8_t event_type; - /* Burst table */ - struct odp_buffer_hdr_t *burst[BUFFER_BURST_SIZE]; - /* ipc mapped process can not walk over pointers, * offset has to be used */ uint64_t ipc_data_offset; @@ -105,8 +110,8 @@ struct odp_buffer_hdr_t { * inlining */ odp_pool_t pool_hdl; - /* Pool pointer */ - void *pool_ptr; + /* Max data size */ + uint32_t size; /* Data or next header */ uint8_t data[0];