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 From patchwork Fri Feb 17 14:20:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 94157 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp190086qgi; Fri, 17 Feb 2017 06:21:41 -0800 (PST) X-Received: by 10.55.40.27 with SMTP id o27mr7227161qkh.221.1487341301873; Fri, 17 Feb 2017 06:21:41 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l64si7579424qki.151.2017.02.17.06.21.40; Fri, 17 Feb 2017 06:21: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 2097162DB0; Fri, 17 Feb 2017 14:21:40 +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 9C04C60A47; Fri, 17 Feb 2017 14:21:34 +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 D199660A6F; Fri, 17 Feb 2017 14:21:31 +0000 (UTC) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10123.outbound.protection.outlook.com [40.107.1.123]) by lists.linaro.org (Postfix) with ESMTPS id 6BE4660A46 for ; Fri, 17 Feb 2017 14:21:30 +0000 (UTC) Received: from DB6PR07CA0113.eurprd07.prod.outlook.com (10.175.238.155) by DB4PR07MB0590.eurprd07.prod.outlook.com (10.242.222.139) 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:28 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::209) by DB6PR07CA0113.outlook.office365.com (2603:10a6:6:2c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.10 via Frontend Transport; Fri, 17 Feb 2017 14:21: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 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: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; 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 v1HEK8Ya000475 (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 v1HEK8d5000454 (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:07 +0200 Message-ID: <1487341207-31908-2-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1487341207-31908-1-git-send-email-petri.savolainen@linaro.org> References: <1487341207-31908-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)(39410400002)(39860400002)(39840400002)(39450400003)(39850400002)(2980300002)(199003)(189002)(33646002)(22756006)(86362001)(50986999)(36756003)(97736004)(76176999)(2351001)(50466002)(626004)(189998001)(48376002)(53936002)(105596002)(356003)(106466001)(5003940100001)(450100001)(110136004)(92566002)(38730400002)(2906002)(575784001)(305945005)(50226002)(77096006)(81156014)(68736007)(81166006)(2950100002)(8936002)(6916009)(5660300001)(47776003)(8676002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB4PR07MB0590; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM5EUR03FT042; 1:7qU2p1XX4tzJLelIzabrBgth1CfzjRXRuliOnFL77hN0dlsk+7oPna2dNATK8rKAvE2/CcrhhZGf8ARkpeOZklBpl7Db0heRjrc3nwgSANxfwbwVvqsRB69EbLzvcxGjlJHE13/dvP1SVO+SoQFud0LkWmySri+BnmgzWeydYkGOxg75yDXHFtCYYpZcyOC1BiXyLISj6OlXxHTdj6aUpagm/svmX8s7PXt2PG8V8/kd25fgx1+XZynvZGCTmAWmpnek0NYMjL9ygXjyB3Z+4Uh8Ex32d48EpQMoelsOHA6aM9IpPi0WUPwDYvLqeDncK1k9E40896s3B1EVtYDCvnYEoPQMXrPqRyqD0PSN18iyBrvEYVY7J4VFK5TbIJZitdMEugGT8PbJFHjuAilUCJopMipp0p8/0zh1WYFAddXwvDGTuwCxNwrXHAd7vVq5qud6QaWC+P2762l/OyT+aA== X-MS-Office365-Filtering-Correlation-Id: e3e0d06e-e70a-44a9-d716-08d457404348 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB4PR07MB0590; X-Microsoft-Exchange-Diagnostics: 1; DB4PR07MB0590; 3:f2RmM2ssraAi5kVvqV9F0YDYjZEl5W3CDP3kaPnAmUhIEYIHBPdm/pKCow4BEInxT9JEy2BTJBv13NTzXrDZy3Iht1ps8SQER8lqTOalV8UVnSaVltxtHGPrMnjZHZdcGOuUqeVSOi44pZFmcGiq+umJqVeRAL9B4sN5TmVd9nOA3YCgi2Yvskh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OLyman3/Szpcwa8+25TDsNoyZgnDkotJGhY1X6z6HFQkl7hc0ar60Fuao5oOO4lK+IwQOmi2KRd17SgLsYo3o9nY/ERQqvSgjSfaGkqSE9tOUhNCV+dugHfxMD4Ea1LnjnhWCXposRabdGoajVMOBJG7w0xyNyGoM4rGE4Z9ew2DEotMpvWeTUKQEwcZd2XQmzBJafZQlAGEceQL5gb7BVzJiWBSWovpTXdSvUeIcE9rLB/9owHfqVN9W4jcWOEvulfnYY8fJ6KG6ZOrJjvaf2tpLkpv5NMAoemFrdg9ATEMTts/LQX8rAGZYmYJRBC6oEDQ9ulvyOYUiDkKuEXgjdDd34isIUcdrogZKbadM6IKZZRJUFy+u1VMwDnoY5Q+YVo41Cks9G40kKkdF6Mdui4vw+jokmjuKdCiR8imhHjhmBV9ZmJh/g4+WT/PXz3MdfMUzeB8zr4zAhoNtHwhu7fOe4ElN+UKHVHCFE27fnZd7GwXQHsSCXA5l+feXSfaewh2ldvltVivEMwHsBuAFBXAL2U7zb0pGI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123558025)(20161123564025)(20161123555025)(20161123562025)(6072148); SRVR:DB4PR07MB0590; BCL:0; PCL:0; RULEID:; SRVR:DB4PR07MB0590; X-Microsoft-Exchange-Diagnostics: 1; DB4PR07MB0590; 4:PbmnE8YhJ6vfFM3tawre9peo+x3M1Rp/oZo2Z0361z79Q8doUzhZ/G9sDkb1541/6IcF4xlKRz2wwU3RV340rsQvKgfau5FGDP1jpbrPyn4g4Bs2fnsyR42Q7vYacg1nwLlX0ADfTgW1j7Zx7vkcvtGhT+Pxm4VzwT9X8qWpl2Q1li/7JjNRbvhfGxW/qFhCJhrBNu6iP2Xj7Q9RxIud1hb9nle2r+n38Uijd/DV5cwgpSsoniryhE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vvIhS/L3vNNTQyYKnCmzbmVAL9WTyntX/FYT/rYeqBVK9x+vQnnYkaLlc2HpG3aeRxa6IgHsrOoTTc6AsZzOfdyt2S3mbu7l1IV5xLily/t+9iMHfw==; 24:shnt6d4QjvHjeh2Kf8vTflbhqYSVWwy3Xy99psE/pzI7lapOY/6DDz0igTp44fpHeRiKbcX6JQjoLFiHOsRrV/Iot4qIPrPzSp11mSRSOZE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB4PR07MB0590; 7:H6Cd2YqEx2CABbVrMgXl2lfOIEI1WznZkUq5E2g2uUbtVguBNL4iI1Qr8foscmbLfHvz0fdUOSTfufxBH+s6OoJZ8G15lD7JHR58JazoE9zRofN6++RuitYWOjuEYbvnkwahh66sapN++LbaHZs9cs1FlL2Rrd9mcHfL1LlJYo72UMTAhqlvdawziq7S728/bwE0sfDU2nhhgX0PkLKQCELPHma7YhVKmyJYACg5ltK8Nxk2eX+49TijUS6/7+qD6YEpHlO73MqwT1C/uHqMaEfPRceeWNQrkDNysVsDu1vOG/HhwNYOupNXPejNg48zcudDqXBKR+c0O6U6ENcz+w== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2017 14:21:28.3671 (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: DB4PR07MB0590 Subject: [lng-odp] [API-NEXT PATCH 2/2] linux-gen: pktio: parser default config 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" Fill default parser configuration and capability. All pktios use same parser code, so the capability is the same (all layers). Signed-off-by: Petri Savolainen --- platform/linux-generic/odp_packet_io.c | 13 +++++++++++-- test/common_plat/validation/api/pktio/pktio.c | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) -- 2.8.1 diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 98460a5..5e783d8 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -923,6 +923,8 @@ void odp_pktout_queue_param_init(odp_pktout_queue_param_t *param) void odp_pktio_config_init(odp_pktio_config_t *config) { memset(config, 0, sizeof(odp_pktio_config_t)); + + config->parser.layer = ODP_PKTIO_PARSER_LAYER_ALL; } int odp_pktio_info(odp_pktio_t hdl, odp_pktio_info_t *info) @@ -1098,6 +1100,7 @@ int odp_pktio_term_global(void) int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) { pktio_entry_t *entry; + int ret; entry = get_pktio_entry(pktio); if (entry == NULL) { @@ -1106,9 +1109,15 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) } if (entry->s.ops->capability) - return entry->s.ops->capability(entry, capa); + ret = entry->s.ops->capability(entry, capa); + else + ret = single_capability(capa); - return single_capability(capa); + /* The same parser is used for all pktios */ + if (ret == 0) + capa->config.parser.layer = ODP_PKTIO_PARSER_LAYER_ALL; + + return ret; } unsigned odp_pktio_max_index(void) diff --git a/test/common_plat/validation/api/pktio/pktio.c b/test/common_plat/validation/api/pktio/pktio.c index 4f3c0c0..8d62bb1 100644 --- a/test/common_plat/validation/api/pktio/pktio.c +++ b/test/common_plat/validation/api/pktio/pktio.c @@ -1178,6 +1178,8 @@ void pktio_test_pktio_config(void) odp_pktio_config_init(&config); + CU_ASSERT(config.parser.layer == ODP_PKTIO_PARSER_LAYER_ALL); + CU_ASSERT(odp_pktio_config(pktio, NULL) == 0); CU_ASSERT(odp_pktio_config(pktio, &config) == 0);