From patchwork Fri Jul 7 13:32:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 107198 Delivered-To: patch@linaro.org Received: by 10.182.72.42 with SMTP id a10csp94187obv; Fri, 7 Jul 2017 06:35:50 -0700 (PDT) X-Received: by 10.55.50.208 with SMTP id y199mr2269618qky.174.1499434550857; Fri, 07 Jul 2017 06:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499434550; cv=none; d=google.com; s=arc-20160816; b=fVu4KQbfyZIwPkFKwpn4fsiile1WOX4pQsg6g6lR06jGGu0af/ZsXNkkvUPQ23+fDT 48lbE7OIH1odJuyZljJ0KDqXMP2ANdfopRNfz3GV+3WIAz1RXrz4vtGoBieG774uBEff sNdk5oNPhPLOFTRCn28umgLI/gheBCSXCMfORJwXoI3xlmtRS4D9FLst0CnQnJetHFXX n9d/NzIcybmhPGK6psDbTBhFymYqoiQiZbkt0wDSylnCH9nrl8qljbqGtjBa+mOj4nD3 lKEOt3wQRJOTLBJJuRIeRUWO+FSiE0pIVj4hsvd42AFuYcyy5Rad88BNYuCwD7o8PAQe QRvg== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=iPpkh5Ey3fe+HSOeNJ1HYGL8xjHKX9gM1qeUwYX7n84=; b=Z37sHngMtigZZGAYYYE5hMn3IburdOT1osAq7Voq83E+8HmZ02n/NWgkLurdJV+n18 HA4vICEpR5guQZVrGoQ/EBQM/GVIgpt5o9HrOSpI4WeH707s3mcqJWNg53cGE4CDnylY lYHtd4TOTSVi3q3YytGlrsT+nzyFOH4p4G7M7gDlEk2MBKLJsHX+PPp6cHsinLNkAoxj xjJen50o4dBwpmmiEiOK57KTnP9xNAX6QT/NWixfeLPWDlnoKPMDw2bsXn1bqsek2feb y0gc55hGuEqvX3gkJzBAxhvCKVs+xsZSl0cuj3t2bxdGtumixqnTktIU/2NhDgITC1WL C3eg== 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w56si3241991qth.384.2017.07.07.06.35.50; Fri, 07 Jul 2017 06:35:50 -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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 684B660D1A; Fri, 7 Jul 2017 13:35:50 +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=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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 B03A46156C; Fri, 7 Jul 2017 13:33:51 +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 1E79460D1A; Fri, 7 Jul 2017 13:33:32 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0103.outbound.protection.outlook.com [104.47.0.103]) by lists.linaro.org (Postfix) with ESMTPS id 57CA760A79 for ; Fri, 7 Jul 2017 13:33:01 +0000 (UTC) Received: from VI1PR07CA0075.eurprd07.prod.outlook.com (2a01:111:e400:5967::43) by DB5PR07MB1048.eurprd07.prod.outlook.com (2a01:111:e400:5108::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.6; Fri, 7 Jul 2017 13:32:58 +0000 Received: from VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::209) by VI1PR07CA0075.outlook.office365.com (2a01:111:e400:5967::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.4 via Frontend Transport; Fri, 7 Jul 2017 13:32:57 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by VE1EUR03FT064.mail.protection.outlook.com (10.152.19.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1220.9 via Frontend Transport; Fri, 7 Jul 2017 13:32:56 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v67DWKHi007678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 7 Jul 2017 16:32:20 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v67DWKBV007667 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 7 Jul 2017 16:32:20 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 7 Jul 2017 16:32:17 +0300 Message-ID: <20170707133219.1611-2-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170707133219.1611-1-petri.savolainen@linaro.org> References: <20170707133219.1611-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; SCL:-1; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39840400002)(39410400002)(39450400003)(39400400002)(39860400002)(2980300002)(199003)(189002)(9170700003)(498600001)(189998001)(2351001)(50466002)(47776003)(33646002)(2906002)(8676002)(86362001)(575784001)(305945005)(5660300001)(106466001)(356003)(105596002)(48376002)(50986999)(53936002)(50226002)(76176999)(81166006)(36756003)(2950100002)(6916009)(6666003)(5003940100001)(8936002)(77096006)(1076002)(110136004)(626005)(38730400002)(22756006); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB1048; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VE1EUR03FT064; 1:uintc15oU7wLw5+AXHqmQSSw6JUYE7vXZsPS+oCJo4IbBgfio62NQoz9toNy8+CmX8+oQfS7nw7BE1ir7bjcI4F6gzOdeZSw4nGuc1Dx9iToSQJS/QJEvlr60rpAO9KggIZa7apeMzvlVHmuaFocsxw5tsPNNBphYTVMyPxSJITQbp/12wtvnc33PYy/9IXT9+TB5JK9i0AbmJ8vmRWXOI3P5QuSO0YmPFWiyZ2RAbyZB2phPgyQkLc79Av4GPw1JrcbnsJWNLYDe+nnAeTydmNN028O4sbsu4tNWMwEXriySOTzFqc9G/WkFPHl4Ngc7daS3tqY+0EzUVOSNVknFbX+Dg+ZdnPm8XPC4c/yVPkHPu16tCLasMnTOE5EVp05En+p4mhkbJj0ZXYiA8vJHp6uaBAkwwPGPQHoqREcCekNHE/hQZKnz/PluZBdn549t62QfquiOBKxja25lUnrhCT1LeXmyZeRXLPI967y2hhoni44CaNbx5CjF4rhNIeeuFrFTbVss7NGRmjxo67QtR1XPS+90nBFitl/Gf4sl8aE2h8Yk7rSmD/RranVSDfwSOHyAso49N7xBtvvZeyN09tBt7rs/zlkXQ5wxUvlsLNh/gy1FGOYZ6UEVz3AiIFGYS9UwaleTOOuJ+s2COgPrHlIc7ltfALkUHQJkCV+pQfsf8vnx01+EA100968wB6+f8XgpGp8Jy8G9R1g9AT9gHb6EiFwoX/s64Ry0PkNiq95XIQSw/uU2Y/bTizSdcH0wMSJoRdPaC+NDvdU31IfOFGVTdlnZ2QR5AoeW+c5hMW7tgzZtqA2SqO7O3IcRnV5IqZiF5mDLsOGq2EF1WskQw== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8941da3-a190-4275-39fe-08d4c53cadc4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB5PR07MB1048; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1048; 3:bZ4uIUB93qeP3t/+XMswhORnvYsol+VREYsYpoSN1z+dOYjaYsdqKHYlgtcATrwwQZMW1L5UUBlhVXFN4/p8MQKS/TYaGtmp2h3zte+a+mPPq1MngVobrqiOwxQv9wweVsHrkuOgvOX0x4Wt0huT3hyCHhQiBYrDm64oZla9j6BQlJva/PyC+Y9iW86tGupwiyavEtxGWLbmglhaP5/SzutuSH7WcY15R8pJsM6wNihmflRxIRpUSP9jD7Gd6GeFVYA9vFpZc80FLANQc4XfXEIISJxJoDWoCot77BU8pZ4X1PWy1X+OOjCaVbSCDefXsFRSz7JJKkfpGQZfZMKgtvdS1XM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PNSj1etdOLXOTM6kwqSz9X+3O7jW/2vK4F1PErXi9+60eeTcaTZI4Oo0n1eTAQtoGNvPxttymmhZ/Kzja7oNlji8+eNTCeUZ2anyiFA97NzOLOMC/0WcMokpDQMoOKzyuV6y1bj+dakaT6/qOngGmaxqshgTYe3LRg3uDC+3bzP0IJy8/g436jPMNTWUzetg== X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1048; 20:bP1i9HU3Nkez530KT0fCXrB4aMepyOYO7WBM7bHy5Ubd4qtSaOloVLo7GW2hPBcUsL+m3Nz3UMml6tY3FRv9O6HeFvqLXhenaJsNHH24NEt6FwTRkSRupxkYF8/nVAL+B3fN+4KE92sMi8fMnPGN5Ov8NOKzv4ph3NCkXZ4jOqLmYSX9q3wkGi8kAYIJN8c4zOFKMCs8D75gx5DiZVd70kLtXa7v6H7XWXXf3JdgKsUWqMGWdE921jBj6qzktGNGhvWgSodH1CmzKhoKjWpnXgX8ltKPzitd8Iq/f8g802Us96lTc1zI5zCoDn1fAEYlOn1CLYbGMizAVBSwSVNaDyBoABjxlDpR1CSIgmRwMiTLVl+/l8YtI/Zl6PwY1JA+a5Yxq/F/v+93DrITTn3zTmm3NE7O/Mwm23JPhGfgPBm5xp5o5ZTnoYUPnFF0mrWvNIXX2zUZ1A4h43oMowUZxlg2chYxzHBR6d/LtMuxfSFFgwOFv0NojoEf/QKys5THJbjJ1F6wh9pdBKl9BnyTRHcERBI3qsHHfp6bzxzPSDS2VpNGeK0pcvFMYnClN8l46Q+x8lxR6BYoVX3eITWjgaUqeEuO+oLk81yOFfoIZbQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(148574349560750); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(13021025)(5005006)(2017060910064)(13013025)(93006095)(93003095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123564025)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB5PR07MB1048; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB5PR07MB1048; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR07MB1048; 4:doee6xcaiJ9cqWHyy1QbSy/+kZqS3wgkVGy1HR3RUS?= xCjdeHt5Ca96h6qrWLKJ9ntv9Q/D0rf/MBe0oEQGJeYciYbeAODo5toXE8pmZYqgxMrkafkeAzrN7tUt7Qt/fvf3UiuYdL8Nun2DsVE4kA2giuNgLRPK8Vwetc3FU0o6kgbI2YVsm5iWsFgMBRrOX3eBo8Pl313fnLGYOaOJlxHkwyiKX+nZEHpi+rOLRk5WpvxTAq4ERDVd3z/IwP+RE0JV4eSpoZnJFrrXHPM4ZwhOc+940w6l17zQf/WaqOnuWQNrGBtrTXMqb7UtzQ4XlIAMuWxJ+STzzdUIH1jwT6g/R85bVYz45uWrZYbbEmBoDdqOXN2JUGxJIPJ2kSdRrDuVJiJjuaf5ownuI/1jYEThJhYIkkFWBal9wVS0D/DKzuNJOpEUo+syZqYUT9vA8IHle3NhyI4g0Eqc1I1DosfucRXZ9ofZoW1K+4LGYWrG31I+HIXzKRyKZfT4NbdaSfNhnzh4xKGAC4KsvqXzOaxqgR0r3p0J8JmrxrFSAAmp7egvZVcAVY9jN+CEm9FopUvN7ll3uE3YV+CZO+u6vuhlzQ2IHwSCik+Y1wd5i/jvOlnIQXlpMGSXMnTQHf5PmPyyDlLGf9NcyLO5yZdQzV6zURUjIi8NDG0B55iWVIBwbhgJNtmlTRRpAcYC+MGVIcrL+xXuZeEQwju1JNxv129p/pTSQ4s4MCCKdtf9UjnKx8SS8SeK/aA3cFLo/w45E7ZZQML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T+DUi5X4+LWD0wWxmbOudLaHftmp7UTTh/J9Z6Wym2QKgWY8dW/e6oNgFkP0V5uGxZQduFhv6c203/fG3NdQ/2TiitI/finCLjg= X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 13:32:56.8235 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB1048 Subject: [lng-odp] [PATCH 1/3] linux-gen: buffer: change buffer handle to pointer 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" Changed buffer, event and timeout handles to be pointers. Packet handles are already pointers. This enabled code optimization as some conversions may be removed and remaining once are just type casts. Signed-off-by: Petri Savolainen --- include/odp/arch/default/api/abi/buffer.h | 7 +- include/odp/arch/default/api/abi/event.h | 2 +- .../include/odp/api/plat/buffer_types.h | 6 +- .../include/odp/api/plat/event_types.h | 2 +- .../include/odp/api/plat/timer_types.h | 2 +- .../linux-generic/include/odp_buffer_inlines.h | 9 +- .../linux-generic/include/odp_buffer_internal.h | 23 ++-- .../linux-generic/include/odp_packet_internal.h | 5 +- platform/linux-generic/include/odp_pool_internal.h | 30 +----- platform/linux-generic/odp_buffer.c | 4 +- platform/linux-generic/odp_packet.c | 56 +++++----- platform/linux-generic/odp_pool.c | 120 +++++++++++---------- platform/linux-generic/odp_queue.c | 6 +- platform/linux-generic/odp_traffic_mngr.c | 2 +- platform/linux-generic/pktio/ipc.c | 11 +- 15 files changed, 126 insertions(+), 159 deletions(-) -- 2.13.0 diff --git a/include/odp/arch/default/api/abi/buffer.h b/include/odp/arch/default/api/abi/buffer.h index eec6f01f..d8bfc913 100644 --- a/include/odp/arch/default/api/abi/buffer.h +++ b/include/odp/arch/default/api/abi/buffer.h @@ -14,18 +14,13 @@ extern "C" { /** @internal Dummy type for strong typing */ typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_buffer_t; -/** @internal Dummy type for strong typing */ -typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_buffer_seg_t; - /** @ingroup odp_buffer * @{ */ typedef _odp_abi_buffer_t *odp_buffer_t; -typedef _odp_abi_buffer_seg_t *odp_buffer_seg_t; -#define ODP_BUFFER_INVALID ((odp_buffer_t)0xffffffff) -#define ODP_SEGMENT_INVALID ((odp_buffer_seg_t)0xffffffff) +#define ODP_BUFFER_INVALID ((odp_buffer_t)NULL) /** * @} diff --git a/include/odp/arch/default/api/abi/event.h b/include/odp/arch/default/api/abi/event.h index 4f6596b1..fd86f25c 100644 --- a/include/odp/arch/default/api/abi/event.h +++ b/include/odp/arch/default/api/abi/event.h @@ -22,7 +22,7 @@ typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_event_t; typedef _odp_abi_event_t *odp_event_t; -#define ODP_EVENT_INVALID ((odp_event_t)0xffffffff) +#define ODP_EVENT_INVALID ((odp_event_t)NULL) typedef enum odp_event_type_t { ODP_EVENT_BUFFER = 1, diff --git a/platform/linux-generic/include/odp/api/plat/buffer_types.h b/platform/linux-generic/include/odp/api/plat/buffer_types.h index 809768f3..8b79bb52 100644 --- a/platform/linux-generic/include/odp/api/plat/buffer_types.h +++ b/platform/linux-generic/include/odp/api/plat/buffer_types.h @@ -31,11 +31,7 @@ extern "C" { typedef ODP_HANDLE_T(odp_buffer_t); -#define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, 0xffffffff) - -typedef ODP_HANDLE_T(odp_buffer_seg_t); - -#define ODP_SEGMENT_INVALID ((odp_buffer_seg_t)ODP_BUFFER_INVALID) +#define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, NULL) /** * @} diff --git a/platform/linux-generic/include/odp/api/plat/event_types.h b/platform/linux-generic/include/odp/api/plat/event_types.h index a1aa0e45..559a2fa0 100644 --- a/platform/linux-generic/include/odp/api/plat/event_types.h +++ b/platform/linux-generic/include/odp/api/plat/event_types.h @@ -32,7 +32,7 @@ extern "C" { typedef ODP_HANDLE_T(odp_event_t); -#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff) +#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, NULL) typedef enum odp_event_type_t { ODP_EVENT_BUFFER = 1, diff --git a/platform/linux-generic/include/odp/api/plat/timer_types.h b/platform/linux-generic/include/odp/api/plat/timer_types.h index 8821bed6..a8891f11 100644 --- a/platform/linux-generic/include/odp/api/plat/timer_types.h +++ b/platform/linux-generic/include/odp/api/plat/timer_types.h @@ -38,7 +38,7 @@ typedef ODP_HANDLE_T(odp_timer_t); typedef ODP_HANDLE_T(odp_timeout_t); -#define ODP_TIMEOUT_INVALID _odp_cast_scalar(odp_timeout_t, 0xffffffff) +#define ODP_TIMEOUT_INVALID _odp_cast_scalar(odp_timeout_t, NULL) /** * @} diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index cf817d90..1dbc725b 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -23,9 +23,14 @@ odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf); void _odp_buffer_event_type_set(odp_buffer_t buf, int ev); int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf); -static inline odp_buffer_t odp_hdr_to_buf(odp_buffer_hdr_t *hdr) +static inline odp_buffer_t buf_from_buf_hdr(odp_buffer_hdr_t *hdr) { - return hdr->handle.handle; + return (odp_buffer_t)hdr; +} + +static inline odp_event_t event_from_buf_hdr(odp_buffer_hdr_t *hdr) +{ + return (odp_event_t)hdr; } #ifdef __cplusplus diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 076abe96..1e8a6486 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -33,25 +33,12 @@ extern "C" { #include #include -typedef union odp_buffer_bits_t { - odp_buffer_t handle; - - union { - uint32_t u32; - - struct { - uint32_t pool_id: 8; - uint32_t index: 24; - }; - }; -} odp_buffer_bits_t; - #define BUFFER_BURST_SIZE CONFIG_BURST_SIZE /* Common buffer header */ struct odp_buffer_hdr_t { - /* Handle union */ - odp_buffer_bits_t handle; + /* Buffer index in the pool */ + uint32_t index; /* Initial buffer data pointer and length */ uint8_t *base_data; @@ -104,9 +91,13 @@ struct odp_buffer_hdr_t { * offset has to be used */ uint64_t ipc_data_offset; - /* Pool handle */ + /* Pool handle: will be removed, used only for odp_packet_pool() + * inlining */ odp_pool_t pool_hdl; + /* Pool pointer */ + void *pool_ptr; + /* Data or next header */ uint8_t data[0]; }; diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index cdd139bb..ad499548 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -207,11 +207,8 @@ int packet_parse_layer(odp_packet_hdr_t *pkt_hdr, /* Reset parser metadata for a new parse */ void packet_parse_reset(odp_packet_hdr_t *pkt_hdr); -/* Convert a packet handle to a buffer handle */ -odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); - /* Convert a buffer handle to a packet handle */ -odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf); +odp_packet_t _odp_packet_from_buf_hdr(odp_buffer_hdr_t *buf_hdr); static inline int packet_hdr_has_l2(odp_packet_hdr_t *pkt_hdr) { diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index ebb779da..1fb55d7d 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -28,8 +28,7 @@ extern "C" { typedef struct pool_cache_t { uint32_t num; - - odp_buffer_t buf[CONFIG_POOL_CACHE_SIZE]; + uint32_t buf_index[CONFIG_POOL_CACHE_SIZE]; } pool_cache_t ODP_ALIGNED_CACHE; @@ -92,34 +91,9 @@ static inline pool_t *pool_entry_from_hdl(odp_pool_t pool_hdl) return &pool_tbl->pool[_odp_typeval(pool_hdl)]; } -static inline odp_buffer_hdr_t *pool_buf_hdl_to_hdr(pool_t *pool, - odp_buffer_t buf) -{ - odp_buffer_bits_t handle; - uint32_t index, block_offset; - odp_buffer_hdr_t *buf_hdr; - - handle.handle = buf; - index = handle.index; - block_offset = index * pool->block_size; - - /* clang requires cast to uintptr_t */ - buf_hdr = (odp_buffer_hdr_t *)(uintptr_t)&pool->base_addr[block_offset]; - - return buf_hdr; -} - static inline odp_buffer_hdr_t *buf_hdl_to_hdr(odp_buffer_t buf) { - odp_buffer_bits_t handle; - uint32_t pool_id; - pool_t *pool; - - handle.handle = buf; - pool_id = handle.pool_id; - pool = pool_entry(pool_id); - - return pool_buf_hdl_to_hdr(pool, buf); + return (odp_buffer_hdr_t *)(uintptr_t)buf; } int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/odp_buffer.c index 88c8140b..9c7dc1f5 100644 --- a/platform/linux-generic/odp_buffer.c +++ b/platform/linux-generic/odp_buffer.c @@ -41,6 +41,7 @@ uint32_t odp_buffer_size(odp_buffer_t buf) int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf) { odp_buffer_hdr_t *hdr; + pool_t *pool; int len = 0; if (!odp_buffer_is_valid(buf)) { @@ -49,12 +50,13 @@ int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf) } hdr = buf_hdl_to_hdr(buf); + pool = hdr->pool_ptr; len += snprintf(&str[len], n-len, "Buffer\n"); len += snprintf(&str[len], n-len, " pool %" PRIu64 "\n", - odp_pool_to_u64(hdr->pool_hdl)); + odp_pool_to_u64(pool->pool_hdl)); len += snprintf(&str[len], n-len, " addr %p\n", hdr->seg[0].data); len += snprintf(&str[len], n-len, diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index eb66af2d..e6de2558 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -54,7 +54,7 @@ static inline odp_packet_hdr_t *packet_hdr(odp_packet_t pkt) static inline odp_buffer_t buffer_handle(odp_packet_hdr_t *pkt_hdr) { - return pkt_hdr->buf_hdr.handle.handle; + return (odp_buffer_t)pkt_hdr; } static inline odp_packet_hdr_t *buf_to_packet_hdr(odp_buffer_t buf) @@ -62,6 +62,16 @@ static inline odp_packet_hdr_t *buf_to_packet_hdr(odp_buffer_t buf) return (odp_packet_hdr_t *)buf_hdl_to_hdr(buf); } +odp_packet_t _odp_packet_from_buf_hdr(odp_buffer_hdr_t *buf_hdr) +{ + return (odp_packet_t)buf_hdr; +} + +static inline odp_buffer_t packet_to_buffer(odp_packet_t pkt) +{ + return (odp_buffer_t)pkt; +} + static inline uint32_t packet_seg_len(odp_packet_hdr_t *pkt_hdr, uint32_t seg_idx) { @@ -617,7 +627,7 @@ void odp_packet_free_multi(const odp_packet_t pkt[], int num) int odp_packet_reset(odp_packet_t pkt, uint32_t len) { odp_packet_hdr_t *const pkt_hdr = packet_hdr(pkt); - pool_t *pool = pool_entry_from_hdl(pkt_hdr->buf_hdr.pool_hdl); + pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; if (len > pool->headroom + pool->data_size + pool->tailroom) return -1; @@ -627,22 +637,6 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len) return 0; } -odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf) -{ - if (odp_unlikely(buf == ODP_BUFFER_INVALID)) - return ODP_PACKET_INVALID; - - return (odp_packet_t)buf_to_packet_hdr(buf); -} - -odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt) -{ - if (odp_unlikely(pkt == ODP_PACKET_INVALID)) - return ODP_BUFFER_INVALID; - - return buffer_handle(packet_hdr(pkt)); -} - odp_packet_t odp_packet_from_event(odp_event_t ev) { if (odp_unlikely(ev == ODP_EVENT_INVALID)) @@ -874,7 +868,7 @@ int odp_packet_extend_head(odp_packet_t *pkt, uint32_t len, int ret = 0; if (len > headroom) { - pool_t *pool = pool_entry_from_hdl(pkt_hdr->buf_hdr.pool_hdl); + pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; int num; int segs; @@ -1040,7 +1034,7 @@ int odp_packet_extend_tail(odp_packet_t *pkt, uint32_t len, int ret = 0; if (len > tailroom) { - pool_t *pool = pool_entry_from_hdl(pkt_hdr->buf_hdr.pool_hdl); + pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; int num; int segs; @@ -1337,12 +1331,13 @@ int odp_packet_add_data(odp_packet_t *pkt_ptr, uint32_t offset, uint32_t len) odp_packet_t pkt = *pkt_ptr; odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); uint32_t pktlen = pkt_hdr->frame_len; + pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; odp_packet_t newpkt; if (offset > pktlen) return -1; - newpkt = odp_packet_alloc(pkt_hdr->buf_hdr.pool_hdl, pktlen + len); + newpkt = odp_packet_alloc(pool->pool_hdl, pktlen + len); if (newpkt == ODP_PACKET_INVALID) return -1; @@ -1366,12 +1361,13 @@ int odp_packet_rem_data(odp_packet_t *pkt_ptr, uint32_t offset, uint32_t len) odp_packet_t pkt = *pkt_ptr; odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); uint32_t pktlen = pkt_hdr->frame_len; + pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; odp_packet_t newpkt; if (offset > pktlen || offset + len > pktlen) return -1; - newpkt = odp_packet_alloc(pkt_hdr->buf_hdr.pool_hdl, pktlen - len); + newpkt = odp_packet_alloc(pool->pool_hdl, pktlen - len); if (newpkt == ODP_PACKET_INVALID) return -1; @@ -1436,12 +1432,12 @@ int odp_packet_concat(odp_packet_t *dst, odp_packet_t src) { odp_packet_hdr_t *dst_hdr = packet_hdr(*dst); odp_packet_hdr_t *src_hdr = packet_hdr(src); - int dst_segs = dst_hdr->buf_hdr.segcount; - int src_segs = src_hdr->buf_hdr.segcount; - odp_pool_t dst_pool = dst_hdr->buf_hdr.pool_hdl; - odp_pool_t src_pool = src_hdr->buf_hdr.pool_hdl; - uint32_t dst_len = dst_hdr->frame_len; - uint32_t src_len = src_hdr->frame_len; + int dst_segs = dst_hdr->buf_hdr.segcount; + int src_segs = src_hdr->buf_hdr.segcount; + pool_t *dst_pool = dst_hdr->buf_hdr.pool_ptr; + pool_t *src_pool = src_hdr->buf_hdr.pool_ptr; + uint32_t dst_len = dst_hdr->frame_len; + uint32_t src_len = src_hdr->frame_len; /* Do a copy if resulting packet would be out of segments or packets * are from different pools. */ @@ -1703,7 +1699,7 @@ void odp_packet_print(odp_packet_t pkt) int len = 0; int n = max_len - 1; odp_packet_hdr_t *hdr = packet_hdr(pkt); - odp_buffer_t buf = _odp_packet_to_buffer(pkt); + odp_buffer_t buf = packet_to_buffer(pkt); len += snprintf(&str[len], n - len, "Packet "); len += odp_buffer_snprint(&str[len], n - len, buf); @@ -1751,7 +1747,7 @@ void odp_packet_print(odp_packet_t pkt) int odp_packet_is_valid(odp_packet_t pkt) { - if (odp_buffer_is_valid(_odp_packet_to_buffer(pkt)) == 0) + if (odp_buffer_is_valid(packet_to_buffer(pkt)) == 0) return 0; if (odp_event_type(odp_packet_to_event(pkt)) != ODP_EVENT_PACKET) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 9dba7341..7e0c7606 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -52,12 +52,32 @@ static inline odp_pool_t pool_index_to_handle(uint32_t pool_idx) return _odp_cast_scalar(odp_pool_t, pool_idx); } -static inline uint32_t pool_id_from_buf(odp_buffer_t buf) +static inline pool_t *pool_from_buf(odp_buffer_t buf) { - odp_buffer_bits_t handle; + odp_buffer_hdr_t *buf_hdr = buf_hdl_to_hdr(buf); - handle.handle = buf; - return handle.pool_id; + return buf_hdr->pool_ptr; +} + +static inline odp_buffer_hdr_t *buf_hdr_from_index(pool_t *pool, + uint32_t buffer_idx) +{ + uint32_t block_offset; + odp_buffer_hdr_t *buf_hdr; + + block_offset = buffer_idx * pool->block_size; + + /* clang requires cast to uintptr_t */ + buf_hdr = (odp_buffer_hdr_t *)(uintptr_t)&pool->base_addr[block_offset]; + + return buf_hdr; +} + +static inline uint32_t buf_index_from_hdl(odp_buffer_t buf) +{ + odp_buffer_hdr_t *buf_hdr = buf_hdl_to_hdr(buf); + + return buf_hdr->index; } int odp_pool_init_global(void) @@ -141,16 +161,14 @@ static void flush_cache(pool_cache_t *cache, pool_t *pool) { ring_t *ring; uint32_t mask; - uint32_t cache_num, i, data; + uint32_t cache_num, i; ring = &pool->ring->hdr; mask = pool->ring_mask; cache_num = cache->num; - for (i = 0; i < cache_num; i++) { - data = (uint32_t)(uintptr_t)cache->buf[i]; - ring_enq(ring, mask, data); - } + for (i = 0; i < cache_num; i++) + ring_enq(ring, mask, cache->buf_index[i]); cache->num = 0; } @@ -202,23 +220,11 @@ static pool_t *reserve_pool(void) return NULL; } -static odp_buffer_t form_buffer_handle(uint32_t pool_idx, uint32_t buffer_idx) -{ - odp_buffer_bits_t bits; - - bits.handle = 0; - bits.pool_id = pool_idx; - bits.index = buffer_idx; - - return bits.handle; -} - static void init_buffers(pool_t *pool) { uint32_t i; odp_buffer_hdr_t *buf_hdr; odp_packet_hdr_t *pkt_hdr; - odp_buffer_t buf_hdl; void *addr; void *uarea = NULL; uint8_t *data; @@ -256,10 +262,12 @@ static void init_buffers(pool_t *pool) seg_size = pool->headroom + pool->data_size + pool->tailroom; /* Initialize buffer metadata */ + buf_hdr->index = i; buf_hdr->size = seg_size; buf_hdr->type = type; buf_hdr->event_type = type; buf_hdr->pool_hdl = pool->pool_hdl; + buf_hdr->pool_ptr = pool; buf_hdr->uarea_addr = uarea; /* Show user requested size through API */ buf_hdr->uarea_size = pool->params.pkt.uarea_size; @@ -275,11 +283,8 @@ static void init_buffers(pool_t *pool) buf_hdr->buf_end = &data[offset + pool->data_size + pool->tailroom]; - buf_hdl = form_buffer_handle(pool->pool_idx, i); - buf_hdr->handle.handle = buf_hdl; - - /* Store buffer into the global pool */ - ring_enq(ring, mask, (uint32_t)(uintptr_t)buf_hdl); + /* Store buffer index into the global pool */ + ring_enq(ring, mask, i); } } @@ -600,7 +605,7 @@ int odp_pool_info(odp_pool_t pool_hdl, odp_pool_info_t *info) } int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], - odp_buffer_hdr_t *buf_hdr[], int max_num) + odp_buffer_hdr_t *buf_hdr_out[], int max_num) { ring_t *ring; uint32_t mask, i; @@ -626,10 +631,13 @@ int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], /* Get buffers from the cache */ for (i = 0; i < num_ch; i++) { - buf[i] = cache->buf[cache_num - num_ch + i]; + uint32_t j = cache_num - num_ch + i; + + hdr = buf_hdr_from_index(pool, cache->buf_index[j]); + buf[i] = buf_from_buf_hdr(hdr); - if (odp_likely(buf_hdr != NULL)) - buf_hdr[i] = pool_buf_hdl_to_hdr(pool, buf[i]); + if (odp_likely(buf_hdr_out != NULL)) + buf_hdr_out[i] = hdr; } /* If needed, get more from the global pool */ @@ -651,18 +659,18 @@ int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], for (i = 0; i < num_deq; i++) { uint32_t idx = num_ch + i; - buf[idx] = (odp_buffer_t)(uintptr_t)data[i]; - hdr = pool_buf_hdl_to_hdr(pool, buf[idx]); + hdr = buf_hdr_from_index(pool, data[i]); odp_prefetch(hdr); - if (odp_likely(buf_hdr != NULL)) - buf_hdr[idx] = hdr; + buf[idx] = buf_from_buf_hdr(hdr); + + if (odp_likely(buf_hdr_out != NULL)) + buf_hdr_out[idx] = hdr; } /* Cache extra buffers. Cache is currently empty. */ for (i = 0; i < cache_num; i++) - cache->buf[i] = (odp_buffer_t) - (uintptr_t)data[num_deq + i]; + cache->buf_index[i] = data[num_deq + i]; cache->num = cache_num; } else { @@ -672,26 +680,28 @@ int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], return num_ch + num_deq; } -static inline void buffer_free_to_pool(uint32_t pool_id, +static inline void buffer_free_to_pool(pool_t *pool, const odp_buffer_t buf[], int num) { - pool_t *pool; int i; ring_t *ring; uint32_t mask; pool_cache_t *cache; uint32_t cache_num; - cache = local.cache[pool_id]; - pool = pool_entry(pool_id); + cache = local.cache[pool->pool_idx]; /* Special case of a very large free. Move directly to * the global pool. */ if (odp_unlikely(num > CONFIG_POOL_CACHE_SIZE)) { + uint32_t buf_index[num]; + ring = &pool->ring->hdr; mask = pool->ring_mask; for (i = 0; i < num; i++) - ring_enq(ring, mask, (uint32_t)(uintptr_t)buf[i]); + buf_index[i] = buf_index_from_hdl(buf[i]); + + ring_enq_multi(ring, mask, buf_index, num); return; } @@ -718,8 +728,7 @@ static inline void buffer_free_to_pool(uint32_t pool_id, index = cache_num - burst; for (i = 0; i < burst; i++) - data[i] = (uint32_t) - (uintptr_t)cache->buf[index + i]; + data[i] = cache->buf_index[index + i]; ring_enq_multi(ring, mask, data, burst); } @@ -728,14 +737,14 @@ static inline void buffer_free_to_pool(uint32_t pool_id, } for (i = 0; i < num; i++) - cache->buf[cache_num + i] = buf[i]; + cache->buf_index[cache_num + i] = buf_index_from_hdl(buf[i]); cache->num = cache_num + num; } void buffer_free_multi(const odp_buffer_t buf[], int num_total) { - uint32_t pool_id; + pool_t *pool; int num; int i; int first = 0; @@ -743,18 +752,19 @@ void buffer_free_multi(const odp_buffer_t buf[], int num_total) while (1) { num = 1; i = 1; - pool_id = pool_id_from_buf(buf[first]); + + pool = pool_from_buf(buf[first]); /* 'num' buffers are from the same pool */ if (num_total > 1) { for (i = first; i < num_total; i++) - if (pool_id != pool_id_from_buf(buf[i])) + if (pool != pool_from_buf(buf[i])) break; num = i - first; } - buffer_free_to_pool(pool_id, &buf[first], num); + buffer_free_to_pool(pool, &buf[first], num); if (i == num_total) return; @@ -871,9 +881,9 @@ void odp_pool_print(odp_pool_t pool_hdl) odp_pool_t odp_buffer_pool(odp_buffer_t buf) { - uint32_t pool_id = pool_id_from_buf(buf); + pool_t *pool = pool_from_buf(buf); - return pool_index_to_handle(pool_id); + return pool->pool_hdl; } void odp_pool_param_init(odp_pool_param_t *params) @@ -901,15 +911,15 @@ void seg_free_tail(odp_buffer_hdr_t *buf_hdr, int segcount) int odp_buffer_is_valid(odp_buffer_t buf) { - odp_buffer_bits_t handle; pool_t *pool; - handle.handle = buf; - - if (handle.pool_id >= ODP_CONFIG_POOLS) + if (buf == ODP_BUFFER_INVALID) return 0; - pool = pool_entry(handle.pool_id); + pool = pool_from_buf(buf); + + if (pool->pool_idx >= ODP_CONFIG_POOLS) + return 0; if (pool->reserved == 0) return 0; diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index dd430cd1..3f6e7365 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -610,7 +610,7 @@ int odp_queue_deq_multi(odp_queue_t handle, odp_event_t events[], int num) ret = queue->s.dequeue_multi(queue, buf_hdr, num); for (i = 0; i < ret; i++) - events[i] = odp_buffer_to_event(buf_hdr[i]->handle.handle); + events[i] = event_from_buf_hdr(buf_hdr[i]); return ret; } @@ -625,7 +625,7 @@ odp_event_t odp_queue_deq(odp_queue_t handle) buf_hdr = queue->s.dequeue(queue); if (buf_hdr) - return odp_buffer_to_event(buf_hdr->handle.handle); + return event_from_buf_hdr(buf_hdr); return ODP_EVENT_INVALID; } @@ -734,7 +734,7 @@ int sched_cb_queue_deq_multi(uint32_t queue_index, odp_event_t ev[], int num) if (ret > 0) for (i = 0; i < ret; i++) - ev[i] = odp_buffer_to_event(buf_hdr[i]->handle.handle); + ev[i] = event_from_buf_hdr(buf_hdr[i]); return ret; } diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index a93b3ba9..80219296 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -107,7 +107,7 @@ static int queue_tm_reenq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr) odp_tm_queue_t tm_queue = MAKE_ODP_TM_QUEUE((uint8_t *)queue - offsetof(tm_queue_obj_t, tm_qentry)); - odp_packet_t pkt = _odp_packet_from_buffer(buf_hdr->handle.handle); + odp_packet_t pkt = _odp_packet_from_buf_hdr(buf_hdr); return odp_tm_enq(tm_queue, pkt); } diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 54e42227..ccfbbd66 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -562,12 +562,13 @@ static int ipc_pktio_send_lockless(pktio_entry_t *pktio_entry, for (i = 0; i < len; i++) { odp_packet_t pkt = pkt_table[i]; pool_t *ipc_pool = pool_entry_from_hdl(pktio_entry->s.ipc.pool); - odp_buffer_bits_t handle; - uint32_t pkt_pool_id; + odp_packet_hdr_t *pkt_hdr; + pool_t *pool; - handle.handle = _odp_packet_to_buffer(pkt); - pkt_pool_id = handle.pool_id; - if (pkt_pool_id != ipc_pool->pool_idx) { + pkt_hdr = odp_packet_hdr(pkt); + pool = pkt_hdr->buf_hdr.pool_ptr; + + if (pool->pool_idx != ipc_pool->pool_idx) { odp_packet_t newpkt; newpkt = odp_packet_copy(pkt, pktio_entry->s.ipc.pool); From patchwork Fri Jul 7 13:32:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 107196 Delivered-To: patch@linaro.org Received: by 10.182.72.42 with SMTP id a10csp91766obv; Fri, 7 Jul 2017 06:33:39 -0700 (PDT) X-Received: by 10.237.55.105 with SMTP id i96mr42298685qtb.139.1499434419818; Fri, 07 Jul 2017 06:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499434419; cv=none; d=google.com; s=arc-20160816; b=vl3/NgVT+ewiX5VRQSdCm+IJFTpEdJYHKXqUZt/Umb7ee+pNvhfK5C4V3Z7OLIMjPt bV/HO4g+lqOkfxNGwExRbZkiI5pLETxbXAWqW3HnZONb2NT7Wzz6BGdFGt7TdCI892sD I2F3xjepZAd9r338Y9p2+tJbS5ZcciQ1n3L/gEpooaJ/KDHRkk5f/j+TfY3K815QCK1Q YpxBgPAHq96yJ38L4iJ9v0V+sCD+uy3OX5Zu55bqIcH420bZuC3P/2k0NTGjYDPEGcNZ Efc2YhXPqrMpuyZ4ThneKRRcyDn0lZjZ416go4SUNsOo26VQRWgr24IXBNA5e/ko4Xqm SiRQ== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=GfGGHEcMtLgxR17FVpZ5vGJrYeYBsBEo6GoVFYQaXxE=; b=jRX1YsHzobI8xYvbPOBnqVCNS9dHMes0TGDleUSFwgW731wOXOucbccN8kIsouGvg1 zEpIew2qkcRFfw4K5IwqKjkIkG9RMbowf7Hi1WLZtHmhhNnEfsYSnEWkNkD+uIynAhxi CG5+dlBflzUKa9is8IclQcm6W9FAd4Km8k26tFrgaUTapsiCpoev8DLheLk0G9VVcTdf 84/tHXJy8PVEkfiM4upIxcTz8O/cFfgEfE+BrLiWbzCABfJOVsyG0ZM0YpfD/8LX4jxl ZOmhUFXjIeNrUKpbaL2OJP3gLRpU4vhTnfpThfgK7h9qDsvzDttfz/a7GdTCllxXgE0d ePxg== 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x128si3139547qke.211.2017.07.07.06.33.39; Fri, 07 Jul 2017 06:33:39 -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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8660160CE8; Fri, 7 Jul 2017 13:33:39 +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=-2.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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 4DF3660BFE; Fri, 7 Jul 2017 13:33:31 +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 E5F3660BFF; Fri, 7 Jul 2017 13:33:26 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0135.outbound.protection.outlook.com [104.47.2.135]) by lists.linaro.org (Postfix) with ESMTPS id 8CEA060C8B for ; Fri, 7 Jul 2017 13:32:54 +0000 (UTC) Received: from VI1PR07CA0075.eurprd07.prod.outlook.com (2a01:111:e400:5967::43) by AM2PR07MB1042.eurprd07.prod.outlook.com (2a01:111:e400:8444::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.6; Fri, 7 Jul 2017 13:32:53 +0000 Received: from VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::209) by VI1PR07CA0075.outlook.office365.com (2a01:111:e400:5967::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.4 via Frontend Transport; Fri, 7 Jul 2017 13:32:52 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by VE1EUR03FT064.mail.protection.outlook.com (10.152.19.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1220.9 via Frontend Transport; Fri, 7 Jul 2017 13:32:52 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v67DWK8Q007684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 7 Jul 2017 16:32:20 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v67DWKBW007667 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 7 Jul 2017 16:32:20 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 7 Jul 2017 16:32:18 +0300 Message-ID: <20170707133219.1611-3-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170707133219.1611-1-petri.savolainen@linaro.org> References: <20170707133219.1611-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; SCL:-1; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39400400002)(39860400002)(39840400002)(39850400002)(39450400003)(2980300002)(189002)(199003)(9170700003)(5660300001)(47776003)(626005)(76176999)(305945005)(2351001)(50986999)(105596002)(53936002)(33646002)(38730400002)(2950100002)(6916009)(110136004)(86362001)(498600001)(2906002)(106466001)(77096006)(8936002)(5003940100001)(356003)(1076002)(50466002)(50226002)(36756003)(81166006)(8676002)(189998001)(22756006)(48376002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB1042; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VE1EUR03FT064; 1:FW0ju2IqEuQPf6UkvEiHZzkFkiVnV3MTy8B9VjwHNhjVuqvFx6KR5wclz3cQSRNJdoZnfS9IvCUQMUWOc12FAdmLFppdDGQVM3XZlOcPtY/N95AAYEVhGzG00mqtmcG/52r89BwQqzB9oHAjCfBW2o8uj3POcKkVGsor6GSXRPQLb51/m20YmycY9Qf9OITKgYj/HW0UIxlBr2IrCl8m+eBFtbYlhFb1YsoBX4k9rRW+2lKTotmTDr5m6EFquRdOK6LtQ+q3itLUJCO27cqzVtdo8FkHjCNxbhiSSrn5LrF21qG8+fW6SaTlirDaYXQlnuo9nHbpNweInpYR9UNZnMPzI6qZOGV46mVczSNwWbX6z6m8gBvGKMX0f9jgwZuRhNOGWROv/VR0k7q6NGUrxHYy8V2M3S6pRb0eIaq0rm5YicJ6SzTE59awoih7MZhA4uFIvNyKtpHdkcquW2tQ1WBBvx4PmYS6tYUrm3tZkHu9Qv+NzqS3x6r7A4FBfsdcw5/8w1VKk8u4Tgqyn2XDCNfhbTbv9PixZoRzmh7OEnDL8rGO0let6bLRzudHr0/JXJ5BYwggM5MgQa3p3pEYdWrefW1DSNLm82jsAJOPoUGzGJDrHe43XxnLw/xS1D6bouFaPx5w/cBbPwcxM0rZ5H7HBI1555StnM4NAxKc1+F6IqJS9NNrrDq7IzNrJvQziA9IoDobNGlMx0adBO6smZStFg7GLokFqXrbT262cYmXMJNnG444KryST7UHOIbja3m/GzKkSzWcc90RpF5gikAd25MoxwKnXFcnRjRl2yVYG6PBKb0wKrE7o1afez5LN7j1V5AOuf84ikecOwdiVw== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a8b8b08-2a85-4f7a-f2e2-08d4c53cab17 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM2PR07MB1042; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB1042; 3:592XHsqNpC4ErOOrtW7IyA/A+3xlyAr5pVTMVZ6Mp5hEEqLdIpk4kYBwohR+nW5EQTvjIDe5rWTcBk8cc7tJDSXMCgGVTRDV3Zg/qmim0ca3GKj542DnQwJ+mJ6JujZHr9vEDVVsw6CT8abuoeT/Ucrgj5BImW92447/lyEuImPm/T1mO+KiU1JnfldW9Ia/lA14v/LhIhS1OXl8uK9vMP301bjKvECG3IB4oaMh5BPn2Q22c7ZqhN2QxUCHhcjKQ6HLMa50hQogxQYV+Vfi4UNvW1xdbijNe1QodvlL62bbXaZ0h7e+u7Pc0+eg8bhtwz/i/ak2FWCUbDfr8OKayix3WqqW60TQNtU+w4XWel+H5Q2AKd8+luC46xjibYeUPVgOGtvTDFahAIQfp0LF8xUAw+lA5pM6edqGYgzkvMdBuOtEowZUccw3Bl0s1ezKtihfD4VFL/WiQtSbrW7zusicOSw2ALH5QXmnLZ85/PjQtAvK793Z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LkJ9UQjXnouJ2KLth2e5l+lWTgrj7Ryn8zkA== X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB1042; 20:14g77k4wmydal5y16nM/Wl3zVOpDH57u07jW5LgwTy62smHkuJI3hM+keTRA57/nBIzLqyqiLuFqwI9VC6hJYONKh59GHFcC1HSdooGLATeTWtohFNt9IQ8t+IHge1qCwcIoF+y5NaOlVaVSxVo+R/yrvUfEqahRzjyCAKBX8TykUmKE7eFiuLR/Z87C6GQgUOZSXWeELi/aTGxUrASxYvlR306dfPlVDmD6px1m/c5wOtnGnmWhvOso4zboXNsG9fnXvWxnfzFDitSDFMlcpzieE++F1dbb6mijY6nXYjSKJaTnezwQ/MUl60+cIFv/wGu8m6hDCz4e3emAhu9l0YRmRFM0uCdTEeZgiydibVCuZES3oSbt+nNdMRpsVMJnG+Kpg32RGuBYzZdacJtDXvFa28Xczk2gm229QSRiw1K3SwyLBr4f2c4EpPzWlxtiRAodzyO+u47685oKav6+XY1mdJlptJ79uZRSSSHamt6l41ntAGmDWHCdcyFQBQ9zIyP14HoSqqWDza81MzxrfRAe1rHxleLkQUr9REMrjlaW/cH8FwHhl3V15OuKiXM5SxsLALFJeDqW4yOxoqSzUb0uezA/+eOFA156i9bIojA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(13013025)(13021025)(100000703101)(100105400095)(93006095)(93003095)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123564025)(20161123560025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM2PR07MB1042; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805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DWpBkl8cebv51hR8OA1tTAR6FX5JQUH9QQUjsOTzIIluQGB8BQ+3BGbfzCmCgrLgGYzSMbnsH2l25a8xLMRT8YWnuLncgNbFYJeuxf4kL0wcGkgyU0Iya4VjtolP8tHtowg2PErNPuTqcFQhe1CUKgxNi5vKef8kjNCY27KbUWGJmyis7t6kZKOxz+coSWWP2jPskpg8adSRSkyhFrrZ3d/O/uMrODTluXMlL+3V6JYS7uTY5JPKJvUwXF+L15+Fr+6GUU2l0e71kcFqf5smkrWW9w2pLNN2Q7zfiKNw6VJ2UTE54aIbV2R56FZl38 X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB1042; 5:ZiIXPTuk/aw7FyfGY2zgCisTMR4Txs+YqY8kvI7SU7v2s3IGr1CT1ZgIgeq5U+bcw7IlqJz5KttZQ2noSaINlwufMf7WrkPy2pT33xTxD26eBNtywzAO7q2KNCM/Meowc8RgssZbG+aY31SvA6lrbWLhFY8hAS6nE+PgsKay8OcyPkEWay325c4WYlKB5e73Fb3VBN1rAeZS+loyXAvZH04YaiO21kGl/WIZ+a5BLVvp0TIqw1uYzZv/I2LyPuMpr6+/sYUTjelF93fqSH+IQxaLImOO8cKV7qlAO5u4IRyQ2P0IE4nl66PTR0HF1ZPKH+om1z762teH4qIdi+HuDU5+puMwUTWRUdmXsVl8CqTrUM8Xgae9kBlFQFTrSIvX3rhANVgWZ8B6GqujT0x4wPIyMxR9iyZ996MG3NPXh/l7mrzZwg1ykix4PAeYbuxiVK9E7tewb9sHIc4GH68DvBMoz9tmjITncq1psVC/FccI3Y4HNO2CFWhARXx99L7r; 24:1lfZE22xbvW/Xrztjsl6BN9mrQUolNBZ7sDERsEbB3tOCp1imqZNMSJWo6DyEw8aVvLenSe1P86qvbFylal5ahhJBoHrJ9EMhRGwQrJ046U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB1042; 7:1Z263+8kYdB+uQZsK1/uY/oSxfbw0FbKfbojBqteJlFVRFwuYQjqy2a3uIWmKMEPpJ8wXt89nbH7XwwvjaJLMuxPfLVMBhj3BOCfsT8PtRD/eqVTIZQ6ehBUaZuikjRjOBRwzKFnvS+k/IbsFEuHhcTZ/azrpS+GLgfCumZDmvJl+cT+lNDvTtFrBwzkbrawCjaFJpQ1/Oj3o541vpzs+v8+YmyBh4xIKFfJ2fFzBzO4+MwryV1F4ahHhP2LN4ZOaEw6mDjBepcai8QfUj2dgziblzSFseNF1fVnIfjSSB31dwYibkswfx31jwyq4Ud1JmwEouL1oDSuJdb5nf2DrZNagA/QqAX3vaL9CIDvJm2iM3MRkCTlDq7qcrXqaaSeW5c74gmWRR+vOIT2z5uWJ0B+7XNR6Df9hUNpVwCS72FGc0ZCpFktv7vXXNyzW6kKnQ9YQTKPL86OuROxk+u8Yw8oV6YsCEF2D4fYDLmvobgKf49J+MJ7gcE8p3xhJw0TAc4QYv/MSNdIHXc710zaK12aM26Z/FJVUf4b09EoAOcalVoJhOpTpXzff3wGHgoKnkIMS/5q6bejc+tTQZgIYa3juunejr1U+sTWReo7T3xms0m9s/EkUtnWkLwGwZJaGSn3ucPIXxnlMJu3Btov2w3GYLot0kxg04CHjVtpvcTCgCHeqAoa8Dzz5Wiy0N3cYYdtGNC7a3/tPjuuL0V45rwTbtmo/a3s4sXXYF1HV07jdzDEfZiPXav//tLuyYHN0RQzMb6Heg/c7hASp5EfLyB68w7F6CnQPsayK4d/8GA= X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 13:32:52.3390 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB1042 Subject: [lng-odp] [PATCH 2/3] linux-gen: queue: avoid extra conversions 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" Conversions are not needed as event handles are buffer header pointers. Signed-off-by: Petri Savolainen --- .../linux-generic/include/odp_buffer_inlines.h | 5 -- platform/linux-generic/odp_queue.c | 61 +++++----------------- 2 files changed, 14 insertions(+), 52 deletions(-) -- 2.13.0 diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index 1dbc725b..a5658e81 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -28,11 +28,6 @@ static inline odp_buffer_t buf_from_buf_hdr(odp_buffer_hdr_t *hdr) return (odp_buffer_t)hdr; } -static inline odp_event_t event_from_buf_hdr(odp_buffer_hdr_t *hdr) -{ - return (odp_event_t)hdr; -} - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 3f6e7365..e246d1a3 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -479,31 +479,23 @@ int queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr) int odp_queue_enq_multi(odp_queue_t handle, const odp_event_t ev[], int num) { - odp_buffer_hdr_t *buf_hdr[QUEUE_MULTI_MAX]; - queue_entry_t *queue; - int i; + queue_entry_t *queue = queue_to_qentry(handle); + + if (odp_unlikely(num == 0)) + return 0; if (num > QUEUE_MULTI_MAX) num = QUEUE_MULTI_MAX; - queue = queue_to_qentry(handle); - - for (i = 0; i < num; i++) - buf_hdr[i] = buf_hdl_to_hdr(odp_buffer_from_event(ev[i])); - - return num == 0 ? 0 : queue->s.enqueue_multi(queue, buf_hdr, - num); + return queue->s.enqueue_multi(queue, (odp_buffer_hdr_t **)(uintptr_t)ev, + num); } int odp_queue_enq(odp_queue_t handle, odp_event_t ev) { - odp_buffer_hdr_t *buf_hdr; - queue_entry_t *queue; - - queue = queue_to_qentry(handle); - buf_hdr = buf_hdl_to_hdr(odp_buffer_from_event(ev)); + queue_entry_t *queue = queue_to_qentry(handle); - return queue->s.enqueue(queue, buf_hdr); + return queue->s.enqueue(queue, (odp_buffer_hdr_t *)(uintptr_t)ev); } static inline int deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], @@ -596,38 +588,21 @@ odp_buffer_hdr_t *queue_deq(queue_entry_t *queue) return NULL; } -int odp_queue_deq_multi(odp_queue_t handle, odp_event_t events[], int num) +int odp_queue_deq_multi(odp_queue_t handle, odp_event_t ev[], int num) { - queue_entry_t *queue; - odp_buffer_hdr_t *buf_hdr[QUEUE_MULTI_MAX]; - int i, ret; + queue_entry_t *queue = queue_to_qentry(handle); if (num > QUEUE_MULTI_MAX) num = QUEUE_MULTI_MAX; - queue = queue_to_qentry(handle); - - ret = queue->s.dequeue_multi(queue, buf_hdr, num); - - for (i = 0; i < ret; i++) - events[i] = event_from_buf_hdr(buf_hdr[i]); - - return ret; + return queue->s.dequeue_multi(queue, (odp_buffer_hdr_t **)ev, num); } - odp_event_t odp_queue_deq(odp_queue_t handle) { - queue_entry_t *queue; - odp_buffer_hdr_t *buf_hdr; - - queue = queue_to_qentry(handle); - buf_hdr = queue->s.dequeue(queue); - - if (buf_hdr) - return event_from_buf_hdr(buf_hdr); + queue_entry_t *queue = queue_to_qentry(handle); - return ODP_EVENT_INVALID; + return (odp_event_t)queue->s.dequeue(queue); } void queue_lock(queue_entry_t *queue) @@ -726,17 +701,9 @@ odp_queue_t sched_cb_queue_handle(uint32_t queue_index) int sched_cb_queue_deq_multi(uint32_t queue_index, odp_event_t ev[], int num) { - int i, ret; queue_entry_t *qe = get_qentry(queue_index); - odp_buffer_hdr_t *buf_hdr[num]; - ret = deq_multi(qe, buf_hdr, num); - - if (ret > 0) - for (i = 0; i < ret; i++) - ev[i] = event_from_buf_hdr(buf_hdr[i]); - - return ret; + return deq_multi(qe, (odp_buffer_hdr_t **)ev, num); } int sched_cb_queue_empty(uint32_t queue_index) From patchwork Fri Jul 7 13:32:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 107197 Delivered-To: patch@linaro.org Received: by 10.182.72.42 with SMTP id a10csp92541obv; Fri, 7 Jul 2017 06:34:24 -0700 (PDT) X-Received: by 10.237.54.73 with SMTP id e67mr1058016qtb.230.1499434464523; Fri, 07 Jul 2017 06:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499434464; cv=none; d=google.com; s=arc-20160816; b=HzJhL2SbxrGz+27vq3VXbs1nmprR9UQyKFU+j7YrIvVITd0/Da8LjBeOdT2l65FT2L YdiY9ITJia685yzeaO1nsTrXl+l6LklBxUS4kO7Gpwrf4XgMSLO3YyOcOMQF8ncxV37U iPTEBqeLBcu3CCgluqXL19IJxo17mMHVxXIeNiRj673AbKawev8/fiH23HFfqQjrcBZF Mkk36RsO085SFbq4RqS2guRkn0rHOeI4UiV/yilD57uPaBugr0uZ+XZFsKTXrekuHsLt nwQYPhSOkQY9NAYaBmLsigs22WXTaA2IagD5b5xOQ5Ud0Qc3BH8CYMTXMiXHSuyP2t6s ZIMA== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=dNzBmcLBy8ZDzE+RApVPg5zi0SyoxH/RCOQmJ2F3uYw=; b=fa8NudxdhJy+HAZkh3vY3mlBpN36BXLV02u6jh+d8qo9t8QQsN6dXUkS+OLWuLHdLk EOZaVAwd4Z/cao2evE+YO4rxgGRyLKXSz5tVCc3vDeZFaJqe5LtpZevKOgwzjgZrgZNT cKTEyG2MFQXkLupidcJ45it3h5bbs11TFOBsGHarVjyVLfUTudOsUexMxwGurw2ojcrg +2KPfaL7RKvIv1qdxPDVZG02kGLGrdJNrJhgWhz7jaR8wck6DO4atFWo3hz0sZnq/LAr +FihQrAHcCdQhf3VR/2FEcsvvKShpLoszFAaW+4ry1ZyXmy4nXW/5ne+kyzHXtvlPD6c bdsw== 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 19si3338301qkt.22.2017.07.07.06.34.24; Fri, 07 Jul 2017 06:34:24 -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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1852B60C88; Fri, 7 Jul 2017 13:34:24 +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=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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 D1B3860D1A; Fri, 7 Jul 2017 13:33:35 +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 779B660BFF; Fri, 7 Jul 2017 13:33:27 +0000 (UTC) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30121.outbound.protection.outlook.com [40.107.3.121]) by lists.linaro.org (Postfix) with ESMTPS id 7AA7A60A59 for ; Fri, 7 Jul 2017 13:32:56 +0000 (UTC) Received: from DB6PR07CA0115.eurprd07.prod.outlook.com (2603:10a6:6:2c::29) by VI1PR0701MB2208.eurprd07.prod.outlook.com (2603:10a6:800:31::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.4; Fri, 7 Jul 2017 13:32:55 +0000 Received: from VE1EUR03FT028.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::207) by DB6PR07CA0115.outlook.office365.com (2603:10a6:6:2c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.4 via Frontend Transport; Fri, 7 Jul 2017 13:32:54 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by VE1EUR03FT028.mail.protection.outlook.com (10.152.18.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1220.9 via Frontend Transport; Fri, 7 Jul 2017 13:32:54 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v67DWKRI007687 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 7 Jul 2017 16:32:20 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v67DWKBX007667 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 7 Jul 2017 16:32:20 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 7 Jul 2017 16:32:19 +0300 Message-ID: <20170707133219.1611-4-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170707133219.1611-1-petri.savolainen@linaro.org> References: <20170707133219.1611-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; SCL:-1; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39840400002)(39400400002)(39450400003)(39860400002)(39410400002)(2980300002)(199003)(189002)(9170700003)(48376002)(2351001)(86362001)(33646002)(575784001)(8936002)(5003940100001)(50226002)(81166006)(22756006)(1076002)(356003)(8676002)(77096006)(2906002)(189998001)(53936002)(47776003)(38730400002)(2950100002)(6916009)(110136004)(36756003)(5660300001)(106466001)(626005)(76176999)(105596002)(50986999)(498600001)(50466002)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0701MB2208; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; VE1EUR03FT028; 1:zdbs53Y8153cryUsEjLfNT+oyHV3yRMP5ZcBkC0kezGbH9RpUwdkL9Y5E92/pA6Z/0YcuIsObmrEuDKah3NxGv0IGTQBHKyM81g4LIFSU1gFS+YGgqpzMZW+q7V/TJq9sCU1LVJCTq1G4id1MyeWbA6OKOssY6ZzDD5p3Zg0PF+is0Zfr6th9bjBkNvcLi9EycQ2LlkTRNMZonnF+SaprLqnDvzmjcRo6RQcr7UarA0BIfUEzGtS483fB3cQtgKEUCNyBYwoQU70pjiwbcJRaknePNxJDtu0PgPWQWmavWj4gg1cYCsTNhNN1IuTN12ncIOyGNI58j2mTf0CO2Ylgz/9iB2Fmn3Bf6PRN0VSG3hP5lulexTHNrZ4HrkpdeWSd9DHDmu/fRqu7DGhjywEpgprtDTWhdpXw3LRVcSqjzC61aKJwHilC773mudTIfBr6sp9q5B9CDfrnrKGVNMegdNHXG/zLP97z7/WlIOAvCOzHYvaCLiGMYs5FYwjNoUSYDi64lmqCd7qfglsvP9wtlnOzMrjp11qsXzBkzbbItFTVFWt1pgLajV5x715eNd4Fj9dkLUu6CO/vpuvZNrD3016NLEOQv7wsPLodruUBTTdBQOd2C/SZHVU1s/eHlUBtrVXOvGpo+4tjUQrOlKcvRpD43ZZxeFOXG5aO4J4XHHKBSySfdzphPNcbGSfLiVMcCrBG8R8sp2l0wnEdEse6fWziGx+JcvvqZDSPxL6bGzChMSFR8UYslO9xq9yb93COMPehhqbsSF9tCBnhwIzjsvcKEXs7g9iMvOBReHT5JahyvXVIC+qE8q6wpnMbGRvS5+PFITCpThUitkxveHeVQ== MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99165e60-7e09-4e97-24c4-08d4c53cac2d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR0701MB2208; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0701MB2208; 3:0vsqWLkOKj9YAUtJLOOE6u+ckh5MdqAnRYFNCR1ufnk5IEgtFlHOoyR34qcuRPVDljnZ/X1mapAP80+KSj9sqh7HWeibhV0JeCNEq9yeDxw+CipsDP1lsrOxukfQ3kHZggLn+d6MBZl+PT8rqRxgDOh3VbcORZJj0Yx0abdbLPBGfhL3BqQ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236129657087228)(148574349560750); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13013025)(5005006)(8121501046)(2017060910064)(13021025)(93006095)(93003095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(20161123555025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0701MB2208; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0701MB2208; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0701MB2208; 4:eNfrUGpyqcnVexjcS4eqLF8eYZOrD9r6L8wlkSk5?= S6/SR8sQg0LEUscjONFeSKRy8zmBymZl1rzf30f61JEvIOWffFeQdadKRg/FjVrOJU24GrSlB0EpveSnCaKy0GvdBzcB1XbVgFq/MXIa36GxHMp6Fob7s2nu92R5WDoqdhh4GqtViSEg0FPnAYojZYst9mErmggjzI03Mx7aSmYZVhqy2eFuf8282Z4kmt+9dTIgI/V1tTIxBUjcHblfrvzkHHpD5jqpbovWcnTmsAYnYg7oHmih4VfNNOQZPbue+D3wY6s90nQTbUlLgju/faGW7OSHIqQaN8Ceb9x/NmN9KzmqCuj0Z/sEi6j5YSf9Kx4MCQknmuqf3VeBXZvylpz1V0g93EnNFSEv9eStJchhdPKuxtNNwx1yDHZmLBfaua39tjOr2Bw6pgSAU1BntZcY/0Kc74kKq87BeX2K8y1SGJfdrJGAnr6p5vzYVMhSA0Cp/kfAD7P99Filqj2AgeJ3nHJ/9HqG7ZAnQM/xC3pdLMPzEUf2b3XWSz4dakuMKg6wM1+7+Hg/vIiSIvwPFYekhCY1kvYeHD0gJwZ+3YJKtDzT6cMDVTNFuETtz+p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xKn9mGgypCuqz5bG3M+3d6UtgPyOWTm7bZfoA9TToeCnE3BkikPMTMY/z7UtN5PNBr7GtveqXXE7uFX4twDAL4zfIeffUTqDa1hWzAa99hZU71empL3j0PZZzeEX4sL7nXHQSn8TC3k1Ek1pBqBA7/1M89oK22/vSISH8vzc68iPzFwoAyoR4U= X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 13:32:54.1713 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB2208 Subject: [lng-odp] [PATCH 3/3] linux-gen: pool: avoid extra conversions 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" Avoid conversions between buffer/packet handles and buffer/packet header pointers. Signed-off-by: Petri Savolainen --- platform/linux-generic/include/odp_pool_internal.h | 5 +-- platform/linux-generic/odp_packet.c | 49 +++++++++++----------- platform/linux-generic/odp_pool.c | 49 +++++++--------------- 3 files changed, 42 insertions(+), 61 deletions(-) -- 2.13.0 diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 1fb55d7d..a4c0e532 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -96,9 +96,8 @@ static inline odp_buffer_hdr_t *buf_hdl_to_hdr(odp_buffer_t buf) return (odp_buffer_hdr_t *)(uintptr_t)buf; } -int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], - odp_buffer_hdr_t *buf_hdr[], int num); -void buffer_free_multi(const odp_buffer_t buf[], int num_free); +int buffer_alloc_multi(pool_t *pool, odp_buffer_hdr_t *buf_hdr[], int num); +void buffer_free_multi(odp_buffer_hdr_t *buf_hdr[], int num_free); #ifdef __cplusplus } diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index e6de2558..3cde2086 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -361,14 +361,14 @@ static inline void copy_num_segs(odp_packet_hdr_t *to, odp_packet_hdr_t *from, static inline odp_packet_hdr_t *alloc_segments(pool_t *pool, int num) { - odp_buffer_t buf[num]; odp_packet_hdr_t *pkt_hdr[num]; int ret; - ret = buffer_alloc_multi(pool, buf, (odp_buffer_hdr_t **)pkt_hdr, num); + ret = buffer_alloc_multi(pool, (odp_buffer_hdr_t **)pkt_hdr, num); + if (odp_unlikely(ret != num)) { if (ret > 0) - buffer_free_multi(buf, ret); + buffer_free_multi((odp_buffer_hdr_t **)pkt_hdr, ret); return NULL; } @@ -427,12 +427,12 @@ static inline odp_packet_hdr_t *add_segments(odp_packet_hdr_t *pkt_hdr, static inline void free_bufs(odp_packet_hdr_t *pkt_hdr, int first, int num) { int i; - odp_buffer_t buf[num]; + odp_buffer_hdr_t *buf_hdr[num]; for (i = 0; i < num; i++) - buf[i] = buffer_handle(pkt_hdr->buf_hdr.seg[first + i].hdr); + buf_hdr[i] = pkt_hdr->buf_hdr.seg[first + i].hdr; - buffer_free_multi(buf, num); + buffer_free_multi(buf_hdr, num); } static inline odp_packet_hdr_t *free_segments(odp_packet_hdr_t *pkt_hdr, @@ -444,10 +444,10 @@ static inline odp_packet_hdr_t *free_segments(odp_packet_hdr_t *pkt_hdr, if (head) { odp_packet_hdr_t *new_hdr; int i; - odp_buffer_t buf[num]; + odp_buffer_hdr_t *buf_hdr[num]; for (i = 0; i < num; i++) - buf[i] = buffer_handle(pkt_hdr->buf_hdr.seg[i].hdr); + buf_hdr[i] = pkt_hdr->buf_hdr.seg[i].hdr; /* First remaining segment is the new packet descriptor */ new_hdr = pkt_hdr->buf_hdr.seg[num].hdr; @@ -464,7 +464,7 @@ static inline odp_packet_hdr_t *free_segments(odp_packet_hdr_t *pkt_hdr, pkt_hdr = new_hdr; - buffer_free_multi(buf, num); + buffer_free_multi(buf_hdr, num); } else { /* Free last 'num' bufs */ free_bufs(pkt_hdr, num_remain, num); @@ -487,10 +487,9 @@ static inline int packet_alloc(pool_t *pool, uint32_t len, int max_pkt, int num_buf, i; int num = max_pkt; int max_buf = max_pkt * num_seg; - odp_buffer_t buf[max_buf]; odp_packet_hdr_t *pkt_hdr[max_buf]; - num_buf = buffer_alloc_multi(pool, buf, (odp_buffer_hdr_t **)pkt_hdr, + num_buf = buffer_alloc_multi(pool, (odp_buffer_hdr_t **)pkt_hdr, max_buf); /* Failed to allocate all segments */ @@ -500,8 +499,12 @@ static inline int packet_alloc(pool_t *pool, uint32_t len, int max_pkt, num = num_buf / num_seg; num_free = num_buf - (num * num_seg); - if (num_free > 0) - buffer_free_multi(&buf[num_buf - num_free], num_free); + if (num_free > 0) { + odp_buffer_hdr_t **p; + + p = (odp_buffer_hdr_t **)&pkt_hdr[num_buf - num_free]; + buffer_free_multi(p, num_free); + } if (num == 0) return 0; @@ -584,43 +587,39 @@ void odp_packet_free(odp_packet_t pkt) int num_seg = pkt_hdr->buf_hdr.segcount; if (odp_likely(CONFIG_PACKET_MAX_SEGS == 1 || num_seg == 1)) - buffer_free_multi(&hdl, 1); + buffer_free_multi((odp_buffer_hdr_t **)&hdl, 1); else free_bufs(pkt_hdr, 0, num_seg); } void odp_packet_free_multi(const odp_packet_t pkt[], int num) { - odp_buffer_t buf[num * CONFIG_PACKET_MAX_SEGS]; - int i; - if (CONFIG_PACKET_MAX_SEGS == 1) { - for (i = 0; i < num; i++) - buf[i] = buffer_handle(packet_hdr(pkt[i])); - - buffer_free_multi(buf, num); + buffer_free_multi((odp_buffer_hdr_t **)(uintptr_t)pkt, num); } else { + odp_buffer_hdr_t *buf_hdr[num * CONFIG_PACKET_MAX_SEGS]; + int i; int j; int bufs = 0; for (i = 0; i < num; i++) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt[i]); int num_seg = pkt_hdr->buf_hdr.segcount; - odp_buffer_hdr_t *buf_hdr = &pkt_hdr->buf_hdr; + odp_buffer_hdr_t *hdr = &pkt_hdr->buf_hdr; - buf[bufs] = buffer_handle(pkt_hdr); + buf_hdr[bufs] = hdr; bufs++; if (odp_likely(num_seg == 1)) continue; for (j = 1; j < num_seg; j++) { - buf[bufs] = buffer_handle(buf_hdr->seg[j].hdr); + buf_hdr[bufs] = hdr->seg[j].hdr; bufs++; } } - buffer_free_multi(buf, bufs); + buffer_free_multi(buf_hdr, bufs); } } diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 7e0c7606..e08c8985 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -73,13 +73,6 @@ static inline odp_buffer_hdr_t *buf_hdr_from_index(pool_t *pool, return buf_hdr; } -static inline uint32_t buf_index_from_hdl(odp_buffer_t buf) -{ - odp_buffer_hdr_t *buf_hdr = buf_hdl_to_hdr(buf); - - return buf_hdr->index; -} - int odp_pool_init_global(void) { uint32_t i; @@ -604,8 +597,7 @@ int odp_pool_info(odp_pool_t pool_hdl, odp_pool_info_t *info) return 0; } -int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], - odp_buffer_hdr_t *buf_hdr_out[], int max_num) +int buffer_alloc_multi(pool_t *pool, odp_buffer_hdr_t *buf_hdr[], int max_num) { ring_t *ring; uint32_t mask, i; @@ -633,11 +625,7 @@ int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], for (i = 0; i < num_ch; i++) { uint32_t j = cache_num - num_ch + i; - hdr = buf_hdr_from_index(pool, cache->buf_index[j]); - buf[i] = buf_from_buf_hdr(hdr); - - if (odp_likely(buf_hdr_out != NULL)) - buf_hdr_out[i] = hdr; + buf_hdr[i] = buf_hdr_from_index(pool, cache->buf_index[j]); } /* If needed, get more from the global pool */ @@ -661,11 +649,7 @@ int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], hdr = buf_hdr_from_index(pool, data[i]); odp_prefetch(hdr); - - buf[idx] = buf_from_buf_hdr(hdr); - - if (odp_likely(buf_hdr_out != NULL)) - buf_hdr_out[idx] = hdr; + buf_hdr[idx] = hdr; } /* Cache extra buffers. Cache is currently empty. */ @@ -681,7 +665,7 @@ int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[], } static inline void buffer_free_to_pool(pool_t *pool, - const odp_buffer_t buf[], int num) + odp_buffer_hdr_t *buf_hdr[], int num) { int i; ring_t *ring; @@ -699,7 +683,7 @@ static inline void buffer_free_to_pool(pool_t *pool, ring = &pool->ring->hdr; mask = pool->ring_mask; for (i = 0; i < num; i++) - buf_index[i] = buf_index_from_hdl(buf[i]); + buf_index[i] = buf_hdr[i]->index; ring_enq_multi(ring, mask, buf_index, num); @@ -737,12 +721,12 @@ static inline void buffer_free_to_pool(pool_t *pool, } for (i = 0; i < num; i++) - cache->buf_index[cache_num + i] = buf_index_from_hdl(buf[i]); + cache->buf_index[cache_num + i] = buf_hdr[i]->index; cache->num = cache_num + num; } -void buffer_free_multi(const odp_buffer_t buf[], int num_total) +void buffer_free_multi(odp_buffer_hdr_t *buf_hdr[], int num_total) { pool_t *pool; int num; @@ -750,21 +734,20 @@ void buffer_free_multi(const odp_buffer_t buf[], int num_total) int first = 0; while (1) { - num = 1; - i = 1; - - pool = pool_from_buf(buf[first]); + num = 1; + i = 1; + pool = buf_hdr[first]->pool_ptr; /* 'num' buffers are from the same pool */ if (num_total > 1) { for (i = first; i < num_total; i++) - if (pool != pool_from_buf(buf[i])) + if (pool != buf_hdr[i]->pool_ptr) break; num = i - first; } - buffer_free_to_pool(pool, &buf[first], num); + buffer_free_to_pool(pool, &buf_hdr[first], num); if (i == num_total) return; @@ -782,7 +765,7 @@ odp_buffer_t odp_buffer_alloc(odp_pool_t pool_hdl) ODP_ASSERT(ODP_POOL_INVALID != pool_hdl); pool = pool_entry_from_hdl(pool_hdl); - ret = buffer_alloc_multi(pool, &buf, NULL, 1); + ret = buffer_alloc_multi(pool, (odp_buffer_hdr_t **)&buf, 1); if (odp_likely(ret == 1)) return buf; @@ -798,17 +781,17 @@ int odp_buffer_alloc_multi(odp_pool_t pool_hdl, odp_buffer_t buf[], int num) pool = pool_entry_from_hdl(pool_hdl); - return buffer_alloc_multi(pool, buf, NULL, num); + return buffer_alloc_multi(pool, (odp_buffer_hdr_t **)buf, num); } void odp_buffer_free(odp_buffer_t buf) { - buffer_free_multi(&buf, 1); + buffer_free_multi((odp_buffer_hdr_t **)&buf, 1); } void odp_buffer_free_multi(const odp_buffer_t buf[], int num) { - buffer_free_multi(buf, num); + buffer_free_multi((odp_buffer_hdr_t **)(uintptr_t)buf, num); } int odp_pool_capability(odp_pool_capability_t *capa)