net/ark: remove queue offset based on port id
PATCH 1/2 net/ark: remove queue offset based on port id
--- drivers/net/ark/ark_ethdev_rx.c | 4 +--- drivers/net/ark/ark_ethdev_tx.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +1 -3
@@ -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 ) {
drivers/net/ark/ark_ethdev_tx.c +1 -3
@@ -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,
Signature · 1 line
2.7.4
PATCH 1/2 net/ark: remove queue offset based on port id
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.
--- drivers/net/ark/ark_ethdev_rx.c | 4 +--- drivers/net/ark/ark_ethdev_tx.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +1 -3
@@ -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 ) {
drivers/net/ark/ark_ethdev_tx.c +1 -3
@@ -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,
Signature · 1 line
2.7.4
PATCH 2/2 net/ark: remove resources when port is close
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources for the port can be freed by rte_eth_dev_close()
--- drivers/net/ark/ark_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ark/ark_ethdev.c +5 -0
@@ -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
Signature · 1 line
2.7.4
Quoted 2 lines · Ed Czeck
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?
Quoted 2 lines
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?
Quoted 41 lines
Fixes c33d45af3633 ("net/ark: add Tx initial version")Signed-off-by Ed Czeck <[email protected]>--- drivers/net/ark/ark_ethdev_rx.c | 4 +--- drivers/net/ark/ark_ethdev_tx.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)drivers/net/ark/ark_ethdev_rx.c +1
-3@@ -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 ) {drivers/net/ark/ark_ethdev_tx.c +1
-3@@ -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,
Quoted 4 lines · Ed Czeck
Fixes c33d45af3633 ("net/ark: add Tx initial version")Signed-off-by Ed Czeck <[email protected]>
Hi Ed,
Can you please add some context to commit log, what was the problem, what was its impact, how this is fixed?
Quoted 36 lines
--- drivers/net/ark/ark_ethdev_rx.c | 4 +--- drivers/net/ark/ark_ethdev_tx.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)drivers/net/ark/ark_ethdev_rx.c +1
-3@@ -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 ) {drivers/net/ark/ark_ethdev_tx.c +1
-3@@ -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,
PATCH 1/2 net/ark: remove queue offset based on port id
In reply to Ed CzeckQueue index was incorrectly incremented with port, which caused incorrect queue packet placement. This manifested when port number was != 0.
--- drivers/net/ark/ark_ethdev_rx.c | 4 +--- drivers/net/ark/ark_ethdev_tx.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +1 -3
@@ -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 ) {
drivers/net/ark/ark_ethdev_tx.c +1 -3
@@ -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,
Signature · 1 line
2.7.4
PATCH 2/2 net/ark: remove resources when port is close
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources for the port can be freed by rte_eth_dev_close()
--- drivers/net/ark/ark_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ark/ark_ethdev.c +5 -0
@@ -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
Signature · 1 line
2.7.4
Quoted 8 lines · Ed Czeck
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")Signed-off-by Ed Czeck <[email protected]>
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.
PATCH 2/2 net/ark: remove resources when port is close
In reply to Ed CzeckSet RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources for the port can be freed by rte_eth_dev_close()
--- drivers/net/ark/ark_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ark/ark_ethdev.c +5 -0
@@ -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
Signature · 1 line
2.7.4