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 9D2B3A04BC; Fri, 9 Oct 2020 00:26:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C11E1BAB9; Fri, 9 Oct 2020 00:26:53 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 642C3F3E for ; Fri, 9 Oct 2020 00:26:51 +0200 (CEST) IronPort-SDR: 9Of9eZ2UCKLmvZ1u/brkR56QJWsHQCWIm5Y+SqKqNt6i0/lXiE+WsS9upQ8l+x6w02+AdExB+i iLcXWEDx0WSA== X-IronPort-AV: E=McAfee;i="6000,8403,9768"; a="152333181" X-IronPort-AV: E=Sophos;i="5.77,352,1596524400"; d="scan'208";a="152333181" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 15:26:49 -0700 IronPort-SDR: oOBSVzXdOmX4DlBYbcDMqio1oadLQrTJGgXS54BNDpgjFZ+P/jzjYjC1FmqZlyfbn9joAvTAaA Domo/lRKvXWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,352,1596524400"; d="scan'208";a="316842185" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga006.jf.intel.com with ESMTP; 08 Oct 2020 15:26:49 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 8 Oct 2020 15:26:48 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 8 Oct 2020 15:26:48 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 8 Oct 2020 15:26:48 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 8 Oct 2020 15:26:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WVsc19Gyfs75iYD8taCWbkDVTyEJRdEUuhmL31i++FGiMGvrSSk8TQ2T+ZSinKfj3JQNClSIg6wCdiYDMlVNDoLDcmjuFNk1drFc1cLeidjgCq4wlEhdYRDIjfAOIQ6GcurkIob2U7ErDuPbE77zt3hHyLb6v1soDA2VbvB9UDrnr9CaWa39BXZPkQZEcX/y/YeNj2Mnvq2TtEMBEO0m4WdmIenEuo0TKTbMA679IPH3Tx2TCl4zJV7akyV1nI0ENQNjOpKNKvKcD5V6jiyHKSVEFscYD/wc47Ekl/QLthFMBfai4GTTvrKo+2bmk648BPFrCO4f1Rvbz17UA1asiA== 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=ExDZqW85L4cx0/gaRGJ1zajTFiYrgBHcC/GnGudGgNI=; b=djejkcqISUsrpoORagUqrf0Wx0R5Cj9lDXzzrnx8EHZ3YEdsaamK6eMrPfmK2AfIsqR+TEoyRadrNDeoQW9mg/Y253D5QhAg1fPRjrotxQDft5oOdFn93z/bgwMDjeev4+DgYHNF9UcxI/6/kJFCGdIILsenCiyqqdnqLsNhpm8xkmDtXVZIzmiupVUrZjtGj0zJDrdyI4Snk50Ddl5D/z4tSZ8CXqHNwNOQDZUy/Mu+aIJeFMaWio92+xdh+B1C3tQ6U+2rWcBfCfadGMsnwzX3yTo69CH83dVa3mYwLC3V01lx8eLS31Yj3aQCGTZKuQpMr6bVA34jQ/CW3l/CKw== 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=ExDZqW85L4cx0/gaRGJ1zajTFiYrgBHcC/GnGudGgNI=; b=Px2uOLI65TMKCQAQXq7bVARTwhiEJN+4XhYPJln+U95//1pi6n+pjcd77E6IlOCH4o9Epa0SwXwzS5+q/VttD0wrJQtIjg2zYdCFuik4QUKuUpF1o0Z5WpRJ23mJmAduTcPCJtVk+Q7MXKp4E4uciohecC6RVkMOC0008fVkyHQ= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BY5PR11MB4435.namprd11.prod.outlook.com (2603:10b6:a03:1ce::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Thu, 8 Oct 2020 22:26:37 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f5a4:3f6b:ade3:296b]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f5a4:3f6b:ade3:296b%3]) with mapi id 15.20.3455.023; Thu, 8 Oct 2020 22:26:37 +0000 From: "Ananyev, Konstantin" To: "Ma, Liang J" , "dev@dpdk.org" CC: "Hunt, David" , "stephen@networkplumber.org" , "Burakov, Anatoly" Thread-Topic: [PATCH v4 03/10] ethdev: add simple power management API Thread-Index: AQHWmMYP1YIY4HfankenulenmkAl0qmOUeTw Date: Thu, 8 Oct 2020 22:26:37 +0000 Message-ID: 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> In-Reply-To: <1601647919-25312-3-git-send-email-liang.j.ma@intel.com> 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: 82736161-0d7f-4340-d2e2-08d86bd93877 x-ms-traffictypediagnostic: BY5PR11MB4435: 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:1332; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Eks0+xxS7u6wwcyov94JFpzLS+EinV8vraNcN+GNFv5qh0ZQtVlTd4UsZ0X7I5uKmIA+a7q5/9doPvmPwR/FwkhCP59kUBPrCABCt9MNvMxqjf7ri/doaInS7TWCZs9ZGKLudEVK3KGcqq6pJJ8TYu7YbCyDyKjEoVgKhzGh2ceAB4ox8uR+pQ3rb06e7xgT0PS9q0W/bSgOM5DF2OH/yOBK6tTzpC1PmLVQJygGYelT5UUzW9hvNvE1tZXIeiImHZ2e5KhxF0LRzNw/9vhdJv7SXwMUqznAhVA0Dp5xHdhwQQFcmhLtYiyQy0cUELwItFZPT0MD05Z/Gifc07Y4tw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(39860400002)(136003)(346002)(376002)(478600001)(2906002)(52536014)(5660300002)(83380400001)(33656002)(76116006)(107886003)(4326008)(8676002)(110136005)(66946007)(64756008)(6506007)(86362001)(66476007)(26005)(66556008)(71200400001)(7696005)(9686003)(316002)(8936002)(186003)(54906003)(66446008)(55016002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: oau1vaBO3GGweptCG/JrElxjHINS+EEbaeLTMtTxaAAnsvqexvqNF6SWLhTLCmlVWU9SHPTZNYuZFTGzFjUKhsXR86YrpMgLIMvll+bP1YMUt/UeH5WVHFBktpqoIcey2DQTqkzGgngEPWnfig72TufkD4kf4eQWAP9Sx5KhuWCJmqTRVSClQpBE32Vt84Q0TxwVOkJU7Maqm2K6Vm0ADVxv7rOcSqqCQ4nmhY1MHr4CLFMI46cdD+kv8LX3CheaVP1Moz92eZHVzZ3XhtzwBDXI0OGCfwLPGZ/Q0wU+QgPVNXQRPOLFtzevE/PPL4ds3V9Bq0s3zhsxROO+h3ApFt5jppOREedMTTlrhDleHICH4nnk4JmxUlcJ8lNpY3sqTJLVz2BkH6d5bRC+9so93Fem5E5bMneriNnq6hTOrgj/u3r0IC1Q+BaQ0VdjXv5r5l1HasckW3HwzF6s92QmJh55ze2Muq/8bQgSp8qwsY9l6lfierGY8WDY+E6O0UqvlVrFjqbP/hs84kmxJsZ86VpGtczGq5IMA2qFjI1hTtMpfkwU1qrkNm1GDKyI2q8L0kaFdK+Tqx3Fg3YRzBHoO9kGIGBdX+rXQFi6s776KhIUYAvrTb2oSYqi9EyQHcuOgwQ4OLICzyPW974UIh+bzQ== 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: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82736161-0d7f-4340-d2e2-08d86bd93877 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2020 22:26:37.1058 (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: 6Yx/7alWRqvJhXspfw1xGO5fbPRYRJTlJE6+gjmD3ULlmbjDfMJMmrL7Ni50hZNcd9OB6SAF6TmRb+3MO++ztndyKyfBVxICNmRRVG6J2ac= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4435 X-OriginatorOrg: intel.com 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" >=20 > Add a simple API allow ethdev get wake up address from PMD. > Also include internal structure update. >=20 > 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(+) >=20 > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde= v.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)); > } >=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) > +{ > + struct rte_eth_dev *dev; > + uint16_t ret; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + dev =3D &rte_eth_devices[port_id]; > + > + ret =3D (*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_add= r() is defined for that PMD. Plus you need to check that queue_id is valid. > + > + return ret; > +} > + > 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 d2bf74f128..a6cfe3cd57 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -4014,6 +4014,30 @@ __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 from specific queue > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param queue_id > + * The Tx 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. > + * -EINVAL: Failed to get wake address. > + */ > +__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); > + > /** > * 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 c3062c246c..935d46f25c 100644 > --- a/lib/librte_ethdev/rte_ethdev_driver.h > +++ b/lib/librte_ethdev/rte_ethdev_driver.h > @@ -574,6 +574,31 @@ typedef int (*eth_tx_hairpin_queue_setup_t) > uint16_t nb_tx_desc, > const struct rte_eth_hairpin_conf *hairpin_conf); >=20 > +/** > + * @internal > + * Get the Wake up address. > + * > + * @param rxq > + * Ethdev queue pointer. > + * @param tail_desc_addr > + * The pointer point to descriptor address var. > + * @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 > + * Negative errno value on error, 0 on success. > + * > + * @retval 0 > + * Success. > + * @retval -EINVAL > + * Failed to get descriptor address. > + */ > +typedef int (*eth_get_wake_addr_t) > + (void *rxq, volatile void **tail_desc_addr, > + uint64_t *expected, uint64_t *mask); > + > + > /** > * @internal A structure containing the functions exported by an Etherne= t driver. > */ > @@ -713,6 +738,9 @@ struct eth_dev_ops { > /**< Set up device RX hairpin queue. */ > eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup; > /**< Set up device TX hairpin queue. */ > + eth_get_wake_addr_t get_wake_addr; > + /**< Get wake up address. */ > + > }; >=20 > /** > diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev= /rte_ethdev_version.map > index c95ef5157a..3cb2093980 100644 > --- a/lib/librte_ethdev/rte_ethdev_version.map > +++ b/lib/librte_ethdev/rte_ethdev_version.map > @@ -229,6 +229,7 @@ EXPERIMENTAL { > # added in 20.11 > rte_eth_link_speed_to_str; > rte_eth_link_to_str; > + rte_eth_get_wake_addr; > }; >=20 > INTERNAL { > -- > 2.17.1