DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v7 3/9] null: extend number of virtual queues
@ 2015-10-30 13:56 Tomasz Kulasek
  0 siblings, 0 replies; 2+ messages in thread
From: Tomasz Kulasek @ 2015-10-30 13:56 UTC (permalink / raw)
  To: dev

Date: Fri, 30 Oct 2015 14:55:58 +0100
Message-Id: <1446213364-11856-4-git-send-email-tomaszx.kulasek@intel.com>
X-Mailer: git-send-email 2.1.4
In-Reply-To: <1446213364-11856-1-git-send-email-tomaszx.kulasek@intel.com>
References: <1444989651-6236-1-git-send-email-tomaszx.kulasek@intel.com>
 <1446213364-11856-1-git-send-email-tomaszx.kulasek@intel.com>

This patch adds a possibility to configure more than one queue on null

device.



v5 changes:

 - fixed queues number configuration (using internals->nb_*_queues instead

   of dev->data->nb_*_queues)



Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>

Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>

---

 drivers/net/null/rte_eth_null.c |   28 +++++++++++++++++++---------

 1 file changed, 19 insertions(+), 9 deletions(-)



diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c

index c748101..bf81b1b 100644

--- a/drivers/net/null/rte_eth_null.c

+++ b/drivers/net/null/rte_eth_null.c

@@ -71,8 +71,8 @@ struct pmd_internals {

 	unsigned nb_rx_queues;

 	unsigned nb_tx_queues;

 

-	struct null_queue rx_null_queues[1];

-	struct null_queue tx_null_queues[1];

+	struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT];

+	struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT];

 };

 

 

@@ -178,7 +178,15 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)

 }

 

 static int

-eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { return 0; }

+eth_dev_configure(struct rte_eth_dev *dev) {

+	struct pmd_internals *internals;

+

+	internals = dev->data->dev_private;

+	internals->nb_rx_queues = dev->data->nb_rx_queues;

+	internals->nb_tx_queues = dev->data->nb_tx_queues;

+

+	return 0;

+}

 

 static int

 eth_dev_start(struct rte_eth_dev *dev)

@@ -213,10 +221,11 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,

 	if ((dev == NULL) || (mb_pool == NULL))

 		return -EINVAL;

 

-	if (rx_queue_id != 0)

+	internals = dev->data->dev_private;

+

+	if (rx_queue_id >= internals->nb_rx_queues)

 		return -ENODEV;

 

-	internals = dev->data->dev_private;

 	packet_size = internals->packet_size;

 

 	internals->rx_null_queues[rx_queue_id].mb_pool = mb_pool;

@@ -246,10 +255,11 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,

 	if (dev == NULL)

 		return -EINVAL;

 

-	if (tx_queue_id != 0)

+	internals = dev->data->dev_private;

+

+	if (tx_queue_id >= internals->nb_tx_queues)

 		return -ENODEV;

 

-	internals = dev->data->dev_private;

 	packet_size = internals->packet_size;

 

 	dev->data->tx_queues[tx_queue_id] =

@@ -279,8 +289,8 @@ eth_dev_info(struct rte_eth_dev *dev,

 	dev_info->driver_name = drivername;

 	dev_info->max_mac_addrs = 1;

 	dev_info->max_rx_pktlen = (uint32_t)-1;

-	dev_info->max_rx_queues = (uint16_t)internals->nb_rx_queues;

-	dev_info->max_tx_queues = (uint16_t)internals->nb_tx_queues;

+	dev_info->max_rx_queues = RTE_DIM(internals->rx_null_queues);

+	dev_info->max_tx_queues = RTE_DIM(internals->tx_null_queues);

 	dev_info->min_rx_bufsize = 0;

 	dev_info->pci_dev = NULL;

 }

-- 

1.7.9.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-dev] [PATCH v7 3/9] null: extend number of virtual queues
  2015-10-30 14:25 ` [dpdk-dev] [PATCH v7 " Tomasz Kulasek
@ 2015-10-30 14:25   ` Tomasz Kulasek
  0 siblings, 0 replies; 2+ messages in thread
From: Tomasz Kulasek @ 2015-10-30 14:25 UTC (permalink / raw)
  To: dev

This patch adds a possibility to configure more than one queue on null
device.

v5 changes:
 - fixed queues number configuration (using internals->nb_*_queues instead
   of dev->data->nb_*_queues)

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
 drivers/net/null/rte_eth_null.c |   28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index c748101..bf81b1b 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -71,8 +71,8 @@ struct pmd_internals {
 	unsigned nb_rx_queues;
 	unsigned nb_tx_queues;
 
-	struct null_queue rx_null_queues[1];
-	struct null_queue tx_null_queues[1];
+	struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT];
+	struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT];
 };
 
 
@@ -178,7 +178,15 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 }
 
 static int
-eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { return 0; }
+eth_dev_configure(struct rte_eth_dev *dev) {
+	struct pmd_internals *internals;
+
+	internals = dev->data->dev_private;
+	internals->nb_rx_queues = dev->data->nb_rx_queues;
+	internals->nb_tx_queues = dev->data->nb_tx_queues;
+
+	return 0;
+}
 
 static int
 eth_dev_start(struct rte_eth_dev *dev)
@@ -213,10 +221,11 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 	if ((dev == NULL) || (mb_pool == NULL))
 		return -EINVAL;
 
-	if (rx_queue_id != 0)
+	internals = dev->data->dev_private;
+
+	if (rx_queue_id >= internals->nb_rx_queues)
 		return -ENODEV;
 
-	internals = dev->data->dev_private;
 	packet_size = internals->packet_size;
 
 	internals->rx_null_queues[rx_queue_id].mb_pool = mb_pool;
@@ -246,10 +255,11 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 	if (dev == NULL)
 		return -EINVAL;
 
-	if (tx_queue_id != 0)
+	internals = dev->data->dev_private;
+
+	if (tx_queue_id >= internals->nb_tx_queues)
 		return -ENODEV;
 
-	internals = dev->data->dev_private;
 	packet_size = internals->packet_size;
 
 	dev->data->tx_queues[tx_queue_id] =
@@ -279,8 +289,8 @@ eth_dev_info(struct rte_eth_dev *dev,
 	dev_info->driver_name = drivername;
 	dev_info->max_mac_addrs = 1;
 	dev_info->max_rx_pktlen = (uint32_t)-1;
-	dev_info->max_rx_queues = (uint16_t)internals->nb_rx_queues;
-	dev_info->max_tx_queues = (uint16_t)internals->nb_tx_queues;
+	dev_info->max_rx_queues = RTE_DIM(internals->rx_null_queues);
+	dev_info->max_tx_queues = RTE_DIM(internals->tx_null_queues);
 	dev_info->min_rx_bufsize = 0;
 	dev_info->pci_dev = NULL;
 }
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-30 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-30 13:56 [dpdk-dev] [PATCH v7 3/9] null: extend number of virtual queues Tomasz Kulasek
  -- strict thread matches above, loose matches on Subject: below --
2015-10-16 10:00 [dpdk-dev] [PATCH v6 0/9] Dynamic RSS Configuration for Bonding Tomasz Kulasek
2015-10-30 14:25 ` [dpdk-dev] [PATCH v7 " Tomasz Kulasek
2015-10-30 14:25   ` [dpdk-dev] [PATCH v7 3/9] null: extend number of virtual queues Tomasz Kulasek

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).