DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/iavf: implement power management API
@ 2021-03-11 11:55 David Hunt
  2021-03-11 13:37 ` Burakov, Anatoly
  0 siblings, 1 reply; 4+ messages in thread
From: David Hunt @ 2021-03-11 11:55 UTC (permalink / raw)
  To: dev; +Cc: jingjing.wu, beilei.xing, David Hunt

Implement support for the power management API by implementing a
`get_monitor_addr` function that will return an address of an RX ring's
status bit.

This patch is basically a cut-and-paste of the changes already
committed in ixgbe, i40e and ice drivers in 21.02. This extends
the availability of the power-saving mechanism to the iavf driver,
which is needed for those use-cases using virtual functions.

Patch set where PMD Power Manamgement added in 21.02:
http://patchwork.dpdk.org/project/dpdk/list/?series=14756

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c |  1 +
 drivers/net/iavf/iavf_rxtx.c   | 25 +++++++++++++++++++++++++
 drivers/net/iavf/iavf_rxtx.h   |  1 +
 3 files changed, 27 insertions(+)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 4d3772202..760aa41c1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -197,6 +197,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = {
 	.rx_queue_intr_disable      = iavf_dev_rx_queue_intr_disable,
 	.filter_ctrl                = iavf_dev_filter_ctrl,
 	.tx_done_cleanup	    = iavf_dev_tx_done_cleanup,
+	.get_monitor_addr           = iavf_get_monitor_addr,
 };
 
 static int
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 8fafe4579..caf14a232 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -57,6 +57,31 @@ iavf_proto_xtr_type_to_rxdid(uint8_t flex_type)
 				rxdid_map[flex_type] : IAVF_RXDID_COMMS_OVS_1;
 }
 
+int
+iavf_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)
+{
+	struct iavf_rx_queue *rxq = rx_queue;
+	volatile union iavf_rx_desc *rxdp;
+	uint16_t desc;
+
+	desc = rxq->rx_tail;
+	rxdp = &rxq->rx_ring[desc];
+	/* watch for changes in status bit */
+	pmc->addr = &rxdp->wb.qword1.status_error_len;
+
+	/*
+	 * we expect the DD bit to be set to 1 if this descriptor was already
+	 * written to.
+	 */
+	pmc->val = rte_cpu_to_le_64(1 << IAVF_RX_DESC_STATUS_DD_SHIFT);
+	pmc->mask = rte_cpu_to_le_64(1 << IAVF_RX_DESC_STATUS_DD_SHIFT);
+
+	/* registers are 64-bit */
+	pmc->size = sizeof(uint64_t);
+
+	return 0;
+}
+
 static inline int
 check_rx_thresh(uint16_t nb_desc, uint16_t thresh)
 {
diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h
index 922ddadad..5377459ea 100644
--- a/drivers/net/iavf/iavf_rxtx.h
+++ b/drivers/net/iavf/iavf_rxtx.h
@@ -469,6 +469,7 @@ uint16_t iavf_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 			    uint16_t nb_pkts);
 uint16_t iavf_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
 				 uint16_t nb_pkts);
+int iavf_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc);
 int iavf_rx_vec_dev_check(struct rte_eth_dev *dev);
 int iavf_tx_vec_dev_check(struct rte_eth_dev *dev);
 int iavf_rxq_vec_setup(struct iavf_rx_queue *rxq);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v1] net/iavf: implement power management API
  2021-03-11 11:55 [dpdk-dev] [PATCH v1] net/iavf: implement power management API David Hunt
@ 2021-03-11 13:37 ` Burakov, Anatoly
  2021-03-25  7:53   ` Zhang, Qi Z
  2021-03-31 12:27   ` Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: Burakov, Anatoly @ 2021-03-11 13:37 UTC (permalink / raw)
  To: David Hunt, dev; +Cc: jingjing.wu, beilei.xing

On 11-Mar-21 11:55 AM, David Hunt wrote:
> Implement support for the power management API by implementing a
> `get_monitor_addr` function that will return an address of an RX ring's
> status bit.
> 
> This patch is basically a cut-and-paste of the changes already
> committed in ixgbe, i40e and ice drivers in 21.02. This extends
> the availability of the power-saving mechanism to the iavf driver,
> which is needed for those use-cases using virtual functions.
> 
> Patch set where PMD Power Manamgement added in 21.02:
> http://patchwork.dpdk.org/project/dpdk/list/?series=14756
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>
> ---

LGTM as far as using the API correctly goes.

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v1] net/iavf: implement power management API
  2021-03-11 13:37 ` Burakov, Anatoly
@ 2021-03-25  7:53   ` Zhang, Qi Z
  2021-03-31 12:27   ` Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2021-03-25  7:53 UTC (permalink / raw)
  To: Burakov, Anatoly, Hunt, David, dev; +Cc: Wu, Jingjing, Xing, Beilei



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Burakov, Anatoly
> Sent: Thursday, March 11, 2021 9:37 PM
> To: Hunt, David <david.hunt@intel.com>; dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v1] net/iavf: implement power management
> API
> 
> On 11-Mar-21 11:55 AM, David Hunt wrote:
> > Implement support for the power management API by implementing a
> > `get_monitor_addr` function that will return an address of an RX
> > ring's status bit.
> >
> > This patch is basically a cut-and-paste of the changes already
> > committed in ixgbe, i40e and ice drivers in 21.02. This extends the
> > availability of the power-saving mechanism to the iavf driver, which
> > is needed for those use-cases using virtual functions.
> >
> > Patch set where PMD Power Manamgement added in 21.02:
> > http://patchwork.dpdk.org/project/dpdk/list/?series=14756
> >
> > Signed-off-by: David Hunt <david.hunt@intel.com>
> > ---
> 
> LGTM as far as using the API correctly goes.
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v1] net/iavf: implement power management API
  2021-03-11 13:37 ` Burakov, Anatoly
  2021-03-25  7:53   ` Zhang, Qi Z
@ 2021-03-31 12:27   ` Ferruh Yigit
  1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2021-03-31 12:27 UTC (permalink / raw)
  To: Burakov, Anatoly, David Hunt, dev; +Cc: jingjing.wu, beilei.xing

On 3/11/2021 1:37 PM, Burakov, Anatoly wrote:
> On 11-Mar-21 11:55 AM, David Hunt wrote:
>> Implement support for the power management API by implementing a
>> `get_monitor_addr` function that will return an address of an RX ring's
>> status bit.
>>
>> This patch is basically a cut-and-paste of the changes already
>> committed in ixgbe, i40e and ice drivers in 21.02. This extends
>> the availability of the power-saving mechanism to the iavf driver,
>> which is needed for those use-cases using virtual functions.
>>
>> Patch set where PMD Power Manamgement added in 21.02:
>> http://patchwork.dpdk.org/project/dpdk/list/?series=14756
>>
>> Signed-off-by: David Hunt <david.hunt@intel.com>
>> ---
> 
> LGTM as far as using the API correctly goes.
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
> 

The patch seems theoretically confirmed, but does it make sense to test the 
power feature on HW, what do you think?
If tested already can it be possible to provide a tested-by tag for record?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-31 12:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 11:55 [dpdk-dev] [PATCH v1] net/iavf: implement power management API David Hunt
2021-03-11 13:37 ` Burakov, Anatoly
2021-03-25  7:53   ` Zhang, Qi Z
2021-03-31 12:27   ` Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git