From: Ferruh Yigit Date: Fri, 26 Aug 2016 11:17:38 +0000 (+0100) Subject: net/pcap: convert config option to a macro X-Git-Tag: spdx-start~5874 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3c8870f8ff2f0f9c7cd00eb2fcc3f7221ef7be13;p=dpdk.git net/pcap: convert config option to a macro pcap PMD is using ring PMD configuration parameters to set max number of queues. This creates an unnecessary dependency and confusion. Stop using configuration parameter to set max number of queues and convert this variable into a macro within source code, to simplify configuration file. Default value of macro is same as ring parameter's default. pcap pmd doesn't need to be configured in a detail to set rx and tx max queue numbers separately, so using same macro for both queues. Signed-off-by: Ferruh Yigit Acked-by: Stephen Hemminger --- diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 29cc54ba5d..595d4f8c05 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * Copyright(c) 2014 6WIND S.A. * All rights reserved. * @@ -58,6 +58,8 @@ #define ETH_PCAP_ARG_MAXLEN 64 +#define RTE_PMD_PCAP_MAX_QUEUES 16 + static char errbuf[PCAP_ERRBUF_SIZE]; static unsigned char tx_pcap_data[RTE_ETH_PCAP_SNAPLEN]; static struct timeval start_time; @@ -87,22 +89,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; };