From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id ABAC64C93 for ; Fri, 17 Aug 2018 00:44:13 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id d4-v6so2657821pfn.0 for ; Thu, 16 Aug 2018 15:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wbGdWXxM5XlfSiU5+Zui7E7Ksv+9eV/tHdLHFlMf680=; b=mkOz+4zHrSdpAy9lzGjiMWxBGAmZ6pqBFslYfTDLD13da45zbKCvBJaU8t1iSpzf3n nHpUutTheHlzZONAYyB4RzemqWVC5rnCJxj84ZcS0AkNxJTfpAvDlvxO2ouYhI376PXV eGGqniy/UHERZrRKb3JZHwlmVaNCu7diI3iS5hI3SSy8bMl5CzYy7ZQzZehIEuoUKBDP QWIRb3eRx854kNL9TO0++UxNW0um6U+6816CKtkPEpQOyt4LnjAtFNMsDYVgWzwOte+S oBgCrd8Lnkq2JixJ2DojrHRnzAA9jiB/BI4SXsx9jE5jBALuNxYlBRsmNbi5Ns6WVNMp jE+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wbGdWXxM5XlfSiU5+Zui7E7Ksv+9eV/tHdLHFlMf680=; b=NJnE+Vvb7GiZsvAkGxcLeuUrIxKaPnYH/ylG1mM5pAEWNrZBQjQX+JVhCpkGPZAL6v hpny+IhMQg2gNo7ewEG3YJIU1oMlo/iBQqp5piXCERIRYz6QXKfP5usXCrbQm3EZZ0oC lej0zKciAe9byY6Qos4vpS65d79ObiN3vP7cmG30FBu7S7Tqkmd+6wz3VrnXsJ7hbNb+ N0WjYPi5NSIK5k4gQ/bcoOe1QD8YBdwO04fxi/a0XdoKFn5Y60oQjrblFkFJYh1GHi0i nWs5/q8/GXO5n6M7ZrqZL6PQelLePHteOZ6ht6Hg9pPEaNnZE9mcGvaVJxfl4AzQee8i C7fA== X-Gm-Message-State: AOUpUlHiyqV4fcUuDHwCmyijIzSFTwXWZy23L1LLGjow0unDoiSzBbZV w6CY8kCh39E4yvL9y038NEXudQ== X-Google-Smtp-Source: AA+uWPxhMq8fLKkZTcfyxBzHNcxcoRo3qPItGaSw9hVknSuZlKxxe+14Z56MBhGcsNrUFBbmZZIG/A== X-Received: by 2002:a62:6cc7:: with SMTP id h190-v6mr34390628pfc.113.1534459452869; Thu, 16 Aug 2018 15:44:12 -0700 (PDT) Received: from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id n9-v6sm426666pfg.21.2018.08.16.15.44.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 15:44:11 -0700 (PDT) From: Stephen Hemminger To: matan@mellanox.com Cc: dev@dpdk.org, Stephen Hemminger Date: Thu, 16 Aug 2018 15:44:08 -0700 Message-Id: <20180816224409.5719-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180816224409.5719-1-stephen@networkplumber.org> References: <20180814001926.19630-1-stephen@networkplumber.org> <20180816224409.5719-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 1/2] ethdev: silence error message on rte_eth_dev_owner_unset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Aug 2018 22:44:14 -0000 The rte_eth_dev_owner_unset function always generates a log message because the unset value for owner id is 0. Fixes: 5b7ba31148a8 ("ethdev: add port ownership") Signed-off-by: Stephen Hemminger --- lib/librte_ethdev/rte_ethdev.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 4c320250589a..f09bf8bc8b01 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -393,11 +393,8 @@ static int rte_eth_is_valid_owner_id(uint64_t owner_id) { if (owner_id == RTE_ETH_DEV_NO_OWNER || - rte_eth_dev_shared_data->next_owner_id <= owner_id) { - RTE_ETHDEV_LOG(ERR, "Invalid owner_id=%016"PRIx64"\n", - owner_id); + rte_eth_dev_shared_data->next_owner_id <= owner_id) return 0; - } return 1; } @@ -444,8 +441,12 @@ _rte_eth_dev_owner_set(const uint16_t port_id, const uint64_t old_owner_id, } if (!rte_eth_is_valid_owner_id(new_owner->id) && - !rte_eth_is_valid_owner_id(old_owner_id)) + !rte_eth_is_valid_owner_id(old_owner_id)) { + RTE_ETHDEV_LOG(ERR, + "Invalid owner old_id=%016"PRIx64" new_id=%016"PRIx64"\n", + old_owner_id, new_owner->id); return -EINVAL; + } port_owner = &rte_eth_devices[port_id].data->owner; if (port_owner->id != old_owner_id) { -- 2.18.0