net/ark: support for single function with multiple port
Subsystems (2)
PATCH 1/3 net/ark: support for single function with multiple port
Support the creation of multiple ports from one ark device via the use of ark pmd extension. I.e., one device with q queue can seen a p ports each with q/p queues.
Add unique dev_private data for each port to manage queue assignment.
This patch repairs a latent issue uncovered during testing.
Backporting is not requested.
--- drivers/net/ark/ark_ethdev.c | 15 ++++++++++++++- drivers/net/ark/ark_ethdev_rx.c | 6 +++--- drivers/net/ark/ark_ethdev_tx.c | 2 +- drivers/net/ark/ark_global.h | 3 +++ 4 files changed, 21 insertions(+), 5 deletions(-)
drivers/net/ark/ark_ethdev.c +14 -1
@@ -300,6 +300,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)int ret;int port_count =1 ;int p; +uint16_t num_queues;bool rqpacing = false; ark->eth_dev = dev;
@@ -427,6 +428,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->user_ext.dev_get_port_count (dev, ark->user_data[dev->data->port_id]); ark->num_ports = port_count; + num_queues =ark_api_num_queues_per_port (ark->mpurx.v, port_count);for (p =0 ; p < port_count; p++) {struct rte_eth_dev *eth_dev;
@@ -452,7 +454,18 @@ eth_ark_dev_init(struct rte_eth_dev *dev) } eth_dev->device = &pci_dev->device; - eth_dev->data->dev_private = ark; +/* Device requires new dev_private data */ + eth_dev->data->dev_private = +rte_zmalloc_socket (name, +sizeof (struct ark_adapter ), +RTE_CACHE_LINE_SIZE , +rte_socket_id ()); + +memcpy (eth_dev->data->dev_private, ark, +sizeof (struct ark_adapter )); + ark = eth_dev->data->dev_private; + ark->qbase = p * num_queues; + eth_dev->dev_ops = ark->eth_dev->dev_ops; eth_dev->tx_pkt_burst = ark->eth_dev->tx_pkt_burst; eth_dev->rx_pkt_burst = ark->eth_dev->rx_pkt_burst;
drivers/net/ark/ark_ethdev_rx.c +3 -3
@@ -68,7 +68,7 @@ struct ark_rx_queue {static int eth_ark_rx_hw_setup (struct rte_eth_dev *dev,struct ark_rx_queue *queue, - uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx) +uint16_t rx_queue_idx) {rte_iova_t queue_base;rte_iova_t phys_addr_q_base;
@@ -124,7 +124,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,uint32_t i;int status; -int qidx = queue_idx; +int qidx = ark->qbase + queue_idx;/* We may already be setup, free memory prior to re-allocation */ if (dev->data->rx_queues[queue_idx] !=NULL ) {
@@ -215,7 +215,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, }/* MPU Setup */ if (status ==0 ) - status =eth_ark_rx_hw_setup (dev, queue, qidx, queue_idx); + status =eth_ark_rx_hw_setup (dev, queue, queue_idx);if (unlikely (status !=0 )) {struct rte_mbuf **mbuf;
drivers/net/ark/ark_ethdev_tx.c +1 -1
@@ -229,7 +229,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,struct ark_tx_queue *queue;int status; -int qidx = queue_idx; +int qidx = ark->qbase + queue_idx;if (!rte_is_power_of_2 (nb_desc)) { ARK_PMD_LOG(ERR,
drivers/net/ark/ark_global.h +3 -0
@@ -112,7 +112,10 @@ struct ark_adapter {ark_pkt_chkr_t pc;ark_pkt_dir_t pd; +/* For single function, multiple ports */ int num_ports; +uint16_t qbase; +bool isvf;/* Packet generator/checker args */
Signature · 1 line
2.34.1
PATCH 2/3 net/ark: remove RQ pacing firmware from PMD
features and function have been removed from FPGA firmware
--- drivers/net/ark/ark_ethdev.c | 62 ++++++++------------------------ drivers/net/ark/ark_global.h | 3 -- drivers/net/ark/ark_rqp.c | 70 ------------------------------------ drivers/net/ark/ark_rqp.h | 58 ------------------------------ drivers/net/ark/meson.build | 1 - 5 files changed, 15 insertions(+), 179 deletions(-) delete mode 100644 drivers/net/ark/ark_rqp.c delete mode 100644 drivers/net/ark/ark_rqp.h
drivers/net/ark/ark_ethdev.c +15 -47
@@ -17,7 +17,6 @@#include "ark_mpu.h" #include "ark_ddm.h" #include "ark_udm.h" -#include "ark_rqp.h" #include "ark_pktdir.h" #include "ark_pktgen.h" #include "ark_pktchkr.h"
@@ -107,36 +106,32 @@ static const struct rte_pci_id pci_id_ark_map[] = {* This structure is used to statically define the capabilities * of supported devices. * Capabilities: -* rqpacing - -* Some HW variants require that PCIe read-requests be correctly throttled. -* This is called "rqpacing" and has to do with credit and flow control -* on certain Arkville implementations. +* isvf -- defined for function id that are virtual */ 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, vf) \ - {id, {.rqpacing = rqp, .isvf = vf} } +#define SET_DEV_CAPS (id, vf) \ + {id, {.isvf = vf} }static const struct ark_dev_caps ark_device_caps[] = { -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), +SET_DEV_CAPS (0x100d , false), +SET_DEV_CAPS (0x100e , false), +SET_DEV_CAPS (0x100f , false), +SET_DEV_CAPS (0x1010 , false), +SET_DEV_CAPS (0x1017 , false), +SET_DEV_CAPS (0x1018 , false), +SET_DEV_CAPS (0x1019 , false), +SET_DEV_CAPS (0x101a , false), +SET_DEV_CAPS (0x101b , false), +SET_DEV_CAPS (0x101c , true), +SET_DEV_CAPS (0x101e , false), +SET_DEV_CAPS (0x101f , false), {.device_id =0 ,} };
@@ -301,9 +296,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)int port_count =1 ;int p;uint16_t num_queues; -bool rqpacing = false; - - ark->eth_dev = dev;ARK_PMD_LOG (DEBUG ,"\n" );
@@ -319,7 +311,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) p =0 ;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 ; }
@@ -344,12 +335,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE ]; ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE ]; -if (rqpacing) { - ark->rqpacing = - (struct ark_rqpace_t *)(ark->bar0 +ARK_RCPACING_BASE ); - }else { - ark->rqpacing =NULL ; - } ark->started =0 ; ark->pkt_dir_v =ARK_PKT_DIR_INIT_VAL ;
@@ -368,17 +353,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->sysctrl.t32[4], __func__);return -1 ; } -if (ark->sysctrl.t32[3 ] !=0 ) { -if (ark->rqpacing) { -if (ark_rqp_lasped (ark->rqpacing)) { -ARK_PMD_LOG (ERR ,"Arkville Evaluation System - " -"Timer has Expired\n" ); -return -1 ; - } -ARK_PMD_LOG (WARNING ,"Arkville Evaluation System - " -"Timer is Running\n" ); - } - }ARK_PMD_LOG (DEBUG , "HW Sanity test has PASSED, expected constant"
@@ -550,9 +524,6 @@ ark_config_device(struct rte_eth_dev *dev) mpu =RTE_PTR_ADD (mpu,ARK_MPU_QOFFSET ); } -if (!ark->isvf && ark->rqpacing) -ark_rqp_stats_reset (ark->rqpacing); -return 0 ; }
@@ -709,9 +680,6 @@ eth_ark_dev_close(struct rte_eth_dev *dev)/* * This should only be called once for the device during shutdown */ -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 );
drivers/net/ark/ark_global.h +0 -3
@@ -32,7 +32,6 @@#define ARK_CMAC_BASE 0x80000#define ARK_PKTDIR_BASE 0xa0000#define ARK_PKTCHKR_BASE 0x90000 -#define ARK_RCPACING_BASE 0xb0000#define ARK_EXTERNAL_BASE 0x100000#define ARK_MPU_QOFFSET 0x00100#define ARK_MAX_PORTS RTE_MAX_ETHPORTS
@@ -150,8 +149,6 @@ struct ark_adapter {int started;uint16_t rx_queues;uint16_t tx_queues; - -struct ark_rqpace_t *rqpacing; };typedef uint32_t *ark_t ;
drivers/net/ark/ark_rqp.c deleted +0 -70
70 lines not on this page · raw message
drivers/net/ark/ark_rqp.h deleted +0 -58
58 lines not on this page · raw message
drivers/net/ark/meson.build +0 -1
@@ -16,6 +16,5 @@ sources = files( 'ark_pktchkr.c', 'ark_pktdir.c', 'ark_pktgen.c', - 'ark_rqp.c', 'ark_udm.c', )
Signature · 1 line
2.34.1
Re: [PATCH 2/3] net/ark: remove RQ pacing firmware from PMD
Quoted 2 lines · Ed Czeck
features and function have been removed from FPGA firmware
I am always a little confused how you manage the deployment, if a customer requires RQ pacing, how you manage it, at least should it be documented in driver documentation that RQ pacing supported before v23.11, or something like that?
If this doesn't make sense for your deployment model, scratch it, this is just a reminder if it is useful.
Quoted 76 lines
Signed-off-by Ed Czeck <[email protected]>--- drivers/net/ark/ark_ethdev.c | 62 ++++++++------------------------ drivers/net/ark/ark_global.h | 3 -- drivers/net/ark/ark_rqp.c | 70 ------------------------------------ drivers/net/ark/ark_rqp.h | 58 ------------------------------ drivers/net/ark/meson.build | 1 - 5 files changed, 15 insertions(+), 179 deletions(-) delete mode 100644 drivers/net/ark/ark_rqp.c delete mode 100644 drivers/net/ark/ark_rqp.hdrivers/net/ark/ark_ethdev.c +15
-20@@ -17,7 +17,6 @@#include "ark_mpu.h" #include "ark_ddm.h" #include "ark_udm.h" -#include "ark_rqp.h" #include "ark_pktdir.h" #include "ark_pktgen.h" #include "ark_pktchkr.h" @@ -107,36 +106,32 @@ static const struct rte_pci_id pci_id_ark_map[] = {* This structure is used to statically define the capabilities * of supported devices. * Capabilities: -* rqpacing - -* Some HW variants require that PCIe read-requests be correctly throttled. -* This is called "rqpacing" and has to do with credit and flow control -* on certain Arkville implementations. +* isvf -- defined for function id that are virtual */ 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, vf) \ - {id, {.rqpacing = rqp, .isvf = vf} } +#define SET_DEV_CAPS (id, vf) \ + {id, {.isvf = vf} }static const struct ark_dev_caps ark_device_caps[] = { -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), +SET_DEV_CAPS (0x100d , false), +SET_DEV_CAPS (0x100e , false), +SET_DEV_CAPS (0x100f , false), +SET_DEV_CAPS (0x1010 , false), +SET_DEV_CAPS (0x1017 , false), +SET_DEV_CAPS (0x1018 , false), +SET_DEV_CAPS (0x1019 , false), +SET_DEV_CAPS (0x101a , false), +SET_DEV_CAPS (0x101b , false), +SET_DEV_CAPS (0x101c , true), +SET_DEV_CAPS (0x101e , false), +SET_DEV_CAPS (0x101f , false), {.device_id =0 ,} };
drivers/net/ark/ark_ethdev.c eth_ark_dev_init(struct rte_eth_dev *dev) · line 299
Quoted 7 lines
drivers/net/ark/ark_ethdev.c +0
-3@@ -301,9 +296,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)int port_count =1 ;int p;uint16_t num_queues; -bool rqpacing = false; - - ark->eth_dev = dev;
Above "ark->eth_dev" assignment doesn't look directly related with RQ pacing, I just want to double check if it is removed intentionally?
Re: [PATCH 2/3] net/ark: remove RQ pacing firmware from PMD
Quoted 11 lines · Ferruh Yigit
Quoted 2 lines · Ed Czeck
features and function have been removed from FPGA firmware
I am always a little confused how you manage the deployment, if a customer requires RQ pacing, how you manage it, at least should it be documented in driver documentation that RQ pacing supported before v23.11, or something like that?
If this doesn't make sense for your deployment model, scratch it, this is just a reminder if it is useful.
Our deployment needs to balance the DPDK release, our FPGA firmware, our (not yet
published) DPDKpatches and external FPGA-IP firmware from AMD (Xilinx) and Intel
(Altera). We have safety code to ensure that these fall into a valid alignment. We also
try to maintain SW/FPGA compatibility and evolve without breaking things unnecessarily.
Our releases follow DPDK's and we update other tools as they are released.
For RQ pacing, it was an internal feature needed for older Xilinx PCIE IP, with a
narrow exposure via our PMD. The Xilinx IP no longer requires this module, our
firmware no longer includes it, and the PMD can drop. It was not user controllable
nor an advertised feature.
Quoted 13 lines
Quoted 13 lines
Signed-off-by Ed Czeck <[email protected]>--- drivers/net/ark/ark_ethdev.c | 62 ++++++++------------------------ drivers/net/ark/ark_global.h | 3 -- drivers/net/ark/ark_rqp.c | 70 ------------------------------------ drivers/net/ark/ark_rqp.h | 58 ------------------------------ drivers/net/ark/meson.build | 1 - 5 files changed, 15 insertions(+), 179 deletions(-) delete mode 100644 drivers/net/ark/ark_rqp.c delete mode 100644 drivers/net/ark/ark_rqp.h
Quoted 13 lines
drivers/net/ark/ark_ethdev.c static const struct rte_pci_id pci_id_ark_map[] =
Quoted 13 lines
drivers/net/ark/ark_ethdev.c +0
-1@@ -17,7 +17,6 @@#include "ark_mpu.h" #include "ark_ddm.h" #include "ark_udm.h" -#include "ark_rqp.h" #include "ark_pktdir.h" #include "ark_pktgen.h" #include "ark_pktchkr.h" @@ -107,36 +106,32 @@ static const struct rte_pci_id pci_id_ark_map[] =
{
Quoted 5 lines
drivers/net/ark/ark_ethdev.c static const struct rte_pci_id pci_id_ark_map[] = {
Quoted 5 lines
drivers/net/ark/ark_ethdev.c +0
-2* This structure is used to statically define the capabilities * of supported devices. * Capabilities: -* rqpacing - -* Some HW variants require that PCIe read-requests be correctly
throttled.
Quoted 46 lines
Quoted 46 lines
drivers/net/ark/ark_ethdev.c +15
-17-* This is called "rqpacing" and has to do with credit and flow control -* on certain Arkville implementations. +* isvf -- defined for function id that are virtual */ 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, vf) \ - {id, {.rqpacing = rqp, .isvf = vf} } +#define SET_DEV_CAPS (id, vf) \ + {id, {.isvf = vf} }static const struct ark_dev_caps ark_device_caps[] = { -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), +SET_DEV_CAPS (0x100d , false), +SET_DEV_CAPS (0x100e , false), +SET_DEV_CAPS (0x100f , false), +SET_DEV_CAPS (0x1010 , false), +SET_DEV_CAPS (0x1017 , false), +SET_DEV_CAPS (0x1018 , false), +SET_DEV_CAPS (0x1019 , false), +SET_DEV_CAPS (0x101a , false), +SET_DEV_CAPS (0x101b , false), +SET_DEV_CAPS (0x101c , true), +SET_DEV_CAPS (0x101e , false), +SET_DEV_CAPS (0x101f , false), {.device_id =0 ,} };
Quoted 11 lines
drivers/net/ark/ark_ethdev.c eth_ark_dev_init(struct rte_eth_dev *dev) · line 299
Quoted 8 lines
drivers/net/ark/ark_ethdev.c +0
-3@@ -301,9 +296,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)int port_count =1 ;int p;uint16_t num_queues; -bool rqpacing = false; - - ark->eth_dev = dev;Above "
ark->eth_dev" assignment doesn't look directly related with RQ pacing, I just want to double check if it is removed intentionally?
This change is in error. Thanks for catching it. New patch to follow.
Quoted 2 lines
PATCH v2 2/3 net/ark: remove RQ pacing firmware from PMD
In reply to Ed Czeckfeatures and function have been removed from FPGA firmware
---
v2:
* restore previously incorrectly deleted line
--- drivers/net/ark/ark_ethdev.c | 60 ++++++++----------------------- drivers/net/ark/ark_global.h | 3 -- drivers/net/ark/ark_rqp.c | 70 ------------------------------------ drivers/net/ark/ark_rqp.h | 58 ------------------------------ drivers/net/ark/meson.build | 1 - 5 files changed, 15 insertions(+), 177 deletions(-) delete mode 100644 drivers/net/ark/ark_rqp.c delete mode 100644 drivers/net/ark/ark_rqp.h
drivers/net/ark/ark_ethdev.c +15 -45
@@ -17,7 +17,6 @@#include "ark_mpu.h" #include "ark_ddm.h" #include "ark_udm.h" -#include "ark_rqp.h" #include "ark_pktdir.h" #include "ark_pktgen.h" #include "ark_pktchkr.h"
@@ -107,36 +106,32 @@ static const struct rte_pci_id pci_id_ark_map[] = {* This structure is used to statically define the capabilities * of supported devices. * Capabilities: -* rqpacing - -* Some HW variants require that PCIe read-requests be correctly throttled. -* This is called "rqpacing" and has to do with credit and flow control -* on certain Arkville implementations. +* isvf -- defined for function id that are virtual */ 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, vf) \ - {id, {.rqpacing = rqp, .isvf = vf} } +#define SET_DEV_CAPS (id, vf) \ + {id, {.isvf = vf} }static const struct ark_dev_caps ark_device_caps[] = { -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), +SET_DEV_CAPS (0x100d , false), +SET_DEV_CAPS (0x100e , false), +SET_DEV_CAPS (0x100f , false), +SET_DEV_CAPS (0x1010 , false), +SET_DEV_CAPS (0x1017 , false), +SET_DEV_CAPS (0x1018 , false), +SET_DEV_CAPS (0x1019 , false), +SET_DEV_CAPS (0x101a , false), +SET_DEV_CAPS (0x101b , false), +SET_DEV_CAPS (0x101c , true), +SET_DEV_CAPS (0x101e , false), +SET_DEV_CAPS (0x101f , false), {.device_id =0 ,} };
@@ -301,7 +296,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)int port_count =1 ;int p;uint16_t num_queues; -bool rqpacing = false; ark->eth_dev = dev;
@@ -319,7 +313,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) p =0 ;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 ; }
@@ -344,12 +337,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE ]; ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE ]; -if (rqpacing) { - ark->rqpacing = - (struct ark_rqpace_t *)(ark->bar0 +ARK_RCPACING_BASE ); - }else { - ark->rqpacing =NULL ; - } ark->started =0 ; ark->pkt_dir_v =ARK_PKT_DIR_INIT_VAL ;
@@ -368,17 +355,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->sysctrl.t32[4], __func__);return -1 ; } -if (ark->sysctrl.t32[3 ] !=0 ) { -if (ark->rqpacing) { -if (ark_rqp_lasped (ark->rqpacing)) { -ARK_PMD_LOG (ERR ,"Arkville Evaluation System - " -"Timer has Expired\n" ); -return -1 ; - } -ARK_PMD_LOG (WARNING ,"Arkville Evaluation System - " -"Timer is Running\n" ); - } - }ARK_PMD_LOG (DEBUG , "HW Sanity test has PASSED, expected constant"
@@ -550,9 +526,6 @@ ark_config_device(struct rte_eth_dev *dev) mpu =RTE_PTR_ADD (mpu,ARK_MPU_QOFFSET ); } -if (!ark->isvf && ark->rqpacing) -ark_rqp_stats_reset (ark->rqpacing); -return 0 ; }
@@ -709,9 +682,6 @@ eth_ark_dev_close(struct rte_eth_dev *dev)/* * This should only be called once for the device during shutdown */ -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 );
drivers/net/ark/ark_global.h +0 -3
@@ -32,7 +32,6 @@#define ARK_CMAC_BASE 0x80000#define ARK_PKTDIR_BASE 0xa0000#define ARK_PKTCHKR_BASE 0x90000 -#define ARK_RCPACING_BASE 0xb0000#define ARK_EXTERNAL_BASE 0x100000#define ARK_MPU_QOFFSET 0x00100#define ARK_MAX_PORTS RTE_MAX_ETHPORTS
@@ -150,8 +149,6 @@ struct ark_adapter {int started;uint16_t rx_queues;uint16_t tx_queues; - -struct ark_rqpace_t *rqpacing; };typedef uint32_t *ark_t ;
drivers/net/ark/ark_rqp.c deleted +0 -70
70 lines not on this page · raw message
drivers/net/ark/ark_rqp.h deleted +0 -58
58 lines not on this page · raw message
drivers/net/ark/meson.build +0 -1
@@ -16,6 +16,5 @@ sources = files( 'ark_pktchkr.c', 'ark_pktdir.c', 'ark_pktgen.c', - 'ark_rqp.c', 'ark_udm.c', )
Signature · 1 line
2.34.1
Re: [PATCH v2 2/3] net/ark: remove RQ pacing firmware from PMD
Quoted 7 lines · Ed Czeck
features and function have been removed from FPGA firmware
Signed-off-by Ed Czeck <[email protected]>---
v2:
* restore previously incorrectly deleted line
Can you please send v2 of whole set, this helps on CI checks and back tracing via patchwork etc...
PATCH 3/3 net/ark: support for large dataroom in FPGA
In reply to Ed CzeckAllow for non-standard dataroom sizes for upstream data motion when using a custom mbuf pool.
- New firmware version for UDM (Upstream Data Mover)
- New layout on ark_rx_meta data
--- doc/guides/nics/ark.rst | 1 + drivers/net/ark/ark_ethdev_rx.c | 8 ++++++++ drivers/net/ark/ark_ext.h | 9 +++++++++ drivers/net/ark/ark_udm.h | 5 +++-- 4 files changed, 21 insertions(+), 2 deletions(-)
doc/guides/nics/ark.rst +1 -0
@@ -334,6 +334,7 @@ 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 23.11 requires Arkville 23.11. * DPDK 22.07 requires Arkville 22.07. * DPDK 22.03 requires Arkville 22.03. * DPDK 21.05 requires Arkville 21.05.
drivers/net/ark/ark_ethdev_rx.c +8 -0
@@ -9,6 +9,7 @@#include "ark_logs.h" #include "ark_mpu.h" #include "ark_udm.h" +#include "ark_ext.h" #define ARK_RX_META_SIZE 32#define ARK_RX_META_OFFSET (RTE_PKTMBUF_HEADROOM - ARK_RX_META_SIZE)
@@ -166,6 +167,13 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, queue->mb_pool = mb_pool; queue->dataroom =rte_pktmbuf_data_room_size (mb_pool) -RTE_PKTMBUF_HEADROOM ; + +/* Check pool's private data to confirm pool structure */ +if (mb_pool->private_data_size !=0 ) { +struct rte_pmd_ark_lmbuf_mempool_priv *pool_priv =rte_mempool_get_priv (mb_pool); +if (strncmp (pool_priv->cookie,ARK_MEMPOOL_COOKIE ,sizeof (pool_priv->cookie)) ==0 ) + queue->dataroom = pool_priv->dataroom; + } queue->headroom =RTE_PKTMBUF_HEADROOM ; queue->phys_qid = qidx; queue->queue_index = queue_idx;
drivers/net/ark/ark_ext.h +9 -0
@@ -5,6 +5,7 @@#ifndef _ARK_EXT_H_#define _ARK_EXT_H_ +#include <rte_mbuf.h> #include <ethdev_driver.h> /* The following section lists function prototypes for Arkville's
@@ -16,6 +17,14 @@* See documentation for compiling and use of extensions. */ +/* private data optionally attached to mempool for rx */ +struct rte_pmd_ark_lmbuf_mempool_priv { +struct rte_pktmbuf_pool_private pool_private; +char cookie[4 ]; +uint32_t dataroom; +}; +#define ARK_MEMPOOL_COOKIE "ARK1" +/** * Extension prototype, required implementation if extensions are used. * Called during device probe to initialize the user structure
drivers/net/ark/ark_udm.h +3 -2
@@ -20,7 +20,8 @@*/ struct ark_rx_meta {uint32_t user_meta[5 ];/* user defined based on fpga code */ -uint8_t reserved[10 ]; +uint32_t pkt_len32; +uint8_t reserved[6 ];uint16_t pkt_len; } __rte_packed;
@@ -33,7 +34,7 @@ struct ark_rx_meta {#define ARK_RX_WRITE_TIME_NS 2500#define ARK_UDM_SETUP 0#define ARK_UDM_MODID 0x4d445500 -#define ARK_UDM_MODVER 0x37313232 +#define ARK_UDM_MODVER 0x37333332 struct ark_udm_setup_t { union {
Signature · 1 line
2.34.1
PATCH v2 1/3 net/ark: support for single function with multiple port
In reply to Ed CzeckSupport the creation of multiple ports from one ark device via the use of ark pmd extension. I.e., one device with q queue can seen a p ports each with q/p queues.
Add unique dev_private data for each port to manage queue assignment.
This patch repairs a latent issue uncovered during testing.
Backporting is not requested.
--- drivers/net/ark/ark_ethdev.c | 15 ++++++++++++++- drivers/net/ark/ark_ethdev_rx.c | 6 +++--- drivers/net/ark/ark_ethdev_tx.c | 2 +- drivers/net/ark/ark_global.h | 3 +++ 4 files changed, 21 insertions(+), 5 deletions(-)
drivers/net/ark/ark_ethdev.c +14 -1
@@ -300,6 +300,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)int ret;int port_count =1 ;int p; +uint16_t num_queues;bool rqpacing = false; ark->eth_dev = dev;
@@ -427,6 +428,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->user_ext.dev_get_port_count (dev, ark->user_data[dev->data->port_id]); ark->num_ports = port_count; + num_queues =ark_api_num_queues_per_port (ark->mpurx.v, port_count);for (p =0 ; p < port_count; p++) {struct rte_eth_dev *eth_dev;
@@ -452,7 +454,18 @@ eth_ark_dev_init(struct rte_eth_dev *dev) } eth_dev->device = &pci_dev->device; - eth_dev->data->dev_private = ark; +/* Device requires new dev_private data */ + eth_dev->data->dev_private = +rte_zmalloc_socket (name, +sizeof (struct ark_adapter ), +RTE_CACHE_LINE_SIZE , +rte_socket_id ()); + +memcpy (eth_dev->data->dev_private, ark, +sizeof (struct ark_adapter )); + ark = eth_dev->data->dev_private; + ark->qbase = p * num_queues; + eth_dev->dev_ops = ark->eth_dev->dev_ops; eth_dev->tx_pkt_burst = ark->eth_dev->tx_pkt_burst; eth_dev->rx_pkt_burst = ark->eth_dev->rx_pkt_burst;
drivers/net/ark/ark_ethdev_rx.c +3 -3
@@ -68,7 +68,7 @@ struct ark_rx_queue {static int eth_ark_rx_hw_setup (struct rte_eth_dev *dev,struct ark_rx_queue *queue, - uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx) +uint16_t rx_queue_idx) {rte_iova_t queue_base;rte_iova_t phys_addr_q_base;
@@ -124,7 +124,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,uint32_t i;int status; -int qidx = queue_idx; +int qidx = ark->qbase + queue_idx;/* We may already be setup, free memory prior to re-allocation */ if (dev->data->rx_queues[queue_idx] !=NULL ) {
@@ -215,7 +215,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, }/* MPU Setup */ if (status ==0 ) - status =eth_ark_rx_hw_setup (dev, queue, qidx, queue_idx); + status =eth_ark_rx_hw_setup (dev, queue, queue_idx);if (unlikely (status !=0 )) {struct rte_mbuf **mbuf;
drivers/net/ark/ark_ethdev_tx.c +1 -1
@@ -229,7 +229,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,struct ark_tx_queue *queue;int status; -int qidx = queue_idx; +int qidx = ark->qbase + queue_idx;if (!rte_is_power_of_2 (nb_desc)) { ARK_PMD_LOG(ERR,
drivers/net/ark/ark_global.h +3 -0
@@ -112,7 +112,10 @@ struct ark_adapter {ark_pkt_chkr_t pc;ark_pkt_dir_t pd; +/* For single function, multiple ports */ int num_ports; +uint16_t qbase; +bool isvf;/* Packet generator/checker args */
Signature · 1 line
2.34.1
PATCH v2 2/3 net/ark: remove RQ pacing firmware from PMD
features and function have been removed from FPGA firmware
---
v2:
* restore previously incorrectly deleted line
--- drivers/net/ark/ark_ethdev.c | 60 ++++++++----------------------- drivers/net/ark/ark_global.h | 3 -- drivers/net/ark/ark_rqp.c | 70 ------------------------------------ drivers/net/ark/ark_rqp.h | 58 ------------------------------ drivers/net/ark/meson.build | 1 - 5 files changed, 15 insertions(+), 177 deletions(-) delete mode 100644 drivers/net/ark/ark_rqp.c delete mode 100644 drivers/net/ark/ark_rqp.h
drivers/net/ark/ark_ethdev.c +15 -45
@@ -17,7 +17,6 @@#include "ark_mpu.h" #include "ark_ddm.h" #include "ark_udm.h" -#include "ark_rqp.h" #include "ark_pktdir.h" #include "ark_pktgen.h" #include "ark_pktchkr.h"
@@ -107,36 +106,32 @@ static const struct rte_pci_id pci_id_ark_map[] = {* This structure is used to statically define the capabilities * of supported devices. * Capabilities: -* rqpacing - -* Some HW variants require that PCIe read-requests be correctly throttled. -* This is called "rqpacing" and has to do with credit and flow control -* on certain Arkville implementations. +* isvf -- defined for function id that are virtual */ 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, vf) \ - {id, {.rqpacing = rqp, .isvf = vf} } +#define SET_DEV_CAPS (id, vf) \ + {id, {.isvf = vf} }static const struct ark_dev_caps ark_device_caps[] = { -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), +SET_DEV_CAPS (0x100d , false), +SET_DEV_CAPS (0x100e , false), +SET_DEV_CAPS (0x100f , false), +SET_DEV_CAPS (0x1010 , false), +SET_DEV_CAPS (0x1017 , false), +SET_DEV_CAPS (0x1018 , false), +SET_DEV_CAPS (0x1019 , false), +SET_DEV_CAPS (0x101a , false), +SET_DEV_CAPS (0x101b , false), +SET_DEV_CAPS (0x101c , true), +SET_DEV_CAPS (0x101e , false), +SET_DEV_CAPS (0x101f , false), {.device_id =0 ,} };
@@ -301,7 +296,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)int port_count =1 ;int p;uint16_t num_queues; -bool rqpacing = false; ark->eth_dev = dev;
@@ -319,7 +313,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) p =0 ;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 ; }
@@ -344,12 +337,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE ]; ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE ]; -if (rqpacing) { - ark->rqpacing = - (struct ark_rqpace_t *)(ark->bar0 +ARK_RCPACING_BASE ); - }else { - ark->rqpacing =NULL ; - } ark->started =0 ; ark->pkt_dir_v =ARK_PKT_DIR_INIT_VAL ;
@@ -368,17 +355,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->sysctrl.t32[4], __func__);return -1 ; } -if (ark->sysctrl.t32[3 ] !=0 ) { -if (ark->rqpacing) { -if (ark_rqp_lasped (ark->rqpacing)) { -ARK_PMD_LOG (ERR ,"Arkville Evaluation System - " -"Timer has Expired\n" ); -return -1 ; - } -ARK_PMD_LOG (WARNING ,"Arkville Evaluation System - " -"Timer is Running\n" ); - } - }ARK_PMD_LOG (DEBUG , "HW Sanity test has PASSED, expected constant"
@@ -550,9 +526,6 @@ ark_config_device(struct rte_eth_dev *dev) mpu =RTE_PTR_ADD (mpu,ARK_MPU_QOFFSET ); } -if (!ark->isvf && ark->rqpacing) -ark_rqp_stats_reset (ark->rqpacing); -return 0 ; }
@@ -709,9 +682,6 @@ eth_ark_dev_close(struct rte_eth_dev *dev)/* * This should only be called once for the device during shutdown */ -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 );
drivers/net/ark/ark_global.h +0 -3
@@ -32,7 +32,6 @@#define ARK_CMAC_BASE 0x80000#define ARK_PKTDIR_BASE 0xa0000#define ARK_PKTCHKR_BASE 0x90000 -#define ARK_RCPACING_BASE 0xb0000#define ARK_EXTERNAL_BASE 0x100000#define ARK_MPU_QOFFSET 0x00100#define ARK_MAX_PORTS RTE_MAX_ETHPORTS
@@ -150,8 +149,6 @@ struct ark_adapter {int started;uint16_t rx_queues;uint16_t tx_queues; - -struct ark_rqpace_t *rqpacing; };typedef uint32_t *ark_t ;
drivers/net/ark/ark_rqp.c deleted +0 -70
70 lines not on this page · raw message
drivers/net/ark/ark_rqp.h deleted +0 -58
58 lines not on this page · raw message
drivers/net/ark/meson.build +0 -1
@@ -16,6 +16,5 @@ sources = files( 'ark_pktchkr.c', 'ark_pktdir.c', 'ark_pktgen.c', - 'ark_rqp.c', 'ark_udm.c', )
Signature · 1 line
2.34.1
PATCH v2 3/3 net/ark: support for large dataroom in FPGA
In reply to Ed CzeckAllow for non-standard dataroom sizes for upstream data motion when using a custom mbuf pool.
- New firmware version for UDM (Upstream Data Mover)
- New layout on ark_rx_meta data
--- doc/guides/nics/ark.rst | 1 + drivers/net/ark/ark_ethdev_rx.c | 8 ++++++++ drivers/net/ark/ark_ext.h | 9 +++++++++ drivers/net/ark/ark_udm.h | 5 +++-- 4 files changed, 21 insertions(+), 2 deletions(-)
doc/guides/nics/ark.rst +1 -0
@@ -334,6 +334,7 @@ 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 23.11 requires Arkville 23.11. * DPDK 22.07 requires Arkville 22.07. * DPDK 22.03 requires Arkville 22.03. * DPDK 21.05 requires Arkville 21.05.
drivers/net/ark/ark_ethdev_rx.c +8 -0
@@ -9,6 +9,7 @@#include "ark_logs.h" #include "ark_mpu.h" #include "ark_udm.h" +#include "ark_ext.h" #define ARK_RX_META_SIZE 32#define ARK_RX_META_OFFSET (RTE_PKTMBUF_HEADROOM - ARK_RX_META_SIZE)
@@ -166,6 +167,13 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, queue->mb_pool = mb_pool; queue->dataroom =rte_pktmbuf_data_room_size (mb_pool) -RTE_PKTMBUF_HEADROOM ; + +/* Check pool's private data to confirm pool structure */ +if (mb_pool->private_data_size !=0 ) { +struct rte_pmd_ark_lmbuf_mempool_priv *pool_priv =rte_mempool_get_priv (mb_pool); +if (strncmp (pool_priv->cookie,ARK_MEMPOOL_COOKIE ,sizeof (pool_priv->cookie)) ==0 ) + queue->dataroom = pool_priv->dataroom; + } queue->headroom =RTE_PKTMBUF_HEADROOM ; queue->phys_qid = qidx; queue->queue_index = queue_idx;
drivers/net/ark/ark_ext.h +9 -0
@@ -5,6 +5,7 @@#ifndef _ARK_EXT_H_#define _ARK_EXT_H_ +#include <rte_mbuf.h> #include <ethdev_driver.h> /* The following section lists function prototypes for Arkville's
@@ -16,6 +17,14 @@* See documentation for compiling and use of extensions. */ +/* private data optionally attached to mempool for rx */ +struct rte_pmd_ark_lmbuf_mempool_priv { +struct rte_pktmbuf_pool_private pool_private; +char cookie[4 ]; +uint32_t dataroom; +}; +#define ARK_MEMPOOL_COOKIE "ARK1" +/** * Extension prototype, required implementation if extensions are used. * Called during device probe to initialize the user structure
drivers/net/ark/ark_udm.h +3 -2
@@ -20,7 +20,8 @@*/ struct ark_rx_meta {uint32_t user_meta[5 ];/* user defined based on fpga code */ -uint8_t reserved[10 ]; +uint32_t pkt_len32; +uint8_t reserved[6 ];uint16_t pkt_len; } __rte_packed;
@@ -33,7 +34,7 @@ struct ark_rx_meta {#define ARK_RX_WRITE_TIME_NS 2500#define ARK_UDM_SETUP 0#define ARK_UDM_MODID 0x4d445500 -#define ARK_UDM_MODVER 0x37313232 +#define ARK_UDM_MODVER 0x37333332 struct ark_udm_setup_t { union {
Signature · 1 line
2.34.1
Quoted 4 lines · Ed Czeck
Support the creation of multiple ports from one ark device via the use of ark pmd extension. I.e., one device with q queue can seen a p ports each with q/p queues.
Quoted 9 lines
Add unique
dev_privatedata for each port to manage queue assignment.This patch repairs a latent issue uncovered during testing.
Fixes 6799275eeea6 ("net/ark: support virtual functions")Backporting is not requested.
Signed-off-by Ed Czeck <[email protected]>
Series applied to dpdk-next-net/main, thanks.