From patchwork Thu Jul 21 17:22:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 14981 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 68429568C; Thu, 21 Jul 2016 19:25:10 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5AF78568C for ; Thu, 21 Jul 2016 19:25:08 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 21 Jul 2016 10:25:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,400,1464678000"; d="scan'208"; a="1011398811" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 21 Jul 2016 10:25:06 -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 u6LHP5jG017091; Thu, 21 Jul 2016 18:25:05 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u6LHP5Rc026315; Thu, 21 Jul 2016 18:25:05 +0100 Received: (from fyigit@localhost) by sivswdev02.ir.intel.com with id u6LHP5pC026311; Thu, 21 Jul 2016 18:25:05 +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 Cc: Nicolas Pernas Maradei Date: Thu, 21 Jul 2016 18:22:54 +0100 Message-Id: <1469121780-26099-16-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1469121780-26099-1-git-send-email-ferruh.yigit@intel.com> References: <1469121780-26099-1-git-send-email-ferruh.yigit@intel.com> Subject: [dpdk-dev] [RFC 15/21] net/pcap: update how single iface handled 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove hardcoded single interface values, make it more obvious. Signed-off-by: Ferruh Yigit --- drivers/net/pcap/rte_eth_pcap.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 8e011ea..fb170db 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -967,16 +967,14 @@ rte_pmd_pcap_devinit(const char *name, const char *params) if (ret < 0) goto free_kvlist; - dumpers.queue[0].pcap = pcaps.queue[0].pcap; - dumpers.queue[0].name = pcaps.queue[0].name; - dumpers.queue[0].type = pcaps.queue[0].type; - single_iface = 1; + dumpers.queue[0] = pcaps.queue[0]; - ret = rte_eth_from_pcaps(name, &pcaps, 1, &dumpers, 1, - kvlist, single_iface, is_tx_pcap); + single_iface = 1; + pcaps.num_of_queue = 1; + dumpers.num_of_queue = 1; - goto free_kvlist; + goto create_eth; } /* @@ -1027,6 +1025,7 @@ rte_pmd_pcap_devinit(const char *name, const char *params) if (ret < 0) goto free_kvlist; +create_eth: ret = rte_eth_from_pcaps(name, &pcaps, pcaps.num_of_queue, &dumpers, dumpers.num_of_queue, kvlist, single_iface, is_tx_pcap);