diff mbox

[dpdk-dev,RFC,01/21] net/pcap: create own configuration parameter

Message ID 1469121780-26099-2-git-send-email-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers show

Commit Message

Ferruh Yigit July 21, 2016, 5:22 p.m. UTC
pcap pmd is using ring pmd configuration parameters to set max number of
queues. This creates an unnecessary dependency and confusion.

Create a new config parameter for pcap PMD:
CONFIG_RTE_PMD_PCAP_MAX_QUEUES

Default value of config is same as ring parameter default.

pcap pmd doesn't need to be configured in a detail to set rx and tx max
queue numbers separately, so using same config item for both queues.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 config/common_base              |  1 +
 drivers/net/pcap/rte_eth_pcap.c | 18 +++++++++---------
 2 files changed, 10 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/config/common_base b/config/common_base
index 7830535..e32bd61 100644
--- a/config/common_base
+++ b/config/common_base
@@ -307,6 +307,7 @@  CONFIG_RTE_PMD_RING_MAX_TX_RINGS=16
 # Compile software PMD backed by PCAP files
 #
 CONFIG_RTE_LIBRTE_PMD_PCAP=n
+CONFIG_RTE_PMD_PCAP_MAX_QUEUES=16
 
 #
 # Compile link bonding PMD library
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 7e213eb..6343c0e 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -87,22 +87,22 @@  struct pcap_tx_queue {
 
 struct rx_pcaps {
 	unsigned num_of_rx;
-	pcap_t *pcaps[RTE_PMD_RING_MAX_RX_RINGS];
-	const char *names[RTE_PMD_RING_MAX_RX_RINGS];
-	const char *types[RTE_PMD_RING_MAX_RX_RINGS];
+	pcap_t *pcaps[RTE_PMD_PCAP_MAX_QUEUES];
+	const char *names[RTE_PMD_PCAP_MAX_QUEUES];
+	const char *types[RTE_PMD_PCAP_MAX_QUEUES];
 };
 
 struct tx_pcaps {
 	unsigned num_of_tx;
-	pcap_dumper_t *dumpers[RTE_PMD_RING_MAX_TX_RINGS];
-	pcap_t *pcaps[RTE_PMD_RING_MAX_RX_RINGS];
-	const char *names[RTE_PMD_RING_MAX_RX_RINGS];
-	const char *types[RTE_PMD_RING_MAX_RX_RINGS];
+	pcap_dumper_t *dumpers[RTE_PMD_PCAP_MAX_QUEUES];
+	pcap_t *pcaps[RTE_PMD_PCAP_MAX_QUEUES];
+	const char *names[RTE_PMD_PCAP_MAX_QUEUES];
+	const char *types[RTE_PMD_PCAP_MAX_QUEUES];
 };
 
 struct pmd_internals {
-	struct pcap_rx_queue rx_queue[RTE_PMD_RING_MAX_RX_RINGS];
-	struct pcap_tx_queue tx_queue[RTE_PMD_RING_MAX_TX_RINGS];
+	struct pcap_rx_queue rx_queue[RTE_PMD_PCAP_MAX_QUEUES];
+	struct pcap_tx_queue tx_queue[RTE_PMD_PCAP_MAX_QUEUES];
 	int if_index;
 	int single_iface;
 };