From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DEC1A04BC; Fri, 9 Oct 2020 18:11:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3FDA1D5D7; Fri, 9 Oct 2020 18:11:28 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 0F94A1D5C0 for ; Fri, 9 Oct 2020 18:11:25 +0200 (CEST) IronPort-SDR: n0Jo6VjN402IUA0iQ83Te04sIc0+u7zjpAgO5rg3CgYXJkg8PlPBkMCfAQ8xHnOKb43kazZry+ Ec/X/kl9l83w== X-IronPort-AV: E=McAfee;i="6000,8403,9769"; a="164716896" X-IronPort-AV: E=Sophos;i="5.77,355,1596524400"; d="scan'208";a="164716896" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 09:11:24 -0700 IronPort-SDR: uk2T6K9x6qeeZoW3u994AlHcz9hPZ1tmoKSJVXH8C8Z47NcsLcGbUf7Xj8MtsCb24eiIJ1WSly noHMr+8NNMsQ== X-IronPort-AV: E=Sophos;i="5.77,355,1596524400"; d="scan'208";a="462243022" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.3.170]) ([10.213.3.170]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 09:11:22 -0700 To: "Ananyev, Konstantin" , "Ma, Liang J" , "dev@dpdk.org" Cc: "Hunt, David" , "stephen@networkplumber.org" References: <1599214740-3927-1-git-send-email-liang.j.ma@intel.com> <1601647919-25312-1-git-send-email-liang.j.ma@intel.com> <1601647919-25312-3-git-send-email-liang.j.ma@intel.com> From: "Burakov, Anatoly" Message-ID: <0654775a-c21b-5a29-2b40-335a4dc9f560@intel.com> Date: Fri, 9 Oct 2020 17:11:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 03/10] ethdev: add simple power management API 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 08-Oct-20 11:26 PM, Ananyev, Konstantin wrote: >> >> Add a simple API allow ethdev get wake up address from PMD. >> Also include internal structure update. >> >> Signed-off-by: Liang Ma >> Signed-off-by: Anatoly Burakov >> --- >> lib/librte_ethdev/rte_ethdev.c | 19 ++++++++++++++++ >> lib/librte_ethdev/rte_ethdev.h | 24 ++++++++++++++++++++ >> lib/librte_ethdev/rte_ethdev_driver.h | 28 ++++++++++++++++++++++++ >> lib/librte_ethdev/rte_ethdev_version.map | 1 + >> 4 files changed, 72 insertions(+) >> >> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c >> index d7668114ca..88253d95f9 100644 >> --- a/lib/librte_ethdev/rte_ethdev.c >> +++ b/lib/librte_ethdev/rte_ethdev.c >> @@ -4804,6 +4804,25 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, >> dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); >> } >> >> +int >> +rte_eth_get_wake_addr(uint16_t port_id, uint16_t queue_id, >> + volatile void **wake_addr, >> + uint64_t *expected, uint64_t *mask) >> +{ >> +struct rte_eth_dev *dev; >> +uint16_t ret; >> + >> +RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >> + >> +dev = &rte_eth_devices[port_id]; >> + >> +ret = (*dev->dev_ops->get_wake_addr) >> +(dev->data->rx_queues[queue_id], >> + wake_addr, expected, mask); > > > This is an optional dev_ops, so I think you need to check that get_wake_addr() > is defined for that PMD. > Plus you need to check that queue_id is valid. > Sorry, added dev_ops check but left out the queue id part :( Will fix in v6. -- Thanks, Anatoly