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+YR4pzUEjbcEtmBeDYqWEwdLmPSKuTl4JQiYUa0CNM3rHKRYqjroBRjf3faOEOVrArFW3A1CxS9RIXRjvSvrgUHAZ9PT9m1YopsVk1j5r3EPtouRGden3sRhkNp0Nayt8O3+SbLWJ0ebeITFNX06gn37PLVlbyREzgDSBeng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PDfuOqgU+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/e1cXdlroElElQvpoPXw61RqMqrS4U3PrZYrQ73B05fIZVqDPrufeCDhHmDiSQssk617ZdkjKsAA7T4dwBM5ffiiBmDvrppSFEWEdcpO68Bdw36Bfw1lF99pjSo6KChSud6AZXFTQ+nNMbkzXzf08oTLaGsKSIucrocWPwn0HnkydOkoNm/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ai+uLUG4o5GcZ8DHTdg/Kz6ybxzxjsMC9Ic8JQ90B9ysFq+OeSsgOw/2YPtZajAxOv0YgIw9iMccfEqi6UW4lrTBFClOyYGl8xZjD0SheKjFbgtDC9kLtbt55Wh/9sCa/9prDx7cGCYf+lZQmdOzSVMEaEzSydIsat2MUo7v3k6arltjPyFEKeyDR9pgcVgnevpGJYhyxGc12UJBdeKQA3Gqi55f5908IoGF65rDg/xwVi X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB1628; 6:KK/5SfnZIUD2b76qvzZJsK9xFa5M8lKvAEDSUGb96ksdV6pvNHO/177SIDVCT8fSRSbhR02EOjjSfLXEzDdnKJRcsKUvlHLXQFPmFHGAGnLmtrK7xSQ1uZCyy6jE4tsShhKrlmsTvbpzhxg6pIy2PpnvR2aZHyyphW1zsJRApXh2hSb+N6eHGK/7mxl9G5RLPSW6Fxcr2U8XkXrVQi6GXGCfctcRhYG4ONFSfl0bAqDLkconsLWy/ippyaKbylOyYAm3xKm2ZFhgM9bxWTezHaOtP0vjrJfIPgR5cwQuJU+A8dp1AUZvtHMsfjeNpuCFDE4LwAEkJsdsedx8wULRNsAKceeT8KKpEahcWGf62BPuA+3M/BJztmj86+zghZ1/k1qsRMaRTQJmNUdq8Hrisx6yLzHaYPiHERn5UBYGZu8=; 5:9DrObMBvFD2jD9LB1gcWkYuemRLN1VHWw955/v11KzF/JrJT8LV+/wY/rHARgpdqAttsSPJf7cu70AlB49ryVnGehsMOJ35FbQnmpkA3M2s+Bdc9vTa9/wrIxXfZvsy31sVv/jxMTYYVJ7t1QK/MBw==; 24:QnrcQnLwt3Ohv8Cmly6zwYQZhA3qJdouAIkxTauwSwL0/fquIIywzEiyjYh0hOfzlI3OrCS7En895QeMN0UTwU42Q2qDd9AL/zHPyDk3+4g= SpamDiagnosticOutput: 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