From patchwork Mon Feb 6 12:37:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93428 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1689386qgi; Mon, 6 Feb 2017 04:47:30 -0800 (PST) X-Received: by 10.55.75.143 with SMTP id y137mr8623756qka.39.1486385250144; Mon, 06 Feb 2017 04:47:30 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c126si417115qkd.37.2017.02.06.04.47.29; Mon, 06 Feb 2017 04:47:30 -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 AF05562DBC; Mon, 6 Feb 2017 12:47:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-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 A522F62F3B; Mon, 6 Feb 2017 12:39:32 +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 E289A62DB8; Mon, 6 Feb 2017 12:38:47 +0000 (UTC) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50123.outbound.protection.outlook.com [40.107.5.123]) by lists.linaro.org (Postfix) with ESMTPS id B3AF562DB9 for ; Mon, 6 Feb 2017 12:38:29 +0000 (UTC) Received: from VI1PR07CA0060.eurprd07.prod.outlook.com (10.164.94.156) by AMSPR07MB279.eurprd07.prod.outlook.com (10.242.227.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 6 Feb 2017 12:38:28 +0000 Received: from AM1FFO11FD035.protection.gbl (2a01:111:f400:7e00::124) by VI1PR07CA0060.outlook.office365.com (2a01:111:e400:5967::28) 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; Mon, 6 Feb 2017 12:38:27 +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 AM1FFO11FD035.mail.protection.outlook.com (10.174.64.224) 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; Mon, 6 Feb 2017 12:38:27 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1347.nsn-intra.net (10.158.36.135) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:24 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:24 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4TR019857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4V9019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:37:55 +0200 Message-ID: <1486384684-14761-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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)(39450400003)(39860400002)(39410400002)(39850400002)(39840400002)(2980300002)(189002)(199003)(47776003)(50466002)(92566002)(48376002)(2950100002)(107886002)(6916009)(189998001)(110136003)(6666003)(68736007)(86362001)(305945005)(81156014)(81166006)(50226002)(356003)(33646002)(2906002)(76176999)(450100001)(8676002)(50986999)(97736004)(36756003)(8936002)(2351001)(105596002)(106466001)(5660300001)(22756006)(626004)(53936002)(77096006)(38730400001)(5003940100001); DIR:OUT; SFP:1102; SCL:1; SRVR:AMSPR07MB279; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD035; 1:Yy9NjJNMnw8L07u5OgaHI2BwAZGcT+d4TNf0CGX8Qi6IdMnxQX3C1F7lWEEq5bBxB4qoAKLqL3vw/WjSfev6ZPEWckSmx529VHW3ajM8CytwkPV3+c7/FUXicdKDCfczuEhZPz0odvDbVzyWLb19nVjdCKRLaz+XgtxT8G+B1jsW90cCruGtEs9RBlXaADRNxnJzHHcXrsmP5H1Iy1F6uHnzsv9MKX58vXbp2oooGiIPDqV6CKzznK56Aqm/yY3PkyMCJZvMx9mk7uIDHUgV/J+uKZuFDRSPEX1StKT/JAnFmVwk2DjxD/5UhbHoRRVP0UC6j8uBi8VbBrHZfR7OmcyiDenFLypAW6c0NT6FKwKJhOUE9wVYBH1gIonlWQqiqb7Ld16YgHFWT62/27I29yOf8KXApQyzhz5lCyIcmOM0W4oUXUU16MlykM+Msy1BM0D1bRm889MGJgvAQJAPMxuhZZiiEaRulRqF9DVzsak= X-MS-Office365-Filtering-Correlation-Id: 48ed812c-a0a4-49af-ae1d-08d44e8d0c5e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:AMSPR07MB279; X-Microsoft-Exchange-Diagnostics: 1; AMSPR07MB279; 3:hfHzx9K1JvK5HB3uMVywUdpa53pK2zBm3RCjC7tyv1vqRyqyJegJvYgvGzqx2/K72fnw/tuHC4QyBoA4SaiEDw0c/WQ9npwBsriuTKYedxmxXQyK1cfBgV9myRoBMo022K9tYRc67W1bHCIZGfB7QXOis7+5DHWTl2owfFPdYCuKDBPVxUD4PQSDsMQLVydglqgzc4WO62FhPXHz8PphkBAoe/MfiMJ8Mx6FQmF2evwM074f4NKwfdWjTMjIpDGy7mazaXIRLg6EUD/IYEs6h9jzxaSM5NWihGUzNOoZ3ZAOPcvqtCtNGnR42qdI30q6zPfg/x/2akPIRAui7WNKe/rJDyX1vK5gzcTqWnX+egxyIRTMv2ooHadgPn9GWTln; 25:B41Ow/2ws6sAKJjK8BJyr4HIyNxsqTtDvl5hBB3mJb7tppk3ToyYlvrbc1e087jCm66dufEBo3gOOkyd9RmB4xzLbfGnbLi28taq6Zna8v3jmWtRBnpe2W4Rsa/37OY2rmLWUK7ReUTOxRP089wRY0d/2u7sAVYOM03x+Cv1vVUIZeSiQnxqfxGkAn+Eq6QY/MXCRDKC3JZjeZY6WfaMEceZk2HKkaDHA07QI7gkRYCW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JSYv5jYBef43+bIHrjpGAD+rrYpvAkbIAXHGMeP6VurkrAOkmgaeIl6HhFIdzWbQ4PakLwCIrxjP3HzvLI1mAr4or2tQ= 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)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(6072148); SRVR:AMSPR07MB279; BCL:0; PCL:0; RULEID:; SRVR:AMSPR07MB279; X-Microsoft-Exchange-Diagnostics: 1; AMSPR07MB279; 4:GXrMs7uJHLvu/O/LVlgHGKFC07FpfpIRliiWjdLoi/4qcoGHhu03eORgTUA+Efp66aUZKIRNDkqr9NaQQ5HS7vzcF6431M+9KUvDXmHx/7vT+J6kzbKXdR7CrHeUpmpt+JmFD/sNCeiiplr1hHzjiQrqaRgG9GcAYgFmxwwcwJjcrOfUpryPbHyTEfkZnjGOFlnsapgxJj5ACFMvm5WQDNsn/TXwjEcL2D0mrQbeXKC5aS+yBffE/DvwCrtpaxYWsBu8KbLHHu5WqGQ4Sorc6pI0SsSwIEUBISJ4hjDf9YO4ywRnnlPwNuFB/VCKUj9HBgUA2HmtkNUTFXFefVzPF9Ea0V4wHHnTEr+hGqB3z1fRAu4Q881mIyQnfvWXNjn7WnIimtuwjMFt735GM2D4mJX/KAyAblot2b7uGVhW6U97ZjpwWXxWTr0X3LZqBJd5lBzaZub1oLKsM17ASMsm6ihWE5ac1gBQ5U+dZyV+rBcdK6dvGSBRT7MbtwUQ4XlFa8ozf2Rfb/xxRPe0QAPV4YW0vizPbjpVFETzEOH6SpahdEhmEg+FXCCEiNRCTOobusqQeyOjommjWLNAVR0OLmzAppIfEX0N0IWKm8vooGqTpza+bVVWefDTPladSvT1ASsh8CKr6ZoykuRzXssS08iDgr2amuGQQs3aEp6d1UBUNMauUM95g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k/LdjDvCTzvdN/o4lOGi0WiQOXbMUM8aRvg+YJRDbpJ9neaEI0J1Lv4QcO+MlZ5L7uWsBA6rPCx09LBlLihOfXSsb5mhe2X0WoUDHKzRywArtLvHUwq2sXZbLOmjxrRlumqZdaL+Bd69kz0WS58q8+Z9EjyLmBSL8GV6J2AKItYUrEoLRhR0m3jj7Q6KRc2EQfLle2BvIuUbTM4EAw+qlxLZK+OYhjpBiVLDdsYCjMINGUJjQ3pWBDwBLdIt2ihCJwtYiy3g9qCvuXZp9f7NZ171op+V9J22a8h3JZEy/Zbz7fVW59w0FqrBU8rmwudewe5e/wGlElvNhAVlkzS3vUzeKAnUuYIL8U+g5O0BiJek4YRnTiTlmT3RloETbTwkxx6Uojr/3JQXNrWtXDHOKhMW1vrrRH7IZ7ff/hqvQdh4AV54VCbCShO39a75EVXkvnWhp3SB7k6THd0kWx9Z9FEjJTEiA== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:27.0345 (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: AMSPR07MB279 Subject: [lng-odp] [PATCH 01/10] 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 Mon Feb 6 12:37:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93423 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1687518qgi; Mon, 6 Feb 2017 04:41:31 -0800 (PST) X-Received: by 10.55.78.77 with SMTP id c74mr10023800qkb.109.1486384891897; Mon, 06 Feb 2017 04:41:31 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r3si405891qkb.46.2017.02.06.04.41.31; Mon, 06 Feb 2017 04:41:31 -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 8B0C762EBA; Mon, 6 Feb 2017 12:41:31 +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 267C362EBD; Mon, 6 Feb 2017 12:39:08 +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 8C37160B51; Mon, 6 Feb 2017 12:38:34 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0106.outbound.protection.outlook.com [104.47.1.106]) by lists.linaro.org (Postfix) with ESMTPS id 78D6362DB0 for ; Mon, 6 Feb 2017 12:38:26 +0000 (UTC) Received: from AMXPR07CA0035.eurprd07.prod.outlook.com (10.242.64.35) by AM4PR07MB1619.eurprd07.prod.outlook.com (10.166.132.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 6 Feb 2017 12:38:24 +0000 Received: from DB3FFO11FD038.protection.gbl (2a01:111:f400:7e04::128) by AMXPR07CA0035.outlook.office365.com (2a01:111:e400:1000::35) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.37 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.37) by DB3FFO11FD038.mail.protection.outlook.com (10.47.217.69) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1348.nsn-intra.net (10.158.36.136) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:23 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:23 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4Mi019874 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VA019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:37:56 +0200 Message-ID: <1486384684-14761-3-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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.37; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39450400003)(39860400002)(39840400002)(39410400002)(39850400002)(2980300002)(189002)(199003)(86362001)(626004)(110136003)(5660300001)(107886002)(50466002)(48376002)(97736004)(189998001)(356003)(2906002)(38730400001)(575784001)(5003940100001)(53936002)(6666003)(6916009)(2950100002)(77096006)(2351001)(50986999)(92566002)(68736007)(76176999)(8676002)(33646002)(81166006)(36756003)(450100001)(8936002)(105596002)(106466001)(47776003)(50226002)(22756006)(81156014)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR07MB1619; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD038; 1:wtP31KlI49c2xA9iBY6QHrGwg17yI15lHPTEmLNcAVpXf2mdA0UisfmFVaBz8ImjkAschQrXmm0qH5UJQQY8kGyI8wZKkysSty8id6sMsojfhUkU56fGF6CG7HfpQPrX/0v4Y+2hrcxW1lh3z8TOL+CpwwSyQFsip8N7n1BbzemJ0OXom9wZihLUtdbObHCpZih8BrcnFsHt2KX/Wl/KFJmy7g8iHVVKHue4hiVC13s2sP4WErzscAq6Bnlq94Q4Rt8kgiNIn17mwfgb54WBk+OE96eh2ecy17O764yqyAsLtnRPLGczDKVvGUSHbGbga5feuKYs1KVri1ar6cV5RYsqZqiUk99xZlL9V2moM48Y+MYru3kJAi/CDFQInRkb2oCttNiTwMqXmF4bApcy4aOAoLHtXxVV1e9jAak5/MYgrHfiUIM6UJ7qRBVHx/VsE00HL1Uzy5U3sDbKrdfEwDuWTtsCtCNWDsich4d6zxo= X-MS-Office365-Filtering-Correlation-Id: c16b06b6-27bc-4c2f-4e78-08d44e8d0aa4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:AM4PR07MB1619; X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1619; 3:BlkeyNyg8TR6Bm2MwiLryPE5Erlw9MACqYegX3s9/NCrjH9quRZgpuQSKvC4zVJ2f1JwH3HVoT7EQfkue3ZTq9ljCcdDxtprm7D/MrXL/IJp4BL7fd6sIrANdUllDNbj6ZsZY3JVB6DdlrhOX2dE+QuWy4RMPUq+QZE4chp6s/CIzxV8qJ6S5cDFmYdyGzKJMnk125JpyK0QC+OruZDTj0auqJ64it/kCCEp5zGEef46ri1QbmhaseK2ZCqCDWf4tGyRGIQ7CzCJbfw75b9aY+ofe7R2htco54rg/BGO5JrzY2PdNq3IM1snNslMUb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wXTMTXlRrFikukQRT0bTnUTEFAPLbymdoIiDzzkfwnS6WtnbLBvCwe3qM25bs1A04zIxbE6GmtjyL5AJE0cJJRKio7xekqw3cjGTX+55TKYN63npBq3UeNSY9UtL6AGeT4VO/zMWtj3FXsFzBezlqMygXPBx6mBrAtw09HNiMFTNOX5wOg9lb7i1qsZRjdcb5KLTPcZLoNlqeQMdzJ7YUNU8nh6UUYCJJNrxUj2AMSqGJ03TSg5PhdlOjomWK6MUBNu4/0rkKKK8R1C4UkRWl5LgHMT1cdONZT7ZXXRtezCttSQ6Nm1VBZYlY0uCunZvCMsNjpQzCozgSzArAmjozYt2eeRMOqUwjqWvyn5BORzKmVjHbTtUegim5RUj+fsz9s3Tjja3FMMabxShICUtW0hvs= 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)(5005006)(8121501046)(13016025)(13018025)(20170203043)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(6072148); SRVR:AM4PR07MB1619; BCL:0; PCL:0; RULEID:; SRVR:AM4PR07MB1619; X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1619; 4:S0j3+SUlS+ew6SG71ftEYkZ202BSgPDe6c/4UxzDtdnVH42fFdsulM+JxlSHLi9O+FAPD26RoB3wSWz5EkNlz2DFdzv4szCCG3SBIwK4GVFVPC1XTx3L7LvtiSjpR1Q9saNiWLhxJ3Z2sziLoMvUK/J5/Y0OvfUr+rA0VaNf2S2div8kbVKFkQ2pG4ZE6MAKxJ1pZRv6jErC4D29LycCTit6vIQw1yMowOvJbWm2Fc9jvS5dDQEtkDZ4V2wGMsomm/ucJ9h6yp7DX8TTWXePxqpj6VvEaoL/m+TdoO/UbyKpii2hvXocUfVuYZZdvq71Bs/Qf9V901mBFfi941n2lnyGMe6+a7drb/9d1c3LuH8bmPQjbfcdCE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SjYHue4Wpc52qlPaVUD0wzNQgzZSUWKcBDGo8dBxP4Fu6+s+miPsmlMlffQxUc6RG9kI4bsS4Rg==; 24:1um28rBx+axTXH5ZQr+NHgv1WxayiyVx2/lZo9/CHBZw3O+By4dHbfR6yEtPxXVilMBkav9tsiAUw3bubhZIAveOmLQEyK0X4ODikyBN0XE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1619; 7:N2PW/67Z1UnFElTz1KaHBnS+bLTdVKT89BjdChyPgLgVFIdmbvjS8HU9ZsNJW1rVXhMfXt3DchWSayOXhD9mm04c6YXghVCGkj86jI5rowaxfbUm0Gmj3pqWXIOoVzmuA/XPRb5jM0Vl+f/UOnDSobWZx5cwobJwgwEN+ZTWqbviJnxlzPN2lOhVUX0AMsZLdAP17IeTRkqq5GJNbys28yfrPkD3piyxep4Opspq97PGAeLMmrYuCOqKQdyINoQyNbWTp8rTQwjCQ3aEeDw3hyTyYXfTK1acMSYgquDZCpNVJVBtxuVf0A4f3rqbKLx80ED3kaBzlfISXPf0XcL+O8W9AWSXRyz69eWKZI2ze/lvomfRpJDv8AsHWSLQxmgGIxyd+XUCiIgnfLI1fIrUzHov83udNVOe076xnVyLnq94V8+coQkJr0r+fjv9JIXkyNlBox3B5Wb97J4Ls3atat09+/XxapAtpI40wWcCUWOjTPt7Q07zS/jmWki2M5P6Zgv4uzLE+7spuyk4MGdczQ== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:24.0885 (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.37]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR07MB1619 Subject: [lng-odp] [PATCH 02/10] 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 Mon Feb 6 12:37:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93429 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1689816qgi; Mon, 6 Feb 2017 04:48:53 -0800 (PST) X-Received: by 10.200.57.109 with SMTP id t42mr8515708qtb.242.1486385333542; Mon, 06 Feb 2017 04:48:53 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a188si408388qkc.182.2017.02.06.04.48.53; Mon, 06 Feb 2017 04:48:53 -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 25AF262EBA; Mon, 6 Feb 2017 12:48:53 +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 30C3660B51; Mon, 6 Feb 2017 12:39:41 +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 749DC62DB7; Mon, 6 Feb 2017 12:38:50 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0114.outbound.protection.outlook.com [104.47.0.114]) by lists.linaro.org (Postfix) with ESMTPS id AA82C62DBB for ; Mon, 6 Feb 2017 12:38:31 +0000 (UTC) Received: from VI1PR07CA0052.eurprd07.prod.outlook.com (2a01:111:e400:5967::20) by AM3PR07MB276.eurprd07.prod.outlook.com (2a01:111:e400:8819::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 6 Feb 2017 12:38:28 +0000 Received: from AM1FFO11FD035.protection.gbl (2a01:111:f400:7e00::121) by VI1PR07CA0052.outlook.office365.com (2a01:111:e400:5967::20) 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; Mon, 6 Feb 2017 12:38:28 +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 AM1FFO11FD035.mail.protection.outlook.com (10.174.64.224) 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; Mon, 6 Feb 2017 12:38:28 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1347.nsn-intra.net (10.158.36.135) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:24 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:24 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4L7019883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VB019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:37:57 +0200 Message-ID: <1486384684-14761-4-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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)(39410400002)(39840400002)(39860400002)(39450400003)(2980300002)(189002)(199003)(53936002)(450100001)(22756006)(8676002)(81166006)(626004)(5003940100001)(47776003)(50466002)(92566002)(33646002)(81156014)(2906002)(2950100002)(68736007)(48376002)(356003)(5660300001)(6916009)(305945005)(575784001)(6666003)(105596002)(107886002)(77096006)(106466001)(189998001)(76176999)(50986999)(2351001)(36756003)(50226002)(110136003)(38730400001)(8936002)(86362001)(97736004); DIR:OUT; SFP:1102; SCL:1; SRVR:AM3PR07MB276; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD035; 1:J5whUKTDl3Jyke2EUR+S2qj27cb9xTBUxf1r7+CX5cUfUttocLr6xLEoV5zmYGBUiHdSZ/h1NxMAf6iSp1tbCY7rAUuPyy7hO1N2yiDoe2mvE0SN/DGMLNG8YT+9Uo+5KkY4Csi3wBA89PSfwt4EMdhOEYbidCsz5a8slDiCZW6cNyn6wwOeF5Z+yaV2aLvIZcRrQ4aRx5aUU8ZzyPZE0XxmKfXIfpdZVn1M9qtEHx3cyQlN/ZjSKhni/KCJzomaNt/1mDOxMHblL4WH+s2VojemLAyucpMwF6azzLPHBGWPcIZQik/rI6w7UiRJVxPYHGXiTnYAoSIAoQqg+cTJht7UOybFC+x6SF/uQeT0ZO0vMbzQ5DCED+Ppl7qMlGOf/44dmCwC9ky3QogV228S05uyzZOYvEuWo2DOQlLb8tVP0xVrNlsDe2oKbP7Ik62sgxobg5Ila5E0yx9ldbbL7jajORqeLqaj2RBW5gjlUfI= X-MS-Office365-Filtering-Correlation-Id: e7428f55-2e10-409e-ed42-08d44e8d0d02 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:AM3PR07MB276; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB276; 3:nExDhu6IPpIOzlmqeTKRjFIXxWd9ejxHWk4XWJiiqkTPxHwn8ix1oEATEFdqsr/OtZkdSB7iMeCFHfwmSVfDyKDAhKuAk/0mQSDHRWWENZgWgWdouM0VJDdNNqcKa9jQMmU++xA4CNEkPRFFeI5sNsy5CfHY5czHi06SeHa/P6xm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IarGQPUBhco27fYw+7iw0ZPLs2clyTkyG0qUrwN0PNrBaqrnJIg46IXrmjCG7wLD35VMjHLvK6axeatu5mYYLBZNR9ya5wbOqf8bHS8zEH/Nfqtf7oHCCaomF48DDmolVqyl0Np9RMT+1eW6sAEyBNRqdj87uRNgvpcec0OQeN6NonBZAZv313XUsTzCA1ojbyZRTbwKskwU9t18dpfnndN9ednHnvO9YMsqLYuqugeloQcS+Iv45Liflv6bQ6noTT/RHEKawRp6fi1403wToFYN1Y/ms2RvUb+hkDeyulBkMXhD3SbEvdvq7xLrqr7qEvvowwW3zKCsGtP+k21+ai9YUNII4qgDGjItiS7TgmYLxBoAJEa0g6gjbOvi5h/P6X78FiKF4AiHEZsbRp2s6dd61h8CsjuoKb8k2PEP0oU6kvHNvZMA9aOLgo+j0Wmshf+d+xyrtpUgXIwVNAcT9Iq8QcweXemEsxePNRmSlMOwRTK6qT0nld5nIbk36ZY3KTHbbgATDI6OBiLo22KvPG/c/jdn3N3syfHGXSJs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(20170203043)(13018025)(13016025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(20161123558025)(6072148); SRVR:AM3PR07MB276; BCL:0; PCL:0; RULEID:; SRVR:AM3PR07MB276; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB276; 4:CUXzIy1zhjdM5sOWEf1EMjBns2gKOewycgktuK6eZNNBNZ9Pvp4cKopNFtLxpeAz5waSOqznheTf2gAY3rY9tVnCnT29L6sORKZB5Wj/aie+55q0yL+jB9Z7EA8Bav/JkFwknLH4WsNjlUB+tDXMt+oMkuYd8tsPhS9/RY8gpu6x1rd3RXWhvPwpB+GjXozxTThwzXN6EJSaPgukMmEA4xPeld0P/wDB6qe7PWpDmPyKT1SMDvRiXCRH79W5kp9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oVNMgt/djhLEsk=; 5:DrjB6SjTCzbknNTUccH3OVU3DEL9IM0rVyO/uBLs9aY/zHhXV8NIgDUgE90E7TCHJ3OVebL+yGpeEtnAiwsqW80s9ZdXcdRmzHfQ7rIU2CT7o+tOta7ESt6TZigIejrDMfyDD90sQYiNNCqkn4Z8sw==; 24:VtGveaJ2b+ciaTZPtW1g/kiTahugsJnpBlW4wFOyMP6CH79cDeYm4Mt7trtE3EzknZESN0JPw+sb7hIxUD3LQ1Yc6r/6xmbr2Zydf8VYMLU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB276; 7:NOK1vaKqppElkMa2Vp19+yiD+eAEoVPBSOSjtEVQRZZXd0QaSLfVKQclKIl9B/dIwZKZm8/Iu+pCV+dSg/ym0z0CRu7rBydaMVexSSVDYg3BlrpIkZiBmNPT8L4varSwRpNWPO7XZSasrLLUzzhTZsdKEyrOYPPG37j9fKWRkrz6Skfv4KPbYHyjIxx/wP4yd1vBxKGB0cBp00UDaily2cLPdXoQbmTlqxZpjUz5qxYEdPC/R1LY2itEzay/7jsVm6ph3zXH/IaBfRefqQqGHD5u1g2rI6WWzUKyHsTLtn/eMk/hWLY6xtdlRizsQUGBIF9e3kKG3awpm1vBqkzsHEHlCjXvzZv9hReQI+Ex6xtOwzbQwJERqSBrXZYBigRMj1kCl8e/7+CLvEY2LprhqqNYArmfE3oV8qkyC7d29+RHJb/9Qk4gUWTcWqwu/1+67gWIMKw7wczYWXr2/yXF6E0kGyrBJNQMPUU4NSWqU696xUq7kIRXmC1nmfJzwETun5VmKToZ8j4mTRI4I+a8/g== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:28.0953 (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: AM3PR07MB276 Subject: [lng-odp] [PATCH 03/10] 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 e6e9d74..9e3b9fe 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 8833822..e56d954 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 Mon Feb 6 12:37:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93421 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1687077qgi; Mon, 6 Feb 2017 04:40:10 -0800 (PST) X-Received: by 10.107.150.10 with SMTP id y10mr6310558iod.221.1486384810077; Mon, 06 Feb 2017 04:40:10 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x69si4484129ite.19.2017.02.06.04.40.09; Mon, 06 Feb 2017 04:40:10 -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 0F25362F66; Mon, 6 Feb 2017 12:40:09 +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 A07B762DBC; Mon, 6 Feb 2017 12:39:03 +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 1845462EA2; Mon, 6 Feb 2017 12:38:32 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0102.outbound.protection.outlook.com [104.47.2.102]) by lists.linaro.org (Postfix) with ESMTPS id 35ACD608D9 for ; Mon, 6 Feb 2017 12:38:26 +0000 (UTC) Received: from VI1PR07CA0059.eurprd07.prod.outlook.com (10.164.94.155) by HE1PR07MB1625.eurprd07.prod.outlook.com (10.166.124.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 6 Feb 2017 12:38:24 +0000 Received: from AM1FFO11FD035.protection.gbl (2a01:111:f400:7e00::114) by VI1PR07CA0059.outlook.office365.com (2a01:111:e400:5967::27) 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; Mon, 6 Feb 2017 12:38:24 +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 AM1FFO11FD035.mail.protection.outlook.com (10.174.64.224) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1347.nsn-intra.net (10.158.36.135) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:21 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:21 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4pN019886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VC019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:37:58 +0200 Message-ID: <1486384684-14761-5-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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)(39860400002)(39450400003)(39840400002)(39850400002)(39410400002)(2980300002)(199003)(189002)(48376002)(77096006)(36756003)(8676002)(50226002)(2906002)(107886002)(33646002)(97736004)(38730400001)(53936002)(50466002)(92566002)(86362001)(81166006)(50986999)(5003940100001)(81156014)(356003)(189998001)(626004)(305945005)(47776003)(68736007)(22756006)(110136003)(6666003)(5660300001)(2950100002)(6916009)(8936002)(2351001)(106466001)(105596002)(450100001)(76176999); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB1625; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD035; 1:VAhiHYPBgrVcYUwLJK+xWxGj/V7Vu+Se5A3Ra/VTPl5wZs3mlM+WjlzQi4/jDLZJ4t6OLD6zgHijH0cEYpQmGHpWe6mweNnPo7ef9rAe2wL95W63+7IWYr6DGg5zSuqCq6AJOJNLHkrzdhiEIzCsTOjziazc+QKHgXZqa9j59c17rxbrqBUFUJ5zTubr/MtJK2jhviaSyywD4FpDGm83jh+BSE20Jlowxyb3wK0tFTTvGoduDcY9NL7QKDtrm4PtvmevHER58u0EtSnCBPrEbAGlw3Pyc+oBESCSLoF8txzKEw5Ru1VqIHMw3/E9jBEz8/oClvjKuvYULSwqAbXAf9aV24IgAWRIYmtoa7rP1NCLqO1sS3E6h+0Soll7ERSbPX4Gxybm00eHGqduWO0aOte3B3TTb1/oRqhza4XMYhU2cpvhUnwagH3Xr55YW3oPTI997Wun6pkC8iXrvODrRbOa/LeAgAjjyJqo2leIZas= X-MS-Office365-Filtering-Correlation-Id: 65e84972-d5f7-4b1b-8c42-08d44e8d0aa1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:HE1PR07MB1625; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1625; 3:IaDoGCwENF04ELcnTtaaDhHWRkLGcfXAxDIM/bZrkgAsAMXXYvtvMHX+JcM8YM/ckMnvruAmDtPo6e5jKqbPqV/CpEL3I5Aml6fU6fgE3jWlRL9TLNfyiTuJtnYE49mp11MXc3bxVRE5NJ0QUvIT26Lpn8m1MZle5EHzABXi6L+Z9wyxNELRCcwFdEZs/I8pBUCil7pO6YRLnPmsyTPwYLu34vm741WeWJ6gPr8POHmt5iiEn+LFUe6BqcbMiUH55iUQIQAqu5VEMbd9DDqKnJ7OrcxQTkFwHqgq5GfIoafbrtS0KrwBPlvsZP6UK2NgawtN3QFZ9W3WYfRAn6spfCFg+LPlkJVcaTzOCwCVw8wFk7wLnAw/8OwP/SI7NMOH; 25:el/WNrZJcdOM+fFPqTf7Mv4bVZstuUPQbZxwRBrQYOt7azT8iiqtLKWCfMGtmE8s/Cs+u/47RLeS99UK+woYD3JMAOWPW/0DpNK79vybHNdQOfsV3Yiy6V5M8duHJEtF+NFdrLQEY+enKkzeRFGc4zi8u4gXV12FPqFCmdvCv4NE6LQjWhQsqyldOz3LY4TF37rKd+ArNLJcdF2pTRpqTISeG8KO0MVYZv9ZCdXWJeObgHJWsVS25ZQ02FmneU6xUcxbbNY9Qz495Aq6rwpvy7s4WcP7TVDXlYFc/XyNLTIleKQu9GipSYCWRrshanSuRQxYoa1T3Uqzxe30HOz259MgjKSfuPKenw408IBDnZcpZMcE5EiSPfg01mRAYQveSnuQhnFaSlkfzzbHplEs9AwJ+a3r+JIdQkWThSG7mKESAcV9Atp6302JvLZVX8Kus967rj5v2MnZCc4b7eQq/Q== X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1625; 31:GbCprIiKQNjlRVd+6elp5FYcXuMpt5Hwz/244GkVv/3nqNsD+hM2HZW025EMK2dJ5wVe/sCYb+9xrMz3M3Xm6NPeuriFrf5nCCD9gYIHSwo868/dbwx/IYXyjFROCpH0HEOtqbVoACXTUebLoknq2Ut2e53SHwveMZ7wBE0i/pZgEKgLevMb9F4pXY7HK0nFLUzTwCnAWPxxrZ07SAmpdeg9jsVVQX6UaN+hmmSxGW+pzLrCbca3GuuQ4jzkXq+p6Z/VXb6D/GrFWraKD8D8mQ==; 20:wUwlOiQTHYaOyTI2qvWQCMMopjz0cfYi2KaizXYi9M5zHMUuWIei3xp3gjJtrqnwDFUdGCkp5yA4+iCzURAublw4yzQY5EcVLkRlu3u8e08ZLtuWrq0AheOEHzhwd/uaj/CjI5IfQ33tCXFzG+UKwB2AmmhNOVn5kt7KYzPDfSfGCybEr7EcYnLEYG04PH+gJzfpY7CZ4pJGJzDBWcL1DuePBlJyctvGaLZSfUoZXPcVKCKZQNODGEdYPZpx0NB4KhgFBtYLggjL//lpiPScdM8RuYB+YTGilBuqFEVjbT1yaoooKBg1B+fIuRh1Gw+ZxSK0G6LAGiyeAxkbDF49XQMDYaBv/ypOMbarjWLBvb9yOCV6bEM7GqcqXAFfwYDwxaDm2vaZo62ql/aIaBmQCTeEXQGH3J8gxMTEOu4pwCM4BD3fG8o8TOaZcvMSPzUS6qKaPbkTR54h56LaHTLatn1xBMJo5vjvjuXgWdPwsPc8A2tYyqypa6IaFv0gQt6RtQCqD11Er/c4nbEafu+vPDpEEL8eeONFrpclatAZoHankD8SCluq/iluwxxazGTXeOD+81e7kVBqMnLIcigMn0h4RQS9EsQI5aESwO9GrDg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13018025)(20170203043)(13016025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(6072148); SRVR:HE1PR07MB1625; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB1625; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1625; 4:xV4+3b9FsrMYc1BhsGHXafjIwvgMQvOI8tekDRC6dgf1lSXmErWV/1ZUvl5F281LyBsgQki2jkDtaVhLztispMbooVjrxPFO05/oUj1fkiVqxK0jI54fODSLxD2vHFFS+wbVqrukQws0EvpSHtAJ0mUHZbn6uuNnmFNUExGsHRUxHbUmu8jQv1DT0wWaBuayrYlfuFQ4ptPAU8Zuj0g7AZa5Bxh2bhACUd1Zz2xfSYEjUMRvD1ZrcdMeV0j7AkAtvHsf9k81Ns9Lf+mY6EfVrZZ2+WP8RHzevHUCUARQI0SND/fN2ZOOVOrZqRV909luSaQmVWxpjj/nWK75zHcfrKpeV3Sqo79RzgxYHdqbHLJqL7fBk4ozmBHdyaTVCgC2df+twP4fi7BGVTXj0oacL9H9WB9/+XnZjlDJimZ8Luj3L++kqmAWAvNcKBXsdZBDgUFGDnChxAJeYqJoChU4lc1X4zYDHw8oPfNY7Ha0uxxhM4Lw54qPMVL85+VYxo2XJCdmnX80dwhBwLfzdNaVWzUOG2j8UMaFx+JCKUmnUME4DcCMa582vSKwyY1kYp21TEB3RpfjToMmfjUVnBwBdbBwVgMz+UpPcTDDsmPdI/0pBo+sFpA7XTb4/Zog2Vsoe49PnOJdsAdT/vR2viMlctRujXQo08pw4NjoLMqQ27V/LuMdvxsAe68fisbelwsq X-Forefront-PRVS: 0210479ED8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR07MB1625; 23:DC7go0hmYsImz3yjXtf9LnxGJubnz5X1F96qUvOav?= TFliOsRVTbxvTSM7zgj2CvOweDfGmOuN0dH+/simTAQi93ymO9e/Y8FwKW6+mxaUCbPb8TtTG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1XgLaAyf38VOiG43vHK96jM7UrCKkwtplwpnXaReLbNvScke9581f4gpFWQY6DW3hVpd1tsoYMQrX1zs8/0apAufIgj5XYMULmeObO1IGL/aMvjuIIIZFevV2liYDkwzmmOwUIn4m90QM5bsxkO1B1jt6h/X7A8Z/9n2U4dF62htwldaVls8UVr+123HPX1SUikx6/roNkvDQ9/OrJuN+WgJ8A== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:24.1173 (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: HE1PR07MB1625 Subject: [lng-odp] [PATCH 04/10] test: l2fwd: add pktio driver print out 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" Print out pktio driver name in start up. Driver name (e.g. dpdk or netmap) helps in checking that correct pktio device started. Signed-off-by: Petri Savolainen --- test/common_plat/performance/odp_l2fwd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.8.1 diff --git a/test/common_plat/performance/odp_l2fwd.c b/test/common_plat/performance/odp_l2fwd.c index 54dc4cf..9864c64 100644 --- a/test/common_plat/performance/odp_l2fwd.c +++ b/test/common_plat/performance/odp_l2fwd.c @@ -603,6 +603,7 @@ static int create_pktio(const char *dev, int idx, int num_rx, int num_tx, odp_pktio_op_mode_t mode_rx; odp_pktio_op_mode_t mode_tx; pktin_mode_t in_mode = gbl_args->appl.in_mode; + odp_pktio_info_t info; odp_pktio_param_init(&pktio_param); @@ -620,8 +621,13 @@ static int create_pktio(const char *dev, int idx, int num_rx, int num_tx, return -1; } - printf("created pktio %" PRIu64 " (%s)\n", - odp_pktio_to_u64(pktio), dev); + if (odp_pktio_info(pktio, &info)) { + LOG_ERR("Error: pktio info failed %s\n", dev); + return -1; + } + + printf("created pktio %" PRIu64 ", dev: %s, drv: %s\n", + odp_pktio_to_u64(pktio), dev, info.drv_name); if (odp_pktio_capability(pktio, &capa)) { LOG_ERR("Error: capability query failed %s\n", dev); From patchwork Mon Feb 6 12:37:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93425 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1688002qgi; Mon, 6 Feb 2017 04:43:13 -0800 (PST) X-Received: by 10.107.40.149 with SMTP id o143mr6345312ioo.30.1486384993509; Mon, 06 Feb 2017 04:43:13 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p139si9064469iop.237.2017.02.06.04.43.13; Mon, 06 Feb 2017 04:43:13 -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 0D1AC62DBB; Mon, 6 Feb 2017 12:43:13 +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 BFB5262ECC; Mon, 6 Feb 2017 12:39:13 +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 8CCA360B51; Mon, 6 Feb 2017 12:38:38 +0000 (UTC) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30100.outbound.protection.outlook.com [40.107.3.100]) by lists.linaro.org (Postfix) with ESMTPS id DA33C62DB7 for ; Mon, 6 Feb 2017 12:38:28 +0000 (UTC) Received: from VI1PR07CA0074.eurprd07.prod.outlook.com (10.164.94.170) by DBXPR07MB288.eurprd07.prod.outlook.com (10.141.10.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 6 Feb 2017 12:38:25 +0000 Received: from AM1FFO11FD035.protection.gbl (2a01:111:f400:7e00::107) by VI1PR07CA0074.outlook.office365.com (2a01:111:e400:5967::42) 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; Mon, 6 Feb 2017 12:38:25 +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 AM1FFO11FD035.mail.protection.outlook.com (10.174.64.224) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1347.nsn-intra.net (10.158.36.135) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:23 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:23 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4W3019889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VD019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:37:59 +0200 Message-ID: <1486384684-14761-6-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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)(39840400002)(39410400002)(39860400002)(2980300002)(189002)(199003)(50466002)(36756003)(97736004)(107886002)(105596002)(8936002)(50226002)(81156014)(81166006)(8676002)(189998001)(5660300001)(5003940100001)(48376002)(22756006)(50986999)(76176999)(626004)(2906002)(38730400001)(68736007)(53936002)(356003)(86362001)(110136003)(2950100002)(92566002)(450100001)(47776003)(77096006)(6666003)(6916009)(33646002)(106466001)(305945005)(2351001); DIR:OUT; SFP:1102; SCL:1; SRVR:DBXPR07MB288; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD035; 1:XCyQtY6aK6VHlcQ1yiyQ0LfcI5MLGuM1a5DWeeV/5U8n4Zo6yNeOIBZ6IYHqvoe+VuTh4TbzeheoPooaUU+uWBVmCmm13P2I+Z8sN4H2WnCosVhIzdVKbBoMQ7+Yl0y5wptCuCCo+GmCVwlv5TqJMCkaXM2JzHvBnUErQaKYM7YlOFzMtg2140bryw21ENfZXm3YYsk0ZfRwDyTy8asFL6jSULbuui/EB0Vr+ck6dCQO4ZZA4pMqDQxGEhN3M04P9dPR0ZnLIGhBdpwZAZPmLl86JE2dh61rs7MSUpo1or7j74Xvp9NKRyvkG5PbZaK9pkOL1c2kYyxxHXFy4qM5QhsGQ1hAao9oV/LwIYAr/uZxg1/psq1kGSoGm5jV0yg2oNkNoICIFb7bfS48c1zJsh/nHTVpAERPQUWEBGi6LXNrM3dZmM2BTOsblr0YI59lACaxxH+fr358bvN6KSyTFjjni7V7vdyFYmG8UOb+vkg= X-MS-Office365-Filtering-Correlation-Id: 3b4e44aa-f3e8-4196-53f6-08d44e8d0b1d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DBXPR07MB288; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB288; 3:U2zIe6/JoNleKGZOWBHVA9IPQ3jNswzs+N8QWkpSwrAMJiFOSnvAm54scsqSWhJP7ICVwrdpGrjLsRYpg/OSvxMD06qHBOi2hhUdX06psZa70nXCJI/MvfonmrGMb7zF/Tthfb7AwjTdVPu0VtJKJ0m0rBaXWb4C8i6038zVW2yJDlfC3zwZ7HsnBDpRkXXdre4E+gmJrb6iFjb4lKuehM91XPBakS4e796k3UDpe04mMaoJ+TNinB2dkz/VLOJgBUq/QwFHFFAOpMiBm5m/elixUJAGLoB74SbXMvOVauxrsbZS6rD0brf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9gp95XngLfGITrnSYrxDTgqC/6r7VrSG/IZFCsEa911+OE9eOTfHHrGHRr9oOs9M89n6pJ5HH9glboVY/zt3tuoQ+0GxiX/Zupafto2OfGlMN8rqHp7vonzWkitto0ediJsnIY1km1Ei323oHbDznOzMCMhMkU5yhUtOqmdP1SOcSxjPjfV7Rgop8m2vWZAkSgS8NEXfhlwwglN44ALQsMrwyvkWP6oIzrKKa+VRUpfOGz+pLdbiIhSjSjc955ZhSspCXT9pkaclM9xHnYXB3btjCkB3Glq+sVMtE8z9OcyQzZBywnieu44WdBfUMY56ihj1IWxlQt2qqvjt99ACnA4NXza49n09FCODRVQK6S9ACnXv7MNDy6S1VuE5CMdVDZceREF8Y642nFAkdnspf1PEs784DS0POjIKk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(13018025)(13016025)(20170203043)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123558025)(20161123555025)(6072148); SRVR:DBXPR07MB288; BCL:0; PCL:0; RULEID:; SRVR:DBXPR07MB288; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB288; 4:re6bVAei0LetcX+G+iDJLevZ3mH7NzayeDE+Z5HbtquwhUnE+OqlO7gobaCAe3FGcZKhz+pyMR5F28Xuv5smE588V1lzOMFccdJ1KrLKG1vwHhd+YM1HZ4t7qUxqdJYmPkyDgByJlp10q4Bg4xD16dB9hiNbjzIf2SbQkdRYI9JQwBODU3T/isRpeuvhC1T6haKZA6wDigggV3j5EuTI4oV9JGrlJ3ut7IFFzv+Nke+bdjQpLC1/88SCWzmlDpWmSTd+6Eg941o82D66VtqmopxyQv2VSYm46s+yAswn5EIAPbsjcs1S93AsudH7dMdsGdRymUPrI04sBe/nBjHd6B+TkX0VfzkPa4hb7A8qHC+uDGMp+E0nP7rKh83kL5I34Nr0OsK26qyXUOD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95nDKOMdCkDFubeJ1p2i24mKm2sJQ5NdyyBl90M7YICBxiRT1U4Fk49qf74IwrlCktCxl69W1YNNXPR8JcWRFg8hHwZH2YSUE2gSnAxr7Ow= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB288; 7:kiW1spv1W/zQrM4ITU9uM+ENUdrW3QrJ0s28+ewxaQOA05Xr55DJGdMYeVfBKEy4RXM/zyHOEdX0k7p+nt2CaDY/0MqgQ0OThEzHu/IEGSuUMXJpYn09DnplB327tXMLuxS6z5tZXLQJVVPuCoypAAEXVaWrrSTQZ8hsyzciiXR+l0iLPxGaNCQvPuiNUmwXvMBpTLKgUJ0JX7I2wOi8UpQDYnAUw8kcPd87ksRWM+kWroD2tsmuoFFwYYA06FsjNFTONGNnV5Pl/uIgg00UHXE4fFCTTj24ralag8tw+mTqWvAkopj1mb7VsixSyRI2WXB/GdXVtEYri1/K9tw5actf/x6eTW1I4IQ7xNz51CtDvnfL/J6OGDgC0MTXNCm98b8Onq8jMveDNvSXnJnlQVsx2OGRRHapP0lotsWxBwb/ic/wv5eGiQeQM58+UeUnZz3i2Y2e+icMPumTtJPM37mmIr4OjOjEXWOKl+Jb1Qd7NOZHmkAu3pDktrZZzPprqY/LUDjdBgvlUybe4+bUbw== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:24.9285 (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: DBXPR07MB288 Subject: [lng-odp] [PATCH 05/10] validation: packet: print reason for suite init failure 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" Knowing the reason for suite init function failure helps in debugging. Signed-off-by: Petri Savolainen --- test/common_plat/validation/api/packet/packet.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) -- 2.8.1 diff --git a/test/common_plat/validation/api/packet/packet.c b/test/common_plat/validation/api/packet/packet.c index fa5206f..e3d28f6 100644 --- a/test/common_plat/validation/api/packet/packet.c +++ b/test/common_plat/validation/api/packet/packet.c @@ -110,8 +110,10 @@ int packet_suite_init(void) uint8_t data = 0; uint32_t i; - if (odp_pool_capability(&capa) < 0) + if (odp_pool_capability(&capa) < 0) { + printf("pool_capability failed\n"); return -1; + } /* Pick a typical packet size and decrement it to the single segment * limit if needed (min_seg_len maybe equal to max_len @@ -136,14 +138,17 @@ int packet_suite_init(void) params.pkt.uarea_size = sizeof(struct udata_struct); packet_pool = odp_pool_create("packet_pool", ¶ms); - if (packet_pool == ODP_POOL_INVALID) + if (packet_pool == ODP_POOL_INVALID) { + printf("pool_create failed: 1\n"); return -1; + } params.pkt.uarea_size = 0; packet_pool_no_uarea = odp_pool_create("packet_pool_no_uarea", ¶ms); if (packet_pool_no_uarea == ODP_POOL_INVALID) { odp_pool_destroy(packet_pool); + printf("pool_create failed: 2\n"); return -1; } @@ -154,6 +159,7 @@ int packet_suite_init(void) if (packet_pool_double_uarea == ODP_POOL_INVALID) { odp_pool_destroy(packet_pool_no_uarea); odp_pool_destroy(packet_pool); + printf("pool_create failed: 3\n"); return -1; } @@ -174,8 +180,10 @@ int packet_suite_init(void) } while (segmented_test_packet == ODP_PACKET_INVALID); if (odp_packet_is_valid(test_packet) == 0 || - odp_packet_is_valid(segmented_test_packet) == 0) + odp_packet_is_valid(segmented_test_packet) == 0) { + printf("packet_is_valid failed\n"); return -1; + } segmentation_supported = odp_packet_is_segmented(segmented_test_packet); @@ -187,16 +195,21 @@ int packet_suite_init(void) udat = odp_packet_user_area(test_packet); udat_size = odp_packet_user_area_size(test_packet); - if (!udat || udat_size != sizeof(struct udata_struct)) + if (!udat || udat_size != sizeof(struct udata_struct)) { + printf("packet_user_area failed: 1\n"); return -1; + } odp_pool_print(packet_pool); memcpy(udat, &test_packet_udata, sizeof(struct udata_struct)); udat = odp_packet_user_area(segmented_test_packet); udat_size = odp_packet_user_area_size(segmented_test_packet); - if (udat == NULL || udat_size != sizeof(struct udata_struct)) + if (udat == NULL || udat_size != sizeof(struct udata_struct)) { + printf("packet_user_area failed: 2\n"); return -1; + } + memcpy(udat, &test_packet_udata, sizeof(struct udata_struct)); return 0; From patchwork Mon Feb 6 12:38:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93424 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1687750qgi; Mon, 6 Feb 2017 04:42:21 -0800 (PST) X-Received: by 10.55.159.206 with SMTP id i197mr8393312qke.175.1486384941403; Mon, 06 Feb 2017 04:42:21 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s43si390752qtc.275.2017.02.06.04.42.21; Mon, 06 Feb 2017 04:42:21 -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 0096062EB8; Mon, 6 Feb 2017 12:42:20 +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 694A762EC5; Mon, 6 Feb 2017 12:39:11 +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 E575160B51; Mon, 6 Feb 2017 12:38:35 +0000 (UTC) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20136.outbound.protection.outlook.com [40.107.2.136]) by lists.linaro.org (Postfix) with ESMTPS id EB5C262DB3 for ; Mon, 6 Feb 2017 12:38:26 +0000 (UTC) Received: from DB5PR07CA0026.eurprd07.prod.outlook.com (10.167.223.36) by DBXPR07MB287.eurprd07.prod.outlook.com (10.141.10.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 6 Feb 2017 12:38:24 +0000 Received: from DB3FFO11FD002.protection.gbl (2a01:111:f400:7e04::149) by DB5PR07CA0026.outlook.office365.com (2603:10a6:0:2d::36) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.38 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.38) by DB3FFO11FD002.mail.protection.outlook.com (10.47.216.91) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1349.nsn-intra.net (10.158.36.137) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:23 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:23 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4f7019892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VE019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:38:00 +0200 Message-ID: <1486384684-14761-7-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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.38; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39410400002)(39850400002)(39840400002)(39860400002)(39450400003)(2980300002)(189002)(199003)(6916009)(2950100002)(33646002)(6666003)(38730400001)(76176999)(86362001)(22756006)(77096006)(8936002)(50226002)(81166006)(68736007)(8676002)(81156014)(50986999)(36756003)(106466001)(2906002)(47776003)(105596002)(2351001)(48376002)(50466002)(626004)(107886002)(450100001)(356003)(5003940100001)(110136003)(5660300001)(305945005)(97736004)(189998001)(53936002)(92566002); DIR:OUT; SFP:1102; SCL:1; SRVR:DBXPR07MB287; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD002; 1:Je9ys+D8fkeE9GvJJP16QUBsuo/UTy7QUqNJ+v+pfnv28r5ULn0/iOL5RXN7BX97xzK1xRZ4wZK9hILc27ZiblG9F57P+i8UeHm7Q75Enni8R8TywlgQQVAQawovFY9SXSfDknB84l3kJCqeA5yYbKzS5rnfy9tKrqLJNabl7CQVQUTPSV/zcQ/LLiY5KXdu6tyiPFpyz02TZczNBEUou8VjdsNxb/OfWBVCIbOQyI2RS3hW/jbBAhpSgXzXDLVC382xXJGDaVb115A1Iwfr1ZWrv7YAZ+6g650e2oXyXfaC+WkYcGnrNn6r618TgzCBmJgEgPqqLyq5t/dCr9VYO4jWRSGRNP9bJpUfV9gbmXLfCDCYaB1i8q3rwdzll1yfyV/6kJwoYyh5vZzEIWRyO7tcPGkAudCfoF/hgC7nJekotlSUz036cmwbJ2B/q/277zKgnHwZU+Xui1qdCh9pqFkYrZDsOtICAugKRZxGehk= X-MS-Office365-Filtering-Correlation-Id: 1ff38f7b-9bf3-4d4f-bf2d-08d44e8d0af0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DBXPR07MB287; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB287; 3:CDSDVjIxgBKDg5459WRzVE3AFnGL7LGJqISb53iGANyYjrczbAYhBHLWSDnXAVbHNEmk2V/BOc5IfvPBJ9Hef7Rzm6ell1j/eD/HeqPwhk+wlwpQd3JQ7WXB0ZJJaEYekXzhypsSDuV/SpnH0Ys3385vd3aJ+jEN2DxYgMtfMRlBdGyK2qL4hdgMq55HEigcogtscC0ABzukYEHxgHtUr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m2/pBcalwiWFz2JUVmoxkDghDM5pNK3YzF4CaXOHjiM1yM9ZO4LzlAYBqTxnrY44Kwmos1ltQk8Se/taadGYdwDWQWnAsT63o6wJep9MJgq7X6jnA1HA0Onll+vN2ORCBYjRo8IGs0efqvC1Mfcw6MGF3seqUSVfsSadsN2ffSKkC2Nx90q/RKO+wprBJ2gC4guTTs4ubfCFwCCFW70yBKzRZhw+nId3n+X+Yz5PVKHlArLklBDw26WQjSayOleHAt1ESmJBkQn6e8OnU/Vc7J+htRJ5lVhmoO3Xu2UCE3P45O3wivIRsfibYA1HV+GWQEIVwmTQSFLwjB2DHhcUJh8RRHQk+tkEf76RvBgPNrEYT3G293lwRGuKr1J41WSLx+Po6HfLTocvOrkwc/FmlDM74Tapp3uHtcFsVHt70+0cwKHpVzBHQv0b2Ljbm/m5Ofq5jUx/811KHfzXwgMCC+knoaCUBYjaqYLjpZE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13018025)(8121501046)(20170203043)(5005006)(13016025)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(20161123564025)(6072148); SRVR:DBXPR07MB287; BCL:0; PCL:0; RULEID:; SRVR:DBXPR07MB287; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB287; 4:zNV/mxktjUQqBTnOqZoP3R/S/bupOsIUMokXv55A2JfLEfr2h0SveUUozNFFERPe+TWYkcLsp6tHhw8Pr0L5fU9r/2KKHRhBMuC1Ps4fAxxDfwylGRExxN9/nIrHuyILpbvHMyTv/P7jyvfjteRwmOypN0a1AjHxljvuCVtrIZTQpocRuNXGMjIQyajePOvazK2VpdiyrRvRl0ovtytEqGw/vZ97dB00Q+2KLb44ROv8kYcEmNdtsXB7upL+k2lJNCJRbDDCxKq/+GDCnP+5HFiSwmtaAzUwuHdadoygb9Z3g6yj3Ek1q4Ww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ccv6DQ120WQJuH/NohZwOlLXXg/8BucBhFYeAHQ==; 24:DLYbV7J529K1wC6e+LBwSZGl1AwlI8SrIm2f92819LDBDqNkKrFe92VGU8YN8JpfgA8Rb0LfhErK7qAm7mllFrc9zGMOQwY1YBUKE3Z5afE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB287; 7:B+xicwmddAuG1CEZUXUyykVKcFeyQKejOn+JQm2exeBmKy6qrPsjMOJ8BgQmtWsmFZsTH2J/sPvD0r3DLNS5qyKe5STLOela0ivPlG6nRJt5301V+NID5LOOdYyzq1rModSVV9cCZ6BGzFgTTaL3aGg9Icdgvf8Myo3jl3htHSa+fE/DTC5usAvoXU9AEoPNrkK2tvC2TDCERQChwpi+lqUo8iroOKPZsb7DYZnUqNSS2/SXhMM/xFD8IleA4jlK9SEGLnRAdTJtSXnD8tWASc6ZdlG8i2GVupR07IL3ufdGY7+sxYsG57LG9EB5nVatdNGaR2uyYYpV7kwjLES2V7kQh0rSlJUQhnTgsiUO/SQACJcBbhBr8/3TNoSYAsexzdl1N07bF3S+AQO2tTUud262W6CZzaJUHRPgDh05qu/lkrtgxrzpDvxC57IIIpiPmKTTyJhDR5Ucaewyo5MnkWCvFC/ihbpxEVtikpU31X7M4Pz8KdKgia9mV2gKT3UNuNNJ1y+QKsHOjlPe9Qvhdw== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:24.5895 (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.38]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBXPR07MB287 Subject: [lng-odp] [PATCH 06/10] test: generator: various improvements 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" User may select number of worker threads (-w) or cpumask (-c) (but not both) to limit number of worker thread. Increased pool size since many threads empty the pool easily and result some threads to give up (on the first time those see pool empty). Added EXAMPLE_ERR() before abort() to make debugging easier. Signed-off-by: Petri Savolainen --- example/generator/odp_generator.c | 77 ++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 26 deletions(-) -- 2.8.1 diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 6ac8f2d..8062d87 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -22,10 +22,10 @@ #include -#define MAX_WORKERS 32 /**< max number of works */ -#define SHM_PKT_POOL_SIZE (512*2048) /**< pkt pool size */ -#define SHM_PKT_POOL_BUF_SIZE 1856 /**< pkt pool buf size */ -#define DEFAULT_PKT_INTERVAL 1000 /**< interval btw each pkt */ +#define MAX_WORKERS 32 /* Max number of workers */ +#define POOL_NUM_PKT 2048 /* Number of packets in packet pool */ +#define POOL_PKT_LEN 1856 /* Max packet length */ +#define DEFAULT_PKT_INTERVAL 1000 /* Interval between each packet */ #define APPL_MODE_UDP 0 /**< UDP mode */ #define APPL_MODE_PING 1 /**< ping mode */ @@ -41,7 +41,7 @@ * Parsed command line application arguments */ typedef struct { - int cpu_count; /**< system CPU count */ + int num_workers; /**< Number of worker thread */ const char *mask; /**< CPU mask */ int if_count; /**< Number of interfaces to be used */ char **if_names; /**< Array of pointers to interface names */ @@ -383,14 +383,17 @@ static int gen_send_thread(void *arg) (unsigned int)args->appl.number) break; + pkt = ODP_PACKET_INVALID; + if (args->appl.mode == APPL_MODE_UDP) pkt = pack_udp_pkt(thr_args->pool); else if (args->appl.mode == APPL_MODE_PING) pkt = pack_icmp_pkt(thr_args->pool); - else - pkt = ODP_PACKET_INVALID; - if (!odp_packet_is_valid(pkt)) { + if (pkt == ODP_PACKET_INVALID) { + /* Thread gives up as soon as it sees the pool empty. + * Depending on pool size and transmit latency, it may + * be normal that pool gets empty sometimes. */ EXAMPLE_ERR(" [%2i] alloc_single failed\n", thr); break; } @@ -671,13 +674,17 @@ int main(int argc, char *argv[]) /* Print both system and application information */ print_info(NO_PATH(argv[0]), &args->appl); - /* Default to system CPU count unless user specified */ + /* Default to max number of workers, unless user specified number of + * workers or cpumask */ num_workers = MAX_WORKERS; - if (args->appl.cpu_count) - num_workers = args->appl.cpu_count; - num_workers = odp_cpumask_default_worker(&cpumask, num_workers); - if (args->appl.mask) { + + if (args->appl.num_workers) { + /* -w option: number of workers */ + num_workers = args->appl.num_workers; + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); + } else if (args->appl.mask) { + /* -c option: cpumask */ odp_cpumask_from_str(&cpumask, args->appl.mask); num_workers = odp_cpumask_count(&cpumask); } @@ -700,9 +707,9 @@ int main(int argc, char *argv[]) /* Create packet pool */ odp_pool_param_init(¶ms); - params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE; - params.pkt.len = SHM_PKT_POOL_BUF_SIZE; - params.pkt.num = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE; + params.pkt.seg_len = POOL_PKT_LEN; + params.pkt.len = POOL_PKT_LEN; + params.pkt.num = POOL_NUM_PKT; params.type = ODP_POOL_PACKET; pool = odp_pool_create("packet_pool", ¶ms); @@ -763,18 +770,24 @@ int main(int argc, char *argv[]) odp_cpumask_set(&cpu_mask, cpu_first); tq = odp_queue_create("", NULL); - if (tq == ODP_QUEUE_INVALID) + if (tq == ODP_QUEUE_INVALID) { + EXAMPLE_ERR("queue_create failed\n"); abort(); + } args->thread[1].pktio_dev = args->appl.if_names[0]; args->thread[1].pool = pool; args->thread[1].tp = tp; args->thread[1].tq = tq; args->thread[1].tim = odp_timer_alloc(tp, tq, NULL); - if (args->thread[1].tim == ODP_TIMER_INVALID) + if (args->thread[1].tim == ODP_TIMER_INVALID) { + EXAMPLE_ERR("timer_alloc failed\n"); abort(); + } args->thread[1].tmo_ev = odp_timeout_alloc(tmop); - if (args->thread[1].tmo_ev == ODP_TIMEOUT_INVALID) + if (args->thread[1].tmo_ev == ODP_TIMEOUT_INVALID) { + EXAMPLE_ERR("timeout_alloc failed\n"); abort(); + } args->thread[1].mode = args->appl.mode; memset(&thr_params, 0, sizeof(thr_params)); @@ -786,18 +799,24 @@ int main(int argc, char *argv[]) odph_odpthreads_create(&thread_tbl[1], &cpu_mask, &thr_params); tq = odp_queue_create("", NULL); - if (tq == ODP_QUEUE_INVALID) + if (tq == ODP_QUEUE_INVALID) { + EXAMPLE_ERR("queue_create failed\n"); abort(); + } args->thread[0].pktio_dev = args->appl.if_names[0]; args->thread[0].pool = pool; args->thread[0].tp = tp; args->thread[0].tq = tq; args->thread[0].tim = odp_timer_alloc(tp, tq, NULL); - if (args->thread[0].tim == ODP_TIMER_INVALID) + if (args->thread[0].tim == ODP_TIMER_INVALID) { + EXAMPLE_ERR("timer_alloc failed\n"); abort(); + } args->thread[0].tmo_ev = odp_timeout_alloc(tmop); - if (args->thread[0].tmo_ev == ODP_TIMEOUT_INVALID) + if (args->thread[0].tmo_ev == ODP_TIMEOUT_INVALID) { + EXAMPLE_ERR("timeout_alloc failed\n"); abort(); + } args->thread[0].mode = args->appl.mode; cpu_next = odp_cpumask_next(&cpumask, cpu_first); odp_cpumask_zero(&cpu_mask); @@ -819,17 +838,23 @@ int main(int argc, char *argv[]) args->thread[i].pktio_dev = args->appl.if_names[if_idx]; tq = odp_queue_create("", NULL); - if (tq == ODP_QUEUE_INVALID) + if (tq == ODP_QUEUE_INVALID) { + EXAMPLE_ERR("queue_create failed\n"); abort(); + } args->thread[i].pool = pool; args->thread[i].tp = tp; args->thread[i].tq = tq; args->thread[i].tim = odp_timer_alloc(tp, tq, NULL); - if (args->thread[i].tim == ODP_TIMER_INVALID) + if (args->thread[i].tim == ODP_TIMER_INVALID) { + EXAMPLE_ERR("timer_alloc failed\n"); abort(); + } args->thread[i].tmo_ev = odp_timeout_alloc(tmop); - if (args->thread[i].tmo_ev == ODP_TIMEOUT_INVALID) + if (args->thread[i].tmo_ev == ODP_TIMEOUT_INVALID) { + EXAMPLE_ERR("timeout_alloc failed\n"); abort(); + } args->thread[i].mode = args->appl.mode; if (args->appl.mode == APPL_MODE_UDP) { @@ -955,7 +980,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) switch (opt) { case 'w': - appl_args->cpu_count = atoi(optarg); + appl_args->num_workers = atoi(optarg); break; case 'c': appl_args->mask = optarg; From patchwork Mon Feb 6 12:38:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93419 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1686694qgi; Mon, 6 Feb 2017 04:38:53 -0800 (PST) X-Received: by 10.200.35.124 with SMTP id b57mr9605260qtb.147.1486384733899; Mon, 06 Feb 2017 04:38:53 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i30si396375qtc.126.2017.02.06.04.38.53; Mon, 06 Feb 2017 04:38:53 -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 84F2962DB8; Mon, 6 Feb 2017 12:38:53 +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 9867060B51; Mon, 6 Feb 2017 12:38:43 +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 DD6BD62DB0; Mon, 6 Feb 2017 12:38:25 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0138.outbound.protection.outlook.com [104.47.1.138]) by lists.linaro.org (Postfix) with ESMTPS id 885F5608D9 for ; Mon, 6 Feb 2017 12:38:23 +0000 (UTC) Received: from AM4PR0701CA0035.eurprd07.prod.outlook.com (10.165.102.45) by DBXPR07MB287.eurprd07.prod.outlook.com (10.141.10.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 6 Feb 2017 12:38:22 +0000 Received: from DB3FFO11FD020.protection.gbl (2a01:111:f400:7e04::118) by AM4PR0701CA0035.outlook.office365.com (2603:10a6:200:42::45) 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; Mon, 6 Feb 2017 12:38:21 +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 DB3FFO11FD020.mail.protection.outlook.com (10.47.217.51) 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; Mon, 6 Feb 2017 12:38:21 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:21 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:21 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4Ow019895 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VF019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:38:01 +0200 Message-ID: <1486384684-14761-8-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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)(979002)(6009001)(7916002)(39410400002)(39850400002)(39840400002)(39860400002)(39450400003)(2980300002)(189002)(199003)(6916009)(2950100002)(33646002)(6666003)(38730400001)(76176999)(86362001)(6306002)(22756006)(77096006)(8936002)(50226002)(81166006)(68736007)(8676002)(81156014)(50986999)(36756003)(106466001)(2906002)(47776003)(105596002)(2351001)(48376002)(50466002)(626004)(107886002)(450100001)(356003)(5003940100001)(110136003)(5660300001)(305945005)(97736004)(189998001)(53936002)(92566002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DBXPR07MB287; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD020; 1:tBeOCcmNWJ7hG6GeCK3sdkWFdnuUaQmi4qYotgpkpw/e1Z10lzA34FpPI2CH771VfSNL8LGtBK+/h5OyGUOnn3coXpvxdhdqWFAb8dquRyJ4ETOgmKRR9oa/Kh7uL3ecNSU6gT4Up4CyP03WAOQhAwSCAVG+CkriEL953w/7V2GalS1Kjas4uax+SLYYIeF0lFYT8neRr1Ks6wgwtDmHu/PlQEmk78A9cz1/NDzQtUwgXk2Pbw3U+i1wSamgzU0kvKL0o6+Xekg8w/+EnO6uc0Pju91dkM9OuTcb63bIb5znoiHQ0FiQ3TyeWZuoW5LSDTGOv1Oz72KrvrNc2amjRB1IOT5Y7YvLWOTTkRJsiYqe34/kEmbbgug07VkHJaXUiB0YX6rWfCE0S/9KJTloBjquvOdTgQSRiLys0HFGtGKGJsDqQZQtnWU0WOn1+9yjeJT+Qq8Sc+rd5Ja+PQgpkt1IR+Gkg/Dj+x+yX6muDf0= X-MS-Office365-Filtering-Correlation-Id: 6c795f04-be8e-415d-e1be-08d44e8d092e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DBXPR07MB287; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB287; 3:GV7i6HAT7QZCxUcq8pwDk1YZjjaScsRiGJehomqcpN4unyvtDQ3HYPOfwwVu/VbgeexjJ9wMdxbfaaKZjcYa0ZsW9NIda66cSvW0QxEG0B5HX4M6jIihWPc6Nu/F4mKZljVhBkfgLBQwVoaTjLVt5/mfBFDDggoDb/Q1aKDDeJAQbxloZH90onqVa3s+YdWo1oaT2iU7JEA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YVnaZ/euOj8WtWc6/dhLdl4C1f7ywWS+c7it3lBtV2D498HARTZjC7VTBbT7CP+bBTeA6kkbxN+b7Ac5CaWuNplWo5wIxkLX56oUgrBJOjzidpV6PlFaSplPk5z36ZVbBrkJL0bKzj6mVt0An8D9a1rdERhvmwbvSHnHFOo+yk3BYn5b6Dv87FX2WEDB5APaxpVsp0OaiC4Dn0x9Icy4B0YHMxGNT3UHwzvXguwa+T2myeaChxUDP7niCARJY5yskMOjPKQa1eDt09U34Jb3Cak5OFZT0QxIkrpJaVQkhz82l2R96LHprEfTKJ8F3gYSOxinA9Gps+qcFvdgwjJNjptuPaBCuLXgbO1Z9jS64M4WgljYeMfWsdvEBh03HMtqOCySBWK14Cv8N8zf7YFPmjlCd1obTv9K2qL+F+xPApECX73kAYMDjmhUEqACSLfUiVpzuHogbvSHT/XCZVlnowtTp0h/PJ34LEcjVaXIKkjNHA8bvk5StEgsM4Ycd2Id/Gy+8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13018025)(8121501046)(20170203043)(5005006)(13016025)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(20161123564025)(6072148); SRVR:DBXPR07MB287; BCL:0; PCL:0; RULEID:; SRVR:DBXPR07MB287; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB287; 4:ZAre+fq+i/K3evpn23yDgt7JaSBo9/OdvttO9BmiOHvq2jVLoHnD2um6otgJ1i50Lw7LBrC1XSzy4b25eKYAbaHha4wmhw9lHKpHhJZamweoLRCT0PsYkCTPczhSua0iun9JaKrWNce8zPNNGGv8FNdm21xGzi6jlyzIkvJj687jNqrbE4NNq+CiCSXzp7l0YTQ8ivTHwEN1GAVoIQDwvIILFLqqve15rjbFUDsyzESzdFeaOo/du8+iyFPRvdg+YQHbzi1qVcidtaRR6l06pyKB5bi0KwG8d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OHgQDXsaiQZwpGb91nstwHCffMoEpskGqbAuOPfsyoxfEGFURP6S4C5I=; 5:VFlWDHRfwS4h5Kyj4SF/vvul7Xh6kwJFLauwOTgD0W4heyhr20xCLwl8wDs6VZvq9wiUCt5G15snYuth/uNAP1c4f9ATOTJnifnx2c+grTk5Xmv1UD7KZXZ5QGFfm1Zx8WETat3/sBdKrW/KRsCJyQ==; 24:7BaUzU9BWpD0i4gasZZ1g+dEdhifdUFFGo+zlYCHaNArFRhXDxA511T7xufKTTJbgahkPVfrby77yYXWGYvn/UR9qt/1ULPbo6pWbE21+Gs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB287; 7:snvxYLlkP5AWbcY7EE5T+Ifd340gLNHsDtVexXNpXk2+boFS1Q/QZBjf1vS3s0WbGsB812zVH0RC8/oQdsgjeMDfas5VkmMnNgZbulo2rH0kdLct1MGN8aKb1qCHTiTovM7oQpt8PT0fgDAwB/TurFW1Zj0C/lrPweBw+Mw6vO/CahtoYHsNEXN6Q2wcAZ6GocPBSsb014oCLHoyG5J34RNjyfD8UK7eZ2YuytMj0bU7ktaRtHEpVqifSmi8lqrBolv8/pL5cUGZ3y7R5uNphE7j/ITLTvbCGMlUJocb/yvmNBYl7ey/BWG5uN4ydPtXScnPGlsPnMV31bkef4OVKp+ZfxDmy7z0kjedcfktoUj2pCNN220e5WfnY1RERvcBS+ZE48HZNwrc4l2EAy27+vQDTvOsmTN/4oCSNa3dc6wMrgDagJdyyEB2FF5bFVLz/GSXmucLpTCd3s4+ZG4tuKE9ATS0ARmzE1ISbrPVZtp9gworfuPvfp3G3Ce/oOCN3KnFqIwyEWQhLhUS4rIXFg== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:21.6413 (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: DBXPR07MB287 Subject: [lng-odp] [PATCH 07/10] test: l2fwd script: limit number of generator cpus 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" During 'make check' run generator on up to four cpus. Generator on all cpus was an overkill compared to l2fwd on two cpus. Generator and l2fwd still share cpus (on odp-linux) as cpumask_default_worker() returns the same cpumask for both. Signed-off-by: Petri Savolainen --- test/common_plat/performance/odp_l2fwd_run.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.8.1 diff --git a/test/common_plat/performance/odp_l2fwd_run.sh b/test/common_plat/performance/odp_l2fwd_run.sh index 757cf53..dd42ede 100755 --- a/test/common_plat/performance/odp_l2fwd_run.sh +++ b/test/common_plat/performance/odp_l2fwd_run.sh @@ -66,12 +66,14 @@ run_l2fwd() exit 1 fi - #@todo: limit odp_generator to cores - #https://bugs.linaro.org/show_bug.cgi?id=1398 + # Max 4 workers + # @todo: ensure that generator and l2fwd workers are not allocated to + # the same CPUs (odp_generator${EXEEXT} --interval $FLOOD_MODE -I $IF0 \ --srcip 192.168.0.1 --dstip 192.168.0.2 \ - -m u 2>&1 > /dev/null) \ + -m u -w 4 2>&1 > /dev/null) \ 2>&1 > /dev/null & + GEN_PID=$! # this just turns off output buffering so that you still get periodic @@ -82,6 +84,8 @@ run_l2fwd() STDBUF= fi LOG=odp_l2fwd_tmp.log + + # Max 2 workers $STDBUF odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2 | tee $LOG ret=$? From patchwork Mon Feb 6 12:38:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93420 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1686936qgi; Mon, 6 Feb 2017 04:39:41 -0800 (PST) X-Received: by 10.55.185.131 with SMTP id j125mr9125886qkf.115.1486384781479; Mon, 06 Feb 2017 04:39:41 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o189si406287qke.6.2017.02.06.04.39.41; Mon, 06 Feb 2017 04:39:41 -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 20B9062DB4; Mon, 6 Feb 2017 12:39:41 +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 2024262DB7; Mon, 6 Feb 2017 12:39:03 +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 F286562DB8; Mon, 6 Feb 2017 12:38:27 +0000 (UTC) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00099.outbound.protection.outlook.com [40.107.0.99]) by lists.linaro.org (Postfix) with ESMTPS id 3C20360B51 for ; Mon, 6 Feb 2017 12:38:26 +0000 (UTC) Received: from DB5PR07CA0033.eurprd07.prod.outlook.com (10.167.223.43) by DBXPR07MB288.eurprd07.prod.outlook.com (10.141.10.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.888.5; Mon, 6 Feb 2017 12:38:24 +0000 Received: from DB3FFO11FD002.protection.gbl (2a01:111:f400:7e04::102) by DB5PR07CA0033.outlook.office365.com (2603:10a6:0:2d::43) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.38 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.38) by DB3FFO11FD002.mail.protection.outlook.com (10.47.216.91) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1349.nsn-intra.net (10.158.36.137) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:20 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:20 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4ZB019898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VG019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:38:02 +0200 Message-ID: <1486384684-14761-9-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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.38; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39850400002)(39450400003)(39840400002)(39410400002)(39860400002)(2980300002)(189002)(199003)(50466002)(36756003)(97736004)(107886002)(105596002)(8936002)(50226002)(81156014)(81166006)(8676002)(189998001)(5660300001)(5003940100001)(48376002)(22756006)(50986999)(76176999)(626004)(2906002)(38730400001)(68736007)(53936002)(356003)(86362001)(110136003)(2950100002)(92566002)(450100001)(47776003)(77096006)(6916009)(33646002)(106466001)(305945005)(2351001); DIR:OUT; SFP:1102; SCL:1; SRVR:DBXPR07MB288; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD002; 1:rpkWcvqkKWA0FqhcwBjua9oClCOVjTZLk3ypEDmfPWiQYzBujvx/3jSl3T96KlE5TJmSF40pt/GSmCqjAI9ROk6Ge4NuLyxZXg30W7PZdvx12DVNGdZb9Uxo1hD5quR2RreZUil3YVvYjT0xGllObrlYFHNCKpzDMOKmNVF2v25paHoAjtKYI1bVy2HW4bH3VbdVn8jM9aCJWQ7Lte+vmzVYjrreqbyO8AL5ungzC2v75+rOzbh6UWcFI2hYL5RSiZceWH43heaIXoXb8EDO7WXk9Vo4EWPKgmIxX4iib+69nFEavq+dOF/DZevAgXTdPrjE+lgJ9AEamj2s+pRvtmE1hAuZDxt/svZm0P0Yy5+gDVd4sl3VuB7HLJeSv4eamqKWdF3jAS27X5HjR99dDcAoiEvW22TOSvKL88MrrPeiNgG+JMNw4sYlyUVcmBaYrnqrfptgQpeik49cV4iOXpV9DcvtAGpjeTFrlc2B3f8= X-MS-Office365-Filtering-Correlation-Id: 9b16c9de-b3e4-4422-db53-08d44e8d0ab2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DBXPR07MB288; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB288; 3:oT8kIJx8+JIusZWra5v9k0j1454st60mRPV23ZjGbg4OR7hnfKnwdM+KaAXX/jssWIwPnBx/8B1DhXlf2Nl8U73A/xiYA16IwNc3aVTEYmIg0wx4F7UnuyWEuGdrUWfO9IW9ZMnZnCjGvFij5vTy5Ie+TBioOgLGIoWJRQFIPxu7+8Ks554mCy8HyaZki7zbaijoCMuLc2XOpiMYP2yAF7+Si8YDx/LLBnklI74o6r3B0bpq1X3IfTVMVbglED/KOOvaPuRGSP66WUM4GFIHRNSemFdpNHoKmJk+o+/stD252kwwUN5zJJ5J1oohvTfJqKjFoH1nEMibv+jPp+Xl36c2WNH2b4i/++FqYYoF6DJddK8fOJwDZlyJAeAM8Jm3; 25:VJft5jy5PIs8hDjkGr6Dg1rnubuq1J7A67U8DGCO1K1N/4vPlq/GYkcteAZaBmdGYaFXiLsxak8X6h1EaObltWxLvpMdEWBiN7HI1UGeoWXM9ah2qjsNNbVetfO2Q2Ip1qS3EgMrnWxNZDQDh350Y+bTuxsD25UFpWyonwNfxQvko3Ow+qf8Q7ACiMXq8bo1/CSuRTSfagD5XV1xXEqCShs3dxyQBieHvh8L97BAU6qGiqID6xT/EEa19p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c3CGjdft8wfUpSxvuP2Iy6OeDqTPztZnV0iQkokNBdPrPJI/r9g1pc87YJFY//yBRJqzLSksSYmcgBb5yk/G6rALYtkW2U3Qd2+7kq+uzoKNjNg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(13018025)(13016025)(20170203043)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123558025)(20161123555025)(6072148); SRVR:DBXPR07MB288; BCL:0; PCL:0; RULEID:; SRVR:DBXPR07MB288; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB288; 4:JjjhgMfoVcanLHSnA7SZZq4ZAlC6MLiPME4xL8Qgv+uNWAHUjF6AIZtKfl26horsj5e0n/FVyhFOVM0cRTsi+SuJbCAZR8AUATlgV0KVs2qg3M+CGV+hA3tIO2MpOW2w6j53avzyWwt3SXWQFNFJ0TK5AKMV8wU7ptTHsbKABLbIrt5DGrICRqfi3AtK3/aLqsrYm/UPYfOcgnyrs+VCmEfSmpOro+SYU54f4ADGY7SdRE4AVG906V30KF4VavAjGrPpx4izR3Ao07Bxruwaow+8MfCnKrFAdEZqN/ORLdvds6Qx6Ok4JbnMM3bwzS7S3Cg7UwNcC5i3t1x4HEG4h08Dxb+K2lUcphjJQqx2vkgPBPAh71uyj45mbQ3p7tCyXeNtYk8armQm5gEwYAJwhGp/nWld6wyC+DW5thG89SzUG2KzN8SEyG9bzLQziztXqjwTLiN/qBiHy1ngPQMLjaADxy6Ft2uWFfpQo76pXCb+UG1x4msVXLgeFqC0KONOKq5l4QaiII39kFRf+BGpA6peNfOJfdytU7v9ZYNOd/vLYq6uolOgI7x7wdfZdGOd2jfw2iu9wlcp6788TG/trc90QTGhHm5iw+0Un5EUrvsDX+0ogFwzSXD8JRUqWVuwpJhTBtmPdkG4EMp9MOQzte5+mivA+hi8fPhR6K9eFnfH9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WbRN9vo0t6GYAz5fqXKP1sN7LiJpUHVGWYTV2+rOt/vAuLwW3mjRqX0+YveUpbECvk6Yi7/fbazeSwZj3Is3TOxEUWcbxIeCkf3FXSlLvVwvX0w2i7b4ZjZCE7yRortIXloI0z7eEJbkT7QRCK8ExRQ98+ADvJttWe/qFCjwxmCTC5bD0J4hz2TiLOKTbq2zZDaOaWVVPE90VeKeJVp3HxxFl1zKOl7DiQ1j6U8gpjOEwELVhlY58/GSQRQu0Diyrm/pmTMhUDIwyaKdppY/d8CNSfEPe5d1Tp0/8luoDG1zIhJUBbPFv96SCnaH3rb9gsXINRroyT8Y95ywY+nW7uzdtyZMLV1Bcp38SZZtBRLIo9ZDgaK4uCbjrSnKc+nrF8CDUDZhwE7I+Y0VOkpJ6UDRzEuuNN7O5g== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:24.1839 (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.38]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBXPR07MB288 Subject: [lng-odp] [PATCH 08/10] test: l2fwd: use packet_data 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" Since l2fwd can assume that all packets are Ethernet. Also odp_packet_data() points to the first byte of the frame directly after packet input. Signed-off-by: Petri Savolainen --- test/common_plat/performance/odp_l2fwd.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) -- 2.8.1 diff --git a/test/common_plat/performance/odp_l2fwd.c b/test/common_plat/performance/odp_l2fwd.c index 9864c64..8f5c5e1 100644 --- a/test/common_plat/performance/odp_l2fwd.c +++ b/test/common_plat/performance/odp_l2fwd.c @@ -241,15 +241,13 @@ static inline void fill_eth_addrs(odp_packet_t pkt_tbl[], odp_packet_prefetch(pkt, 0, ODPH_ETHHDR_LEN); - if (odp_packet_has_eth(pkt)) { - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); + eth = odp_packet_data(pkt); - if (gbl_args->appl.src_change) - eth->src = gbl_args->port_eth_addr[dst_port]; + if (gbl_args->appl.src_change) + eth->src = gbl_args->port_eth_addr[dst_port]; - if (gbl_args->appl.dst_change) - eth->dst = gbl_args->dst_eth_addr[dst_port]; - } + if (gbl_args->appl.dst_change) + eth->dst = gbl_args->dst_eth_addr[dst_port]; } } From patchwork Mon Feb 6 12:38:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93427 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1688902qgi; Mon, 6 Feb 2017 04:45:56 -0800 (PST) X-Received: by 10.107.136.195 with SMTP id s64mr6036107ioi.51.1486385156494; Mon, 06 Feb 2017 04:45:56 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 98si9068623iol.61.2017.02.06.04.45.56; Mon, 06 Feb 2017 04:45:56 -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 E33EB6087D; Mon, 6 Feb 2017 12:45:55 +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 4EDD662F4A; Mon, 6 Feb 2017 12:39:28 +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 7C94362DBC; Mon, 6 Feb 2017 12:38:47 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0129.outbound.protection.outlook.com [104.47.2.129]) by lists.linaro.org (Postfix) with ESMTPS id 371A762DB8 for ; Mon, 6 Feb 2017 12:38:29 +0000 (UTC) Received: from AM4PR0701CA0027.eurprd07.prod.outlook.com (10.165.102.37) by HE1PR07MB1627.eurprd07.prod.outlook.com (10.166.124.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 6 Feb 2017 12:38:25 +0000 Received: from DB3FFO11FD020.protection.gbl (2a01:111:f400:7e04::180) by AM4PR0701CA0027.outlook.office365.com (2603:10a6:200:42::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; Mon, 6 Feb 2017 12:38:25 +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 DB3FFO11FD020.mail.protection.outlook.com (10.47.217.51) 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; Mon, 6 Feb 2017 12:38:25 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:24 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:24 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4f3019901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VH019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:38:03 +0200 Message-ID: <1486384684-14761-10-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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)(39450400003)(39410400002)(39850400002)(39860400002)(2980300002)(199003)(189002)(22756006)(626004)(356003)(2351001)(47776003)(2906002)(5660300001)(92566002)(305945005)(107886002)(68736007)(189998001)(50986999)(76176999)(5003940100001)(575784001)(86362001)(450100001)(106466001)(33646002)(53936002)(97736004)(105596002)(81156014)(8676002)(81166006)(48376002)(50466002)(8936002)(50226002)(38730400001)(77096006)(6916009)(2950100002)(110136003)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB1627; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD020; 1:xCQnYiQ6ZIwB0u/UOgoj31lzabnyB9rGzoc44Ic1Nj5BQcGaAYeeXuAshWRzCY3fgarapdrvD4YujBuMmhNZc9PU5qrZpQDkLGHAXdIzVBOi2g4ZJPq4uaM2N87xtnT6jtwRxvx/1KA+hF3KrXSF9nmiffkGzsmabsAY0625h1OfqXCLVqxOmPY5LNuLL5NVEijTlkGESVNsn0+47klZXWHfCXnazE93BGJs7Q7PyPbF4kTn+ODw3hpAdO9N8YomChIX9WHfefeOAGlkEN9XoGdDEbYkm7v9k3I9JC169fn/ZCY6YFh0YNkiiLHroilvRfCf7zvMKCClcEpK92lHJN/cKuic0chBf8f1jkkteYbYt7eCsk0jki0da06yIvt+Z1wIIXhdeGrvzWs3YovDTxcXf+IcCAfNJLXc/LYQ5jDls+qi0FlTOa/vZzkKJNGLAu5bGtbCeIQXQe/XW7bA80dJ88EvckW9XPW8GzlngGk= X-MS-Office365-Filtering-Correlation-Id: 047a2bd7-21ed-4581-50d1-08d44e8d0b71 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:HE1PR07MB1627; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1627; 3:VcfVBYkcTbjrSKh6cOMWB5NNovc4J04f0Lu3q7g25Hlz8Sr2jNc1AdAQyf6Lrx7pQotgEZZNAZfAWCSZd8O7QaT2nE5d5ie77EsqyGZ2KO6QB39RKcmcDLg6H8vJElvJFOHzSttDJhYFDuAZE5oLBG16KwzBOyEtOoLfGzJbahIWH3kEoZ9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k4GY01pTxI4PSVeeqevg9F3G70k5kHgxtdrKEPv0DJaieqPTMP/o7DrqR4AXkkEForvqapJVofLG/A8bN9ckSjtSp81nO0gZCCum6POtyJdsjTs8VE0gSGenXhh54i34jR3MVMk0tsyI81iXLnpKZzaxOrwfsOxLQqKTm4CYW9qLvIdEMM6YPHi0G4e7G/roaUcuTa3Ed75jEb+TRz857TMq7cp2t7jby70mr3v4i8VtDaP0T3miiUVR8yagtIuET9K/d/YrbVnHrZAmWSwBmXSS1TSy+/4OTAiiB3AlMYdZ4y3BLdJoFKo/jJM7F+qA2DazyEDOi4j+g5gxrFukJpv+GLhZwv6V1BfFeua6NNG17W4bv/5dp1D2PwWnokFjQFMKqETdgCO5js9O/gGdbNKmW5H6ZLnNwkK0AwqLVIvvOWgr7zZ+fey41XvfZdHdsW3GnHfeDF/UKMKFdy1uHLUVyBptmflm9EPwke0X9aqT0oyP4kCWEgO/iuj/WVZ5Kvftpv2Ne0VjqhCo5jPx6P/BHPrPVAT+R9Ws= 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)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(6072148); SRVR:HE1PR07MB1627; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB1627; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1627; 4:2qUwfJUVlSuPszmnzqqCYcapyCHXYu8SwrgzPFXScvq5F4f6ABX4Uh4lbJUhhgL7wIgWxuwzDg6xmBYQSjGvCtlzSGxQIHLBVc7hak9pOsKdymNcOSFl3YlfWB+eA9eYX5ONMyNFqwH6MP1Pndix78pBVAzaMyEMMSnvZXt/i6Pez/qCXz3wz6eiNX9NbYwmtdgNaKVHQjxE/UTY06XQ1zZDujDUquoqPobF2uDYJVIwB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ajFn7QO6vqOLv9ux2y6pDmNkAyVL8RqUQUKTJMTkA42l+jBQ=; 5:1R5neB3ZVs5U1TCK8tYkOauhGvRwMCXNFOQvqNRdw8ee0InWNVWNo1al9fus9SCa6N9nAWUTxYFyTY+Vm0OMiNYi8Mkdp+bOOZMYyXhfsOhwEPo9Ya4NoHxLofrkgApJq/ohomlP4WkUeEQlDs8aoQ==; 24:tpPjZ9PDUPHQayhigdDIuTtxJtjfWD15ICLSPgzYFRxEC5wLEl1SZmfzG+HV7ZERpxZPTHCifYmul3tGHSo5c1IvzlvhKpt3OahedrJK0XM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1627; 7:UHRFkcYUv+XOaBvWDvNAOleFl91kMWt9wcbAJVF6Wv3v6HGXEbroabIoCDKzsb6CGzMtYZKw6dHhYdPJtTAROLty8oy0liqPMKrDuZZ97dpodxtchNKOlsVMwgIsn1/DuLtQ0hjAEbekS04kR9jEOmXo3+0+GohcZvt8BqfPLolf0OK9IJIetf1WBlwLpEZDU/fFlWktBkrx1jHBH2ZDCFv1kCccSTkw5cB+JHVCKGfYw+mG9w14791ggDL2FUColFBF3HSHeyqwanGPycxyUJN2sMeDkm8rDCPlXf3JFQP60WYdcLOBP9bt9zzWWMLCfrDugzhrZxHgRvYFKxaO1sPIq46nbvB4x34jRBJ4AcFQ5Nd5xvGFp9rHB/Cw/FW/dAAD0U3W8cu+G3vSr6j3uPSMrPUDhuck4l9S0Br0lfY+jL/sCxe5LMldNF5Q939HbdtJi6Vl+qLwCsDFNrrPj14ZLmKMG1l/ThPTXwKtUIvuO3l0hYmYEp20C+2GyrY9ye+PE7Fs0RTRqn0hoNWRZQ== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:25.4321 (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: HE1PR07MB1627 Subject: [lng-odp] [PATCH 09/10] 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 e56d954..b316ade 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 0eb025a..3fe41a5 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 Mon Feb 6 12:38:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 93426 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1688229qgi; Mon, 6 Feb 2017 04:43:57 -0800 (PST) X-Received: by 10.107.134.85 with SMTP id i82mr8069854iod.151.1486385037320; Mon, 06 Feb 2017 04:43:57 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i7si4476341itc.113.2017.02.06.04.43.57; Mon, 06 Feb 2017 04:43:57 -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 CE808608D9; Mon, 6 Feb 2017 12:43:56 +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 1D5A062ED5; Mon, 6 Feb 2017 12:39:18 +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 A005460B51; Mon, 6 Feb 2017 12:38:39 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0121.outbound.protection.outlook.com [104.47.2.121]) by lists.linaro.org (Postfix) with ESMTPS id 134F762DB4 for ; Mon, 6 Feb 2017 12:38:27 +0000 (UTC) Received: from AM4PR0701CA0031.eurprd07.prod.outlook.com (10.165.102.41) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received: from DB3FFO11FD020.protection.gbl (2a01:111:f400:7e04::106) by AM4PR0701CA0031.outlook.office365.com (2603:10a6:200:42::41) 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; Mon, 6 Feb 2017 12:38:24 +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 DB3FFO11FD020.mail.protection.outlook.com (10.47.217.51) 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; Mon, 6 Feb 2017 12:38:24 +0000 Received: from fihe3nok1346.nsn-intra.net (10.158.36.134) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34; Mon, 6 Feb 2017 14:38:23 +0200 Received: from mailrelay.int.nokia.com (10.130.128.30) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Mon, 6 Feb 2017 14:38:23 +0200 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4fo019904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v16Cc4VI019846 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Mon, 6 Feb 2017 14:38:04 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Mon, 6 Feb 2017 14:38:04 +0200 Message-ID: <1486384684-14761-11-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1486384684-14761-1-git-send-email-petri.savolainen@linaro.org> References: <1486384684-14761-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)(39410400002)(39840400002)(39450400003)(39850400002)(39860400002)(2980300002)(51234002)(189002)(199003)(2906002)(2950100002)(6916009)(68736007)(5003940100001)(92566002)(53936002)(106466001)(189998001)(110136003)(2351001)(5660300001)(36756003)(626004)(76176999)(105596002)(50986999)(107886002)(86362001)(305945005)(450100001)(38730400001)(77096006)(50226002)(50466002)(48376002)(47776003)(8676002)(81156014)(81166006)(356003)(22756006)(8936002)(33646002)(97736004); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB1628; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD020; 1:FLUCutDPqdQNQgpS9JG/IwQS1FHbmx46NZPWlercXReMQpuKOvwTImZSGt8kfHFoaOFsdXhFX4Sjk1b1AfonFDAfmvHPKEaDDdraJvtIezqSgoGahIltHYZxAEe806ahLeQEVSndeFdzu5wxixPNjoZCHD6yf7X1hsb2sEzElfaJHI1SZnFr6WB68QYURhyXIaYlDyagQ70L3iE67ot0wcfxscXExq2H93UH2NV4yWjKNWlzUGQA5LSbPndQSFrhvoY6b/nS9AlEshDtfbXImtHSD0qJ71/wxweF41T1rlsflomxpmt5FxF+UpHOujA2oXUHx4LUPxoGftkGje1LGph3w8VosQpSsthIKIq0DwE6XhBCQWtMwpMN8RGbGKedTznL/58rGO0uv9eYs0/ey3zwowjm+VfcDq+Tt8prtH8Xp13McvMQPnn80oHFqGhVwiQac3rcUY/5HICNTGy9V7chrA8Inf7sQiQiIHl39XI= X-MS-Office365-Filtering-Correlation-Id: 48404d2f-9d0c-4d60-891d-08d44e8d0af5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:HE1PR07MB1628; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1628; 3:UNYKXD2OwNmKYcKMvjCGFUvb3WYyX3S6rBE+H9EGfVi/itnXFFkX85jCwBD8P9h95x99/BuWaJJJjkhz9qIEj2JmDMr127/v/isDeJEcCVg8eF6ddBtXwOK+6jTKjXAYcFeH7oiABeCM8FmJxmEHLhqgmz5HMh8BfcuYUT8GZG/DKw0T8WKCHJIvwqHGzrNzJQvYHZz0NK/07r+YrrQTGLIK/Gb3Ghrd7zmpFRqI9gwSjYL+PYUclL5aaw1J13Wf0zJpbLtsn9XqOkeHPYy0mz0eNYWqFb/WzUMyIdcpF7NinPEkVDKm/82wvBJXY5Fz3ziuBmXJHmvZ6g8KdGc5DgjmYnUZBzUR/2ZXH/OPTD0D/pfjzYKqCyOB/jEBFjPb; 25:CLu6Jmv6bPyZ+2jk4sH+9/ZFjORcgHW25zZy77sdcKFmo2CF/ZtGiSagnPN+A/ByVwgCt7CJ1sDQSlORx21692h8u+YR4pzUEjbcEtmBeDYqWEwdLmPSKuTl4JQiYUa0CNM3rHKRYqjroBRjf3faOE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XRjCfB6nXNAjo3juyvs5IFiJVuiQ+olF3xK0tbCSmDws6h8CX+s9kp0HkNA6c+OayC1X9pcJc6d4C3O0SgppiDLm7E3q0wsvyMFSC57PDfuOqgU+dlW/tv/ew2iHfgNzCsvNPIxRnLq8VY37Jzv3CCQTmpfoVff3cH3LhPGq95rkXxisZLNSaA55/IQ= 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)(8121501046)(20170203043)(13018025)(13016025)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558025)(20161123564025)(20161123555025)(6072148); SRVR:HE1PR07MB1628; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB1628; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1628; 4:atnRxbOfb3+nt5H01QO+ngxyh7D0bWbcPnh/e2Qh9CdIMDVRc/+7daQnd+25Rao6FIc51BzZWNFUbZVO2V6r92tCN/FqF7gNeqIFphddDS1i+bTLA73VTyMwZvNuibvT2Btp4P6/MuIgIKtnAAKzUdPpkPEV2yn47mipJLwWEG3AeazNrnuPulz5A+jGvQF/zZAF5Cq8cC84GJr759Z12lCaPEaHDCWtnsa8+a2hLSmWDizbQXFf/jU/wjmGyJj97nzGSIMiYGJyuWDuZ8416RRkTes9zyxtRNAmHjQprw/C4I2XOYJg/Cuj1FlecbKyFGv+XTwu68ojGntXE8XGzkzvX90Xrsn++B2gPFQ1zAM/VTpS69C84oNgzHGVWDo1FTLQB+c0+PloGK9K2GnnUJPTpDl70kKquO78HJy58wux7mhu5q9BTzGP/yZON2K7eq5fAUiZHJs2cSv85nqu3r6pn/Ivb1ViibcjWfgEXqBNfsSdMfilalp7KCTJM5x2b+POWaIBnb/XCsVUEC/e1cXdlroElElQvpoPXw61RqMqrS4U3PrZYrQ73B05fIZVqDPrufeCDhHmDiSQssk617ZdkjKs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amDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1628; 7:suOc7mcLqYpl0hukuMMboQSJNKZ93/sOrzVdYvEXbBzhHzLN3aNP66eNaS2qVqFwX+0PMgtufuu+tNmrNh5+SwDtyrqyfW5knQf3QwCAlegy1CG2pE3b70XT4w2QbO0Po7ifcPh8hb7xiVlUnVOWAC+BlQS+6T6v7HATjbMHo6P6GpcARJm89x1lxOa7gAGQw8uqqPKsyJeOS/w/EqoUQmEkSy/EPXTV9zuWbgJXoWaZDTyhq0UmCddE+H5H6YLrcJP+j2f6OTaOooH022lQ0EtTbSHKzIjcJUMl+nxeTgoTEoKrsHWnDZVJ3yxiaxxl/haCaS99lAMNx5Yll0pxQB0DraPDgTnJ6e7jNmuRO6MQkb2QYuLO82pecZn1rvBQ9IfpU9lXbPaPI1bjTSTSfKmbLLiaoJdWGBV57XaML3CXFIOOnJYeiUcAekWf6C2r9wYscIaD6mjQAyr6nYmam50D+/d5KwZXJ3dSzIAtKQ874Zk4Rz4h2CHwMHnYnM/jKeIbDEGR9My6ETVrYQ8K7A== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 12:38:24.6209 (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 10/10] 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 9e3b9fe..8fa6b57 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 b316ade..3d9f544 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