From patchwork Wed Oct 18 15:00:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116315 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp2467571edb; Wed, 18 Oct 2017 08:03:15 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QiGqpIMhDmUi4Sb+6Kjvb3Q19fih/2FgephrRLpO+jvJwC10oGFOcLQZt7axj3NS2oaVWh X-Received: by 10.157.10.56 with SMTP id 53mr4535515otg.312.1508338995703; Wed, 18 Oct 2017 08:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508338995; cv=none; d=google.com; s=arc-20160816; b=iUYccZiC1dv+PJBtUmsXlzeCcFGnJC2xae05LzdmYnteEBXrdEyYYJH9krIZusVtbK b2PXt0l4nZFQbj/73xAJP9pZqbTVEAWe5f6UW4HVijvEM2+BUpBRZzPFrnpT725vw/ld VNU3bxxY7fgzeIqxW278leCH5ajE6yoFJozTIKm5BiBXr1+Cyd9Cxqxnih2lQUlj2lgE mWTm0QAilA5aeC1/9wT8TQnjjMhYbL3ABLPtcC9/oxinyNSJVB+joxptcjktkGud9fDY HEaFzHtQhk5r6jInXLngHEdZAjz5pfaPxP5wZAdgd4TFI8KGhcvnoVn5xYJvqxjLDAlT ggog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=r6yy2/4Q0AnmqYNTMREKGx+VQlTFhpvDg4RTYjYOIvI=; b=ks2i0PmvlJc6a6POzTDBgRJQMG2KdZne2UXWwKtClKATfmmaFDpH0zYybY/pUqyTkt MsANKcasC7NlZXAowmGBV8xvD27JaJ1WlrZfJNPKDRtIRGBe2Xuq41bs8HOCXR+ZI9vH FjMG5Yfu8RccE+RFh8YxDh9crWeLPr5AY+Y3nEBZ46wNe2Qkn3yxHiqTrHDima9aFZn9 MON6LfavWArGt182yj2Ts2pxP5Vd6xtlzTdzkx5GP5SY/FYqvCx0VyelbPx6WCzrqpvE IUYp7rwA3vq1smoOJF6iwA3mKUzwIeFF2iRrOmRpAEatomk9zuIOUQi2+AAyhdzWgCO/ SFdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id q75si3801199ota.334.2017.10.18.08.03.15; Wed, 18 Oct 2017 08:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 097F862AE9; Wed, 18 Oct 2017 15:03:15 +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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 2BCCE6204E; Wed, 18 Oct 2017 15:01:39 +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 E857E6102F; Wed, 18 Oct 2017 15:01:22 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id A9E1962913 for ; Wed, 18 Oct 2017 15:00:25 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 99D722D8399F for ; Wed, 18 Oct 2017 18:00:22 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UnPpEZA5yP-0M3iTw69; Wed, 18 Oct 2017 18:00:22 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6SG6N26vxh-0MCSvelc; Wed, 18 Oct 2017 18:00:22 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 18 Oct 2017 18:00:04 +0300 Message-Id: <1508338806-1394-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508338806-1394-1-git-send-email-odpbot@yandex.ru> References: <1508338806-1394-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 239 Subject: [lng-odp] [PATCH v1 1/3] linux-gen: pktio: add missing unlock 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" From: Maxim Uvarov add missing unlock on return. https://bugs.linaro.org/show_bug.cgi?id=3242 Signed-off-by: Maxim Uvarov --- /** Email created from pull request 239 (muvarov:master_bug3242) ** https://github.com/Linaro/odp/pull/239 ** Patch: https://github.com/Linaro/odp/pull/239.patch ** Base sha: ec0c3145fcafa09ae3a79875e7e07dd4794583cc ** Merge commit sha: 13cc3007dc36c8942ffe7dd834f3812b32ae2ae3 **/ platform/linux-generic/odp_packet_io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 5cf94a146..c2e6742b2 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -202,8 +202,10 @@ static odp_pktio_t setup_pktio_entry(const char *name, odp_pool_t pool, /* if successful, alloc_pktio_entry() returns with the entry locked */ pktio_entry = get_pktio_entry(hdl); - if (!pktio_entry) + if (!pktio_entry) { + unlock_entry(pktio_entry); return ODP_PKTIO_INVALID; + } pktio_entry->s.pool = pool; memcpy(&pktio_entry->s.param, param, sizeof(odp_pktio_param_t)); From patchwork Wed Oct 18 15:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116314 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp2466539edb; Wed, 18 Oct 2017 08:02:25 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TWe5q+vPw+O8OvWg3Py3ugY+FdlK10d4t68wM4tbyortAkWogBgqtBE5RpYKqVpI4vf6ke X-Received: by 10.36.31.212 with SMTP id d203mr3071474itd.48.1508338945353; Wed, 18 Oct 2017 08:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508338945; cv=none; d=google.com; s=arc-20160816; b=hoDzhTWOaEe/Z/oLkv3A1+h+k2WR9l+I17LpD1qI6X5s6WfByNubFp30/fEH0B9IH5 rFTwWyeF9l0mOWKlBuJIImJgequkzt3XH+Q84l207tI43Xa9SZ8VmPOxdsM350XkH94R acooY9h58tcucIUQaE+SiH18sAW4DZtNtZHH65Jd7/ixVmParW06K4KdIyu26Ofs8MUl rTPpWpg+tp9dbyW6mdLs1VD7zIdNHooKCWWD6L62FUzeQH+b/lmZUBCsPmkRFIQd1sLP YHWSwDhdXKbEn5man+nU4AkAGJTcJuZiFxAlr6JrlwTGJHRV+3lHvgryPC8mxuv4QaOr hH9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=7EgDFi9p9nFEKqnkRWHITnL+rHFY0yVn+jmicP0jwcc=; b=VXtD/4dQglQ6JZTK6FI52WYhfGruKyynuxMSFRifxm9ztqvZVgsXpPWCmy6qcb4M1D TBDjwk83xs9wymZn9C3RaSNT61PgwxvWyrFwmw+5F6+H2zQCx3I/OSr0ngrZ82CYMmmF hRZg5+aqmWQDZam4JwPGSiMvG+N3EiUR7wsIsKKe7DxleYBVU1JifcFYMuj3Zs/i9Jf3 JA7N9viykzq4xlzmxCrSmleuWO1a70FnigVs7CszgYGjF97CgsLEXHjg6/d4wSaVxszw GM+hK/TBU2OB2Q8DRhNNTeLDi4Cv0Pdsi0kurJb1xruU7pqxz5NgYA6RjlJb1OV9ZCTk KInw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id c200si9315756itb.156.2017.10.18.08.02.24; Wed, 18 Oct 2017 08:02:25 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id CA3DD62AE7; Wed, 18 Oct 2017 15:02:24 +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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 BCBC1628FA; Wed, 18 Oct 2017 15:01:31 +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 F35596102F; Wed, 18 Oct 2017 15:01:20 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id A2FE3628FF for ; Wed, 18 Oct 2017 15:00:24 +0000 (UTC) Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 147721341A49 for ; Wed, 18 Oct 2017 18:00:23 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback17j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id slJ5EcUnte-0Mni7Xb2; Wed, 18 Oct 2017 18:00:23 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6SG6N26vxh-0MCO30Gv; Wed, 18 Oct 2017 18:00:22 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 18 Oct 2017 18:00:05 +0300 Message-Id: <1508338806-1394-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508338806-1394-1-git-send-email-odpbot@yandex.ru> References: <1508338806-1394-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 239 Subject: [lng-odp] [PATCH v1 2/3] linux-gen: pktio test odp_shm_reserve return code 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" From: Maxim Uvarov Better to check odp_shm_reserve() code than address. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 239 (muvarov:master_bug3242) ** https://github.com/Linaro/odp/pull/239 ** Patch: https://github.com/Linaro/odp/pull/239.patch ** Base sha: ec0c3145fcafa09ae3a79875e7e07dd4794583cc ** Merge commit sha: 13cc3007dc36c8942ffe7dd834f3812b32ae2ae3 **/ platform/linux-generic/odp_packet_io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index c2e6742b2..4363711fb 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -59,11 +59,10 @@ int odp_pktio_init_global(void) shm = odp_shm_reserve("odp_pktio_entries", sizeof(pktio_table_t), sizeof(pktio_entry_t), 0); - pktio_tbl = odp_shm_addr(shm); - - if (pktio_tbl == NULL) + if (shm == ODP_SHM_INVALID) return -1; + pktio_tbl = odp_shm_addr(shm); memset(pktio_tbl, 0, sizeof(pktio_table_t)); odp_spinlock_init(&pktio_tbl->lock); From patchwork Wed Oct 18 15:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116316 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp2468601edb; Wed, 18 Oct 2017 08:04:02 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q7q/z+W64LTmiptgK/FLyxaNpyFCK3g2rAszYpWVrXPuNGsK23Hii6ahjjVje3w2Fo4GlV X-Received: by 10.107.102.14 with SMTP id a14mr22891057ioc.60.1508339042681; Wed, 18 Oct 2017 08:04:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508339042; cv=none; d=google.com; s=arc-20160816; b=lwJmPxXCF9lCCEx5SNssPdmq6SDuAXWgv5wpcwmOfw5ICJuVmWJ5AOC0KNLQd6plI7 8wqeJnJd7iUyvV2VxQMaGuVehkzSKhagQahxmg560dxqQeVMLMNrMNKKNpa4afTvoXLb tK41veHeyc8KW2I6T8PMhyl+xmDRAsNdAN23gOrF8+MJKTIc71bel1906l0qwPftQzun 8VRGdzwCuTLnWL2YFHNltw98tF2QnY/k6QkDipir2KUi/F5WV/YSQu5W3X3RwHvv5h9S sTSZ9ypL9osRsHabeg/sIzv0iEV759UPM1p+qTwtj/ZaIeBC66FNjpKr/Sp5TPur9EVP XaWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ve3Ye90EdeD+C05d1wTx2TqyFpDtA2WvdcMyAsJoZWY=; b=acehD58tNCCvd6IoEE6mf97SFsQDPQny4cPHxMB5jSEDaK7eo8MpBm9UbdPM7fd3zY yG+TGO9keQ4OJdKr478c/CLENzMmQPBfvoMqN2YllAENS5wn4CLbXjaKE1JTIvgOJG8o PuDDFkGtvi9q0eDgTwNU7mYlnegPDoyT5rIx0pP0bCq2gXEdnBCf2zGqrCRLXrs/vJz3 cSZ9QF6+Rl2GsMZKYug1N0M5go2C8QAitaxJLRvuoLjv2PAIYd/WFrojg/iSygzdGHpX Q0i8ORFPkxj6wb7nDYZ7Nqf3nd7+GTzz0mh+RM4p7GFevbrgv6Ge8aKbGMbsdMILDAOU orZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id a62si9317282ith.50.2017.10.18.08.04.00; Wed, 18 Oct 2017 08:04:02 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 44DE462D4C; Wed, 18 Oct 2017 15:04:00 +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=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 72187629BA; Wed, 18 Oct 2017 15:01:40 +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 50BFD6102F; Wed, 18 Oct 2017 15:01:23 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id E0EB36291E for ; Wed, 18 Oct 2017 15:00:24 +0000 (UTC) Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 7854B183227 for ; Wed, 18 Oct 2017 18:00:23 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id O7zOQqu8qr-0NSmtpRk; Wed, 18 Oct 2017 18:00:23 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6SG6N26vxh-0NCOhT6v; Wed, 18 Oct 2017 18:00:23 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 18 Oct 2017 18:00:06 +0300 Message-Id: <1508338806-1394-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508338806-1394-1-git-send-email-odpbot@yandex.ru> References: <1508338806-1394-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 239 Subject: [lng-odp] [PATCH v1 3/3] linux-gen: pktio: do not set pktio ops on not allocated state 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" From: Maxim Uvarov Simplify ret code. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 239 (muvarov:master_bug3242) ** https://github.com/Linaro/odp/pull/239 ** Patch: https://github.com/Linaro/odp/pull/239.patch ** Base sha: ec0c3145fcafa09ae3a79875e7e07dd4794583cc ** Merge commit sha: 13cc3007dc36c8942ffe7dd834f3812b32ae2ae3 **/ platform/linux-generic/odp_packet_io.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 4363711fb..f972bb78f 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -215,27 +215,25 @@ static odp_pktio_t setup_pktio_entry(const char *name, odp_pool_t pool, for (pktio_if = 0; pktio_if_ops[pktio_if]; ++pktio_if) { ret = pktio_if_ops[pktio_if]->open(hdl, pktio_entry, name, pool); - - if (!ret) { - pktio_entry->s.ops = pktio_if_ops[pktio_if]; - ODP_DBG("%s uses %s\n", - name, pktio_if_ops[pktio_if]->name); + if (!ret) break; - } } if (ret != 0) { pktio_entry->s.state = PKTIO_STATE_FREE; - hdl = ODP_PKTIO_INVALID; + unlock_entry(pktio_entry); ODP_ERR("Unable to init any I/O type.\n"); - } else { - snprintf(pktio_entry->s.name, - sizeof(pktio_entry->s.name), "%s", name); - pktio_entry->s.state = PKTIO_STATE_OPENED; + return ODP_PKTIO_INVALID; } + snprintf(pktio_entry->s.name, + sizeof(pktio_entry->s.name), "%s", name); + pktio_entry->s.state = PKTIO_STATE_OPENED; + pktio_entry->s.ops = pktio_if_ops[pktio_if]; unlock_entry(pktio_entry); + ODP_DBG("%s uses %s\n", name, pktio_if_ops[pktio_if]->name); + return hdl; }