From patchwork Thu Jul 13 12:58:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 107679 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2186010qge; Thu, 13 Jul 2017 06:01:46 -0700 (PDT) X-Received: by 10.237.42.129 with SMTP id t1mr4395903qtd.93.1499950906448; Thu, 13 Jul 2017 06:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499950906; cv=none; d=google.com; s=arc-20160816; b=gBdU0XHAbGwOvAc6xM1LFLxr9xvjOElOBFH+16I1GWf1Wu5u5T2LUmtwYF2w35ZHar yDaXp7Sk7gk3hLDD70MRSuJwJIXyhK0ncLlKVlpKS/JfMzG1fjStTFua9ggN10v2Z5sV IrTG27XK+CL7m/U3n2BzfLVYMJCeEtXq1ZUTJ59bcyxxSBI53yTCjY1GMA61JNGpWO9W CWS5HTKZs0p1m3xc/efYnBp33PQ+yX8WNa6yS+KpRgPedP8DhySV/0BKAdkaD6Jz50TN WQHT/ul3I60I85a///9d4GLxqYfiUjfM3Q2A+FFCq2dGmqTjLuoe05H8DTFUXMm58ZWP 2frg== 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:message-id:date:to:from :delivered-to:arc-authentication-results; bh=1ZQouvZCjDjo3UoJl9vjFrHE9xB2ms6rD2nCIQ/JBq0=; b=AKv1hizGZlgouHmF8i6nyLmV91vWDYTBjpw8lxm1jrNADgGAK6cPtumSEATwKruGAJ Pxhgyq2QrsL/rb7+xf7SBJ4YPB4rSJfEggk+eLxxYgUJJQQqp3SaPaw5+iMMn5a/lhsZ 7iAQjmYeXsUF1fUf/Pow2vEbB5FW3E/0mcqvemZ7SQMsl8Fqyu7gNRqPv7IMzHMZedeZ 2d5XWuJh43liCa/lNifMWI1H3IyBqNalpA/mOweeeOvVeEVkr4saKmRxHEwBzANcBMSR K5fBw2KMMNxPCXkCYe8QKo7dsayVYer7CYTA2sfz9ugEp5sJF8GRAPrBJDVwOLeX+Pdn FfTg== 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 i16si5125903qtf.90.2017.07.13.06.01.46; Thu, 13 Jul 2017 06:01:46 -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 2636860D70; Thu, 13 Jul 2017 13:01:46 +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 231346084E; Thu, 13 Jul 2017 13:00:42 +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 9717E6081D; Thu, 13 Jul 2017 13:00:25 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0105.outbound.protection.outlook.com [104.47.0.105]) by lists.linaro.org (Postfix) with ESMTPS id EEA1F62AE9 for ; Thu, 13 Jul 2017 12:59:03 +0000 (UTC) Received: from AM4PR07CA0026.eurprd07.prod.outlook.com (2603:10a6:205:1::39) by DB6PR0701MB2200.eurprd07.prod.outlook.com (2603:10a6:4:51::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.4; Thu, 13 Jul 2017 12:59:02 +0000 Received: from AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::204) by AM4PR07CA0026.outlook.office365.com (2603:10a6:205:1::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1282.4 via Frontend Transport; Thu, 13 Jul 2017 12:59:01 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.241 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.241) by AM5EUR03FT005.mail.protection.outlook.com (10.152.16.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1240.9 via Frontend Transport; Thu, 13 Jul 2017 12:59:01 +0000 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v6DCwSjf029188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Jul 2017 15:58:28 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v6DCwSPc029185 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Thu, 13 Jul 2017 15:58:28 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Thu, 13 Jul 2017 15:58:26 +0300 Message-ID: <20170713125828.28230-1-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.13.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:CAL; SCL:-1; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(39840400002)(39400400002)(39410400002)(39850400002)(39450400003)(2980300002)(199003)(189002)(9170700003)(356003)(50986999)(5660300001)(22756006)(5003940100001)(2906002)(189998001)(47776003)(1076002)(50466002)(6916009)(48376002)(106466001)(8936002)(77096006)(2351001)(33646002)(50226002)(81166006)(105596002)(8676002)(110136004)(38730400002)(86362001)(498600001)(305945005)(575784001)(53936002)(36756003)(626005); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0701MB2200; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM5EUR03FT005; 1:1mY4XlFv03hZDZfh5Uy7hkE+J/Xocib7VPhp8sZBMd+hSLrabd10NWJtA8qQUCET2d1vqzk7d476tJPcGSaCs8HKI7QmdayDGb2452puK74WYecxxqI/PciafYceJpBmOvntHP5htF+3Cg+pXtK/pWxNEfaKAtMmyMrR+17cvBeDn9uairWMsdB4l694qhX2AGloDHgrAkZY+l3KgHv1tCvhdYO4STWjKhZYWMBGoWaYWqh3Xo+Oepx0x/7i8f7fujmWWzmol55ZSWsDX5qoG6c/son67WFY6X+ALZELjIc42Mt2U30MJyufuCpoJSaEyd4E/YOlj8XqYKc+vVojffppj9IqVN7szdWDrzHD5NdKjY64bdhdIP/XlJnb/9sJ25cS+BxkFXRXqibWYjaS5AxOPPHgGEIHGtUGh4gjCoz53EbubUKF3yGIZGN6CiMItV6qxH90UcALMreHCV9ujFTKCPrc7Ryaq4wr9b4ifoQn9QyGV3vXU8TiBFNb+gITItHqwyup+l9kBkfFmqomphZI2MZn6Q0OfQkcXptMAg+DjYryPhfQjBqiA3eL/2vwAiuo79FFEoTfVIAWKCczLsg4itfYU9nZ/pKRJrcbIeacaobHujJkoPC5KKfhKCXshth5y6YanhiIvQpSNJDVjs9u5WTlOpDJQi2wU4NrSy2wIvskqACNN2Paei+VDntNgZlV9TsMSJqgvnPnkeNnr7WKj405nVou+ioihsRomPiin/y8ewWjss9OCwkPp2NgEnD/y+0+eGbMl3Goqd4ImMXhl9E5SMijPJQ+BHEtATYAzDyhkHF58MqHmzUYKYPa/g6BpQ83bgeAqytCW4on/t4eHKkoLXklyNA7Ito0W4w= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ed9c841-6aa3-4cc0-27e4-08d4c9eeef14 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:DB6PR0701MB2200; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0701MB2200; 3:ysld6dsi2ipDt4uYZuGkIv6v85heSPVyMWPt2LMcgb3dDs46Vk/B1cx0VthNEShQiDNltc7LJmmsDpsNJXA54JTD2CfLAeaTd8o9CNtMtc9WFkjwm0V88Y4CknWc5qh2Kv2kGVwMwwh+elWP+dfSNqqgFSjTxC/bwfWZWgeU5ylE5+/AbADIVbVd1t5JOQN5pfBDbEJpwtbZwqeJPElQyMv0FqcXlmDcaZG5KDvz8Ips7kskpCBlcSe98bzkfU6yufin6uGaDMW0p6if4byZJzr3aUe7FcDoMwnNSHwKfbznDY24jWbv+0YJ74XI9isH/5v4+r3DiZT4VUiEAXjSCMBUniYElfiU7wef6tYOTqR3tGYLpkKYZOUT4Cbvlg+tanhUD7NpoblcwkvQpA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ul1B0btdyeGze9jbsYVG+Yp0MQmdTGKYV6l90xYLO8wrWJFJ/N+6/djKYt5lcaObUQX7P6IBVCmau6xE10/k/KkJ4N/vXKooig9t+pw/MF2Ew9Tx1NYuvuoCanF5TMdERq/g== X-Microsoft-Exchange-Diagnostics: 1; DB6PR0701MB2200; 20:FozqiukSh9McicQXbN2JmbAd6FELmzyX/isQNL6gdqWYvf0B07MekehhcauQEkxDWPck4zYdVZJTecbhQoIbpoVt/e91L3TICALRxr19d/fRqMeRpPdH1jVaa1RA3GyQvkI8FNVhu6yBCxEzbNVFSgkMfpItImIo4ximdY3XJhVv7b/hAD2yR10L/EOZrxngTa1Zvz3XeAs7uP1RK85imekMERmc6qHCGvHneTTjbhs6yR4h9z4xQ6lA4S5XJ8H+DmIbcufwpJpltritcN/+PRruMrgDV3O04NhlCdV2be8xF/uo9X4yppSOFlUtg+65lXBAxbSb/G+B8tEcosvqPn+xSWnfTug32O1eug8dxPMNKGE7tPs2t3wtp0XGAqyVhikyJtJBPsPY/fWER2AxF5XxU85AD77oeJRJu+mScn0feiDZ+41ociagVkf0pnsu3ah24UT2GYnHyAn4WDB12CE7xnIdGRyoUgDcYcJCTA3rbsV8fwTt4YRJXqKhpm/BtLx7TqUqgVHjUHvp/npmzo85bEZ+s7eBCAlcl7P8mLzKX6kxGzsbNCPXR1g1dHArnvYbomjZkRcq+0deFuFrr2y8IggxO1Dd67NsfBXVg2s= X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(148574349560750); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13021025)(13013025)(2017060910075)(8121501046)(5005006)(10201501046)(93006095)(93003095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0701MB2200; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0701MB2200; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0701MB2200; 4:14foP3d7xzAQuWpedwt5Rl3yzipusom315C2Tb9H?= tyTxlmTSInCwjRisSNg45YCIP+q1Ult7rFd9pcDtJorfJzwtsaRcjZvxZixZ1WroCjnmIp317X6rs62mVuf8fAVqqgL/vqi2uxSdyBKGfFSJDAByQZXEM0C8CskaEj3iETTt8c++u05ACOZAhAzOfW1mdXJeNM7zepGzlTUymh8H5KksEY9EK5pt7YhZNG4VJ+LBUiyx4Y7CnN4sQb+80OcO50G/txNqoaBgClg4aadAiIcn/MPQdwo7KuglZu59v+wIkyZzYfaHY5CZ/4iD9h9lkgoW60Qmxgk48bQKtB6lRknk6knf6N++UVMS3P00Mbz18fV/plX/luFNlUY9gW0uvvwdJuh/aemwMu351+xyagwFZ+Oj45IZ0IAUcz1UuQTJWL1Ks8KY+ZcwEJRLWyPxqN2YpXAbO9WafzKMmDlWy1t/cfXxmLeqw0Csul+d3OdYDA3sw81gLvMmJ6Gt5dEQnXDTDELKBcLhc6n6vGLKBrpVkw/QmDSDeHoyCl3I2X7AZD6QQC33ump4Mow20YCVNdVqRNWBdmqiIuzQhQppm70x0+lqFGcDpUZ/43BckL5v4kvrSgcLZ5CJv+t4utkvU7Xb/0VJPiFxo3zOfkkAvBs6IZnlWvXe5pAYN/IoE1HDgP3XaqdFfbYG2VDz3F990TcL7aYhC7wcO1VOTdFI2vsEJ5VndFZyfk5V4mvPz8vaw5FpEnFmpZChgVju4GmuAnX59DeGglEKZ43KsXLPUyB47UYI/6UM3TtxsgYRtTsJGNdln9rQS/DzNGvlU+Akg2kxosBkAlQrq3q7mQmdbUqvIbsCx/k8Qm7ooCQHh56QX6ZRSDB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:n8qQBy+UQxifgbFEW1rTM6lDqtsuPlQY4cQc4te/e6JtrKrUCRm+Wvv0gf7dP4G6xkHYiGG7FBYLwt8bi8kQWaibvgh9zvlhamihBgQ2DM4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0701MB2200; 7:HooemlTOF0HSOwxZx9ou/uxAksthsm2uFLudnQb+9owOS1perDcxUoHNKtMhS/eVPr7JERFgOSPa1hT+65s93QByzpXFTWpJZn/het0/7f680Wk9esNSOswIS86I32zl/kUI8rM1sqhukFK/Un9ut5K11atCkChv1R5xwe5lOsydCUZAVuEp7Poon2N+emU42/KKDBR6A8UnPDEi2mX0Q+eZdXi5O1pjRwKZrZ4KVSfYzA+NEpscIiH/bYJDfWkvvra2SoBPakTE/348ZC5cdU0kzjQVyS7px0JCHIUICb4IZZPo7RLxhL8cPweIQ8jx2D+IvjIqvrcUfuhjlL0OkKwg2qGWxPABa/NkhyNwf0owfu08Is8dudvvGQauqHo8nv03siqdl18/Wa3m2n8v4G1qptH4MjMPgLMmh34aG/bb3a/buB+ZbVXOolLG+RIQk3hBK1FS+eoTOhY+UN1HGms9RGaZn6goCGTi7LkqUpsEwalkoY4hPzmr+h964Kli2SN6neQ6lUqN37H4zfqdbEWMWrniWVBqayyGQaJctdDkuTeWsA2njEK2wofJeiU0E0VDhEooLAnaGkqpG66BCbmR54bDamTpxwjvtQSGMEMUE9uAVmlOjhk51dLq9fBGiNLoXRkrWDw6hsnUCBkTGw0j57E7aPBxvE0qz1nkaiOkE39hEvlIR+7LrQSEkBahj+riPbM1QHDItWD9qExbFX0LvmCsBAqO/lj07NcRcSDS15JqD0iYVI0d405BhQhUPXoBm5c9q+GmMGo67a0JDLWqMXnXqwDlFAG9V/gLhnw= X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 12:59:01.4838 (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.241]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0701MB2200 Subject: [lng-odp] [PATCH v2 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 d513f05e..d38f831f 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -208,11 +208,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 d52814b2..348d609a 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -559,7 +559,7 @@ static int queue_deq_multi(odp_queue_t handle, odp_event_t events[], int num) ret = queue->s.dequeue_multi(qentry_to_int(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; } @@ -574,7 +574,7 @@ static odp_event_t queue_deq(odp_queue_t handle) buf_hdr = queue->s.dequeue(qentry_to_int(queue)); if (buf_hdr) - return odp_buffer_to_event(buf_hdr->handle.handle); + return event_from_buf_hdr(buf_hdr); return ODP_EVENT_INVALID; } @@ -686,7 +686,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 ec2d331f..53e10471 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -104,7 +104,7 @@ static int queue_tm_reenq(queue_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 f0facd8c..acdfc4ff 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -580,12 +580,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 Thu Jul 13 12:58:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 107677 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2183099qge; Thu, 13 Jul 2017 05:59:08 -0700 (PDT) X-Received: by 10.237.46.225 with SMTP id k88mr4970919qtd.5.1499950748718; Thu, 13 Jul 2017 05:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499950748; cv=none; d=google.com; s=arc-20160816; b=mlv/m38Tqs29UZBFk4hKmaJmflEr3sa/0P6maIfO028h4YPUKLDaHaU54lO2ISI0jX 4HP8NHltsM5m6fv+6LoKth4w27DpbnnHgMPYgY7OYHFXu/R1EFOw4SXdf6+9LEeXgbOU 25AQvz+dBdMUxIYxbw+nrKFOYWRAoEQ0SQONpeV8xgdxWKaKjATRyn6pLxw8qRsjqk92 1LOIQGX9zJk/xwVVbDYHucYMjClpO1IRpEr/qMl0yvR8ii6j4uJyBoUYgCaGuiNq3T7U jCtG66lAuBVGBz1Njl9aZmgJ3lZEM3ZrSpEkzbWoGMQVt62kgzikPiYE6Nefi4TqlRoK VZzw== 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=mgdGPYhyidNk3RtgM2VI1jUklxfTblCj8DNu9CW1lFo=; b=0qsMTeUKv1XUtw5KUru/Kx5els915soxnY3wF28hlFTzEwx1PJjA7CeFgT2FYxg7WI NFt2ZjV+XGoCje1Mly86ACUUo1JMem+HLdYkqM00QMdo+OiTuhj93Tdm2NcNq1oukWQ8 7aDQj9fMJDtNEdn7A/3FNTooKcC9qFnDf9x9MfDrg80dkMBu3RfXiJOKtt5Agmplk/2k 60z71juTlMLLqsv77+90OARLsE8qM+J1+3QQbL1WlBAReYXxuf8L44X8waddeVSlJqWW 1SID4cGpBjl58aT2Taf4JeTUItrylLgswOw/o3U+6XKrzGW808eSivY1h+abaeA3qn/Q QfVg== 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 t58si5085780qta.113.2017.07.13.05.59.08; Thu, 13 Jul 2017 05:59:08 -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 3FC6C644D6; Thu, 13 Jul 2017 12:59:08 +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 C9EFF60C90; Thu, 13 Jul 2017 12:59:00 +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 4E31860C90; Thu, 13 Jul 2017 12:58:58 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0138.outbound.protection.outlook.com [104.47.2.138]) by lists.linaro.org (Postfix) with ESMTPS id A9A4C60C35 for ; Thu, 13 Jul 2017 12:58:56 +0000 (UTC) Received: from AM5PR0701CA0007.eurprd07.prod.outlook.com (2603:10a6:203:51::17) by AM4PR0701MB2193.eurprd07.prod.outlook.com (2603:10a6:200:49::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.4; Thu, 13 Jul 2017 12:58:55 +0000 Received: from DB5EUR03FT041.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::207) by AM5PR0701CA0007.outlook.office365.com (2603:10a6:203:51::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1282.4 via Frontend Transport; Thu, 13 Jul 2017 12:58:55 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.241 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.241) by DB5EUR03FT041.mail.protection.outlook.com (10.152.21.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1240.9 via Frontend Transport; Thu, 13 Jul 2017 12:58:54 +0000 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v6DCwS8W029198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Jul 2017 15:58:28 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v6DCwSPd029185 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Thu, 13 Jul 2017 15:58:28 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Thu, 13 Jul 2017 15:58:27 +0300 Message-ID: <20170713125828.28230-2-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170713125828.28230-1-petri.savolainen@linaro.org> References: <20170713125828.28230-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:CAL; SCL:-1; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39410400002)(39450400003)(39400400002)(39840400002)(39860400002)(2980300002)(199003)(189002)(9170700003)(53936002)(5003940100001)(105596002)(6916009)(48376002)(8936002)(1076002)(22756006)(8676002)(2950100002)(106466001)(86362001)(189998001)(50466002)(50226002)(38730400002)(626005)(36756003)(5660300001)(2906002)(47776003)(81166006)(77096006)(76176999)(305945005)(2351001)(50986999)(498600001)(110136004)(356003)(33646002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR0701MB2193; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT041; 1:mj7fDx93AAfy8PS7SmPStkCF/alCobMZ2oq3d+GUx4Ixy5GNq4KjNuND4WlDZcmA9x35QWfi2D5AjA0+noC79IOYBCrL2L60Jdhwt/B1iVCkvOnoMqyiaWETv/Z/QtlX5wCkntUL9moVnX28TgZYaXHdmi0Wp99qKuzjlRdJetDkJ/Y6nFtsAJfgg6akGPCSsphH1aw81iwlhhbiy/MYuXTcC+5V5J6fbwZz68cQhzJgcSyew0vTkQ1heM4H+hjeFHi8G3lVjm3WZC5LbJLpHux6GKEOCXi8a3Bib0rDo2tjn2NqF0A1vF4Ikji3j65E+mV7xFA81Ws7ZIG4voQbTAFi/0QYs7DChKXTAZ6IzbsuR7oOgqyFsSSeOQsHsPJadl/PvsEr/uCr9cnCkK7+hhLbVCSphzZxobQwhueBiQHl3ZyiTIhRVlbuIbA58iFGm0yBNtV5XhglP8tdiynw75BXC1aSDbO/vk/q2fKnfHGRmOeWE6SbuPR+2EYYB7m8xZ2X9Bb0fTJGWCrUJcMR6oUhncxYcFmySiUX3BEGIW98fP1FaxboLcPQOB5G0wJcwHjEpcd+4yO9KaeQzT8frYlIjfZo4T3GYKpYMMIUxZBN1CP3lDDTAG2jk1ZDyuqIH/6njPR+tvV7gALRt/QGksumRT8VxZvd1gavFMeR2ztBKomLDpaFME/18nAioSHy6hFb0uoXeOLC/Od6qGWUWmbsIUOIMxObnNl0Qy8puQOlOGtgBINW+VaPFnoLx3uyEuh6t3k4zAiCtTsjIqrJEWsmS+2OEWRY4UyDlH+YMIOw3MaIRpgf4cO+DK9/sNPTp07oKRSpQf1kEiZ/N04rsgO/dr+NC+I9p9GYg/n/Q7A= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e555d24c-ba8a-4b6c-0309-08d4c9eeeafb 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:AM4PR0701MB2193; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0701MB2193; 3:qJzwJnd1jRS50JNx7/DD2i5VmcEDBnQQ5vxRGVGN4hP2mIZEpdz++2JbVkHBKJO6x4TuMFI6zDURZ0KOMHmbN11M4vzK6ovdA74m4IyUit3v3bSz8V0rzcZmGzX/vgcEqovxWZeLURzalophhxwnAYJbw/r8ckRgFcExWAHz7fch6ITnDzKvP5u6xDmJ53orvPcqsra1nPYpM1x7PmZmTkdiAwBfsxq6L0cwAKCVv69cc1d87JkBrikxX1IgvxG8exjyH6HnB+Ub+qwuWwNV+x7LpHz4wZuFvDgwiIYPI0kjwQ8a3lVZhVeKaeBLkpoexvF4nOurVM0HoXMyH7FPHG7GBu8xNj/wV0BJq0WBQh1D/X+KsPP+pI2sh6YMiwoI2/6c0C3g/lRtYSH18Xh4p5HxOVYoM54iC9zL/bnBTFSaRmXDT1mJO3oAig5COc6H1ZCm//03/Fs8qtt4VVwYm3x8LyzRC82Avb9Wpg196XfNcYfzxEoqxVdMFOAvdOO26ADUyJkIhiNYyWcAPymwmhhci0lCkb5D/fdHCMqJz3qE/56EEdORR9BvUnbaIjFxOTToFZ8vlp6kRA9LInHlxpiRRir9dtz7P2CpubUSX/wU/1S0V/+dR8U0hlkPMsht/vlUe5QR7cpwH1Pc5nxJrAg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wQ2eLZhLe7DhnWjkSODFWC9qQ5vYzuYI/g7GnyD6HQBc0y4iJKCS4IebgA1k/cKjo/nQCwpgk6o+PxFp5vwMUhfzvGz4MS/JaNW4sYXqaFrpYoZ+pxcyOH8CqQ79DGw/d77WG4SAMnQ13RpuZNsurhjhvMPKvQXzOpWgefoKja0uICuPh/ZzTxBm02URHAKgVHN2oamRBTfc5ouQJoL9M9DuwyPagXUf45DoEBYC1tL9+2nT60gDD9kMuFuedsB8+tzwO0OJIYvdjJ1nIIcsBcP4LNY3dHzGTVuMmUk2ujHN3JCiwPU1jeyK31jMJhUQoxJRfOzDd4VSCwNHKONAfMo5ej8tNHa76RXnscjXT4MxHbsb5aHZf1UaMGKSLTUEaMhkaPDfjoHmt45G6j+uIUD6LZOtF8nN2lN/5GKr8oxl9M6wDV4y2gmEQRS9UgFRzIpftqWZW2ZgEyVwKMoBXKAby3MOkqqAFEoWkYUkGXqu0YyneUyk9qFa7h8= X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(13013025)(13021025)(8121501046)(100000703101)(100105400095)(93006095)(93003095)(3002001)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM4PR0701MB2193; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM4PR0701MB2193; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0701MB2193; 4:GqkST1KmEJfg1MppTvllaPTnFwwmOVVsuaeNWRIF?= M+iClZdDsMr064P2nI7f3NedFjGXKcILRwOi+QK9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zh1PX1EtcAPdvEkDDTLA5tXFbP/zaVpRJMdbP0tQKKJN+haWqWzZ+ii/xj9VyrOct5xGnnaUF7dhzR3ofh/J3bP4mqWvkQkoj0i3ISDI8Ig3FSG7Rr5ICYbVwQSZYyBUDJDomChLZBMAMxg54UFT860eMEEFDkuktSg7Ce354qcy355rYFnO3YmwKDYUtTLyoTdVfTY/CKRsCHVblq2Ugu+TljRRpu+htdmTEBD5JesbXzCODdmaJmZf4RZaMnMxdDV8QSzuQZ/Vy/Gf8Q9lY00AKT2UcxTWgeOoTruUhpeFR3xhxmNNdh01gGjd5NCVPxAz4C0sQemCr2z+tBadR19d8uZ/zFvU5umfQuAvgb7rEchRXPBENAz1MyqL9x3PROCe1wJGmhE2EhER57G2dNibdSdctDiPI3pFQGP6+dLh0nZz/RH4AqIVZinQqTq9Fy5jEHxlY/Tlr4qfEPbCYK73dwMfz9OJr6Y5y9UDzwXRxv9xth+9ComeZThy6k0tOyCwvmfbNByyDrhzaTO202Oe27Fmb9b1pwW9IJzC8h7IQd44sl0zQhJXsa8e31qWnZOJigrccNoHZAFrHIRLasMjuOxhyVPF595lhbIZ1AvlPTk37unsu9YqRzgpLoWIFws= X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 12:58:54.5925 (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.241]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0701MB2193 Subject: [lng-odp] [PATCH v2 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 | 74 +++++++--------------- 2 files changed, 22 insertions(+), 57 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 348d609a..904c9ef2 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -422,43 +422,34 @@ static int queue_int_enq(queue_t q_int, odp_buffer_hdr_t *buf_hdr) static int 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 = handle_to_qentry(handle); + + if (odp_unlikely(num == 0)) + return 0; if (num > QUEUE_MULTI_MAX) num = QUEUE_MULTI_MAX; - queue = handle_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(qentry_to_int(queue), - buf_hdr, num); + return queue->s.enqueue_multi(qentry_to_int(queue), + (odp_buffer_hdr_t **)(uintptr_t)ev, num); } static int queue_enq(odp_queue_t handle, odp_event_t ev) { - odp_buffer_hdr_t *buf_hdr; - queue_entry_t *queue; - - queue = handle_to_qentry(handle); - buf_hdr = buf_hdl_to_hdr(odp_buffer_from_event(ev)); + queue_entry_t *queue = handle_to_qentry(handle); - return queue->s.enqueue(qentry_to_int(queue), buf_hdr); + return queue->s.enqueue(qentry_to_int(queue), + (odp_buffer_hdr_t *)(uintptr_t)ev); } -static inline int deq_multi(queue_t q_int, odp_buffer_hdr_t *buf_hdr[], +static inline int deq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num) { odp_buffer_hdr_t *hdr, *next; int i, j; - queue_entry_t *queue; int updated = 0; int status_sync = sched_fn->status_sync; - queue = qentry_from_int(q_int); LOCK(&queue->s.lock); if (odp_unlikely(queue->s.status < QUEUE_STATUS_READY)) { /* Bad queue, or queue has been destroyed. @@ -529,15 +520,18 @@ static inline int deq_multi(queue_t q_int, odp_buffer_hdr_t *buf_hdr[], static int queue_int_deq_multi(queue_t q_int, odp_buffer_hdr_t *buf_hdr[], int num) { - return deq_multi(q_int, buf_hdr, num); + queue_entry_t *queue = qentry_from_int(q_int); + + return deq_multi(queue, buf_hdr, num); } static odp_buffer_hdr_t *queue_int_deq(queue_t q_int) { + queue_entry_t *queue = qentry_from_int(q_int); odp_buffer_hdr_t *buf_hdr = NULL; int ret; - ret = deq_multi(q_int, &buf_hdr, 1); + ret = deq_multi(queue, &buf_hdr, 1); if (ret == 1) return buf_hdr; @@ -545,38 +539,22 @@ static odp_buffer_hdr_t *queue_int_deq(queue_t q_int) return NULL; } -static int queue_deq_multi(odp_queue_t handle, odp_event_t events[], int num) +static int 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 = handle_to_qentry(handle); if (num > QUEUE_MULTI_MAX) num = QUEUE_MULTI_MAX; - queue = handle_to_qentry(handle); - - ret = queue->s.dequeue_multi(qentry_to_int(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(qentry_to_int(queue), + (odp_buffer_hdr_t **)ev, num); } - static odp_event_t queue_deq(odp_queue_t handle) { - queue_entry_t *queue; - odp_buffer_hdr_t *buf_hdr; - - queue = handle_to_qentry(handle); - buf_hdr = queue->s.dequeue(qentry_to_int(queue)); - - if (buf_hdr) - return event_from_buf_hdr(buf_hdr); + queue_entry_t *queue = handle_to_qentry(handle); - return ODP_EVENT_INVALID; + return (odp_event_t)queue->s.dequeue(qentry_to_int(queue)); } static int queue_init(queue_entry_t *queue, const char *name, @@ -678,17 +656,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(qentry_to_int(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 Thu Jul 13 12:58:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 107678 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2184389qge; Thu, 13 Jul 2017 06:00:29 -0700 (PDT) X-Received: by 10.237.57.199 with SMTP id m65mr4839337qte.243.1499950829553; Thu, 13 Jul 2017 06:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499950829; cv=none; d=google.com; s=arc-20160816; b=Q8XTC7EtIDEc6mXelXSzwMKjnux9Wvf8bR9aAi8ZqsuZvXQAmWGoOjVc7ybhnSxjSq pazt/z3GF65bdU/wpkRkE9n8TOZoiKy3ntW6HmfJsVE9VI4pZSR2qcd2MpQY43hJGdDp 6PChZDVPkSS6VH6X5apLRls28gcuSlCFHzGrDUGk5ibcMInvQHSvXOeLoCg+2jQq4xhP 0GoNQUKASabyeo0VlPjZ/vl+HJoeO7i2TPFbm65m7LDqr2picm71EiqxtVsX1B8L9Hrv dMWkh+4NbKbfQaHTTezvEYXdZZOlpVvBwJlXEm9u1+HQmRiw7P+WDxJ8aAKEqoibRwXZ zFvg== 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=eglsA/251dwRGTOlXcOfiGjR9f5iwjdPZExPRLxAwKXiuuleGwJ/XLDVk/2CNZgfMO EgbSfKnu1dNsIYslQ56zJlif9wghbqzcD0pELw3PJVOsx+q9YeFw1qGdWLWFXNvlMpAL b9JEU7zRqXBtRRrUQillIurcjaEgSquBjaCng9IeCkB6esTtmDKqZp5E6t04uxYSs3JN gWP/uQhJrT9CabdLHOTe+B8OEtEa3OTfFc5uZXyBXnKqs9FTfbAYNo/Z44TYXzwDo+3/ 97U/TZ9G1cq2dZgqH8MgsHU/lZKAkgupL0ewRYMOBOVU3J+2h/fUJuxLIH1sdDdB/Gcf yXRA== 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 t13si5068324qtc.217.2017.07.13.06.00.29; Thu, 13 Jul 2017 06:00: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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 27D5D60833; Thu, 13 Jul 2017 13:00:29 +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=-4.7 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 47579644DC; Thu, 13 Jul 2017 12:59:27 +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 BC04F60D1A; Thu, 13 Jul 2017 12:59:12 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0104.outbound.protection.outlook.com [104.47.2.104]) by lists.linaro.org (Postfix) with ESMTPS id 937F560C35 for ; Thu, 13 Jul 2017 12:59:00 +0000 (UTC) Received: from VI1PR07CA0167.eurprd07.prod.outlook.com (2603:10a6:802:3e::15) by HE1PR07MB1050.eurprd07.prod.outlook.com (2a01:111:e400:581d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.4; Thu, 13 Jul 2017 12:58:58 +0000 Received: from DB5EUR03FT064.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::208) by VI1PR07CA0167.outlook.office365.com (2603:10a6:802:3e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1282.4 via Frontend Transport; Thu, 13 Jul 2017 12:58:57 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.241 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.241) by DB5EUR03FT064.mail.protection.outlook.com (10.152.21.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1240.9 via Frontend Transport; Thu, 13 Jul 2017 12:58:57 +0000 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v6DCwSch029201 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Jul 2017 15:58:28 +0300 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v6DCwSPe029185 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Thu, 13 Jul 2017 15:58:28 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Thu, 13 Jul 2017 15:58:28 +0300 Message-ID: <20170713125828.28230-3-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170713125828.28230-1-petri.savolainen@linaro.org> References: <20170713125828.28230-1-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:CAL; SCL:-1; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39410400002)(39400400002)(39450400003)(39860400002)(39840400002)(2980300002)(189002)(199003)(9170700003)(53936002)(110136004)(5003940100001)(33646002)(356003)(38730400002)(36756003)(50226002)(305945005)(77096006)(2906002)(626005)(50986999)(189998001)(2351001)(76176999)(48376002)(2950100002)(6916009)(498600001)(50466002)(8676002)(8936002)(22756006)(105596002)(1076002)(106466001)(47776003)(575784001)(86362001)(81166006)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB1050; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT064; 1:FCtbBBuxfrVIV+rR5ZKvg/j7IRVsq9OUFLOkz+klnuWeLROMBS1szC/8kuaht9/N0b2lqdJNsxL45QeuUV5TMMZ1Zd9Acef2F4XAEqqswxyQQa0t0VrqAO7Hwlz6ocO6DGYANt9/ctGaXsbSaJwZirkEb6VCVimsWaFq/zs5FAKIui9pVSad+ejKgTVuLdt3TVdMYUDc/eTGYrDBpShesr37wWQc/zy/DLswrYU0AvNXfBpJ5h5fMMPCUeNYrtwO/F22sf4DFl5sh0/B1C5I6eocWr2Zeg4CjnpOiaXgBxKSqfEPuGfyGVzd5sabyEa7lGeQM3BBaT2ojDVvq4AMxUSo0cmrOcFNtzZE9zNXMHGGauV77RMaNtwDQjL8tCIybxFuoaBpIUoMD6UDfV99JRIPXsezCOQk+lxJrJXlsZxAGJoiSv/o5sAmcwgXly7n8AcvrUQaTK46wRZI1PZPrZtuLVyhxPvMrEpAPCTqDU8k/v1vsdCwpPO8JxPCsLCk5nDa3CtVSJ5mAFWBpM+Yy+U1KWcI6yN1pe8gW2XkRalsSPxN+Ogm7URSyy3Vy4BkRSnCHrGeLC5sLkVet9U2GRBXvYFemDgYVF0ZYSWA649H0TYtT9XiTsiGZKPmWkzbe/hpSwFx3SbsL7QIfvxLAVAvtuCvaWYjaFla+4lA2vdAMRp49n0ODP1SJcbHbgWzX7sp4pJlmmD8MUmjz/f9s5oM1ndvd1htrH+eG7rM84jXjJsbK1C528z/oUg9JxaIY0w/gByRtnF0Cp4dVNEcqW1SPHyrHFm9+zQQ4R659irXOZFOfuKnfeU4AUJE2lHcgI1tPVZZVu6ya5fLNybh0nktxrPy+rctCRr0NBMOVPk= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f0e6fc9-b701-46ac-7d02-08d4c9eeec94 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:HE1PR07MB1050; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1050; 3:u0oR0iq/UdlVDtejbtiI4WE7CLLb44nHt+EhJ8w12cs4mtfZiwjqmWFpAVjNS7tbTaa2WwHddAkNEsKPAptqzQPHc8ds58XyCyzK7DanE9bRuFWA9VaR2xDeswzX3pfb36T0t+Xh2334b77XLFQBSI0tmMwvlmDxaCAt0NUg4tQM7bC36ytzB37DhcQtZcaxfMBx5dJC94f9twzFpfqdXN/5fDtPhHSPN3j9D3jR64DNTBR9gcSMBa9jKBujmDQ46VU2+eYpy6iHDZvG7PKiZSVo85SWGEIzNNNQRMuR8ib7oG+9belVDCeERUr+2t7dO1KuH2N+N+APn4WZGG9MZZIX068YbpH8E5UTUq8GFsddJxzIXjad7iNwrcrggb3sj0b4hG2nJ5n9c/pFCWe3Fvj36L37hTvCgYbWUbxKKJfoQn97wL5ODG2gKx7VJC/cTUNIbqpGOcdIA9XOi64b1QFx7ags7uBcrEaIYAjFtq9+FwrCi1ta5/FP5FcK1vUeSo560iAXJi+vzisku9gWUHif3yLtvk0oC9WchOu1ys0mVp3B787Yl9AljScdQ3GmeMcikz1umRlYTS1Ccjo9P22gWGeUrBbHJe1/lgIh4ut+2tKFFjbijpEJ8bWoefIiCyGV2opuHE/T66ItEq0puabnJGgYQ1GL1u7ikqbPAEWPtR3PPzsuk/kcBw7gZXutoTDy735hot6cmYhbKkyN2GBW+38qkFhoyei4ox5MkfCxO5SyrWnD5Sek7byYljIJ+kgaoAG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SXwq3uQH6Dnq+YChec0I8ut0KeBDKXhf0MoKVMgMXBKtRWUZ4wD90dOoZWH54rAo5EQ5kSCT4E4xEJcLZaUluVFc2JEcxgBPQeWp/1LcQ3O52xosalyaX52iypplvR/pYzIzQdQxDLaQRjt2mCsrf7m0mZZtKnuKjtge8Y9x5Rpi0B1MYI+yVyct1WcktrI4mcmwK2jq5Ry/38B6ObBcoOf/smi4FXp8FPryeMHYnhEVpqBUuO7Jp2OiYPMEnfq0vEi9Z0OTxwbuVms9T3iCZcwZJyOj8ZWCbIALymS+MaMJfuxRZdK6IIi2HEAo4j78Gt9YXZyDiFqm1TmtGwubDRCcV9uSBuV6rY8NaO3+1XRLINvQABwwENVCS/VHGyYSE/SXvTjME3oNLEt4cEyE0Vi1NijOpfNuyPme+kmwERaTSWjLBtJg= X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(148574349560750); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(13013025)(2017060910075)(13021025)(8121501046)(10201501046)(93006095)(93003095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123560025)(20161123558100)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR07MB1050; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR07MB1050; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR07MB1050; 4:7/4D8zn8m++ZWGya/u/QT2GXMHnjD8HvaX3JIRa5gr?= g+F6mM0JZCRiP9RrHqPkGHjjqiHgDSyfJl/bj6ghv40EntBd2frARQubtYUXn2zml73ZUNgARpyJLY2sQIM6u4U95PKG9H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U1xNCV2ugaJo+m33uPJbrNVOOQgcfNA4+/zPklkM+Nnfr/uUgQ+BookGERb7H7H8vkJWmyxIJgDxGWkzE82dcgBnY8vGBwGdBTDIA3qrMQyeCf4C0Y7kiwUITwjuP0AVeJ88jQybKISEePcIAb+3bj8fCUWZU2vI28VnUY6659QH65q2y9FuLdFE94qvkD1s2THTgF0bF29ikKzZqCoAqaRkupBTIqI3wiB X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1050; 5:6lm+ZsDuZxrokPs1Vyyl/Un35SvSpEdqfYsBWeWiESREGaZFD4scgj3UoEautPEsqZxAteWGGRExHXeJdiZ8UWtBEP9GpTH5Pyxf8V1Bk9hx0p1l5UO8XrHqWzBEunUW6hF8Da8eOKM0Z8FZTvj0Qu27k9f76dVBvm3xUVe0o7KIibRtt11TXnDF6awGoXc7ACVKaqEUnRg4kRbgDk5M+/HI4Wf/T70CyUZNPSaFnD81nClJgeXoHU4lgnowJtJTAZlrA4sM1m4DKJ6EqfOWumLqyd2CgBZzOvdppTWPjFt1amyb15m3yTNxj21DZlZmV1mDl3/zJsiPRBBeerpP1nNt3zA4vmOsdU651jD1z0uVIUu8oJ83Ct6DsSmhSOycdvTN61W/l5LZOwEcK8iEisHxuHy7LTKbCSzNJ1CQkOw30kdmpr/v2pgYDBbeKdYY5u6FIHTMdg01tbHMPPCQdWkXHKRCyCAVnw2fDmHMdTw/xLwK8M5l0/GhgbxsN+pG; 24:qxidZdfNxN4zIe2aaAhKf+eT7OeterqA6RDYaS0ZEWBrwAOlmcgEEEYT4zq9QI28PMTDyNopFQHpBkbkvKG+y50F/qMtluWGaNDfa9lQ+ZA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1050; 7:+Rl9/GAHKkgBDpzMXv4CY5pF/4AJhtfy6tRqaBkhsASA+GmGl+nMaOy5nYfmkSIm4JizH62vXORS7H9pcUz33H85mWrAai4GxvTJqKg7D7OMXE9JIoBSfBdg54BF/z2iYY8KxrKZJgsQc03K5uoq61f91WNyEs7PDh9khumIFRpULG4Co6yL/yO4YfYuCDoWCyJVKS+ZqeDHsJFFh+MHO7o33VWDSpL6yle2ogFEfWgUjocuIwhnskGUbUXxpj8o14KgwRpry/nxnGcd01pVcK5ayopw96nifleCToS8YOzD44jwKCbCLS7AGLbClcS85n13FNKwjBf51CngVtEvFDCi2y3SKidKQgaQtNDzqjCyqdpEbfebKZmXFQaSornFUtU+sGNjflnN0kaCgQjmbZ6E4bTFvG/s8qqtyrJdxNA6lbIzXR3FjtWy16q0rxkhia2I3MVhxyyKGLsoC6T/MMQlQiVbeBX4tcOY5oK0uUT9+Ywuk2gr/tCkJsfEv2ENx9Jt80GdEcFdz+esQ3Ar99LofBWOQhvraaRGkuG7ZqRhM4dZcsCKKQovcbk22nepy1me18/HXXiSod2crvSoThgny3MRIl+XWjuL+7L5pBv1MGFuir7l4eD21k0w8VDbYS8LMcBg2bPFqEI/pkbTgZc0YL6D/uU+DeiKOhk5CpEjSm1pumeATD9cWe6kEGs7hC57T8Ci5rs6PC6YDSP+2YJjPbDFZJszjNNebxvm9lNYCV8reMZe2KxyEjAM2AAo6Do4BmKGqvaHVXiqEI4voLqdGXUb6eaXD+kA0ZpK+Rs= X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 12:58:57.2758 (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.241]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB1050 Subject: [lng-odp] [PATCH v2 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)