From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72DC5A0C47; Tue, 12 Oct 2021 08:21:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0771440E50; Tue, 12 Oct 2021 08:21:34 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 2104C41100 for ; Tue, 12 Oct 2021 08:21:31 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="226953491" X-IronPort-AV: E=Sophos;i="5.85,366,1624345200"; d="scan'208";a="226953491" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 23:21:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,366,1624345200"; d="scan'208";a="591613082" Received: from limiao-icelake.sh.intel.com ([10.67.115.199]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2021 23:21:30 -0700 From: Miao Li To: dev@dpdk.org Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com, miao.li@intel.com, Anatoly Burakov Date: Tue, 12 Oct 2021 14:22:49 +0000 Message-Id: <20211012142250.410803-5-miao.li@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211012142250.410803-1-miao.li@intel.com> References: <20210924102309.231304-1-miao.li@intel.com> <20211012142250.410803-1-miao.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 4/5] power: modify return of queue_stopped X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Since some vdevs like virtio and vhost do not support rxq_info_get and queue state inquiry, the error return value -ENOTSUP need to be ignored when queue_stopped cannot get rx queue information and rx queue state. This patch changes the return value of queue_stopped when rte_eth_rx_queue_info_get return ENOTSUP to support vdevs which cannot provide rx queue information and rx queue state enable power management. Signed-off-by: Miao Li Acked-by: Anatoly Burakov --- lib/power/rte_power_pmd_mgmt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c index 0ce40f0875..39a2b4cd23 100644 --- a/lib/power/rte_power_pmd_mgmt.c +++ b/lib/power/rte_power_pmd_mgmt.c @@ -382,8 +382,13 @@ queue_stopped(const uint16_t port_id, const uint16_t queue_id) { struct rte_eth_rxq_info qinfo; - if (rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo) < 0) - return -1; + int ret = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo); + if (ret < 0) { + if (ret == -ENOTSUP) + return 1; + else + return -1; + } return qinfo.queue_state == RTE_ETH_QUEUE_STATE_STOPPED; } -- 2.25.1