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 7A876A04B7; Wed, 14 Oct 2020 05:19:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5BBEB1DBAC; Wed, 14 Oct 2020 05:19:53 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1B25A1DBA9 for ; Wed, 14 Oct 2020 05:19:49 +0200 (CEST) IronPort-SDR: xBV5LjFVTLSnc5HllYXr172D3DVaXLRXiQeZMHwDSecD6b6t8X25gtd7m39CF56QB0f5j9iPq2 XIWiNkID5frg== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="230203910" X-IronPort-AV: E=Sophos;i="5.77,373,1596524400"; d="scan'208";a="230203910" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 20:19:46 -0700 IronPort-SDR: umgQRqEKCNfom0sYgf6KsDMSFB21UYhU7pL1OjNy1x4LijqgEyDC/p/GYqa8HRk1N6v1076Iub wQGSAoH2v2KQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,373,1596524400"; d="scan'208";a="345491840" Received: from irsmsx601.ger.corp.intel.com ([163.33.146.7]) by fmsmga004.fm.intel.com with ESMTP; 13 Oct 2020 20:19:46 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by irsmsx601.ger.corp.intel.com (163.33.146.7) 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 04:19:44 +0100 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Wed, 14 Oct 2020 11:19:42 +0800 From: "Guo, Jia" To: "Burakov, Anatoly" , "dev@dpdk.org" CC: "Ma, Liang J" , "Xing, Beilei" , "Hunt, David" , "Ananyev, Konstantin" , "jerinjacobk@gmail.com" , "Richardson, Bruce" , "thomas@monjalon.net" , "McDaniel, Timothy" , "Eads, Gage" , "Macnamara, Chris" Thread-Topic: [PATCH v5 07/10] net/i40e: implement power management API Thread-Index: AQHWnlWnz+hOlZZoikSpZVr0rlOZ3amWc1+Q Date: Wed, 14 Oct 2020 03:19:41 +0000 Message-ID: References: <1601647919-25312-1-git-send-email-liang.j.ma@intel.com> <78bfa354463be2c3560ee97c369ae7266e0fb50f.1602258833.git.anatoly.burakov@intel.com> In-Reply-To: <78bfa354463be2c3560ee97c369ae7266e0fb50f.1602258833.git.anatoly.burakov@intel.com> Accept-Language: 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 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5 07/10] net/i40e: implement 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" > -----Original Message----- > From: Burakov, Anatoly > Sent: Saturday, October 10, 2020 12:02 AM > To: dev@dpdk.org > Cc: Ma, Liang J ; Xing, Beilei ; > Guo, Jia ; Hunt, David ; > Ananyev, Konstantin ; > jerinjacobk@gmail.com; Richardson, Bruce ; > thomas@monjalon.net; McDaniel, Timothy ; > Eads, Gage ; Macnamara, Chris > > Subject: [PATCH v5 07/10] net/i40e: implement power management API >=20 > From: Liang Ma >=20 > Implement support for the power management API by implementing a > `get_wake_addr` function that will return an address of an RX ring's stat= us bit. >=20 > Signed-off-by: Liang Ma > Signed-off-by: Anatoly Burakov > --- > drivers/net/i40e/i40e_ethdev.c | 1 + > drivers/net/i40e/i40e_rxtx.c | 23 +++++++++++++++++++++++ > drivers/net/i40e/i40e_rxtx.h | 2 ++ > 3 files changed, 26 insertions(+) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 943cfe71dc..cab86f8ec9 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -513,6 +513,7 @@ static const struct eth_dev_ops i40e_eth_dev_ops =3D = { > .mtu_set =3D i40e_dev_mtu_set, > .tm_ops_get =3D i40e_tm_ops_get, > .tx_done_cleanup =3D i40e_tx_done_cleanup, > + .get_wake_addr =3D i40e_get_wake_addr, > }; >=20 > /* store statistics names and its offset in stats structure */ diff --gi= t > a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index > 322fc1ed75..c17f27292f 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -71,6 +71,29 @@ > #define I40E_TX_OFFLOAD_NOTSUP_MASK \ > (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK) >=20 > +int > +i40e_get_wake_addr(void *rx_queue, volatile void **tail_desc_addr, > + uint64_t *expected, uint64_t *mask) > +{ > + struct i40e_rx_queue *rxq =3D rx_queue; > + volatile union i40e_rx_desc *rxdp; > + uint16_t desc; > + > + desc =3D rxq->rx_tail; > + rxdp =3D &rxq->rx_ring[desc]; > + /* watch for changes in status bit */ > + *tail_desc_addr =3D &rxdp->wb.qword1.status_error_len; > + > + /* > + * we expect the DD bit to be set to 1 if this descriptor was already > + * written to. > + */ > + *expected =3D rte_cpu_to_le_64(1 << > I40E_RX_DESC_STATUS_DD_SHIFT); > + *mask =3D rte_cpu_to_le_64(1 << I40E_RX_DESC_STATUS_DD_SHIFT); > + > + return 0; Suppose that it will always success to get wake addr in i40e, right? > +} > + > static inline void > i40e_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union i40e_rx_desc > *rxdp) { diff --git a/drivers/net/i40e/i40e_rxtx.h > b/drivers/net/i40e/i40e_rxtx.h index 57d7b4160b..f23a2073e3 100644 > --- a/drivers/net/i40e/i40e_rxtx.h > +++ b/drivers/net/i40e/i40e_rxtx.h > @@ -248,6 +248,8 @@ uint16_t i40e_recv_scattered_pkts_vec_avx2(void > *rx_queue, > struct rte_mbuf **rx_pkts, uint16_t nb_pkts); uint16_t > i40e_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts, > uint16_t nb_pkts); > +int i40e_get_wake_addr(void *rx_queue, volatile void **tail_desc_addr, > + uint64_t *expected, uint64_t *value); >=20 > /* For each value it means, datasheet of hardware can tell more details > * > -- > 2.17.1