From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 1C53D595E for ; Wed, 15 Jul 2015 19:28:13 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 15 Jul 2015 10:28:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,481,1432623600"; d="scan'208";a="765079633" Received: from unknown (HELO Sent) ([10.217.248.180]) by orsmga002.jf.intel.com with SMTP; 15 Jul 2015 10:28:11 -0700 Received: by Sent (sSMTP sendmail emulation); Wed, 15 Jul 2015 19:27:49 +0200 From: Tomasz Kulasek To: dev@dpdk.org Date: Wed, 15 Jul 2015 19:26:23 +0200 Message-Id: <1436981189-3320-4-git-send-email-tomaszx.kulasek@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436981189-3320-1-git-send-email-tomaszx.kulasek@intel.com> References: <1435589444-1988-1-git-send-email-tomaszx.kulasek@intel.com> <1436981189-3320-1-git-send-email-tomaszx.kulasek@intel.com> Subject: [dpdk-dev] [PATCHv4 3/9] null: extend number of virtual queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 17:28:14 -0000 This patch adds a possibility to configure more than one queue on null device. Signed-off-by: Tomasz Kulasek --- drivers/net/null/rte_eth_null.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index a8b3191..39ffcde 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]; }; @@ -213,7 +213,7 @@ 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) + if (rx_queue_id >= dev->data->nb_rx_queues) return -ENODEV; internals = dev->data->dev_private; @@ -246,7 +246,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, if (dev == NULL) return -EINVAL; - if (tx_queue_id != 0) + if (tx_queue_id >= dev->data->nb_tx_queues) return -ENODEV; internals = dev->data->dev_private; @@ -279,8 +279,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