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);