From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id BA4C958D8 for ; Fri, 26 Aug 2016 13:18:49 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP; 26 Aug 2016 04:18:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,580,1464678000"; d="scan'208";a="1031638607" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 26 Aug 2016 04:18:48 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u7QBIlGA029922 for ; Fri, 26 Aug 2016 12:18:47 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u7QBIlBF008343 for ; Fri, 26 Aug 2016 12:18:47 +0100 Received: (from fyigit@localhost) by sivswdev02.ir.intel.com with id u7QBIlqd008339 for dev@dpdk.org; Fri, 26 Aug 2016 12:18:47 +0100 X-Authentication-Warning: sivswdev02.ir.intel.com: fyigit set sender to ferruh.yigit@intel.com using -f From: Ferruh Yigit To: dev@dpdk.org Date: Fri, 26 Aug 2016 12:17:38 +0100 Message-Id: <1472210279-8286-2-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1472210279-8286-1-git-send-email-ferruh.yigit@intel.com> References: <1472210279-8286-1-git-send-email-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH 01/22] net/pcap: convert config option to a macro 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: Fri, 26 Aug 2016 11:18:50 -0000 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 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 --- drivers/net/pcap/rte_eth_pcap.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 7e213eb..a0ed1bf 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; }; -- 2.7.4