diff mbox

[dpdk-dev,15/22] net/pcap: update how single iface handled

Message ID 1472210279-8286-16-git-send-email-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers show

Commit Message

Ferruh Yigit Aug. 26, 2016, 11:17 a.m. UTC
Remove hardcoded single interface values, make it more obvious.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/pcap/rte_eth_pcap.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 5416947..8b312a9 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -969,16 +969,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;
 	}
 
 	/*
@@ -1029,6 +1027,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);