From patchwork Wed Feb 8 12:17:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93627 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2702091obz; Wed, 8 Feb 2017 04:23:29 -0800 (PST) X-Received: by 10.36.22.12 with SMTP id a12mr15895334ita.51.1486556609006; Wed, 08 Feb 2017 04:23:29 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j1si1581620iti.75.2017.02.08.04.23.28; Wed, 08 Feb 2017 04:23:28 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 73B76634D5; Wed, 8 Feb 2017 12:23:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-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 A107E634BC; Wed, 8 Feb 2017 12:19:09 +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 DA0B2634C5; Wed, 8 Feb 2017 12:19:00 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0111.outbound.protection.outlook.com [104.47.0.111]) by lists.linaro.org (Postfix) with ESMTPS id 1673763489 for ; Wed, 8 Feb 2017 12:18:12 +0000 (UTC) Received: from VI1PR07CA0069.eurprd07.prod.outlook.com (10.164.94.165) by DB5PR07MB1622.eurprd07.prod.outlook.com (10.166.12.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Wed, 8 Feb 2017 12:18:07 +0000 Received: from AM1FFO11FD044.protection.gbl (2a01:111:f400:7e00::128) by VI1PR07CA0069.outlook.office365.com (2a01:111:e400:5967::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5 via Frontend Transport; Wed, 8 Feb 2017 12:18:07 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.35 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.35) by AM1FFO11FD044.mail.protection.outlook.com (10.174.64.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.7 via Frontend Transport; Wed, 8 Feb 2017 12:18:07 +0000 Received: from fihe3nok1348.nsn-intra.net (10.158.36.136) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34; Wed, 8 Feb 2017 14:18:05 +0200 Received: from mailrelay.int.nokia.com (10.130.128.21) by fihe3nok1348.nsn-intra.net (10.158.36.136) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Wed, 8 Feb 2017 14:18:04 +0200 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 v18CHaQl022750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 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 v18CHavt022737 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Wed, 8 Feb 2017 14:17:32 +0200 Message-ID: <1486556256-22167-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> References: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.35; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(2980300002)(199003)(189002)(36756003)(76176999)(50986999)(33646002)(47776003)(2351001)(5003940100001)(105596002)(6666003)(97736004)(189998001)(2950100002)(5660300001)(6916009)(77096006)(92566002)(356003)(626004)(305945005)(81166006)(50226002)(81156014)(8676002)(8936002)(450100001)(48376002)(53936002)(68736007)(50466002)(110136004)(38730400002)(2906002)(86362001)(106466001)(22756006); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB1622; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD044; 1:fv3ssrV4rGZlubezk7vfFq5YPHpnFqQinLZ4hDPjbCco+XvkheCjrD8ieFsVjkcGB4weMBFXm/KMpf2VtZE4bymm87Rbl+NUPWHzp7Ft45ZxURtHeRHtSG44CGAp2ElhSudX3iQ9itgHMqXZ08SF7M3CI/yJWpu5bwdEdDO1Y5ouhFjse1csSuOQTVBKau1lnQ2R5MvGdx9tz7f+QSbed0mGiqvBCiKOHfOZM1J4gMg5uxUW35funK4B7diDxl7xK7dZCtJxKtBKcRYRBPCQlalrqCtFPkRfwtrZOj0Kqv1eAj9J8+pYUR7ObrwFfwxJDzNfZ6L7nkDkXX7NbLtACPZX9m5Crja0pceakeqEBbm1zzvoMnne0U8Z++uALHeDSORnUXciNnw4wyTboDZK5CLZNB6VkeFOgHHLEgh+kX4BrtKEPv+Bm8jo2kVFt07lHSDJfI4V5vhRXCyNSw6MGg7CdHy0onIvbpDjBGOhfGbc+BSyFwc8V3hsKP618krSwOHtRznP3aI5wkH6q9WjlA== X-MS-Office365-Filtering-Correlation-Id: 60d94c4c-9a5a-4b14-bdad-08d4501c8a5e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB5PR07MB1622; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1622; 3:ggLXSE1i8xQgHWGt153Crs9P3uNl+7LZ7h5DrpiBM20htlim8hNSftSiY3ZojJZ4DVDq9KrI1HkVimWnOGT4XDasOXmB7bwT8665mcyXcqVgB8zP6M2c4VDsbR/3sU0Gfma90OCzLrBscXX25VViaWy3EwDSK9JFlETEAVft085VXnRZ0XG5me9og12rY6jO8ZDmDmSE1Qf3w4hFTteTgdOJ4obl16q1gw1UKUfCo9NrwrbS/5rErixMg7RQySWihBTLn62L+J/HBb5L0HUY/B8SqcuIpsys6K+WB9NzLJ0Vo9hAPR0+R4d7JiLA4em0Ve2eH2U+z8RWT6hNhq1pnt5jdPlF50MhqAT7BHTF9ZI=; 25:pK7N3sGooXgDEtcrb1ZQMbd47r2li4y37iyUkPDvfwlp8ATxbed/Jq34/QqceBkES9wKfu2bcJ3a04udkYlklbF5C+pXs5pRXBwk40VAk/Gym7W+odBJ0sIIX/m7uYeqxCtY4PPob6ydez4kGqyVSxESL98Idb/i5H+fwQ2Kwjim9DSJhYgFCOPwAhQwA4Lb0daVOWQqpd7h1k3WZSjjHd7nzfWCi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5vOr7EQd2TH3VdU03IB+3mWt/6D0xpfdHUTSJIZCKwj5hcKV2zdOuG5LcEwNP3DlF0y+xX1Gbc8c17tR8cqCm0Q2TMmEkWPy44MfNjjAhWQjjjdyWnZJ3s4cK31Ue3i91v8cbCH2Rstggaw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(5005006)(20170203043)(8121501046)(2017020702029)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:DB5PR07MB1622; BCL:0; PCL:0; RULEID:; SRVR:DB5PR07MB1622; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1622; 4:PoaLGv3Huo5zKdTIMlf7OR6zFHLy1l5UVyNHE2MhNRqlBkeKaK9bmjaXVLMVFXoril/mJHfyZ1BjgTbySV3NpernwqUC4H5fj70EPPnsue48by0/tKMhkp3KmyYpdz5eyJ6DlLZMkCDlqOqeG7hCXFmhfIFrQ6mLRbaI6npuIDtp2gYJnXrEMYWlyPBnDpvGEZ0uTwWvsoZSXtD1R94LVyX/VvuzIIuLpFomkLNYpezUG7VOT4VSvntm0l4pneDZ+Zcrk8UHTrmyZmcJgqzcr1u4VoMoesJVV9YBjqNBxzLpJ2sxSmKyBaFshOS840bvIaE7YhD0idLuvpKaaNOYIJ9lrJwSg5SRKrpSZG+E9KufpwSsnb4VtMwgsEneJfKsGDFht4x+V/BVIQGqHZBuZGVKLKQIC3sEVld92RWe5GKMA7IaEUcEizmu/UWHsFEnQuzXkbBdtB4f2FA+BzVMUPOZUG53jrDCSJc7HnMjAaYdzHJLThPXxRsjQ4ibumgQjivKQ8zrJE6wQe6n3Hch8D2glOhg9o5sByfUgdHasqKBKNJ00PUMY2SgMq1xFYrzAfpq+VcAsgzukdwGMNFudLwuymneN8oYqLTq2dgByCHn0tnuLdz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ics: 1; DB5PR07MB1622; 7:QbZ3/C2EncxcIxnB4bESblsqI3lUPX/Ds2kka+Xe14j/Z7XnDgbUHbJ5+3lofgVSmr1MWHd2wwXfOTRkb0TReEWdxec61HxaXhBduyyRuA0KSS8GZ46EkKgSvDCQE61badWGnuJ1o7iKk8dzaS4gF1iW0J91ZFrsaJgFngVoJcJcZltvWnONOAow6ihlEfnbXQWUVUt7txSthSGcRhKtmLBP/Quuvv5i7oc3XYC48jzMpWR7IQlSg7nR3pEA9fA/u2EDSbp9q2Z4Qyy4HevbNqxAwxhkVF8+coLOJhy19p3RbystcwFLWIC8aWLzkGLUBUgaeGf6zv6pM3Ygndctg+mCuNYRRREmzmxlmgRFMTx6IHQx+XA5HcFNuD1pLGOcH/DAi2QkEzeG/WXKYNm5IRqsjhhRzctojkwSWqOLGBgyhLspNNoYD2ByrpROKAkzdiIqkOrtmn6tIUutIDNv4JAgvLh36S5HFMiW762Xv24VrD8q6C3yfYV6ApzC5LRofO4wuiFG8hSWeMIi/9Lt4Q== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 12:18:07.6073 (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.35]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB1622 Subject: [lng-odp] [PATCH v2 1/5] linux-gen: inline: rename _STATIC to _ODP_INLINE X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" This define is visible to applications through API headers. Use _ODP prefix to avoid name space collision. Also "inline" describes better the purpose of the macro than "static". Signed-off-by: Petri Savolainen --- .../include/odp/api/plat/atomic_inlines.h | 114 +++++++++++---------- .../include/odp/api/plat/byteorder_inlines.h | 24 ++--- .../include/odp/api/plat/static_inline.h.in | 8 +- .../include/odp/api/plat/std_clib_inlines.h | 6 +- .../include/odp/api/plat/sync_inlines.h | 6 +- 5 files changed, 82 insertions(+), 76 deletions(-) -- 2.8.1 diff --git a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h index 4471f2e..03b2884 100644 --- a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h @@ -13,63 +13,65 @@ #ifndef _ODP_PLAT_ATOMIC_INLINES_H_ #define _ODP_PLAT_ATOMIC_INLINES_H_ -_STATIC void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val) { __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom) +_ODP_INLINE uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom) { return __atomic_load_n(&atom->v, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val) { __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom, + uint32_t val) { return __atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_add_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_add_u32(odp_atomic_u32_t *atom, uint32_t val) { (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_fetch_sub_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE uint32_t odp_atomic_fetch_sub_u32(odp_atomic_u32_t *atom, + uint32_t val) { return __atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_sub_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_sub_u32(odp_atomic_u32_t *atom, uint32_t val) { (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_fetch_inc_u32(odp_atomic_u32_t *atom) +_ODP_INLINE uint32_t odp_atomic_fetch_inc_u32(odp_atomic_u32_t *atom) { return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_inc_u32(odp_atomic_u32_t *atom) +_ODP_INLINE void odp_atomic_inc_u32(odp_atomic_u32_t *atom) { (void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_fetch_dec_u32(odp_atomic_u32_t *atom) +_ODP_INLINE uint32_t odp_atomic_fetch_dec_u32(odp_atomic_u32_t *atom) { return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_dec_u32(odp_atomic_u32_t *atom) +_ODP_INLINE void odp_atomic_dec_u32(odp_atomic_u32_t *atom) { (void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED); } -_STATIC int odp_atomic_cas_u32(odp_atomic_u32_t *atom, uint32_t *old_val, - uint32_t new_val) +_ODP_INLINE int odp_atomic_cas_u32(odp_atomic_u32_t *atom, uint32_t *old_val, + uint32_t new_val) { return __atomic_compare_exchange_n(&atom->v, old_val, new_val, 0 /* strong */, @@ -77,12 +79,13 @@ _STATIC int odp_atomic_cas_u32(odp_atomic_u32_t *atom, uint32_t *old_val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_xchg_u32(odp_atomic_u32_t *atom, uint32_t new_val) +_ODP_INLINE uint32_t odp_atomic_xchg_u32(odp_atomic_u32_t *atom, + uint32_t new_val) { return __atomic_exchange_n(&atom->v, new_val, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_max_u32(odp_atomic_u32_t *atom, uint32_t new_max) +_ODP_INLINE void odp_atomic_max_u32(odp_atomic_u32_t *atom, uint32_t new_max) { uint32_t old_val; @@ -94,7 +97,7 @@ _STATIC void odp_atomic_max_u32(odp_atomic_u32_t *atom, uint32_t new_max) } } -_STATIC void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min) +_ODP_INLINE void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min) { uint32_t old_val; @@ -106,7 +109,7 @@ _STATIC void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min) } } -_STATIC void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val) { atom->v = val; #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 @@ -114,7 +117,7 @@ _STATIC void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom) +_ODP_INLINE uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, (void)0); @@ -123,7 +126,7 @@ _STATIC uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom) #endif } -_STATIC void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v = val); @@ -132,7 +135,8 @@ _STATIC void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom, + uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v += val); @@ -141,7 +145,7 @@ _STATIC uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v += val); @@ -150,7 +154,8 @@ _STATIC void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom, + uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v -= val); @@ -159,7 +164,7 @@ _STATIC uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v -= val); @@ -168,7 +173,7 @@ _STATIC void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom) +_ODP_INLINE uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v++); @@ -177,7 +182,7 @@ _STATIC uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom) #endif } -_STATIC void odp_atomic_inc_u64(odp_atomic_u64_t *atom) +_ODP_INLINE void odp_atomic_inc_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v++); @@ -186,7 +191,7 @@ _STATIC void odp_atomic_inc_u64(odp_atomic_u64_t *atom) #endif } -_STATIC uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom) +_ODP_INLINE uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v--); @@ -195,7 +200,7 @@ _STATIC uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom) #endif } -_STATIC void odp_atomic_dec_u64(odp_atomic_u64_t *atom) +_ODP_INLINE void odp_atomic_dec_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v--); @@ -204,8 +209,8 @@ _STATIC void odp_atomic_dec_u64(odp_atomic_u64_t *atom) #endif } -_STATIC int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val, - uint64_t new_val) +_ODP_INLINE int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val, + uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 int ret; @@ -219,7 +224,8 @@ _STATIC int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val, #endif } -_STATIC uint64_t odp_atomic_xchg_u64(odp_atomic_u64_t *atom, uint64_t new_val) +_ODP_INLINE uint64_t odp_atomic_xchg_u64(odp_atomic_u64_t *atom, + uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v = new_val); @@ -228,7 +234,7 @@ _STATIC uint64_t odp_atomic_xchg_u64(odp_atomic_u64_t *atom, uint64_t new_val) #endif } -_STATIC void odp_atomic_max_u64(odp_atomic_u64_t *atom, uint64_t new_max) +_ODP_INLINE void odp_atomic_max_u64(odp_atomic_u64_t *atom, uint64_t new_max) { uint64_t old_val; @@ -240,7 +246,7 @@ _STATIC void odp_atomic_max_u64(odp_atomic_u64_t *atom, uint64_t new_max) } } -_STATIC void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min) +_ODP_INLINE void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min) { uint64_t old_val; @@ -252,28 +258,28 @@ _STATIC void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min) } } -_STATIC uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom) +_ODP_INLINE uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom) { return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE); } -_STATIC void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom, uint32_t val) { __atomic_store_n(&atom->v, val, __ATOMIC_RELEASE); } -_STATIC void odp_atomic_add_rel_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_add_rel_u32(odp_atomic_u32_t *atom, uint32_t val) { (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELEASE); } -_STATIC void odp_atomic_sub_rel_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_sub_rel_u32(odp_atomic_u32_t *atom, uint32_t val) { (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELEASE); } -_STATIC int odp_atomic_cas_acq_u32(odp_atomic_u32_t *atom, - uint32_t *old_val, uint32_t new_val) +_ODP_INLINE int odp_atomic_cas_acq_u32(odp_atomic_u32_t *atom, + uint32_t *old_val, uint32_t new_val) { return __atomic_compare_exchange_n(&atom->v, old_val, new_val, 0 /* strong */, @@ -281,8 +287,8 @@ _STATIC int odp_atomic_cas_acq_u32(odp_atomic_u32_t *atom, __ATOMIC_RELAXED); } -_STATIC int odp_atomic_cas_rel_u32(odp_atomic_u32_t *atom, - uint32_t *old_val, uint32_t new_val) +_ODP_INLINE int odp_atomic_cas_rel_u32(odp_atomic_u32_t *atom, + uint32_t *old_val, uint32_t new_val) { return __atomic_compare_exchange_n(&atom->v, old_val, new_val, 0 /* strong */, @@ -290,9 +296,9 @@ _STATIC int odp_atomic_cas_rel_u32(odp_atomic_u32_t *atom, __ATOMIC_RELAXED); } -_STATIC int odp_atomic_cas_acq_rel_u32(odp_atomic_u32_t *atom, - uint32_t *old_val, - uint32_t new_val) +_ODP_INLINE int odp_atomic_cas_acq_rel_u32(odp_atomic_u32_t *atom, + uint32_t *old_val, + uint32_t new_val) { return __atomic_compare_exchange_n(&atom->v, old_val, new_val, 0 /* strong */, @@ -300,7 +306,7 @@ _STATIC int odp_atomic_cas_acq_rel_u32(odp_atomic_u32_t *atom, __ATOMIC_RELAXED); } -_STATIC uint64_t odp_atomic_load_acq_u64(odp_atomic_u64_t *atom) +_ODP_INLINE uint64_t odp_atomic_load_acq_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, (void)0); @@ -309,7 +315,7 @@ _STATIC uint64_t odp_atomic_load_acq_u64(odp_atomic_u64_t *atom) #endif } -_STATIC void odp_atomic_store_rel_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_store_rel_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v = val); @@ -318,7 +324,7 @@ _STATIC void odp_atomic_store_rel_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC void odp_atomic_add_rel_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_add_rel_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v += val); @@ -327,7 +333,7 @@ _STATIC void odp_atomic_add_rel_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC void odp_atomic_sub_rel_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_sub_rel_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v -= val); @@ -336,8 +342,8 @@ _STATIC void odp_atomic_sub_rel_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC int odp_atomic_cas_acq_u64(odp_atomic_u64_t *atom, - uint64_t *old_val, uint64_t new_val) +_ODP_INLINE int odp_atomic_cas_acq_u64(odp_atomic_u64_t *atom, + uint64_t *old_val, uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 int ret; @@ -351,8 +357,8 @@ _STATIC int odp_atomic_cas_acq_u64(odp_atomic_u64_t *atom, #endif } -_STATIC int odp_atomic_cas_rel_u64(odp_atomic_u64_t *atom, - uint64_t *old_val, uint64_t new_val) +_ODP_INLINE int odp_atomic_cas_rel_u64(odp_atomic_u64_t *atom, + uint64_t *old_val, uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 int ret; @@ -366,9 +372,9 @@ _STATIC int odp_atomic_cas_rel_u64(odp_atomic_u64_t *atom, #endif } -_STATIC int odp_atomic_cas_acq_rel_u64(odp_atomic_u64_t *atom, - uint64_t *old_val, - uint64_t new_val) +_ODP_INLINE int odp_atomic_cas_acq_rel_u64(odp_atomic_u64_t *atom, + uint64_t *old_val, + uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 int ret; diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h index c91a3b1..e781890 100644 --- a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h @@ -21,7 +21,7 @@ extern "C" { * @{ */ -_STATIC uint16_t odp_be_to_cpu_16(odp_u16be_t be16) +_ODP_INLINE uint16_t odp_be_to_cpu_16(odp_u16be_t be16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __odp_builtin_bswap16((__odp_force uint16_t)be16); @@ -30,7 +30,7 @@ _STATIC uint16_t odp_be_to_cpu_16(odp_u16be_t be16) #endif } -_STATIC uint32_t odp_be_to_cpu_32(odp_u32be_t be32) +_ODP_INLINE uint32_t odp_be_to_cpu_32(odp_u32be_t be32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __builtin_bswap32((__odp_force uint32_t)be32); @@ -39,7 +39,7 @@ _STATIC uint32_t odp_be_to_cpu_32(odp_u32be_t be32) #endif } -_STATIC uint64_t odp_be_to_cpu_64(odp_u64be_t be64) +_ODP_INLINE uint64_t odp_be_to_cpu_64(odp_u64be_t be64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __builtin_bswap64((__odp_force uint64_t)be64); @@ -48,7 +48,7 @@ _STATIC uint64_t odp_be_to_cpu_64(odp_u64be_t be64) #endif } -_STATIC odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) +_ODP_INLINE odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u16be_t)__odp_builtin_bswap16(cpu16); @@ -57,7 +57,7 @@ _STATIC odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) #endif } -_STATIC odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) +_ODP_INLINE odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u32be_t)__builtin_bswap32(cpu32); @@ -66,7 +66,7 @@ _STATIC odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) #endif } -_STATIC odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) +_ODP_INLINE odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u64be_t)__builtin_bswap64(cpu64); @@ -75,7 +75,7 @@ _STATIC odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) #endif } -_STATIC uint16_t odp_le_to_cpu_16(odp_u16le_t le16) +_ODP_INLINE uint16_t odp_le_to_cpu_16(odp_u16le_t le16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint16_t)le16; @@ -84,7 +84,7 @@ _STATIC uint16_t odp_le_to_cpu_16(odp_u16le_t le16) #endif } -_STATIC uint32_t odp_le_to_cpu_32(odp_u32le_t le32) +_ODP_INLINE uint32_t odp_le_to_cpu_32(odp_u32le_t le32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint32_t)le32; @@ -93,7 +93,7 @@ _STATIC uint32_t odp_le_to_cpu_32(odp_u32le_t le32) #endif } -_STATIC uint64_t odp_le_to_cpu_64(odp_u64le_t le64) +_ODP_INLINE uint64_t odp_le_to_cpu_64(odp_u64le_t le64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint64_t)le64; @@ -102,7 +102,7 @@ _STATIC uint64_t odp_le_to_cpu_64(odp_u64le_t le64) #endif } -_STATIC odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) +_ODP_INLINE odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u16le_t)cpu16; @@ -111,7 +111,7 @@ _STATIC odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) #endif } -_STATIC odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) +_ODP_INLINE odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u32le_t)cpu32; @@ -120,7 +120,7 @@ _STATIC odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) #endif } -_STATIC odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64) +_ODP_INLINE odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u64le_t)cpu64; diff --git a/platform/linux-generic/include/odp/api/plat/static_inline.h.in b/platform/linux-generic/include/odp/api/plat/static_inline.h.in index 4562a22..3cf0043 100644 --- a/platform/linux-generic/include/odp/api/plat/static_inline.h.in +++ b/platform/linux-generic/include/odp/api/plat/static_inline.h.in @@ -25,15 +25,15 @@ extern "C" { /** * @internal - * @def _STATIC - * Control conditional static inline expansions for ABI compatibility + * @def _ODP_INLINE + * Define a function as inlined or not inlined (for ABI compatibility) */ #if @ODP_ABI_COMPAT@ #define ODP_ABI_COMPAT 1 -#define _STATIC +#define _ODP_INLINE #else #define ODP_ABI_COMPAT 0 -#define _STATIC static inline +#define _ODP_INLINE static inline #endif #ifdef __cplusplus diff --git a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h index 2e833e4..8f505d0 100644 --- a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h @@ -14,17 +14,17 @@ extern "C" { #include #include -_STATIC void *odp_memcpy(void *dst, const void *src, size_t num) +_ODP_INLINE void *odp_memcpy(void *dst, const void *src, size_t num) { return memcpy(dst, src, num); } -_STATIC void *odp_memset(void *ptr, int value, size_t num) +_ODP_INLINE void *odp_memset(void *ptr, int value, size_t num) { return memset(ptr, value, num); } -_STATIC int odp_memcmp(const void *ptr1, const void *ptr2, size_t num) +_ODP_INLINE int odp_memcmp(const void *ptr1, const void *ptr2, size_t num) { return memcmp(ptr1, ptr2, num); } diff --git a/platform/linux-generic/include/odp/api/plat/sync_inlines.h b/platform/linux-generic/include/odp/api/plat/sync_inlines.h index 245c750..76eb681 100644 --- a/platform/linux-generic/include/odp/api/plat/sync_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/sync_inlines.h @@ -21,17 +21,17 @@ extern "C" { * @{ */ -_STATIC void odp_mb_release(void) +_ODP_INLINE void odp_mb_release(void) { __atomic_thread_fence(__ATOMIC_RELEASE); } -_STATIC void odp_mb_acquire(void) +_ODP_INLINE void odp_mb_acquire(void) { __atomic_thread_fence(__ATOMIC_ACQUIRE); } -_STATIC void odp_mb_full(void) +_ODP_INLINE void odp_mb_full(void) { __atomic_thread_fence(__ATOMIC_SEQ_CST); } From patchwork Wed Feb 8 12:17:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93622 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2699968obz; Wed, 8 Feb 2017 04:18:16 -0800 (PST) X-Received: by 10.55.47.69 with SMTP id v66mr19093710qkh.222.1486556296099; Wed, 08 Feb 2017 04:18:16 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d77si5468713qkj.21.2017.02.08.04.18.15; Wed, 08 Feb 2017 04:18:16 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 32D8B634BE; Wed, 8 Feb 2017 12:18:15 +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 1A5066347E; Wed, 8 Feb 2017 12:18:09 +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 C5CAD6347E; Wed, 8 Feb 2017 12:18:05 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0135.outbound.protection.outlook.com [104.47.1.135]) by lists.linaro.org (Postfix) with ESMTPS id 5194662FE2 for ; Wed, 8 Feb 2017 12:18:04 +0000 (UTC) Received: from VI1PR07CA0066.eurprd07.prod.outlook.com (10.164.94.162) by VI1PR07MB1629.eurprd07.prod.outlook.com (10.166.142.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Wed, 8 Feb 2017 12:18:02 +0000 Received: from AM1FFO11FD044.protection.gbl (2a01:111:f400:7e00::191) by VI1PR07CA0066.outlook.office365.com (2a01:111:e400:5967::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5 via Frontend Transport; Wed, 8 Feb 2017 12:18:02 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.35 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.35) by AM1FFO11FD044.mail.protection.outlook.com (10.174.64.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.7 via Frontend Transport; Wed, 8 Feb 2017 12:18:02 +0000 Received: from fihe3nok1348.nsn-intra.net (10.158.36.136) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34; Wed, 8 Feb 2017 14:18:01 +0200 Received: from mailrelay.int.nokia.com (10.130.128.21) by fihe3nok1348.nsn-intra.net (10.158.36.136) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Wed, 8 Feb 2017 14:18:00 +0200 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 v18CHabn022753 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 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 v18CHavu022737 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Wed, 8 Feb 2017 14:17:33 +0200 Message-ID: <1486556256-22167-3-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> References: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.35; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39840400002)(39860400002)(39410400002)(39850400002)(39450400003)(2980300002)(199003)(189002)(2351001)(50466002)(50986999)(33646002)(92566002)(48376002)(86362001)(53936002)(76176999)(22756006)(77096006)(8936002)(6916009)(105596002)(36756003)(6666003)(47776003)(2950100002)(575784001)(106466001)(97736004)(5003940100001)(38730400002)(110136004)(356003)(81166006)(81156014)(8676002)(626004)(450100001)(305945005)(50226002)(2906002)(189998001)(5660300001)(68736007); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB1629; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD044; 1:LZGn5SXjNgyi6xpt+oB2jeWHxPkRm18SV8MMWMKu8LXO+rPc0L7WY6WG4DQqa5FhDlIwd0GMAiNTSjZeL55NvqGdHMWJbeYoUFB97+qu9+puNzb3RWP4+OibbBUr5AR6UMNecRdLxg/5J+jhYOPt/tKPAoL2nslWPsidtHFuXSm+ODgsNblYWqCVEYJjGglslptOwp9fpAWTW9cjuzoIjV2SSwK5ugD+oumWITMu6AV+rxw6XhFu5WDnJleMPKBWie/u6EyPm2Vmbk18LUbd2ZkB2uAqQj7l1YLLLzkg/iOuv/OM0pRzlvIfK90A6CO0Fz/CT+zhC+amNH8rudIYR+Sy+t6qrKU+DOaHCmWtf+klPmx6eu/f/FdpfPBFJU2O08S6oXEXW12A1frNsBYuGTDKLL+7XqmccKrSlSw1ET1o+1QKJHl/1TUXErUXjfP8DugG1cjJlUFu7f0hB7uhMf2Ag/361Mi8mqraWvvs/oAb+EsL2iZp2bocqmrx6tiV/x177bzSRFJt80hABG7zFQ== X-MS-Office365-Filtering-Correlation-Id: 97686f0c-1492-470f-c5f1-08d4501c8769 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:VI1PR07MB1629; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB1629; 3:9zyUcJ/2Q7Rg2U2rBFHPPZTvVrBt98/2sa2LIM37LvUR963i23rgbtventNmCS3EybaN5IjsgPHkIbMTGaueMms9NrFLDdJ7FHQvzpFgWLGhpgS9xMfC1qi+deZh4nQbAGOEy7Q+r3Jax4J3NAS+5VyYswWPZdUJ9o5NPAVj3Job74v2L3KGjVoQD9r66fnkr42ZXGyJculQ6ULvVI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Lircp5r+JMk9sKHPOwLSd6QK1cv9QAFyuOY/huxssxsd/LR9at6BEPVy09q1i9mg6d8v8QJfWpQWsKnoZ7sEFqg0zlp0XzHC+7f4N8UDpSD5gCsETWJprH51kPk3LWXiHi5/vN2tFelVyLzJLB/Y3DD7zllrhjnmVC1vkYZ2mazoTvz5+LkibZOzEQequqMkiy79bCWxpKo0cE9HgJ/joTIkwHZpwHoHJiVgIESAxp0U+4hzUTy8yG71E0fa54d5g8bhE67b/T+xir55WZe99FQNsVm3G01sh5fAA14+sOAGXFm15l7K7J4NoIKYBcnDaufcwdWv8RRm2JAqClboq4rx1AXIFLQ0yxHwdXZIlPoswD+4AbCACQ4bFFYPJpLshYL1jDoTDmERhOLZcLoaYkij+QWNxkWFKZe2vDZY8dPMJCQCZ0qabX1iPYABJOHGBPLqlyUlC8H8oQjQ831I9w/6npYg6fO4mrlmKJQIIyc0oRBHAKDA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13018025)(20170203043)(13016025)(5005006)(2017020702029)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123558025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:VI1PR07MB1629; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB1629; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB1629; 4:6TvWjvL6wcp3IhSaoEgUtxciFL7kNg9ChPXZZ6bL/1La4gsKztzYowaTkRMbR97rBSi2FUUxGmW99hyBsqBsIrbmitk1rTVoh2D1wpZzrwZEPqPSoc8jGlr3WsDYPsIwtXDT6bvmZHuYF1aO3BeOp3A8ylU/bESsORgZaU2+eSETw8cPeeji+YYwd2MJTRsj+ORSimE9CpojMnuREA+1lklwE9psSVRrag4csl4LG5dqhMdbVns66BPbE/zoIR8bdfZZLGGH7OMtYLC7Ybl/pD/nvUWAA42u/2j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UGJLY1m2t2dqc6lvdbHOgFHD5kJ+3urJU7VmBU7gWsQzUuY=; 5:UUQMbL02LYNtRG1lWwY28TJjfVSf8lQdyIO6llZLBZ8cljsdnz4aEYdH29z7LYiI3FTU8DEM7hnVbxwScYQxPY7lQp1AYmbcjvcjHcfIX9X83Q+8y5BSGTwyjbFsvVxCsxKUmF811idU72idN0biRA==; 24:F1FeM/JiXgb5m1wiJ7nUVj0KeWdJeDEBpPs8enbPCTxChL0mSYgbVJLm09grv8HLgS8k4ma2BcDr6xLH0RYtZDegIIf0BHxdNIIEeXPDsr8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB1629; 7:+wElIT1II7Jzsru/BF+YHVenJropbrvH/jbBWFGRIAZPyvhhUjC/vmsfYIPhaSYWZ44Wm5aLN10QRCm5+xOlJMZ1y6mYOo3J29fQUsPnlgd+NvvV6ZQxMZC74B5vZLRacEKRcRynzTNxpv5ujG28ZGlzf6vvoNhG5kJOBT0HDzpMZeQSDosFXoXTji+uaxPGTC19bBzJ6SzAhmQF3RupuhKPAm3biB+T8Re+zjdzP9WwmIfS+8OnunOEvy79ZDQFJ95hyKODe1R8LOfvwF3ne7pquxj1jgR/H7wQoOyckB6BXuZVXs2GZ3ElNZ/rAbBUCQY2eyNYqfqo0KyjYbr0fOh0eDUEU9CdgoaaRawy10eyB3SjlC3J9YudAIs4m9NGKFGVSzywr7vZiXgZL1Qr0IOqS18n8ZOfQRY++hOmPx3mVpVXUy67ApujKBHYxdE+0p5YnaCGzKfzwvvLjD75FbM0bWh6dYQbzNADaEOYtqApuLiEW+qWqzu5+XEb3f/3nRQOgM14KaLECZiiiSHS4g== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 12:18:02.6465 (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.35]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB1629 Subject: [lng-odp] [PATCH v2 2/5] linux-gen: ticketlock: inline also in application 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" Enable ticketlock function inlining in applications when not building for ABI compatibility. Signed-off-by: Petri Savolainen --- platform/linux-generic/Makefile.am | 1 + .../include/odp/api/plat/ticketlock_inlines.h | 19 +++++++++++- .../include/odp/api/plat/ticketlock_inlines_api.h | 36 ++++++++++++++++++++++ .../linux-generic/include/odp/api/ticketlock.h | 4 +++ platform/linux-generic/odp_ticketlock.c | 24 +++------------ 5 files changed, 64 insertions(+), 20 deletions(-) create mode 100644 platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h -- 2.8.1 diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 576fedf..64b0287 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -94,6 +94,7 @@ odpapiplatinclude_HEADERS = \ $(srcdir)/include/odp/api/plat/thread_types.h \ $(srcdir)/include/odp/api/plat/thrmask_types.h \ $(srcdir)/include/odp/api/plat/ticketlock_inlines.h \ + $(srcdir)/include/odp/api/plat/ticketlock_inlines_api.h \ $(srcdir)/include/odp/api/plat/ticketlock_types.h \ $(srcdir)/include/odp/api/plat/time_types.h \ $(srcdir)/include/odp/api/plat/timer_types.h \ diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h index 87432a7..ecbea7c 100644 --- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h @@ -13,11 +13,12 @@ #ifndef _ODP_PLAT_TICKETLOCK_INLINES_H_ #define _ODP_PLAT_TICKETLOCK_INLINES_H_ -#include #include #include #include +#include + /** @internal * Acquire ticket lock. * @@ -110,4 +111,20 @@ static inline int _odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock) odp_atomic_load_u32(&ticketlock->next_ticket); } +/* Include inlined versions of API functions */ +#include +#if ODP_ABI_COMPAT == 0 + +/** @ingroup odp_locks + * @{ + */ + +#include + +/** + * @} + */ + +#endif + #endif diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h new file mode 100644 index 0000000..5efe696 --- /dev/null +++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Ticketlock inline functions + */ + +#ifndef _ODP_PLAT_TICKETLOCK_INLINES_API_H_ +#define _ODP_PLAT_TICKETLOCK_INLINES_API_H_ + +_ODP_INLINE void odp_ticketlock_lock(odp_ticketlock_t *lock) +{ + return _odp_ticketlock_lock(lock); +} + +_ODP_INLINE int odp_ticketlock_trylock(odp_ticketlock_t *lock) +{ + return _odp_ticketlock_trylock(lock); +} + +_ODP_INLINE void odp_ticketlock_unlock(odp_ticketlock_t *lock) +{ + _odp_ticketlock_unlock(lock); +} + +_ODP_INLINE int odp_ticketlock_is_locked(odp_ticketlock_t *lock) +{ + return _odp_ticketlock_is_locked(lock); +} + +#endif diff --git a/platform/linux-generic/include/odp/api/ticketlock.h b/platform/linux-generic/include/odp/api/ticketlock.h index 85be4bc..e0f5d81 100644 --- a/platform/linux-generic/include/odp/api/ticketlock.h +++ b/platform/linux-generic/include/odp/api/ticketlock.h @@ -19,6 +19,10 @@ extern "C" { #include +#if ODP_ABI_COMPAT == 0 +#include +#endif + #include #ifdef __cplusplus diff --git a/platform/linux-generic/odp_ticketlock.c b/platform/linux-generic/odp_ticketlock.c index f18d78f..f73dd9a 100644 --- a/platform/linux-generic/odp_ticketlock.c +++ b/platform/linux-generic/odp_ticketlock.c @@ -5,6 +5,7 @@ */ #include +#include void odp_ticketlock_init(odp_ticketlock_t *ticketlock) { @@ -12,22 +13,7 @@ void odp_ticketlock_init(odp_ticketlock_t *ticketlock) odp_atomic_init_u32(&ticketlock->cur_ticket, 0); } -void odp_ticketlock_lock(odp_ticketlock_t *lock) -{ - return _odp_ticketlock_lock(lock); -} - -int odp_ticketlock_trylock(odp_ticketlock_t *lock) -{ - return _odp_ticketlock_trylock(lock); -} - -void odp_ticketlock_unlock(odp_ticketlock_t *lock) -{ - _odp_ticketlock_unlock(lock); -} - -int odp_ticketlock_is_locked(odp_ticketlock_t *lock) -{ - return _odp_ticketlock_is_locked(lock); -} +/* Include non-inlined versions of API functions */ +#if ODP_ABI_COMPAT == 1 +#include +#endif From patchwork Wed Feb 8 12:17:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93624 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2700718obz; Wed, 8 Feb 2017 04:20:00 -0800 (PST) X-Received: by 10.55.70.79 with SMTP id t76mr21367454qka.271.1486556400791; Wed, 08 Feb 2017 04:20:00 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f62si5302209qkj.205.2017.02.08.04.20.00; Wed, 08 Feb 2017 04:20:00 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 656E0634BE; Wed, 8 Feb 2017 12:20:00 +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_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 9B9A463488; Wed, 8 Feb 2017 12:18: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 13BD762F85; Wed, 8 Feb 2017 12:18:25 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0120.outbound.protection.outlook.com [104.47.0.120]) by lists.linaro.org (Postfix) with ESMTPS id DF6C062F85 for ; Wed, 8 Feb 2017 12:18:08 +0000 (UTC) Received: from AM2PR07CA0021.eurprd07.prod.outlook.com (10.163.24.159) by DB5PR07MB1622.eurprd07.prod.outlook.com (10.166.12.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.888.5; Wed, 8 Feb 2017 12:18:06 +0000 Received: from AM1FFO11FD048.protection.gbl (2a01:111:f400:7e00::166) by AM2PR07CA0021.outlook.office365.com (2a01:111:e400:8448::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.888.5 via Frontend Transport; Wed, 8 Feb 2017 12:18:06 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.36 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.36) by AM1FFO11FD048.mail.protection.outlook.com (10.174.65.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.7 via Frontend Transport; Wed, 8 Feb 2017 12:18:06 +0000 Received: from fihe3nok1348.nsn-intra.net (10.158.36.136) by fihe3nok1347.nsn-intra.net (10.158.36.135) with Microsoft SMTP Server (TLS) id 15.1.466.34; Wed, 8 Feb 2017 14:18:05 +0200 Received: from mailrelay.int.nokia.com (10.130.128.21) by fihe3nok1348.nsn-intra.net (10.158.36.136) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Wed, 8 Feb 2017 14:18:04 +0200 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 v18CHaL2022759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 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 v18CHavv022737 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Wed, 8 Feb 2017 14:17:34 +0200 Message-ID: <1486556256-22167-4-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> References: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.36; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(2980300002)(199003)(189002)(36756003)(76176999)(50986999)(33646002)(47776003)(2351001)(5003940100001)(105596002)(97736004)(189998001)(2950100002)(5660300001)(6916009)(77096006)(92566002)(356003)(626004)(305945005)(81166006)(50226002)(81156014)(8676002)(8936002)(450100001)(48376002)(53936002)(68736007)(50466002)(110136004)(38730400002)(575784001)(2906002)(86362001)(106466001)(22756006); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB1622; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD048; 1:z0cFdjDdk6nzrKhvXL2FN/3MWbglyAO4OeJDoKt2QHHpMJ0e4KVT/SisQ+TbZVzXROrpuFx5o/leYzsYlFJawK4tEha2aGBLzvbfbNww6iT7amJUx+Z2BLXTI3Jaj9h2666kYvq+4ntJhbrcju/vTbT/XhbQI4ig4QCePlIlwOxAVoP8MSvZUUg5qRZb0MXPUTwBfDOS5wnsG/5ikIrpBoHyCd3buBCZ9hnQPPzsSpBj4nFpJNr4XcunVE7dF+McZ+nSF4il8/KpIlK5gdUEnJXOMQyZE5sQ/P6po+yyKy1tjUwMZH27KThLgdQeYTzpHS65LIt0QRVwwwGVL//dnbcBf/PQMUH4AhwaT0Hq/froHaV5swoNoXzS/KSW+2GZrpJjrfrVbDXh2+WaN97sVgIfy2Hf3dSFnyUgcEYvILYRUbFHQe+4I29L1TjGSkraGDN33PI/165kgOBeI60UcX2m+KZ3+KeVc6BUOz58TXcLfkk54y80L+BoYbiiFyUOe4//8IPp8VXsjebxqGa03g== X-MS-Office365-Filtering-Correlation-Id: f93abbb2-e703-4b4e-4bfc-08d4501c89ad X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB5PR07MB1622; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1622; 3:atfuUhZtpJKTE5xgFRZLD6s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OBfp4MUnEuW6ljMXKhdDnCfi4jlj5Oa5dqk9FoGzMNkvgC/kxSg==; 20:2nwidhDGoEt2KPJRs5opjm9jyM4Kt2qfZTy9B2kN9hBUOTTbozmw17/KoYZtFk5wo6mMpX7v/paD20c6M06TNT6/nDsTjtHOlpyaqitNwm+ZnFkNyKeLzzFwZdHMneupyn+cSjPS7Wh+Ta3z01Haf4EN1rwk9RpfUn2x7MIuO/jw5R7DUZ/7uVusmuycC5TNTDiQdIoUBfl2hmaL/JWSYUydFwO1xldNVw+K2vT/clzeDS+GUzCNLHzGEwYc/BP40BFEj8QUefA/hnTb1rmal4zp2HcTqdY/4QBRH02K+5OQpPf25IfZ7Y0aEXDeU2vdjsOifJQXgNtb/qXVWlv54YrtCvvirA3HOCeNs61bRj/o9CsJziK/k8RL0whtoQmEYc1o4CIL6v8SvmJO+8YDwIs4EFwTgRNM9aZ1G88fQI2cyYsbyOGbIvMISFdR27Sx8v3xfJEZHMdoIxXnUyqCoTTjI9PcboaOCkJaDM8Vuq3EcduwV9yhaHznwATdOJs0Qm/cSdOF8LaNLvNgqeDnvC0l48ktm+QH78WmYCr/knipBppNZxEhsX2NjbfvDfltNG1G47Md1VA36t6+mIpY0NFS6ZQK97ugz5qMDMYtjqQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(5005006)(20170203043)(8121501046)(2017020702029)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:DB5PR07MB1622; BCL:0; PCL:0; RULEID:; SRVR:DB5PR07MB1622; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1622; 4:iKLmAIYVsOEM9JWEGdl3k4NE6UV37AOEMhJlx7ZiZ0G8lsGWn8AnzdkTsLnsay77+o5XuWqWVPkn1POTNzwlY62mfNmYzfXtuTNTjGl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0w40egTCAYXc5sH0ANijiuNCSUMNnhos7Lqm/LcgibSsHg2/FSs+2PuN7uToy9rNNRuEH23fnlwiHIhWclbYQ/sQOGDnjZw3YtEIZPsx94M8hGzhPCjStXzyltlGDqvJ6j1Th7jolKjoTHq0XkCvr/v2b/w=; 5:Pmq0S2QN7f3KHY7uxcAfG3W9UvUc7ZnCCBeAEcklXmwFUsm3erWKYTwh/w14vNR2+KBop8EsbKzHKRQdvOcAwLLdQOxlr+0kQIYCrxIEGRBkS7sJtkrM9ONz1EjMJoI6r8l9MNE1X6iv/UvOcYxTtg==; 24:37fUyAPhsNB3k5EbvomEViEIY7rHYd5Mfqp2VV3DQi5drOr/M6uHVlvIXLHTTbuJiStE5HLWLPMv9M5RHti+46edZmZHUft5hIHqgVmQ0uA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1622; 7:bzxvqaAEblcuBX3rkAS38jRgHEskb3tYGlTryHdEEh53phHbWQa8BkXw02L/OCF21fYT84tGBIxkYxR1iSvI62SW+ayftxgMXAQNungl2AIXJnmTivkCT2rtR3xnXuOgclGBeIscXC6bQwYrBqlAROLpfatjV/tiAc89Xte3hvP0CZoLzXMAJLOk8aEKE94RsgEGJA3iQlrA2WV0qSP7vDlEm8OIZpFhJ9cSfvRit1+GGTO0PJNup+1vmON1vyTp0x4ihKSVfltWtF8RkvqBdeEW2Tuy4e51bPiX6b9LjEtGnXSLZy7R4zqTZWNq0qtRxXxi1aN1KL12O5ju4rkNbWKYOG+D1IPwxP8jRM4Vh/Iq7YvwN74GJDHbd5/51YhLjwo+fd56nUYAbIWysGwVvtjgqLVGShrZ3Rh7cM9byt0z2g4gp1KRtIh1E8KmONuPP2b+d5V37Vofni7EOWZF3Cr0S3G/p6NT+1TXKYPPg+hADt1PjBiM6lHq58K0Tj5aRQKA2XRoGLHI91Kqzo2uMQ== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 12:18:06.4444 (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.36]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB1622 Subject: [lng-odp] [PATCH v2 3/5] linux-gen: packet: packet handle is hdr 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 packet handle (odp_packet_t) to store pointer to the packet header, instead a bit field structure of pool and index. Buffer and event handles are not changed. Pointer as handle improves packet accessor function performance and enable accessor function inlining as mapping to pool/index is not needed. Signed-off-by: Petri Savolainen --- .../include/odp/api/plat/packet_types.h | 2 +- .../linux-generic/include/odp_packet_internal.h | 2 +- platform/linux-generic/odp_packet.c | 163 ++++++++++++--------- 3 files changed, 96 insertions(+), 71 deletions(-) -- 2.8.1 diff --git a/platform/linux-generic/include/odp/api/plat/packet_types.h b/platform/linux-generic/include/odp/api/plat/packet_types.h index 34e5dd8..999130e 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_types.h @@ -32,7 +32,7 @@ extern "C" { typedef ODP_HANDLE_T(odp_packet_t); -#define ODP_PACKET_INVALID _odp_cast_scalar(odp_packet_t, 0xffffffff) +#define ODP_PACKET_INVALID _odp_cast_scalar(odp_packet_t, 0) #define ODP_PACKET_OFFSET_INVALID (0x0fffffff) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index e3ada5c..499f8df 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -209,7 +209,7 @@ typedef struct { */ static inline odp_packet_hdr_t *odp_packet_hdr(odp_packet_t pkt) { - return (odp_packet_hdr_t *)buf_hdl_to_hdr((odp_buffer_t)pkt); + return (odp_packet_hdr_t *)(uintptr_t)pkt; } static inline void copy_packet_parser_metadata(odp_packet_hdr_t *src_hdr, diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 024f694..9a8c112 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -23,9 +23,14 @@ /* Initial packet segment data length */ #define BASE_LEN CONFIG_PACKET_MAX_SEG_LEN +static inline odp_packet_hdr_t *packet_hdr(odp_packet_t pkt) +{ + return (odp_packet_hdr_t *)(uintptr_t)pkt; +} + static inline odp_packet_t packet_handle(odp_packet_hdr_t *pkt_hdr) { - return (odp_packet_t)pkt_hdr->buf_hdr.handle.handle; + return (odp_packet_t)pkt_hdr; } static inline odp_buffer_t buffer_handle(odp_packet_hdr_t *pkt_hdr) @@ -33,6 +38,11 @@ static inline odp_buffer_t buffer_handle(odp_packet_hdr_t *pkt_hdr) return pkt_hdr->buf_hdr.handle.handle; } +static inline odp_packet_hdr_t *buf_to_packet_hdr(odp_buffer_t buf) +{ + return (odp_packet_hdr_t *)buf_hdl_to_hdr(buf); +} + static inline uint32_t packet_seg_len(odp_packet_hdr_t *pkt_hdr, uint32_t seg_idx) { @@ -485,8 +495,8 @@ static inline int packet_alloc(pool_t *pool, uint32_t len, int max_pkt, odp_packet_hdr_t *hdr; /* First buffer is the packet descriptor */ - pkt[i] = (odp_packet_t)buf[i * num_seg]; hdr = pkt_hdr[i * num_seg]; + pkt[i] = packet_handle(hdr); init_segments(&pkt_hdr[i * num_seg], num_seg); packet_init(hdr, len, parse); @@ -552,11 +562,13 @@ int odp_packet_alloc_multi(odp_pool_t pool_hdl, uint32_t len, void odp_packet_free(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + odp_buffer_t hdl = buffer_handle(pkt_hdr); + int num_seg = pkt_hdr->buf_hdr.segcount; if (odp_likely(CONFIG_PACKET_MAX_SEGS == 1 || num_seg == 1)) - buffer_free_multi((odp_buffer_t *)&pkt, 1); + buffer_free_multi(&hdl, 1); else free_bufs(pkt_hdr, 0, num_seg); } @@ -571,11 +583,11 @@ void odp_packet_free_multi(const odp_packet_t pkt[], int num) int bufs = 0; for (i = 0; i < num; i++) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt[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; - buf[bufs] = (odp_buffer_t)pkt[i]; + buf[bufs] = buffer_handle(pkt_hdr); bufs++; if (odp_likely(num_seg == 1)) @@ -593,7 +605,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 = odp_packet_hdr(pkt); + odp_packet_hdr_t *const pkt_hdr = packet_hdr(pkt); pool_t *pool = pool_entry_from_hdl(pkt_hdr->buf_hdr.pool_hdl); if (len > pool->headroom + pool->data_size + pool->tailroom) @@ -606,22 +618,34 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len) odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf) { - return (odp_packet_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) { - return (odp_buffer_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) { - return (odp_packet_t)ev; + if (odp_unlikely(ev == ODP_EVENT_INVALID)) + return ODP_PACKET_INVALID; + + return (odp_packet_t)buf_to_packet_hdr((odp_buffer_t)ev); } odp_event_t odp_packet_to_event(odp_packet_t pkt) { - return (odp_event_t)pkt; + if (odp_unlikely(pkt == ODP_PACKET_INVALID)) + return ODP_EVENT_INVALID; + + return (odp_event_t)buffer_handle(packet_hdr(pkt)); } /* @@ -633,57 +657,57 @@ odp_event_t odp_packet_to_event(odp_packet_t pkt) void *odp_packet_head(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return pkt_hdr->buf_hdr.seg[0].data - pkt_hdr->headroom; } uint32_t odp_packet_buf_len(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return pkt_hdr->buf_hdr.size * pkt_hdr->buf_hdr.segcount; } void *odp_packet_data(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return packet_data(pkt_hdr); } uint32_t odp_packet_seg_len(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return packet_first_seg_len(pkt_hdr); } uint32_t odp_packet_len(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->frame_len; + return packet_hdr(pkt)->frame_len; } uint32_t odp_packet_headroom(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->headroom; + return packet_hdr(pkt)->headroom; } uint32_t odp_packet_tailroom(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->tailroom; + return packet_hdr(pkt)->tailroom; } void *odp_packet_tail(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return packet_tail(pkt_hdr); } void *odp_packet_push_head(odp_packet_t pkt, uint32_t len) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (len > pkt_hdr->headroom) return NULL; @@ -868,7 +892,7 @@ static inline void reset_seg(odp_packet_hdr_t *pkt_hdr, int first, int num) int odp_packet_extend_head(odp_packet_t *pkt, uint32_t len, void **data_ptr, uint32_t *seg_len) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(*pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(*pkt); uint32_t frame_len = pkt_hdr->frame_len; uint32_t headroom = pkt_hdr->headroom; int ret = 0; @@ -972,7 +996,7 @@ int odp_packet_extend_head(odp_packet_t *pkt, uint32_t len, void *odp_packet_pull_head(odp_packet_t pkt, uint32_t len) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (len > pkt_hdr->frame_len) return NULL; @@ -984,7 +1008,7 @@ void *odp_packet_pull_head(odp_packet_t pkt, uint32_t len) int odp_packet_trunc_head(odp_packet_t *pkt, uint32_t len, void **data_ptr, uint32_t *seg_len_out) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(*pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(*pkt); uint32_t seg_len = packet_first_seg_len(pkt_hdr); if (len > pkt_hdr->frame_len) @@ -1018,7 +1042,7 @@ int odp_packet_trunc_head(odp_packet_t *pkt, uint32_t len, void *odp_packet_push_tail(odp_packet_t pkt, uint32_t len) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); void *old_tail; if (len > pkt_hdr->tailroom) @@ -1033,7 +1057,7 @@ void *odp_packet_push_tail(odp_packet_t pkt, uint32_t len) int odp_packet_extend_tail(odp_packet_t *pkt, uint32_t len, void **data_ptr, uint32_t *seg_len_out) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(*pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(*pkt); uint32_t frame_len = pkt_hdr->frame_len; uint32_t tailroom = pkt_hdr->tailroom; uint32_t tail_off = frame_len; @@ -1124,7 +1148,7 @@ int odp_packet_extend_tail(odp_packet_t *pkt, uint32_t len, void *odp_packet_pull_tail(odp_packet_t pkt, uint32_t len) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (len > packet_last_seg_len(pkt_hdr)) return NULL; @@ -1139,7 +1163,7 @@ int odp_packet_trunc_tail(odp_packet_t *pkt, uint32_t len, { int last; uint32_t seg_len; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(*pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(*pkt); if (len > pkt_hdr->frame_len) return -1; @@ -1174,7 +1198,7 @@ void *odp_packet_offset(odp_packet_t pkt, uint32_t offset, uint32_t *len, odp_packet_seg_t *seg) { int seg_idx; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); void *addr = packet_map(pkt_hdr, offset, len, &seg_idx); if (addr != NULL && seg != NULL) @@ -1199,42 +1223,42 @@ void odp_packet_prefetch(odp_packet_t pkt ODP_UNUSED, odp_pool_t odp_packet_pool(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->buf_hdr.pool_hdl; + return packet_hdr(pkt)->buf_hdr.pool_hdl; } odp_pktio_t odp_packet_input(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->input; + return packet_hdr(pkt)->input; } int odp_packet_input_index(odp_packet_t pkt) { - return odp_pktio_index(odp_packet_hdr(pkt)->input); + return odp_pktio_index(packet_hdr(pkt)->input); } void *odp_packet_user_ptr(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->buf_hdr.buf_ctx; + return packet_hdr(pkt)->buf_hdr.buf_ctx; } void odp_packet_user_ptr_set(odp_packet_t pkt, const void *ctx) { - odp_packet_hdr(pkt)->buf_hdr.buf_cctx = ctx; + packet_hdr(pkt)->buf_hdr.buf_cctx = ctx; } void *odp_packet_user_area(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->buf_hdr.uarea_addr; + return packet_hdr(pkt)->buf_hdr.uarea_addr; } uint32_t odp_packet_user_area_size(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->buf_hdr.uarea_size; + return packet_hdr(pkt)->buf_hdr.uarea_size; } void *odp_packet_l2_ptr(odp_packet_t pkt, uint32_t *len) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (!packet_hdr_has_l2(pkt_hdr)) return NULL; @@ -1243,7 +1267,7 @@ void *odp_packet_l2_ptr(odp_packet_t pkt, uint32_t *len) uint32_t odp_packet_l2_offset(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (!packet_hdr_has_l2(pkt_hdr)) return ODP_PACKET_OFFSET_INVALID; @@ -1252,7 +1276,7 @@ uint32_t odp_packet_l2_offset(odp_packet_t pkt) int odp_packet_l2_offset_set(odp_packet_t pkt, uint32_t offset) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (offset >= pkt_hdr->frame_len) return -1; @@ -1264,7 +1288,7 @@ int odp_packet_l2_offset_set(odp_packet_t pkt, uint32_t offset) void *odp_packet_l3_ptr(odp_packet_t pkt, uint32_t *len) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (pkt_hdr->p.parsed_layers < LAYER_L3) packet_parse_layer(pkt_hdr, LAYER_L3); @@ -1273,7 +1297,7 @@ void *odp_packet_l3_ptr(odp_packet_t pkt, uint32_t *len) uint32_t odp_packet_l3_offset(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (pkt_hdr->p.parsed_layers < LAYER_L3) packet_parse_layer(pkt_hdr, LAYER_L3); @@ -1282,7 +1306,7 @@ uint32_t odp_packet_l3_offset(odp_packet_t pkt) int odp_packet_l3_offset_set(odp_packet_t pkt, uint32_t offset) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (offset >= pkt_hdr->frame_len) return -1; @@ -1295,7 +1319,7 @@ int odp_packet_l3_offset_set(odp_packet_t pkt, uint32_t offset) void *odp_packet_l4_ptr(odp_packet_t pkt, uint32_t *len) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (pkt_hdr->p.parsed_layers < LAYER_L4) packet_parse_layer(pkt_hdr, LAYER_L4); @@ -1304,7 +1328,7 @@ void *odp_packet_l4_ptr(odp_packet_t pkt, uint32_t *len) uint32_t odp_packet_l4_offset(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (pkt_hdr->p.parsed_layers < LAYER_L4) packet_parse_layer(pkt_hdr, LAYER_L4); @@ -1313,7 +1337,7 @@ uint32_t odp_packet_l4_offset(odp_packet_t pkt) int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (offset >= pkt_hdr->frame_len) return -1; @@ -1326,14 +1350,14 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset) uint32_t odp_packet_flow_hash(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return pkt_hdr->flow_hash; } void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); pkt_hdr->flow_hash = flow_hash; pkt_hdr->p.input_flags.flow_hash = 1; @@ -1341,14 +1365,14 @@ void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash) odp_time_t odp_packet_ts(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return pkt_hdr->timestamp; } void odp_packet_ts_set(odp_packet_t pkt, odp_time_t timestamp) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); pkt_hdr->timestamp = timestamp; pkt_hdr->p.input_flags.timestamp = 1; @@ -1356,12 +1380,12 @@ void odp_packet_ts_set(odp_packet_t pkt, odp_time_t timestamp) int odp_packet_is_segmented(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->buf_hdr.segcount > 1; + return packet_hdr(pkt)->buf_hdr.segcount > 1; } int odp_packet_num_segs(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return pkt_hdr->buf_hdr.segcount; } @@ -1375,14 +1399,14 @@ odp_packet_seg_t odp_packet_first_seg(odp_packet_t pkt) odp_packet_seg_t odp_packet_last_seg(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return packet_last_seg(pkt_hdr); } odp_packet_seg_t odp_packet_next_seg(odp_packet_t pkt, odp_packet_seg_t seg) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (odp_unlikely(seg >= (odp_packet_seg_t)packet_last_seg(pkt_hdr))) return ODP_PACKET_SEG_INVALID; @@ -1399,7 +1423,7 @@ odp_packet_seg_t odp_packet_next_seg(odp_packet_t pkt, odp_packet_seg_t seg) void *odp_packet_seg_data(odp_packet_t pkt, odp_packet_seg_t seg) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (odp_unlikely(seg >= pkt_hdr->buf_hdr.segcount)) return NULL; @@ -1409,7 +1433,7 @@ void *odp_packet_seg_data(odp_packet_t pkt, odp_packet_seg_t seg) uint32_t odp_packet_seg_data_len(odp_packet_t pkt, odp_packet_seg_t seg) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (odp_unlikely(seg >= pkt_hdr->buf_hdr.segcount)) return 0; @@ -1427,7 +1451,7 @@ uint32_t odp_packet_seg_data_len(odp_packet_t pkt, odp_packet_seg_t seg) 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 = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); uint32_t pktlen = pkt_hdr->frame_len; odp_packet_t newpkt; @@ -1456,7 +1480,7 @@ int odp_packet_add_data(odp_packet_t *pkt_ptr, uint32_t offset, uint32_t len) 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 = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); uint32_t pktlen = pkt_hdr->frame_len; odp_packet_t newpkt; @@ -1488,7 +1512,7 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len, int rc; uint32_t shift; uint32_t seglen = 0; /* GCC */ - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(*pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(*pkt); void *addr = packet_map(pkt_hdr, offset, &seglen, NULL); uint64_t uaddr = (uint64_t)(uintptr_t)addr; uint64_t misalign; @@ -1526,8 +1550,8 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len, int odp_packet_concat(odp_packet_t *dst, odp_packet_t src) { - odp_packet_hdr_t *dst_hdr = odp_packet_hdr(*dst); - odp_packet_hdr_t *src_hdr = odp_packet_hdr(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; @@ -1585,7 +1609,7 @@ int odp_packet_split(odp_packet_t *pkt, uint32_t len, odp_packet_t *tail) odp_packet_t odp_packet_copy(odp_packet_t pkt, odp_pool_t pool) { - odp_packet_hdr_t *srchdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *srchdr = packet_hdr(pkt); uint32_t pktlen = srchdr->frame_len; odp_packet_t newpkt = odp_packet_alloc(pool, pktlen); @@ -1623,7 +1647,7 @@ int odp_packet_copy_to_mem(odp_packet_t pkt, uint32_t offset, uint32_t seglen = 0; /* GCC */ uint32_t cpylen; uint8_t *dstaddr = (uint8_t *)dst; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (offset + len > pkt_hdr->frame_len) return -1; @@ -1647,7 +1671,7 @@ int odp_packet_copy_from_mem(odp_packet_t pkt, uint32_t offset, uint32_t seglen = 0; /* GCC */ uint32_t cpylen; const uint8_t *srcaddr = (const uint8_t *)src; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (offset + len > pkt_hdr->frame_len) return -1; @@ -1668,8 +1692,8 @@ int odp_packet_copy_from_pkt(odp_packet_t dst, uint32_t dst_offset, odp_packet_t src, uint32_t src_offset, uint32_t len) { - odp_packet_hdr_t *dst_hdr = odp_packet_hdr(dst); - odp_packet_hdr_t *src_hdr = odp_packet_hdr(src); + odp_packet_hdr_t *dst_hdr = packet_hdr(dst); + odp_packet_hdr_t *src_hdr = packet_hdr(src); void *dst_map; void *src_map; uint32_t cpylen, minseg; @@ -1746,10 +1770,11 @@ void odp_packet_print(odp_packet_t pkt) char str[max_len]; int len = 0; int n = max_len - 1; - odp_packet_hdr_t *hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *hdr = packet_hdr(pkt); + odp_buffer_t buf = _odp_packet_to_buffer(pkt); len += snprintf(&str[len], n - len, "Packet "); - len += odp_buffer_snprint(&str[len], n - len, (odp_buffer_t)pkt); + len += odp_buffer_snprint(&str[len], n - len, buf); len += snprintf(&str[len], n - len, " input_flags 0x%" PRIx64 "\n", hdr->p.input_flags.all); len += snprintf(&str[len], n - len, " error_flags 0x%" PRIx32 "\n", @@ -1794,7 +1819,7 @@ void odp_packet_print(odp_packet_t pkt) int odp_packet_is_valid(odp_packet_t pkt) { - if (odp_buffer_is_valid((odp_buffer_t)pkt) == 0) + if (odp_buffer_is_valid(_odp_packet_to_buffer(pkt)) == 0) return 0; if (odp_event_type(odp_packet_to_event(pkt)) != ODP_EVENT_PACKET) @@ -1812,8 +1837,8 @@ int odp_packet_is_valid(odp_packet_t pkt) int _odp_packet_copy_md_to_packet(odp_packet_t srcpkt, odp_packet_t dstpkt) { - odp_packet_hdr_t *srchdr = odp_packet_hdr(srcpkt); - odp_packet_hdr_t *dsthdr = odp_packet_hdr(dstpkt); + odp_packet_hdr_t *srchdr = packet_hdr(srcpkt); + odp_packet_hdr_t *dsthdr = packet_hdr(dstpkt); dsthdr->input = srchdr->input; dsthdr->dst_queue = srchdr->dst_queue; From patchwork Wed Feb 8 12:17:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93628 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2702692obz; Wed, 8 Feb 2017 04:24:59 -0800 (PST) X-Received: by 10.107.47.195 with SMTP id v64mr8251858iov.85.1486556699012; Wed, 08 Feb 2017 04:24:59 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 19si14559126ioj.58.2017.02.08.04.24.58; Wed, 08 Feb 2017 04:24:58 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6394D634DF; Wed, 8 Feb 2017 12:24:58 +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 18C7A634D0; Wed, 8 Feb 2017 12:19:17 +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 3C9A663489; Wed, 8 Feb 2017 12:19:01 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0111.outbound.protection.outlook.com [104.47.0.111]) by lists.linaro.org (Postfix) with ESMTPS id 5B05F63008 for ; Wed, 8 Feb 2017 12:18:11 +0000 (UTC) Received: from VI1PR07CA0056.eurprd07.prod.outlook.com (10.164.94.152) by DB5PR07MB1622.eurprd07.prod.outlook.com (10.166.12.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Wed, 8 Feb 2017 12:18:08 +0000 Received: from AM1FFO11FD044.protection.gbl (2a01:111:f400:7e00::182) by VI1PR07CA0056.outlook.office365.com (2a01:111:e400:5967::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5 via Frontend Transport; Wed, 8 Feb 2017 12:18:08 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.35 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.35) by AM1FFO11FD044.mail.protection.outlook.com (10.174.64.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.7 via Frontend Transport; Wed, 8 Feb 2017 12:18:08 +0000 Received: from fihe3nok1348.nsn-intra.net (10.158.36.136) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34; Wed, 8 Feb 2017 14:18:05 +0200 Received: from mailrelay.int.nokia.com (10.130.128.21) by fihe3nok1348.nsn-intra.net (10.158.36.136) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Wed, 8 Feb 2017 14:18:04 +0200 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 v18CHaWT022765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 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 v18CHavw022737 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Wed, 8 Feb 2017 14:17:35 +0200 Message-ID: <1486556256-22167-5-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> References: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.35; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(2980300002)(199003)(189002)(36756003)(76176999)(50986999)(33646002)(47776003)(2351001)(5003940100001)(105596002)(97736004)(189998001)(2950100002)(5660300001)(6916009)(77096006)(92566002)(356003)(626004)(305945005)(81166006)(50226002)(81156014)(8676002)(8936002)(450100001)(48376002)(53936002)(68736007)(50466002)(110136004)(38730400002)(575784001)(2906002)(86362001)(106466001)(22756006); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB1622; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD044; 1:t0XcaYHl8T2TyG/RLZDj3kHY4oNXraf0+vrRrCFQA2LZr4jUL42jCywvI1zXOGEsSTsy4fWkFpQkIWlawMErtDgy/P/EJ+LVdaQAWnK1fUmiwqbsSavhCz+7Lo4a2oc827zLF56G2Ltj4hsVJoVEkEt6RvmScdDZc/tD1L+N62eMKSz2+uNK8Wlt3vBY7abFsxegn+hjFQjV5i4fk6D1rm980AXyKHgL4+rKWT9pVoip63ARkMmWE/SrYb3xzMXo5Xtj65z2G0Hfi6L3AUMvbTRMAePQ9VgJBBfw6txv30bPPe+lI1fupYRLoqwM4LYYf9+jkrOPhZzcZeE3md8BqHxTd/r5+TS0ktHS35IkNk4KjZphivHfIi78fLqP9wCexFGgtPzUdMqIbTH9wzlRG9ljGZJmiDfaArsG/syxOBdKJ7ztoeqvQJ32naOeVhuVjSMQ3nb/wGrcXB/lSC8yvtqFGokyVc13NrbMO6/6v7c6weLPp+8a0Vn245SG6HyiTMSmmNklDRNNo4icrOEu6w== X-MS-Office365-Filtering-Correlation-Id: 1ff64bb7-7efa-4047-3d49-08d4501c8acc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB5PR07MB1622; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1622; 3:1c/lceB3ZI0QeIKRiQvgBoa+IGPJ6wtP2DR3sweLnLMOQzs8pMRi0sOOA/09F+mF82kZ93yJcY9Hdo8ZTULmIad2IyWVxyXXXZmdNOLYUtCB4mQGC3UWn7+aoNoNQS3X/B82Iumg99CtSrASmGOorZv5qBk2ittHMHusSFpIKVuqYNDUzScnYvY2A0BDsOlIb2pOjpCz4RpSNFUlECvwSYNRj+VNq5fiYlZ681G5cpasq9dLYsnae4O6h3cQVJCHOxkH5eUWU3BzDVShH7TMeVeNY4G5Ygt8N3v2aaCbyl0co2xfMYkxPg3IVI0ZBLrWtsS000EHHHEGb0JyP4yDwfThnYwjgO+yNOap2KRGN/8=; 25:siRuZGoUDd0MNKuEkIty6mSZnHSte1c9Xh7X4kkGCAv4ruhPuhyB6NMJA/atjjnL13HeL5MsUhHQ0KrVHv2q5QyqlrnX31xRzkFsNQfq+XaDVO3oiEd4l+2G4Xx87quF6gDQJF7Y/4GiIOp4gmZ0DcS6yifVwz2nC6PXhv2fpvXnzVCEs6+PBQ3bkvx1nXfSZPu+Kk4O06RNkq31kLZnhtDhJJCd1SxuxLBLph3dhRHIrXx2Pd0QtIsphkvjWvaAY0J/25LLAA3IrGCeo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8B1o7Qqk54YCb2Vn0YKDYIk7bDs/jIoB6RoBo3nDEWrut72wgvMMnWjBrRIS2y7D7Fa4Jxo8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(5005006)(20170203043)(8121501046)(2017020702029)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:DB5PR07MB1622; BCL:0; PCL:0; RULEID:; SRVR:DB5PR07MB1622; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1622; 4:ZBJfgZYw+kaKfggVZe7buEaBrKRXWYMEbZSQHdJVkfv98E3ovvB3bEd1IYZsxTpzj3AaJ5e/P0T7hBMFTbc2KkwceuM4h3L6Sb5DFB+m8DIbuffOqMWJyFtKMdnK3vp87QO+8CtwzBI5t1X0ixoLnTPEb50fPrCBBlqI44MDYCsvyJxiwP83CJQ9Mf+XNETzJvZYl8oTNXSYhzpBkFOOjKeGU6Y0vdL6PuILyZt+LwIZMTtgsgXscetL4Mz/0C63dpSuiu8J3gcXxBQr7En6ZY+E+g9VIqoqBoL9CQzRWYq9cJ5UxtK0gBh9FNMD1F2W+mKibwoRK4snxWIy2Xiy/aeldICoooFjnm4KBtlhanGRILpb7Zj8X6xCyl/U5CrPGM//4o5mA+jc+Xs9ATcLDWMr0/8oAtTphR/FFw6jbihKcxLdI+64Npr/IGbkb4KRBIksM7CGwSAFb3XcHSaXtwsdhRY5Ih3aDJV62QORJWL6cGbIifs4w67TBWIkqyJJo4JreyOo2Ag1KU35OzLfm7bMpt0JtKb3ag5nT/MyeFo69/x4NCYFBKcKdMkwMHGVoUon3ynUZCgFf4LkdV1Avx0Paj/3vQ5sRTgEJxYbQicMQCxSwWHM5H0IZklbPd5mt5mVqtRzazc8z2OoS5MZArSL343ar1NhAIGOI0X7mxgtBzcTOIZ2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vBWBE6UlqRetUfwF7pVf11O7ypp2svMMP/qvQq+ADRkn4nCN9ggdXoaE+cp2xH+webf6Ivrru3jSvO2vpfTLKgalC8cXBEp0kllQB4ev5tMiQWnJwFa5FqXnuV1kJcFeJcrqvLvuXKFwhL7IkpalCyy9iXDbZ5acyVwWYw1B3x4NTNhiJ9jBMTogK0DnTvPTwI/biKu37iZbOq1V0UXiIOExebzdKUyudx61OcO4Y0qDhEu81jefaRUAzh5wtEP7A8BSDreTC2M2TQTkbApxz5ahxwrowpweZGkBt6FQnxZZBA0olFDQKaqV8gaKNz9+kgstq0SLQdmWKNGY06zg8pRYq3JGEO7GdD9WTZm1R81wiGS5Lgykh8tT/o+vZmNZEly6e532zDbeFgIU6x7CDQC2XfTw6aHEkK2JWFzV9MX2hM0YbxmeUeWoSnrO9JDw64wn/bSdB/H25gFjVzWaEll5Nebxtd6/kyO7iBiQ== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 12:18:08.3405 (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.35]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB1622 Subject: [lng-odp] [PATCH v2 4/5] linux-gen: packet: inline functions 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" Added first inlined packet functions. Functions are allways used inlined within the implementation. Applications see inlined versions only when ABI compatibility is disabled. Signed-off-by: Petri Savolainen --- platform/linux-generic/Makefile.am | 2 + platform/linux-generic/include/odp/api/packet.h | 11 +- .../include/odp/api/plat/packet_inlines.h | 173 +++++++++++++++++++++ .../include/odp/api/plat/packet_inlines_api.h | 113 ++++++++++++++ .../include/odp/api/plat/packet_types.h | 33 ++++ platform/linux-generic/odp_packet.c | 147 ++++------------- platform/linux-generic/pktio/dpdk.c | 5 +- platform/linux-generic/pktio/netmap.c | 5 +- test/common_plat/performance/Makefile.am | 4 + 9 files changed, 363 insertions(+), 130 deletions(-) create mode 100644 platform/linux-generic/include/odp/api/plat/packet_inlines.h create mode 100644 platform/linux-generic/include/odp/api/plat/packet_inlines_api.h -- 2.8.1 diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 64b0287..812b22c 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -78,6 +78,8 @@ odpapiplatinclude_HEADERS = \ $(srcdir)/include/odp/api/plat/crypto_types.h \ $(srcdir)/include/odp/api/plat/event_types.h \ $(srcdir)/include/odp/api/plat/init_types.h \ + $(srcdir)/include/odp/api/plat/packet_inlines.h \ + $(srcdir)/include/odp/api/plat/packet_inlines_api.h \ $(srcdir)/include/odp/api/plat/packet_types.h \ $(srcdir)/include/odp/api/plat/packet_io_types.h \ $(srcdir)/include/odp/api/plat/pool_types.h \ diff --git a/platform/linux-generic/include/odp/api/packet.h b/platform/linux-generic/include/odp/api/packet.h index ebbeaf1..eff4080 100644 --- a/platform/linux-generic/include/odp/api/packet.h +++ b/platform/linux-generic/include/odp/api/packet.h @@ -24,13 +24,10 @@ extern "C" { #include #include -/** @ingroup odp_packet - * @{ - */ - -/** - * @} - */ +#include +#if ODP_ABI_COMPAT == 0 +#include +#endif #include diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_inlines.h new file mode 100644 index 0000000..eb36aa9 --- /dev/null +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -0,0 +1,173 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Packet inline functions + */ + +#ifndef _ODP_PLAT_PACKET_INLINES_H_ +#define _ODP_PLAT_PACKET_INLINES_H_ + +#include +#include +#include +#include + +/** @internal Inline function offsets */ +extern const _odp_packet_inline_offset_t _odp_packet_inline; + +/** @internal Inline function @param pkt @return */ +static inline void *_odp_packet_data(odp_packet_t pkt) +{ + return *(void **)(uintptr_t)((uint8_t *)pkt + _odp_packet_inline.data); +} + +/** @internal Inline function @param pkt @return */ +static inline uint32_t _odp_packet_seg_len(odp_packet_t pkt) +{ + return *(uint32_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.seg_len); +} + +/** @internal Inline function @param pkt @return */ +static inline uint32_t _odp_packet_len(odp_packet_t pkt) +{ + return *(uint32_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.frame_len); +} + +/** @internal Inline function @param pkt @return */ +static inline uint32_t _odp_packet_headroom(odp_packet_t pkt) +{ + return *(uint32_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.headroom); +} + +/** @internal Inline function @param pkt @return */ +static inline uint32_t _odp_packet_tailroom(odp_packet_t pkt) +{ + return *(uint32_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.tailroom); +} + +/** @internal Inline function @param pkt @return */ +static inline odp_pool_t _odp_packet_pool(odp_packet_t pkt) +{ + return *(odp_pool_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.pool); +} + +/** @internal Inline function @param pkt @return */ +static inline odp_pktio_t _odp_packet_input(odp_packet_t pkt) +{ + return *(odp_pktio_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.input); +} + +/** @internal Inline function @param pkt @return */ +static inline int _odp_packet_num_segs(odp_packet_t pkt) +{ + return *(uint8_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.segcount); +} + +/** @internal Inline function @param pkt @return */ +static inline void *_odp_packet_user_ptr(odp_packet_t pkt) +{ + return *(void **)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.user_ptr); +} + +/** @internal Inline function @param pkt @return */ +static inline void *_odp_packet_user_area(odp_packet_t pkt) +{ + return *(void **)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.user_area); +} + +/** @internal Inline function @param pkt @return */ +static inline uint32_t _odp_packet_user_area_size(odp_packet_t pkt) +{ + return *(uint32_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.user_area_size); +} + +/** @internal Inline function @param pkt @return */ +static inline uint32_t _odp_packet_flow_hash(odp_packet_t pkt) +{ + return *(uint32_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.flow_hash); +} + +/** @internal Inline function @param pkt @return */ +static inline odp_time_t _odp_packet_ts(odp_packet_t pkt) +{ + return *(odp_time_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.timestamp); +} + +/** @internal Inline function @param pkt @return */ +static inline void *_odp_packet_head(odp_packet_t pkt) +{ + return (uint8_t *)_odp_packet_data(pkt) - _odp_packet_headroom(pkt); +} + +/** @internal Inline function @param pkt @return */ +static inline int _odp_packet_is_segmented(odp_packet_t pkt) +{ + return _odp_packet_num_segs(pkt) > 1; +} + +/** @internal Inline function @param pkt @return */ +static inline odp_packet_seg_t _odp_packet_first_seg(odp_packet_t pkt) +{ + (void)pkt; + + return 0; +} + +/** @internal Inline function @param pkt @return */ +static inline odp_packet_seg_t _odp_packet_last_seg(odp_packet_t pkt) +{ + return _odp_packet_num_segs(pkt) - 1; +} + +/** @internal Inline function @param pkt @param seg @return */ +static inline odp_packet_seg_t _odp_packet_next_seg(odp_packet_t pkt, + odp_packet_seg_t seg) +{ + if (odp_unlikely(seg >= _odp_packet_last_seg(pkt))) + return ODP_PACKET_SEG_INVALID; + + return seg + 1; +} + +/** @internal Inline function @param pkt @param offset @param len */ +static inline void _odp_packet_prefetch(odp_packet_t pkt, uint32_t offset, + uint32_t len) +{ + (void)pkt; (void)offset; (void)len; +} + +/* Include inlined versions of API functions */ +#include +#if ODP_ABI_COMPAT == 0 + +/** @ingroup odp_packet + * @{ + */ + +#include + +/** + * @} + */ + +#endif + +#endif diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h b/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h new file mode 100644 index 0000000..233bc87 --- /dev/null +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h @@ -0,0 +1,113 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Packet inline functions + */ + +#ifndef _ODP_PLAT_PACKET_INLINES_API_H_ +#define _ODP_PLAT_PACKET_INLINES_API_H_ + +_ODP_INLINE void *odp_packet_data(odp_packet_t pkt) +{ + return _odp_packet_data(pkt); +} + +_ODP_INLINE uint32_t odp_packet_seg_len(odp_packet_t pkt) +{ + return _odp_packet_seg_len(pkt); +} + +_ODP_INLINE uint32_t odp_packet_len(odp_packet_t pkt) +{ + return _odp_packet_len(pkt); +} + +_ODP_INLINE uint32_t odp_packet_headroom(odp_packet_t pkt) +{ + return _odp_packet_headroom(pkt); +} + +_ODP_INLINE uint32_t odp_packet_tailroom(odp_packet_t pkt) +{ + return _odp_packet_tailroom(pkt); +} + +_ODP_INLINE odp_pool_t odp_packet_pool(odp_packet_t pkt) +{ + return _odp_packet_pool(pkt); +} + +_ODP_INLINE odp_pktio_t odp_packet_input(odp_packet_t pkt) +{ + return _odp_packet_input(pkt); +} + +_ODP_INLINE int odp_packet_num_segs(odp_packet_t pkt) +{ + return _odp_packet_num_segs(pkt); +} + +_ODP_INLINE void *odp_packet_user_ptr(odp_packet_t pkt) +{ + return _odp_packet_user_ptr(pkt); +} + +_ODP_INLINE void *odp_packet_user_area(odp_packet_t pkt) +{ + return _odp_packet_user_area(pkt); +} + +_ODP_INLINE uint32_t odp_packet_user_area_size(odp_packet_t pkt) +{ + return _odp_packet_user_area_size(pkt); +} + +_ODP_INLINE uint32_t odp_packet_flow_hash(odp_packet_t pkt) +{ + return _odp_packet_flow_hash(pkt); +} + +_ODP_INLINE odp_time_t odp_packet_ts(odp_packet_t pkt) +{ + return _odp_packet_ts(pkt); +} + +_ODP_INLINE void *odp_packet_head(odp_packet_t pkt) +{ + return _odp_packet_head(pkt); +} + +_ODP_INLINE int odp_packet_is_segmented(odp_packet_t pkt) +{ + return _odp_packet_is_segmented(pkt); +} + +_ODP_INLINE odp_packet_seg_t odp_packet_first_seg(odp_packet_t pkt) +{ + return _odp_packet_first_seg(pkt); +} + +_ODP_INLINE odp_packet_seg_t odp_packet_last_seg(odp_packet_t pkt) +{ + return _odp_packet_last_seg(pkt); +} + +_ODP_INLINE odp_packet_seg_t odp_packet_next_seg(odp_packet_t pkt, + odp_packet_seg_t seg) +{ + return _odp_packet_next_seg(pkt, seg); +} + +_ODP_INLINE void odp_packet_prefetch(odp_packet_t pkt, uint32_t offset, + uint32_t len) +{ + return _odp_packet_prefetch(pkt, offset, len); +} + +#endif diff --git a/platform/linux-generic/include/odp/api/plat/packet_types.h b/platform/linux-generic/include/odp/api/plat/packet_types.h index 999130e..a8530bf 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_types.h @@ -18,6 +18,8 @@ extern "C" { #endif +#include + #include #if ODP_ABI_COMPAT == 1 #include @@ -55,6 +57,37 @@ typedef enum { #endif +/** @internal Packet header field offsets for inline functions */ +typedef struct _odp_packet_inline_offset_t { + /** @internal field offset */ + size_t data; + /** @internal field offset */ + size_t seg_len; + /** @internal field offset */ + size_t frame_len; + /** @internal field offset */ + size_t headroom; + /** @internal field offset */ + size_t tailroom; + /** @internal field offset */ + size_t pool; + /** @internal field offset */ + size_t input; + /** @internal field offset */ + size_t segcount; + /** @internal field offset */ + size_t user_ptr; + /** @internal field offset */ + size_t user_area; + /** @internal field offset */ + size_t user_area_size; + /** @internal field offset */ + size_t flow_hash; + /** @internal field offset */ + size_t timestamp; + +} _odp_packet_inline_offset_t; + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 9a8c112..f193ac2 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include #include #include #include @@ -23,6 +24,23 @@ /* Initial packet segment data length */ #define BASE_LEN CONFIG_PACKET_MAX_SEG_LEN +/* Fill in packet header field offsets for inline functions */ +const _odp_packet_inline_offset_t _odp_packet_inline ODP_ALIGNED_CACHE = { + .data = offsetof(odp_packet_hdr_t, buf_hdr.seg[0].data), + .seg_len = offsetof(odp_packet_hdr_t, buf_hdr.seg[0].len), + .frame_len = offsetof(odp_packet_hdr_t, frame_len), + .headroom = offsetof(odp_packet_hdr_t, headroom), + .tailroom = offsetof(odp_packet_hdr_t, tailroom), + .pool = offsetof(odp_packet_hdr_t, buf_hdr.pool_hdl), + .input = offsetof(odp_packet_hdr_t, input), + .segcount = offsetof(odp_packet_hdr_t, buf_hdr.segcount), + .user_ptr = offsetof(odp_packet_hdr_t, buf_hdr.buf_ctx), + .user_area = offsetof(odp_packet_hdr_t, buf_hdr.uarea_addr), + .user_area_size = offsetof(odp_packet_hdr_t, buf_hdr.uarea_size), + .flow_hash = offsetof(odp_packet_hdr_t, flow_hash), + .timestamp = offsetof(odp_packet_hdr_t, timestamp) +}; + static inline odp_packet_hdr_t *packet_hdr(odp_packet_t pkt) { return (odp_packet_hdr_t *)(uintptr_t)pkt; @@ -655,13 +673,6 @@ odp_event_t odp_packet_to_event(odp_packet_t pkt) * */ -void *odp_packet_head(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - - return pkt_hdr->buf_hdr.seg[0].data - pkt_hdr->headroom; -} - uint32_t odp_packet_buf_len(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); @@ -669,35 +680,6 @@ uint32_t odp_packet_buf_len(odp_packet_t pkt) return pkt_hdr->buf_hdr.size * pkt_hdr->buf_hdr.segcount; } -void *odp_packet_data(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - - return packet_data(pkt_hdr); -} - -uint32_t odp_packet_seg_len(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - - return packet_first_seg_len(pkt_hdr); -} - -uint32_t odp_packet_len(odp_packet_t pkt) -{ - return packet_hdr(pkt)->frame_len; -} - -uint32_t odp_packet_headroom(odp_packet_t pkt) -{ - return packet_hdr(pkt)->headroom; -} - -uint32_t odp_packet_tailroom(odp_packet_t pkt) -{ - return packet_hdr(pkt)->tailroom; -} - void *odp_packet_tail(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); @@ -1207,13 +1189,6 @@ void *odp_packet_offset(odp_packet_t pkt, uint32_t offset, uint32_t *len, return addr; } -/* This function is a no-op */ -void odp_packet_prefetch(odp_packet_t pkt ODP_UNUSED, - uint32_t offset ODP_UNUSED, - uint32_t len ODP_UNUSED) -{ -} - /* * * Meta-data @@ -1221,41 +1196,16 @@ void odp_packet_prefetch(odp_packet_t pkt ODP_UNUSED, * */ -odp_pool_t odp_packet_pool(odp_packet_t pkt) -{ - return packet_hdr(pkt)->buf_hdr.pool_hdl; -} - -odp_pktio_t odp_packet_input(odp_packet_t pkt) -{ - return packet_hdr(pkt)->input; -} - int odp_packet_input_index(odp_packet_t pkt) { return odp_pktio_index(packet_hdr(pkt)->input); } -void *odp_packet_user_ptr(odp_packet_t pkt) -{ - return packet_hdr(pkt)->buf_hdr.buf_ctx; -} - void odp_packet_user_ptr_set(odp_packet_t pkt, const void *ctx) { packet_hdr(pkt)->buf_hdr.buf_cctx = ctx; } -void *odp_packet_user_area(odp_packet_t pkt) -{ - return packet_hdr(pkt)->buf_hdr.uarea_addr; -} - -uint32_t odp_packet_user_area_size(odp_packet_t pkt) -{ - return packet_hdr(pkt)->buf_hdr.uarea_size; -} - void *odp_packet_l2_ptr(odp_packet_t pkt, uint32_t *len) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); @@ -1348,13 +1298,6 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset) return 0; } -uint32_t odp_packet_flow_hash(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - - return pkt_hdr->flow_hash; -} - void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); @@ -1363,13 +1306,6 @@ void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash) pkt_hdr->p.input_flags.flow_hash = 1; } -odp_time_t odp_packet_ts(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - - return pkt_hdr->timestamp; -} - void odp_packet_ts_set(odp_packet_t pkt, odp_time_t timestamp) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); @@ -1378,42 +1314,6 @@ void odp_packet_ts_set(odp_packet_t pkt, odp_time_t timestamp) pkt_hdr->p.input_flags.timestamp = 1; } -int odp_packet_is_segmented(odp_packet_t pkt) -{ - return packet_hdr(pkt)->buf_hdr.segcount > 1; -} - -int odp_packet_num_segs(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - - return pkt_hdr->buf_hdr.segcount; -} - -odp_packet_seg_t odp_packet_first_seg(odp_packet_t pkt) -{ - (void)pkt; - - return 0; -} - -odp_packet_seg_t odp_packet_last_seg(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - - return packet_last_seg(pkt_hdr); -} - -odp_packet_seg_t odp_packet_next_seg(odp_packet_t pkt, odp_packet_seg_t seg) -{ - odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - - if (odp_unlikely(seg >= (odp_packet_seg_t)packet_last_seg(pkt_hdr))) - return ODP_PACKET_SEG_INVALID; - - return seg + 1; -} - /* * * Segment level @@ -1542,7 +1442,7 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len, return rc; (void)odp_packet_move_data(*pkt, 0, shift, - odp_packet_len(*pkt) - shift); + _odp_packet_len(*pkt) - shift); (void)odp_packet_trunc_tail(pkt, shift, NULL, NULL); return 1; @@ -1586,7 +1486,7 @@ int odp_packet_concat(odp_packet_t *dst, odp_packet_t src) int odp_packet_split(odp_packet_t *pkt, uint32_t len, odp_packet_t *tail) { - uint32_t pktlen = odp_packet_len(*pkt); + uint32_t pktlen = _odp_packet_len(*pkt); if (len >= pktlen || tail == NULL) return -1; @@ -1627,7 +1527,7 @@ odp_packet_t odp_packet_copy(odp_packet_t pkt, odp_pool_t pool) odp_packet_t odp_packet_copy_part(odp_packet_t pkt, uint32_t offset, uint32_t len, odp_pool_t pool) { - uint32_t pktlen = odp_packet_len(pkt); + uint32_t pktlen = _odp_packet_len(pkt); odp_packet_t newpkt; if (offset >= pktlen || offset + len > pktlen) @@ -2246,3 +2146,8 @@ uint64_t odp_packet_seg_to_u64(odp_packet_seg_t hdl) { return _odp_pri(hdl); } + +/* Include non-inlined versions of API functions */ +#if ODP_ABI_COMPAT == 1 +#include +#endif diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 9a9f7a4..1922109 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -14,6 +14,9 @@ #include +#include +#include + #include #include #include @@ -836,7 +839,7 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, return 0; } for (i = 0; i < num; i++) { - pkt_len = odp_packet_len(pkt_table[i]); + pkt_len = _odp_packet_len(pkt_table[i]); if (pkt_len > pkt_dpdk->mtu) { if (i == 0) diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 208984b..ae3db34 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -8,6 +8,9 @@ #include +#include +#include + #include #include #include @@ -806,7 +809,7 @@ static int netmap_send(pktio_entry_t *pktio_entry, int index, for (nb_tx = 0; nb_tx < num; nb_tx++) { pkt = pkt_table[nb_tx]; - pkt_len = odp_packet_len(pkt); + pkt_len = _odp_packet_len(pkt); if (pkt_len > pkt_nm->mtu) { if (nb_tx == 0) diff --git a/test/common_plat/performance/Makefile.am b/test/common_plat/performance/Makefile.am index 1074ade..9111c0c 100644 --- a/test/common_plat/performance/Makefile.am +++ b/test/common_plat/performance/Makefile.am @@ -28,6 +28,10 @@ odp_bench_packet_LDFLAGS = $(AM_LDFLAGS) -static odp_bench_packet_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test odp_crypto_LDFLAGS = $(AM_LDFLAGS) -static odp_crypto_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test +odp_pktio_perf_LDFLAGS = $(AM_LDFLAGS) -static +odp_pktio_perf_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test +odp_l2fwd_LDFLAGS = $(AM_LDFLAGS) -static +odp_l2fwd_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test odp_pktio_ordered_LDFLAGS = $(AM_LDFLAGS) -static odp_pktio_ordered_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test odp_sched_latency_LDFLAGS = $(AM_LDFLAGS) -static From patchwork Wed Feb 8 12:17:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93626 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2701340obz; Wed, 8 Feb 2017 04:21:26 -0800 (PST) X-Received: by 10.237.34.116 with SMTP id o49mr18645663qtc.122.1486556486002; Wed, 08 Feb 2017 04:21:26 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f33si5450835qtf.306.2017.02.08.04.21.25; Wed, 08 Feb 2017 04:21:25 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A4145634CA; Wed, 8 Feb 2017 12:21:25 +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 F0B39634CC; Wed, 8 Feb 2017 12:18:40 +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 276E762FE2; Wed, 8 Feb 2017 12:18:27 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0098.outbound.protection.outlook.com [104.47.2.98]) by lists.linaro.org (Postfix) with ESMTPS id 11D8562FE2 for ; Wed, 8 Feb 2017 12:18:09 +0000 (UTC) Received: from VI1PR07CA0082.eurprd07.prod.outlook.com (10.164.94.178) by HE1PR07MB1628.eurprd07.prod.outlook.com (10.166.124.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Wed, 8 Feb 2017 12:18:07 +0000 Received: from AM1FFO11FD044.protection.gbl (2a01:111:f400:7e00::187) by VI1PR07CA0082.outlook.office365.com (2a01:111:e400:5967::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5 via Frontend Transport; Wed, 8 Feb 2017 12:18:06 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.35 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.35) by AM1FFO11FD044.mail.protection.outlook.com (10.174.64.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.7 via Frontend Transport; Wed, 8 Feb 2017 12:18:06 +0000 Received: from fihe3nok1348.nsn-intra.net (10.158.36.136) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34; Wed, 8 Feb 2017 14:18:05 +0200 Received: from mailrelay.int.nokia.com (10.130.128.21) by fihe3nok1348.nsn-intra.net (10.158.36.136) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Wed, 8 Feb 2017 14:18:04 +0200 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 v18CHbVj022768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Feb 2017 14:17:37 +0200 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 v18CHavx022737 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Wed, 8 Feb 2017 14:17:36 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Wed, 8 Feb 2017 14:17:36 +0200 Message-ID: <1486556256-22167-6-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> References: <1486556256-22167-1-git-send-email-petri.savolainen@linaro.org> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.35; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39450400003)(39850400002)(39410400002)(39860400002)(39840400002)(2980300002)(199003)(51234002)(189002)(50986999)(76176999)(626004)(81156014)(305945005)(5660300001)(5003940100001)(81166006)(356003)(68736007)(2906002)(47776003)(8676002)(77096006)(48376002)(53936002)(50466002)(189998001)(97736004)(106466001)(36756003)(2351001)(33646002)(2950100002)(450100001)(6916009)(86362001)(92566002)(50226002)(105596002)(110136004)(8936002)(22756006)(38730400002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB1628; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD044; 1:IdY7IIplH398VNTAvfmhGipeOA84wiJpIEygvFLz5X3mMtKmm4u9Wub0YcIRxHdcOy0+AIl7mmwR0+cu1fEvvkVjETOA79rk1yho+uwptbM14UH1Dba+vQOMT0cgAxC+No2rgeg+t397gVVTTFCbzaLQOC9dtV5Yf1mEnVBhLxXp8a0v8EeB5T+3qVTtGZp8mR5pxR9HyYVBBt4fcQWyqqf8ghCBPMXmrBSNZQ29hACOZAMtT8crzDONk3l5KCB61PKaCHbV+2Qi3rUFOIMO3vbAsPKzNoUm3bbdfJiedWcXB0vvSmEHljOH1b1AQlMS2pQxFtJe4CufePyq2/522Gv+p60A1+6V1gD9PsYaBZmNch6gKNYX2s7Fb7c/q8jh8P8hSlUCOcA4siyjK/jFf14p4+uno5t4LZTCOoU41th+iuLLSJ98IjcOUZfP47RfC70VQGF0ZM/162Pr3jA8C1PwmJvPC2EOSzxlHEYxbtSje3M1nTrYKM4zgEMXCc8FbbANZw5xZiwyvtbrjBDX9A== X-MS-Office365-Filtering-Correlation-Id: 3cf86fa1-6045-43bb-5a1d-08d4501c89b3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:HE1PR07MB1628; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1628; 3:CK/RZknq+J20YsIpBlXZ4Jr1Uf9ATwatqluknJnv2vzmJiwasKwgonJ0xBqPzGkDssHPdPd6bJe/mvZRJcU6lZv0Oj4+Byua6IRnRSa10H1xbgRZh7QmUsjMTtaGEOKFAjLj+dL/aJqLj7+szV/T6K6tj8k0ca9W+HB2Ifrv8GIrXfQu7QstR0ajWqlSvroeO5+O8uwDhDsVvZcOyiT1lZ/cV2x18wX0+qCWD4G4H7H1veqMGdTl6hAYjjockezWyhw3xnhcV1wtPXmuN8FfEHBPMOM8yOsja/7Tdakvj2SkCsrR/tWLC6w+t2XHgOyheLB3Y/+BbibNwloz/GUm6I7RnWdkpz8YonzLAi8Ibyc=; 25:qFX2h5u9KLg8IysbYKA0fH5bYhvthN2eW3e9cX/Mh+pylSvcurV1ydC03kS9DpnyfK/Yj6066MlWqTeUdj4a9G2EaNpiQf8t1orWAqqUEZuPpKhCMSz+uudlOBruSEdFYdUZIPOMgdH1hMjVYGu5YMIY6i8bAfzpRcnLlBse3nMvZ3TLidXpYhGot35UNxoHWHgJEPtRB94DeR+n70IHt3Br6jdmcYkfZbwJga7xFeVPvNy5sNF+KzQkekQbQd/PC39gFdqysHyIEIxXOEB5tianFLv5+exH2EJ+72U5Xt/IMf/2jUwULJAqee3ajEKOeEgOJ0OpTz5776gANa3SqfqBkDCdRshb9ueqm3BXLzgVyq/c9ABAg2NhWkQ4z6sxwIGZQZ0ZkP6vt4ptcw5PVq3/TJUAxxOKnGt6F/wHSyY4x1NYnxHkz274pp082lcH66fY0/k9Ber8ZsdBHoHEDg== X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1628; 31:whEG6ipCQ4jYeRHQKnV3GCwLyFVl0qLYFxrTJoyWU6nAHOo/RKvLzUjochdKMpxvBUW0eWvU7osr1WaDrVHe5hR0pGdCme8QY2Wmi6qiZrhbKU3VQPnwfqQanNTW6POQjadylLSF2oy/d6+RqCrvxvu/W+rY/+2YR1Xo0YswoMT8Uw/sXKXTSw5jadF7srT67nN0qA3NK13pheQeiERMQvUndKKZjoI+bQvxudx0zeCsHkKotDWbxACZyhbF+evYGxV/jsrHBATUv5A4YZW9kDIQsO62GVO7QU62gZ3WbN8=; 20:Cp3MXoc3lGrOUWI37p7j0mQoWrlfqTukdIo3bU8ES/5E9lLZZ4MFuTMnMPYgxeiBHiTEHo0e+xc5cxDpvp93LlKYa7AFpRjb2i8oidSgQ7qH/Z3IazHb1l5pFF+T7emqvOj2w6iUUQtkgRzpKWAfburKXXZDINhixv1yv0bar1bHUmHRv1KkYh4mrrWSQ/gjWA5KcvwErYzXmeQNGg/aqqmZKykklN4ebQZmoSPnYc5SkvMKRr2f7jxZVVEZjcCZ+GeDkckSJLWVQqQYJnDFGCpHo3I9kBw8QUOD943JbGZ2zPbicg4vxT4dO59Sbl9BEU4O/edAcDbD2sSrBdfxiuxFnvbxLW3P7chVvNVIfzcGuAQZ7exbDlw+8rkBORNhZXPjbPiEiOxRtY0TKZEAU7XKYXi3yMgClq5SGG6OJ275VSSp2jeG/Xn6puAdkxiCLTaQWHLOGMYsWy05nVsIn5FKjSsKJaNCtJ/NhBQe8zWi8ybar1to4wHh7k2kocNz1vskUw9JMPH0pRIuC8XAdj2mryRiRPRRnO9TzKDD8bbdv7gCIjBrhdnKBYMRcHc7bLNVhbRinht86lIq9/+J43jAukb512S88yWSrCFoYBg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(13016025)(13018025)(2017020702029)(20170203043)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558025)(20161123560025)(6072148); SRVR:HE1PR07MB1628; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB1628; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1628; 4:wfz5q8BaqcMq4ZcrE7GjmElqQuf+jEPJCCLhqxZrkVcludpkaYCBeNHn0mlv50GED1dTh1ZzVbGow4ZMsxJpbdhkDuiyssUD2/hbpNfBY/gv4XqetSyRtZuti5k0+DJ5UZ0bFo4gyXcTK0TWjNZzPI6MGi0iY4r1FuJqLUE6io3kOJ4h+iuLZj3xwvcwHOSx670dpxXSGpjUS3XgY9a5cHDdEbztsfQQluS6AlxogscFolQl9jl7QgUO4wcJbaRW+bRQ9LCFqnpnHlzyHFATcE3aERB4gnJ3UTQ2De//i4/erTob8ZmYkm/TAD+NgNMdrvZBD/OrMcWImjCunYoNEryf7IK+9Gx19YcLB+p7gjb2CUQ6ADyTAXTJw8tE7v6bribRYBrq+rnasTGGj7Gd94cTpcdqYNyjr9IJGnI825xl6nkxzwPUZW1NjtU3R84N5HllwcxapzxPmCB0cwqGxOtEztQVMtlqqg8xuYNYNqyOPiaKqew8SVLiOfSk+7+uXo63NmSIf1Yw4oZEw+UkCKW519n06YLNkVu7XGxBKuzLxwrhGKcGFZxxbETfyfLu22dFUItLh1lN5exsHD0tkfDaQPS8/pT2hT0fZ9d9Nb4GsL753JXdsk6mW8Jnn61Rep1iIlAQdYVbkhEbpQJTLEbs92YKS2dusiFm9jOGDSxgjMg+Sz0AsUvG7k3FYoB7Vz2ntNTDvfGOUst5EmU1gyFR9NUscbBzEX7kEBPqTyklqAT29vNEObp4ITFGsT77GYZgoGxNGVvPXHAIq4n0CFDzLl1hPlhtOGo9kJnHx3Y= X-Forefront-PRVS: 0212BDE3BE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR07MB1628; 23:1gIr35hgqhqtnF5e+boANDGHy9xG086FE84ZO7dE6?= qcq8eguiAsNHBXetrCApYR869ig6bb2hvyhKRPCYx+5fq33mkIQM9Ym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vEBhqNGCA5frNbsb+C0Y28+n6TwDIEKk32hhFXlhSY/CxeKFFBnlW7KwnCt+NUblnHlq6712N35vBhr3KhgdtWb6/5qc1H2NFrkrR5AQL+AbCv4Gzvfi/HSP1754QbEe5IsNkYHonhlABEX+9meWMntj75rnCLMYQdNUwLkhZmNAWaiaXibbr8lwqqLtHREecOX44oiNaPmXtQ6Q== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 12:18:06.4841 (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.35]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB1628 Subject: [lng-odp] [PATCH v2 5/5] linux-gen: packet: inline flag functions 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" Added first inlined packet flag functions. Functions are allways used inlined within the implementation. Applications see inlined versions only when ABI compatibility is disabled. Signed-off-by: Petri Savolainen --- platform/linux-generic/Makefile.am | 2 + .../linux-generic/include/odp/api/packet_flags.h | 11 +-- .../include/odp/api/plat/packet_flag_inlines.h | 90 ++++++++++++++++++++++ .../include/odp/api/plat/packet_flag_inlines_api.h | 41 ++++++++++ .../include/odp/api/plat/packet_types.h | 52 +++++++++++++ .../linux-generic/include/odp_packet_internal.h | 55 +------------ platform/linux-generic/odp_packet.c | 4 +- platform/linux-generic/odp_packet_flags.c | 41 ++-------- 8 files changed, 201 insertions(+), 95 deletions(-) create mode 100644 platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h create mode 100644 platform/linux-generic/include/odp/api/plat/packet_flag_inlines_api.h -- 2.8.1 diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 812b22c..335b267 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -78,6 +78,8 @@ odpapiplatinclude_HEADERS = \ $(srcdir)/include/odp/api/plat/crypto_types.h \ $(srcdir)/include/odp/api/plat/event_types.h \ $(srcdir)/include/odp/api/plat/init_types.h \ + $(srcdir)/include/odp/api/plat/packet_flag_inlines.h \ + $(srcdir)/include/odp/api/plat/packet_flag_inlines_api.h \ $(srcdir)/include/odp/api/plat/packet_inlines.h \ $(srcdir)/include/odp/api/plat/packet_inlines_api.h \ $(srcdir)/include/odp/api/plat/packet_types.h \ diff --git a/platform/linux-generic/include/odp/api/packet_flags.h b/platform/linux-generic/include/odp/api/packet_flags.h index 467f5b1..1e55af8 100644 --- a/platform/linux-generic/include/odp/api/packet_flags.h +++ b/platform/linux-generic/include/odp/api/packet_flags.h @@ -17,13 +17,10 @@ extern "C" { #endif -/** @ingroup odp_packet - * @{ - */ - -/** - * @} - */ +#include +#if ODP_ABI_COMPAT == 0 +#include +#endif #include diff --git a/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h new file mode 100644 index 0000000..2de04c8 --- /dev/null +++ b/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Packet inline functions + */ + +#ifndef _ODP_PLAT_PACKET_FLAG_INLINES_H_ +#define _ODP_PLAT_PACKET_FLAG_INLINES_H_ + +#include +#include + +/** @internal Inline function offsets */ +extern const _odp_packet_inline_offset_t _odp_packet_inline; + +/** @internal Inline function @param pkt @return */ +static inline uint64_t _odp_packet_input_flags(odp_packet_t pkt) +{ + return *(uint64_t *)(uintptr_t)((uint8_t *)pkt + + _odp_packet_inline.input_flags); +} + +/** @internal Inline function @param pkt @return */ +static inline int _odp_packet_has_l2(odp_packet_t pkt) +{ + _odp_packet_input_flags_t flags; + + flags.all = _odp_packet_input_flags(pkt); + return flags.l2; +} + +/** @internal Inline function @param pkt @return */ +static inline int _odp_packet_has_eth(odp_packet_t pkt) +{ + _odp_packet_input_flags_t flags; + + flags.all = _odp_packet_input_flags(pkt); + return flags.eth; +} + +/** @internal Inline function @param pkt @return */ +static inline int _odp_packet_has_jumbo(odp_packet_t pkt) +{ + _odp_packet_input_flags_t flags; + + flags.all = _odp_packet_input_flags(pkt); + return flags.jumbo; +} + +/** @internal Inline function @param pkt @return */ +static inline int _odp_packet_has_flow_hash(odp_packet_t pkt) +{ + _odp_packet_input_flags_t flags; + + flags.all = _odp_packet_input_flags(pkt); + return flags.flow_hash; +} + +/** @internal Inline function @param pkt @return */ +static inline int _odp_packet_has_ts(odp_packet_t pkt) +{ + _odp_packet_input_flags_t flags; + + flags.all = _odp_packet_input_flags(pkt); + return flags.timestamp; +} + +/* Include inlined versions of API functions */ +#include +#if ODP_ABI_COMPAT == 0 + +/** @ingroup odp_packet + * @{ + */ + +#include + +/** + * @} + */ + +#endif + +#endif diff --git a/platform/linux-generic/include/odp/api/plat/packet_flag_inlines_api.h b/platform/linux-generic/include/odp/api/plat/packet_flag_inlines_api.h new file mode 100644 index 0000000..f4e143a --- /dev/null +++ b/platform/linux-generic/include/odp/api/plat/packet_flag_inlines_api.h @@ -0,0 +1,41 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Packet inline functions + */ + +#ifndef _ODP_PLAT_PACKET_FLAG_INLINES_API_H_ +#define _ODP_PLAT_PACKET_FLAG_INLINES_API_H_ + +_ODP_INLINE int odp_packet_has_l2(odp_packet_t pkt) +{ + return _odp_packet_has_l2(pkt); +} + +_ODP_INLINE int odp_packet_has_eth(odp_packet_t pkt) +{ + return _odp_packet_has_eth(pkt); +} + +_ODP_INLINE int odp_packet_has_jumbo(odp_packet_t pkt) +{ + return _odp_packet_has_jumbo(pkt); +} + +_ODP_INLINE int odp_packet_has_flow_hash(odp_packet_t pkt) +{ + return _odp_packet_has_flow_hash(pkt); +} + +_ODP_INLINE int odp_packet_has_ts(odp_packet_t pkt) +{ + return _odp_packet_has_ts(pkt); +} + +#endif diff --git a/platform/linux-generic/include/odp/api/plat/packet_types.h b/platform/linux-generic/include/odp/api/plat/packet_types.h index a8530bf..b8f665d 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_types.h @@ -85,9 +85,61 @@ typedef struct _odp_packet_inline_offset_t { size_t flow_hash; /** @internal field offset */ size_t timestamp; + /** @internal field offset */ + size_t input_flags; } _odp_packet_inline_offset_t; +/** @internal Packet input & protocol flags */ +typedef union { + /** All input flags */ + uint64_t all; + + struct { + uint64_t parsed_l2:1; /**< L2 parsed */ + uint64_t dst_queue:1; /**< Dst queue present */ + + uint64_t flow_hash:1; /**< Flow hash present */ + uint64_t timestamp:1; /**< Timestamp present */ + + uint64_t l2:1; /**< known L2 protocol present */ + uint64_t l3:1; /**< known L3 protocol present */ + uint64_t l4:1; /**< known L4 protocol present */ + + uint64_t eth:1; /**< Ethernet */ + uint64_t eth_bcast:1; /**< Ethernet broadcast */ + uint64_t eth_mcast:1; /**< Ethernet multicast */ + uint64_t jumbo:1; /**< Jumbo frame */ + uint64_t vlan:1; /**< VLAN hdr found */ + uint64_t vlan_qinq:1; /**< Stacked VLAN found, QinQ */ + + uint64_t snap:1; /**< SNAP */ + uint64_t arp:1; /**< ARP */ + + uint64_t ipv4:1; /**< IPv4 */ + uint64_t ipv6:1; /**< IPv6 */ + uint64_t ip_bcast:1; /**< IP broadcast */ + uint64_t ip_mcast:1; /**< IP multicast */ + uint64_t ipfrag:1; /**< IP fragment */ + uint64_t ipopt:1; /**< IP optional headers */ + + uint64_t ipsec:1; /**< IPSec packet. Required by the + odp_packet_has_ipsec_set() func. */ + uint64_t ipsec_ah:1; /**< IPSec authentication header */ + uint64_t ipsec_esp:1; /**< IPSec encapsulating security + payload */ + uint64_t udp:1; /**< UDP */ + uint64_t tcp:1; /**< TCP */ + uint64_t tcpopt:1; /**< TCP options present */ + uint64_t sctp:1; /**< SCTP */ + uint64_t icmp:1; /**< ICMP */ + + uint64_t color:2; /**< Packet color for traffic mgmt */ + uint64_t nodrop:1; /**< Drop eligibility status */ + }; + +} _odp_packet_input_flags_t; + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 499f8df..4f844d1 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -26,62 +26,13 @@ extern "C" { #include #include #include +#include /** Minimum segment length expected by packet_parse_common() */ #define PACKET_PARSE_SEG_LEN 96 -/** - * Packet input & protocol flags - */ -typedef union { - /* All input flags */ - uint64_t all; - - struct { - uint64_t parsed_l2:1; /**< L2 parsed */ - uint64_t dst_queue:1; /**< Dst queue present */ - - uint64_t flow_hash:1; /**< Flow hash present */ - uint64_t timestamp:1; /**< Timestamp present */ - - uint64_t l2:1; /**< known L2 protocol present */ - uint64_t l3:1; /**< known L3 protocol present */ - uint64_t l4:1; /**< known L4 protocol present */ - - uint64_t eth:1; /**< Ethernet */ - uint64_t eth_bcast:1; /**< Ethernet broadcast */ - uint64_t eth_mcast:1; /**< Ethernet multicast */ - uint64_t jumbo:1; /**< Jumbo frame */ - uint64_t vlan:1; /**< VLAN hdr found */ - uint64_t vlan_qinq:1; /**< Stacked VLAN found, QinQ */ - - uint64_t snap:1; /**< SNAP */ - uint64_t arp:1; /**< ARP */ - - uint64_t ipv4:1; /**< IPv4 */ - uint64_t ipv6:1; /**< IPv6 */ - uint64_t ip_bcast:1; /**< IP broadcast */ - uint64_t ip_mcast:1; /**< IP multicast */ - uint64_t ipfrag:1; /**< IP fragment */ - uint64_t ipopt:1; /**< IP optional headers */ - - uint64_t ipsec:1; /**< IPSec packet. Required by the - odp_packet_has_ipsec_set() func. */ - uint64_t ipsec_ah:1; /**< IPSec authentication header */ - uint64_t ipsec_esp:1; /**< IPSec encapsulating security - payload */ - uint64_t udp:1; /**< UDP */ - uint64_t tcp:1; /**< TCP */ - uint64_t tcpopt:1; /**< TCP options present */ - uint64_t sctp:1; /**< SCTP */ - uint64_t icmp:1; /**< ICMP */ - - uint64_t color:2; /**< Packet color for traffic mgmt */ - uint64_t nodrop:1; /**< Drop eligibility status */ - }; -} input_flags_t; -ODP_STATIC_ASSERT(sizeof(input_flags_t) == sizeof(uint64_t), +ODP_STATIC_ASSERT(sizeof(_odp_packet_input_flags_t) == sizeof(uint64_t), "INPUT_FLAGS_SIZE_ERROR"); /** @@ -144,7 +95,7 @@ typedef enum { * Packet parser metadata */ typedef struct { - input_flags_t input_flags; + _odp_packet_input_flags_t input_flags; error_flags_t error_flags; output_flags_t output_flags; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index f193ac2..c21f635 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -38,7 +38,9 @@ const _odp_packet_inline_offset_t _odp_packet_inline ODP_ALIGNED_CACHE = { .user_area = offsetof(odp_packet_hdr_t, buf_hdr.uarea_addr), .user_area_size = offsetof(odp_packet_hdr_t, buf_hdr.uarea_size), .flow_hash = offsetof(odp_packet_hdr_t, flow_hash), - .timestamp = offsetof(odp_packet_hdr_t, timestamp) + .timestamp = offsetof(odp_packet_hdr_t, timestamp), + .input_flags = offsetof(odp_packet_hdr_t, p.input_flags) + }; static inline odp_packet_hdr_t *packet_hdr(odp_packet_t pkt) diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index 798fa11..ea9a227 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include #include #include @@ -32,13 +33,6 @@ int odp_packet_has_error(odp_packet_t pkt) /* Get Input Flags */ -int odp_packet_has_l2(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - - return pkt_hdr->p.input_flags.l2; -} - int odp_packet_has_l2_error(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); @@ -79,13 +73,6 @@ int odp_packet_has_l4_error(odp_packet_t pkt) return pkt_hdr->p.error_flags.tcp_err | pkt_hdr->p.error_flags.udp_err; } -int odp_packet_has_eth(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - - return pkt_hdr->p.input_flags.eth; -} - int odp_packet_has_eth_bcast(odp_packet_t pkt) { retflag(pkt, input_flags.eth_bcast, LAYER_L2); @@ -96,13 +83,6 @@ int odp_packet_has_eth_mcast(odp_packet_t pkt) retflag(pkt, input_flags.eth_mcast, LAYER_L2); } -int odp_packet_has_jumbo(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - - return pkt_hdr->p.input_flags.jumbo; -} - int odp_packet_has_vlan(odp_packet_t pkt) { retflag(pkt, input_flags.vlan, LAYER_L2); @@ -173,20 +153,6 @@ int odp_packet_has_icmp(odp_packet_t pkt) retflag(pkt, input_flags.icmp, LAYER_L4); } -int odp_packet_has_flow_hash(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - - return pkt_hdr->p.input_flags.flow_hash; -} - -int odp_packet_has_ts(odp_packet_t pkt) -{ - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); - - return pkt_hdr->p.input_flags.timestamp; -} - odp_packet_color_t odp_packet_color(odp_packet_t pkt) { retflag(pkt, input_flags.color, LAYER_ALL); @@ -352,3 +318,8 @@ void odp_packet_has_ts_clr(odp_packet_t pkt) pkt_hdr->p.input_flags.timestamp = 0; } + +/* Include non-inlined versions of API functions */ +#if ODP_ABI_COMPAT == 1 +#include +#endif