Sync some patches from upstream about bugfix, modifies are as follow: - app/testpmd: fix crash in multi-process forwarding - net/hns3: fix offload flag of IEEE 1588 - net/hns3: fix read Rx timestamp handle - net/hns3: fix double free for Rx/Tx queue - net/hns3: fix variable overflow - net/hns3: enable PFC for all user priorities - ring: add telemetry command for ring info - ring: add telemetry command to list rings - net/hns3: support power monitor - net/hns3: disable SCTP verification tag for RSS hash input - app/testpmd: fix RSS algorithm choice
92 lines
3.3 KiB
Diff
92 lines
3.3 KiB
Diff
From 97dd5755f1c76addc90c3c6ba7bb7a9c329cfd25 Mon Sep 17 00:00:00 2001
|
|
From: Chengwen Feng <fengchengwen@huawei.com>
|
|
Date: Mon, 5 Feb 2024 16:35:21 +0800
|
|
Subject: [PATCH 421/431] net/hns3: support power monitor
|
|
|
|
[ upstream commit 9e1e7dded323ce424aebf992f6ddfa9656655631 ]
|
|
|
|
This commit supports power monitor on the Rx queue descriptor of the
|
|
next poll.
|
|
|
|
Note: Although rte_power_monitor() on the ARM platform does not support
|
|
callback, this commit still implements the callback so that it does not
|
|
need to be adjusted after the ARM platform supports callback.
|
|
|
|
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
|
|
Signed-off-by: Jie Hai <haijie1@huawei.com>
|
|
Signed-off-by: chenyi <chenyi211@huawei.com>
|
|
---
|
|
drivers/net/hns3/hns3_ethdev.c | 1 +
|
|
drivers/net/hns3/hns3_ethdev_vf.c | 1 +
|
|
drivers/net/hns3/hns3_rxtx.c | 21 +++++++++++++++++++++
|
|
drivers/net/hns3/hns3_rxtx.h | 1 +
|
|
4 files changed, 24 insertions(+)
|
|
|
|
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
|
index c7a2147f39..0e1ca1b314 100644
|
|
--- a/drivers/net/hns3/hns3_ethdev.c
|
|
+++ b/drivers/net/hns3/hns3_ethdev.c
|
|
@@ -6501,6 +6501,7 @@ static const struct eth_dev_ops hns3_eth_dev_ops = {
|
|
.eth_dev_priv_dump = hns3_eth_dev_priv_dump,
|
|
.eth_rx_descriptor_dump = hns3_rx_descriptor_dump,
|
|
.eth_tx_descriptor_dump = hns3_tx_descriptor_dump,
|
|
+ .get_monitor_addr = hns3_get_monitor_addr,
|
|
};
|
|
|
|
static const struct hns3_reset_ops hns3_reset_ops = {
|
|
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
|
index 0b4ad5a0f7..a6f0d77104 100644
|
|
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
|
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
|
@@ -2290,6 +2290,7 @@ static const struct eth_dev_ops hns3vf_eth_dev_ops = {
|
|
.eth_dev_priv_dump = hns3_eth_dev_priv_dump,
|
|
.eth_rx_descriptor_dump = hns3_rx_descriptor_dump,
|
|
.eth_tx_descriptor_dump = hns3_tx_descriptor_dump,
|
|
+ .get_monitor_addr = hns3_get_monitor_addr,
|
|
};
|
|
|
|
static const struct hns3_reset_ops hns3vf_reset_ops = {
|
|
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
|
index 81edd5258d..49f7177578 100644
|
|
--- a/drivers/net/hns3/hns3_rxtx.c
|
|
+++ b/drivers/net/hns3/hns3_rxtx.c
|
|
@@ -4883,3 +4883,24 @@ hns3_start_rxtx_datapath(struct rte_eth_dev *dev)
|
|
|
|
hns3_mp_req_start_rxtx(dev);
|
|
}
|
|
+
|
|
+static int
|
|
+hns3_monitor_callback(const uint64_t value,
|
|
+ const uint64_t arg[RTE_POWER_MONITOR_OPAQUE_SZ] __rte_unused)
|
|
+{
|
|
+ const uint64_t vld = rte_le_to_cpu_32(BIT(HNS3_RXD_VLD_B));
|
|
+ return (value & vld) == vld ? -1 : 0;
|
|
+}
|
|
+
|
|
+int
|
|
+hns3_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc)
|
|
+{
|
|
+ struct hns3_rx_queue *rxq = rx_queue;
|
|
+ struct hns3_desc *rxdp = &rxq->rx_ring[rxq->next_to_use];
|
|
+
|
|
+ pmc->addr = &rxdp->rx.bd_base_info;
|
|
+ pmc->fn = hns3_monitor_callback;
|
|
+ pmc->size = sizeof(uint32_t);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
|
|
index b6a6513307..18dcc75805 100644
|
|
--- a/drivers/net/hns3/hns3_rxtx.h
|
|
+++ b/drivers/net/hns3/hns3_rxtx.h
|
|
@@ -814,5 +814,6 @@ void hns3_stop_tx_datapath(struct rte_eth_dev *dev);
|
|
void hns3_start_tx_datapath(struct rte_eth_dev *dev);
|
|
void hns3_stop_rxtx_datapath(struct rte_eth_dev *dev);
|
|
void hns3_start_rxtx_datapath(struct rte_eth_dev *dev);
|
|
+int hns3_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc);
|
|
|
|
#endif /* HNS3_RXTX_H */
|
|
--
|
|
2.33.0
|
|
|