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 F217DA04DB; Wed, 14 Oct 2020 19:07:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 386951BED1; Wed, 14 Oct 2020 19:07:05 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id DD58D1BEB2 for ; Wed, 14 Oct 2020 19:07:03 +0200 (CEST) IronPort-SDR: bL9Jvy0mHLtBYK3i332KpWAk1ph2fC0Fyokshax5uz0H7NU671pJzd04vDTClcTNYe6pQ1qjmh 3haUpDDSnF1g== X-IronPort-AV: E=McAfee;i="6000,8403,9774"; a="153979098" X-IronPort-AV: E=Sophos;i="5.77,375,1596524400"; d="scan'208";a="153979098" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 10:07:01 -0700 IronPort-SDR: 3tLFPMqwUpVMVW07jdPbxTdS+W1x9mNQa0fsTU4xujhRuKCVdiEksSXoLK4D7Gj5vJANd0sxzt kgESkN4mXHMQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,375,1596524400"; d="scan'208";a="346573424" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga008.jf.intel.com with ESMTP; 14 Oct 2020 10:07:01 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 14 Oct 2020 10:07:01 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 14 Oct 2020 10:07:01 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.51) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 14 Oct 2020 10:06:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CcPEkxt5f2It9H9FR4SiItDIuaph3z/orHPkAGxr5J947x+2wJKYul4m1xVIjJZgFVD4Q8fbb3QBB/lj6JhhVzzqFGIrZWxEiCdRoc+X0cgpBVYHVgV1zOjmxVyiinYL35QR+o1Z49bf3U/+qbFPyUun4obn14JfYYiJGIg2vtBVyoc+C830ZWUhK9Tr1WDWjjoGmEYtvwk4ED9CdYAyliyM+EvaM2aM8rUIRuSQDmPSDDtyTEBaw6CgWqTT3IWB65TWsle6WTXDEO4oa9sdljnqrGDow3cGQP+7dujRbmD/ACK3kWVWqPaAxjA64jEfpsAfH5AhmFf0DM9btjy9Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UC+zBx+SCy38gahZLr5N7ifmC+xdIdih0PgS89JwRJQ=; b=gNdonjnXL/pZuj9spLuG3xqJM08apiWDcEls+vp1dmi0/bF5nGWn+vAMGe7EzHHrwI27XxhoudZtFMP7lkxoAVK4nD0g1sGRalb9/qALNzZdEVaq2TEfwumiaYI+rVDBCpwDbCvvsarSAjPtg9HLhRCwzFWwVFFMwogdaE7hRXQ3plZABTWPV/yCg57yRn9FMPn9RII9nvfkTgadUsItZWF2yI2VNxBlM8UFcEfbcK0K19+G1O/EZZO2kyHQ7qt4rSZSXUNcSc19fqBmJPLOodtAkSrbUU+JwqUyIo/lx3Dajldmv26aKeW+SqPJ2iL0JWX2/Kl5RndKD/Jkkc3u+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UC+zBx+SCy38gahZLr5N7ifmC+xdIdih0PgS89JwRJQ=; b=Dej5Lf35EwPBH54a8yeUt9d3lh7wJmmq/Xxbn1GTjezjjc/1ukZ93+WIs+YOZ4fhwC6jy7zPUB0Hn7QO4ekz6PWLOkg3pMz29B8GPAvNhmDYQoRk2uzT7WaNChgxWzDwACclYX+5ogTj3VkQGs6uIih96mJw7YWDZ5UzcGsXkYc= Received: from SN6PR11MB3310.namprd11.prod.outlook.com (2603:10b6:805:b9::13) by SA0PR11MB4591.namprd11.prod.outlook.com (2603:10b6:806:9c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20; Wed, 14 Oct 2020 17:06:54 +0000 Received: from SN6PR11MB3310.namprd11.prod.outlook.com ([fe80::ed1d:ff6d:e1e2:6d07]) by SN6PR11MB3310.namprd11.prod.outlook.com ([fe80::ed1d:ff6d:e1e2:6d07%2]) with mapi id 15.20.3455.030; Wed, 14 Oct 2020 17:06:54 +0000 From: "Ananyev, Konstantin" To: "Burakov, Anatoly" , "dev@dpdk.org" CC: "Ma, Liang J" , Thomas Monjalon , "Yigit, Ferruh" , "Andrew Rybchenko" , Ray Kinsella , Neil Horman , "Hunt, David" , "jerinjacobk@gmail.com" , "Richardson, Bruce" , "McDaniel, Timothy" , "Eads, Gage" , "Macnamara, Chris" Thread-Topic: [PATCH v6 04/10] ethdev: add simple power management API Thread-Index: AQHWoi5CFilGmAvGjk2Eut2Ey45qY6mXU33g Date: Wed, 14 Oct 2020 17:06:54 +0000 Message-ID: References: <532f45c5d79b4c30a919553d322bb66e91534466.1602258833.git.anatoly.burakov@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6541fdfe-5ccc-4785-120e-08d870638d1e x-ms-traffictypediagnostic: SA0PR11MB4591: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fiw4AOax1M0hw8rmziILZQaw1PBDuAwz8JAF7E52N9b7PColnLjt2Ltu+2GDQXBIn8HSXIRzl/pZGMIHSHcrhNjs5Zw92DYng/NiOGZAOOcv1EO/e3BvByud5RO4NBBKezv4rwLo799uKRtORzCIAcyvc6DdaoVChIriwCLdePZM2s6tINOWDOUaiI+f+rqwcySN437TABwKYwi/DU+z6eo3JcuEa72XWfNkHCmKyF3IxmT6foE+z1irtOVVuU4fr0pwzwkvTeok6H8qWGQvwAX4KOiX0MT1Ek1rz9sqJg/VGa9OW4/2aa8sgdsqWTfmjApUMSMb5LrCVuZ094ojsw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3310.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(136003)(396003)(376002)(346002)(54906003)(316002)(8676002)(5660300002)(55016002)(110136005)(86362001)(52536014)(4326008)(9686003)(478600001)(186003)(107886003)(33656002)(26005)(6506007)(7696005)(66476007)(76116006)(64756008)(66556008)(66446008)(2906002)(66946007)(71200400001)(8936002)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: Gd5O4UdgceyRMCMklpXqurKZJMn2mwdu2K1XEs903QzG/d6oxdWO0odwsQwbfMGZkJ8WID2gLjeXsxu8iVPeYwxQU9UGjLIdwwXvFDfwzKp1BD435h+RMYjbgMjGDo8dN4ctBXRJJczZVV8Tng+GiysC5Jlp79ngazk1FqlENW0RTtSJwhqa0ZngmuVSPtchHYbl2jmNdSd5EBM4CZFtfVR0PoBIuhX1aSy8R+4JiOow5TUFWB9CmuOTmonTQ69rrhxCZgSashABHOgP+Ja6nZ34K89so0aKUT+yOpgfISZB9RfApmPb9R/IyPBz7EfYdWhiY6M9vC5j1YcMvb4mgLSV6KiU0o5JbXnzkJ0oKbFeWj69G2a765l382zzcpdo4Q4ZzdbwMt2KgdA7KhcoVgj9Nwcag8Q4oQzo2XvwJBfnGpq8SJOkDeGSvUmqLImtZSUA78PuR3x09iFckvyKhFCoubS8GJCMxKJ4n/Zr7CL3eI1sn4qkIN7yeOfiBLD+DzL3e7uJr2JnqOewQk4egNa26fz5KpB2EwOQUcLNDx9ycxLo61PVNbQ60U2nlIBXZ6SpJS4mdMNgBeuRv1CmTmzEP4wd25B7CS+XlPYMWpMbBxviw5eV8sbd0ar75t5WKg12RBcgFAgZj2XLP6RahA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3310.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6541fdfe-5ccc-4785-120e-08d870638d1e X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2020 17:06:54.2977 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7yEZtmqkIP72kIKOy6cLNznETq2UF7L4bt+JDCZ7TasMAfW78o/mwtHK8OV11+E6C3Z2/Fj+5tgIuirnqs0IQ4OvggYudAr48orC4A13PdA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4591 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v6 04/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" > From: Liang Ma >=20 > Add a simple API to allow getting address of next RX descriptor from the > PMD, as well as release notes information. >=20 > Signed-off-by: Liang Ma > Signed-off-by: Anatoly Burakov > Acked-by: Konstantin Ananyev > --- >=20 > Notes: > v6: > - Rebase on top of latest main > - Ensure the API checks queue ID (Konstantin) > - Removed accidental inclusion of unrelated release notes > v5: > - Bring function format in line with other functions in the file > - Ensure the API is supported by the driver before calling it (Konsta= ntin) >=20 > doc/guides/rel_notes/release_20_11.rst | 8 ++++++- > lib/librte_ethdev/rte_ethdev.c | 23 +++++++++++++++++++ > lib/librte_ethdev/rte_ethdev.h | 26 ++++++++++++++++++++++ > lib/librte_ethdev/rte_ethdev_driver.h | 28 ++++++++++++++++++++++++ > lib/librte_ethdev/rte_ethdev_version.map | 1 + > 5 files changed, 85 insertions(+), 1 deletion(-) >=20 > diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_note= s/release_20_11.rst > index 0925123e9c..ca4f43f7f9 100644 > --- a/doc/guides/rel_notes/release_20_11.rst > +++ b/doc/guides/rel_notes/release_20_11.rst > @@ -71,7 +71,13 @@ New Features > * **Added the FEC API, for a generic FEC query and config.** >=20 > Added the FEC API which provides functions for query FEC capabilities = and > - current FEC mode from device. Also, API for configuring FEC mode is al= so provided. > + current FEC mode from device. Also, API for configuring FEC mode is al= so > + provided. > + > +* **ethdev: add 1 new EXPERIMENTAL API for PMD power management.** > + > + * ``rte_eth_get_wake_addr()`` > + * add new eth_dev_ops ``get_wake_addr`` >=20 > * **Updated Broadcom bnxt driver.** >=20 > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde= v.c > index 59beb8aec2..5d19c97a3e 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -4844,6 +4844,29 @@ 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)); > } >=20 > +int > +rte_eth_get_wake_addr(uint16_t port_id, uint16_t queue_id, > + volatile void **wake_addr, uint64_t *expected, uint64_t *mask, > + uint8_t *data_sz) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + dev =3D &rte_eth_devices[port_id]; > + > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_wake_addr, -ENOTSUP); > + > + if (queue_id >=3D dev->data->nb_tx_queues) { nb_rx_queues > + RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=3D%u\n", queue_id); RX not TX > + return -EINVAL; > + } > + > + return eth_err(port_id, > + dev->dev_ops->get_wake_addr(dev->data->rx_queues[queue_id], > + wake_addr, expected, mask, data_sz)); > +} > + > int > rte_eth_dev_set_mc_addr_list(uint16_t port_id, > struct rte_ether_addr *mc_addr_set, > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethde= v.h > index 3a31f94367..005faba455 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -4119,6 +4119,32 @@ __rte_experimental > int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, > struct rte_eth_burst_mode *mode); >=20 > +/** > + * Retrieve the wake up address for the receive queue. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param queue_id > + * The Rx queue on the Ethernet device for which information > + * will be retrieved. > + * @param wake_addr > + * The pointer point to the address which is used for monitoring. > + * @param expected > + * The pointer point to value to be expected when descriptor is set. > + * @param mask > + * The pointer point to comparison bitmask for the expected value. > + * > + * @return > + * - 0: Success. > + * -ENOTSUP: Operation not supported. > + * -EINVAL: Invalid parameters. > + * -ENODEV: Invalid port ID. > + */ > +__rte_experimental > +int rte_eth_get_wake_addr(uint16_t port_id, uint16_t queue_id, > + volatile void **wake_addr, uint64_t *expected, uint64_t *mask, > + uint8_t *data_sz); > + > /** > * Retrieve device registers and register attributes (number of register= s and > * register size) > diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rt= e_ethdev_driver.h > index 35cc4fb186..76b179de42 100644 > --- a/lib/librte_ethdev/rte_ethdev_driver.h > +++ b/lib/librte_ethdev/rte_ethdev_driver.h > @@ -655,6 +655,32 @@ typedef int (*eth_fec_get_t)(struct rte_eth_dev *dev= , > */ > typedef int (*eth_fec_set_t)(struct rte_eth_dev *dev, uint32_t fec_capa)= ; >=20 > +/** > + * @internal > + * Get address of memory location whose contents will change whenever th= ere is > + * new data to be received on an RX queue. > + * > + * @param rxq > + * Ethdev queue pointer. > + * @param tail_desc_addr > + * The pointer point to where the address will be stored. > + * @param expected > + * The pointer point to value to be expected when descriptor is set. > + * @param mask > + * The pointer point to comparison bitmask for the expected value. > + * @param data_sz > + * Data size for the expected value (can be 1, 2, 4, or 8 bytes) > + * @return > + * Negative errno value on error, 0 on success. > + * > + * @retval 0 > + * Success > + * @retval -EINVAL > + * Invalid parameters > + */ > +typedef int (*eth_get_wake_addr_t)(void *rxq, volatile void **tail_desc_= addr, > + uint64_t *expected, uint64_t *mask, uint8_t *data_sz); > + > /** > * @internal A structure containing the functions exported by an Etherne= t driver. > */ > @@ -801,6 +827,8 @@ struct eth_dev_ops { > /**< Get Forward Error Correction(FEC) mode. */ > eth_fec_set_t fec_set; > /**< Set Forward Error Correction(FEC) mode. */ > + eth_get_wake_addr_t get_wake_addr; > + /**< Get next RX queue ring entry address. */ > }; >=20 > /** > diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev= /rte_ethdev_version.map > index f8a0945812..6c2ea5996d 100644 > --- a/lib/librte_ethdev/rte_ethdev_version.map > +++ b/lib/librte_ethdev/rte_ethdev_version.map > @@ -232,6 +232,7 @@ EXPERIMENTAL { > rte_eth_fec_get_capability; > rte_eth_fec_get; > rte_eth_fec_set; > + rte_eth_get_wake_addr; > }; >=20 > INTERNAL { > -- > 2.17.1