From patchwork Fri Feb 17 14:20:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 94158 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp190276qgi; Fri, 17 Feb 2017 06:22:07 -0800 (PST) X-Received: by 10.200.35.135 with SMTP id q7mr7507204qtq.206.1487341327598; Fri, 17 Feb 2017 06:22:07 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v26si7564100qtf.255.2017.02.17.06.22.07; Fri, 17 Feb 2017 06:22:07 -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 3254262DAA; Fri, 17 Feb 2017 14:22:07 +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 2A14D60D98; Fri, 17 Feb 2017 14:21:36 +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 186AF60A59; Fri, 17 Feb 2017 14:21:33 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0131.outbound.protection.outlook.com [104.47.1.131]) by lists.linaro.org (Postfix) with ESMTPS id 461FD60A47 for ; Fri, 17 Feb 2017 14:21:31 +0000 (UTC) Received: from DB6PR07CA0098.eurprd07.prod.outlook.com (10.175.238.140) by DB3PR07MB0586.eurprd07.prod.outlook.com (10.160.46.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.10; Fri, 17 Feb 2017 14:21:29 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::200) by DB6PR07CA0098.outlook.office365.com (2603:10a6:6:2c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.7 via Frontend Transport; Fri, 17 Feb 2017 14:21:29 +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 AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.904.16 via Frontend Transport; Fri, 17 Feb 2017 14:21:29 +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; Fri, 17 Feb 2017 16:21:27 +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; Fri, 17 Feb 2017 16:21:27 +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 v1HEK8xq000466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Feb 2017 16:20:08 +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 v1HEK8d4000454 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 17 Feb 2017 16:20:08 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 17 Feb 2017 16:20:06 +0200 Message-ID: <1487341207-31908-1-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 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)(39840400002)(39850400002)(39450400003)(39410400002)(39860400002)(2980300002)(199003)(189002)(97736004)(5003940100001)(92566002)(48376002)(2351001)(22756006)(6916009)(110136004)(105596002)(106466001)(50466002)(47776003)(68736007)(50986999)(450100001)(356003)(77096006)(305945005)(81156014)(8676002)(50226002)(81166006)(8936002)(189998001)(86362001)(5660300001)(36756003)(33646002)(2906002)(53936002)(626004)(38730400002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB3PR07MB0586; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM5EUR03FT042; 1:SCfP1buw9L5UM7LJDpKUB5mNthM/CCU0ZOeHDQ4e93/xOqplr9weyit4nwWQfcmkot/8RW/zj0XTBwQpymoI2xb8GjE/Cs+tk39WJhpfp4XieKToPE4YtTFVPGP7sCGOhKSObszeG87pIFNQe/88xpUtGev/B8O2VBkweDIDFfwu4sVzgpRgaXdOGOb0yet5aKx6D5iueNAF735x+gxSScJ0EJqbLCaDsFueX1U8jz+0fwjtJrD1EtbopAQqCBVg4b9CWguOmGYyiTWv5iMPcPI2PkMKerv7RxmcjYcabrZyf2T/64yjFC+EToUp30p/NJKxTKWYmvi94xHVU176vRsjyg52v+eCV5BuTpf1xv+ohFggs/zdyIzGwg56wCaYotqb+RcUUtOAaU9OxJsA0Rw+wmPTBa6gpEB0X8InUm7k01rH1eThgaA5/4Dv/ahMDgWZJN0/Ptou5+J+U+iEhQ== X-MS-Office365-Filtering-Correlation-Id: f40db506-fe38-4ddf-2190-08d4574043b4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB3PR07MB0586; X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB0586; 3:A5946mPHoQkSlj3wx0lTkbfEKUO9gIYANQG7SxypgQ5ix3XvS8QVqx36Q4+jp30HMLFPAS9PU5jTkob5RdU4mT7CW5z8cW95jSIVbepxVe4hGb6g2UhOB1THiIchImidO5k3WP+A9e8ciimOfrDILkt/Qil+2zf8IcrOgT4GfcZqGVRCrrieGyqTNxqz7T2tsg7XlfRZB7pJit8p43n+Oi3sRCEfCHAkcbEPBewuuI7dEkQM6ilI1S8SlCoPnzYdu515jbMj2wm/zLp+UrhrH/2Shjd+34qDraWWLModtYyOxp676KRwxB4Yo27SL7tVAd2ESUgE2tZK3ksYcN2p1eYKLW75FlMYEDmSrPhZGxR4y5hygNUxK93u6a5Z0kDi; 25:+v7KTpZIEhfS8+2RZgaXnHMU0M/j9nKXe3m8+tHqBG8MaEziS57WukwqpYiRWkrJIeb4ZrMmNPHTi0YwEu4g1dik4gNjzokCZdmKhgVa+ponlk1C/9xlQU36XyqVn89ZFnqPEpq33x6TIBiatPAsH2G9q7ZccC5CKWm6uLMTkHPio8y6OqmFBpA1ROMdwwS5Lqe3WzzaQVWZ8QKa97jqY6zk1rVMQdING7A9lh/UFOodoFBniDgMeec8FlQmpsUgtuksA3rNg3cX3tJl2YcZL6d67xRz3UGHCMxU041PkX1Xi2BwfumjkB5pFk/8AlUe0zw1bLObxfhgpJtODbbvSj/E2x4E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am-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(13016025)(13018025)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(20161123558025)(6072148); SRVR:DB3PR07MB0586; BCL:0; PCL:0; RULEID:; SRVR:DB3PR07MB0586; X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB0586; 4:2+oO+z07ScenHHlfjjnRifsA3OwmstJX/liEbzKNDpjSgpnQe2WCHekeR/MqPgtnFtMHE5P9InxqSL5EzcK1ds/W47PyYfX9l0080FEworYY1FDvAziz2vgfpwj/F531NmcNzAtNT3iT2/hTFLtX91aXysTKEFHx54zU5zK2uaUSeyNyf//GUx0A5aCa7dIe0AbJVnXRi7+2Xff4QjzyU4vL9vjruGU7PWlWRhBpZ6D+z2NM029BrdC4pIF95wzGCSPixaB6aeT6Q2OHQ/ccfYEUGDlTCgeBMurypHsikzT6KjMklQxdLMduZQ8xHcis1w5DYDBtEfrx7k4iQ3OMXQJkoNTjQfh5foSfAYfbJFV/tZH6NMIoh62WstnOdyEnIjp16Iq3T1LptGXxmP0PX2gLmqJarj42OXflMr78Uzxrkgdy6dnSKGK3YnGRQoM8oz7ZpjV/KeWEKYQdy1YRhf53Pn/vLs/2oz+VoHIMx5dANqcfVwMXpTObFutJoYfdD7QXl2RvbMh33uxXwVomaMMpjnsm+7pXaNHSu8HqKCAONzgD/nfp3GukUfYXgFenDuzR3/5KYMqi8PVt5SxH+J2JFOmLctsQKZqz4lyuXpQB8Y5DM0JfFFQLLbeqSZMoJJ/o/IR/UIbCGgYNMLAfTZRKaT1tVwpwS824Ch0hGqU= X-Forefront-PRVS: 02213C82F8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR07MB0586; 23:dEjS98vaTfBufMjjnFkt9MQXWGMWa22NSQ48FVEy/?= 72SDm0nXLtsNyLCaK/2+k7GSn6+EJh8avOhIH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LsASGLg== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2017 14:21:29.0547 (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: DB3PR07MB0586 Subject: [lng-odp] [API-NEXT PATCH 1/2] api: pktio: add parser configuration 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" Packet input parsing level configuration is added. An application may express the maximum layer it is interested about. Implementations may optimize packet input performance as parsing can be stopped on the application required level. Implementations are free to parse more layers than application requests. Lazy parsing (e.g. in current odp-linux) does not work in practice. The implementation cannot continue parsing after the application has got access to packet data, since application may overwrite some packet headers. Parse results must reflect the format of the received packet. Signed-off-by: Petri Savolainen --- include/odp/api/spec/packet_io.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) -- 2.8.1 Signed-off-by: Petri Savolainen diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 85cd6d1..cec1f22 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -346,6 +346,39 @@ typedef union odp_pktout_config_opt_t { } odp_pktout_config_opt_t; /** + * Parser layers + */ +typedef enum odp_pktio_parser_layer_t { + /** No layers */ + ODP_PKTIO_PARSER_LAYER_NONE = 0, + + /** Layer L2 protocols (Ethernet, VLAN, ARP, etc) */ + ODP_PKTIO_PARSER_LAYER_L2, + + /** Layer L3 protocols (IPv4, IPv6, ICMP, IPsec, etc) */ + ODP_PKTIO_PARSER_LAYER_L3, + + /** Layer L4 protocols (UDP, TCP, SCTP) */ + ODP_PKTIO_PARSER_LAYER_L4, + + /** All layers */ + ODP_PKTIO_PARSER_LAYER_ALL + +} odp_pktio_parser_layer_t; + +/** + * Parser configuration + */ +typedef struct odp_pktio_parser_config_t { + /** Protocol parsing level in packet input + * + * Parse protocol layers in minimum up to this level during packet + * input. The default value is ODP_PKTIO_PARSER_LAYER_ALL. */ + odp_pktio_parser_layer_t layer; + +} odp_pktio_parser_config_t; + +/** * Packet IO configuration options * * Packet IO interface level configuration options. Use odp_pktio_capability() @@ -363,6 +396,9 @@ typedef struct odp_pktio_config_t { * Default value for all bits is zero. */ odp_pktout_config_opt_t pktout; + /** Packet input parser configuration */ + odp_pktio_parser_config_t parser; + /** Interface loopback mode * * In this mode the packets sent out through the interface is