* [PATCH 1/4] net/ark: update mpu code to match current hardware version
@ 2022-05-02 21:22 Ed Czeck
2022-05-02 21:22 ` [PATCH 2/4] net/ark: update ddm " Ed Czeck
` (8 more replies)
0 siblings, 9 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-02 21:22 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level global operations
remove ark_mpu_reset_stats function
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 2 --
drivers/net/ark/ark_ethdev_rx.c | 4 ----
drivers/net/ark/ark_mpu.c | 15 ++++-----------
drivers/net/ark/ark_mpu.h | 3 ++-
4 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 76b88c62d0..c0578b85ce 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -524,7 +524,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->rx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
@@ -536,7 +535,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 0fbb2603db..85e34d0bb8 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -91,9 +91,6 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
ark_udm_write_addr(queue->udm, phys_addr_prod_index);
- /* advance the valid pointer, but don't start until the queue starts */
- ark_mpu_reset_stats(queue->mpu);
-
/* The seed is the producer index for the HW */
ark_mpu_set_producer(queue->mpu, queue->seed_index);
dev->data->rx_queue_state[rx_queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
@@ -589,7 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
if (queue == 0)
return;
- ark_mpu_reset_stats(queue->mpu);
ark_udm_queue_stats_reset(queue->udm);
}
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index b8e94b6ed3..4038c08747 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
{
uint32_t version;
- version = mpu->id.vernum & 0x0000fF00;
- if ((mpu->id.idnum != 0x2055504d) ||
- (mpu->hw.obj_size != obj_size) ||
- (version != 0x00003100)) {
+ version = mpu->id.vernum;
+ if (mpu->id.idnum != ARK_MPU_MODID ||
+ version != ARK_MPU_MODVER ||
+ mpu->hw.obj_size != obj_size) {
ARK_PMD_LOG(ERR,
" MPU module not found as expected %08x"
" \"%c%c%c%c %c%c%c%c\"\n",
@@ -79,16 +79,9 @@ ark_mpu_reset(struct ark_mpu_t *mpu)
mpu->cfg.command = MPU_CMD_FORCE_RESET;
usleep(10);
}
- ark_mpu_reset_stats(mpu);
return mpu->cfg.command != MPU_CMD_IDLE;
}
-void
-ark_mpu_reset_stats(struct ark_mpu_t *mpu)
-{
- mpu->stats.pci_request = 1; /* reset stats */
-}
-
int
ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
int is_tx)
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index 92c3e67c86..944bf37f59 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -15,6 +15,8 @@
* there is minimal documentation.
*/
+#define ARK_MPU_MODID 0x2055504d
+#define ARK_MPU_MODVER 0x37313232
/*
* MPU hardware structures
* These are overlay structures to a memory mapped FPGA device. These
@@ -113,7 +115,6 @@ int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);
-void ark_mpu_reset_stats(struct ark_mpu_t *mpu);
/* this action is in a performance critical path */
static inline void
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 2/4] net/ark: update ddm code to match current hardware version
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
@ 2022-05-02 21:22 ` Ed Czeck
2022-05-02 21:22 ` [PATCH 3/4] net/ark: update udm " Ed Czeck
` (7 subsequent siblings)
8 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-02 21:22 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by hardware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ddm.c | 80 +++++----------------------------
drivers/net/ark/ark_ddm.h | 30 +++++++------
drivers/net/ark/ark_ethdev.c | 33 --------------
drivers/net/ark/ark_ethdev_tx.c | 35 +++------------
4 files changed, 34 insertions(+), 144 deletions(-)
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index b16c739d50..eb88349b7b 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -14,95 +14,45 @@ int
ark_ddm_verify(struct ark_ddm_t *ddm)
{
uint32_t hw_const;
+ uint32_t hw_ver;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
- hw_const = ddm->cfg.const0;
- if (hw_const == ARK_DDM_CONST3)
+ hw_const = ddm->cfg.idnum;
+ hw_ver = ddm->cfg.vernum;
+ if (hw_const == ARK_DDM_MODID && hw_ver == ARK_DDM_MODVER)
return 0;
- if (hw_const == ARK_DDM_CONST1) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 1, "
- "PMD expects version 2\n");
- return -1;
- }
-
- if (hw_const == ARK_DDM_CONST2) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 2, "
- "PMD expects version 3\n");
- return -1;
- }
ARK_PMD_LOG(ERR,
- "ARK: DDM module not found as expected 0x%08x\n",
- ddm->cfg.const0);
+ "ARK: DDM module not found as expected"
+ " id: %08x ver: %08x\n",
+ hw_const, hw_ver);
return -1;
}
void
-ark_ddm_start(struct ark_ddm_t *ddm)
-{
- ddm->cfg.command = 1;
-}
-
-int
-ark_ddm_stop(struct ark_ddm_t *ddm, const int wait)
+ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable)
{
- int cnt = 0;
-
- ddm->cfg.command = 2;
- rte_wmb();
- while (wait && (ddm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
+ ddm->setup.qcommand = enable ? 1U : 0U;
}
void
-ark_ddm_reset(struct ark_ddm_t *ddm)
-{
- int status;
-
- /* reset only works if ddm has stopped properly. */
- status = ark_ddm_stop(ddm, 1);
-
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- ddm->cfg.command = 4;
- usleep(10);
- }
- ddm->cfg.command = 3;
-}
-
-void
-ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr, uint32_t interval)
+ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr)
{
ddm->setup.cons_write_index_addr = cons_addr;
- ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
+ ddm->setup.cons_index = 0;
}
+/* Global stats clear */
void
ark_ddm_stats_reset(struct ark_ddm_t *ddm)
{
ddm->cfg.tlp_stats_clear = 1;
}
-void
-ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
- ark_ddm_is_stopped(ddm)
- );
-}
-
void
ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
{
@@ -116,12 +66,6 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
"MBufs", stats->tx_mbuf_count);
}
-int
-ark_ddm_is_stopped(struct ark_ddm_t *ddm)
-{
- return (ddm->cfg.stop_flushed & 0x01) != 0;
-}
-
uint64_t
ark_ddm_queue_byte_count(struct ark_ddm_t *ddm)
{
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index 687ff2519a..886bb088ce 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -40,17 +40,24 @@ union ark_tx_meta {
*/
#define ARK_DDM_CFG 0x0000
/* Set unique HW ID for hardware version */
-#define ARK_DDM_CONST3 (0x334d4444)
-#define ARK_DDM_CONST2 (0x324d4444)
-#define ARK_DDM_CONST1 (0xfacecafe)
+#define ARK_DDM_MODID 0x204d4444
+#define ARK_DDM_MODVER 0x37313232
struct ark_ddm_cfg_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ volatile uint32_t tlp_stats_clear;
+ };
uint32_t r0;
- volatile uint32_t tlp_stats_clear;
- uint32_t const0;
volatile uint32_t tag_max;
volatile uint32_t command;
- volatile uint32_t stop_flushed;
+ uint32_t write_index_interval; /* 4ns each */
+ volatile uint64_t qflow;
};
#define ARK_DDM_STATS 0x0020
@@ -108,7 +115,7 @@ struct ark_ddm_cpld_ps_t {
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
rte_iova_t cons_write_index_addr;
- uint32_t write_index_interval; /* 4ns each */
+ volatile uint32_t qcommand;
volatile uint32_t cons_index;
};
@@ -141,17 +148,12 @@ struct ark_ddm_t {
/* DDM function prototype */
int ark_ddm_verify(struct ark_ddm_t *ddm);
-void ark_ddm_start(struct ark_ddm_t *ddm);
-int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
-void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
- uint32_t interval);
+void ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
-void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
-int ark_ddm_is_stopped(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_byte_count(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_pkt_count(struct ark_ddm_t *ddm);
void ark_ddm_queue_reset_stats(struct ark_ddm_t *ddm);
+void ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable);
#endif
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index c0578b85ce..07d1d2178d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -527,10 +527,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- /* TX -- DDM */
- if (ark_ddm_stop(ark->ddm.v, 1))
- ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
-
mpu = ark->mputx.v;
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
@@ -538,10 +534,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- ark_ddm_reset(ark->ddm.v);
- ark_ddm_stats_reset(ark->ddm.v);
-
- ark_ddm_stop(ark->ddm.v, 0);
if (ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
@@ -595,9 +587,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
for (i = 0; i < dev->data->nb_tx_queues; i++)
eth_ark_tx_queue_start(dev, i);
- /* start DDM */
- ark_ddm_start(ark->ddm.v);
-
ark->started = 1;
/* set xmit and receive function */
dev->rx_pkt_burst = ð_ark_recv_pkts;
@@ -671,28 +660,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* Stop DDM */
- /* Wait up to 0.1 second. each stop is up to 1000 * 10 useconds */
- for (i = 0; i < 10; i++) {
- status = ark_ddm_stop(ark->ddm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "DDM stop anomaly. status:"
- " %d iter: %u. (%s)\n",
- status,
- i,
- __func__);
- ark_ddm_dump(ark->ddm.v, "Stop anomaly");
-
- mpu = ark->mputx.v;
- for (i = 0; i < ark->tx_queues; i++) {
- ark_mpu_dump(mpu, "DDM failure dump", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
/* STOP RX Side */
/* Stop UDM multiple tries attempted */
for (i = 0; i < 10; i++) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index abdce6a8cc..5940a592a2 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -59,12 +59,6 @@ static int eth_ark_tx_jumbo(struct ark_tx_queue *queue,
static int eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue);
static void free_completed_tx(struct ark_tx_queue *queue);
-static inline void
-ark_tx_hw_queue_stop(struct ark_tx_queue *queue)
-{
- ark_mpu_stop(queue->mpu);
-}
-
/* ************************************************************************* */
static inline void
eth_ark_tx_desc_fill(struct ark_tx_queue *queue,
@@ -309,7 +303,6 @@ static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
rte_iova_t queue_base, ring_base, cons_index_addr;
- uint32_t write_interval_ns;
/* Verify HW -- MPU */
if (ark_mpu_verify(queue->mpu, sizeof(union ark_tx_meta)))
@@ -326,28 +319,9 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
/* Stop and Reset and configure MPU */
ark_mpu_configure(queue->mpu, ring_base, queue->queue_size, 1);
- /*
- * Adjust the write interval based on queue size --
- * increase pcie traffic when low mbuf count
- * Queue sizes less than 128 are not allowed
- */
- switch (queue->queue_size) {
- case 128:
- write_interval_ns = 500;
- break;
- case 256:
- write_interval_ns = 500;
- break;
- case 512:
- write_interval_ns = 1000;
- break;
- default:
- write_interval_ns = 2000;
- break;
- }
-
/* Completion address in UDM */
- ark_ddm_setup(queue->ddm, cons_index_addr, write_interval_ns);
+ ark_ddm_queue_setup(queue->ddm, cons_index_addr);
+ ark_ddm_queue_reset_stats(queue->ddm);
return 0;
}
@@ -360,7 +334,8 @@ eth_ark_tx_queue_release(void *vtx_queue)
queue = (struct ark_tx_queue *)vtx_queue;
- ark_tx_hw_queue_stop(queue);
+ ark_ddm_queue_enable(queue->ddm, 0);
+ ark_mpu_stop(queue->mpu);
queue->cons_index = queue->prod_index;
free_completed_tx(queue);
@@ -386,6 +361,7 @@ eth_ark_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id)
return -1;
}
+ ark_ddm_queue_enable(queue->ddm, 0);
ark_mpu_stop(queue->mpu);
free_completed_tx(queue);
@@ -404,6 +380,7 @@ eth_ark_tx_queue_start(struct rte_eth_dev *dev, uint16_t queue_id)
return 0;
ark_mpu_start(queue->mpu);
+ ark_ddm_queue_enable(queue->ddm, 1);
dev->data->tx_queue_state[queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 3/4] net/ark: update udm code to match current hardware version
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-02 21:22 ` [PATCH 2/4] net/ark: update ddm " Ed Czeck
@ 2022-05-02 21:22 ` Ed Czeck
2022-05-02 21:22 ` [PATCH 4/4] net/ark: add new devices to support list Ed Czeck
` (6 subsequent siblings)
8 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-02 21:22 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by hardware
remove performance structs as they are not in the hardware module
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 34 +----------
drivers/net/ark/ark_ethdev_rx.c | 38 +-----------
drivers/net/ark/ark_ethdev_rx.h | 1 -
drivers/net/ark/ark_udm.c | 103 +++-----------------------------
drivers/net/ark/ark_udm.h | 73 +++++-----------------
5 files changed, 27 insertions(+), 222 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 07d1d2178d..8b4daa819b 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -512,13 +512,6 @@ ark_config_device(struct rte_eth_dev *dev)
if (ark_ddm_verify(ark->ddm.v))
return -1;
- /* UDM */
- if (ark_udm_reset(ark->udm.v)) {
- ARK_PMD_LOG(ERR, "Unable to stop and reset UDM\n");
- return -1;
- }
- /* Keep in reset until the MPU are cleared */
-
/* MPU reset */
mpu = ark->mpurx.v;
num_q = ark_api_num_queues(mpu);
@@ -577,9 +570,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
int i;
/* RX Side */
- /* start UDM */
- ark_udm_start(ark->udm.v);
-
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_start_queue(dev, i);
@@ -627,7 +617,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
uint16_t i;
int status;
struct ark_adapter *ark = dev->data->dev_private;
- struct ark_mpu_t *mpu;
if (ark->started == 0)
return 0;
@@ -660,27 +649,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* STOP RX Side */
- /* Stop UDM multiple tries attempted */
- for (i = 0; i < 10; i++) {
- status = ark_udm_stop(ark->udm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
- status, i, __func__);
- ark_udm_dump(ark->udm.v, "Stop anomaly");
-
- mpu = ark->mpurx.v;
- for (i = 0; i < ark->rx_queues; i++) {
- ark_mpu_dump(mpu, "UDM Stop anomaly", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
ark_udm_dump_stats(ark->udm.v, "Post stop");
- ark_udm_dump_perf(ark->udm.v, "Post stop");
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_dump_queue(dev, i, __func__);
@@ -708,10 +677,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
eth_ark_dev_stop(dev);
- eth_ark_udm_force_close(dev);
/*
- * TODO This should only be called once for the device during shutdown
+ * This should only be called once for the device during shutdown
*/
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 85e34d0bb8..cbc0416bc2 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -200,13 +200,10 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
queue->mpu = RTE_PTR_ADD(ark->mpurx.v, qidx * ARK_MPU_QOFFSET);
/* Configure UDM per queue */
- ark_udm_stop(queue->udm, 0);
ark_udm_configure(queue->udm,
RTE_PKTMBUF_HEADROOM,
- queue->dataroom,
- ARK_RX_WRITE_TIME_NS);
- ark_udm_stats_reset(queue->udm);
- ark_udm_stop(queue->udm, 0);
+ queue->dataroom);
+ ark_udm_queue_stats_reset(queue->udm);
/* populate mbuf reserve */
status = eth_ark_rx_seed_mbufs(queue);
@@ -589,36 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
ark_udm_queue_stats_reset(queue->udm);
}
-void
-eth_ark_udm_force_close(struct rte_eth_dev *dev)
-{
- struct ark_adapter *ark = dev->data->dev_private;
- struct ark_rx_queue *queue;
- uint32_t index;
- uint16_t i;
-
- if (!ark_udm_is_flushed(ark->udm.v)) {
- /* restart the MPUs */
- ARK_PMD_LOG(NOTICE, "UDM not flushed -- forcing flush\n");
- for (i = 0; i < dev->data->nb_rx_queues; i++) {
- queue = (struct ark_rx_queue *)dev->data->rx_queues[i];
- if (queue == 0)
- continue;
-
- ark_mpu_start(queue->mpu);
- /* Add some buffers */
- index = ARK_RX_MPU_CHUNK + queue->seed_index;
- ark_mpu_set_producer(queue->mpu, index);
- }
- /* Wait to allow data to pass */
- usleep(100);
-
- ARK_PMD_LOG(NOTICE, "UDM forced flush attempt, stopped = %d\n",
- ark_udm_is_flushed(ark->udm.v));
- }
- ark_udm_reset(ark->udm.v);
-}
-
static void
ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
{
@@ -633,7 +600,6 @@ ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
ark_mpu_dump(queue->mpu, name, queue->phys_qid);
ark_mpu_dump_setup(queue->mpu, queue->phys_qid);
- ark_udm_dump(queue->udm, name);
ark_udm_dump_setup(queue->udm, queue->phys_qid);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index f64b3dd137..2e3400fd2f 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -27,6 +27,5 @@ void eth_rx_queue_stats_get(void *vqueue, struct rte_eth_stats *stats);
void eth_rx_queue_stats_reset(void *vqueue);
void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id,
const char *msg);
-void eth_ark_udm_force_close(struct rte_eth_dev *dev);
#endif
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 9ebed89627..81b141ad0b 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -12,6 +12,8 @@ static_assert(sizeof(struct ark_rx_meta) == 32, "Unexpected struct size ark_rx_m
int
ark_udm_verify(struct ark_udm_t *udm)
{
+ uint32_t idnum = udm->setup.idnum;
+ uint32_t vernum = udm->setup.vernum;
if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
ARK_PMD_LOG(ERR,
"ARK: UDM structure looks incorrect %d vs %zd\n",
@@ -19,94 +21,30 @@ ark_udm_verify(struct ark_udm_t *udm)
return -1;
}
- if (udm->setup.const0 != ARK_UDM_CONST) {
+ if (idnum != ARK_UDM_MODID || vernum != ARK_UDM_MODVER) {
ARK_PMD_LOG(ERR,
- "ARK: UDM module not found as expected 0x%08x\n",
- udm->setup.const0);
+ "ARK: UDM module not found as expected 0x%08x 0x%08x\n",
+ idnum, vernum);
return -1;
}
return 0;
}
-int
-ark_udm_stop(struct ark_udm_t *udm, const int wait)
-{
- int cnt = 0;
-
- udm->setup.r0 = 0;
- udm->cfg.command = 2;
- rte_wmb();
-
- while (wait && (udm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
-}
-
-int
-ark_udm_reset(struct ark_udm_t *udm)
-{
- int status;
-
- status = ark_udm_stop(udm, 1);
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- udm->cfg.command = 4;
- usleep(10);
- udm->cfg.command = 3;
- status = ark_udm_stop(udm, 0);
- ARK_PMD_LOG(INFO, "%s stop status %d post failure"
- " and forced reset\n",
- __func__, status);
- } else {
- udm->cfg.command = 3;
- }
-
- return status;
-}
-
-void
-ark_udm_start(struct ark_udm_t *udm)
-{
- udm->setup.r0 = 0x100;
- udm->cfg.command = 1;
-}
-
-void
-ark_udm_stats_reset(struct ark_udm_t *udm)
-{
- udm->pcibp.pci_clear = 1;
- udm->tlp_ps.tlp_clear = 1;
-}
-
void
ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns)
+ uint32_t dataroom)
{
/* headroom and data room are in DWords in the UDM */
udm->cfg.dataroom = dataroom / 4;
udm->cfg.headroom = headroom / 4;
-
- /* 4 NS period ns */
- udm->rt_cfg.write_interval = write_interval_ns / 4;
}
void
ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
-}
-
-int
-ark_udm_is_flushed(struct ark_udm_t *udm)
-{
- return (udm->cfg.stop_flushed & 0x01) != 0;
+ udm->rt_cfg.prod_idx = 0;
}
uint64_t
@@ -131,11 +69,10 @@ void
ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
{
ARK_PMD_LOG(INFO, "UDM Stats: %s"
- ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
+ ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
msg,
"Pkts Received", udm->stats.rx_packet_count,
"Pkts Finalized", udm->stats.rx_sent_packets,
- "Pkts Dropped", udm->tlp.pkt_drop,
"Bytes Count", udm->stats.rx_byte_count,
"MBuf Count", udm->stats.rx_mbuf_count);
}
@@ -155,13 +92,6 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
"MBuf Count", udm->qstats.q_mbuf_count);
}
-void
-ark_udm_dump(struct ark_udm_t *udm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
- udm->cfg.stop_flushed);
-}
-
void
ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
{
@@ -172,23 +102,6 @@ ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
"prod_idx", udm->rt_cfg.prod_idx);
}
-void
-ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
-{
- struct ark_udm_pcibp_t *bp = &udm->pcibp;
-
- ARK_PMD_LOG(INFO, "UDM Performance %s"
- ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
- "\n",
- msg,
- "PCI Empty", bp->pci_empty,
- "PCI Q1", bp->pci_q1,
- "PCI Q2", bp->pci_q2,
- "PCI Q3", bp->pci_q3,
- "PCI Q4", bp->pci_q4,
- "PCI Full", bp->pci_full);
-}
-
void
ark_udm_queue_stats_reset(struct ark_udm_t *udm)
{
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 1cbcd94a98..f0685c95c7 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -32,19 +32,25 @@ struct ark_rx_meta {
#define ARK_RX_WRITE_TIME_NS 2500
#define ARK_UDM_SETUP 0
-#define ARK_UDM_CONST2 0xbACECACE
-#define ARK_UDM_CONST3 0x344d4455
-#define ARK_UDM_CONST ARK_UDM_CONST3
+#define ARK_UDM_MODID 0x4d445500
+#define ARK_UDM_MODVER 0x37313232
+
struct ark_udm_setup_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ };
uint32_t r0;
- uint32_t r4;
- volatile uint32_t cycle_count;
uint32_t const0;
};
#define ARK_UDM_CFG 0x010
struct ark_udm_cfg_t {
- volatile uint32_t stop_flushed; /* RO */
+ uint32_t write_interval; /* 4ns cycles */
volatile uint32_t command;
uint32_t dataroom;
uint32_t headroom;
@@ -74,45 +80,11 @@ struct ark_udm_queue_stats_t {
uint32_t q_enable;
};
-#define ARK_UDM_TLP 0x0070
-struct ark_udm_tlp_t {
- volatile uint64_t pkt_drop; /* global */
- volatile uint32_t tlp_q1;
- volatile uint32_t tlp_q2;
- volatile uint32_t tlp_q3;
- volatile uint32_t tlp_q4;
- volatile uint32_t tlp_full;
-};
-
-#define ARK_UDM_PCIBP 0x00a0
-struct ark_udm_pcibp_t {
- volatile uint32_t pci_clear;
- volatile uint32_t pci_empty;
- volatile uint32_t pci_q1;
- volatile uint32_t pci_q2;
- volatile uint32_t pci_q3;
- volatile uint32_t pci_q4;
- volatile uint32_t pci_full;
-};
-
-#define ARK_UDM_TLP_PS 0x00bc
-struct ark_udm_tlp_ps_t {
- volatile uint32_t tlp_clear;
- volatile uint32_t tlp_ps_min;
- volatile uint32_t tlp_ps_max;
- volatile uint32_t tlp_full_ps_min;
- volatile uint32_t tlp_full_ps_max;
- volatile uint32_t tlp_dw_ps_min;
- volatile uint32_t tlp_dw_ps_max;
- volatile uint32_t tlp_pldw_ps_min;
- volatile uint32_t tlp_pldw_ps_max;
-};
-
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
rte_iova_t hw_prod_addr;
- uint32_t write_interval; /* 4ns cycles */
- volatile uint32_t prod_idx; /* RO */
+ uint32_t reserved;
+ volatile uint32_t prod_idx; /* Updated by HW */
};
/* Consolidated structure */
@@ -123,13 +95,8 @@ struct ark_udm_t {
struct ark_udm_cfg_t cfg;
struct ark_udm_stats_t stats;
struct ark_udm_queue_stats_t qstats;
- uint8_t reserved1[(ARK_UDM_TLP - ARK_UDM_PQ) -
+ uint8_t reserved1[(ARK_UDM_RT_CFG - ARK_UDM_PQ) -
sizeof(struct ark_udm_queue_stats_t)];
- struct ark_udm_tlp_t tlp;
- uint8_t reserved2[(ARK_UDM_PCIBP - ARK_UDM_TLP) -
- sizeof(struct ark_udm_tlp_t)];
- struct ark_udm_pcibp_t pcibp;
- struct ark_udm_tlp_ps_t tlp_ps;
struct ark_udm_rt_cfg_t rt_cfg;
int8_t reserved3[(ARK_UDM_EXPECT_SIZE - ARK_UDM_RT_CFG) -
sizeof(struct ark_udm_rt_cfg_t)];
@@ -137,22 +104,14 @@ struct ark_udm_t {
int ark_udm_verify(struct ark_udm_t *udm);
-int ark_udm_stop(struct ark_udm_t *udm, int wait);
-void ark_udm_start(struct ark_udm_t *udm);
-int ark_udm_reset(struct ark_udm_t *udm);
void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns);
+ uint32_t dataroom);
void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
-void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
uint16_t qid);
-void ark_udm_dump(struct ark_udm_t *udm, const char *msg);
-void ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
-int ark_udm_is_flushed(struct ark_udm_t *udm);
/* Per queue data */
uint64_t ark_udm_dropped(struct ark_udm_t *udm);
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 4/4] net/ark: add new devices to support list
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-02 21:22 ` [PATCH 2/4] net/ark: update ddm " Ed Czeck
2022-05-02 21:22 ` [PATCH 3/4] net/ark: update udm " Ed Czeck
@ 2022-05-02 21:22 ` Ed Czeck
2022-05-05 15:37 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
` (5 subsequent siblings)
8 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-02 21:22 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: Ed Czeck, Shepard Siegel, John Miller
update device list is doc
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
doc/guides/nics/ark.rst | 4 +++-
drivers/net/ark/ark_ethdev.c | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index c965406a7b..cec6fce2ff 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -297,6 +297,9 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:1017`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Primary Endpoint]
* ``1d6c:1018`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Secondary Endpoint]
* ``1d6c:1019`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Tertiary Endpoint]
+* ``1d6c:101a`` - AR-ARK-SRIOV-FX0 [Arkville 32B Primary Physical Function]
+* ``1d6c:101b`` - AR-ARK-SRIOV-FX1 [Arkville 64B Primary Physical Function]
+* ``1d6c:101c`` - AR-ARK-SRIOV-VF [Arkville Virtual Function]
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
@@ -322,7 +325,6 @@ Unsupported Features
Features that may be part of, or become part of, the Arkville RTL IP that are
not currently supported or exposed by the ARK PMD include:
-* PCIe SR-IOV Virtual Functions (VFs)
* Arkville's Packet Generator Control and Status
* Arkville's Packet Director Control and Status
* Arkville's Packet Checker Control and Status
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 8b4daa819b..7cf896f6f1 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -94,6 +94,9 @@ static const struct rte_pci_id pci_id_ark_map[] = {
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101a)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101b)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
{.vendor_id = 0, /* sentinel */ },
@@ -127,6 +130,9 @@ ark_device_caps[] = {
SET_DEV_CAPS(0x1017, true),
SET_DEV_CAPS(0x1018, true),
SET_DEV_CAPS(0x1019, true),
+ SET_DEV_CAPS(0x101a, true),
+ SET_DEV_CAPS(0x101b, true),
+ SET_DEV_CAPS(0x101c, false),
SET_DEV_CAPS(0x101e, false),
SET_DEV_CAPS(0x101f, false),
{.device_id = 0,}
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 1/5] net/ark: update mpu code to match current hardware version
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
` (2 preceding siblings ...)
2022-05-02 21:22 ` [PATCH 4/4] net/ark: add new devices to support list Ed Czeck
@ 2022-05-05 15:37 ` Ed Czeck
2022-05-05 15:37 ` [PATCH v1 2/5] net/ark: update ddm " Ed Czeck
` (3 more replies)
2022-05-06 21:27 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
` (4 subsequent siblings)
8 siblings, 4 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-05 15:37 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level global operations
remove ark_mpu_reset_stats function
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 2 --
drivers/net/ark/ark_ethdev_rx.c | 4 ----
drivers/net/ark/ark_mpu.c | 21 ++++-----------------
drivers/net/ark/ark_mpu.h | 29 ++---------------------------
4 files changed, 6 insertions(+), 50 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 76b88c62d0..c0578b85ce 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -524,7 +524,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->rx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
@@ -536,7 +535,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 0fbb2603db..85e34d0bb8 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -91,9 +91,6 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
ark_udm_write_addr(queue->udm, phys_addr_prod_index);
- /* advance the valid pointer, but don't start until the queue starts */
- ark_mpu_reset_stats(queue->mpu);
-
/* The seed is the producer index for the HW */
ark_mpu_set_producer(queue->mpu, queue->seed_index);
dev->data->rx_queue_state[rx_queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
@@ -589,7 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
if (queue == 0)
return;
- ark_mpu_reset_stats(queue->mpu);
ark_udm_queue_stats_reset(queue->udm);
}
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index b8e94b6ed3..9d5ee7841b 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
{
uint32_t version;
- version = mpu->id.vernum & 0x0000fF00;
- if ((mpu->id.idnum != 0x2055504d) ||
- (mpu->hw.obj_size != obj_size) ||
- (version != 0x00003100)) {
+ version = mpu->id.vernum;
+ if (mpu->id.idnum != ARK_MPU_MODID ||
+ version != ARK_MPU_MODVER ||
+ mpu->hw.obj_size != obj_size) {
ARK_PMD_LOG(ERR,
" MPU module not found as expected %08x"
" \"%c%c%c%c %c%c%c%c\"\n",
@@ -79,16 +79,9 @@ ark_mpu_reset(struct ark_mpu_t *mpu)
mpu->cfg.command = MPU_CMD_FORCE_RESET;
usleep(10);
}
- ark_mpu_reset_stats(mpu);
return mpu->cfg.command != MPU_CMD_IDLE;
}
-void
-ark_mpu_reset_stats(struct ark_mpu_t *mpu)
-{
- mpu->stats.pci_request = 1; /* reset stats */
-}
-
int
ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
int is_tx)
@@ -118,12 +111,6 @@ ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
code, qid,
mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
- ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
- "\n",
- code,
- mpu->debug.state, mpu->debug.count,
- mpu->debug.reserved
- );
}
void
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index 92c3e67c86..9d2b70d35f 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -15,6 +15,8 @@
* there is minimal documentation.
*/
+#define ARK_MPU_MODID 0x2055504d
+#define ARK_MPU_MODVER 0x37313232
/*
* MPU hardware structures
* These are overlay structures to a memory mapped FPGA device. These
@@ -64,26 +66,6 @@ enum ARK_MPU_COMMAND {
MPU_COMMAND_LIMIT = 0xfFFFFFFF
};
-#define ARK_MPU_STATS 0x080
-struct ark_mpu_stats_t {
- volatile uint64_t pci_request;
- volatile uint64_t q_empty;
- volatile uint64_t q_q1;
- volatile uint64_t q_q2;
- volatile uint64_t q_q3;
- volatile uint64_t q_q4;
- volatile uint64_t q_full;
-};
-
-#define ARK_MPU_DEBUG 0x0C0
-struct ark_mpu_debug_t {
- volatile uint32_t state;
- uint32_t reserved;
- volatile uint32_t count;
- volatile uint32_t take;
- volatile uint32_t peek[4];
-};
-
/* Consolidated structure */
struct ark_mpu_t {
struct ark_mpu_id_t id;
@@ -93,12 +75,6 @@ struct ark_mpu_t {
uint8_t reserved1[(ARK_MPU_CFG - ARK_MPU_HW) -
sizeof(struct ark_mpu_hw_t)];
struct ark_mpu_cfg_t cfg;
- uint8_t reserved2[(ARK_MPU_STATS - ARK_MPU_CFG) -
- sizeof(struct ark_mpu_cfg_t)];
- struct ark_mpu_stats_t stats;
- uint8_t reserved3[(ARK_MPU_DEBUG - ARK_MPU_STATS) -
- sizeof(struct ark_mpu_stats_t)];
- struct ark_mpu_debug_t debug;
};
uint16_t ark_api_num_queues(struct ark_mpu_t *mpu);
@@ -113,7 +89,6 @@ int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);
-void ark_mpu_reset_stats(struct ark_mpu_t *mpu);
/* this action is in a performance critical path */
static inline void
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 2/5] net/ark: update ddm code to match current hardware version
2022-05-05 15:37 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
@ 2022-05-05 15:37 ` Ed Czeck
2022-05-05 15:37 ` [PATCH v1 3/5] net/ark: update udm " Ed Czeck
` (2 subsequent siblings)
3 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-05 15:37 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by hardware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ddm.c | 80 +++++-------------------------
drivers/net/ark/ark_ddm.h | 86 +++++++++------------------------
drivers/net/ark/ark_ethdev.c | 33 -------------
drivers/net/ark/ark_ethdev_tx.c | 35 +++-----------
4 files changed, 40 insertions(+), 194 deletions(-)
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index b16c739d50..eb88349b7b 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -14,95 +14,45 @@ int
ark_ddm_verify(struct ark_ddm_t *ddm)
{
uint32_t hw_const;
+ uint32_t hw_ver;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
- hw_const = ddm->cfg.const0;
- if (hw_const == ARK_DDM_CONST3)
+ hw_const = ddm->cfg.idnum;
+ hw_ver = ddm->cfg.vernum;
+ if (hw_const == ARK_DDM_MODID && hw_ver == ARK_DDM_MODVER)
return 0;
- if (hw_const == ARK_DDM_CONST1) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 1, "
- "PMD expects version 2\n");
- return -1;
- }
-
- if (hw_const == ARK_DDM_CONST2) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 2, "
- "PMD expects version 3\n");
- return -1;
- }
ARK_PMD_LOG(ERR,
- "ARK: DDM module not found as expected 0x%08x\n",
- ddm->cfg.const0);
+ "ARK: DDM module not found as expected"
+ " id: %08x ver: %08x\n",
+ hw_const, hw_ver);
return -1;
}
void
-ark_ddm_start(struct ark_ddm_t *ddm)
-{
- ddm->cfg.command = 1;
-}
-
-int
-ark_ddm_stop(struct ark_ddm_t *ddm, const int wait)
+ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable)
{
- int cnt = 0;
-
- ddm->cfg.command = 2;
- rte_wmb();
- while (wait && (ddm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
+ ddm->setup.qcommand = enable ? 1U : 0U;
}
void
-ark_ddm_reset(struct ark_ddm_t *ddm)
-{
- int status;
-
- /* reset only works if ddm has stopped properly. */
- status = ark_ddm_stop(ddm, 1);
-
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- ddm->cfg.command = 4;
- usleep(10);
- }
- ddm->cfg.command = 3;
-}
-
-void
-ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr, uint32_t interval)
+ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr)
{
ddm->setup.cons_write_index_addr = cons_addr;
- ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
+ ddm->setup.cons_index = 0;
}
+/* Global stats clear */
void
ark_ddm_stats_reset(struct ark_ddm_t *ddm)
{
ddm->cfg.tlp_stats_clear = 1;
}
-void
-ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
- ark_ddm_is_stopped(ddm)
- );
-}
-
void
ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
{
@@ -116,12 +66,6 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
"MBufs", stats->tx_mbuf_count);
}
-int
-ark_ddm_is_stopped(struct ark_ddm_t *ddm)
-{
- return (ddm->cfg.stop_flushed & 0x01) != 0;
-}
-
uint64_t
ark_ddm_queue_byte_count(struct ark_ddm_t *ddm)
{
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index 687ff2519a..84beeb063a 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -40,17 +40,24 @@ union ark_tx_meta {
*/
#define ARK_DDM_CFG 0x0000
/* Set unique HW ID for hardware version */
-#define ARK_DDM_CONST3 (0x334d4444)
-#define ARK_DDM_CONST2 (0x324d4444)
-#define ARK_DDM_CONST1 (0xfacecafe)
+#define ARK_DDM_MODID 0x204d4444
+#define ARK_DDM_MODVER 0x37313232
struct ark_ddm_cfg_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ volatile uint32_t tlp_stats_clear;
+ };
uint32_t r0;
- volatile uint32_t tlp_stats_clear;
- uint32_t const0;
volatile uint32_t tag_max;
volatile uint32_t command;
- volatile uint32_t stop_flushed;
+ uint32_t write_index_interval; /* 4ns each */
+ volatile uint64_t qflow;
};
#define ARK_DDM_STATS 0x0020
@@ -60,34 +67,6 @@ struct ark_ddm_stats_t {
volatile uint64_t tx_mbuf_count;
};
-#define ARK_DDM_MRDQ 0x0040
-struct ark_ddm_mrdq_t {
- volatile uint32_t mrd_q1;
- volatile uint32_t mrd_q2;
- volatile uint32_t mrd_q3;
- volatile uint32_t mrd_q4;
- volatile uint32_t mrd_full;
-};
-
-#define ARK_DDM_CPLDQ 0x0068
-struct ark_ddm_cpldq_t {
- volatile uint32_t cpld_q1;
- volatile uint32_t cpld_q2;
- volatile uint32_t cpld_q3;
- volatile uint32_t cpld_q4;
- volatile uint32_t cpld_full;
-};
-
-#define ARK_DDM_MRD_PS 0x0090
-struct ark_ddm_mrd_ps_t {
- volatile uint32_t mrd_ps_min;
- volatile uint32_t mrd_ps_max;
- volatile uint32_t mrd_full_ps_min;
- volatile uint32_t mrd_full_ps_max;
- volatile uint32_t mrd_dw_ps_min;
- volatile uint32_t mrd_dw_ps_max;
-};
-
#define ARK_DDM_QUEUE_STATS 0x00a8
struct ark_ddm_qstats_t {
volatile uint64_t byte_count;
@@ -95,20 +74,10 @@ struct ark_ddm_qstats_t {
volatile uint64_t mbuf_count;
};
-#define ARK_DDM_CPLD_PS 0x00c0
-struct ark_ddm_cpld_ps_t {
- volatile uint32_t cpld_ps_min;
- volatile uint32_t cpld_ps_max;
- volatile uint32_t cpld_full_ps_min;
- volatile uint32_t cpld_full_ps_max;
- volatile uint32_t cpld_dw_ps_min;
- volatile uint32_t cpld_dw_ps_max;
-};
-
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
rte_iova_t cons_write_index_addr;
- uint32_t write_index_interval; /* 4ns each */
+ volatile uint32_t qcommand;
volatile uint32_t cons_index;
};
@@ -119,39 +88,28 @@ struct ark_ddm_t {
struct ark_ddm_cfg_t cfg;
uint8_t reserved0[(ARK_DDM_STATS - ARK_DDM_CFG) -
sizeof(struct ark_ddm_cfg_t)];
+
struct ark_ddm_stats_t stats;
- uint8_t reserved1[(ARK_DDM_MRDQ - ARK_DDM_STATS) -
+ uint8_t reserved1[(ARK_DDM_QUEUE_STATS - ARK_DDM_STATS) -
sizeof(struct ark_ddm_stats_t)];
- struct ark_ddm_mrdq_t mrdq;
- uint8_t reserved2[(ARK_DDM_CPLDQ - ARK_DDM_MRDQ) -
- sizeof(struct ark_ddm_mrdq_t)];
- struct ark_ddm_cpldq_t cpldq;
- uint8_t reserved3[(ARK_DDM_MRD_PS - ARK_DDM_CPLDQ) -
- sizeof(struct ark_ddm_cpldq_t)];
- struct ark_ddm_mrd_ps_t mrd_ps;
+
struct ark_ddm_qstats_t queue_stats;
- struct ark_ddm_cpld_ps_t cpld_ps;
- uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_CPLD_PS) -
- sizeof(struct ark_ddm_cpld_ps_t)];
+ uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_QUEUE_STATS) -
+ sizeof(struct ark_ddm_qstats_t)];
+
struct ark_ddm_setup_t setup;
uint8_t reserved_p[(ARK_DDM_EXPECTED_SIZE - ARK_DDM_SETUP) -
sizeof(struct ark_ddm_setup_t)];
};
-
/* DDM function prototype */
int ark_ddm_verify(struct ark_ddm_t *ddm);
-void ark_ddm_start(struct ark_ddm_t *ddm);
-int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
-void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
- uint32_t interval);
+void ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
-void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
-int ark_ddm_is_stopped(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_byte_count(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_pkt_count(struct ark_ddm_t *ddm);
void ark_ddm_queue_reset_stats(struct ark_ddm_t *ddm);
+void ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable);
#endif
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index c0578b85ce..07d1d2178d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -527,10 +527,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- /* TX -- DDM */
- if (ark_ddm_stop(ark->ddm.v, 1))
- ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
-
mpu = ark->mputx.v;
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
@@ -538,10 +534,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- ark_ddm_reset(ark->ddm.v);
- ark_ddm_stats_reset(ark->ddm.v);
-
- ark_ddm_stop(ark->ddm.v, 0);
if (ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
@@ -595,9 +587,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
for (i = 0; i < dev->data->nb_tx_queues; i++)
eth_ark_tx_queue_start(dev, i);
- /* start DDM */
- ark_ddm_start(ark->ddm.v);
-
ark->started = 1;
/* set xmit and receive function */
dev->rx_pkt_burst = ð_ark_recv_pkts;
@@ -671,28 +660,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* Stop DDM */
- /* Wait up to 0.1 second. each stop is up to 1000 * 10 useconds */
- for (i = 0; i < 10; i++) {
- status = ark_ddm_stop(ark->ddm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "DDM stop anomaly. status:"
- " %d iter: %u. (%s)\n",
- status,
- i,
- __func__);
- ark_ddm_dump(ark->ddm.v, "Stop anomaly");
-
- mpu = ark->mputx.v;
- for (i = 0; i < ark->tx_queues; i++) {
- ark_mpu_dump(mpu, "DDM failure dump", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
/* STOP RX Side */
/* Stop UDM multiple tries attempted */
for (i = 0; i < 10; i++) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index abdce6a8cc..5940a592a2 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -59,12 +59,6 @@ static int eth_ark_tx_jumbo(struct ark_tx_queue *queue,
static int eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue);
static void free_completed_tx(struct ark_tx_queue *queue);
-static inline void
-ark_tx_hw_queue_stop(struct ark_tx_queue *queue)
-{
- ark_mpu_stop(queue->mpu);
-}
-
/* ************************************************************************* */
static inline void
eth_ark_tx_desc_fill(struct ark_tx_queue *queue,
@@ -309,7 +303,6 @@ static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
rte_iova_t queue_base, ring_base, cons_index_addr;
- uint32_t write_interval_ns;
/* Verify HW -- MPU */
if (ark_mpu_verify(queue->mpu, sizeof(union ark_tx_meta)))
@@ -326,28 +319,9 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
/* Stop and Reset and configure MPU */
ark_mpu_configure(queue->mpu, ring_base, queue->queue_size, 1);
- /*
- * Adjust the write interval based on queue size --
- * increase pcie traffic when low mbuf count
- * Queue sizes less than 128 are not allowed
- */
- switch (queue->queue_size) {
- case 128:
- write_interval_ns = 500;
- break;
- case 256:
- write_interval_ns = 500;
- break;
- case 512:
- write_interval_ns = 1000;
- break;
- default:
- write_interval_ns = 2000;
- break;
- }
-
/* Completion address in UDM */
- ark_ddm_setup(queue->ddm, cons_index_addr, write_interval_ns);
+ ark_ddm_queue_setup(queue->ddm, cons_index_addr);
+ ark_ddm_queue_reset_stats(queue->ddm);
return 0;
}
@@ -360,7 +334,8 @@ eth_ark_tx_queue_release(void *vtx_queue)
queue = (struct ark_tx_queue *)vtx_queue;
- ark_tx_hw_queue_stop(queue);
+ ark_ddm_queue_enable(queue->ddm, 0);
+ ark_mpu_stop(queue->mpu);
queue->cons_index = queue->prod_index;
free_completed_tx(queue);
@@ -386,6 +361,7 @@ eth_ark_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id)
return -1;
}
+ ark_ddm_queue_enable(queue->ddm, 0);
ark_mpu_stop(queue->mpu);
free_completed_tx(queue);
@@ -404,6 +380,7 @@ eth_ark_tx_queue_start(struct rte_eth_dev *dev, uint16_t queue_id)
return 0;
ark_mpu_start(queue->mpu);
+ ark_ddm_queue_enable(queue->ddm, 1);
dev->data->tx_queue_state[queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 3/5] net/ark: update udm code to match current hardware version
2022-05-05 15:37 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-05 15:37 ` [PATCH v1 2/5] net/ark: update ddm " Ed Czeck
@ 2022-05-05 15:37 ` Ed Czeck
2022-05-05 15:37 ` [PATCH v1 4/5] net/ark: add new devices to support list Ed Czeck
2022-05-05 15:37 ` [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions Ed Czeck
3 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-05 15:37 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by hardware
remove performance structs as they are not in the hardware module
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 34 +----------
drivers/net/ark/ark_ethdev_rx.c | 38 +-----------
drivers/net/ark/ark_ethdev_rx.h | 1 -
drivers/net/ark/ark_udm.c | 103 +++-----------------------------
drivers/net/ark/ark_udm.h | 73 +++++-----------------
5 files changed, 27 insertions(+), 222 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 07d1d2178d..8b4daa819b 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -512,13 +512,6 @@ ark_config_device(struct rte_eth_dev *dev)
if (ark_ddm_verify(ark->ddm.v))
return -1;
- /* UDM */
- if (ark_udm_reset(ark->udm.v)) {
- ARK_PMD_LOG(ERR, "Unable to stop and reset UDM\n");
- return -1;
- }
- /* Keep in reset until the MPU are cleared */
-
/* MPU reset */
mpu = ark->mpurx.v;
num_q = ark_api_num_queues(mpu);
@@ -577,9 +570,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
int i;
/* RX Side */
- /* start UDM */
- ark_udm_start(ark->udm.v);
-
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_start_queue(dev, i);
@@ -627,7 +617,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
uint16_t i;
int status;
struct ark_adapter *ark = dev->data->dev_private;
- struct ark_mpu_t *mpu;
if (ark->started == 0)
return 0;
@@ -660,27 +649,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* STOP RX Side */
- /* Stop UDM multiple tries attempted */
- for (i = 0; i < 10; i++) {
- status = ark_udm_stop(ark->udm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
- status, i, __func__);
- ark_udm_dump(ark->udm.v, "Stop anomaly");
-
- mpu = ark->mpurx.v;
- for (i = 0; i < ark->rx_queues; i++) {
- ark_mpu_dump(mpu, "UDM Stop anomaly", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
ark_udm_dump_stats(ark->udm.v, "Post stop");
- ark_udm_dump_perf(ark->udm.v, "Post stop");
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_dump_queue(dev, i, __func__);
@@ -708,10 +677,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
eth_ark_dev_stop(dev);
- eth_ark_udm_force_close(dev);
/*
- * TODO This should only be called once for the device during shutdown
+ * This should only be called once for the device during shutdown
*/
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 85e34d0bb8..cbc0416bc2 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -200,13 +200,10 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
queue->mpu = RTE_PTR_ADD(ark->mpurx.v, qidx * ARK_MPU_QOFFSET);
/* Configure UDM per queue */
- ark_udm_stop(queue->udm, 0);
ark_udm_configure(queue->udm,
RTE_PKTMBUF_HEADROOM,
- queue->dataroom,
- ARK_RX_WRITE_TIME_NS);
- ark_udm_stats_reset(queue->udm);
- ark_udm_stop(queue->udm, 0);
+ queue->dataroom);
+ ark_udm_queue_stats_reset(queue->udm);
/* populate mbuf reserve */
status = eth_ark_rx_seed_mbufs(queue);
@@ -589,36 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
ark_udm_queue_stats_reset(queue->udm);
}
-void
-eth_ark_udm_force_close(struct rte_eth_dev *dev)
-{
- struct ark_adapter *ark = dev->data->dev_private;
- struct ark_rx_queue *queue;
- uint32_t index;
- uint16_t i;
-
- if (!ark_udm_is_flushed(ark->udm.v)) {
- /* restart the MPUs */
- ARK_PMD_LOG(NOTICE, "UDM not flushed -- forcing flush\n");
- for (i = 0; i < dev->data->nb_rx_queues; i++) {
- queue = (struct ark_rx_queue *)dev->data->rx_queues[i];
- if (queue == 0)
- continue;
-
- ark_mpu_start(queue->mpu);
- /* Add some buffers */
- index = ARK_RX_MPU_CHUNK + queue->seed_index;
- ark_mpu_set_producer(queue->mpu, index);
- }
- /* Wait to allow data to pass */
- usleep(100);
-
- ARK_PMD_LOG(NOTICE, "UDM forced flush attempt, stopped = %d\n",
- ark_udm_is_flushed(ark->udm.v));
- }
- ark_udm_reset(ark->udm.v);
-}
-
static void
ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
{
@@ -633,7 +600,6 @@ ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
ark_mpu_dump(queue->mpu, name, queue->phys_qid);
ark_mpu_dump_setup(queue->mpu, queue->phys_qid);
- ark_udm_dump(queue->udm, name);
ark_udm_dump_setup(queue->udm, queue->phys_qid);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index f64b3dd137..2e3400fd2f 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -27,6 +27,5 @@ void eth_rx_queue_stats_get(void *vqueue, struct rte_eth_stats *stats);
void eth_rx_queue_stats_reset(void *vqueue);
void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id,
const char *msg);
-void eth_ark_udm_force_close(struct rte_eth_dev *dev);
#endif
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 9ebed89627..81b141ad0b 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -12,6 +12,8 @@ static_assert(sizeof(struct ark_rx_meta) == 32, "Unexpected struct size ark_rx_m
int
ark_udm_verify(struct ark_udm_t *udm)
{
+ uint32_t idnum = udm->setup.idnum;
+ uint32_t vernum = udm->setup.vernum;
if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
ARK_PMD_LOG(ERR,
"ARK: UDM structure looks incorrect %d vs %zd\n",
@@ -19,94 +21,30 @@ ark_udm_verify(struct ark_udm_t *udm)
return -1;
}
- if (udm->setup.const0 != ARK_UDM_CONST) {
+ if (idnum != ARK_UDM_MODID || vernum != ARK_UDM_MODVER) {
ARK_PMD_LOG(ERR,
- "ARK: UDM module not found as expected 0x%08x\n",
- udm->setup.const0);
+ "ARK: UDM module not found as expected 0x%08x 0x%08x\n",
+ idnum, vernum);
return -1;
}
return 0;
}
-int
-ark_udm_stop(struct ark_udm_t *udm, const int wait)
-{
- int cnt = 0;
-
- udm->setup.r0 = 0;
- udm->cfg.command = 2;
- rte_wmb();
-
- while (wait && (udm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
-}
-
-int
-ark_udm_reset(struct ark_udm_t *udm)
-{
- int status;
-
- status = ark_udm_stop(udm, 1);
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- udm->cfg.command = 4;
- usleep(10);
- udm->cfg.command = 3;
- status = ark_udm_stop(udm, 0);
- ARK_PMD_LOG(INFO, "%s stop status %d post failure"
- " and forced reset\n",
- __func__, status);
- } else {
- udm->cfg.command = 3;
- }
-
- return status;
-}
-
-void
-ark_udm_start(struct ark_udm_t *udm)
-{
- udm->setup.r0 = 0x100;
- udm->cfg.command = 1;
-}
-
-void
-ark_udm_stats_reset(struct ark_udm_t *udm)
-{
- udm->pcibp.pci_clear = 1;
- udm->tlp_ps.tlp_clear = 1;
-}
-
void
ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns)
+ uint32_t dataroom)
{
/* headroom and data room are in DWords in the UDM */
udm->cfg.dataroom = dataroom / 4;
udm->cfg.headroom = headroom / 4;
-
- /* 4 NS period ns */
- udm->rt_cfg.write_interval = write_interval_ns / 4;
}
void
ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
-}
-
-int
-ark_udm_is_flushed(struct ark_udm_t *udm)
-{
- return (udm->cfg.stop_flushed & 0x01) != 0;
+ udm->rt_cfg.prod_idx = 0;
}
uint64_t
@@ -131,11 +69,10 @@ void
ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
{
ARK_PMD_LOG(INFO, "UDM Stats: %s"
- ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
+ ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
msg,
"Pkts Received", udm->stats.rx_packet_count,
"Pkts Finalized", udm->stats.rx_sent_packets,
- "Pkts Dropped", udm->tlp.pkt_drop,
"Bytes Count", udm->stats.rx_byte_count,
"MBuf Count", udm->stats.rx_mbuf_count);
}
@@ -155,13 +92,6 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
"MBuf Count", udm->qstats.q_mbuf_count);
}
-void
-ark_udm_dump(struct ark_udm_t *udm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
- udm->cfg.stop_flushed);
-}
-
void
ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
{
@@ -172,23 +102,6 @@ ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
"prod_idx", udm->rt_cfg.prod_idx);
}
-void
-ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
-{
- struct ark_udm_pcibp_t *bp = &udm->pcibp;
-
- ARK_PMD_LOG(INFO, "UDM Performance %s"
- ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
- "\n",
- msg,
- "PCI Empty", bp->pci_empty,
- "PCI Q1", bp->pci_q1,
- "PCI Q2", bp->pci_q2,
- "PCI Q3", bp->pci_q3,
- "PCI Q4", bp->pci_q4,
- "PCI Full", bp->pci_full);
-}
-
void
ark_udm_queue_stats_reset(struct ark_udm_t *udm)
{
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 1cbcd94a98..f0685c95c7 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -32,19 +32,25 @@ struct ark_rx_meta {
#define ARK_RX_WRITE_TIME_NS 2500
#define ARK_UDM_SETUP 0
-#define ARK_UDM_CONST2 0xbACECACE
-#define ARK_UDM_CONST3 0x344d4455
-#define ARK_UDM_CONST ARK_UDM_CONST3
+#define ARK_UDM_MODID 0x4d445500
+#define ARK_UDM_MODVER 0x37313232
+
struct ark_udm_setup_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ };
uint32_t r0;
- uint32_t r4;
- volatile uint32_t cycle_count;
uint32_t const0;
};
#define ARK_UDM_CFG 0x010
struct ark_udm_cfg_t {
- volatile uint32_t stop_flushed; /* RO */
+ uint32_t write_interval; /* 4ns cycles */
volatile uint32_t command;
uint32_t dataroom;
uint32_t headroom;
@@ -74,45 +80,11 @@ struct ark_udm_queue_stats_t {
uint32_t q_enable;
};
-#define ARK_UDM_TLP 0x0070
-struct ark_udm_tlp_t {
- volatile uint64_t pkt_drop; /* global */
- volatile uint32_t tlp_q1;
- volatile uint32_t tlp_q2;
- volatile uint32_t tlp_q3;
- volatile uint32_t tlp_q4;
- volatile uint32_t tlp_full;
-};
-
-#define ARK_UDM_PCIBP 0x00a0
-struct ark_udm_pcibp_t {
- volatile uint32_t pci_clear;
- volatile uint32_t pci_empty;
- volatile uint32_t pci_q1;
- volatile uint32_t pci_q2;
- volatile uint32_t pci_q3;
- volatile uint32_t pci_q4;
- volatile uint32_t pci_full;
-};
-
-#define ARK_UDM_TLP_PS 0x00bc
-struct ark_udm_tlp_ps_t {
- volatile uint32_t tlp_clear;
- volatile uint32_t tlp_ps_min;
- volatile uint32_t tlp_ps_max;
- volatile uint32_t tlp_full_ps_min;
- volatile uint32_t tlp_full_ps_max;
- volatile uint32_t tlp_dw_ps_min;
- volatile uint32_t tlp_dw_ps_max;
- volatile uint32_t tlp_pldw_ps_min;
- volatile uint32_t tlp_pldw_ps_max;
-};
-
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
rte_iova_t hw_prod_addr;
- uint32_t write_interval; /* 4ns cycles */
- volatile uint32_t prod_idx; /* RO */
+ uint32_t reserved;
+ volatile uint32_t prod_idx; /* Updated by HW */
};
/* Consolidated structure */
@@ -123,13 +95,8 @@ struct ark_udm_t {
struct ark_udm_cfg_t cfg;
struct ark_udm_stats_t stats;
struct ark_udm_queue_stats_t qstats;
- uint8_t reserved1[(ARK_UDM_TLP - ARK_UDM_PQ) -
+ uint8_t reserved1[(ARK_UDM_RT_CFG - ARK_UDM_PQ) -
sizeof(struct ark_udm_queue_stats_t)];
- struct ark_udm_tlp_t tlp;
- uint8_t reserved2[(ARK_UDM_PCIBP - ARK_UDM_TLP) -
- sizeof(struct ark_udm_tlp_t)];
- struct ark_udm_pcibp_t pcibp;
- struct ark_udm_tlp_ps_t tlp_ps;
struct ark_udm_rt_cfg_t rt_cfg;
int8_t reserved3[(ARK_UDM_EXPECT_SIZE - ARK_UDM_RT_CFG) -
sizeof(struct ark_udm_rt_cfg_t)];
@@ -137,22 +104,14 @@ struct ark_udm_t {
int ark_udm_verify(struct ark_udm_t *udm);
-int ark_udm_stop(struct ark_udm_t *udm, int wait);
-void ark_udm_start(struct ark_udm_t *udm);
-int ark_udm_reset(struct ark_udm_t *udm);
void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns);
+ uint32_t dataroom);
void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
-void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
uint16_t qid);
-void ark_udm_dump(struct ark_udm_t *udm, const char *msg);
-void ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
-int ark_udm_is_flushed(struct ark_udm_t *udm);
/* Per queue data */
uint64_t ark_udm_dropped(struct ark_udm_t *udm);
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 4/5] net/ark: add new devices to support list
2022-05-05 15:37 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-05 15:37 ` [PATCH v1 2/5] net/ark: update ddm " Ed Czeck
2022-05-05 15:37 ` [PATCH v1 3/5] net/ark: update udm " Ed Czeck
@ 2022-05-05 15:37 ` Ed Czeck
2022-05-05 15:37 ` [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions Ed Czeck
3 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-05 15:37 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
update device list is doc
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
doc/guides/nics/ark.rst | 4 +++-
drivers/net/ark/ark_ethdev.c | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index c965406a7b..cec6fce2ff 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -297,6 +297,9 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:1017`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Primary Endpoint]
* ``1d6c:1018`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Secondary Endpoint]
* ``1d6c:1019`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Tertiary Endpoint]
+* ``1d6c:101a`` - AR-ARK-SRIOV-FX0 [Arkville 32B Primary Physical Function]
+* ``1d6c:101b`` - AR-ARK-SRIOV-FX1 [Arkville 64B Primary Physical Function]
+* ``1d6c:101c`` - AR-ARK-SRIOV-VF [Arkville Virtual Function]
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
@@ -322,7 +325,6 @@ Unsupported Features
Features that may be part of, or become part of, the Arkville RTL IP that are
not currently supported or exposed by the ARK PMD include:
-* PCIe SR-IOV Virtual Functions (VFs)
* Arkville's Packet Generator Control and Status
* Arkville's Packet Director Control and Status
* Arkville's Packet Checker Control and Status
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 8b4daa819b..7cf896f6f1 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -94,6 +94,9 @@ static const struct rte_pci_id pci_id_ark_map[] = {
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101a)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101b)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
{.vendor_id = 0, /* sentinel */ },
@@ -127,6 +130,9 @@ ark_device_caps[] = {
SET_DEV_CAPS(0x1017, true),
SET_DEV_CAPS(0x1018, true),
SET_DEV_CAPS(0x1019, true),
+ SET_DEV_CAPS(0x101a, true),
+ SET_DEV_CAPS(0x101b, true),
+ SET_DEV_CAPS(0x101c, false),
SET_DEV_CAPS(0x101e, false),
SET_DEV_CAPS(0x101f, false),
{.device_id = 0,}
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions
2022-05-05 15:37 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
` (2 preceding siblings ...)
2022-05-05 15:37 ` [PATCH v1 4/5] net/ark: add new devices to support list Ed Czeck
@ 2022-05-05 15:37 ` Ed Czeck
3 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-05 15:37 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
Add capabilities field isvf to dev struct
Disable configuration calls as required by vf
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 79 ++++++++++++++++++++----------------
drivers/net/ark/ark_global.h | 1 +
2 files changed, 45 insertions(+), 35 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 7cf896f6f1..fde94ee431 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -113,28 +113,29 @@ static const struct rte_pci_id pci_id_ark_map[] = {
*/
struct ark_caps {
bool rqpacing;
+ bool isvf;
};
struct ark_dev_caps {
uint32_t device_id;
struct ark_caps caps;
};
-#define SET_DEV_CAPS(id, rqp) \
- {id, {.rqpacing = rqp} }
+#define SET_DEV_CAPS(id, rqp, vf) \
+ {id, {.rqpacing = rqp, .isvf = vf} }
static const struct ark_dev_caps
ark_device_caps[] = {
- SET_DEV_CAPS(0x100d, true),
- SET_DEV_CAPS(0x100e, true),
- SET_DEV_CAPS(0x100f, true),
- SET_DEV_CAPS(0x1010, false),
- SET_DEV_CAPS(0x1017, true),
- SET_DEV_CAPS(0x1018, true),
- SET_DEV_CAPS(0x1019, true),
- SET_DEV_CAPS(0x101a, true),
- SET_DEV_CAPS(0x101b, true),
- SET_DEV_CAPS(0x101c, false),
- SET_DEV_CAPS(0x101e, false),
- SET_DEV_CAPS(0x101f, false),
+ SET_DEV_CAPS(0x100d, true, false),
+ SET_DEV_CAPS(0x100e, true, false),
+ SET_DEV_CAPS(0x100f, true, false),
+ SET_DEV_CAPS(0x1010, false, false),
+ SET_DEV_CAPS(0x1017, true, false),
+ SET_DEV_CAPS(0x1018, true, false),
+ SET_DEV_CAPS(0x1019, true, false),
+ SET_DEV_CAPS(0x101a, true, false),
+ SET_DEV_CAPS(0x101b, true, false),
+ SET_DEV_CAPS(0x101c, false, true),
+ SET_DEV_CAPS(0x101e, false, false),
+ SET_DEV_CAPS(0x101f, false, false),
{.device_id = 0,}
};
@@ -317,6 +318,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
while (ark_device_caps[p].device_id != 0) {
if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
rqpacing = ark_device_caps[p].caps.rqpacing;
+ ark->isvf = ark_device_caps[p].caps.isvf;
break;
}
p++;
@@ -498,20 +500,21 @@ ark_config_device(struct rte_eth_dev *dev)
* Make sure that the packet director, generator and checker are in a
* known state
*/
- ark->start_pg = 0;
- ark->pg_running = 0;
- ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
- if (ark->pg == NULL)
- return -1;
- ark_pktgen_reset(ark->pg);
- ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
- if (ark->pc == NULL)
- return -1;
- ark_pktchkr_stop(ark->pc);
- ark->pd = ark_pktdir_init(ark->pktdir.v);
- if (ark->pd == NULL)
- return -1;
-
+ if (!ark->isvf) {
+ ark->start_pg = 0;
+ ark->pg_running = 0;
+ ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
+ if (ark->pg == NULL)
+ return -1;
+ ark_pktgen_reset(ark->pg);
+ ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
+ if (ark->pc == NULL)
+ return -1;
+ ark_pktchkr_stop(ark->pc);
+ ark->pd = ark_pktdir_init(ark->pktdir.v);
+ if (ark->pd == NULL)
+ return -1;
+ }
/* Verify HW */
if (ark_udm_verify(ark->udm.v))
return -1;
@@ -533,7 +536,7 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- if (ark->rqpacing)
+ if (!ark->isvf && ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
return 0;
@@ -551,8 +554,10 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev)
ark->user_ext.dev_uninit(dev,
ark->user_data[dev->data->port_id]);
- ark_pktgen_uninit(ark->pg);
- ark_pktchkr_uninit(ark->pc);
+ if (!ark->isvf) {
+ ark_pktgen_uninit(ark->pg);
+ ark_pktchkr_uninit(ark->pc);
+ }
return 0;
}
@@ -588,10 +593,10 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
dev->rx_pkt_burst = ð_ark_recv_pkts;
dev->tx_pkt_burst = ð_ark_xmit_pkts;
- if (ark->start_pg)
+ if (!ark->isvf && ark->start_pg)
ark_pktchkr_run(ark->pc);
- if (ark->start_pg && !ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && !ark->pg_running) {
pthread_t thread;
/* Delay packet generatpr start allow the hardware to be ready
@@ -635,7 +640,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
/* Stop the packet generator */
- if (ark->start_pg && ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && ark->pg_running) {
ark_pktgen_pause(ark->pg);
ark->pg_running = 0;
}
@@ -661,7 +666,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
eth_ark_rx_dump_queue(dev, i, __func__);
/* Stop the packet checker if it is running */
- if (ark->start_pg) {
+ if (!ark->isvf && ark->start_pg) {
ark_pktchkr_dump_stats(ark->pc);
ark_pktchkr_stop(ark->pc);
}
@@ -974,6 +979,10 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params)
goto free_kvlist;
}
+ if (ark->isvf) {
+ ret = 0;
+ goto free_kvlist;
+ }
ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
/* Setup the packet director */
ark_pktdir_setup(ark->pd, ark->pkt_dir_v);
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index 3c3a712bc8..748db590c1 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -113,6 +113,7 @@ struct ark_adapter {
ark_pkt_dir_t pd;
int num_ports;
+ bool isvf;
/* Packet generator/checker args */
char pkt_gen_args[ARK_MAX_ARG_LEN];
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 1/5] net/ark: update mpu code to match current hardware version
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
` (3 preceding siblings ...)
2022-05-05 15:37 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
@ 2022-05-06 21:27 ` Ed Czeck
2022-05-06 21:27 ` [PATCH v1 2/5] net/ark: update ddm " Ed Czeck
` (4 more replies)
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (3 subsequent siblings)
8 siblings, 5 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-06 21:27 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level global operations
remove ark_mpu_reset_stats function
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 2 --
drivers/net/ark/ark_ethdev_rx.c | 4 ----
drivers/net/ark/ark_mpu.c | 21 ++++-----------------
drivers/net/ark/ark_mpu.h | 29 ++---------------------------
4 files changed, 6 insertions(+), 50 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 76b88c62d0..c0578b85ce 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -524,7 +524,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->rx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
@@ -536,7 +535,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 0fbb2603db..85e34d0bb8 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -91,9 +91,6 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
ark_udm_write_addr(queue->udm, phys_addr_prod_index);
- /* advance the valid pointer, but don't start until the queue starts */
- ark_mpu_reset_stats(queue->mpu);
-
/* The seed is the producer index for the HW */
ark_mpu_set_producer(queue->mpu, queue->seed_index);
dev->data->rx_queue_state[rx_queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
@@ -589,7 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
if (queue == 0)
return;
- ark_mpu_reset_stats(queue->mpu);
ark_udm_queue_stats_reset(queue->udm);
}
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index b8e94b6ed3..9d5ee7841b 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
{
uint32_t version;
- version = mpu->id.vernum & 0x0000fF00;
- if ((mpu->id.idnum != 0x2055504d) ||
- (mpu->hw.obj_size != obj_size) ||
- (version != 0x00003100)) {
+ version = mpu->id.vernum;
+ if (mpu->id.idnum != ARK_MPU_MODID ||
+ version != ARK_MPU_MODVER ||
+ mpu->hw.obj_size != obj_size) {
ARK_PMD_LOG(ERR,
" MPU module not found as expected %08x"
" \"%c%c%c%c %c%c%c%c\"\n",
@@ -79,16 +79,9 @@ ark_mpu_reset(struct ark_mpu_t *mpu)
mpu->cfg.command = MPU_CMD_FORCE_RESET;
usleep(10);
}
- ark_mpu_reset_stats(mpu);
return mpu->cfg.command != MPU_CMD_IDLE;
}
-void
-ark_mpu_reset_stats(struct ark_mpu_t *mpu)
-{
- mpu->stats.pci_request = 1; /* reset stats */
-}
-
int
ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
int is_tx)
@@ -118,12 +111,6 @@ ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
code, qid,
mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
- ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
- "\n",
- code,
- mpu->debug.state, mpu->debug.count,
- mpu->debug.reserved
- );
}
void
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index 92c3e67c86..9d2b70d35f 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -15,6 +15,8 @@
* there is minimal documentation.
*/
+#define ARK_MPU_MODID 0x2055504d
+#define ARK_MPU_MODVER 0x37313232
/*
* MPU hardware structures
* These are overlay structures to a memory mapped FPGA device. These
@@ -64,26 +66,6 @@ enum ARK_MPU_COMMAND {
MPU_COMMAND_LIMIT = 0xfFFFFFFF
};
-#define ARK_MPU_STATS 0x080
-struct ark_mpu_stats_t {
- volatile uint64_t pci_request;
- volatile uint64_t q_empty;
- volatile uint64_t q_q1;
- volatile uint64_t q_q2;
- volatile uint64_t q_q3;
- volatile uint64_t q_q4;
- volatile uint64_t q_full;
-};
-
-#define ARK_MPU_DEBUG 0x0C0
-struct ark_mpu_debug_t {
- volatile uint32_t state;
- uint32_t reserved;
- volatile uint32_t count;
- volatile uint32_t take;
- volatile uint32_t peek[4];
-};
-
/* Consolidated structure */
struct ark_mpu_t {
struct ark_mpu_id_t id;
@@ -93,12 +75,6 @@ struct ark_mpu_t {
uint8_t reserved1[(ARK_MPU_CFG - ARK_MPU_HW) -
sizeof(struct ark_mpu_hw_t)];
struct ark_mpu_cfg_t cfg;
- uint8_t reserved2[(ARK_MPU_STATS - ARK_MPU_CFG) -
- sizeof(struct ark_mpu_cfg_t)];
- struct ark_mpu_stats_t stats;
- uint8_t reserved3[(ARK_MPU_DEBUG - ARK_MPU_STATS) -
- sizeof(struct ark_mpu_stats_t)];
- struct ark_mpu_debug_t debug;
};
uint16_t ark_api_num_queues(struct ark_mpu_t *mpu);
@@ -113,7 +89,6 @@ int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);
-void ark_mpu_reset_stats(struct ark_mpu_t *mpu);
/* this action is in a performance critical path */
static inline void
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 2/5] net/ark: update ddm code to match current hardware version
2022-05-06 21:27 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
@ 2022-05-06 21:27 ` Ed Czeck
2022-05-06 21:27 ` [PATCH v1 3/5] net/ark: update udm " Ed Czeck
` (3 subsequent siblings)
4 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-06 21:27 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by hardware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ddm.c | 80 +++++-------------------------
drivers/net/ark/ark_ddm.h | 86 +++++++++------------------------
drivers/net/ark/ark_ethdev.c | 33 -------------
drivers/net/ark/ark_ethdev_tx.c | 35 +++-----------
4 files changed, 40 insertions(+), 194 deletions(-)
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index b16c739d50..eb88349b7b 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -14,95 +14,45 @@ int
ark_ddm_verify(struct ark_ddm_t *ddm)
{
uint32_t hw_const;
+ uint32_t hw_ver;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
- hw_const = ddm->cfg.const0;
- if (hw_const == ARK_DDM_CONST3)
+ hw_const = ddm->cfg.idnum;
+ hw_ver = ddm->cfg.vernum;
+ if (hw_const == ARK_DDM_MODID && hw_ver == ARK_DDM_MODVER)
return 0;
- if (hw_const == ARK_DDM_CONST1) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 1, "
- "PMD expects version 2\n");
- return -1;
- }
-
- if (hw_const == ARK_DDM_CONST2) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 2, "
- "PMD expects version 3\n");
- return -1;
- }
ARK_PMD_LOG(ERR,
- "ARK: DDM module not found as expected 0x%08x\n",
- ddm->cfg.const0);
+ "ARK: DDM module not found as expected"
+ " id: %08x ver: %08x\n",
+ hw_const, hw_ver);
return -1;
}
void
-ark_ddm_start(struct ark_ddm_t *ddm)
-{
- ddm->cfg.command = 1;
-}
-
-int
-ark_ddm_stop(struct ark_ddm_t *ddm, const int wait)
+ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable)
{
- int cnt = 0;
-
- ddm->cfg.command = 2;
- rte_wmb();
- while (wait && (ddm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
+ ddm->setup.qcommand = enable ? 1U : 0U;
}
void
-ark_ddm_reset(struct ark_ddm_t *ddm)
-{
- int status;
-
- /* reset only works if ddm has stopped properly. */
- status = ark_ddm_stop(ddm, 1);
-
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- ddm->cfg.command = 4;
- usleep(10);
- }
- ddm->cfg.command = 3;
-}
-
-void
-ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr, uint32_t interval)
+ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr)
{
ddm->setup.cons_write_index_addr = cons_addr;
- ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
+ ddm->setup.cons_index = 0;
}
+/* Global stats clear */
void
ark_ddm_stats_reset(struct ark_ddm_t *ddm)
{
ddm->cfg.tlp_stats_clear = 1;
}
-void
-ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
- ark_ddm_is_stopped(ddm)
- );
-}
-
void
ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
{
@@ -116,12 +66,6 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
"MBufs", stats->tx_mbuf_count);
}
-int
-ark_ddm_is_stopped(struct ark_ddm_t *ddm)
-{
- return (ddm->cfg.stop_flushed & 0x01) != 0;
-}
-
uint64_t
ark_ddm_queue_byte_count(struct ark_ddm_t *ddm)
{
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index 687ff2519a..84beeb063a 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -40,17 +40,24 @@ union ark_tx_meta {
*/
#define ARK_DDM_CFG 0x0000
/* Set unique HW ID for hardware version */
-#define ARK_DDM_CONST3 (0x334d4444)
-#define ARK_DDM_CONST2 (0x324d4444)
-#define ARK_DDM_CONST1 (0xfacecafe)
+#define ARK_DDM_MODID 0x204d4444
+#define ARK_DDM_MODVER 0x37313232
struct ark_ddm_cfg_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ volatile uint32_t tlp_stats_clear;
+ };
uint32_t r0;
- volatile uint32_t tlp_stats_clear;
- uint32_t const0;
volatile uint32_t tag_max;
volatile uint32_t command;
- volatile uint32_t stop_flushed;
+ uint32_t write_index_interval; /* 4ns each */
+ volatile uint64_t qflow;
};
#define ARK_DDM_STATS 0x0020
@@ -60,34 +67,6 @@ struct ark_ddm_stats_t {
volatile uint64_t tx_mbuf_count;
};
-#define ARK_DDM_MRDQ 0x0040
-struct ark_ddm_mrdq_t {
- volatile uint32_t mrd_q1;
- volatile uint32_t mrd_q2;
- volatile uint32_t mrd_q3;
- volatile uint32_t mrd_q4;
- volatile uint32_t mrd_full;
-};
-
-#define ARK_DDM_CPLDQ 0x0068
-struct ark_ddm_cpldq_t {
- volatile uint32_t cpld_q1;
- volatile uint32_t cpld_q2;
- volatile uint32_t cpld_q3;
- volatile uint32_t cpld_q4;
- volatile uint32_t cpld_full;
-};
-
-#define ARK_DDM_MRD_PS 0x0090
-struct ark_ddm_mrd_ps_t {
- volatile uint32_t mrd_ps_min;
- volatile uint32_t mrd_ps_max;
- volatile uint32_t mrd_full_ps_min;
- volatile uint32_t mrd_full_ps_max;
- volatile uint32_t mrd_dw_ps_min;
- volatile uint32_t mrd_dw_ps_max;
-};
-
#define ARK_DDM_QUEUE_STATS 0x00a8
struct ark_ddm_qstats_t {
volatile uint64_t byte_count;
@@ -95,20 +74,10 @@ struct ark_ddm_qstats_t {
volatile uint64_t mbuf_count;
};
-#define ARK_DDM_CPLD_PS 0x00c0
-struct ark_ddm_cpld_ps_t {
- volatile uint32_t cpld_ps_min;
- volatile uint32_t cpld_ps_max;
- volatile uint32_t cpld_full_ps_min;
- volatile uint32_t cpld_full_ps_max;
- volatile uint32_t cpld_dw_ps_min;
- volatile uint32_t cpld_dw_ps_max;
-};
-
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
rte_iova_t cons_write_index_addr;
- uint32_t write_index_interval; /* 4ns each */
+ volatile uint32_t qcommand;
volatile uint32_t cons_index;
};
@@ -119,39 +88,28 @@ struct ark_ddm_t {
struct ark_ddm_cfg_t cfg;
uint8_t reserved0[(ARK_DDM_STATS - ARK_DDM_CFG) -
sizeof(struct ark_ddm_cfg_t)];
+
struct ark_ddm_stats_t stats;
- uint8_t reserved1[(ARK_DDM_MRDQ - ARK_DDM_STATS) -
+ uint8_t reserved1[(ARK_DDM_QUEUE_STATS - ARK_DDM_STATS) -
sizeof(struct ark_ddm_stats_t)];
- struct ark_ddm_mrdq_t mrdq;
- uint8_t reserved2[(ARK_DDM_CPLDQ - ARK_DDM_MRDQ) -
- sizeof(struct ark_ddm_mrdq_t)];
- struct ark_ddm_cpldq_t cpldq;
- uint8_t reserved3[(ARK_DDM_MRD_PS - ARK_DDM_CPLDQ) -
- sizeof(struct ark_ddm_cpldq_t)];
- struct ark_ddm_mrd_ps_t mrd_ps;
+
struct ark_ddm_qstats_t queue_stats;
- struct ark_ddm_cpld_ps_t cpld_ps;
- uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_CPLD_PS) -
- sizeof(struct ark_ddm_cpld_ps_t)];
+ uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_QUEUE_STATS) -
+ sizeof(struct ark_ddm_qstats_t)];
+
struct ark_ddm_setup_t setup;
uint8_t reserved_p[(ARK_DDM_EXPECTED_SIZE - ARK_DDM_SETUP) -
sizeof(struct ark_ddm_setup_t)];
};
-
/* DDM function prototype */
int ark_ddm_verify(struct ark_ddm_t *ddm);
-void ark_ddm_start(struct ark_ddm_t *ddm);
-int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
-void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
- uint32_t interval);
+void ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
-void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
-int ark_ddm_is_stopped(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_byte_count(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_pkt_count(struct ark_ddm_t *ddm);
void ark_ddm_queue_reset_stats(struct ark_ddm_t *ddm);
+void ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable);
#endif
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index c0578b85ce..07d1d2178d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -527,10 +527,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- /* TX -- DDM */
- if (ark_ddm_stop(ark->ddm.v, 1))
- ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
-
mpu = ark->mputx.v;
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
@@ -538,10 +534,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- ark_ddm_reset(ark->ddm.v);
- ark_ddm_stats_reset(ark->ddm.v);
-
- ark_ddm_stop(ark->ddm.v, 0);
if (ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
@@ -595,9 +587,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
for (i = 0; i < dev->data->nb_tx_queues; i++)
eth_ark_tx_queue_start(dev, i);
- /* start DDM */
- ark_ddm_start(ark->ddm.v);
-
ark->started = 1;
/* set xmit and receive function */
dev->rx_pkt_burst = ð_ark_recv_pkts;
@@ -671,28 +660,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* Stop DDM */
- /* Wait up to 0.1 second. each stop is up to 1000 * 10 useconds */
- for (i = 0; i < 10; i++) {
- status = ark_ddm_stop(ark->ddm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "DDM stop anomaly. status:"
- " %d iter: %u. (%s)\n",
- status,
- i,
- __func__);
- ark_ddm_dump(ark->ddm.v, "Stop anomaly");
-
- mpu = ark->mputx.v;
- for (i = 0; i < ark->tx_queues; i++) {
- ark_mpu_dump(mpu, "DDM failure dump", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
/* STOP RX Side */
/* Stop UDM multiple tries attempted */
for (i = 0; i < 10; i++) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index abdce6a8cc..5940a592a2 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -59,12 +59,6 @@ static int eth_ark_tx_jumbo(struct ark_tx_queue *queue,
static int eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue);
static void free_completed_tx(struct ark_tx_queue *queue);
-static inline void
-ark_tx_hw_queue_stop(struct ark_tx_queue *queue)
-{
- ark_mpu_stop(queue->mpu);
-}
-
/* ************************************************************************* */
static inline void
eth_ark_tx_desc_fill(struct ark_tx_queue *queue,
@@ -309,7 +303,6 @@ static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
rte_iova_t queue_base, ring_base, cons_index_addr;
- uint32_t write_interval_ns;
/* Verify HW -- MPU */
if (ark_mpu_verify(queue->mpu, sizeof(union ark_tx_meta)))
@@ -326,28 +319,9 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
/* Stop and Reset and configure MPU */
ark_mpu_configure(queue->mpu, ring_base, queue->queue_size, 1);
- /*
- * Adjust the write interval based on queue size --
- * increase pcie traffic when low mbuf count
- * Queue sizes less than 128 are not allowed
- */
- switch (queue->queue_size) {
- case 128:
- write_interval_ns = 500;
- break;
- case 256:
- write_interval_ns = 500;
- break;
- case 512:
- write_interval_ns = 1000;
- break;
- default:
- write_interval_ns = 2000;
- break;
- }
-
/* Completion address in UDM */
- ark_ddm_setup(queue->ddm, cons_index_addr, write_interval_ns);
+ ark_ddm_queue_setup(queue->ddm, cons_index_addr);
+ ark_ddm_queue_reset_stats(queue->ddm);
return 0;
}
@@ -360,7 +334,8 @@ eth_ark_tx_queue_release(void *vtx_queue)
queue = (struct ark_tx_queue *)vtx_queue;
- ark_tx_hw_queue_stop(queue);
+ ark_ddm_queue_enable(queue->ddm, 0);
+ ark_mpu_stop(queue->mpu);
queue->cons_index = queue->prod_index;
free_completed_tx(queue);
@@ -386,6 +361,7 @@ eth_ark_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id)
return -1;
}
+ ark_ddm_queue_enable(queue->ddm, 0);
ark_mpu_stop(queue->mpu);
free_completed_tx(queue);
@@ -404,6 +380,7 @@ eth_ark_tx_queue_start(struct rte_eth_dev *dev, uint16_t queue_id)
return 0;
ark_mpu_start(queue->mpu);
+ ark_ddm_queue_enable(queue->ddm, 1);
dev->data->tx_queue_state[queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 3/5] net/ark: update udm code to match current hardware version
2022-05-06 21:27 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-06 21:27 ` [PATCH v1 2/5] net/ark: update ddm " Ed Czeck
@ 2022-05-06 21:27 ` Ed Czeck
2022-05-06 21:27 ` [PATCH v1 4/5] net/ark: add new devices to support list Ed Czeck
` (2 subsequent siblings)
4 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-06 21:27 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
new version code
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by hardware
remove performance structs as they are not in the hardware module
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 34 +----------
drivers/net/ark/ark_ethdev_rx.c | 38 +-----------
drivers/net/ark/ark_ethdev_rx.h | 1 -
drivers/net/ark/ark_udm.c | 103 +++-----------------------------
drivers/net/ark/ark_udm.h | 73 +++++-----------------
5 files changed, 27 insertions(+), 222 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 07d1d2178d..8b4daa819b 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -512,13 +512,6 @@ ark_config_device(struct rte_eth_dev *dev)
if (ark_ddm_verify(ark->ddm.v))
return -1;
- /* UDM */
- if (ark_udm_reset(ark->udm.v)) {
- ARK_PMD_LOG(ERR, "Unable to stop and reset UDM\n");
- return -1;
- }
- /* Keep in reset until the MPU are cleared */
-
/* MPU reset */
mpu = ark->mpurx.v;
num_q = ark_api_num_queues(mpu);
@@ -577,9 +570,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
int i;
/* RX Side */
- /* start UDM */
- ark_udm_start(ark->udm.v);
-
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_start_queue(dev, i);
@@ -627,7 +617,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
uint16_t i;
int status;
struct ark_adapter *ark = dev->data->dev_private;
- struct ark_mpu_t *mpu;
if (ark->started == 0)
return 0;
@@ -660,27 +649,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* STOP RX Side */
- /* Stop UDM multiple tries attempted */
- for (i = 0; i < 10; i++) {
- status = ark_udm_stop(ark->udm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
- status, i, __func__);
- ark_udm_dump(ark->udm.v, "Stop anomaly");
-
- mpu = ark->mpurx.v;
- for (i = 0; i < ark->rx_queues; i++) {
- ark_mpu_dump(mpu, "UDM Stop anomaly", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
ark_udm_dump_stats(ark->udm.v, "Post stop");
- ark_udm_dump_perf(ark->udm.v, "Post stop");
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_dump_queue(dev, i, __func__);
@@ -708,10 +677,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
eth_ark_dev_stop(dev);
- eth_ark_udm_force_close(dev);
/*
- * TODO This should only be called once for the device during shutdown
+ * This should only be called once for the device during shutdown
*/
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 85e34d0bb8..cbc0416bc2 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -200,13 +200,10 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
queue->mpu = RTE_PTR_ADD(ark->mpurx.v, qidx * ARK_MPU_QOFFSET);
/* Configure UDM per queue */
- ark_udm_stop(queue->udm, 0);
ark_udm_configure(queue->udm,
RTE_PKTMBUF_HEADROOM,
- queue->dataroom,
- ARK_RX_WRITE_TIME_NS);
- ark_udm_stats_reset(queue->udm);
- ark_udm_stop(queue->udm, 0);
+ queue->dataroom);
+ ark_udm_queue_stats_reset(queue->udm);
/* populate mbuf reserve */
status = eth_ark_rx_seed_mbufs(queue);
@@ -589,36 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
ark_udm_queue_stats_reset(queue->udm);
}
-void
-eth_ark_udm_force_close(struct rte_eth_dev *dev)
-{
- struct ark_adapter *ark = dev->data->dev_private;
- struct ark_rx_queue *queue;
- uint32_t index;
- uint16_t i;
-
- if (!ark_udm_is_flushed(ark->udm.v)) {
- /* restart the MPUs */
- ARK_PMD_LOG(NOTICE, "UDM not flushed -- forcing flush\n");
- for (i = 0; i < dev->data->nb_rx_queues; i++) {
- queue = (struct ark_rx_queue *)dev->data->rx_queues[i];
- if (queue == 0)
- continue;
-
- ark_mpu_start(queue->mpu);
- /* Add some buffers */
- index = ARK_RX_MPU_CHUNK + queue->seed_index;
- ark_mpu_set_producer(queue->mpu, index);
- }
- /* Wait to allow data to pass */
- usleep(100);
-
- ARK_PMD_LOG(NOTICE, "UDM forced flush attempt, stopped = %d\n",
- ark_udm_is_flushed(ark->udm.v));
- }
- ark_udm_reset(ark->udm.v);
-}
-
static void
ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
{
@@ -633,7 +600,6 @@ ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
ark_mpu_dump(queue->mpu, name, queue->phys_qid);
ark_mpu_dump_setup(queue->mpu, queue->phys_qid);
- ark_udm_dump(queue->udm, name);
ark_udm_dump_setup(queue->udm, queue->phys_qid);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index f64b3dd137..2e3400fd2f 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -27,6 +27,5 @@ void eth_rx_queue_stats_get(void *vqueue, struct rte_eth_stats *stats);
void eth_rx_queue_stats_reset(void *vqueue);
void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id,
const char *msg);
-void eth_ark_udm_force_close(struct rte_eth_dev *dev);
#endif
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 9ebed89627..81b141ad0b 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -12,6 +12,8 @@ static_assert(sizeof(struct ark_rx_meta) == 32, "Unexpected struct size ark_rx_m
int
ark_udm_verify(struct ark_udm_t *udm)
{
+ uint32_t idnum = udm->setup.idnum;
+ uint32_t vernum = udm->setup.vernum;
if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
ARK_PMD_LOG(ERR,
"ARK: UDM structure looks incorrect %d vs %zd\n",
@@ -19,94 +21,30 @@ ark_udm_verify(struct ark_udm_t *udm)
return -1;
}
- if (udm->setup.const0 != ARK_UDM_CONST) {
+ if (idnum != ARK_UDM_MODID || vernum != ARK_UDM_MODVER) {
ARK_PMD_LOG(ERR,
- "ARK: UDM module not found as expected 0x%08x\n",
- udm->setup.const0);
+ "ARK: UDM module not found as expected 0x%08x 0x%08x\n",
+ idnum, vernum);
return -1;
}
return 0;
}
-int
-ark_udm_stop(struct ark_udm_t *udm, const int wait)
-{
- int cnt = 0;
-
- udm->setup.r0 = 0;
- udm->cfg.command = 2;
- rte_wmb();
-
- while (wait && (udm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
-}
-
-int
-ark_udm_reset(struct ark_udm_t *udm)
-{
- int status;
-
- status = ark_udm_stop(udm, 1);
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- udm->cfg.command = 4;
- usleep(10);
- udm->cfg.command = 3;
- status = ark_udm_stop(udm, 0);
- ARK_PMD_LOG(INFO, "%s stop status %d post failure"
- " and forced reset\n",
- __func__, status);
- } else {
- udm->cfg.command = 3;
- }
-
- return status;
-}
-
-void
-ark_udm_start(struct ark_udm_t *udm)
-{
- udm->setup.r0 = 0x100;
- udm->cfg.command = 1;
-}
-
-void
-ark_udm_stats_reset(struct ark_udm_t *udm)
-{
- udm->pcibp.pci_clear = 1;
- udm->tlp_ps.tlp_clear = 1;
-}
-
void
ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns)
+ uint32_t dataroom)
{
/* headroom and data room are in DWords in the UDM */
udm->cfg.dataroom = dataroom / 4;
udm->cfg.headroom = headroom / 4;
-
- /* 4 NS period ns */
- udm->rt_cfg.write_interval = write_interval_ns / 4;
}
void
ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
-}
-
-int
-ark_udm_is_flushed(struct ark_udm_t *udm)
-{
- return (udm->cfg.stop_flushed & 0x01) != 0;
+ udm->rt_cfg.prod_idx = 0;
}
uint64_t
@@ -131,11 +69,10 @@ void
ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
{
ARK_PMD_LOG(INFO, "UDM Stats: %s"
- ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
+ ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
msg,
"Pkts Received", udm->stats.rx_packet_count,
"Pkts Finalized", udm->stats.rx_sent_packets,
- "Pkts Dropped", udm->tlp.pkt_drop,
"Bytes Count", udm->stats.rx_byte_count,
"MBuf Count", udm->stats.rx_mbuf_count);
}
@@ -155,13 +92,6 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
"MBuf Count", udm->qstats.q_mbuf_count);
}
-void
-ark_udm_dump(struct ark_udm_t *udm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
- udm->cfg.stop_flushed);
-}
-
void
ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
{
@@ -172,23 +102,6 @@ ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
"prod_idx", udm->rt_cfg.prod_idx);
}
-void
-ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
-{
- struct ark_udm_pcibp_t *bp = &udm->pcibp;
-
- ARK_PMD_LOG(INFO, "UDM Performance %s"
- ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
- "\n",
- msg,
- "PCI Empty", bp->pci_empty,
- "PCI Q1", bp->pci_q1,
- "PCI Q2", bp->pci_q2,
- "PCI Q3", bp->pci_q3,
- "PCI Q4", bp->pci_q4,
- "PCI Full", bp->pci_full);
-}
-
void
ark_udm_queue_stats_reset(struct ark_udm_t *udm)
{
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 1cbcd94a98..f0685c95c7 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -32,19 +32,25 @@ struct ark_rx_meta {
#define ARK_RX_WRITE_TIME_NS 2500
#define ARK_UDM_SETUP 0
-#define ARK_UDM_CONST2 0xbACECACE
-#define ARK_UDM_CONST3 0x344d4455
-#define ARK_UDM_CONST ARK_UDM_CONST3
+#define ARK_UDM_MODID 0x4d445500
+#define ARK_UDM_MODVER 0x37313232
+
struct ark_udm_setup_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ };
uint32_t r0;
- uint32_t r4;
- volatile uint32_t cycle_count;
uint32_t const0;
};
#define ARK_UDM_CFG 0x010
struct ark_udm_cfg_t {
- volatile uint32_t stop_flushed; /* RO */
+ uint32_t write_interval; /* 4ns cycles */
volatile uint32_t command;
uint32_t dataroom;
uint32_t headroom;
@@ -74,45 +80,11 @@ struct ark_udm_queue_stats_t {
uint32_t q_enable;
};
-#define ARK_UDM_TLP 0x0070
-struct ark_udm_tlp_t {
- volatile uint64_t pkt_drop; /* global */
- volatile uint32_t tlp_q1;
- volatile uint32_t tlp_q2;
- volatile uint32_t tlp_q3;
- volatile uint32_t tlp_q4;
- volatile uint32_t tlp_full;
-};
-
-#define ARK_UDM_PCIBP 0x00a0
-struct ark_udm_pcibp_t {
- volatile uint32_t pci_clear;
- volatile uint32_t pci_empty;
- volatile uint32_t pci_q1;
- volatile uint32_t pci_q2;
- volatile uint32_t pci_q3;
- volatile uint32_t pci_q4;
- volatile uint32_t pci_full;
-};
-
-#define ARK_UDM_TLP_PS 0x00bc
-struct ark_udm_tlp_ps_t {
- volatile uint32_t tlp_clear;
- volatile uint32_t tlp_ps_min;
- volatile uint32_t tlp_ps_max;
- volatile uint32_t tlp_full_ps_min;
- volatile uint32_t tlp_full_ps_max;
- volatile uint32_t tlp_dw_ps_min;
- volatile uint32_t tlp_dw_ps_max;
- volatile uint32_t tlp_pldw_ps_min;
- volatile uint32_t tlp_pldw_ps_max;
-};
-
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
rte_iova_t hw_prod_addr;
- uint32_t write_interval; /* 4ns cycles */
- volatile uint32_t prod_idx; /* RO */
+ uint32_t reserved;
+ volatile uint32_t prod_idx; /* Updated by HW */
};
/* Consolidated structure */
@@ -123,13 +95,8 @@ struct ark_udm_t {
struct ark_udm_cfg_t cfg;
struct ark_udm_stats_t stats;
struct ark_udm_queue_stats_t qstats;
- uint8_t reserved1[(ARK_UDM_TLP - ARK_UDM_PQ) -
+ uint8_t reserved1[(ARK_UDM_RT_CFG - ARK_UDM_PQ) -
sizeof(struct ark_udm_queue_stats_t)];
- struct ark_udm_tlp_t tlp;
- uint8_t reserved2[(ARK_UDM_PCIBP - ARK_UDM_TLP) -
- sizeof(struct ark_udm_tlp_t)];
- struct ark_udm_pcibp_t pcibp;
- struct ark_udm_tlp_ps_t tlp_ps;
struct ark_udm_rt_cfg_t rt_cfg;
int8_t reserved3[(ARK_UDM_EXPECT_SIZE - ARK_UDM_RT_CFG) -
sizeof(struct ark_udm_rt_cfg_t)];
@@ -137,22 +104,14 @@ struct ark_udm_t {
int ark_udm_verify(struct ark_udm_t *udm);
-int ark_udm_stop(struct ark_udm_t *udm, int wait);
-void ark_udm_start(struct ark_udm_t *udm);
-int ark_udm_reset(struct ark_udm_t *udm);
void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns);
+ uint32_t dataroom);
void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
-void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
uint16_t qid);
-void ark_udm_dump(struct ark_udm_t *udm, const char *msg);
-void ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
-int ark_udm_is_flushed(struct ark_udm_t *udm);
/* Per queue data */
uint64_t ark_udm_dropped(struct ark_udm_t *udm);
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 4/5] net/ark: add new devices to support list
2022-05-06 21:27 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-06 21:27 ` [PATCH v1 2/5] net/ark: update ddm " Ed Czeck
2022-05-06 21:27 ` [PATCH v1 3/5] net/ark: update udm " Ed Czeck
@ 2022-05-06 21:27 ` Ed Czeck
2022-05-06 21:27 ` [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions Ed Czeck
2022-05-18 12:54 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ferruh Yigit
4 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-06 21:27 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
update device list is doc
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
doc/guides/nics/ark.rst | 4 +++-
drivers/net/ark/ark_ethdev.c | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index c965406a7b..cec6fce2ff 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -297,6 +297,9 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:1017`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Primary Endpoint]
* ``1d6c:1018`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Secondary Endpoint]
* ``1d6c:1019`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Tertiary Endpoint]
+* ``1d6c:101a`` - AR-ARK-SRIOV-FX0 [Arkville 32B Primary Physical Function]
+* ``1d6c:101b`` - AR-ARK-SRIOV-FX1 [Arkville 64B Primary Physical Function]
+* ``1d6c:101c`` - AR-ARK-SRIOV-VF [Arkville Virtual Function]
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
@@ -322,7 +325,6 @@ Unsupported Features
Features that may be part of, or become part of, the Arkville RTL IP that are
not currently supported or exposed by the ARK PMD include:
-* PCIe SR-IOV Virtual Functions (VFs)
* Arkville's Packet Generator Control and Status
* Arkville's Packet Director Control and Status
* Arkville's Packet Checker Control and Status
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 8b4daa819b..7cf896f6f1 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -94,6 +94,9 @@ static const struct rte_pci_id pci_id_ark_map[] = {
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101a)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101b)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
{.vendor_id = 0, /* sentinel */ },
@@ -127,6 +130,9 @@ ark_device_caps[] = {
SET_DEV_CAPS(0x1017, true),
SET_DEV_CAPS(0x1018, true),
SET_DEV_CAPS(0x1019, true),
+ SET_DEV_CAPS(0x101a, true),
+ SET_DEV_CAPS(0x101b, true),
+ SET_DEV_CAPS(0x101c, false),
SET_DEV_CAPS(0x101e, false),
SET_DEV_CAPS(0x101f, false),
{.device_id = 0,}
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions
2022-05-06 21:27 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
` (2 preceding siblings ...)
2022-05-06 21:27 ` [PATCH v1 4/5] net/ark: add new devices to support list Ed Czeck
@ 2022-05-06 21:27 ` Ed Czeck
2022-05-18 12:56 ` Ferruh Yigit
2022-05-18 12:54 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ferruh Yigit
4 siblings, 1 reply; 49+ messages in thread
From: Ed Czeck @ 2022-05-06 21:27 UTC (permalink / raw)
To: dev; +Cc: Ed Czeck, Shepard Siegel, John Miller
Add capabilities field isvf to dev struct
Disable configuration calls as required by vf
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 79 ++++++++++++++++++++----------------
drivers/net/ark/ark_global.h | 1 +
2 files changed, 45 insertions(+), 35 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 7cf896f6f1..fde94ee431 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -113,28 +113,29 @@ static const struct rte_pci_id pci_id_ark_map[] = {
*/
struct ark_caps {
bool rqpacing;
+ bool isvf;
};
struct ark_dev_caps {
uint32_t device_id;
struct ark_caps caps;
};
-#define SET_DEV_CAPS(id, rqp) \
- {id, {.rqpacing = rqp} }
+#define SET_DEV_CAPS(id, rqp, vf) \
+ {id, {.rqpacing = rqp, .isvf = vf} }
static const struct ark_dev_caps
ark_device_caps[] = {
- SET_DEV_CAPS(0x100d, true),
- SET_DEV_CAPS(0x100e, true),
- SET_DEV_CAPS(0x100f, true),
- SET_DEV_CAPS(0x1010, false),
- SET_DEV_CAPS(0x1017, true),
- SET_DEV_CAPS(0x1018, true),
- SET_DEV_CAPS(0x1019, true),
- SET_DEV_CAPS(0x101a, true),
- SET_DEV_CAPS(0x101b, true),
- SET_DEV_CAPS(0x101c, false),
- SET_DEV_CAPS(0x101e, false),
- SET_DEV_CAPS(0x101f, false),
+ SET_DEV_CAPS(0x100d, true, false),
+ SET_DEV_CAPS(0x100e, true, false),
+ SET_DEV_CAPS(0x100f, true, false),
+ SET_DEV_CAPS(0x1010, false, false),
+ SET_DEV_CAPS(0x1017, true, false),
+ SET_DEV_CAPS(0x1018, true, false),
+ SET_DEV_CAPS(0x1019, true, false),
+ SET_DEV_CAPS(0x101a, true, false),
+ SET_DEV_CAPS(0x101b, true, false),
+ SET_DEV_CAPS(0x101c, false, true),
+ SET_DEV_CAPS(0x101e, false, false),
+ SET_DEV_CAPS(0x101f, false, false),
{.device_id = 0,}
};
@@ -317,6 +318,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
while (ark_device_caps[p].device_id != 0) {
if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
rqpacing = ark_device_caps[p].caps.rqpacing;
+ ark->isvf = ark_device_caps[p].caps.isvf;
break;
}
p++;
@@ -498,20 +500,21 @@ ark_config_device(struct rte_eth_dev *dev)
* Make sure that the packet director, generator and checker are in a
* known state
*/
- ark->start_pg = 0;
- ark->pg_running = 0;
- ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
- if (ark->pg == NULL)
- return -1;
- ark_pktgen_reset(ark->pg);
- ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
- if (ark->pc == NULL)
- return -1;
- ark_pktchkr_stop(ark->pc);
- ark->pd = ark_pktdir_init(ark->pktdir.v);
- if (ark->pd == NULL)
- return -1;
-
+ if (!ark->isvf) {
+ ark->start_pg = 0;
+ ark->pg_running = 0;
+ ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
+ if (ark->pg == NULL)
+ return -1;
+ ark_pktgen_reset(ark->pg);
+ ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
+ if (ark->pc == NULL)
+ return -1;
+ ark_pktchkr_stop(ark->pc);
+ ark->pd = ark_pktdir_init(ark->pktdir.v);
+ if (ark->pd == NULL)
+ return -1;
+ }
/* Verify HW */
if (ark_udm_verify(ark->udm.v))
return -1;
@@ -533,7 +536,7 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- if (ark->rqpacing)
+ if (!ark->isvf && ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
return 0;
@@ -551,8 +554,10 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev)
ark->user_ext.dev_uninit(dev,
ark->user_data[dev->data->port_id]);
- ark_pktgen_uninit(ark->pg);
- ark_pktchkr_uninit(ark->pc);
+ if (!ark->isvf) {
+ ark_pktgen_uninit(ark->pg);
+ ark_pktchkr_uninit(ark->pc);
+ }
return 0;
}
@@ -588,10 +593,10 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
dev->rx_pkt_burst = ð_ark_recv_pkts;
dev->tx_pkt_burst = ð_ark_xmit_pkts;
- if (ark->start_pg)
+ if (!ark->isvf && ark->start_pg)
ark_pktchkr_run(ark->pc);
- if (ark->start_pg && !ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && !ark->pg_running) {
pthread_t thread;
/* Delay packet generatpr start allow the hardware to be ready
@@ -635,7 +640,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
/* Stop the packet generator */
- if (ark->start_pg && ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && ark->pg_running) {
ark_pktgen_pause(ark->pg);
ark->pg_running = 0;
}
@@ -661,7 +666,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
eth_ark_rx_dump_queue(dev, i, __func__);
/* Stop the packet checker if it is running */
- if (ark->start_pg) {
+ if (!ark->isvf && ark->start_pg) {
ark_pktchkr_dump_stats(ark->pc);
ark_pktchkr_stop(ark->pc);
}
@@ -974,6 +979,10 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params)
goto free_kvlist;
}
+ if (ark->isvf) {
+ ret = 0;
+ goto free_kvlist;
+ }
ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
/* Setup the packet director */
ark_pktdir_setup(ark->pd, ark->pkt_dir_v);
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index 3c3a712bc8..748db590c1 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -113,6 +113,7 @@ struct ark_adapter {
ark_pkt_dir_t pd;
int num_ports;
+ bool isvf;
/* Packet generator/checker args */
char pkt_gen_args[ARK_MAX_ARG_LEN];
--
2.17.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v1 1/5] net/ark: update mpu code to match current hardware version
2022-05-06 21:27 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
` (3 preceding siblings ...)
2022-05-06 21:27 ` [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions Ed Czeck
@ 2022-05-18 12:54 ` Ferruh Yigit
2022-05-19 10:13 ` Kevin Traynor
4 siblings, 1 reply; 49+ messages in thread
From: Ferruh Yigit @ 2022-05-18 12:54 UTC (permalink / raw)
To: Ed Czeck, dev; +Cc: Shepard Siegel, John Miller, Luca Boccassi, Kevin Traynor
On 5/6/2022 10:27 PM, Ed Czeck wrote:
> new version code
> remove device-level global operations
> remove ark_mpu_reset_stats function
>
Hi Ed, please find a few comments inline.
Also I assume 'mpu' is an abbreviation, can you please document what it
stands for in the commit log, like MPU (M.. P.. U..)?
And can you please make it uppercase in the commit title, also if you
can add them to 'devtools/words-case.txt' (in a separate patch), it will
be checked next time by './devtools/check-git-log.sh' script.
Same for all patches.
> Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
> ---
> drivers/net/ark/ark_ethdev.c | 2 --
> drivers/net/ark/ark_ethdev_rx.c | 4 ----
> drivers/net/ark/ark_mpu.c | 21 ++++-----------------
> drivers/net/ark/ark_mpu.h | 29 ++---------------------------
> 4 files changed, 6 insertions(+), 50 deletions(-)
>
<...>
> @@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
> {
> uint32_t version;
>
> - version = mpu->id.vernum & 0x0000fF00;
> - if ((mpu->id.idnum != 0x2055504d) ||
> - (mpu->hw.obj_size != obj_size) ||
> - (version != 0x00003100)) {
> + version = mpu->id.vernum;
> + if (mpu->id.idnum != ARK_MPU_MODID ||
> + version != ARK_MPU_MODVER ||
> + mpu->hw.obj_size != obj_size) {
The driver will work with a specific version of the 'MPU'. So a device
previously working with previous version of the driver, won't work
anymore after this patch, and will be forced to a (FW/bitstream/?) update.
I am not sure how problematic is this from the stable release
perspective. cc'ed maintainers.
But at least won't it be good to document this in release notes, and
perhaps having a table in the driver documentation to list which DPDK
version requires which HW version can be good, what do you think?
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions
2022-05-06 21:27 ` [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions Ed Czeck
@ 2022-05-18 12:56 ` Ferruh Yigit
0 siblings, 0 replies; 49+ messages in thread
From: Ferruh Yigit @ 2022-05-18 12:56 UTC (permalink / raw)
To: Ed Czeck, dev; +Cc: Shepard Siegel, John Miller
On 5/6/2022 10:27 PM, Ed Czeck wrote:
> Add capabilities field isvf to dev struct
> Disable configuration calls as required by vf
>
> Signed-off-by: Ed Czeck<ed.czeck@atomicrules.com>
Hi Ed,
Last two patches are removing VF restriction, adding a new VF device and
enabling its probing.
Can you please document this new feature in the release notes?
Thanks,
Ferruh
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v1 1/5] net/ark: update mpu code to match current hardware version
2022-05-18 12:54 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ferruh Yigit
@ 2022-05-19 10:13 ` Kevin Traynor
0 siblings, 0 replies; 49+ messages in thread
From: Kevin Traynor @ 2022-05-19 10:13 UTC (permalink / raw)
To: Ferruh Yigit, Ed Czeck, dev; +Cc: Shepard Siegel, John Miller, Luca Boccassi
On 18/05/2022 13:54, Ferruh Yigit wrote:
> On 5/6/2022 10:27 PM, Ed Czeck wrote:
>> new version code
>> remove device-level global operations
>> remove ark_mpu_reset_stats function
>>
>
> Hi Ed, please find a few comments inline.
>
> Also I assume 'mpu' is an abbreviation, can you please document what it
> stands for in the commit log, like MPU (M.. P.. U..)?
> And can you please make it uppercase in the commit title, also if you
> can add them to 'devtools/words-case.txt' (in a separate patch), it will
> be checked next time by './devtools/check-git-log.sh' script.
> Same for all patches.
>
>> Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
>> ---
>> drivers/net/ark/ark_ethdev.c | 2 --
>> drivers/net/ark/ark_ethdev_rx.c | 4 ----
>> drivers/net/ark/ark_mpu.c | 21 ++++-----------------
>> drivers/net/ark/ark_mpu.h | 29 ++---------------------------
>> 4 files changed, 6 insertions(+), 50 deletions(-)
>>
>
> <...>
>
>> @@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
>> {
>> uint32_t version;
>>
>> - version = mpu->id.vernum & 0x0000fF00;
>> - if ((mpu->id.idnum != 0x2055504d) ||
>> - (mpu->hw.obj_size != obj_size) ||
>> - (version != 0x00003100)) {
>> + version = mpu->id.vernum;
>> + if (mpu->id.idnum != ARK_MPU_MODID ||
>> + version != ARK_MPU_MODVER ||
>> + mpu->hw.obj_size != obj_size) {
>
> The driver will work with a specific version of the 'MPU'. So a device
> previously working with previous version of the driver, won't work
> anymore after this patch, and will be forced to a (FW/bitstream/?) update.
> I am not sure how problematic is this from the stable release
> perspective. cc'ed maintainers.
>
While it is nice-to-have, stable releases are not guaranteed to work
with future HW/FW/3rd party software etc.
More importantly, a user should not *have* to make updates outside DPDK
when moving along a single DPDK LTS stream. e.g. 21.11.1 -> 21.11.2.
> But at least won't it be good to document this in release notes, and
> perhaps having a table in the driver documentation to list which DPDK
> version requires which HW version can be good, what do you think?
>
I agree documenting the matching versions is good for usability. e.g.
http://doc.dpdk.org/guides/nics/ice.html#recommended-matching-list
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
` (4 preceding siblings ...)
2022-05-06 21:27 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
@ 2022-05-19 21:36 ` Ed Czeck
2022-05-19 21:36 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
` (5 more replies)
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (2 subsequent siblings)
8 siblings, 6 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-19 21:36 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Thomas Monjalon
DDM -> Downstream Data Mover
MPU -> Mbuf Prefetch Unit
UDM -> Upstream Data Mover
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
devtools/words-case.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/devtools/words-case.txt b/devtools/words-case.txt
index bc33470532..fa92ab273e 100644
--- a/devtools/words-case.txt
+++ b/devtools/words-case.txt
@@ -11,6 +11,7 @@ CPT
CQ
CRC
DCB
+DDM
DevX
DMA
eCPRI
@@ -46,6 +47,7 @@ LSC
MAC
MCAM
MPLS
+MPU
MSI
MSI-X
MSS
@@ -90,6 +92,7 @@ TPID
TSO
TTL
Tx
+UDM
UDP
ULP
vDPA
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 2/7] net/ark: update MPU functions for firmware update
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
@ 2022-05-19 21:36 ` Ed Czeck
2022-05-19 21:36 ` [PATCH v2 3/7] net/ark: update DDM " Ed Czeck
` (4 subsequent siblings)
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-19 21:36 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for MPU (Mbuf Prefetch Unit)
remove device-level global operations
remove ark_mpu_reset_stats function
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2:
- document version compatibility between firmware and DPDK
- reword commit message
---
doc/guides/nics/ark.rst | 15 +++++++++++++++
drivers/net/ark/ark_ethdev.c | 2 --
drivers/net/ark/ark_ethdev_rx.c | 4 ----
drivers/net/ark/ark_mpu.c | 21 ++++-----------------
drivers/net/ark/ark_mpu.h | 29 ++---------------------------
5 files changed, 21 insertions(+), 50 deletions(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index c965406a7b..29c0a07d60 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -300,6 +300,21 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
+DPDK and Arkville Firmware Versioning
+-------------------------------------
+
+Arkville's firmware and its PMD have version dependencies which must
+be stepped together at certain releases. PMD code ensures the versions are
+compatible. The following lists shows where version compatible steps have
+occurred. If other combinations are required, please contact Atomic Rules
+support.
+
+* DPDK 22.07 requires Arkville 22.07.
+* DPDK 22.03 requires Arkville 22.03.
+* DPDK 21.05 requires Arkville 21.05.
+* DPDK 18.11 requires Arkville 18.11.
+* DPDK 17.05 requires Arkville 17.05 -- initial version.
+
Supported Operating Systems
---------------------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 76b88c62d0..c0578b85ce 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -524,7 +524,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->rx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
@@ -536,7 +535,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 0fbb2603db..85e34d0bb8 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -91,9 +91,6 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
ark_udm_write_addr(queue->udm, phys_addr_prod_index);
- /* advance the valid pointer, but don't start until the queue starts */
- ark_mpu_reset_stats(queue->mpu);
-
/* The seed is the producer index for the HW */
ark_mpu_set_producer(queue->mpu, queue->seed_index);
dev->data->rx_queue_state[rx_queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
@@ -589,7 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
if (queue == 0)
return;
- ark_mpu_reset_stats(queue->mpu);
ark_udm_queue_stats_reset(queue->udm);
}
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index b8e94b6ed3..9d5ee7841b 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
{
uint32_t version;
- version = mpu->id.vernum & 0x0000fF00;
- if ((mpu->id.idnum != 0x2055504d) ||
- (mpu->hw.obj_size != obj_size) ||
- (version != 0x00003100)) {
+ version = mpu->id.vernum;
+ if (mpu->id.idnum != ARK_MPU_MODID ||
+ version != ARK_MPU_MODVER ||
+ mpu->hw.obj_size != obj_size) {
ARK_PMD_LOG(ERR,
" MPU module not found as expected %08x"
" \"%c%c%c%c %c%c%c%c\"\n",
@@ -79,16 +79,9 @@ ark_mpu_reset(struct ark_mpu_t *mpu)
mpu->cfg.command = MPU_CMD_FORCE_RESET;
usleep(10);
}
- ark_mpu_reset_stats(mpu);
return mpu->cfg.command != MPU_CMD_IDLE;
}
-void
-ark_mpu_reset_stats(struct ark_mpu_t *mpu)
-{
- mpu->stats.pci_request = 1; /* reset stats */
-}
-
int
ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
int is_tx)
@@ -118,12 +111,6 @@ ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
code, qid,
mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
- ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
- "\n",
- code,
- mpu->debug.state, mpu->debug.count,
- mpu->debug.reserved
- );
}
void
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index 92c3e67c86..9d2b70d35f 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -15,6 +15,8 @@
* there is minimal documentation.
*/
+#define ARK_MPU_MODID 0x2055504d
+#define ARK_MPU_MODVER 0x37313232
/*
* MPU hardware structures
* These are overlay structures to a memory mapped FPGA device. These
@@ -64,26 +66,6 @@ enum ARK_MPU_COMMAND {
MPU_COMMAND_LIMIT = 0xfFFFFFFF
};
-#define ARK_MPU_STATS 0x080
-struct ark_mpu_stats_t {
- volatile uint64_t pci_request;
- volatile uint64_t q_empty;
- volatile uint64_t q_q1;
- volatile uint64_t q_q2;
- volatile uint64_t q_q3;
- volatile uint64_t q_q4;
- volatile uint64_t q_full;
-};
-
-#define ARK_MPU_DEBUG 0x0C0
-struct ark_mpu_debug_t {
- volatile uint32_t state;
- uint32_t reserved;
- volatile uint32_t count;
- volatile uint32_t take;
- volatile uint32_t peek[4];
-};
-
/* Consolidated structure */
struct ark_mpu_t {
struct ark_mpu_id_t id;
@@ -93,12 +75,6 @@ struct ark_mpu_t {
uint8_t reserved1[(ARK_MPU_CFG - ARK_MPU_HW) -
sizeof(struct ark_mpu_hw_t)];
struct ark_mpu_cfg_t cfg;
- uint8_t reserved2[(ARK_MPU_STATS - ARK_MPU_CFG) -
- sizeof(struct ark_mpu_cfg_t)];
- struct ark_mpu_stats_t stats;
- uint8_t reserved3[(ARK_MPU_DEBUG - ARK_MPU_STATS) -
- sizeof(struct ark_mpu_stats_t)];
- struct ark_mpu_debug_t debug;
};
uint16_t ark_api_num_queues(struct ark_mpu_t *mpu);
@@ -113,7 +89,6 @@ int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);
-void ark_mpu_reset_stats(struct ark_mpu_t *mpu);
/* this action is in a performance critical path */
static inline void
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 3/7] net/ark: update DDM functions for firmware update
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-05-19 21:36 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
@ 2022-05-19 21:36 ` Ed Czeck
2022-05-19 21:36 ` [PATCH v2 4/7] net/ark: update UDM " Ed Czeck
` (3 subsequent siblings)
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-19 21:36 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for DDM (Downstream Data Mover)
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by firmware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2:
reword commit message
---
drivers/net/ark/ark_ddm.c | 80 +++++-------------------------
drivers/net/ark/ark_ddm.h | 86 +++++++++------------------------
drivers/net/ark/ark_ethdev.c | 33 -------------
drivers/net/ark/ark_ethdev_tx.c | 35 +++-----------
4 files changed, 40 insertions(+), 194 deletions(-)
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index b16c739d50..eb88349b7b 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -14,95 +14,45 @@ int
ark_ddm_verify(struct ark_ddm_t *ddm)
{
uint32_t hw_const;
+ uint32_t hw_ver;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
- hw_const = ddm->cfg.const0;
- if (hw_const == ARK_DDM_CONST3)
+ hw_const = ddm->cfg.idnum;
+ hw_ver = ddm->cfg.vernum;
+ if (hw_const == ARK_DDM_MODID && hw_ver == ARK_DDM_MODVER)
return 0;
- if (hw_const == ARK_DDM_CONST1) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 1, "
- "PMD expects version 2\n");
- return -1;
- }
-
- if (hw_const == ARK_DDM_CONST2) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 2, "
- "PMD expects version 3\n");
- return -1;
- }
ARK_PMD_LOG(ERR,
- "ARK: DDM module not found as expected 0x%08x\n",
- ddm->cfg.const0);
+ "ARK: DDM module not found as expected"
+ " id: %08x ver: %08x\n",
+ hw_const, hw_ver);
return -1;
}
void
-ark_ddm_start(struct ark_ddm_t *ddm)
-{
- ddm->cfg.command = 1;
-}
-
-int
-ark_ddm_stop(struct ark_ddm_t *ddm, const int wait)
+ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable)
{
- int cnt = 0;
-
- ddm->cfg.command = 2;
- rte_wmb();
- while (wait && (ddm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
+ ddm->setup.qcommand = enable ? 1U : 0U;
}
void
-ark_ddm_reset(struct ark_ddm_t *ddm)
-{
- int status;
-
- /* reset only works if ddm has stopped properly. */
- status = ark_ddm_stop(ddm, 1);
-
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- ddm->cfg.command = 4;
- usleep(10);
- }
- ddm->cfg.command = 3;
-}
-
-void
-ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr, uint32_t interval)
+ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr)
{
ddm->setup.cons_write_index_addr = cons_addr;
- ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
+ ddm->setup.cons_index = 0;
}
+/* Global stats clear */
void
ark_ddm_stats_reset(struct ark_ddm_t *ddm)
{
ddm->cfg.tlp_stats_clear = 1;
}
-void
-ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
- ark_ddm_is_stopped(ddm)
- );
-}
-
void
ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
{
@@ -116,12 +66,6 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
"MBufs", stats->tx_mbuf_count);
}
-int
-ark_ddm_is_stopped(struct ark_ddm_t *ddm)
-{
- return (ddm->cfg.stop_flushed & 0x01) != 0;
-}
-
uint64_t
ark_ddm_queue_byte_count(struct ark_ddm_t *ddm)
{
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index 687ff2519a..84beeb063a 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -40,17 +40,24 @@ union ark_tx_meta {
*/
#define ARK_DDM_CFG 0x0000
/* Set unique HW ID for hardware version */
-#define ARK_DDM_CONST3 (0x334d4444)
-#define ARK_DDM_CONST2 (0x324d4444)
-#define ARK_DDM_CONST1 (0xfacecafe)
+#define ARK_DDM_MODID 0x204d4444
+#define ARK_DDM_MODVER 0x37313232
struct ark_ddm_cfg_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ volatile uint32_t tlp_stats_clear;
+ };
uint32_t r0;
- volatile uint32_t tlp_stats_clear;
- uint32_t const0;
volatile uint32_t tag_max;
volatile uint32_t command;
- volatile uint32_t stop_flushed;
+ uint32_t write_index_interval; /* 4ns each */
+ volatile uint64_t qflow;
};
#define ARK_DDM_STATS 0x0020
@@ -60,34 +67,6 @@ struct ark_ddm_stats_t {
volatile uint64_t tx_mbuf_count;
};
-#define ARK_DDM_MRDQ 0x0040
-struct ark_ddm_mrdq_t {
- volatile uint32_t mrd_q1;
- volatile uint32_t mrd_q2;
- volatile uint32_t mrd_q3;
- volatile uint32_t mrd_q4;
- volatile uint32_t mrd_full;
-};
-
-#define ARK_DDM_CPLDQ 0x0068
-struct ark_ddm_cpldq_t {
- volatile uint32_t cpld_q1;
- volatile uint32_t cpld_q2;
- volatile uint32_t cpld_q3;
- volatile uint32_t cpld_q4;
- volatile uint32_t cpld_full;
-};
-
-#define ARK_DDM_MRD_PS 0x0090
-struct ark_ddm_mrd_ps_t {
- volatile uint32_t mrd_ps_min;
- volatile uint32_t mrd_ps_max;
- volatile uint32_t mrd_full_ps_min;
- volatile uint32_t mrd_full_ps_max;
- volatile uint32_t mrd_dw_ps_min;
- volatile uint32_t mrd_dw_ps_max;
-};
-
#define ARK_DDM_QUEUE_STATS 0x00a8
struct ark_ddm_qstats_t {
volatile uint64_t byte_count;
@@ -95,20 +74,10 @@ struct ark_ddm_qstats_t {
volatile uint64_t mbuf_count;
};
-#define ARK_DDM_CPLD_PS 0x00c0
-struct ark_ddm_cpld_ps_t {
- volatile uint32_t cpld_ps_min;
- volatile uint32_t cpld_ps_max;
- volatile uint32_t cpld_full_ps_min;
- volatile uint32_t cpld_full_ps_max;
- volatile uint32_t cpld_dw_ps_min;
- volatile uint32_t cpld_dw_ps_max;
-};
-
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
rte_iova_t cons_write_index_addr;
- uint32_t write_index_interval; /* 4ns each */
+ volatile uint32_t qcommand;
volatile uint32_t cons_index;
};
@@ -119,39 +88,28 @@ struct ark_ddm_t {
struct ark_ddm_cfg_t cfg;
uint8_t reserved0[(ARK_DDM_STATS - ARK_DDM_CFG) -
sizeof(struct ark_ddm_cfg_t)];
+
struct ark_ddm_stats_t stats;
- uint8_t reserved1[(ARK_DDM_MRDQ - ARK_DDM_STATS) -
+ uint8_t reserved1[(ARK_DDM_QUEUE_STATS - ARK_DDM_STATS) -
sizeof(struct ark_ddm_stats_t)];
- struct ark_ddm_mrdq_t mrdq;
- uint8_t reserved2[(ARK_DDM_CPLDQ - ARK_DDM_MRDQ) -
- sizeof(struct ark_ddm_mrdq_t)];
- struct ark_ddm_cpldq_t cpldq;
- uint8_t reserved3[(ARK_DDM_MRD_PS - ARK_DDM_CPLDQ) -
- sizeof(struct ark_ddm_cpldq_t)];
- struct ark_ddm_mrd_ps_t mrd_ps;
+
struct ark_ddm_qstats_t queue_stats;
- struct ark_ddm_cpld_ps_t cpld_ps;
- uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_CPLD_PS) -
- sizeof(struct ark_ddm_cpld_ps_t)];
+ uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_QUEUE_STATS) -
+ sizeof(struct ark_ddm_qstats_t)];
+
struct ark_ddm_setup_t setup;
uint8_t reserved_p[(ARK_DDM_EXPECTED_SIZE - ARK_DDM_SETUP) -
sizeof(struct ark_ddm_setup_t)];
};
-
/* DDM function prototype */
int ark_ddm_verify(struct ark_ddm_t *ddm);
-void ark_ddm_start(struct ark_ddm_t *ddm);
-int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
-void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
- uint32_t interval);
+void ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
-void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
-int ark_ddm_is_stopped(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_byte_count(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_pkt_count(struct ark_ddm_t *ddm);
void ark_ddm_queue_reset_stats(struct ark_ddm_t *ddm);
+void ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable);
#endif
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index c0578b85ce..07d1d2178d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -527,10 +527,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- /* TX -- DDM */
- if (ark_ddm_stop(ark->ddm.v, 1))
- ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
-
mpu = ark->mputx.v;
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
@@ -538,10 +534,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- ark_ddm_reset(ark->ddm.v);
- ark_ddm_stats_reset(ark->ddm.v);
-
- ark_ddm_stop(ark->ddm.v, 0);
if (ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
@@ -595,9 +587,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
for (i = 0; i < dev->data->nb_tx_queues; i++)
eth_ark_tx_queue_start(dev, i);
- /* start DDM */
- ark_ddm_start(ark->ddm.v);
-
ark->started = 1;
/* set xmit and receive function */
dev->rx_pkt_burst = ð_ark_recv_pkts;
@@ -671,28 +660,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* Stop DDM */
- /* Wait up to 0.1 second. each stop is up to 1000 * 10 useconds */
- for (i = 0; i < 10; i++) {
- status = ark_ddm_stop(ark->ddm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "DDM stop anomaly. status:"
- " %d iter: %u. (%s)\n",
- status,
- i,
- __func__);
- ark_ddm_dump(ark->ddm.v, "Stop anomaly");
-
- mpu = ark->mputx.v;
- for (i = 0; i < ark->tx_queues; i++) {
- ark_mpu_dump(mpu, "DDM failure dump", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
/* STOP RX Side */
/* Stop UDM multiple tries attempted */
for (i = 0; i < 10; i++) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index abdce6a8cc..5940a592a2 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -59,12 +59,6 @@ static int eth_ark_tx_jumbo(struct ark_tx_queue *queue,
static int eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue);
static void free_completed_tx(struct ark_tx_queue *queue);
-static inline void
-ark_tx_hw_queue_stop(struct ark_tx_queue *queue)
-{
- ark_mpu_stop(queue->mpu);
-}
-
/* ************************************************************************* */
static inline void
eth_ark_tx_desc_fill(struct ark_tx_queue *queue,
@@ -309,7 +303,6 @@ static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
rte_iova_t queue_base, ring_base, cons_index_addr;
- uint32_t write_interval_ns;
/* Verify HW -- MPU */
if (ark_mpu_verify(queue->mpu, sizeof(union ark_tx_meta)))
@@ -326,28 +319,9 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
/* Stop and Reset and configure MPU */
ark_mpu_configure(queue->mpu, ring_base, queue->queue_size, 1);
- /*
- * Adjust the write interval based on queue size --
- * increase pcie traffic when low mbuf count
- * Queue sizes less than 128 are not allowed
- */
- switch (queue->queue_size) {
- case 128:
- write_interval_ns = 500;
- break;
- case 256:
- write_interval_ns = 500;
- break;
- case 512:
- write_interval_ns = 1000;
- break;
- default:
- write_interval_ns = 2000;
- break;
- }
-
/* Completion address in UDM */
- ark_ddm_setup(queue->ddm, cons_index_addr, write_interval_ns);
+ ark_ddm_queue_setup(queue->ddm, cons_index_addr);
+ ark_ddm_queue_reset_stats(queue->ddm);
return 0;
}
@@ -360,7 +334,8 @@ eth_ark_tx_queue_release(void *vtx_queue)
queue = (struct ark_tx_queue *)vtx_queue;
- ark_tx_hw_queue_stop(queue);
+ ark_ddm_queue_enable(queue->ddm, 0);
+ ark_mpu_stop(queue->mpu);
queue->cons_index = queue->prod_index;
free_completed_tx(queue);
@@ -386,6 +361,7 @@ eth_ark_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id)
return -1;
}
+ ark_ddm_queue_enable(queue->ddm, 0);
ark_mpu_stop(queue->mpu);
free_completed_tx(queue);
@@ -404,6 +380,7 @@ eth_ark_tx_queue_start(struct rte_eth_dev *dev, uint16_t queue_id)
return 0;
ark_mpu_start(queue->mpu);
+ ark_ddm_queue_enable(queue->ddm, 1);
dev->data->tx_queue_state[queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 4/7] net/ark: update UDM functions for firmware update
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-05-19 21:36 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
2022-05-19 21:36 ` [PATCH v2 3/7] net/ark: update DDM " Ed Czeck
@ 2022-05-19 21:36 ` Ed Czeck
2022-05-19 21:36 ` [PATCH v2 5/7] net/ark: report additional errors from firmware Ed Czeck
` (2 subsequent siblings)
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-19 21:36 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for UDM (Upstream Data Mover)
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by firmware
remove performance structs as they are not in the firmware module
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2: reword commit message
---
drivers/net/ark/ark_ethdev.c | 34 +----------
drivers/net/ark/ark_ethdev_rx.c | 38 +-----------
drivers/net/ark/ark_ethdev_rx.h | 1 -
drivers/net/ark/ark_udm.c | 103 +++-----------------------------
drivers/net/ark/ark_udm.h | 73 +++++-----------------
5 files changed, 27 insertions(+), 222 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 07d1d2178d..8b4daa819b 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -512,13 +512,6 @@ ark_config_device(struct rte_eth_dev *dev)
if (ark_ddm_verify(ark->ddm.v))
return -1;
- /* UDM */
- if (ark_udm_reset(ark->udm.v)) {
- ARK_PMD_LOG(ERR, "Unable to stop and reset UDM\n");
- return -1;
- }
- /* Keep in reset until the MPU are cleared */
-
/* MPU reset */
mpu = ark->mpurx.v;
num_q = ark_api_num_queues(mpu);
@@ -577,9 +570,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
int i;
/* RX Side */
- /* start UDM */
- ark_udm_start(ark->udm.v);
-
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_start_queue(dev, i);
@@ -627,7 +617,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
uint16_t i;
int status;
struct ark_adapter *ark = dev->data->dev_private;
- struct ark_mpu_t *mpu;
if (ark->started == 0)
return 0;
@@ -660,27 +649,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* STOP RX Side */
- /* Stop UDM multiple tries attempted */
- for (i = 0; i < 10; i++) {
- status = ark_udm_stop(ark->udm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
- status, i, __func__);
- ark_udm_dump(ark->udm.v, "Stop anomaly");
-
- mpu = ark->mpurx.v;
- for (i = 0; i < ark->rx_queues; i++) {
- ark_mpu_dump(mpu, "UDM Stop anomaly", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
ark_udm_dump_stats(ark->udm.v, "Post stop");
- ark_udm_dump_perf(ark->udm.v, "Post stop");
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_dump_queue(dev, i, __func__);
@@ -708,10 +677,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
eth_ark_dev_stop(dev);
- eth_ark_udm_force_close(dev);
/*
- * TODO This should only be called once for the device during shutdown
+ * This should only be called once for the device during shutdown
*/
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 85e34d0bb8..cbc0416bc2 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -200,13 +200,10 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
queue->mpu = RTE_PTR_ADD(ark->mpurx.v, qidx * ARK_MPU_QOFFSET);
/* Configure UDM per queue */
- ark_udm_stop(queue->udm, 0);
ark_udm_configure(queue->udm,
RTE_PKTMBUF_HEADROOM,
- queue->dataroom,
- ARK_RX_WRITE_TIME_NS);
- ark_udm_stats_reset(queue->udm);
- ark_udm_stop(queue->udm, 0);
+ queue->dataroom);
+ ark_udm_queue_stats_reset(queue->udm);
/* populate mbuf reserve */
status = eth_ark_rx_seed_mbufs(queue);
@@ -589,36 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
ark_udm_queue_stats_reset(queue->udm);
}
-void
-eth_ark_udm_force_close(struct rte_eth_dev *dev)
-{
- struct ark_adapter *ark = dev->data->dev_private;
- struct ark_rx_queue *queue;
- uint32_t index;
- uint16_t i;
-
- if (!ark_udm_is_flushed(ark->udm.v)) {
- /* restart the MPUs */
- ARK_PMD_LOG(NOTICE, "UDM not flushed -- forcing flush\n");
- for (i = 0; i < dev->data->nb_rx_queues; i++) {
- queue = (struct ark_rx_queue *)dev->data->rx_queues[i];
- if (queue == 0)
- continue;
-
- ark_mpu_start(queue->mpu);
- /* Add some buffers */
- index = ARK_RX_MPU_CHUNK + queue->seed_index;
- ark_mpu_set_producer(queue->mpu, index);
- }
- /* Wait to allow data to pass */
- usleep(100);
-
- ARK_PMD_LOG(NOTICE, "UDM forced flush attempt, stopped = %d\n",
- ark_udm_is_flushed(ark->udm.v));
- }
- ark_udm_reset(ark->udm.v);
-}
-
static void
ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
{
@@ -633,7 +600,6 @@ ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
ark_mpu_dump(queue->mpu, name, queue->phys_qid);
ark_mpu_dump_setup(queue->mpu, queue->phys_qid);
- ark_udm_dump(queue->udm, name);
ark_udm_dump_setup(queue->udm, queue->phys_qid);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index f64b3dd137..2e3400fd2f 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -27,6 +27,5 @@ void eth_rx_queue_stats_get(void *vqueue, struct rte_eth_stats *stats);
void eth_rx_queue_stats_reset(void *vqueue);
void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id,
const char *msg);
-void eth_ark_udm_force_close(struct rte_eth_dev *dev);
#endif
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 9ebed89627..81b141ad0b 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -12,6 +12,8 @@ static_assert(sizeof(struct ark_rx_meta) == 32, "Unexpected struct size ark_rx_m
int
ark_udm_verify(struct ark_udm_t *udm)
{
+ uint32_t idnum = udm->setup.idnum;
+ uint32_t vernum = udm->setup.vernum;
if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
ARK_PMD_LOG(ERR,
"ARK: UDM structure looks incorrect %d vs %zd\n",
@@ -19,94 +21,30 @@ ark_udm_verify(struct ark_udm_t *udm)
return -1;
}
- if (udm->setup.const0 != ARK_UDM_CONST) {
+ if (idnum != ARK_UDM_MODID || vernum != ARK_UDM_MODVER) {
ARK_PMD_LOG(ERR,
- "ARK: UDM module not found as expected 0x%08x\n",
- udm->setup.const0);
+ "ARK: UDM module not found as expected 0x%08x 0x%08x\n",
+ idnum, vernum);
return -1;
}
return 0;
}
-int
-ark_udm_stop(struct ark_udm_t *udm, const int wait)
-{
- int cnt = 0;
-
- udm->setup.r0 = 0;
- udm->cfg.command = 2;
- rte_wmb();
-
- while (wait && (udm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
-}
-
-int
-ark_udm_reset(struct ark_udm_t *udm)
-{
- int status;
-
- status = ark_udm_stop(udm, 1);
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- udm->cfg.command = 4;
- usleep(10);
- udm->cfg.command = 3;
- status = ark_udm_stop(udm, 0);
- ARK_PMD_LOG(INFO, "%s stop status %d post failure"
- " and forced reset\n",
- __func__, status);
- } else {
- udm->cfg.command = 3;
- }
-
- return status;
-}
-
-void
-ark_udm_start(struct ark_udm_t *udm)
-{
- udm->setup.r0 = 0x100;
- udm->cfg.command = 1;
-}
-
-void
-ark_udm_stats_reset(struct ark_udm_t *udm)
-{
- udm->pcibp.pci_clear = 1;
- udm->tlp_ps.tlp_clear = 1;
-}
-
void
ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns)
+ uint32_t dataroom)
{
/* headroom and data room are in DWords in the UDM */
udm->cfg.dataroom = dataroom / 4;
udm->cfg.headroom = headroom / 4;
-
- /* 4 NS period ns */
- udm->rt_cfg.write_interval = write_interval_ns / 4;
}
void
ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
-}
-
-int
-ark_udm_is_flushed(struct ark_udm_t *udm)
-{
- return (udm->cfg.stop_flushed & 0x01) != 0;
+ udm->rt_cfg.prod_idx = 0;
}
uint64_t
@@ -131,11 +69,10 @@ void
ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
{
ARK_PMD_LOG(INFO, "UDM Stats: %s"
- ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
+ ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
msg,
"Pkts Received", udm->stats.rx_packet_count,
"Pkts Finalized", udm->stats.rx_sent_packets,
- "Pkts Dropped", udm->tlp.pkt_drop,
"Bytes Count", udm->stats.rx_byte_count,
"MBuf Count", udm->stats.rx_mbuf_count);
}
@@ -155,13 +92,6 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
"MBuf Count", udm->qstats.q_mbuf_count);
}
-void
-ark_udm_dump(struct ark_udm_t *udm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
- udm->cfg.stop_flushed);
-}
-
void
ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
{
@@ -172,23 +102,6 @@ ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
"prod_idx", udm->rt_cfg.prod_idx);
}
-void
-ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
-{
- struct ark_udm_pcibp_t *bp = &udm->pcibp;
-
- ARK_PMD_LOG(INFO, "UDM Performance %s"
- ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
- "\n",
- msg,
- "PCI Empty", bp->pci_empty,
- "PCI Q1", bp->pci_q1,
- "PCI Q2", bp->pci_q2,
- "PCI Q3", bp->pci_q3,
- "PCI Q4", bp->pci_q4,
- "PCI Full", bp->pci_full);
-}
-
void
ark_udm_queue_stats_reset(struct ark_udm_t *udm)
{
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 1cbcd94a98..f0685c95c7 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -32,19 +32,25 @@ struct ark_rx_meta {
#define ARK_RX_WRITE_TIME_NS 2500
#define ARK_UDM_SETUP 0
-#define ARK_UDM_CONST2 0xbACECACE
-#define ARK_UDM_CONST3 0x344d4455
-#define ARK_UDM_CONST ARK_UDM_CONST3
+#define ARK_UDM_MODID 0x4d445500
+#define ARK_UDM_MODVER 0x37313232
+
struct ark_udm_setup_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ };
uint32_t r0;
- uint32_t r4;
- volatile uint32_t cycle_count;
uint32_t const0;
};
#define ARK_UDM_CFG 0x010
struct ark_udm_cfg_t {
- volatile uint32_t stop_flushed; /* RO */
+ uint32_t write_interval; /* 4ns cycles */
volatile uint32_t command;
uint32_t dataroom;
uint32_t headroom;
@@ -74,45 +80,11 @@ struct ark_udm_queue_stats_t {
uint32_t q_enable;
};
-#define ARK_UDM_TLP 0x0070
-struct ark_udm_tlp_t {
- volatile uint64_t pkt_drop; /* global */
- volatile uint32_t tlp_q1;
- volatile uint32_t tlp_q2;
- volatile uint32_t tlp_q3;
- volatile uint32_t tlp_q4;
- volatile uint32_t tlp_full;
-};
-
-#define ARK_UDM_PCIBP 0x00a0
-struct ark_udm_pcibp_t {
- volatile uint32_t pci_clear;
- volatile uint32_t pci_empty;
- volatile uint32_t pci_q1;
- volatile uint32_t pci_q2;
- volatile uint32_t pci_q3;
- volatile uint32_t pci_q4;
- volatile uint32_t pci_full;
-};
-
-#define ARK_UDM_TLP_PS 0x00bc
-struct ark_udm_tlp_ps_t {
- volatile uint32_t tlp_clear;
- volatile uint32_t tlp_ps_min;
- volatile uint32_t tlp_ps_max;
- volatile uint32_t tlp_full_ps_min;
- volatile uint32_t tlp_full_ps_max;
- volatile uint32_t tlp_dw_ps_min;
- volatile uint32_t tlp_dw_ps_max;
- volatile uint32_t tlp_pldw_ps_min;
- volatile uint32_t tlp_pldw_ps_max;
-};
-
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
rte_iova_t hw_prod_addr;
- uint32_t write_interval; /* 4ns cycles */
- volatile uint32_t prod_idx; /* RO */
+ uint32_t reserved;
+ volatile uint32_t prod_idx; /* Updated by HW */
};
/* Consolidated structure */
@@ -123,13 +95,8 @@ struct ark_udm_t {
struct ark_udm_cfg_t cfg;
struct ark_udm_stats_t stats;
struct ark_udm_queue_stats_t qstats;
- uint8_t reserved1[(ARK_UDM_TLP - ARK_UDM_PQ) -
+ uint8_t reserved1[(ARK_UDM_RT_CFG - ARK_UDM_PQ) -
sizeof(struct ark_udm_queue_stats_t)];
- struct ark_udm_tlp_t tlp;
- uint8_t reserved2[(ARK_UDM_PCIBP - ARK_UDM_TLP) -
- sizeof(struct ark_udm_tlp_t)];
- struct ark_udm_pcibp_t pcibp;
- struct ark_udm_tlp_ps_t tlp_ps;
struct ark_udm_rt_cfg_t rt_cfg;
int8_t reserved3[(ARK_UDM_EXPECT_SIZE - ARK_UDM_RT_CFG) -
sizeof(struct ark_udm_rt_cfg_t)];
@@ -137,22 +104,14 @@ struct ark_udm_t {
int ark_udm_verify(struct ark_udm_t *udm);
-int ark_udm_stop(struct ark_udm_t *udm, int wait);
-void ark_udm_start(struct ark_udm_t *udm);
-int ark_udm_reset(struct ark_udm_t *udm);
void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns);
+ uint32_t dataroom);
void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
-void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
uint16_t qid);
-void ark_udm_dump(struct ark_udm_t *udm, const char *msg);
-void ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
-int ark_udm_is_flushed(struct ark_udm_t *udm);
/* Per queue data */
uint64_t ark_udm_dropped(struct ark_udm_t *udm);
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 5/7] net/ark: report additional errors from firmware
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (2 preceding siblings ...)
2022-05-19 21:36 ` [PATCH v2 4/7] net/ark: update UDM " Ed Czeck
@ 2022-05-19 21:36 ` Ed Czeck
2022-05-19 21:36 ` [PATCH v2 6/7] net/ark: add new devices to support list Ed Czeck
2022-05-19 21:36 ` [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-19 21:36 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
detect and report completion errors from firmware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_rqp.c | 6 ++++--
drivers/net/ark/ark_rqp.h | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ark/ark_rqp.c b/drivers/net/ark/ark_rqp.c
index ef9ccd0706..efb9730fe6 100644
--- a/drivers/net/ark/ark_rqp.c
+++ b/drivers/net/ark/ark_rqp.c
@@ -22,14 +22,16 @@ ark_rqp_stats_reset(struct ark_rqpace_t *rqp)
void
ark_rqp_dump(struct ark_rqpace_t *rqp)
{
- if (rqp->err_count_other != 0)
+ if (rqp->err_count_other || rqp->cmpl_errors)
ARK_PMD_LOG(ERR,
"RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
+ ARK_SU32
ARK_SU32 "\n",
rqp->ctrl, rqp->cplh_max, rqp->cpld_max,
"Error Count", rqp->err_cnt,
- "Error General", rqp->err_count_other);
+ "Error General", rqp->err_count_other,
+ "Cmpl Errors", rqp->cmpl_errors);
ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
diff --git a/drivers/net/ark/ark_rqp.h b/drivers/net/ark/ark_rqp.h
index 6c8046062b..d09f242e1e 100644
--- a/drivers/net/ark/ark_rqp.h
+++ b/drivers/net/ark/ark_rqp.h
@@ -48,7 +48,8 @@ struct ark_rqpace_t {
volatile uint32_t cpld_pending_max;
volatile uint32_t err_count_other;
char eval[4];
- volatile int lasped;
+ volatile int32_t lasped;
+ volatile uint32_t cmpl_errors;
};
void ark_rqp_dump(struct ark_rqpace_t *rqp);
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 6/7] net/ark: add new devices to support list
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (3 preceding siblings ...)
2022-05-19 21:36 ` [PATCH v2 5/7] net/ark: report additional errors from firmware Ed Czeck
@ 2022-05-19 21:36 ` Ed Czeck
2022-05-20 8:14 ` Andrew Rybchenko
2022-05-19 21:36 ` [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
5 siblings, 1 reply; 49+ messages in thread
From: Ed Czeck @ 2022-05-19 21:36 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
update device list is doc
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
doc/guides/nics/ark.rst | 4 +++-
drivers/net/ark/ark_ethdev.c | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index 29c0a07d60..f4ffb05b2f 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -297,6 +297,9 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:1017`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Primary Endpoint]
* ``1d6c:1018`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Secondary Endpoint]
* ``1d6c:1019`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Tertiary Endpoint]
+* ``1d6c:101a`` - AR-ARK-SRIOV-FX0 [Arkville 32B Primary Physical Function]
+* ``1d6c:101b`` - AR-ARK-SRIOV-FX1 [Arkville 64B Primary Physical Function]
+* ``1d6c:101c`` - AR-ARK-SRIOV-VF [Arkville Virtual Function]
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
@@ -337,7 +340,6 @@ Unsupported Features
Features that may be part of, or become part of, the Arkville RTL IP that are
not currently supported or exposed by the ARK PMD include:
-* PCIe SR-IOV Virtual Functions (VFs)
* Arkville's Packet Generator Control and Status
* Arkville's Packet Director Control and Status
* Arkville's Packet Checker Control and Status
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 8b4daa819b..7cf896f6f1 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -94,6 +94,9 @@ static const struct rte_pci_id pci_id_ark_map[] = {
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101a)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101b)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
{.vendor_id = 0, /* sentinel */ },
@@ -127,6 +130,9 @@ ark_device_caps[] = {
SET_DEV_CAPS(0x1017, true),
SET_DEV_CAPS(0x1018, true),
SET_DEV_CAPS(0x1019, true),
+ SET_DEV_CAPS(0x101a, true),
+ SET_DEV_CAPS(0x101b, true),
+ SET_DEV_CAPS(0x101c, false),
SET_DEV_CAPS(0x101e, false),
SET_DEV_CAPS(0x101f, false),
{.device_id = 0,}
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (4 preceding siblings ...)
2022-05-19 21:36 ` [PATCH v2 6/7] net/ark: add new devices to support list Ed Czeck
@ 2022-05-19 21:36 ` Ed Czeck
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-19 21:36 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
Add capabilities field isvf to dev struct
Disable configuration calls as required by vf
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2: feature Arkville vf support int release notes
---
doc/guides/rel_notes/release_22_07.rst | 4 ++
drivers/net/ark/ark_ethdev.c | 83 +++++++++++++++-----------
drivers/net/ark/ark_global.h | 1 +
3 files changed, 53 insertions(+), 35 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index 42a5f2d990..a57c406163 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -55,6 +55,10 @@ New Features
Also, make sure to start the actual text at the margin.
=======================================================
+* **Updated Atomic Rules' Arkville PMD.**
+
+ Added support for virtual functions and new Atomic Rules PCI device
+ IDs ``0x101a, 0x101b, 0x101c``.
Removed Items
-------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 7cf896f6f1..ec6c5a9525 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -113,28 +113,29 @@ static const struct rte_pci_id pci_id_ark_map[] = {
*/
struct ark_caps {
bool rqpacing;
+ bool isvf;
};
struct ark_dev_caps {
uint32_t device_id;
struct ark_caps caps;
};
-#define SET_DEV_CAPS(id, rqp) \
- {id, {.rqpacing = rqp} }
+#define SET_DEV_CAPS(id, rqp, vf) \
+ {id, {.rqpacing = rqp, .isvf = vf} }
static const struct ark_dev_caps
ark_device_caps[] = {
- SET_DEV_CAPS(0x100d, true),
- SET_DEV_CAPS(0x100e, true),
- SET_DEV_CAPS(0x100f, true),
- SET_DEV_CAPS(0x1010, false),
- SET_DEV_CAPS(0x1017, true),
- SET_DEV_CAPS(0x1018, true),
- SET_DEV_CAPS(0x1019, true),
- SET_DEV_CAPS(0x101a, true),
- SET_DEV_CAPS(0x101b, true),
- SET_DEV_CAPS(0x101c, false),
- SET_DEV_CAPS(0x101e, false),
- SET_DEV_CAPS(0x101f, false),
+ SET_DEV_CAPS(0x100d, true, false),
+ SET_DEV_CAPS(0x100e, true, false),
+ SET_DEV_CAPS(0x100f, true, false),
+ SET_DEV_CAPS(0x1010, false, false),
+ SET_DEV_CAPS(0x1017, true, false),
+ SET_DEV_CAPS(0x1018, true, false),
+ SET_DEV_CAPS(0x1019, true, false),
+ SET_DEV_CAPS(0x101a, true, false),
+ SET_DEV_CAPS(0x101b, true, false),
+ SET_DEV_CAPS(0x101c, true, true),
+ SET_DEV_CAPS(0x101e, false, false),
+ SET_DEV_CAPS(0x101f, false, false),
{.device_id = 0,}
};
@@ -317,6 +318,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
while (ark_device_caps[p].device_id != 0) {
if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
rqpacing = ark_device_caps[p].caps.rqpacing;
+ ark->isvf = ark_device_caps[p].caps.isvf;
break;
}
p++;
@@ -498,20 +500,21 @@ ark_config_device(struct rte_eth_dev *dev)
* Make sure that the packet director, generator and checker are in a
* known state
*/
- ark->start_pg = 0;
- ark->pg_running = 0;
- ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
- if (ark->pg == NULL)
- return -1;
- ark_pktgen_reset(ark->pg);
- ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
- if (ark->pc == NULL)
- return -1;
- ark_pktchkr_stop(ark->pc);
- ark->pd = ark_pktdir_init(ark->pktdir.v);
- if (ark->pd == NULL)
- return -1;
-
+ if (!ark->isvf) {
+ ark->start_pg = 0;
+ ark->pg_running = 0;
+ ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
+ if (ark->pg == NULL)
+ return -1;
+ ark_pktgen_reset(ark->pg);
+ ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
+ if (ark->pc == NULL)
+ return -1;
+ ark_pktchkr_stop(ark->pc);
+ ark->pd = ark_pktdir_init(ark->pktdir.v);
+ if (ark->pd == NULL)
+ return -1;
+ }
/* Verify HW */
if (ark_udm_verify(ark->udm.v))
return -1;
@@ -533,7 +536,7 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- if (ark->rqpacing)
+ if (!ark->isvf && ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
return 0;
@@ -551,8 +554,10 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev)
ark->user_ext.dev_uninit(dev,
ark->user_data[dev->data->port_id]);
- ark_pktgen_uninit(ark->pg);
- ark_pktchkr_uninit(ark->pc);
+ if (!ark->isvf) {
+ ark_pktgen_uninit(ark->pg);
+ ark_pktchkr_uninit(ark->pc);
+ }
return 0;
}
@@ -588,10 +593,10 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
dev->rx_pkt_burst = ð_ark_recv_pkts;
dev->tx_pkt_burst = ð_ark_xmit_pkts;
- if (ark->start_pg)
+ if (!ark->isvf && ark->start_pg)
ark_pktchkr_run(ark->pc);
- if (ark->start_pg && !ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && !ark->pg_running) {
pthread_t thread;
/* Delay packet generatpr start allow the hardware to be ready
@@ -635,7 +640,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
/* Stop the packet generator */
- if (ark->start_pg && ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && ark->pg_running) {
ark_pktgen_pause(ark->pg);
ark->pg_running = 0;
}
@@ -661,7 +666,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
eth_ark_rx_dump_queue(dev, i, __func__);
/* Stop the packet checker if it is running */
- if (ark->start_pg) {
+ if (!ark->isvf && ark->start_pg) {
ark_pktchkr_dump_stats(ark->pc);
ark_pktchkr_stop(ark->pc);
}
@@ -690,6 +695,10 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
+ /* return to power-on state */
+ if (ark->pd)
+ ark_pktdir_setup(ark->pd, ARK_PKT_DIR_INIT_VAL);
+
for (i = 0; i < dev->data->nb_tx_queues; i++) {
eth_ark_tx_queue_release(dev->data->tx_queues[i]);
dev->data->tx_queues[i] = 0;
@@ -974,6 +983,10 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params)
goto free_kvlist;
}
+ if (ark->isvf) {
+ ret = 0;
+ goto free_kvlist;
+ }
ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
/* Setup the packet director */
ark_pktdir_setup(ark->pd, ark->pkt_dir_v);
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index 3c3a712bc8..748db590c1 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -113,6 +113,7 @@ struct ark_adapter {
ark_pkt_dir_t pd;
int num_ports;
+ bool isvf;
/* Packet generator/checker args */
char pkt_gen_args[ARK_MAX_ARG_LEN];
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 6/7] net/ark: add new devices to support list
2022-05-19 21:36 ` [PATCH v2 6/7] net/ark: add new devices to support list Ed Czeck
@ 2022-05-20 8:14 ` Andrew Rybchenko
0 siblings, 0 replies; 49+ messages in thread
From: Andrew Rybchenko @ 2022-05-20 8:14 UTC (permalink / raw)
To: Ed Czeck, dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
On 5/20/22 00:36, Ed Czeck wrote:
> update device list is doc
>
> Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
I think it would be useful to advertise it in release notes.
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
` (5 preceding siblings ...)
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
@ 2022-05-20 14:15 ` Ed Czeck
2022-05-20 14:15 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
` (5 more replies)
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
8 siblings, 6 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-20 14:15 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Thomas Monjalon
DDM -> Downstream Data Mover
MPU -> Mbuf Prefetch Unit
UDM -> Upstream Data Mover
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
devtools/words-case.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/devtools/words-case.txt b/devtools/words-case.txt
index bc33470532..fa92ab273e 100644
--- a/devtools/words-case.txt
+++ b/devtools/words-case.txt
@@ -11,6 +11,7 @@ CPT
CQ
CRC
DCB
+DDM
DevX
DMA
eCPRI
@@ -46,6 +47,7 @@ LSC
MAC
MCAM
MPLS
+MPU
MSI
MSI-X
MSS
@@ -90,6 +92,7 @@ TPID
TSO
TTL
Tx
+UDM
UDP
ULP
vDPA
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 2/7] net/ark: update MPU functions for firmware update
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
@ 2022-05-20 14:15 ` Ed Czeck
2022-05-23 14:39 ` Ferruh Yigit
2022-05-20 14:15 ` [PATCH v2 3/7] net/ark: update DDM " Ed Czeck
` (4 subsequent siblings)
5 siblings, 1 reply; 49+ messages in thread
From: Ed Czeck @ 2022-05-20 14:15 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for MPU (Mbuf Prefetch Unit)
remove device-level global operations
remove ark_mpu_reset_stats function
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2:
- document version compatibility between firmware and DPDK
- reword commit message
---
doc/guides/nics/ark.rst | 15 +++++++++++++++
drivers/net/ark/ark_ethdev.c | 2 --
drivers/net/ark/ark_ethdev_rx.c | 4 ----
drivers/net/ark/ark_mpu.c | 21 ++++-----------------
drivers/net/ark/ark_mpu.h | 29 ++---------------------------
5 files changed, 21 insertions(+), 50 deletions(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index c965406a7b..29c0a07d60 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -300,6 +300,21 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
+DPDK and Arkville Firmware Versioning
+-------------------------------------
+
+Arkville's firmware and its PMD have version dependencies which must
+be stepped together at certain releases. PMD code ensures the versions are
+compatible. The following lists shows where version compatible steps have
+occurred. If other combinations are required, please contact Atomic Rules
+support.
+
+* DPDK 22.07 requires Arkville 22.07.
+* DPDK 22.03 requires Arkville 22.03.
+* DPDK 21.05 requires Arkville 21.05.
+* DPDK 18.11 requires Arkville 18.11.
+* DPDK 17.05 requires Arkville 17.05 -- initial version.
+
Supported Operating Systems
---------------------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 76b88c62d0..c0578b85ce 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -524,7 +524,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->rx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
@@ -536,7 +535,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 0fbb2603db..85e34d0bb8 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -91,9 +91,6 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
ark_udm_write_addr(queue->udm, phys_addr_prod_index);
- /* advance the valid pointer, but don't start until the queue starts */
- ark_mpu_reset_stats(queue->mpu);
-
/* The seed is the producer index for the HW */
ark_mpu_set_producer(queue->mpu, queue->seed_index);
dev->data->rx_queue_state[rx_queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
@@ -589,7 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
if (queue == 0)
return;
- ark_mpu_reset_stats(queue->mpu);
ark_udm_queue_stats_reset(queue->udm);
}
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index b8e94b6ed3..9d5ee7841b 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
{
uint32_t version;
- version = mpu->id.vernum & 0x0000fF00;
- if ((mpu->id.idnum != 0x2055504d) ||
- (mpu->hw.obj_size != obj_size) ||
- (version != 0x00003100)) {
+ version = mpu->id.vernum;
+ if (mpu->id.idnum != ARK_MPU_MODID ||
+ version != ARK_MPU_MODVER ||
+ mpu->hw.obj_size != obj_size) {
ARK_PMD_LOG(ERR,
" MPU module not found as expected %08x"
" \"%c%c%c%c %c%c%c%c\"\n",
@@ -79,16 +79,9 @@ ark_mpu_reset(struct ark_mpu_t *mpu)
mpu->cfg.command = MPU_CMD_FORCE_RESET;
usleep(10);
}
- ark_mpu_reset_stats(mpu);
return mpu->cfg.command != MPU_CMD_IDLE;
}
-void
-ark_mpu_reset_stats(struct ark_mpu_t *mpu)
-{
- mpu->stats.pci_request = 1; /* reset stats */
-}
-
int
ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
int is_tx)
@@ -118,12 +111,6 @@ ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
code, qid,
mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
- ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
- "\n",
- code,
- mpu->debug.state, mpu->debug.count,
- mpu->debug.reserved
- );
}
void
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index 92c3e67c86..9d2b70d35f 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -15,6 +15,8 @@
* there is minimal documentation.
*/
+#define ARK_MPU_MODID 0x2055504d
+#define ARK_MPU_MODVER 0x37313232
/*
* MPU hardware structures
* These are overlay structures to a memory mapped FPGA device. These
@@ -64,26 +66,6 @@ enum ARK_MPU_COMMAND {
MPU_COMMAND_LIMIT = 0xfFFFFFFF
};
-#define ARK_MPU_STATS 0x080
-struct ark_mpu_stats_t {
- volatile uint64_t pci_request;
- volatile uint64_t q_empty;
- volatile uint64_t q_q1;
- volatile uint64_t q_q2;
- volatile uint64_t q_q3;
- volatile uint64_t q_q4;
- volatile uint64_t q_full;
-};
-
-#define ARK_MPU_DEBUG 0x0C0
-struct ark_mpu_debug_t {
- volatile uint32_t state;
- uint32_t reserved;
- volatile uint32_t count;
- volatile uint32_t take;
- volatile uint32_t peek[4];
-};
-
/* Consolidated structure */
struct ark_mpu_t {
struct ark_mpu_id_t id;
@@ -93,12 +75,6 @@ struct ark_mpu_t {
uint8_t reserved1[(ARK_MPU_CFG - ARK_MPU_HW) -
sizeof(struct ark_mpu_hw_t)];
struct ark_mpu_cfg_t cfg;
- uint8_t reserved2[(ARK_MPU_STATS - ARK_MPU_CFG) -
- sizeof(struct ark_mpu_cfg_t)];
- struct ark_mpu_stats_t stats;
- uint8_t reserved3[(ARK_MPU_DEBUG - ARK_MPU_STATS) -
- sizeof(struct ark_mpu_stats_t)];
- struct ark_mpu_debug_t debug;
};
uint16_t ark_api_num_queues(struct ark_mpu_t *mpu);
@@ -113,7 +89,6 @@ int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);
-void ark_mpu_reset_stats(struct ark_mpu_t *mpu);
/* this action is in a performance critical path */
static inline void
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 3/7] net/ark: update DDM functions for firmware update
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-05-20 14:15 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
@ 2022-05-20 14:15 ` Ed Czeck
2022-05-20 14:15 ` [PATCH v2 4/7] net/ark: update UDM " Ed Czeck
` (3 subsequent siblings)
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-20 14:15 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for DDM (Downstream Data Mover)
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by firmware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2:
reword commit message
---
drivers/net/ark/ark_ddm.c | 80 +++++-------------------------
drivers/net/ark/ark_ddm.h | 86 +++++++++------------------------
drivers/net/ark/ark_ethdev.c | 33 -------------
drivers/net/ark/ark_ethdev_tx.c | 35 +++-----------
4 files changed, 40 insertions(+), 194 deletions(-)
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index b16c739d50..eb88349b7b 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -14,95 +14,45 @@ int
ark_ddm_verify(struct ark_ddm_t *ddm)
{
uint32_t hw_const;
+ uint32_t hw_ver;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
- hw_const = ddm->cfg.const0;
- if (hw_const == ARK_DDM_CONST3)
+ hw_const = ddm->cfg.idnum;
+ hw_ver = ddm->cfg.vernum;
+ if (hw_const == ARK_DDM_MODID && hw_ver == ARK_DDM_MODVER)
return 0;
- if (hw_const == ARK_DDM_CONST1) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 1, "
- "PMD expects version 2\n");
- return -1;
- }
-
- if (hw_const == ARK_DDM_CONST2) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 2, "
- "PMD expects version 3\n");
- return -1;
- }
ARK_PMD_LOG(ERR,
- "ARK: DDM module not found as expected 0x%08x\n",
- ddm->cfg.const0);
+ "ARK: DDM module not found as expected"
+ " id: %08x ver: %08x\n",
+ hw_const, hw_ver);
return -1;
}
void
-ark_ddm_start(struct ark_ddm_t *ddm)
-{
- ddm->cfg.command = 1;
-}
-
-int
-ark_ddm_stop(struct ark_ddm_t *ddm, const int wait)
+ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable)
{
- int cnt = 0;
-
- ddm->cfg.command = 2;
- rte_wmb();
- while (wait && (ddm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
+ ddm->setup.qcommand = enable ? 1U : 0U;
}
void
-ark_ddm_reset(struct ark_ddm_t *ddm)
-{
- int status;
-
- /* reset only works if ddm has stopped properly. */
- status = ark_ddm_stop(ddm, 1);
-
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- ddm->cfg.command = 4;
- usleep(10);
- }
- ddm->cfg.command = 3;
-}
-
-void
-ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr, uint32_t interval)
+ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr)
{
ddm->setup.cons_write_index_addr = cons_addr;
- ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
+ ddm->setup.cons_index = 0;
}
+/* Global stats clear */
void
ark_ddm_stats_reset(struct ark_ddm_t *ddm)
{
ddm->cfg.tlp_stats_clear = 1;
}
-void
-ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
- ark_ddm_is_stopped(ddm)
- );
-}
-
void
ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
{
@@ -116,12 +66,6 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
"MBufs", stats->tx_mbuf_count);
}
-int
-ark_ddm_is_stopped(struct ark_ddm_t *ddm)
-{
- return (ddm->cfg.stop_flushed & 0x01) != 0;
-}
-
uint64_t
ark_ddm_queue_byte_count(struct ark_ddm_t *ddm)
{
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index 687ff2519a..84beeb063a 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -40,17 +40,24 @@ union ark_tx_meta {
*/
#define ARK_DDM_CFG 0x0000
/* Set unique HW ID for hardware version */
-#define ARK_DDM_CONST3 (0x334d4444)
-#define ARK_DDM_CONST2 (0x324d4444)
-#define ARK_DDM_CONST1 (0xfacecafe)
+#define ARK_DDM_MODID 0x204d4444
+#define ARK_DDM_MODVER 0x37313232
struct ark_ddm_cfg_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ volatile uint32_t tlp_stats_clear;
+ };
uint32_t r0;
- volatile uint32_t tlp_stats_clear;
- uint32_t const0;
volatile uint32_t tag_max;
volatile uint32_t command;
- volatile uint32_t stop_flushed;
+ uint32_t write_index_interval; /* 4ns each */
+ volatile uint64_t qflow;
};
#define ARK_DDM_STATS 0x0020
@@ -60,34 +67,6 @@ struct ark_ddm_stats_t {
volatile uint64_t tx_mbuf_count;
};
-#define ARK_DDM_MRDQ 0x0040
-struct ark_ddm_mrdq_t {
- volatile uint32_t mrd_q1;
- volatile uint32_t mrd_q2;
- volatile uint32_t mrd_q3;
- volatile uint32_t mrd_q4;
- volatile uint32_t mrd_full;
-};
-
-#define ARK_DDM_CPLDQ 0x0068
-struct ark_ddm_cpldq_t {
- volatile uint32_t cpld_q1;
- volatile uint32_t cpld_q2;
- volatile uint32_t cpld_q3;
- volatile uint32_t cpld_q4;
- volatile uint32_t cpld_full;
-};
-
-#define ARK_DDM_MRD_PS 0x0090
-struct ark_ddm_mrd_ps_t {
- volatile uint32_t mrd_ps_min;
- volatile uint32_t mrd_ps_max;
- volatile uint32_t mrd_full_ps_min;
- volatile uint32_t mrd_full_ps_max;
- volatile uint32_t mrd_dw_ps_min;
- volatile uint32_t mrd_dw_ps_max;
-};
-
#define ARK_DDM_QUEUE_STATS 0x00a8
struct ark_ddm_qstats_t {
volatile uint64_t byte_count;
@@ -95,20 +74,10 @@ struct ark_ddm_qstats_t {
volatile uint64_t mbuf_count;
};
-#define ARK_DDM_CPLD_PS 0x00c0
-struct ark_ddm_cpld_ps_t {
- volatile uint32_t cpld_ps_min;
- volatile uint32_t cpld_ps_max;
- volatile uint32_t cpld_full_ps_min;
- volatile uint32_t cpld_full_ps_max;
- volatile uint32_t cpld_dw_ps_min;
- volatile uint32_t cpld_dw_ps_max;
-};
-
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
rte_iova_t cons_write_index_addr;
- uint32_t write_index_interval; /* 4ns each */
+ volatile uint32_t qcommand;
volatile uint32_t cons_index;
};
@@ -119,39 +88,28 @@ struct ark_ddm_t {
struct ark_ddm_cfg_t cfg;
uint8_t reserved0[(ARK_DDM_STATS - ARK_DDM_CFG) -
sizeof(struct ark_ddm_cfg_t)];
+
struct ark_ddm_stats_t stats;
- uint8_t reserved1[(ARK_DDM_MRDQ - ARK_DDM_STATS) -
+ uint8_t reserved1[(ARK_DDM_QUEUE_STATS - ARK_DDM_STATS) -
sizeof(struct ark_ddm_stats_t)];
- struct ark_ddm_mrdq_t mrdq;
- uint8_t reserved2[(ARK_DDM_CPLDQ - ARK_DDM_MRDQ) -
- sizeof(struct ark_ddm_mrdq_t)];
- struct ark_ddm_cpldq_t cpldq;
- uint8_t reserved3[(ARK_DDM_MRD_PS - ARK_DDM_CPLDQ) -
- sizeof(struct ark_ddm_cpldq_t)];
- struct ark_ddm_mrd_ps_t mrd_ps;
+
struct ark_ddm_qstats_t queue_stats;
- struct ark_ddm_cpld_ps_t cpld_ps;
- uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_CPLD_PS) -
- sizeof(struct ark_ddm_cpld_ps_t)];
+ uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_QUEUE_STATS) -
+ sizeof(struct ark_ddm_qstats_t)];
+
struct ark_ddm_setup_t setup;
uint8_t reserved_p[(ARK_DDM_EXPECTED_SIZE - ARK_DDM_SETUP) -
sizeof(struct ark_ddm_setup_t)];
};
-
/* DDM function prototype */
int ark_ddm_verify(struct ark_ddm_t *ddm);
-void ark_ddm_start(struct ark_ddm_t *ddm);
-int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
-void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
- uint32_t interval);
+void ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
-void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
-int ark_ddm_is_stopped(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_byte_count(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_pkt_count(struct ark_ddm_t *ddm);
void ark_ddm_queue_reset_stats(struct ark_ddm_t *ddm);
+void ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable);
#endif
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index c0578b85ce..07d1d2178d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -527,10 +527,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- /* TX -- DDM */
- if (ark_ddm_stop(ark->ddm.v, 1))
- ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
-
mpu = ark->mputx.v;
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
@@ -538,10 +534,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- ark_ddm_reset(ark->ddm.v);
- ark_ddm_stats_reset(ark->ddm.v);
-
- ark_ddm_stop(ark->ddm.v, 0);
if (ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
@@ -595,9 +587,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
for (i = 0; i < dev->data->nb_tx_queues; i++)
eth_ark_tx_queue_start(dev, i);
- /* start DDM */
- ark_ddm_start(ark->ddm.v);
-
ark->started = 1;
/* set xmit and receive function */
dev->rx_pkt_burst = ð_ark_recv_pkts;
@@ -671,28 +660,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* Stop DDM */
- /* Wait up to 0.1 second. each stop is up to 1000 * 10 useconds */
- for (i = 0; i < 10; i++) {
- status = ark_ddm_stop(ark->ddm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "DDM stop anomaly. status:"
- " %d iter: %u. (%s)\n",
- status,
- i,
- __func__);
- ark_ddm_dump(ark->ddm.v, "Stop anomaly");
-
- mpu = ark->mputx.v;
- for (i = 0; i < ark->tx_queues; i++) {
- ark_mpu_dump(mpu, "DDM failure dump", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
/* STOP RX Side */
/* Stop UDM multiple tries attempted */
for (i = 0; i < 10; i++) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index abdce6a8cc..5940a592a2 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -59,12 +59,6 @@ static int eth_ark_tx_jumbo(struct ark_tx_queue *queue,
static int eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue);
static void free_completed_tx(struct ark_tx_queue *queue);
-static inline void
-ark_tx_hw_queue_stop(struct ark_tx_queue *queue)
-{
- ark_mpu_stop(queue->mpu);
-}
-
/* ************************************************************************* */
static inline void
eth_ark_tx_desc_fill(struct ark_tx_queue *queue,
@@ -309,7 +303,6 @@ static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
rte_iova_t queue_base, ring_base, cons_index_addr;
- uint32_t write_interval_ns;
/* Verify HW -- MPU */
if (ark_mpu_verify(queue->mpu, sizeof(union ark_tx_meta)))
@@ -326,28 +319,9 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
/* Stop and Reset and configure MPU */
ark_mpu_configure(queue->mpu, ring_base, queue->queue_size, 1);
- /*
- * Adjust the write interval based on queue size --
- * increase pcie traffic when low mbuf count
- * Queue sizes less than 128 are not allowed
- */
- switch (queue->queue_size) {
- case 128:
- write_interval_ns = 500;
- break;
- case 256:
- write_interval_ns = 500;
- break;
- case 512:
- write_interval_ns = 1000;
- break;
- default:
- write_interval_ns = 2000;
- break;
- }
-
/* Completion address in UDM */
- ark_ddm_setup(queue->ddm, cons_index_addr, write_interval_ns);
+ ark_ddm_queue_setup(queue->ddm, cons_index_addr);
+ ark_ddm_queue_reset_stats(queue->ddm);
return 0;
}
@@ -360,7 +334,8 @@ eth_ark_tx_queue_release(void *vtx_queue)
queue = (struct ark_tx_queue *)vtx_queue;
- ark_tx_hw_queue_stop(queue);
+ ark_ddm_queue_enable(queue->ddm, 0);
+ ark_mpu_stop(queue->mpu);
queue->cons_index = queue->prod_index;
free_completed_tx(queue);
@@ -386,6 +361,7 @@ eth_ark_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id)
return -1;
}
+ ark_ddm_queue_enable(queue->ddm, 0);
ark_mpu_stop(queue->mpu);
free_completed_tx(queue);
@@ -404,6 +380,7 @@ eth_ark_tx_queue_start(struct rte_eth_dev *dev, uint16_t queue_id)
return 0;
ark_mpu_start(queue->mpu);
+ ark_ddm_queue_enable(queue->ddm, 1);
dev->data->tx_queue_state[queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 4/7] net/ark: update UDM functions for firmware update
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-05-20 14:15 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
2022-05-20 14:15 ` [PATCH v2 3/7] net/ark: update DDM " Ed Czeck
@ 2022-05-20 14:15 ` Ed Czeck
2022-05-20 14:15 ` [PATCH v2 5/7] net/ark: report additional errors from firmware Ed Czeck
` (2 subsequent siblings)
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-20 14:15 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for UDM (Upstream Data Mover)
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by firmware
remove performance structs as they are not in the firmware module
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2: reword commit message
---
drivers/net/ark/ark_ethdev.c | 34 +----------
drivers/net/ark/ark_ethdev_rx.c | 38 +-----------
drivers/net/ark/ark_ethdev_rx.h | 1 -
drivers/net/ark/ark_udm.c | 103 +++-----------------------------
drivers/net/ark/ark_udm.h | 73 +++++-----------------
5 files changed, 27 insertions(+), 222 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 07d1d2178d..8b4daa819b 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -512,13 +512,6 @@ ark_config_device(struct rte_eth_dev *dev)
if (ark_ddm_verify(ark->ddm.v))
return -1;
- /* UDM */
- if (ark_udm_reset(ark->udm.v)) {
- ARK_PMD_LOG(ERR, "Unable to stop and reset UDM\n");
- return -1;
- }
- /* Keep in reset until the MPU are cleared */
-
/* MPU reset */
mpu = ark->mpurx.v;
num_q = ark_api_num_queues(mpu);
@@ -577,9 +570,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
int i;
/* RX Side */
- /* start UDM */
- ark_udm_start(ark->udm.v);
-
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_start_queue(dev, i);
@@ -627,7 +617,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
uint16_t i;
int status;
struct ark_adapter *ark = dev->data->dev_private;
- struct ark_mpu_t *mpu;
if (ark->started == 0)
return 0;
@@ -660,27 +649,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* STOP RX Side */
- /* Stop UDM multiple tries attempted */
- for (i = 0; i < 10; i++) {
- status = ark_udm_stop(ark->udm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
- status, i, __func__);
- ark_udm_dump(ark->udm.v, "Stop anomaly");
-
- mpu = ark->mpurx.v;
- for (i = 0; i < ark->rx_queues; i++) {
- ark_mpu_dump(mpu, "UDM Stop anomaly", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
ark_udm_dump_stats(ark->udm.v, "Post stop");
- ark_udm_dump_perf(ark->udm.v, "Post stop");
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_dump_queue(dev, i, __func__);
@@ -708,10 +677,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
eth_ark_dev_stop(dev);
- eth_ark_udm_force_close(dev);
/*
- * TODO This should only be called once for the device during shutdown
+ * This should only be called once for the device during shutdown
*/
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 85e34d0bb8..cbc0416bc2 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -200,13 +200,10 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
queue->mpu = RTE_PTR_ADD(ark->mpurx.v, qidx * ARK_MPU_QOFFSET);
/* Configure UDM per queue */
- ark_udm_stop(queue->udm, 0);
ark_udm_configure(queue->udm,
RTE_PKTMBUF_HEADROOM,
- queue->dataroom,
- ARK_RX_WRITE_TIME_NS);
- ark_udm_stats_reset(queue->udm);
- ark_udm_stop(queue->udm, 0);
+ queue->dataroom);
+ ark_udm_queue_stats_reset(queue->udm);
/* populate mbuf reserve */
status = eth_ark_rx_seed_mbufs(queue);
@@ -589,36 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
ark_udm_queue_stats_reset(queue->udm);
}
-void
-eth_ark_udm_force_close(struct rte_eth_dev *dev)
-{
- struct ark_adapter *ark = dev->data->dev_private;
- struct ark_rx_queue *queue;
- uint32_t index;
- uint16_t i;
-
- if (!ark_udm_is_flushed(ark->udm.v)) {
- /* restart the MPUs */
- ARK_PMD_LOG(NOTICE, "UDM not flushed -- forcing flush\n");
- for (i = 0; i < dev->data->nb_rx_queues; i++) {
- queue = (struct ark_rx_queue *)dev->data->rx_queues[i];
- if (queue == 0)
- continue;
-
- ark_mpu_start(queue->mpu);
- /* Add some buffers */
- index = ARK_RX_MPU_CHUNK + queue->seed_index;
- ark_mpu_set_producer(queue->mpu, index);
- }
- /* Wait to allow data to pass */
- usleep(100);
-
- ARK_PMD_LOG(NOTICE, "UDM forced flush attempt, stopped = %d\n",
- ark_udm_is_flushed(ark->udm.v));
- }
- ark_udm_reset(ark->udm.v);
-}
-
static void
ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
{
@@ -633,7 +600,6 @@ ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
ark_mpu_dump(queue->mpu, name, queue->phys_qid);
ark_mpu_dump_setup(queue->mpu, queue->phys_qid);
- ark_udm_dump(queue->udm, name);
ark_udm_dump_setup(queue->udm, queue->phys_qid);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index f64b3dd137..2e3400fd2f 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -27,6 +27,5 @@ void eth_rx_queue_stats_get(void *vqueue, struct rte_eth_stats *stats);
void eth_rx_queue_stats_reset(void *vqueue);
void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id,
const char *msg);
-void eth_ark_udm_force_close(struct rte_eth_dev *dev);
#endif
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 9ebed89627..81b141ad0b 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -12,6 +12,8 @@ static_assert(sizeof(struct ark_rx_meta) == 32, "Unexpected struct size ark_rx_m
int
ark_udm_verify(struct ark_udm_t *udm)
{
+ uint32_t idnum = udm->setup.idnum;
+ uint32_t vernum = udm->setup.vernum;
if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
ARK_PMD_LOG(ERR,
"ARK: UDM structure looks incorrect %d vs %zd\n",
@@ -19,94 +21,30 @@ ark_udm_verify(struct ark_udm_t *udm)
return -1;
}
- if (udm->setup.const0 != ARK_UDM_CONST) {
+ if (idnum != ARK_UDM_MODID || vernum != ARK_UDM_MODVER) {
ARK_PMD_LOG(ERR,
- "ARK: UDM module not found as expected 0x%08x\n",
- udm->setup.const0);
+ "ARK: UDM module not found as expected 0x%08x 0x%08x\n",
+ idnum, vernum);
return -1;
}
return 0;
}
-int
-ark_udm_stop(struct ark_udm_t *udm, const int wait)
-{
- int cnt = 0;
-
- udm->setup.r0 = 0;
- udm->cfg.command = 2;
- rte_wmb();
-
- while (wait && (udm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
-}
-
-int
-ark_udm_reset(struct ark_udm_t *udm)
-{
- int status;
-
- status = ark_udm_stop(udm, 1);
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- udm->cfg.command = 4;
- usleep(10);
- udm->cfg.command = 3;
- status = ark_udm_stop(udm, 0);
- ARK_PMD_LOG(INFO, "%s stop status %d post failure"
- " and forced reset\n",
- __func__, status);
- } else {
- udm->cfg.command = 3;
- }
-
- return status;
-}
-
-void
-ark_udm_start(struct ark_udm_t *udm)
-{
- udm->setup.r0 = 0x100;
- udm->cfg.command = 1;
-}
-
-void
-ark_udm_stats_reset(struct ark_udm_t *udm)
-{
- udm->pcibp.pci_clear = 1;
- udm->tlp_ps.tlp_clear = 1;
-}
-
void
ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns)
+ uint32_t dataroom)
{
/* headroom and data room are in DWords in the UDM */
udm->cfg.dataroom = dataroom / 4;
udm->cfg.headroom = headroom / 4;
-
- /* 4 NS period ns */
- udm->rt_cfg.write_interval = write_interval_ns / 4;
}
void
ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
-}
-
-int
-ark_udm_is_flushed(struct ark_udm_t *udm)
-{
- return (udm->cfg.stop_flushed & 0x01) != 0;
+ udm->rt_cfg.prod_idx = 0;
}
uint64_t
@@ -131,11 +69,10 @@ void
ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
{
ARK_PMD_LOG(INFO, "UDM Stats: %s"
- ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
+ ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
msg,
"Pkts Received", udm->stats.rx_packet_count,
"Pkts Finalized", udm->stats.rx_sent_packets,
- "Pkts Dropped", udm->tlp.pkt_drop,
"Bytes Count", udm->stats.rx_byte_count,
"MBuf Count", udm->stats.rx_mbuf_count);
}
@@ -155,13 +92,6 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
"MBuf Count", udm->qstats.q_mbuf_count);
}
-void
-ark_udm_dump(struct ark_udm_t *udm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
- udm->cfg.stop_flushed);
-}
-
void
ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
{
@@ -172,23 +102,6 @@ ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
"prod_idx", udm->rt_cfg.prod_idx);
}
-void
-ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
-{
- struct ark_udm_pcibp_t *bp = &udm->pcibp;
-
- ARK_PMD_LOG(INFO, "UDM Performance %s"
- ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
- "\n",
- msg,
- "PCI Empty", bp->pci_empty,
- "PCI Q1", bp->pci_q1,
- "PCI Q2", bp->pci_q2,
- "PCI Q3", bp->pci_q3,
- "PCI Q4", bp->pci_q4,
- "PCI Full", bp->pci_full);
-}
-
void
ark_udm_queue_stats_reset(struct ark_udm_t *udm)
{
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 1cbcd94a98..f0685c95c7 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -32,19 +32,25 @@ struct ark_rx_meta {
#define ARK_RX_WRITE_TIME_NS 2500
#define ARK_UDM_SETUP 0
-#define ARK_UDM_CONST2 0xbACECACE
-#define ARK_UDM_CONST3 0x344d4455
-#define ARK_UDM_CONST ARK_UDM_CONST3
+#define ARK_UDM_MODID 0x4d445500
+#define ARK_UDM_MODVER 0x37313232
+
struct ark_udm_setup_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ };
uint32_t r0;
- uint32_t r4;
- volatile uint32_t cycle_count;
uint32_t const0;
};
#define ARK_UDM_CFG 0x010
struct ark_udm_cfg_t {
- volatile uint32_t stop_flushed; /* RO */
+ uint32_t write_interval; /* 4ns cycles */
volatile uint32_t command;
uint32_t dataroom;
uint32_t headroom;
@@ -74,45 +80,11 @@ struct ark_udm_queue_stats_t {
uint32_t q_enable;
};
-#define ARK_UDM_TLP 0x0070
-struct ark_udm_tlp_t {
- volatile uint64_t pkt_drop; /* global */
- volatile uint32_t tlp_q1;
- volatile uint32_t tlp_q2;
- volatile uint32_t tlp_q3;
- volatile uint32_t tlp_q4;
- volatile uint32_t tlp_full;
-};
-
-#define ARK_UDM_PCIBP 0x00a0
-struct ark_udm_pcibp_t {
- volatile uint32_t pci_clear;
- volatile uint32_t pci_empty;
- volatile uint32_t pci_q1;
- volatile uint32_t pci_q2;
- volatile uint32_t pci_q3;
- volatile uint32_t pci_q4;
- volatile uint32_t pci_full;
-};
-
-#define ARK_UDM_TLP_PS 0x00bc
-struct ark_udm_tlp_ps_t {
- volatile uint32_t tlp_clear;
- volatile uint32_t tlp_ps_min;
- volatile uint32_t tlp_ps_max;
- volatile uint32_t tlp_full_ps_min;
- volatile uint32_t tlp_full_ps_max;
- volatile uint32_t tlp_dw_ps_min;
- volatile uint32_t tlp_dw_ps_max;
- volatile uint32_t tlp_pldw_ps_min;
- volatile uint32_t tlp_pldw_ps_max;
-};
-
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
rte_iova_t hw_prod_addr;
- uint32_t write_interval; /* 4ns cycles */
- volatile uint32_t prod_idx; /* RO */
+ uint32_t reserved;
+ volatile uint32_t prod_idx; /* Updated by HW */
};
/* Consolidated structure */
@@ -123,13 +95,8 @@ struct ark_udm_t {
struct ark_udm_cfg_t cfg;
struct ark_udm_stats_t stats;
struct ark_udm_queue_stats_t qstats;
- uint8_t reserved1[(ARK_UDM_TLP - ARK_UDM_PQ) -
+ uint8_t reserved1[(ARK_UDM_RT_CFG - ARK_UDM_PQ) -
sizeof(struct ark_udm_queue_stats_t)];
- struct ark_udm_tlp_t tlp;
- uint8_t reserved2[(ARK_UDM_PCIBP - ARK_UDM_TLP) -
- sizeof(struct ark_udm_tlp_t)];
- struct ark_udm_pcibp_t pcibp;
- struct ark_udm_tlp_ps_t tlp_ps;
struct ark_udm_rt_cfg_t rt_cfg;
int8_t reserved3[(ARK_UDM_EXPECT_SIZE - ARK_UDM_RT_CFG) -
sizeof(struct ark_udm_rt_cfg_t)];
@@ -137,22 +104,14 @@ struct ark_udm_t {
int ark_udm_verify(struct ark_udm_t *udm);
-int ark_udm_stop(struct ark_udm_t *udm, int wait);
-void ark_udm_start(struct ark_udm_t *udm);
-int ark_udm_reset(struct ark_udm_t *udm);
void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns);
+ uint32_t dataroom);
void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
-void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
uint16_t qid);
-void ark_udm_dump(struct ark_udm_t *udm, const char *msg);
-void ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
-int ark_udm_is_flushed(struct ark_udm_t *udm);
/* Per queue data */
uint64_t ark_udm_dropped(struct ark_udm_t *udm);
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 5/7] net/ark: report additional errors from firmware
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (2 preceding siblings ...)
2022-05-20 14:15 ` [PATCH v2 4/7] net/ark: update UDM " Ed Czeck
@ 2022-05-20 14:15 ` Ed Czeck
2022-05-20 14:15 ` [PATCH v2 6/7] net/ark: add new devices to support list Ed Czeck
2022-05-20 14:15 ` [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-20 14:15 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
detect and report completion errors from firmware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_rqp.c | 6 ++++--
drivers/net/ark/ark_rqp.h | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ark/ark_rqp.c b/drivers/net/ark/ark_rqp.c
index ef9ccd0706..efb9730fe6 100644
--- a/drivers/net/ark/ark_rqp.c
+++ b/drivers/net/ark/ark_rqp.c
@@ -22,14 +22,16 @@ ark_rqp_stats_reset(struct ark_rqpace_t *rqp)
void
ark_rqp_dump(struct ark_rqpace_t *rqp)
{
- if (rqp->err_count_other != 0)
+ if (rqp->err_count_other || rqp->cmpl_errors)
ARK_PMD_LOG(ERR,
"RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
+ ARK_SU32
ARK_SU32 "\n",
rqp->ctrl, rqp->cplh_max, rqp->cpld_max,
"Error Count", rqp->err_cnt,
- "Error General", rqp->err_count_other);
+ "Error General", rqp->err_count_other,
+ "Cmpl Errors", rqp->cmpl_errors);
ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
diff --git a/drivers/net/ark/ark_rqp.h b/drivers/net/ark/ark_rqp.h
index 6c8046062b..d09f242e1e 100644
--- a/drivers/net/ark/ark_rqp.h
+++ b/drivers/net/ark/ark_rqp.h
@@ -48,7 +48,8 @@ struct ark_rqpace_t {
volatile uint32_t cpld_pending_max;
volatile uint32_t err_count_other;
char eval[4];
- volatile int lasped;
+ volatile int32_t lasped;
+ volatile uint32_t cmpl_errors;
};
void ark_rqp_dump(struct ark_rqpace_t *rqp);
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 6/7] net/ark: add new devices to support list
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (3 preceding siblings ...)
2022-05-20 14:15 ` [PATCH v2 5/7] net/ark: report additional errors from firmware Ed Czeck
@ 2022-05-20 14:15 ` Ed Czeck
2022-05-20 14:15 ` [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-05-20 14:15 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
update device list is doc
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
doc/guides/nics/ark.rst | 4 +++-
drivers/net/ark/ark_ethdev.c | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index 29c0a07d60..f4ffb05b2f 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -297,6 +297,9 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:1017`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Primary Endpoint]
* ``1d6c:1018`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Secondary Endpoint]
* ``1d6c:1019`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Tertiary Endpoint]
+* ``1d6c:101a`` - AR-ARK-SRIOV-FX0 [Arkville 32B Primary Physical Function]
+* ``1d6c:101b`` - AR-ARK-SRIOV-FX1 [Arkville 64B Primary Physical Function]
+* ``1d6c:101c`` - AR-ARK-SRIOV-VF [Arkville Virtual Function]
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
@@ -337,7 +340,6 @@ Unsupported Features
Features that may be part of, or become part of, the Arkville RTL IP that are
not currently supported or exposed by the ARK PMD include:
-* PCIe SR-IOV Virtual Functions (VFs)
* Arkville's Packet Generator Control and Status
* Arkville's Packet Director Control and Status
* Arkville's Packet Checker Control and Status
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 8b4daa819b..7cf896f6f1 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -94,6 +94,9 @@ static const struct rte_pci_id pci_id_ark_map[] = {
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101a)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101b)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
{.vendor_id = 0, /* sentinel */ },
@@ -127,6 +130,9 @@ ark_device_caps[] = {
SET_DEV_CAPS(0x1017, true),
SET_DEV_CAPS(0x1018, true),
SET_DEV_CAPS(0x1019, true),
+ SET_DEV_CAPS(0x101a, true),
+ SET_DEV_CAPS(0x101b, true),
+ SET_DEV_CAPS(0x101c, false),
SET_DEV_CAPS(0x101e, false),
SET_DEV_CAPS(0x101f, false),
{.device_id = 0,}
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (4 preceding siblings ...)
2022-05-20 14:15 ` [PATCH v2 6/7] net/ark: add new devices to support list Ed Czeck
@ 2022-05-20 14:15 ` Ed Czeck
2022-05-23 14:38 ` Ferruh Yigit
5 siblings, 1 reply; 49+ messages in thread
From: Ed Czeck @ 2022-05-20 14:15 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
Add capabilities field isvf to dev struct
Disable configuration calls as required by vf
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2: feature Arkville vf support int release notes
---
doc/guides/rel_notes/release_22_07.rst | 4 ++
drivers/net/ark/ark_ethdev.c | 83 +++++++++++++++-----------
drivers/net/ark/ark_global.h | 1 +
3 files changed, 53 insertions(+), 35 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index e49cacecef..09b42ee5ea 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -104,6 +104,10 @@ New Features
* ``RTE_EVENT_QUEUE_ATTR_WEIGHT``
* ``RTE_EVENT_QUEUE_ATTR_AFFINITY``
+* **Updated Atomic Rules' Arkville PMD.**
+
+ Added support for virtual functions and new Atomic Rules PCI device
+ IDs ``0x101a, 0x101b, 0x101c``.
Removed Items
-------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 7cf896f6f1..ec6c5a9525 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -113,28 +113,29 @@ static const struct rte_pci_id pci_id_ark_map[] = {
*/
struct ark_caps {
bool rqpacing;
+ bool isvf;
};
struct ark_dev_caps {
uint32_t device_id;
struct ark_caps caps;
};
-#define SET_DEV_CAPS(id, rqp) \
- {id, {.rqpacing = rqp} }
+#define SET_DEV_CAPS(id, rqp, vf) \
+ {id, {.rqpacing = rqp, .isvf = vf} }
static const struct ark_dev_caps
ark_device_caps[] = {
- SET_DEV_CAPS(0x100d, true),
- SET_DEV_CAPS(0x100e, true),
- SET_DEV_CAPS(0x100f, true),
- SET_DEV_CAPS(0x1010, false),
- SET_DEV_CAPS(0x1017, true),
- SET_DEV_CAPS(0x1018, true),
- SET_DEV_CAPS(0x1019, true),
- SET_DEV_CAPS(0x101a, true),
- SET_DEV_CAPS(0x101b, true),
- SET_DEV_CAPS(0x101c, false),
- SET_DEV_CAPS(0x101e, false),
- SET_DEV_CAPS(0x101f, false),
+ SET_DEV_CAPS(0x100d, true, false),
+ SET_DEV_CAPS(0x100e, true, false),
+ SET_DEV_CAPS(0x100f, true, false),
+ SET_DEV_CAPS(0x1010, false, false),
+ SET_DEV_CAPS(0x1017, true, false),
+ SET_DEV_CAPS(0x1018, true, false),
+ SET_DEV_CAPS(0x1019, true, false),
+ SET_DEV_CAPS(0x101a, true, false),
+ SET_DEV_CAPS(0x101b, true, false),
+ SET_DEV_CAPS(0x101c, true, true),
+ SET_DEV_CAPS(0x101e, false, false),
+ SET_DEV_CAPS(0x101f, false, false),
{.device_id = 0,}
};
@@ -317,6 +318,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
while (ark_device_caps[p].device_id != 0) {
if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
rqpacing = ark_device_caps[p].caps.rqpacing;
+ ark->isvf = ark_device_caps[p].caps.isvf;
break;
}
p++;
@@ -498,20 +500,21 @@ ark_config_device(struct rte_eth_dev *dev)
* Make sure that the packet director, generator and checker are in a
* known state
*/
- ark->start_pg = 0;
- ark->pg_running = 0;
- ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
- if (ark->pg == NULL)
- return -1;
- ark_pktgen_reset(ark->pg);
- ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
- if (ark->pc == NULL)
- return -1;
- ark_pktchkr_stop(ark->pc);
- ark->pd = ark_pktdir_init(ark->pktdir.v);
- if (ark->pd == NULL)
- return -1;
-
+ if (!ark->isvf) {
+ ark->start_pg = 0;
+ ark->pg_running = 0;
+ ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
+ if (ark->pg == NULL)
+ return -1;
+ ark_pktgen_reset(ark->pg);
+ ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
+ if (ark->pc == NULL)
+ return -1;
+ ark_pktchkr_stop(ark->pc);
+ ark->pd = ark_pktdir_init(ark->pktdir.v);
+ if (ark->pd == NULL)
+ return -1;
+ }
/* Verify HW */
if (ark_udm_verify(ark->udm.v))
return -1;
@@ -533,7 +536,7 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- if (ark->rqpacing)
+ if (!ark->isvf && ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
return 0;
@@ -551,8 +554,10 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev)
ark->user_ext.dev_uninit(dev,
ark->user_data[dev->data->port_id]);
- ark_pktgen_uninit(ark->pg);
- ark_pktchkr_uninit(ark->pc);
+ if (!ark->isvf) {
+ ark_pktgen_uninit(ark->pg);
+ ark_pktchkr_uninit(ark->pc);
+ }
return 0;
}
@@ -588,10 +593,10 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
dev->rx_pkt_burst = ð_ark_recv_pkts;
dev->tx_pkt_burst = ð_ark_xmit_pkts;
- if (ark->start_pg)
+ if (!ark->isvf && ark->start_pg)
ark_pktchkr_run(ark->pc);
- if (ark->start_pg && !ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && !ark->pg_running) {
pthread_t thread;
/* Delay packet generatpr start allow the hardware to be ready
@@ -635,7 +640,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
/* Stop the packet generator */
- if (ark->start_pg && ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && ark->pg_running) {
ark_pktgen_pause(ark->pg);
ark->pg_running = 0;
}
@@ -661,7 +666,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
eth_ark_rx_dump_queue(dev, i, __func__);
/* Stop the packet checker if it is running */
- if (ark->start_pg) {
+ if (!ark->isvf && ark->start_pg) {
ark_pktchkr_dump_stats(ark->pc);
ark_pktchkr_stop(ark->pc);
}
@@ -690,6 +695,10 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
+ /* return to power-on state */
+ if (ark->pd)
+ ark_pktdir_setup(ark->pd, ARK_PKT_DIR_INIT_VAL);
+
for (i = 0; i < dev->data->nb_tx_queues; i++) {
eth_ark_tx_queue_release(dev->data->tx_queues[i]);
dev->data->tx_queues[i] = 0;
@@ -974,6 +983,10 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params)
goto free_kvlist;
}
+ if (ark->isvf) {
+ ret = 0;
+ goto free_kvlist;
+ }
ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
/* Setup the packet director */
ark_pktdir_setup(ark->pd, ark->pkt_dir_v);
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index 3c3a712bc8..748db590c1 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -113,6 +113,7 @@ struct ark_adapter {
ark_pkt_dir_t pd;
int num_ports;
+ bool isvf;
/* Packet generator/checker args */
char pkt_gen_args[ARK_MAX_ARG_LEN];
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions
2022-05-20 14:15 ` [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
@ 2022-05-23 14:38 ` Ferruh Yigit
0 siblings, 0 replies; 49+ messages in thread
From: Ferruh Yigit @ 2022-05-23 14:38 UTC (permalink / raw)
To: Ed Czeck, dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
On 5/20/2022 3:15 PM, Ed Czeck wrote:
> diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
> index e49cacecef..09b42ee5ea 100644
> --- a/doc/guides/rel_notes/release_22_07.rst
> +++ b/doc/guides/rel_notes/release_22_07.rst
> @@ -104,6 +104,10 @@ New Features
> * ``RTE_EVENT_QUEUE_ATTR_WEIGHT``
> * ``RTE_EVENT_QUEUE_ATTR_AFFINITY``
>
> +* **Updated Atomic Rules' Arkville PMD.**
> +
> + Added support for virtual functions and new Atomic Rules PCI device
> + IDs ``0x101a, 0x101b, 0x101c``.
Can you please split this to the patches that adds the mentioned support:
patch 6/7:
- Added support for new Atomic Rules devices ``0x101a, 0x101b, 0x101c``.
path 7/7:
- Added support for virtual functions.
Thanks,
ferruh
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 2/7] net/ark: update MPU functions for firmware update
2022-05-20 14:15 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
@ 2022-05-23 14:39 ` Ferruh Yigit
0 siblings, 0 replies; 49+ messages in thread
From: Ferruh Yigit @ 2022-05-23 14:39 UTC (permalink / raw)
To: Ed Czeck, dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
On 5/20/2022 3:15 PM, Ed Czeck wrote:
> diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
> index c965406a7b..29c0a07d60 100644
> --- a/doc/guides/nics/ark.rst
> +++ b/doc/guides/nics/ark.rst
> @@ -300,6 +300,21 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
> * ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
> * ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
>
> +DPDK and Arkville Firmware Versioning
> +-------------------------------------
> +
> +Arkville's firmware and its PMD have version dependencies which must
> +be stepped together at certain releases. PMD code ensures the versions are
> +compatible. The following lists shows where version compatible steps have
> +occurred. If other combinations are required, please contact Atomic Rules
> +support.
> +
> +* DPDK 22.07 requires Arkville 22.07.
> +* DPDK 22.03 requires Arkville 22.03.
> +* DPDK 21.05 requires Arkville 21.05.
> +* DPDK 18.11 requires Arkville 18.11.
> +* DPDK 17.05 requires Arkville 17.05 -- initial version.
This means dpdk21.08 & dpdk21.11 supports "Arkville 21.05", right?
And what exactly "Arkville 22.07" represents, I assume it is a package
distributed by Arkville. Is the "Arkville 22.07" information enough, or
is there any benefit to document required FW versions?
Also can you please update release notes that device FW(s) needs to be
updated to "Arkville 22.07".
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
` (6 preceding siblings ...)
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
@ 2022-06-07 15:49 ` Ed Czeck
2022-06-07 15:49 ` [PATCH v3 2/7] net/ark: update MPU functions for firmware update Ed Czeck
` (5 more replies)
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
8 siblings, 6 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 15:49 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Thomas Monjalon
DDM -> Downstream Data Mover
MPU -> Mbuf Prefetch Unit
UDM -> Upstream Data Mover
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
devtools/words-case.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/devtools/words-case.txt b/devtools/words-case.txt
index bc33470532..fa92ab273e 100644
--- a/devtools/words-case.txt
+++ b/devtools/words-case.txt
@@ -11,6 +11,7 @@ CPT
CQ
CRC
DCB
+DDM
DevX
DMA
eCPRI
@@ -46,6 +47,7 @@ LSC
MAC
MCAM
MPLS
+MPU
MSI
MSI-X
MSS
@@ -90,6 +92,7 @@ TPID
TSO
TTL
Tx
+UDM
UDP
ULP
vDPA
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v3 2/7] net/ark: update MPU functions for firmware update
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
@ 2022-06-07 15:49 ` Ed Czeck
2022-06-07 15:49 ` [PATCH v3 3/7] net/ark: update DDM " Ed Czeck
` (4 subsequent siblings)
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 15:49 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for MPU (Mbuf Prefetch Unit)
remove device-level global operations
remove ark_mpu_reset_stats function
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2:
- document version compatibility between firmware and DPDK
- reword commit message
---
doc/guides/nics/ark.rst | 15 +++++++++++++++
drivers/net/ark/ark_ethdev.c | 2 --
drivers/net/ark/ark_ethdev_rx.c | 4 ----
drivers/net/ark/ark_mpu.c | 21 ++++-----------------
drivers/net/ark/ark_mpu.h | 29 ++---------------------------
5 files changed, 21 insertions(+), 50 deletions(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index c965406a7b..29c0a07d60 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -300,6 +300,21 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
+DPDK and Arkville Firmware Versioning
+-------------------------------------
+
+Arkville's firmware and its PMD have version dependencies which must
+be stepped together at certain releases. PMD code ensures the versions are
+compatible. The following lists shows where version compatible steps have
+occurred. If other combinations are required, please contact Atomic Rules
+support.
+
+* DPDK 22.07 requires Arkville 22.07.
+* DPDK 22.03 requires Arkville 22.03.
+* DPDK 21.05 requires Arkville 21.05.
+* DPDK 18.11 requires Arkville 18.11.
+* DPDK 17.05 requires Arkville 17.05 -- initial version.
+
Supported Operating Systems
---------------------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 76b88c62d0..c0578b85ce 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -524,7 +524,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->rx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
@@ -536,7 +535,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 0fbb2603db..85e34d0bb8 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -91,9 +91,6 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
ark_udm_write_addr(queue->udm, phys_addr_prod_index);
- /* advance the valid pointer, but don't start until the queue starts */
- ark_mpu_reset_stats(queue->mpu);
-
/* The seed is the producer index for the HW */
ark_mpu_set_producer(queue->mpu, queue->seed_index);
dev->data->rx_queue_state[rx_queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
@@ -589,7 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
if (queue == 0)
return;
- ark_mpu_reset_stats(queue->mpu);
ark_udm_queue_stats_reset(queue->udm);
}
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index b8e94b6ed3..9d5ee7841b 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
{
uint32_t version;
- version = mpu->id.vernum & 0x0000fF00;
- if ((mpu->id.idnum != 0x2055504d) ||
- (mpu->hw.obj_size != obj_size) ||
- (version != 0x00003100)) {
+ version = mpu->id.vernum;
+ if (mpu->id.idnum != ARK_MPU_MODID ||
+ version != ARK_MPU_MODVER ||
+ mpu->hw.obj_size != obj_size) {
ARK_PMD_LOG(ERR,
" MPU module not found as expected %08x"
" \"%c%c%c%c %c%c%c%c\"\n",
@@ -79,16 +79,9 @@ ark_mpu_reset(struct ark_mpu_t *mpu)
mpu->cfg.command = MPU_CMD_FORCE_RESET;
usleep(10);
}
- ark_mpu_reset_stats(mpu);
return mpu->cfg.command != MPU_CMD_IDLE;
}
-void
-ark_mpu_reset_stats(struct ark_mpu_t *mpu)
-{
- mpu->stats.pci_request = 1; /* reset stats */
-}
-
int
ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
int is_tx)
@@ -118,12 +111,6 @@ ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
code, qid,
mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
- ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
- "\n",
- code,
- mpu->debug.state, mpu->debug.count,
- mpu->debug.reserved
- );
}
void
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index 92c3e67c86..9d2b70d35f 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -15,6 +15,8 @@
* there is minimal documentation.
*/
+#define ARK_MPU_MODID 0x2055504d
+#define ARK_MPU_MODVER 0x37313232
/*
* MPU hardware structures
* These are overlay structures to a memory mapped FPGA device. These
@@ -64,26 +66,6 @@ enum ARK_MPU_COMMAND {
MPU_COMMAND_LIMIT = 0xfFFFFFFF
};
-#define ARK_MPU_STATS 0x080
-struct ark_mpu_stats_t {
- volatile uint64_t pci_request;
- volatile uint64_t q_empty;
- volatile uint64_t q_q1;
- volatile uint64_t q_q2;
- volatile uint64_t q_q3;
- volatile uint64_t q_q4;
- volatile uint64_t q_full;
-};
-
-#define ARK_MPU_DEBUG 0x0C0
-struct ark_mpu_debug_t {
- volatile uint32_t state;
- uint32_t reserved;
- volatile uint32_t count;
- volatile uint32_t take;
- volatile uint32_t peek[4];
-};
-
/* Consolidated structure */
struct ark_mpu_t {
struct ark_mpu_id_t id;
@@ -93,12 +75,6 @@ struct ark_mpu_t {
uint8_t reserved1[(ARK_MPU_CFG - ARK_MPU_HW) -
sizeof(struct ark_mpu_hw_t)];
struct ark_mpu_cfg_t cfg;
- uint8_t reserved2[(ARK_MPU_STATS - ARK_MPU_CFG) -
- sizeof(struct ark_mpu_cfg_t)];
- struct ark_mpu_stats_t stats;
- uint8_t reserved3[(ARK_MPU_DEBUG - ARK_MPU_STATS) -
- sizeof(struct ark_mpu_stats_t)];
- struct ark_mpu_debug_t debug;
};
uint16_t ark_api_num_queues(struct ark_mpu_t *mpu);
@@ -113,7 +89,6 @@ int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);
-void ark_mpu_reset_stats(struct ark_mpu_t *mpu);
/* this action is in a performance critical path */
static inline void
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v3 3/7] net/ark: update DDM functions for firmware update
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-06-07 15:49 ` [PATCH v3 2/7] net/ark: update MPU functions for firmware update Ed Czeck
@ 2022-06-07 15:49 ` Ed Czeck
2022-06-07 15:49 ` [PATCH v3 4/7] net/ark: update UDM " Ed Czeck
` (3 subsequent siblings)
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 15:49 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for DDM (Downstream Data Mover)
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by firmware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2:
reword commit message
---
drivers/net/ark/ark_ddm.c | 80 +++++-------------------------
drivers/net/ark/ark_ddm.h | 86 +++++++++------------------------
drivers/net/ark/ark_ethdev.c | 33 -------------
drivers/net/ark/ark_ethdev_tx.c | 35 +++-----------
4 files changed, 40 insertions(+), 194 deletions(-)
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index b16c739d50..eb88349b7b 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -14,95 +14,45 @@ int
ark_ddm_verify(struct ark_ddm_t *ddm)
{
uint32_t hw_const;
+ uint32_t hw_ver;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
- hw_const = ddm->cfg.const0;
- if (hw_const == ARK_DDM_CONST3)
+ hw_const = ddm->cfg.idnum;
+ hw_ver = ddm->cfg.vernum;
+ if (hw_const == ARK_DDM_MODID && hw_ver == ARK_DDM_MODVER)
return 0;
- if (hw_const == ARK_DDM_CONST1) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 1, "
- "PMD expects version 2\n");
- return -1;
- }
-
- if (hw_const == ARK_DDM_CONST2) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 2, "
- "PMD expects version 3\n");
- return -1;
- }
ARK_PMD_LOG(ERR,
- "ARK: DDM module not found as expected 0x%08x\n",
- ddm->cfg.const0);
+ "ARK: DDM module not found as expected"
+ " id: %08x ver: %08x\n",
+ hw_const, hw_ver);
return -1;
}
void
-ark_ddm_start(struct ark_ddm_t *ddm)
-{
- ddm->cfg.command = 1;
-}
-
-int
-ark_ddm_stop(struct ark_ddm_t *ddm, const int wait)
+ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable)
{
- int cnt = 0;
-
- ddm->cfg.command = 2;
- rte_wmb();
- while (wait && (ddm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
+ ddm->setup.qcommand = enable ? 1U : 0U;
}
void
-ark_ddm_reset(struct ark_ddm_t *ddm)
-{
- int status;
-
- /* reset only works if ddm has stopped properly. */
- status = ark_ddm_stop(ddm, 1);
-
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- ddm->cfg.command = 4;
- usleep(10);
- }
- ddm->cfg.command = 3;
-}
-
-void
-ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr, uint32_t interval)
+ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr)
{
ddm->setup.cons_write_index_addr = cons_addr;
- ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
+ ddm->setup.cons_index = 0;
}
+/* Global stats clear */
void
ark_ddm_stats_reset(struct ark_ddm_t *ddm)
{
ddm->cfg.tlp_stats_clear = 1;
}
-void
-ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
- ark_ddm_is_stopped(ddm)
- );
-}
-
void
ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
{
@@ -116,12 +66,6 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
"MBufs", stats->tx_mbuf_count);
}
-int
-ark_ddm_is_stopped(struct ark_ddm_t *ddm)
-{
- return (ddm->cfg.stop_flushed & 0x01) != 0;
-}
-
uint64_t
ark_ddm_queue_byte_count(struct ark_ddm_t *ddm)
{
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index 687ff2519a..84beeb063a 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -40,17 +40,24 @@ union ark_tx_meta {
*/
#define ARK_DDM_CFG 0x0000
/* Set unique HW ID for hardware version */
-#define ARK_DDM_CONST3 (0x334d4444)
-#define ARK_DDM_CONST2 (0x324d4444)
-#define ARK_DDM_CONST1 (0xfacecafe)
+#define ARK_DDM_MODID 0x204d4444
+#define ARK_DDM_MODVER 0x37313232
struct ark_ddm_cfg_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ volatile uint32_t tlp_stats_clear;
+ };
uint32_t r0;
- volatile uint32_t tlp_stats_clear;
- uint32_t const0;
volatile uint32_t tag_max;
volatile uint32_t command;
- volatile uint32_t stop_flushed;
+ uint32_t write_index_interval; /* 4ns each */
+ volatile uint64_t qflow;
};
#define ARK_DDM_STATS 0x0020
@@ -60,34 +67,6 @@ struct ark_ddm_stats_t {
volatile uint64_t tx_mbuf_count;
};
-#define ARK_DDM_MRDQ 0x0040
-struct ark_ddm_mrdq_t {
- volatile uint32_t mrd_q1;
- volatile uint32_t mrd_q2;
- volatile uint32_t mrd_q3;
- volatile uint32_t mrd_q4;
- volatile uint32_t mrd_full;
-};
-
-#define ARK_DDM_CPLDQ 0x0068
-struct ark_ddm_cpldq_t {
- volatile uint32_t cpld_q1;
- volatile uint32_t cpld_q2;
- volatile uint32_t cpld_q3;
- volatile uint32_t cpld_q4;
- volatile uint32_t cpld_full;
-};
-
-#define ARK_DDM_MRD_PS 0x0090
-struct ark_ddm_mrd_ps_t {
- volatile uint32_t mrd_ps_min;
- volatile uint32_t mrd_ps_max;
- volatile uint32_t mrd_full_ps_min;
- volatile uint32_t mrd_full_ps_max;
- volatile uint32_t mrd_dw_ps_min;
- volatile uint32_t mrd_dw_ps_max;
-};
-
#define ARK_DDM_QUEUE_STATS 0x00a8
struct ark_ddm_qstats_t {
volatile uint64_t byte_count;
@@ -95,20 +74,10 @@ struct ark_ddm_qstats_t {
volatile uint64_t mbuf_count;
};
-#define ARK_DDM_CPLD_PS 0x00c0
-struct ark_ddm_cpld_ps_t {
- volatile uint32_t cpld_ps_min;
- volatile uint32_t cpld_ps_max;
- volatile uint32_t cpld_full_ps_min;
- volatile uint32_t cpld_full_ps_max;
- volatile uint32_t cpld_dw_ps_min;
- volatile uint32_t cpld_dw_ps_max;
-};
-
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
rte_iova_t cons_write_index_addr;
- uint32_t write_index_interval; /* 4ns each */
+ volatile uint32_t qcommand;
volatile uint32_t cons_index;
};
@@ -119,39 +88,28 @@ struct ark_ddm_t {
struct ark_ddm_cfg_t cfg;
uint8_t reserved0[(ARK_DDM_STATS - ARK_DDM_CFG) -
sizeof(struct ark_ddm_cfg_t)];
+
struct ark_ddm_stats_t stats;
- uint8_t reserved1[(ARK_DDM_MRDQ - ARK_DDM_STATS) -
+ uint8_t reserved1[(ARK_DDM_QUEUE_STATS - ARK_DDM_STATS) -
sizeof(struct ark_ddm_stats_t)];
- struct ark_ddm_mrdq_t mrdq;
- uint8_t reserved2[(ARK_DDM_CPLDQ - ARK_DDM_MRDQ) -
- sizeof(struct ark_ddm_mrdq_t)];
- struct ark_ddm_cpldq_t cpldq;
- uint8_t reserved3[(ARK_DDM_MRD_PS - ARK_DDM_CPLDQ) -
- sizeof(struct ark_ddm_cpldq_t)];
- struct ark_ddm_mrd_ps_t mrd_ps;
+
struct ark_ddm_qstats_t queue_stats;
- struct ark_ddm_cpld_ps_t cpld_ps;
- uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_CPLD_PS) -
- sizeof(struct ark_ddm_cpld_ps_t)];
+ uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_QUEUE_STATS) -
+ sizeof(struct ark_ddm_qstats_t)];
+
struct ark_ddm_setup_t setup;
uint8_t reserved_p[(ARK_DDM_EXPECTED_SIZE - ARK_DDM_SETUP) -
sizeof(struct ark_ddm_setup_t)];
};
-
/* DDM function prototype */
int ark_ddm_verify(struct ark_ddm_t *ddm);
-void ark_ddm_start(struct ark_ddm_t *ddm);
-int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
-void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
- uint32_t interval);
+void ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
-void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
-int ark_ddm_is_stopped(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_byte_count(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_pkt_count(struct ark_ddm_t *ddm);
void ark_ddm_queue_reset_stats(struct ark_ddm_t *ddm);
+void ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable);
#endif
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index c0578b85ce..07d1d2178d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -527,10 +527,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- /* TX -- DDM */
- if (ark_ddm_stop(ark->ddm.v, 1))
- ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
-
mpu = ark->mputx.v;
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
@@ -538,10 +534,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- ark_ddm_reset(ark->ddm.v);
- ark_ddm_stats_reset(ark->ddm.v);
-
- ark_ddm_stop(ark->ddm.v, 0);
if (ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
@@ -595,9 +587,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
for (i = 0; i < dev->data->nb_tx_queues; i++)
eth_ark_tx_queue_start(dev, i);
- /* start DDM */
- ark_ddm_start(ark->ddm.v);
-
ark->started = 1;
/* set xmit and receive function */
dev->rx_pkt_burst = ð_ark_recv_pkts;
@@ -671,28 +660,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* Stop DDM */
- /* Wait up to 0.1 second. each stop is up to 1000 * 10 useconds */
- for (i = 0; i < 10; i++) {
- status = ark_ddm_stop(ark->ddm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "DDM stop anomaly. status:"
- " %d iter: %u. (%s)\n",
- status,
- i,
- __func__);
- ark_ddm_dump(ark->ddm.v, "Stop anomaly");
-
- mpu = ark->mputx.v;
- for (i = 0; i < ark->tx_queues; i++) {
- ark_mpu_dump(mpu, "DDM failure dump", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
/* STOP RX Side */
/* Stop UDM multiple tries attempted */
for (i = 0; i < 10; i++) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index abdce6a8cc..5940a592a2 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -59,12 +59,6 @@ static int eth_ark_tx_jumbo(struct ark_tx_queue *queue,
static int eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue);
static void free_completed_tx(struct ark_tx_queue *queue);
-static inline void
-ark_tx_hw_queue_stop(struct ark_tx_queue *queue)
-{
- ark_mpu_stop(queue->mpu);
-}
-
/* ************************************************************************* */
static inline void
eth_ark_tx_desc_fill(struct ark_tx_queue *queue,
@@ -309,7 +303,6 @@ static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
rte_iova_t queue_base, ring_base, cons_index_addr;
- uint32_t write_interval_ns;
/* Verify HW -- MPU */
if (ark_mpu_verify(queue->mpu, sizeof(union ark_tx_meta)))
@@ -326,28 +319,9 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
/* Stop and Reset and configure MPU */
ark_mpu_configure(queue->mpu, ring_base, queue->queue_size, 1);
- /*
- * Adjust the write interval based on queue size --
- * increase pcie traffic when low mbuf count
- * Queue sizes less than 128 are not allowed
- */
- switch (queue->queue_size) {
- case 128:
- write_interval_ns = 500;
- break;
- case 256:
- write_interval_ns = 500;
- break;
- case 512:
- write_interval_ns = 1000;
- break;
- default:
- write_interval_ns = 2000;
- break;
- }
-
/* Completion address in UDM */
- ark_ddm_setup(queue->ddm, cons_index_addr, write_interval_ns);
+ ark_ddm_queue_setup(queue->ddm, cons_index_addr);
+ ark_ddm_queue_reset_stats(queue->ddm);
return 0;
}
@@ -360,7 +334,8 @@ eth_ark_tx_queue_release(void *vtx_queue)
queue = (struct ark_tx_queue *)vtx_queue;
- ark_tx_hw_queue_stop(queue);
+ ark_ddm_queue_enable(queue->ddm, 0);
+ ark_mpu_stop(queue->mpu);
queue->cons_index = queue->prod_index;
free_completed_tx(queue);
@@ -386,6 +361,7 @@ eth_ark_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id)
return -1;
}
+ ark_ddm_queue_enable(queue->ddm, 0);
ark_mpu_stop(queue->mpu);
free_completed_tx(queue);
@@ -404,6 +380,7 @@ eth_ark_tx_queue_start(struct rte_eth_dev *dev, uint16_t queue_id)
return 0;
ark_mpu_start(queue->mpu);
+ ark_ddm_queue_enable(queue->ddm, 1);
dev->data->tx_queue_state[queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v3 4/7] net/ark: update UDM functions for firmware update
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-06-07 15:49 ` [PATCH v3 2/7] net/ark: update MPU functions for firmware update Ed Czeck
2022-06-07 15:49 ` [PATCH v3 3/7] net/ark: update DDM " Ed Czeck
@ 2022-06-07 15:49 ` Ed Czeck
2022-06-07 15:49 ` [PATCH v3 5/7] net/ark: report additional errors from firmware Ed Czeck
` (2 subsequent siblings)
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 15:49 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for UDM (Upstream Data Mover)
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by firmware
remove performance structs as they are not in the firmware module
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2: reword commit message
v3: include queue stop during device stop
---
drivers/net/ark/ark_ethdev.c | 38 ++----------
drivers/net/ark/ark_ethdev_rx.c | 38 +-----------
drivers/net/ark/ark_ethdev_rx.h | 1 -
drivers/net/ark/ark_udm.c | 103 +++-----------------------------
drivers/net/ark/ark_udm.h | 73 +++++-----------------
5 files changed, 31 insertions(+), 222 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 07d1d2178d..2abc35283d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -512,13 +512,6 @@ ark_config_device(struct rte_eth_dev *dev)
if (ark_ddm_verify(ark->ddm.v))
return -1;
- /* UDM */
- if (ark_udm_reset(ark->udm.v)) {
- ARK_PMD_LOG(ERR, "Unable to stop and reset UDM\n");
- return -1;
- }
- /* Keep in reset until the MPU are cleared */
-
/* MPU reset */
mpu = ark->mpurx.v;
num_q = ark_api_num_queues(mpu);
@@ -577,9 +570,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
int i;
/* RX Side */
- /* start UDM */
- ark_udm_start(ark->udm.v);
-
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_start_queue(dev, i);
@@ -627,7 +617,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
uint16_t i;
int status;
struct ark_adapter *ark = dev->data->dev_private;
- struct ark_mpu_t *mpu;
if (ark->started == 0)
return 0;
@@ -648,6 +637,10 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
+ /* Stop RX Side */
+ for (i = 0; i < dev->data->nb_rx_queues; i++)
+ eth_ark_rx_stop_queue(dev, i);
+
/* STOP TX Side */
for (i = 0; i < dev->data->nb_tx_queues; i++) {
status = eth_ark_tx_queue_stop(dev, i);
@@ -660,27 +653,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* STOP RX Side */
- /* Stop UDM multiple tries attempted */
- for (i = 0; i < 10; i++) {
- status = ark_udm_stop(ark->udm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
- status, i, __func__);
- ark_udm_dump(ark->udm.v, "Stop anomaly");
-
- mpu = ark->mpurx.v;
- for (i = 0; i < ark->rx_queues; i++) {
- ark_mpu_dump(mpu, "UDM Stop anomaly", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
ark_udm_dump_stats(ark->udm.v, "Post stop");
- ark_udm_dump_perf(ark->udm.v, "Post stop");
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_dump_queue(dev, i, __func__);
@@ -708,10 +681,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
eth_ark_dev_stop(dev);
- eth_ark_udm_force_close(dev);
/*
- * TODO This should only be called once for the device during shutdown
+ * This should only be called once for the device during shutdown
*/
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 85e34d0bb8..cbc0416bc2 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -200,13 +200,10 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
queue->mpu = RTE_PTR_ADD(ark->mpurx.v, qidx * ARK_MPU_QOFFSET);
/* Configure UDM per queue */
- ark_udm_stop(queue->udm, 0);
ark_udm_configure(queue->udm,
RTE_PKTMBUF_HEADROOM,
- queue->dataroom,
- ARK_RX_WRITE_TIME_NS);
- ark_udm_stats_reset(queue->udm);
- ark_udm_stop(queue->udm, 0);
+ queue->dataroom);
+ ark_udm_queue_stats_reset(queue->udm);
/* populate mbuf reserve */
status = eth_ark_rx_seed_mbufs(queue);
@@ -589,36 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
ark_udm_queue_stats_reset(queue->udm);
}
-void
-eth_ark_udm_force_close(struct rte_eth_dev *dev)
-{
- struct ark_adapter *ark = dev->data->dev_private;
- struct ark_rx_queue *queue;
- uint32_t index;
- uint16_t i;
-
- if (!ark_udm_is_flushed(ark->udm.v)) {
- /* restart the MPUs */
- ARK_PMD_LOG(NOTICE, "UDM not flushed -- forcing flush\n");
- for (i = 0; i < dev->data->nb_rx_queues; i++) {
- queue = (struct ark_rx_queue *)dev->data->rx_queues[i];
- if (queue == 0)
- continue;
-
- ark_mpu_start(queue->mpu);
- /* Add some buffers */
- index = ARK_RX_MPU_CHUNK + queue->seed_index;
- ark_mpu_set_producer(queue->mpu, index);
- }
- /* Wait to allow data to pass */
- usleep(100);
-
- ARK_PMD_LOG(NOTICE, "UDM forced flush attempt, stopped = %d\n",
- ark_udm_is_flushed(ark->udm.v));
- }
- ark_udm_reset(ark->udm.v);
-}
-
static void
ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
{
@@ -633,7 +600,6 @@ ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
ark_mpu_dump(queue->mpu, name, queue->phys_qid);
ark_mpu_dump_setup(queue->mpu, queue->phys_qid);
- ark_udm_dump(queue->udm, name);
ark_udm_dump_setup(queue->udm, queue->phys_qid);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index f64b3dd137..2e3400fd2f 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -27,6 +27,5 @@ void eth_rx_queue_stats_get(void *vqueue, struct rte_eth_stats *stats);
void eth_rx_queue_stats_reset(void *vqueue);
void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id,
const char *msg);
-void eth_ark_udm_force_close(struct rte_eth_dev *dev);
#endif
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 9ebed89627..81b141ad0b 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -12,6 +12,8 @@ static_assert(sizeof(struct ark_rx_meta) == 32, "Unexpected struct size ark_rx_m
int
ark_udm_verify(struct ark_udm_t *udm)
{
+ uint32_t idnum = udm->setup.idnum;
+ uint32_t vernum = udm->setup.vernum;
if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
ARK_PMD_LOG(ERR,
"ARK: UDM structure looks incorrect %d vs %zd\n",
@@ -19,94 +21,30 @@ ark_udm_verify(struct ark_udm_t *udm)
return -1;
}
- if (udm->setup.const0 != ARK_UDM_CONST) {
+ if (idnum != ARK_UDM_MODID || vernum != ARK_UDM_MODVER) {
ARK_PMD_LOG(ERR,
- "ARK: UDM module not found as expected 0x%08x\n",
- udm->setup.const0);
+ "ARK: UDM module not found as expected 0x%08x 0x%08x\n",
+ idnum, vernum);
return -1;
}
return 0;
}
-int
-ark_udm_stop(struct ark_udm_t *udm, const int wait)
-{
- int cnt = 0;
-
- udm->setup.r0 = 0;
- udm->cfg.command = 2;
- rte_wmb();
-
- while (wait && (udm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
-}
-
-int
-ark_udm_reset(struct ark_udm_t *udm)
-{
- int status;
-
- status = ark_udm_stop(udm, 1);
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- udm->cfg.command = 4;
- usleep(10);
- udm->cfg.command = 3;
- status = ark_udm_stop(udm, 0);
- ARK_PMD_LOG(INFO, "%s stop status %d post failure"
- " and forced reset\n",
- __func__, status);
- } else {
- udm->cfg.command = 3;
- }
-
- return status;
-}
-
-void
-ark_udm_start(struct ark_udm_t *udm)
-{
- udm->setup.r0 = 0x100;
- udm->cfg.command = 1;
-}
-
-void
-ark_udm_stats_reset(struct ark_udm_t *udm)
-{
- udm->pcibp.pci_clear = 1;
- udm->tlp_ps.tlp_clear = 1;
-}
-
void
ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns)
+ uint32_t dataroom)
{
/* headroom and data room are in DWords in the UDM */
udm->cfg.dataroom = dataroom / 4;
udm->cfg.headroom = headroom / 4;
-
- /* 4 NS period ns */
- udm->rt_cfg.write_interval = write_interval_ns / 4;
}
void
ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
-}
-
-int
-ark_udm_is_flushed(struct ark_udm_t *udm)
-{
- return (udm->cfg.stop_flushed & 0x01) != 0;
+ udm->rt_cfg.prod_idx = 0;
}
uint64_t
@@ -131,11 +69,10 @@ void
ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
{
ARK_PMD_LOG(INFO, "UDM Stats: %s"
- ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
+ ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
msg,
"Pkts Received", udm->stats.rx_packet_count,
"Pkts Finalized", udm->stats.rx_sent_packets,
- "Pkts Dropped", udm->tlp.pkt_drop,
"Bytes Count", udm->stats.rx_byte_count,
"MBuf Count", udm->stats.rx_mbuf_count);
}
@@ -155,13 +92,6 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
"MBuf Count", udm->qstats.q_mbuf_count);
}
-void
-ark_udm_dump(struct ark_udm_t *udm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
- udm->cfg.stop_flushed);
-}
-
void
ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
{
@@ -172,23 +102,6 @@ ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
"prod_idx", udm->rt_cfg.prod_idx);
}
-void
-ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
-{
- struct ark_udm_pcibp_t *bp = &udm->pcibp;
-
- ARK_PMD_LOG(INFO, "UDM Performance %s"
- ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
- "\n",
- msg,
- "PCI Empty", bp->pci_empty,
- "PCI Q1", bp->pci_q1,
- "PCI Q2", bp->pci_q2,
- "PCI Q3", bp->pci_q3,
- "PCI Q4", bp->pci_q4,
- "PCI Full", bp->pci_full);
-}
-
void
ark_udm_queue_stats_reset(struct ark_udm_t *udm)
{
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 1cbcd94a98..f0685c95c7 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -32,19 +32,25 @@ struct ark_rx_meta {
#define ARK_RX_WRITE_TIME_NS 2500
#define ARK_UDM_SETUP 0
-#define ARK_UDM_CONST2 0xbACECACE
-#define ARK_UDM_CONST3 0x344d4455
-#define ARK_UDM_CONST ARK_UDM_CONST3
+#define ARK_UDM_MODID 0x4d445500
+#define ARK_UDM_MODVER 0x37313232
+
struct ark_udm_setup_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ };
uint32_t r0;
- uint32_t r4;
- volatile uint32_t cycle_count;
uint32_t const0;
};
#define ARK_UDM_CFG 0x010
struct ark_udm_cfg_t {
- volatile uint32_t stop_flushed; /* RO */
+ uint32_t write_interval; /* 4ns cycles */
volatile uint32_t command;
uint32_t dataroom;
uint32_t headroom;
@@ -74,45 +80,11 @@ struct ark_udm_queue_stats_t {
uint32_t q_enable;
};
-#define ARK_UDM_TLP 0x0070
-struct ark_udm_tlp_t {
- volatile uint64_t pkt_drop; /* global */
- volatile uint32_t tlp_q1;
- volatile uint32_t tlp_q2;
- volatile uint32_t tlp_q3;
- volatile uint32_t tlp_q4;
- volatile uint32_t tlp_full;
-};
-
-#define ARK_UDM_PCIBP 0x00a0
-struct ark_udm_pcibp_t {
- volatile uint32_t pci_clear;
- volatile uint32_t pci_empty;
- volatile uint32_t pci_q1;
- volatile uint32_t pci_q2;
- volatile uint32_t pci_q3;
- volatile uint32_t pci_q4;
- volatile uint32_t pci_full;
-};
-
-#define ARK_UDM_TLP_PS 0x00bc
-struct ark_udm_tlp_ps_t {
- volatile uint32_t tlp_clear;
- volatile uint32_t tlp_ps_min;
- volatile uint32_t tlp_ps_max;
- volatile uint32_t tlp_full_ps_min;
- volatile uint32_t tlp_full_ps_max;
- volatile uint32_t tlp_dw_ps_min;
- volatile uint32_t tlp_dw_ps_max;
- volatile uint32_t tlp_pldw_ps_min;
- volatile uint32_t tlp_pldw_ps_max;
-};
-
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
rte_iova_t hw_prod_addr;
- uint32_t write_interval; /* 4ns cycles */
- volatile uint32_t prod_idx; /* RO */
+ uint32_t reserved;
+ volatile uint32_t prod_idx; /* Updated by HW */
};
/* Consolidated structure */
@@ -123,13 +95,8 @@ struct ark_udm_t {
struct ark_udm_cfg_t cfg;
struct ark_udm_stats_t stats;
struct ark_udm_queue_stats_t qstats;
- uint8_t reserved1[(ARK_UDM_TLP - ARK_UDM_PQ) -
+ uint8_t reserved1[(ARK_UDM_RT_CFG - ARK_UDM_PQ) -
sizeof(struct ark_udm_queue_stats_t)];
- struct ark_udm_tlp_t tlp;
- uint8_t reserved2[(ARK_UDM_PCIBP - ARK_UDM_TLP) -
- sizeof(struct ark_udm_tlp_t)];
- struct ark_udm_pcibp_t pcibp;
- struct ark_udm_tlp_ps_t tlp_ps;
struct ark_udm_rt_cfg_t rt_cfg;
int8_t reserved3[(ARK_UDM_EXPECT_SIZE - ARK_UDM_RT_CFG) -
sizeof(struct ark_udm_rt_cfg_t)];
@@ -137,22 +104,14 @@ struct ark_udm_t {
int ark_udm_verify(struct ark_udm_t *udm);
-int ark_udm_stop(struct ark_udm_t *udm, int wait);
-void ark_udm_start(struct ark_udm_t *udm);
-int ark_udm_reset(struct ark_udm_t *udm);
void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns);
+ uint32_t dataroom);
void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
-void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
uint16_t qid);
-void ark_udm_dump(struct ark_udm_t *udm, const char *msg);
-void ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
-int ark_udm_is_flushed(struct ark_udm_t *udm);
/* Per queue data */
uint64_t ark_udm_dropped(struct ark_udm_t *udm);
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v3 5/7] net/ark: report additional errors from firmware
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (2 preceding siblings ...)
2022-06-07 15:49 ` [PATCH v3 4/7] net/ark: update UDM " Ed Czeck
@ 2022-06-07 15:49 ` Ed Czeck
2022-06-07 15:49 ` [PATCH v3 6/7] net/ark: add new devices to support list Ed Czeck
2022-06-07 15:49 ` [PATCH v3 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 15:49 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
detect and report completion errors from firmware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_rqp.c | 6 ++++--
drivers/net/ark/ark_rqp.h | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ark/ark_rqp.c b/drivers/net/ark/ark_rqp.c
index ef9ccd0706..efb9730fe6 100644
--- a/drivers/net/ark/ark_rqp.c
+++ b/drivers/net/ark/ark_rqp.c
@@ -22,14 +22,16 @@ ark_rqp_stats_reset(struct ark_rqpace_t *rqp)
void
ark_rqp_dump(struct ark_rqpace_t *rqp)
{
- if (rqp->err_count_other != 0)
+ if (rqp->err_count_other || rqp->cmpl_errors)
ARK_PMD_LOG(ERR,
"RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
+ ARK_SU32
ARK_SU32 "\n",
rqp->ctrl, rqp->cplh_max, rqp->cpld_max,
"Error Count", rqp->err_cnt,
- "Error General", rqp->err_count_other);
+ "Error General", rqp->err_count_other,
+ "Cmpl Errors", rqp->cmpl_errors);
ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
diff --git a/drivers/net/ark/ark_rqp.h b/drivers/net/ark/ark_rqp.h
index 6c8046062b..d09f242e1e 100644
--- a/drivers/net/ark/ark_rqp.h
+++ b/drivers/net/ark/ark_rqp.h
@@ -48,7 +48,8 @@ struct ark_rqpace_t {
volatile uint32_t cpld_pending_max;
volatile uint32_t err_count_other;
char eval[4];
- volatile int lasped;
+ volatile int32_t lasped;
+ volatile uint32_t cmpl_errors;
};
void ark_rqp_dump(struct ark_rqpace_t *rqp);
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v3 6/7] net/ark: add new devices to support list
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (3 preceding siblings ...)
2022-06-07 15:49 ` [PATCH v3 5/7] net/ark: report additional errors from firmware Ed Czeck
@ 2022-06-07 15:49 ` Ed Czeck
2022-06-07 15:49 ` [PATCH v3 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 15:49 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
update device list is doc
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v3: clarification in doc for LTS support
---
doc/guides/nics/ark.rst | 7 +++++--
drivers/net/ark/ark_ethdev.c | 6 ++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index 29c0a07d60..44488f0ce8 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -297,6 +297,9 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:1017`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Primary Endpoint]
* ``1d6c:1018`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Secondary Endpoint]
* ``1d6c:1019`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Tertiary Endpoint]
+* ``1d6c:101a`` - AR-ARK-SRIOV-FX0 [Arkville 32B Primary Physical Function]
+* ``1d6c:101b`` - AR-ARK-SRIOV-FX1 [Arkville 64B Primary Physical Function]
+* ``1d6c:101c`` - AR-ARK-SRIOV-VF [Arkville Virtual Function]
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
@@ -307,7 +310,8 @@ Arkville's firmware and its PMD have version dependencies which must
be stepped together at certain releases. PMD code ensures the versions are
compatible. The following lists shows where version compatible steps have
occurred. If other combinations are required, please contact Atomic Rules
-support.
+support. LTS versions of DPDK remain compatible with the corresponding
+Arkville version.
* DPDK 22.07 requires Arkville 22.07.
* DPDK 22.03 requires Arkville 22.03.
@@ -337,7 +341,6 @@ Unsupported Features
Features that may be part of, or become part of, the Arkville RTL IP that are
not currently supported or exposed by the ARK PMD include:
-* PCIe SR-IOV Virtual Functions (VFs)
* Arkville's Packet Generator Control and Status
* Arkville's Packet Director Control and Status
* Arkville's Packet Checker Control and Status
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 2abc35283d..377631e66e 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -94,6 +94,9 @@ static const struct rte_pci_id pci_id_ark_map[] = {
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101a)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101b)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
{.vendor_id = 0, /* sentinel */ },
@@ -127,6 +130,9 @@ ark_device_caps[] = {
SET_DEV_CAPS(0x1017, true),
SET_DEV_CAPS(0x1018, true),
SET_DEV_CAPS(0x1019, true),
+ SET_DEV_CAPS(0x101a, true),
+ SET_DEV_CAPS(0x101b, true),
+ SET_DEV_CAPS(0x101c, false),
SET_DEV_CAPS(0x101e, false),
SET_DEV_CAPS(0x101f, false),
{.device_id = 0,}
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v3 7/7] net/ark: add PMD support for devices as virtual functions
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (4 preceding siblings ...)
2022-06-07 15:49 ` [PATCH v3 6/7] net/ark: add new devices to support list Ed Czeck
@ 2022-06-07 15:49 ` Ed Czeck
5 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 15:49 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
Add capabilities field isvf to dev struct
Disable configuration calls as required by vf
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2: feature Arkville vf support in release notes
v3: feature new PCI device ids in release notes
---
doc/guides/rel_notes/release_22_07.rst | 5 ++
drivers/net/ark/ark_ethdev.c | 83 +++++++++++++++-----------
drivers/net/ark/ark_global.h | 1 +
3 files changed, 54 insertions(+), 35 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index e49cacecef..4b90293f14 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -104,6 +104,11 @@ New Features
* ``RTE_EVENT_QUEUE_ATTR_WEIGHT``
* ``RTE_EVENT_QUEUE_ATTR_AFFINITY``
+* **Updated Atomic Rules' Arkville PMD.**
+
+ Added support for Atomic Rules PCI device IDs ``0x101a, 0x101b, 0x101c``.
+
+ Added PMD support for virtual functions and vfio_pci driver.
Removed Items
-------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 377631e66e..e8e4092be6 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -113,28 +113,29 @@ static const struct rte_pci_id pci_id_ark_map[] = {
*/
struct ark_caps {
bool rqpacing;
+ bool isvf;
};
struct ark_dev_caps {
uint32_t device_id;
struct ark_caps caps;
};
-#define SET_DEV_CAPS(id, rqp) \
- {id, {.rqpacing = rqp} }
+#define SET_DEV_CAPS(id, rqp, vf) \
+ {id, {.rqpacing = rqp, .isvf = vf} }
static const struct ark_dev_caps
ark_device_caps[] = {
- SET_DEV_CAPS(0x100d, true),
- SET_DEV_CAPS(0x100e, true),
- SET_DEV_CAPS(0x100f, true),
- SET_DEV_CAPS(0x1010, false),
- SET_DEV_CAPS(0x1017, true),
- SET_DEV_CAPS(0x1018, true),
- SET_DEV_CAPS(0x1019, true),
- SET_DEV_CAPS(0x101a, true),
- SET_DEV_CAPS(0x101b, true),
- SET_DEV_CAPS(0x101c, false),
- SET_DEV_CAPS(0x101e, false),
- SET_DEV_CAPS(0x101f, false),
+ SET_DEV_CAPS(0x100d, true, false),
+ SET_DEV_CAPS(0x100e, true, false),
+ SET_DEV_CAPS(0x100f, true, false),
+ SET_DEV_CAPS(0x1010, false, false),
+ SET_DEV_CAPS(0x1017, true, false),
+ SET_DEV_CAPS(0x1018, true, false),
+ SET_DEV_CAPS(0x1019, true, false),
+ SET_DEV_CAPS(0x101a, true, false),
+ SET_DEV_CAPS(0x101b, true, false),
+ SET_DEV_CAPS(0x101c, true, true),
+ SET_DEV_CAPS(0x101e, false, false),
+ SET_DEV_CAPS(0x101f, false, false),
{.device_id = 0,}
};
@@ -317,6 +318,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
while (ark_device_caps[p].device_id != 0) {
if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
rqpacing = ark_device_caps[p].caps.rqpacing;
+ ark->isvf = ark_device_caps[p].caps.isvf;
break;
}
p++;
@@ -498,20 +500,21 @@ ark_config_device(struct rte_eth_dev *dev)
* Make sure that the packet director, generator and checker are in a
* known state
*/
- ark->start_pg = 0;
- ark->pg_running = 0;
- ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
- if (ark->pg == NULL)
- return -1;
- ark_pktgen_reset(ark->pg);
- ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
- if (ark->pc == NULL)
- return -1;
- ark_pktchkr_stop(ark->pc);
- ark->pd = ark_pktdir_init(ark->pktdir.v);
- if (ark->pd == NULL)
- return -1;
-
+ if (!ark->isvf) {
+ ark->start_pg = 0;
+ ark->pg_running = 0;
+ ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
+ if (ark->pg == NULL)
+ return -1;
+ ark_pktgen_reset(ark->pg);
+ ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
+ if (ark->pc == NULL)
+ return -1;
+ ark_pktchkr_stop(ark->pc);
+ ark->pd = ark_pktdir_init(ark->pktdir.v);
+ if (ark->pd == NULL)
+ return -1;
+ }
/* Verify HW */
if (ark_udm_verify(ark->udm.v))
return -1;
@@ -533,7 +536,7 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- if (ark->rqpacing)
+ if (!ark->isvf && ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
return 0;
@@ -551,8 +554,10 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev)
ark->user_ext.dev_uninit(dev,
ark->user_data[dev->data->port_id]);
- ark_pktgen_uninit(ark->pg);
- ark_pktchkr_uninit(ark->pc);
+ if (!ark->isvf) {
+ ark_pktgen_uninit(ark->pg);
+ ark_pktchkr_uninit(ark->pc);
+ }
return 0;
}
@@ -588,10 +593,10 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
dev->rx_pkt_burst = ð_ark_recv_pkts;
dev->tx_pkt_burst = ð_ark_xmit_pkts;
- if (ark->start_pg)
+ if (!ark->isvf && ark->start_pg)
ark_pktchkr_run(ark->pc);
- if (ark->start_pg && !ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && !ark->pg_running) {
pthread_t thread;
/* Delay packet generatpr start allow the hardware to be ready
@@ -635,7 +640,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
/* Stop the packet generator */
- if (ark->start_pg && ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && ark->pg_running) {
ark_pktgen_pause(ark->pg);
ark->pg_running = 0;
}
@@ -665,7 +670,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
eth_ark_rx_dump_queue(dev, i, __func__);
/* Stop the packet checker if it is running */
- if (ark->start_pg) {
+ if (!ark->isvf && ark->start_pg) {
ark_pktchkr_dump_stats(ark->pc);
ark_pktchkr_stop(ark->pc);
}
@@ -694,6 +699,10 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
+ /* return to power-on state */
+ if (ark->pd)
+ ark_pktdir_setup(ark->pd, ARK_PKT_DIR_INIT_VAL);
+
for (i = 0; i < dev->data->nb_tx_queues; i++) {
eth_ark_tx_queue_release(dev->data->tx_queues[i]);
dev->data->tx_queues[i] = 0;
@@ -978,6 +987,10 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params)
goto free_kvlist;
}
+ if (ark->isvf) {
+ ret = 0;
+ goto free_kvlist;
+ }
ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
/* Setup the packet director */
ark_pktdir_setup(ark->pd, ark->pkt_dir_v);
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index 3c3a712bc8..748db590c1 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -113,6 +113,7 @@ struct ark_adapter {
ark_pkt_dir_t pd;
int num_ports;
+ bool isvf;
/* Packet generator/checker args */
char pkt_gen_args[ARK_MAX_ARG_LEN];
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
` (7 preceding siblings ...)
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
@ 2022-06-07 21:31 ` Ed Czeck
2022-06-07 21:31 ` [PATCH v4 2/7] net/ark: update MPU functions for firmware update Ed Czeck
` (6 more replies)
8 siblings, 7 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 21:31 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Thomas Monjalon
DDM -> Downstream Data Mover
MPU -> Mbuf Prefetch Unit
UDM -> Upstream Data Mover
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
devtools/words-case.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/devtools/words-case.txt b/devtools/words-case.txt
index 2f1753bdc8..53e029a958 100644
--- a/devtools/words-case.txt
+++ b/devtools/words-case.txt
@@ -11,6 +11,7 @@ CPT
CQ
CRC
DCB
+DDM
DevX
DMA
eCPRI
@@ -46,6 +47,7 @@ LSC
MAC
MCAM
MPLS
+MPU
MSI
MSI-X
MSS
@@ -91,6 +93,7 @@ TPID
TSO
TTL
Tx
+UDM
UDP
ULP
vDPA
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v4 2/7] net/ark: update MPU functions for firmware update
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
@ 2022-06-07 21:31 ` Ed Czeck
2022-06-07 21:31 ` [PATCH v4 3/7] net/ark: update DDM " Ed Czeck
` (5 subsequent siblings)
6 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 21:31 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for MPU (Mbuf Prefetch Unit)
remove device-level global operations
remove ark_mpu_reset_stats function
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2:
- document version compatibility between firmware and DPDK
- reword commit message
v4:
- clarify version compatibility note
- firmware change requirement added to release notes
---
doc/guides/nics/ark.rst | 19 +++++++++++++++++
doc/guides/rel_notes/release_22_07.rst | 3 +++
drivers/net/ark/ark_ethdev.c | 2 --
drivers/net/ark/ark_ethdev_rx.c | 4 ----
drivers/net/ark/ark_mpu.c | 21 ++++---------------
drivers/net/ark/ark_mpu.h | 29 ++------------------------
6 files changed, 28 insertions(+), 50 deletions(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index 60b61e08e8..d8acb36d74 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -300,6 +300,25 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
+DPDK and Arkville Firmware Versioning
+-------------------------------------
+
+Arkville's firmware releases and its PMD have version dependencies which
+must be stepped together at certain releases. PMD code ensures the
+versions are compatible. The following lists shows where version
+compatible steps have occurred between DPDK releases and the corresponding
+Arkville releases. Intermediate releases not listed below remain
+compatible, e.g., DPDK releases 21.05, 21.08, and 21.11 are all compatible
+with Arkville releases 21.05, 21.08 and 21.11. LTS versions of DPDK remain
+compatible with the corresponding Arkville version. If other combinations
+are required, please contact Atomic Rules support.
+
+* DPDK 22.07 requires Arkville 22.07.
+* DPDK 22.03 requires Arkville 22.03.
+* DPDK 21.05 requires Arkville 21.05.
+* DPDK 18.11 requires Arkville 18.11.
+* DPDK 17.05 requires Arkville 17.05 -- initial version.
+
Supported Operating Systems
---------------------------
diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index d46f773df0..aca946cea6 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -170,6 +170,9 @@ New Features
This is a fall-back implementation for platforms that
don't support vector operations.
+* **Updated Atomic Rules' Arkville PMD.**
+
+ A firmware version update to Arkville 22.07 is required.
Removed Items
-------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 76b88c62d0..c0578b85ce 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -524,7 +524,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->rx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
@@ -536,7 +535,6 @@ ark_config_device(struct rte_eth_dev *dev)
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
for (i = 0; i < num_q; i++) {
- ark_mpu_reset(mpu);
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 0fbb2603db..85e34d0bb8 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -91,9 +91,6 @@ eth_ark_rx_hw_setup(struct rte_eth_dev *dev,
ark_udm_write_addr(queue->udm, phys_addr_prod_index);
- /* advance the valid pointer, but don't start until the queue starts */
- ark_mpu_reset_stats(queue->mpu);
-
/* The seed is the producer index for the HW */
ark_mpu_set_producer(queue->mpu, queue->seed_index);
dev->data->rx_queue_state[rx_queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
@@ -589,7 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
if (queue == 0)
return;
- ark_mpu_reset_stats(queue->mpu);
ark_udm_queue_stats_reset(queue->udm);
}
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c
index b8e94b6ed3..9d5ee7841b 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/net/ark/ark_mpu.c
@@ -24,10 +24,10 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
{
uint32_t version;
- version = mpu->id.vernum & 0x0000fF00;
- if ((mpu->id.idnum != 0x2055504d) ||
- (mpu->hw.obj_size != obj_size) ||
- (version != 0x00003100)) {
+ version = mpu->id.vernum;
+ if (mpu->id.idnum != ARK_MPU_MODID ||
+ version != ARK_MPU_MODVER ||
+ mpu->hw.obj_size != obj_size) {
ARK_PMD_LOG(ERR,
" MPU module not found as expected %08x"
" \"%c%c%c%c %c%c%c%c\"\n",
@@ -79,16 +79,9 @@ ark_mpu_reset(struct ark_mpu_t *mpu)
mpu->cfg.command = MPU_CMD_FORCE_RESET;
usleep(10);
}
- ark_mpu_reset_stats(mpu);
return mpu->cfg.command != MPU_CMD_IDLE;
}
-void
-ark_mpu_reset_stats(struct ark_mpu_t *mpu)
-{
- mpu->stats.pci_request = 1; /* reset stats */
-}
-
int
ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
int is_tx)
@@ -118,12 +111,6 @@ ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
code, qid,
mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
- ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
- "\n",
- code,
- mpu->debug.state, mpu->debug.count,
- mpu->debug.reserved
- );
}
void
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h
index 92c3e67c86..9d2b70d35f 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/net/ark/ark_mpu.h
@@ -15,6 +15,8 @@
* there is minimal documentation.
*/
+#define ARK_MPU_MODID 0x2055504d
+#define ARK_MPU_MODVER 0x37313232
/*
* MPU hardware structures
* These are overlay structures to a memory mapped FPGA device. These
@@ -64,26 +66,6 @@ enum ARK_MPU_COMMAND {
MPU_COMMAND_LIMIT = 0xfFFFFFFF
};
-#define ARK_MPU_STATS 0x080
-struct ark_mpu_stats_t {
- volatile uint64_t pci_request;
- volatile uint64_t q_empty;
- volatile uint64_t q_q1;
- volatile uint64_t q_q2;
- volatile uint64_t q_q3;
- volatile uint64_t q_q4;
- volatile uint64_t q_full;
-};
-
-#define ARK_MPU_DEBUG 0x0C0
-struct ark_mpu_debug_t {
- volatile uint32_t state;
- uint32_t reserved;
- volatile uint32_t count;
- volatile uint32_t take;
- volatile uint32_t peek[4];
-};
-
/* Consolidated structure */
struct ark_mpu_t {
struct ark_mpu_id_t id;
@@ -93,12 +75,6 @@ struct ark_mpu_t {
uint8_t reserved1[(ARK_MPU_CFG - ARK_MPU_HW) -
sizeof(struct ark_mpu_hw_t)];
struct ark_mpu_cfg_t cfg;
- uint8_t reserved2[(ARK_MPU_STATS - ARK_MPU_CFG) -
- sizeof(struct ark_mpu_cfg_t)];
- struct ark_mpu_stats_t stats;
- uint8_t reserved3[(ARK_MPU_DEBUG - ARK_MPU_STATS) -
- sizeof(struct ark_mpu_stats_t)];
- struct ark_mpu_debug_t debug;
};
uint16_t ark_api_num_queues(struct ark_mpu_t *mpu);
@@ -113,7 +89,6 @@ int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);
-void ark_mpu_reset_stats(struct ark_mpu_t *mpu);
/* this action is in a performance critical path */
static inline void
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v4 3/7] net/ark: update DDM functions for firmware update
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-06-07 21:31 ` [PATCH v4 2/7] net/ark: update MPU functions for firmware update Ed Czeck
@ 2022-06-07 21:31 ` Ed Czeck
2022-06-07 21:31 ` [PATCH v4 4/7] net/ark: update UDM " Ed Czeck
` (4 subsequent siblings)
6 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 21:31 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for DDM (Downstream Data Mover)
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by firmware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2:
reword commit message
---
drivers/net/ark/ark_ddm.c | 80 +++++-------------------------
drivers/net/ark/ark_ddm.h | 86 +++++++++------------------------
drivers/net/ark/ark_ethdev.c | 33 -------------
drivers/net/ark/ark_ethdev_tx.c | 35 +++-----------
4 files changed, 40 insertions(+), 194 deletions(-)
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c
index b16c739d50..eb88349b7b 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/net/ark/ark_ddm.c
@@ -14,95 +14,45 @@ int
ark_ddm_verify(struct ark_ddm_t *ddm)
{
uint32_t hw_const;
+ uint32_t hw_ver;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
- hw_const = ddm->cfg.const0;
- if (hw_const == ARK_DDM_CONST3)
+ hw_const = ddm->cfg.idnum;
+ hw_ver = ddm->cfg.vernum;
+ if (hw_const == ARK_DDM_MODID && hw_ver == ARK_DDM_MODVER)
return 0;
- if (hw_const == ARK_DDM_CONST1) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 1, "
- "PMD expects version 2\n");
- return -1;
- }
-
- if (hw_const == ARK_DDM_CONST2) {
- ARK_PMD_LOG(ERR,
- "ARK: DDM module is version 2, "
- "PMD expects version 3\n");
- return -1;
- }
ARK_PMD_LOG(ERR,
- "ARK: DDM module not found as expected 0x%08x\n",
- ddm->cfg.const0);
+ "ARK: DDM module not found as expected"
+ " id: %08x ver: %08x\n",
+ hw_const, hw_ver);
return -1;
}
void
-ark_ddm_start(struct ark_ddm_t *ddm)
-{
- ddm->cfg.command = 1;
-}
-
-int
-ark_ddm_stop(struct ark_ddm_t *ddm, const int wait)
+ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable)
{
- int cnt = 0;
-
- ddm->cfg.command = 2;
- rte_wmb();
- while (wait && (ddm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
+ ddm->setup.qcommand = enable ? 1U : 0U;
}
void
-ark_ddm_reset(struct ark_ddm_t *ddm)
-{
- int status;
-
- /* reset only works if ddm has stopped properly. */
- status = ark_ddm_stop(ddm, 1);
-
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- ddm->cfg.command = 4;
- usleep(10);
- }
- ddm->cfg.command = 3;
-}
-
-void
-ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr, uint32_t interval)
+ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr)
{
ddm->setup.cons_write_index_addr = cons_addr;
- ddm->setup.write_index_interval = interval / 4; /* 4 ns period */
+ ddm->setup.cons_index = 0;
}
+/* Global stats clear */
void
ark_ddm_stats_reset(struct ark_ddm_t *ddm)
{
ddm->cfg.tlp_stats_clear = 1;
}
-void
-ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
- ark_ddm_is_stopped(ddm)
- );
-}
-
void
ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
{
@@ -116,12 +66,6 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
"MBufs", stats->tx_mbuf_count);
}
-int
-ark_ddm_is_stopped(struct ark_ddm_t *ddm)
-{
- return (ddm->cfg.stop_flushed & 0x01) != 0;
-}
-
uint64_t
ark_ddm_queue_byte_count(struct ark_ddm_t *ddm)
{
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/net/ark/ark_ddm.h
index 687ff2519a..84beeb063a 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/net/ark/ark_ddm.h
@@ -40,17 +40,24 @@ union ark_tx_meta {
*/
#define ARK_DDM_CFG 0x0000
/* Set unique HW ID for hardware version */
-#define ARK_DDM_CONST3 (0x334d4444)
-#define ARK_DDM_CONST2 (0x324d4444)
-#define ARK_DDM_CONST1 (0xfacecafe)
+#define ARK_DDM_MODID 0x204d4444
+#define ARK_DDM_MODVER 0x37313232
struct ark_ddm_cfg_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ volatile uint32_t tlp_stats_clear;
+ };
uint32_t r0;
- volatile uint32_t tlp_stats_clear;
- uint32_t const0;
volatile uint32_t tag_max;
volatile uint32_t command;
- volatile uint32_t stop_flushed;
+ uint32_t write_index_interval; /* 4ns each */
+ volatile uint64_t qflow;
};
#define ARK_DDM_STATS 0x0020
@@ -60,34 +67,6 @@ struct ark_ddm_stats_t {
volatile uint64_t tx_mbuf_count;
};
-#define ARK_DDM_MRDQ 0x0040
-struct ark_ddm_mrdq_t {
- volatile uint32_t mrd_q1;
- volatile uint32_t mrd_q2;
- volatile uint32_t mrd_q3;
- volatile uint32_t mrd_q4;
- volatile uint32_t mrd_full;
-};
-
-#define ARK_DDM_CPLDQ 0x0068
-struct ark_ddm_cpldq_t {
- volatile uint32_t cpld_q1;
- volatile uint32_t cpld_q2;
- volatile uint32_t cpld_q3;
- volatile uint32_t cpld_q4;
- volatile uint32_t cpld_full;
-};
-
-#define ARK_DDM_MRD_PS 0x0090
-struct ark_ddm_mrd_ps_t {
- volatile uint32_t mrd_ps_min;
- volatile uint32_t mrd_ps_max;
- volatile uint32_t mrd_full_ps_min;
- volatile uint32_t mrd_full_ps_max;
- volatile uint32_t mrd_dw_ps_min;
- volatile uint32_t mrd_dw_ps_max;
-};
-
#define ARK_DDM_QUEUE_STATS 0x00a8
struct ark_ddm_qstats_t {
volatile uint64_t byte_count;
@@ -95,20 +74,10 @@ struct ark_ddm_qstats_t {
volatile uint64_t mbuf_count;
};
-#define ARK_DDM_CPLD_PS 0x00c0
-struct ark_ddm_cpld_ps_t {
- volatile uint32_t cpld_ps_min;
- volatile uint32_t cpld_ps_max;
- volatile uint32_t cpld_full_ps_min;
- volatile uint32_t cpld_full_ps_max;
- volatile uint32_t cpld_dw_ps_min;
- volatile uint32_t cpld_dw_ps_max;
-};
-
#define ARK_DDM_SETUP 0x00e0
struct ark_ddm_setup_t {
rte_iova_t cons_write_index_addr;
- uint32_t write_index_interval; /* 4ns each */
+ volatile uint32_t qcommand;
volatile uint32_t cons_index;
};
@@ -119,39 +88,28 @@ struct ark_ddm_t {
struct ark_ddm_cfg_t cfg;
uint8_t reserved0[(ARK_DDM_STATS - ARK_DDM_CFG) -
sizeof(struct ark_ddm_cfg_t)];
+
struct ark_ddm_stats_t stats;
- uint8_t reserved1[(ARK_DDM_MRDQ - ARK_DDM_STATS) -
+ uint8_t reserved1[(ARK_DDM_QUEUE_STATS - ARK_DDM_STATS) -
sizeof(struct ark_ddm_stats_t)];
- struct ark_ddm_mrdq_t mrdq;
- uint8_t reserved2[(ARK_DDM_CPLDQ - ARK_DDM_MRDQ) -
- sizeof(struct ark_ddm_mrdq_t)];
- struct ark_ddm_cpldq_t cpldq;
- uint8_t reserved3[(ARK_DDM_MRD_PS - ARK_DDM_CPLDQ) -
- sizeof(struct ark_ddm_cpldq_t)];
- struct ark_ddm_mrd_ps_t mrd_ps;
+
struct ark_ddm_qstats_t queue_stats;
- struct ark_ddm_cpld_ps_t cpld_ps;
- uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_CPLD_PS) -
- sizeof(struct ark_ddm_cpld_ps_t)];
+ uint8_t reserved5[(ARK_DDM_SETUP - ARK_DDM_QUEUE_STATS) -
+ sizeof(struct ark_ddm_qstats_t)];
+
struct ark_ddm_setup_t setup;
uint8_t reserved_p[(ARK_DDM_EXPECTED_SIZE - ARK_DDM_SETUP) -
sizeof(struct ark_ddm_setup_t)];
};
-
/* DDM function prototype */
int ark_ddm_verify(struct ark_ddm_t *ddm);
-void ark_ddm_start(struct ark_ddm_t *ddm);
-int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
-void ark_ddm_reset(struct ark_ddm_t *ddm);
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
-void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
- uint32_t interval);
+void ark_ddm_queue_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr);
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
-void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
-int ark_ddm_is_stopped(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_byte_count(struct ark_ddm_t *ddm);
uint64_t ark_ddm_queue_pkt_count(struct ark_ddm_t *ddm);
void ark_ddm_queue_reset_stats(struct ark_ddm_t *ddm);
+void ark_ddm_queue_enable(struct ark_ddm_t *ddm, int enable);
#endif
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index c0578b85ce..07d1d2178d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -527,10 +527,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- /* TX -- DDM */
- if (ark_ddm_stop(ark->ddm.v, 1))
- ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
-
mpu = ark->mputx.v;
num_q = ark_api_num_queues(mpu);
ark->tx_queues = num_q;
@@ -538,10 +534,6 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- ark_ddm_reset(ark->ddm.v);
- ark_ddm_stats_reset(ark->ddm.v);
-
- ark_ddm_stop(ark->ddm.v, 0);
if (ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
@@ -595,9 +587,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
for (i = 0; i < dev->data->nb_tx_queues; i++)
eth_ark_tx_queue_start(dev, i);
- /* start DDM */
- ark_ddm_start(ark->ddm.v);
-
ark->started = 1;
/* set xmit and receive function */
dev->rx_pkt_burst = ð_ark_recv_pkts;
@@ -671,28 +660,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* Stop DDM */
- /* Wait up to 0.1 second. each stop is up to 1000 * 10 useconds */
- for (i = 0; i < 10; i++) {
- status = ark_ddm_stop(ark->ddm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "DDM stop anomaly. status:"
- " %d iter: %u. (%s)\n",
- status,
- i,
- __func__);
- ark_ddm_dump(ark->ddm.v, "Stop anomaly");
-
- mpu = ark->mputx.v;
- for (i = 0; i < ark->tx_queues; i++) {
- ark_mpu_dump(mpu, "DDM failure dump", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
/* STOP RX Side */
/* Stop UDM multiple tries attempted */
for (i = 0; i < 10; i++) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index abdce6a8cc..5940a592a2 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -59,12 +59,6 @@ static int eth_ark_tx_jumbo(struct ark_tx_queue *queue,
static int eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue);
static void free_completed_tx(struct ark_tx_queue *queue);
-static inline void
-ark_tx_hw_queue_stop(struct ark_tx_queue *queue)
-{
- ark_mpu_stop(queue->mpu);
-}
-
/* ************************************************************************* */
static inline void
eth_ark_tx_desc_fill(struct ark_tx_queue *queue,
@@ -309,7 +303,6 @@ static int
eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
{
rte_iova_t queue_base, ring_base, cons_index_addr;
- uint32_t write_interval_ns;
/* Verify HW -- MPU */
if (ark_mpu_verify(queue->mpu, sizeof(union ark_tx_meta)))
@@ -326,28 +319,9 @@ eth_ark_tx_hw_queue_config(struct ark_tx_queue *queue)
/* Stop and Reset and configure MPU */
ark_mpu_configure(queue->mpu, ring_base, queue->queue_size, 1);
- /*
- * Adjust the write interval based on queue size --
- * increase pcie traffic when low mbuf count
- * Queue sizes less than 128 are not allowed
- */
- switch (queue->queue_size) {
- case 128:
- write_interval_ns = 500;
- break;
- case 256:
- write_interval_ns = 500;
- break;
- case 512:
- write_interval_ns = 1000;
- break;
- default:
- write_interval_ns = 2000;
- break;
- }
-
/* Completion address in UDM */
- ark_ddm_setup(queue->ddm, cons_index_addr, write_interval_ns);
+ ark_ddm_queue_setup(queue->ddm, cons_index_addr);
+ ark_ddm_queue_reset_stats(queue->ddm);
return 0;
}
@@ -360,7 +334,8 @@ eth_ark_tx_queue_release(void *vtx_queue)
queue = (struct ark_tx_queue *)vtx_queue;
- ark_tx_hw_queue_stop(queue);
+ ark_ddm_queue_enable(queue->ddm, 0);
+ ark_mpu_stop(queue->mpu);
queue->cons_index = queue->prod_index;
free_completed_tx(queue);
@@ -386,6 +361,7 @@ eth_ark_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id)
return -1;
}
+ ark_ddm_queue_enable(queue->ddm, 0);
ark_mpu_stop(queue->mpu);
free_completed_tx(queue);
@@ -404,6 +380,7 @@ eth_ark_tx_queue_start(struct rte_eth_dev *dev, uint16_t queue_id)
return 0;
ark_mpu_start(queue->mpu);
+ ark_ddm_queue_enable(queue->ddm, 1);
dev->data->tx_queue_state[queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v4 4/7] net/ark: update UDM functions for firmware update
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-06-07 21:31 ` [PATCH v4 2/7] net/ark: update MPU functions for firmware update Ed Czeck
2022-06-07 21:31 ` [PATCH v4 3/7] net/ark: update DDM " Ed Czeck
@ 2022-06-07 21:31 ` Ed Czeck
2022-06-07 21:31 ` [PATCH v4 5/7] net/ark: report additional errors from firmware Ed Czeck
` (3 subsequent siblings)
6 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 21:31 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
new firmware version for UDM (Upstream Data Mover)
remove device-level start, stop, and reset operations
add queue-based start, stop and reset as required by firmware
remove performance structs as they are not in the firmware module
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2: reword commit message
v3: include queue stop during device stop
---
drivers/net/ark/ark_ethdev.c | 38 ++----------
drivers/net/ark/ark_ethdev_rx.c | 38 +-----------
drivers/net/ark/ark_ethdev_rx.h | 1 -
drivers/net/ark/ark_udm.c | 103 +++-----------------------------
drivers/net/ark/ark_udm.h | 73 +++++-----------------
5 files changed, 31 insertions(+), 222 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 07d1d2178d..2abc35283d 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -512,13 +512,6 @@ ark_config_device(struct rte_eth_dev *dev)
if (ark_ddm_verify(ark->ddm.v))
return -1;
- /* UDM */
- if (ark_udm_reset(ark->udm.v)) {
- ARK_PMD_LOG(ERR, "Unable to stop and reset UDM\n");
- return -1;
- }
- /* Keep in reset until the MPU are cleared */
-
/* MPU reset */
mpu = ark->mpurx.v;
num_q = ark_api_num_queues(mpu);
@@ -577,9 +570,6 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
int i;
/* RX Side */
- /* start UDM */
- ark_udm_start(ark->udm.v);
-
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_start_queue(dev, i);
@@ -627,7 +617,6 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
uint16_t i;
int status;
struct ark_adapter *ark = dev->data->dev_private;
- struct ark_mpu_t *mpu;
if (ark->started == 0)
return 0;
@@ -648,6 +637,10 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
+ /* Stop RX Side */
+ for (i = 0; i < dev->data->nb_rx_queues; i++)
+ eth_ark_rx_stop_queue(dev, i);
+
/* STOP TX Side */
for (i = 0; i < dev->data->nb_tx_queues; i++) {
status = eth_ark_tx_queue_stop(dev, i);
@@ -660,27 +653,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
}
}
- /* STOP RX Side */
- /* Stop UDM multiple tries attempted */
- for (i = 0; i < 10; i++) {
- status = ark_udm_stop(ark->udm.v, 1);
- if (status == 0)
- break;
- }
- if (status || i != 0) {
- ARK_PMD_LOG(ERR, "UDM stop anomaly. status %d iter: %u. (%s)\n",
- status, i, __func__);
- ark_udm_dump(ark->udm.v, "Stop anomaly");
-
- mpu = ark->mpurx.v;
- for (i = 0; i < ark->rx_queues; i++) {
- ark_mpu_dump(mpu, "UDM Stop anomaly", i);
- mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
- }
- }
-
ark_udm_dump_stats(ark->udm.v, "Post stop");
- ark_udm_dump_perf(ark->udm.v, "Post stop");
for (i = 0; i < dev->data->nb_rx_queues; i++)
eth_ark_rx_dump_queue(dev, i, __func__);
@@ -708,10 +681,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
eth_ark_dev_stop(dev);
- eth_ark_udm_force_close(dev);
/*
- * TODO This should only be called once for the device during shutdown
+ * This should only be called once for the device during shutdown
*/
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 85e34d0bb8..cbc0416bc2 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -200,13 +200,10 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
queue->mpu = RTE_PTR_ADD(ark->mpurx.v, qidx * ARK_MPU_QOFFSET);
/* Configure UDM per queue */
- ark_udm_stop(queue->udm, 0);
ark_udm_configure(queue->udm,
RTE_PKTMBUF_HEADROOM,
- queue->dataroom,
- ARK_RX_WRITE_TIME_NS);
- ark_udm_stats_reset(queue->udm);
- ark_udm_stop(queue->udm, 0);
+ queue->dataroom);
+ ark_udm_queue_stats_reset(queue->udm);
/* populate mbuf reserve */
status = eth_ark_rx_seed_mbufs(queue);
@@ -589,36 +586,6 @@ eth_rx_queue_stats_reset(void *vqueue)
ark_udm_queue_stats_reset(queue->udm);
}
-void
-eth_ark_udm_force_close(struct rte_eth_dev *dev)
-{
- struct ark_adapter *ark = dev->data->dev_private;
- struct ark_rx_queue *queue;
- uint32_t index;
- uint16_t i;
-
- if (!ark_udm_is_flushed(ark->udm.v)) {
- /* restart the MPUs */
- ARK_PMD_LOG(NOTICE, "UDM not flushed -- forcing flush\n");
- for (i = 0; i < dev->data->nb_rx_queues; i++) {
- queue = (struct ark_rx_queue *)dev->data->rx_queues[i];
- if (queue == 0)
- continue;
-
- ark_mpu_start(queue->mpu);
- /* Add some buffers */
- index = ARK_RX_MPU_CHUNK + queue->seed_index;
- ark_mpu_set_producer(queue->mpu, index);
- }
- /* Wait to allow data to pass */
- usleep(100);
-
- ARK_PMD_LOG(NOTICE, "UDM forced flush attempt, stopped = %d\n",
- ark_udm_is_flushed(ark->udm.v));
- }
- ark_udm_reset(ark->udm.v);
-}
-
static void
ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
{
@@ -633,7 +600,6 @@ ark_ethdev_rx_dump(const char *name, struct ark_rx_queue *queue)
ark_mpu_dump(queue->mpu, name, queue->phys_qid);
ark_mpu_dump_setup(queue->mpu, queue->phys_qid);
- ark_udm_dump(queue->udm, name);
ark_udm_dump_setup(queue->udm, queue->phys_qid);
}
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index f64b3dd137..2e3400fd2f 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -27,6 +27,5 @@ void eth_rx_queue_stats_get(void *vqueue, struct rte_eth_stats *stats);
void eth_rx_queue_stats_reset(void *vqueue);
void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id,
const char *msg);
-void eth_ark_udm_force_close(struct rte_eth_dev *dev);
#endif
diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c
index 9ebed89627..81b141ad0b 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/net/ark/ark_udm.c
@@ -12,6 +12,8 @@ static_assert(sizeof(struct ark_rx_meta) == 32, "Unexpected struct size ark_rx_m
int
ark_udm_verify(struct ark_udm_t *udm)
{
+ uint32_t idnum = udm->setup.idnum;
+ uint32_t vernum = udm->setup.vernum;
if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
ARK_PMD_LOG(ERR,
"ARK: UDM structure looks incorrect %d vs %zd\n",
@@ -19,94 +21,30 @@ ark_udm_verify(struct ark_udm_t *udm)
return -1;
}
- if (udm->setup.const0 != ARK_UDM_CONST) {
+ if (idnum != ARK_UDM_MODID || vernum != ARK_UDM_MODVER) {
ARK_PMD_LOG(ERR,
- "ARK: UDM module not found as expected 0x%08x\n",
- udm->setup.const0);
+ "ARK: UDM module not found as expected 0x%08x 0x%08x\n",
+ idnum, vernum);
return -1;
}
return 0;
}
-int
-ark_udm_stop(struct ark_udm_t *udm, const int wait)
-{
- int cnt = 0;
-
- udm->setup.r0 = 0;
- udm->cfg.command = 2;
- rte_wmb();
-
- while (wait && (udm->cfg.stop_flushed & 0x01) == 0) {
- if (cnt++ > 1000)
- return 1;
-
- usleep(10);
- }
- return 0;
-}
-
-int
-ark_udm_reset(struct ark_udm_t *udm)
-{
- int status;
-
- status = ark_udm_stop(udm, 1);
- if (status != 0) {
- ARK_PMD_LOG(NOTICE, "%s stop failed doing forced reset\n",
- __func__);
- udm->cfg.command = 4;
- usleep(10);
- udm->cfg.command = 3;
- status = ark_udm_stop(udm, 0);
- ARK_PMD_LOG(INFO, "%s stop status %d post failure"
- " and forced reset\n",
- __func__, status);
- } else {
- udm->cfg.command = 3;
- }
-
- return status;
-}
-
-void
-ark_udm_start(struct ark_udm_t *udm)
-{
- udm->setup.r0 = 0x100;
- udm->cfg.command = 1;
-}
-
-void
-ark_udm_stats_reset(struct ark_udm_t *udm)
-{
- udm->pcibp.pci_clear = 1;
- udm->tlp_ps.tlp_clear = 1;
-}
-
void
ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns)
+ uint32_t dataroom)
{
/* headroom and data room are in DWords in the UDM */
udm->cfg.dataroom = dataroom / 4;
udm->cfg.headroom = headroom / 4;
-
- /* 4 NS period ns */
- udm->rt_cfg.write_interval = write_interval_ns / 4;
}
void
ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr)
{
udm->rt_cfg.hw_prod_addr = addr;
-}
-
-int
-ark_udm_is_flushed(struct ark_udm_t *udm)
-{
- return (udm->cfg.stop_flushed & 0x01) != 0;
+ udm->rt_cfg.prod_idx = 0;
}
uint64_t
@@ -131,11 +69,10 @@ void
ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
{
ARK_PMD_LOG(INFO, "UDM Stats: %s"
- ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
+ ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
msg,
"Pkts Received", udm->stats.rx_packet_count,
"Pkts Finalized", udm->stats.rx_sent_packets,
- "Pkts Dropped", udm->tlp.pkt_drop,
"Bytes Count", udm->stats.rx_byte_count,
"MBuf Count", udm->stats.rx_mbuf_count);
}
@@ -155,13 +92,6 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
"MBuf Count", udm->qstats.q_mbuf_count);
}
-void
-ark_udm_dump(struct ark_udm_t *udm, const char *msg)
-{
- ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
- udm->cfg.stop_flushed);
-}
-
void
ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
{
@@ -172,23 +102,6 @@ ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
"prod_idx", udm->rt_cfg.prod_idx);
}
-void
-ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
-{
- struct ark_udm_pcibp_t *bp = &udm->pcibp;
-
- ARK_PMD_LOG(INFO, "UDM Performance %s"
- ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
- "\n",
- msg,
- "PCI Empty", bp->pci_empty,
- "PCI Q1", bp->pci_q1,
- "PCI Q2", bp->pci_q2,
- "PCI Q3", bp->pci_q3,
- "PCI Q4", bp->pci_q4,
- "PCI Full", bp->pci_full);
-}
-
void
ark_udm_queue_stats_reset(struct ark_udm_t *udm)
{
diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h
index 1cbcd94a98..f0685c95c7 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/net/ark/ark_udm.h
@@ -32,19 +32,25 @@ struct ark_rx_meta {
#define ARK_RX_WRITE_TIME_NS 2500
#define ARK_UDM_SETUP 0
-#define ARK_UDM_CONST2 0xbACECACE
-#define ARK_UDM_CONST3 0x344d4455
-#define ARK_UDM_CONST ARK_UDM_CONST3
+#define ARK_UDM_MODID 0x4d445500
+#define ARK_UDM_MODVER 0x37313232
+
struct ark_udm_setup_t {
+ union {
+ char id[4];
+ uint32_t idnum;
+ };
+ union {
+ char ver[4];
+ uint32_t vernum;
+ };
uint32_t r0;
- uint32_t r4;
- volatile uint32_t cycle_count;
uint32_t const0;
};
#define ARK_UDM_CFG 0x010
struct ark_udm_cfg_t {
- volatile uint32_t stop_flushed; /* RO */
+ uint32_t write_interval; /* 4ns cycles */
volatile uint32_t command;
uint32_t dataroom;
uint32_t headroom;
@@ -74,45 +80,11 @@ struct ark_udm_queue_stats_t {
uint32_t q_enable;
};
-#define ARK_UDM_TLP 0x0070
-struct ark_udm_tlp_t {
- volatile uint64_t pkt_drop; /* global */
- volatile uint32_t tlp_q1;
- volatile uint32_t tlp_q2;
- volatile uint32_t tlp_q3;
- volatile uint32_t tlp_q4;
- volatile uint32_t tlp_full;
-};
-
-#define ARK_UDM_PCIBP 0x00a0
-struct ark_udm_pcibp_t {
- volatile uint32_t pci_clear;
- volatile uint32_t pci_empty;
- volatile uint32_t pci_q1;
- volatile uint32_t pci_q2;
- volatile uint32_t pci_q3;
- volatile uint32_t pci_q4;
- volatile uint32_t pci_full;
-};
-
-#define ARK_UDM_TLP_PS 0x00bc
-struct ark_udm_tlp_ps_t {
- volatile uint32_t tlp_clear;
- volatile uint32_t tlp_ps_min;
- volatile uint32_t tlp_ps_max;
- volatile uint32_t tlp_full_ps_min;
- volatile uint32_t tlp_full_ps_max;
- volatile uint32_t tlp_dw_ps_min;
- volatile uint32_t tlp_dw_ps_max;
- volatile uint32_t tlp_pldw_ps_min;
- volatile uint32_t tlp_pldw_ps_max;
-};
-
#define ARK_UDM_RT_CFG 0x00e0
struct ark_udm_rt_cfg_t {
rte_iova_t hw_prod_addr;
- uint32_t write_interval; /* 4ns cycles */
- volatile uint32_t prod_idx; /* RO */
+ uint32_t reserved;
+ volatile uint32_t prod_idx; /* Updated by HW */
};
/* Consolidated structure */
@@ -123,13 +95,8 @@ struct ark_udm_t {
struct ark_udm_cfg_t cfg;
struct ark_udm_stats_t stats;
struct ark_udm_queue_stats_t qstats;
- uint8_t reserved1[(ARK_UDM_TLP - ARK_UDM_PQ) -
+ uint8_t reserved1[(ARK_UDM_RT_CFG - ARK_UDM_PQ) -
sizeof(struct ark_udm_queue_stats_t)];
- struct ark_udm_tlp_t tlp;
- uint8_t reserved2[(ARK_UDM_PCIBP - ARK_UDM_TLP) -
- sizeof(struct ark_udm_tlp_t)];
- struct ark_udm_pcibp_t pcibp;
- struct ark_udm_tlp_ps_t tlp_ps;
struct ark_udm_rt_cfg_t rt_cfg;
int8_t reserved3[(ARK_UDM_EXPECT_SIZE - ARK_UDM_RT_CFG) -
sizeof(struct ark_udm_rt_cfg_t)];
@@ -137,22 +104,14 @@ struct ark_udm_t {
int ark_udm_verify(struct ark_udm_t *udm);
-int ark_udm_stop(struct ark_udm_t *udm, int wait);
-void ark_udm_start(struct ark_udm_t *udm);
-int ark_udm_reset(struct ark_udm_t *udm);
void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
- uint32_t dataroom,
- uint32_t write_interval_ns);
+ uint32_t dataroom);
void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
-void ark_udm_stats_reset(struct ark_udm_t *udm);
void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
uint16_t qid);
-void ark_udm_dump(struct ark_udm_t *udm, const char *msg);
-void ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg);
void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
-int ark_udm_is_flushed(struct ark_udm_t *udm);
/* Per queue data */
uint64_t ark_udm_dropped(struct ark_udm_t *udm);
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v4 5/7] net/ark: report additional errors from firmware
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (2 preceding siblings ...)
2022-06-07 21:31 ` [PATCH v4 4/7] net/ark: update UDM " Ed Czeck
@ 2022-06-07 21:31 ` Ed Czeck
2022-06-07 21:31 ` [PATCH v4 6/7] net/ark: add new devices to support list Ed Czeck
` (2 subsequent siblings)
6 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 21:31 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
detect and report completion errors from firmware
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_rqp.c | 6 ++++--
drivers/net/ark/ark_rqp.h | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ark/ark_rqp.c b/drivers/net/ark/ark_rqp.c
index ef9ccd0706..efb9730fe6 100644
--- a/drivers/net/ark/ark_rqp.c
+++ b/drivers/net/ark/ark_rqp.c
@@ -22,14 +22,16 @@ ark_rqp_stats_reset(struct ark_rqpace_t *rqp)
void
ark_rqp_dump(struct ark_rqpace_t *rqp)
{
- if (rqp->err_count_other != 0)
+ if (rqp->err_count_other || rqp->cmpl_errors)
ARK_PMD_LOG(ERR,
"RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
+ ARK_SU32
ARK_SU32 "\n",
rqp->ctrl, rqp->cplh_max, rqp->cpld_max,
"Error Count", rqp->err_cnt,
- "Error General", rqp->err_count_other);
+ "Error General", rqp->err_count_other,
+ "Cmpl Errors", rqp->cmpl_errors);
ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
ARK_SU32
diff --git a/drivers/net/ark/ark_rqp.h b/drivers/net/ark/ark_rqp.h
index 6c8046062b..d09f242e1e 100644
--- a/drivers/net/ark/ark_rqp.h
+++ b/drivers/net/ark/ark_rqp.h
@@ -48,7 +48,8 @@ struct ark_rqpace_t {
volatile uint32_t cpld_pending_max;
volatile uint32_t err_count_other;
char eval[4];
- volatile int lasped;
+ volatile int32_t lasped;
+ volatile uint32_t cmpl_errors;
};
void ark_rqp_dump(struct ark_rqpace_t *rqp);
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v4 6/7] net/ark: add new devices to support list
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (3 preceding siblings ...)
2022-06-07 21:31 ` [PATCH v4 5/7] net/ark: report additional errors from firmware Ed Czeck
@ 2022-06-07 21:31 ` Ed Czeck
2022-06-07 21:31 ` [PATCH v4 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
2022-06-08 8:41 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ferruh Yigit
6 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 21:31 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
update device list is doc
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v3: clarification in doc for LTS support
v4: mention nee devices in release notes
---
doc/guides/nics/ark.rst | 4 +++-
doc/guides/rel_notes/release_22_07.rst | 2 ++
drivers/net/ark/ark_ethdev.c | 6 ++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst
index d8acb36d74..591e41799c 100644
--- a/doc/guides/nics/ark.rst
+++ b/doc/guides/nics/ark.rst
@@ -297,6 +297,9 @@ ARK PMD supports the following Arkville RTL PCIe instances including:
* ``1d6c:1017`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Primary Endpoint]
* ``1d6c:1018`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Secondary Endpoint]
* ``1d6c:1019`` - AR-ARK-FX1 [Arkville 64B Multi-Homed Tertiary Endpoint]
+* ``1d6c:101a`` - AR-ARK-SRIOV-FX0 [Arkville 32B Primary Physical Function]
+* ``1d6c:101b`` - AR-ARK-SRIOV-FX1 [Arkville 64B Primary Physical Function]
+* ``1d6c:101c`` - AR-ARK-SRIOV-VF [Arkville Virtual Function]
* ``1d6c:101e`` - AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile]
* ``1d6c:101f`` - AR-TK242 [2x100GbE Packet Capture Device]
@@ -341,7 +344,6 @@ Unsupported Features
Features that may be part of, or become part of, the Arkville RTL IP that are
not currently supported or exposed by the ARK PMD include:
-* PCIe SR-IOV Virtual Functions (VFs)
* Arkville's Packet Generator Control and Status
* Arkville's Packet Director Control and Status
* Arkville's Packet Checker Control and Status
diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index aca946cea6..191539cb72 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -174,6 +174,8 @@ New Features
A firmware version update to Arkville 22.07 is required.
+ Added support for Atomic Rules PCI device IDs ``0x101a, 0x101b, 0x101c``.
+
Removed Items
-------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 2abc35283d..377631e66e 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -94,6 +94,9 @@ static const struct rte_pci_id pci_id_ark_map[] = {
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101a)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101b)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101c)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
{RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
{.vendor_id = 0, /* sentinel */ },
@@ -127,6 +130,9 @@ ark_device_caps[] = {
SET_DEV_CAPS(0x1017, true),
SET_DEV_CAPS(0x1018, true),
SET_DEV_CAPS(0x1019, true),
+ SET_DEV_CAPS(0x101a, true),
+ SET_DEV_CAPS(0x101b, true),
+ SET_DEV_CAPS(0x101c, false),
SET_DEV_CAPS(0x101e, false),
SET_DEV_CAPS(0x101f, false),
{.device_id = 0,}
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v4 7/7] net/ark: add PMD support for devices as virtual functions
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (4 preceding siblings ...)
2022-06-07 21:31 ` [PATCH v4 6/7] net/ark: add new devices to support list Ed Czeck
@ 2022-06-07 21:31 ` Ed Czeck
2022-06-08 8:41 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ferruh Yigit
6 siblings, 0 replies; 49+ messages in thread
From: Ed Czeck @ 2022-06-07 21:31 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ktraynor, bluca, Shepard Siegel, John Miller
Add capabilities field isvf to dev struct
Disable configuration calls as required by vf
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
v2: feature Arkville vf support in release notes
v3: feature new PCI device ids in release notes
v4: split release note
---
doc/guides/rel_notes/release_22_07.rst | 2 +
drivers/net/ark/ark_ethdev.c | 83 +++++++++++++++-----------
drivers/net/ark/ark_global.h | 1 +
3 files changed, 51 insertions(+), 35 deletions(-)
diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index 191539cb72..3a6df7bed9 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -176,6 +176,8 @@ New Features
Added support for Atomic Rules PCI device IDs ``0x101a, 0x101b, 0x101c``.
+ Added PMD support for virtual functions and vfio_pci driver.
+
Removed Items
-------------
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 377631e66e..e8e4092be6 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -113,28 +113,29 @@ static const struct rte_pci_id pci_id_ark_map[] = {
*/
struct ark_caps {
bool rqpacing;
+ bool isvf;
};
struct ark_dev_caps {
uint32_t device_id;
struct ark_caps caps;
};
-#define SET_DEV_CAPS(id, rqp) \
- {id, {.rqpacing = rqp} }
+#define SET_DEV_CAPS(id, rqp, vf) \
+ {id, {.rqpacing = rqp, .isvf = vf} }
static const struct ark_dev_caps
ark_device_caps[] = {
- SET_DEV_CAPS(0x100d, true),
- SET_DEV_CAPS(0x100e, true),
- SET_DEV_CAPS(0x100f, true),
- SET_DEV_CAPS(0x1010, false),
- SET_DEV_CAPS(0x1017, true),
- SET_DEV_CAPS(0x1018, true),
- SET_DEV_CAPS(0x1019, true),
- SET_DEV_CAPS(0x101a, true),
- SET_DEV_CAPS(0x101b, true),
- SET_DEV_CAPS(0x101c, false),
- SET_DEV_CAPS(0x101e, false),
- SET_DEV_CAPS(0x101f, false),
+ SET_DEV_CAPS(0x100d, true, false),
+ SET_DEV_CAPS(0x100e, true, false),
+ SET_DEV_CAPS(0x100f, true, false),
+ SET_DEV_CAPS(0x1010, false, false),
+ SET_DEV_CAPS(0x1017, true, false),
+ SET_DEV_CAPS(0x1018, true, false),
+ SET_DEV_CAPS(0x1019, true, false),
+ SET_DEV_CAPS(0x101a, true, false),
+ SET_DEV_CAPS(0x101b, true, false),
+ SET_DEV_CAPS(0x101c, true, true),
+ SET_DEV_CAPS(0x101e, false, false),
+ SET_DEV_CAPS(0x101f, false, false),
{.device_id = 0,}
};
@@ -317,6 +318,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
while (ark_device_caps[p].device_id != 0) {
if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
rqpacing = ark_device_caps[p].caps.rqpacing;
+ ark->isvf = ark_device_caps[p].caps.isvf;
break;
}
p++;
@@ -498,20 +500,21 @@ ark_config_device(struct rte_eth_dev *dev)
* Make sure that the packet director, generator and checker are in a
* known state
*/
- ark->start_pg = 0;
- ark->pg_running = 0;
- ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
- if (ark->pg == NULL)
- return -1;
- ark_pktgen_reset(ark->pg);
- ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
- if (ark->pc == NULL)
- return -1;
- ark_pktchkr_stop(ark->pc);
- ark->pd = ark_pktdir_init(ark->pktdir.v);
- if (ark->pd == NULL)
- return -1;
-
+ if (!ark->isvf) {
+ ark->start_pg = 0;
+ ark->pg_running = 0;
+ ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
+ if (ark->pg == NULL)
+ return -1;
+ ark_pktgen_reset(ark->pg);
+ ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1);
+ if (ark->pc == NULL)
+ return -1;
+ ark_pktchkr_stop(ark->pc);
+ ark->pd = ark_pktdir_init(ark->pktdir.v);
+ if (ark->pd == NULL)
+ return -1;
+ }
/* Verify HW */
if (ark_udm_verify(ark->udm.v))
return -1;
@@ -533,7 +536,7 @@ ark_config_device(struct rte_eth_dev *dev)
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- if (ark->rqpacing)
+ if (!ark->isvf && ark->rqpacing)
ark_rqp_stats_reset(ark->rqpacing);
return 0;
@@ -551,8 +554,10 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev)
ark->user_ext.dev_uninit(dev,
ark->user_data[dev->data->port_id]);
- ark_pktgen_uninit(ark->pg);
- ark_pktchkr_uninit(ark->pc);
+ if (!ark->isvf) {
+ ark_pktgen_uninit(ark->pg);
+ ark_pktchkr_uninit(ark->pc);
+ }
return 0;
}
@@ -588,10 +593,10 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
dev->rx_pkt_burst = ð_ark_recv_pkts;
dev->tx_pkt_burst = ð_ark_xmit_pkts;
- if (ark->start_pg)
+ if (!ark->isvf && ark->start_pg)
ark_pktchkr_run(ark->pc);
- if (ark->start_pg && !ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && !ark->pg_running) {
pthread_t thread;
/* Delay packet generatpr start allow the hardware to be ready
@@ -635,7 +640,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
ark->user_data[dev->data->port_id]);
/* Stop the packet generator */
- if (ark->start_pg && ark->pg_running) {
+ if (!ark->isvf && ark->start_pg && ark->pg_running) {
ark_pktgen_pause(ark->pg);
ark->pg_running = 0;
}
@@ -665,7 +670,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
eth_ark_rx_dump_queue(dev, i, __func__);
/* Stop the packet checker if it is running */
- if (ark->start_pg) {
+ if (!ark->isvf && ark->start_pg) {
ark_pktchkr_dump_stats(ark->pc);
ark_pktchkr_stop(ark->pc);
}
@@ -694,6 +699,10 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
if (ark->rqpacing)
ark_rqp_dump(ark->rqpacing);
+ /* return to power-on state */
+ if (ark->pd)
+ ark_pktdir_setup(ark->pd, ARK_PKT_DIR_INIT_VAL);
+
for (i = 0; i < dev->data->nb_tx_queues; i++) {
eth_ark_tx_queue_release(dev->data->tx_queues[i]);
dev->data->tx_queues[i] = 0;
@@ -978,6 +987,10 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params)
goto free_kvlist;
}
+ if (ark->isvf) {
+ ret = 0;
+ goto free_kvlist;
+ }
ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v);
/* Setup the packet director */
ark_pktdir_setup(ark->pd, ark->pkt_dir_v);
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index 3c3a712bc8..748db590c1 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -113,6 +113,7 @@ struct ark_adapter {
ark_pkt_dir_t pd;
int num_ports;
+ bool isvf;
/* Packet generator/checker args */
char pkt_gen_args[ARK_MAX_ARG_LEN];
--
2.25.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
` (5 preceding siblings ...)
2022-06-07 21:31 ` [PATCH v4 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
@ 2022-06-08 8:41 ` Ferruh Yigit
6 siblings, 0 replies; 49+ messages in thread
From: Ferruh Yigit @ 2022-06-08 8:41 UTC (permalink / raw)
To: Ed Czeck; +Cc: ktraynor, bluca, Thomas Monjalon, dev
On 6/7/2022 10:31 PM, Ed Czeck wrote:
>
> DDM -> Downstream Data Mover
> MPU -> Mbuf Prefetch Unit
> UDM -> Upstream Data Mover
>
> Signed-off-by: Ed Czeck<ed.czeck@atomicrules.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Series applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 49+ messages in thread
end of thread, other threads:[~2022-06-08 8:41 UTC | newest]
Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 21:22 [PATCH 1/4] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-02 21:22 ` [PATCH 2/4] net/ark: update ddm " Ed Czeck
2022-05-02 21:22 ` [PATCH 3/4] net/ark: update udm " Ed Czeck
2022-05-02 21:22 ` [PATCH 4/4] net/ark: add new devices to support list Ed Czeck
2022-05-05 15:37 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-05 15:37 ` [PATCH v1 2/5] net/ark: update ddm " Ed Czeck
2022-05-05 15:37 ` [PATCH v1 3/5] net/ark: update udm " Ed Czeck
2022-05-05 15:37 ` [PATCH v1 4/5] net/ark: add new devices to support list Ed Czeck
2022-05-05 15:37 ` [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions Ed Czeck
2022-05-06 21:27 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ed Czeck
2022-05-06 21:27 ` [PATCH v1 2/5] net/ark: update ddm " Ed Czeck
2022-05-06 21:27 ` [PATCH v1 3/5] net/ark: update udm " Ed Czeck
2022-05-06 21:27 ` [PATCH v1 4/5] net/ark: add new devices to support list Ed Czeck
2022-05-06 21:27 ` [PATCH v1 5/5] net/ark: add PMD support for devices as virtual functions Ed Czeck
2022-05-18 12:56 ` Ferruh Yigit
2022-05-18 12:54 ` [PATCH v1 1/5] net/ark: update mpu code to match current hardware version Ferruh Yigit
2022-05-19 10:13 ` Kevin Traynor
2022-05-19 21:36 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-05-19 21:36 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
2022-05-19 21:36 ` [PATCH v2 3/7] net/ark: update DDM " Ed Czeck
2022-05-19 21:36 ` [PATCH v2 4/7] net/ark: update UDM " Ed Czeck
2022-05-19 21:36 ` [PATCH v2 5/7] net/ark: report additional errors from firmware Ed Czeck
2022-05-19 21:36 ` [PATCH v2 6/7] net/ark: add new devices to support list Ed Czeck
2022-05-20 8:14 ` Andrew Rybchenko
2022-05-19 21:36 ` [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
2022-05-20 14:15 ` [PATCH v2 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-05-20 14:15 ` [PATCH v2 2/7] net/ark: update MPU functions for firmware update Ed Czeck
2022-05-23 14:39 ` Ferruh Yigit
2022-05-20 14:15 ` [PATCH v2 3/7] net/ark: update DDM " Ed Czeck
2022-05-20 14:15 ` [PATCH v2 4/7] net/ark: update UDM " Ed Czeck
2022-05-20 14:15 ` [PATCH v2 5/7] net/ark: report additional errors from firmware Ed Czeck
2022-05-20 14:15 ` [PATCH v2 6/7] net/ark: add new devices to support list Ed Czeck
2022-05-20 14:15 ` [PATCH v2 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
2022-05-23 14:38 ` Ferruh Yigit
2022-06-07 15:49 ` [PATCH v3 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-06-07 15:49 ` [PATCH v3 2/7] net/ark: update MPU functions for firmware update Ed Czeck
2022-06-07 15:49 ` [PATCH v3 3/7] net/ark: update DDM " Ed Czeck
2022-06-07 15:49 ` [PATCH v3 4/7] net/ark: update UDM " Ed Czeck
2022-06-07 15:49 ` [PATCH v3 5/7] net/ark: report additional errors from firmware Ed Czeck
2022-06-07 15:49 ` [PATCH v3 6/7] net/ark: add new devices to support list Ed Czeck
2022-06-07 15:49 ` [PATCH v3 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
2022-06-07 21:31 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ed Czeck
2022-06-07 21:31 ` [PATCH v4 2/7] net/ark: update MPU functions for firmware update Ed Czeck
2022-06-07 21:31 ` [PATCH v4 3/7] net/ark: update DDM " Ed Czeck
2022-06-07 21:31 ` [PATCH v4 4/7] net/ark: update UDM " Ed Czeck
2022-06-07 21:31 ` [PATCH v4 5/7] net/ark: report additional errors from firmware Ed Czeck
2022-06-07 21:31 ` [PATCH v4 6/7] net/ark: add new devices to support list Ed Czeck
2022-06-07 21:31 ` [PATCH v4 7/7] net/ark: add PMD support for devices as virtual functions Ed Czeck
2022-06-08 8:41 ` [PATCH v4 1/7] devtools: add Atomic Rules acronyms for commit checks Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).