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 21A49A0C4B; Fri, 15 Oct 2021 11:08:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6F4A411D6; Fri, 15 Oct 2021 11:08:03 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 552DB411D6 for ; Fri, 15 Oct 2021 11:08:02 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10137"; a="314077414" X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="314077414" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 02:08:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="660460442" Received: from limiao-icelake.sh.intel.com ([10.67.115.199]) by orsmga005.jf.intel.com with ESMTP; 15 Oct 2021 02:08:00 -0700 From: Miao Li To: dev@dpdk.org Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com, miao.li@intel.com, Anatoly Burakov Date: Fri, 15 Oct 2021 17:09:10 +0000 Message-Id: <20211015170911.478394-5-miao.li@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015170911.478394-1-miao.li@intel.com> References: <20211015151223.425847-1-miao.li@intel.com> <20211015170911.478394-1-miao.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 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 Reviewed-by: Chenbo Xia --- 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