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+umJqVeRAL9B4sN5TmVd9nOA3YCgi2YvskhopBhUAzkGQOLemX0rtT+n1MNPneq54Z+fwkQGbQfywX2jF99iTjRPTb/Hr7jiCPy8rqhCDY9LpoduJR5CHlf7t3F0bU7w7mK9zRJn2c/UIfwpFLjhRRCqeTJCTI1uOrhVk79PN4DtvhHKwfplM2Xt/foeAbLSwd7aG2wQV09RsVSjLMq5l2zXak1iGtJ3/AeBUVvEmv2K; 25:bf9aHd8XOJOBgh0At3GH+60STrhgA5sDEAqc0rNYRGMmjjRm2ifZcaT22thVe+KEeuzqvxHfTLDVGAbZF4xOvDpFh/GTP06emoNF3HfUilIaNPHxMlO4nk/2XTocR1ogi7DTRZnAtSRKZvM8uVovYQtGskYQ0aeVzoEl9WHnevb8FAS2EKoaoKyBMS/ICd6033EvQWLwsTjJWSDZDJpArbNpxfsEsBBdK3YMlMDJ58b6kJDt4Dj7W9c7WFyShlKmRujhaiezmgx2UJfaUR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ElN+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/DV5cwgpSsoniryhEmV+u/P+84Uw0mUB3CECAt/c6DWxOUngItdbbChCBtuNv25euQLLyTe0AaGtgjmGZ0odoSS+ITyE2gwEBXlJnO83hzASPYI017ALXUXzg1tC0i49UXPL2iczwkbSfOzBqHBF60De1jywIWan+ot5Igmw7NGt9hkkTCGy20BXvwwWBJrKp2R0JNK7658rFcFX6p0oNVicXTJ4wsP55o1SyjLf/ywngqw6OjPpoYMxRGqwbIRJmRVtMtFGimDjqJCW72PK6MzR8blRL87qoxl1b/W3gH308QzQW0nM9tQBLtA4zAee9cSk6eeIjYxn3GoYCDqxXNQ8ln4m8TF6Z3D6CVktZUYp7l6v7jWeuL75uI0nkqwcRjC1qoHYvkbwb5vQwS3IxbSv+tZh5TYo8in7sKyjgZMFZWWGFqoKIyVm2FL6HKNQzavpyE= X-Forefront-PRVS: 02213C82F8 X-Microsoft-Exchange-Diagnostics: =?us-asc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nz2gx3asYsFttTNU6BJ5jpW3PaBhdGVZ8YM2HDpKnbQGWlRKvJIL3/nw6UA3AW4Z2H0CTzhkdKwGDMOzLMat+MpQ48i X-Microsoft-Exchange-Diagnostics: 1; DB4PR07MB0590; 6:nNK7C+FPcUGMOkcuEKWdOg5IKc9VByoH4wHN73ZlGmKqPXGE+eO7DByO+1+MfAKZc0curGNHNz/DFirtVr/R3hS/6u5o0PwWU0IYqfBwGswAXU58ufMXMkxzekHSzr7TNLw3/a03cI1GOwns9qu5lDLgTTyF437z8JXXaDqOoeRxqLx0QaWeJLmpQGtTqbEtp8sahWa803i7YM9ygNtzwK6xXDlD+lVlTNibnq+BF1F9EkmfHanN+TgBJ05FhUgQDBg6QP9cPIX5A+0yQZQpnR2VO6+hmfJjL3kcQu8idYlbWhop+kJud2EOZRB4GV1yp8B+CUyZqxKx4atTwcMhEuYxvP59zXh4Dmjl3uMqq27hv+IR6WmlT8P/cWl6OIkrL/ef/IlK5HJUA6lZlkptFs/ARmLfvqFOjd5T3DhQ7fk=; 5:rVzPv1gezCD7h5I2cirpRXCGdPaOm801Dj63vvIhS/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);