* [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id
@ 2019-07-16 21:34 Ed Czeck
2019-07-16 21:34 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Ed Czeck @ 2019-07-16 21:34 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: shepard.siegel, john.miller, Ed Czeck, stable
Fixes: c33d45af3633 ("net/ark: add Tx initial version")
Cc: stable@dpdk.org
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev_rx.c | 4 +---
drivers/net/ark/ark_ethdev_tx.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 7de1a98..6156730 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -127,9 +127,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
uint32_t i;
int status;
- /* Future works: divide the Q's evenly with multi-ports */
- int port = dev->data->port_id;
- int qidx = port + queue_idx;
+ int qidx = queue_idx;
/* We may already be setup, free memory prior to re-allocation */
if (dev->data->rx_queues[queue_idx] != NULL) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 1967655..08bcf43 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -211,9 +211,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
struct ark_tx_queue *queue;
int status;
- /* Future: divide the Q's evenly with multi-ports */
- int port = dev->data->port_id;
- int qidx = port + queue_idx;
+ int qidx = queue_idx;
if (!rte_is_power_of_2(nb_desc)) {
PMD_DRV_LOG(ERR,
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close
2019-07-16 21:34 [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ed Czeck
@ 2019-07-16 21:34 ` Ed Czeck
2019-07-17 17:33 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Ed Czeck @ 2019-07-16 21:34 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: shepard.siegel, john.miller, Ed Czeck
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources
for the port can be freed by rte_eth_dev_close()
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 86e500e..3435728 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -261,6 +261,8 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
/* Use dummy function until setup */
dev->rx_pkt_burst = ð_ark_recv_pkts_noop;
dev->tx_pkt_burst = ð_ark_xmit_pkts_noop;
+ /* Let rte_eth_dev_close() release the port resources */
+ dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr;
ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr;
@@ -706,6 +708,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
eth_ark_dev_rx_queue_release(dev->data->rx_queues[i]);
dev->data->rx_queues[i] = 0;
}
+
+ rte_free(dev->data->mac_addrs);
+ dev->data->mac_addrs = 0;
}
static void
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id
2019-07-16 21:34 [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ed Czeck
2019-07-16 21:34 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
@ 2019-07-17 17:33 ` Ferruh Yigit
2019-07-19 13:07 ` Ed Czeck
2019-07-22 12:35 ` Ed Czeck
3 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2019-07-17 17:33 UTC (permalink / raw)
To: Ed Czeck, dev; +Cc: shepard.siegel, john.miller, stable
On 7/16/2019 10:34 PM, Ed Czeck wrote:
> Fixes: c33d45af3633 ("net/ark: add Tx initial version")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
Hi Ed,
Can you please add some context to commit log, what was the problem, what was
its impact, how this is fixed?
> ---
> drivers/net/ark/ark_ethdev_rx.c | 4 +---
> drivers/net/ark/ark_ethdev_tx.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
> index 7de1a98..6156730 100644
> --- a/drivers/net/ark/ark_ethdev_rx.c
> +++ b/drivers/net/ark/ark_ethdev_rx.c
> @@ -127,9 +127,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
> uint32_t i;
> int status;
>
> - /* Future works: divide the Q's evenly with multi-ports */
> - int port = dev->data->port_id;
> - int qidx = port + queue_idx;
> + int qidx = queue_idx;
>
> /* We may already be setup, free memory prior to re-allocation */
> if (dev->data->rx_queues[queue_idx] != NULL) {
> diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
> index 1967655..08bcf43 100644
> --- a/drivers/net/ark/ark_ethdev_tx.c
> +++ b/drivers/net/ark/ark_ethdev_tx.c
> @@ -211,9 +211,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
> struct ark_tx_queue *queue;
> int status;
>
> - /* Future: divide the Q's evenly with multi-ports */
> - int port = dev->data->port_id;
> - int qidx = port + queue_idx;
> + int qidx = queue_idx;
>
> if (!rte_is_power_of_2(nb_desc)) {
> PMD_DRV_LOG(ERR,
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id
2019-07-16 21:34 [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ed Czeck
2019-07-16 21:34 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
2019-07-17 17:33 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
@ 2019-07-19 13:07 ` Ed Czeck
2019-07-19 13:07 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
2019-07-19 17:27 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
2019-07-22 12:35 ` Ed Czeck
3 siblings, 2 replies; 9+ messages in thread
From: Ed Czeck @ 2019-07-19 13:07 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: shepard.siegel, john.miller, Ed Czeck, stable
Queue index was incorrectly incremented with port, which
caused swizzling of packet placement among queues. This manifested
when the number of configured ports was >1 and < nb_queues.
Fixes: c33d45af3633 ("net/ark: add Tx initial version")
Cc: stable@dpdk.org
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev_rx.c | 4 +---
drivers/net/ark/ark_ethdev_tx.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 7de1a98..6156730 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -127,9 +127,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
uint32_t i;
int status;
- /* Future works: divide the Q's evenly with multi-ports */
- int port = dev->data->port_id;
- int qidx = port + queue_idx;
+ int qidx = queue_idx;
/* We may already be setup, free memory prior to re-allocation */
if (dev->data->rx_queues[queue_idx] != NULL) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 1967655..08bcf43 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -211,9 +211,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
struct ark_tx_queue *queue;
int status;
- /* Future: divide the Q's evenly with multi-ports */
- int port = dev->data->port_id;
- int qidx = port + queue_idx;
+ int qidx = queue_idx;
if (!rte_is_power_of_2(nb_desc)) {
PMD_DRV_LOG(ERR,
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close
2019-07-19 13:07 ` Ed Czeck
@ 2019-07-19 13:07 ` Ed Czeck
2019-07-19 17:27 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
1 sibling, 0 replies; 9+ messages in thread
From: Ed Czeck @ 2019-07-19 13:07 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: shepard.siegel, john.miller, Ed Czeck
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources
for the port can be freed by rte_eth_dev_close()
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 86e500e..3435728 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -261,6 +261,8 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
/* Use dummy function until setup */
dev->rx_pkt_burst = ð_ark_recv_pkts_noop;
dev->tx_pkt_burst = ð_ark_xmit_pkts_noop;
+ /* Let rte_eth_dev_close() release the port resources */
+ dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr;
ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr;
@@ -706,6 +708,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
eth_ark_dev_rx_queue_release(dev->data->rx_queues[i]);
dev->data->rx_queues[i] = 0;
}
+
+ rte_free(dev->data->mac_addrs);
+ dev->data->mac_addrs = 0;
}
static void
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id
2019-07-19 13:07 ` Ed Czeck
2019-07-19 13:07 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
@ 2019-07-19 17:27 ` Ferruh Yigit
1 sibling, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2019-07-19 17:27 UTC (permalink / raw)
To: Ed Czeck, dev; +Cc: shepard.siegel, john.miller, stable
On 7/19/2019 2:07 PM, Ed Czeck wrote:
> Queue index was incorrectly incremented with port, which
> caused swizzling of packet placement among queues.
What is "swizzling of packet placement"?
'qidx' is used to set 'phys_qid', if what the name suggest is correct it is used
to access the actual physical queues.
How this was working if you are calculating physical queue indexes wrong?
(Of-course except port 0)
Are you actually fixing the multiple port support?
> This manifested
> when the number of configured ports was >1 and < nb_queues.
I can see port number ">1", but is the 'nb_queues' limitation real?
If there are 2 queues per port, and you are configuring 3 ports will the
original calculation be correct?
>
> Fixes: c33d45af3633 ("net/ark: add Tx initial version")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
> ---
> drivers/net/ark/ark_ethdev_rx.c | 4 +---
> drivers/net/ark/ark_ethdev_tx.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
> index 7de1a98..6156730 100644
> --- a/drivers/net/ark/ark_ethdev_rx.c
> +++ b/drivers/net/ark/ark_ethdev_rx.c
> @@ -127,9 +127,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
> uint32_t i;
> int status;
>
> - /* Future works: divide the Q's evenly with multi-ports */
> - int port = dev->data->port_id;
> - int qidx = port + queue_idx;
> + int qidx = queue_idx;
>
> /* We may already be setup, free memory prior to re-allocation */
> if (dev->data->rx_queues[queue_idx] != NULL) {
> diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
> index 1967655..08bcf43 100644
> --- a/drivers/net/ark/ark_ethdev_tx.c
> +++ b/drivers/net/ark/ark_ethdev_tx.c
> @@ -211,9 +211,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
> struct ark_tx_queue *queue;
> int status;
>
> - /* Future: divide the Q's evenly with multi-ports */
> - int port = dev->data->port_id;
> - int qidx = port + queue_idx;
> + int qidx = queue_idx;
>
> if (!rte_is_power_of_2(nb_desc)) {
> PMD_DRV_LOG(ERR,
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id
2019-07-16 21:34 [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ed Czeck
` (2 preceding siblings ...)
2019-07-19 13:07 ` Ed Czeck
@ 2019-07-22 12:35 ` Ed Czeck
2019-07-22 12:35 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
2019-07-22 16:07 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
3 siblings, 2 replies; 9+ messages in thread
From: Ed Czeck @ 2019-07-22 12:35 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: shepard.siegel, john.miller, Ed Czeck, stable
Queue index was incorrectly incremented with port, which
caused incorrect queue packet placement. This manifested
when port number was != 0.
Fixes: c33d45af3633 ("net/ark: add Tx initial version")
Cc: stable@dpdk.org
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev_rx.c | 4 +---
drivers/net/ark/ark_ethdev_tx.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 7de1a98..6156730 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -127,9 +127,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
uint32_t i;
int status;
- /* Future works: divide the Q's evenly with multi-ports */
- int port = dev->data->port_id;
- int qidx = port + queue_idx;
+ int qidx = queue_idx;
/* We may already be setup, free memory prior to re-allocation */
if (dev->data->rx_queues[queue_idx] != NULL) {
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 1967655..08bcf43 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -211,9 +211,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
struct ark_tx_queue *queue;
int status;
- /* Future: divide the Q's evenly with multi-ports */
- int port = dev->data->port_id;
- int qidx = port + queue_idx;
+ int qidx = queue_idx;
if (!rte_is_power_of_2(nb_desc)) {
PMD_DRV_LOG(ERR,
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close
2019-07-22 12:35 ` Ed Czeck
@ 2019-07-22 12:35 ` Ed Czeck
2019-07-22 16:07 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
1 sibling, 0 replies; 9+ messages in thread
From: Ed Czeck @ 2019-07-22 12:35 UTC (permalink / raw)
To: dev, ferruh.yigit; +Cc: shepard.siegel, john.miller, Ed Czeck
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources
for the port can be freed by rte_eth_dev_close()
Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 86e500e..3435728 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -261,6 +261,8 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
/* Use dummy function until setup */
dev->rx_pkt_burst = ð_ark_recv_pkts_noop;
dev->tx_pkt_burst = ð_ark_xmit_pkts_noop;
+ /* Let rte_eth_dev_close() release the port resources */
+ dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr;
ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr;
@@ -706,6 +708,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev)
eth_ark_dev_rx_queue_release(dev->data->rx_queues[i]);
dev->data->rx_queues[i] = 0;
}
+
+ rte_free(dev->data->mac_addrs);
+ dev->data->mac_addrs = 0;
}
static void
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id
2019-07-22 12:35 ` Ed Czeck
2019-07-22 12:35 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
@ 2019-07-22 16:07 ` Ferruh Yigit
1 sibling, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2019-07-22 16:07 UTC (permalink / raw)
To: Ed Czeck, dev; +Cc: shepard.siegel, john.miller, stable
On 7/22/2019 1:35 PM, Ed Czeck wrote:
> Queue index was incorrectly incremented with port, which
> caused incorrect queue packet placement. This manifested
> when port number was != 0.
>
> Fixes: c33d45af3633 ("net/ark: add Tx initial version")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
Hi Ed,
Please add version tag, v#, to the subject prefix, that makes easy to trace the
patches, like this is v3 of the patchset.
Also changing patch title as:
net/ark: fix queue packet replacement
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-07-22 16:07 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 21:34 [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ed Czeck
2019-07-16 21:34 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
2019-07-17 17:33 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
2019-07-19 13:07 ` Ed Czeck
2019-07-19 13:07 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
2019-07-19 17:27 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id Ferruh Yigit
2019-07-22 12:35 ` Ed Czeck
2019-07-22 12:35 ` [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is close Ed Czeck
2019-07-22 16:07 ` [dpdk-dev] [PATCH 1/2] net/ark: remove queue offset based on port id 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).