get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/333/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 333,
    "url": "http://patches.dpdk.org/api/patches/333/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1410380225-13751-1-git-send-email-nico@emutex.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1410380225-13751-1-git-send-email-nico@emutex.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1410380225-13751-1-git-send-email-nico@emutex.com",
    "date": "2014-09-10T20:17:05",
    "name": "[dpdk-dev] Fix librte_pmd_pcap driver double stop error",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bef0811746b479f4d71d573de04e6a9c0969c238",
    "submitter": {
        "id": 66,
        "url": "http://patches.dpdk.org/api/people/66/?format=api",
        "name": "Nicolás Pernas Maradei",
        "email": "nico@emutex.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1410380225-13751-1-git-send-email-nico@emutex.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/333/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/333/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E596E32A5;\n\tWed, 10 Sep 2014 22:12:26 +0200 (CEST)",
            "from smtp.digiweb.ie (smtp2.digiweb.ie [83.147.160.14])\n\tby dpdk.org (Postfix) with ESMTP id 00DD22E8B\n\tfor <dev@dpdk.org>; Wed, 10 Sep 2014 22:12:26 +0200 (CEST)",
            "from statler.emutex.com (unknown [92.51.199.138])\n\tby smtp.digiweb.ie (Postfix) with ESMTP id 855AD290255\n\tfor <dev@dpdk.org>; Wed, 10 Sep 2014 21:17:18 +0100 (IST)",
            "from [10.10.64.102] (helo=nico-emutex.emutex.com)\n\tby statler.emutex.com with esmtpsa\n\t(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.72) (envelope-from <nico@emutex.com>)\n\tid 1XRoKM-0003qq-1n; Wed, 10 Sep 2014 21:17:18 +0100"
        ],
        "From": "=?UTF-8?q?Nicol=C3=A1s=20Pernas=20Maradei?= <nico@emutex.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 10 Sep 2014 17:17:05 -0300",
        "Message-Id": "<1410380225-13751-1-git-send-email-nico@emutex.com>",
        "X-Mailer": "git-send-email 1.8.3.2",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Cc": "=?UTF-8?q?Nicola=CC=81s=20Pernas=20Maradei?= <nico@emutex.com>",
        "Subject": "[dpdk-dev] [PATCH] Fix librte_pmd_pcap driver double stop error",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Nicolás Pernas Maradei <nico@emutex.com>\n\nlibrte_pmd_pcap driver was opening the pcap/interfaces only at init time and\nclosing them only when the port was being stopped. This behaviour would cause\nproblems (leading to segfault) if the user closed the port 2 times. The first\ntime the pcap/interfaces would be normally closed but libpcap would throw an\nerror causing a segfault if the closed pcaps/interfaces were closed again.\nThis behaviour is solved by re-openning pcaps/interfaces when the port is\nstarted (only if these weren't open already for example at init time).\n\nSigned-off-by: Nicolás Pernas Maradei <nico@emutex.com>\n---\n lib/librte_pmd_pcap/rte_eth_pcap.c | 254 +++++++++++++++++++++++++++++--------\n 1 file changed, 202 insertions(+), 52 deletions(-)",
    "diff": "diff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c b/lib/librte_pmd_pcap/rte_eth_pcap.c\nindex eebe768..f4d501d 100644\n--- a/lib/librte_pmd_pcap/rte_eth_pcap.c\n+++ b/lib/librte_pmd_pcap/rte_eth_pcap.c\n@@ -66,6 +66,8 @@ struct pcap_rx_queue {\n \tstruct rte_mempool *mb_pool;\n \tvolatile unsigned long rx_pkts;\n \tvolatile unsigned long err_pkts;\n+\tconst char *name;\n+\tconst char *type;\n };\n \n struct pcap_tx_queue {\n@@ -73,17 +75,23 @@ struct pcap_tx_queue {\n \tpcap_t *pcap;\n \tvolatile unsigned long tx_pkts;\n \tvolatile unsigned long err_pkts;\n+\tconst char *name;\n+\tconst char *type;\n };\n \n struct rx_pcaps {\n \tunsigned num_of_rx;\n \tpcap_t *pcaps[RTE_PMD_RING_MAX_RX_RINGS];\n+\tconst char *names[RTE_PMD_RING_MAX_RX_RINGS];\n+\tconst char *types[RTE_PMD_RING_MAX_RX_RINGS];\n };\n \n struct tx_pcaps {\n \tunsigned num_of_tx;\n \tpcap_dumper_t *dumpers[RTE_PMD_RING_MAX_TX_RINGS];\n \tpcap_t *pcaps[RTE_PMD_RING_MAX_RX_RINGS];\n+\tconst char *names[RTE_PMD_RING_MAX_RX_RINGS];\n+\tconst char *types[RTE_PMD_RING_MAX_RX_RINGS];\n };\n \n struct pmd_internals {\n@@ -105,6 +113,10 @@ const char *valid_arguments[] = {\n \tNULL\n };\n \n+static int open_single_tx_pcap(const char *pcap_filename, pcap_dumper_t **dumper);\n+static int open_single_rx_pcap(const char *pcap_filename, pcap_t **pcap);\n+static int open_single_iface(const char *iface, pcap_t **pcap);\n+\n static struct ether_addr eth_addr = { .addr_bytes = { 0, 0, 0, 0x1, 0x2, 0x3 } };\n static const char *drivername = \"Pcap PMD\";\n static struct rte_eth_link pmd_link = {\n@@ -253,6 +265,59 @@ eth_pcap_tx(void *queue,\n static int\n eth_dev_start(struct rte_eth_dev *dev)\n {\n+\tunsigned i;\n+\tstruct pmd_internals *internals = dev->data->dev_private;\n+\tunsigned nb_rxq = internals->nb_rx_queues;\n+\tunsigned nb_txq = internals->nb_tx_queues;\n+\tstruct pcap_tx_queue *tx;\n+\tstruct pcap_rx_queue *rx;\n+\n+\t/* Special iface case. Single pcap is open and shared between tx/rx. */\n+\tif (nb_rxq == nb_txq && nb_rxq == 1) {\n+\t\ttx = &internals->tx_queue[0];\n+\t\trx = &internals->rx_queue[0];\n+\n+\t\tif (!tx->pcap && strcmp(tx->type, ETH_PCAP_IFACE_ARG) == 0) {\n+\t\t\tif (open_single_iface(tx->name, &tx->pcap) < 0)\n+\t\t\t\treturn -1;\n+\t\t\trx->pcap = tx->pcap;\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\n+\t/* If not open already, open tx pcaps/dumpers */\n+\tfor (i = 0; i < internals->nb_tx_queues; i++) {\n+\t\ttx = &internals->tx_queue[i];\n+\n+\t\tif (!tx->dumper && strcmp(tx->type, ETH_PCAP_TX_PCAP_ARG) == 0) {\n+\t\t\tif (open_single_tx_pcap(tx->name, &tx->dumper) < 0)\n+\t\t\t\treturn -1;\n+\t\t}\n+\n+\t\telse if (!tx->pcap && strcmp(tx->type, ETH_PCAP_TX_IFACE_ARG) == 0) {\n+\t\t\tif (open_single_iface(tx->name, &tx->pcap) < 0)\n+\t\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\t/* If not open already, open rx pcaps */\n+\tfor (i = 0; i < internals->nb_rx_queues; i++) {\n+\t\trx = &internals->rx_queue[i];\n+\n+\t\tif (rx->pcap != NULL)\n+\t\t\tcontinue;\n+\n+\t\tif (strcmp(rx->type, ETH_PCAP_RX_PCAP_ARG) == 0) {\n+\t\t\tif (open_single_rx_pcap(rx->name, &rx->pcap) < 0)\n+\t\t\t\treturn -1;\n+\t\t}\n+\n+\t\telse if (strcmp(rx->type, ETH_PCAP_RX_IFACE_ARG) == 0) {\n+\t\t\tif (open_single_iface(rx->name, &rx->pcap) < 0)\n+\t\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n \tdev->data->dev_link.link_status = 1;\n \treturn 0;\n }\n@@ -266,17 +331,45 @@ static void\n eth_dev_stop(struct rte_eth_dev *dev)\n {\n \tunsigned i;\n-\tpcap_dumper_t *dumper;\n-\tpcap_t *pcap;\n \tstruct pmd_internals *internals = dev->data->dev_private;\n+\tstruct pcap_tx_queue *tx;\n+\tstruct pcap_rx_queue *rx;\n+\tunsigned nb_rxq = internals->nb_rx_queues;\n+\tunsigned nb_txq = internals->nb_tx_queues;\n+\n+\t/* Special iface case. Single pcap is open and shared between tx/rx. */\n+\tif (internals->rx_queue->pcap == internals->tx_queue->pcap &&\n+\t\tnb_rxq == nb_txq && nb_rxq == 1) {\n+\n+\t\ttx = &internals->tx_queue[0];\n+\t\trx = &internals->rx_queue[0];\n+\t\tpcap_close(tx->pcap);\n+\t\ttx->pcap = NULL;\n+\t\trx->pcap = NULL;\n+\t\treturn;\n+\t}\n \n \tfor (i = 0; i < internals->nb_tx_queues; i++) {\n-\t\tdumper = internals->tx_queue[i].dumper;\n-\t\tif(dumper != NULL)\n-\t\t\tpcap_dump_close(dumper);\n-\t\tpcap = internals->tx_queue[i].pcap;\n-\t\tif(pcap != NULL)\n-\t\t\tpcap_close(pcap);\n+\t\ttx = &internals->tx_queue[i];\n+\n+\t\tif (tx->dumper != NULL) {\n+\t\t\tpcap_dump_close(tx->dumper);\n+\t\t\ttx->dumper = NULL;\n+\t\t}\n+\n+\t\tif (tx->pcap != NULL) {\n+\t\t\tpcap_close(tx->pcap);\n+\t\t\ttx->pcap = NULL;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < internals->nb_rx_queues; i++) {\n+\t\trx = &internals->rx_queue[i];\n+\n+\t\tif (rx->pcap != NULL) {\n+\t\t\tpcap_close(rx->pcap);\n+\t\t\trx->pcap = NULL;\n+\t\t}\n \t}\n \n \tdev->data->dev_link.link_status = 0;\n@@ -409,55 +502,79 @@ static struct eth_dev_ops ops = {\n  * reference of it for use it later on.\n  */\n static int\n-open_rx_pcap(const char *key __rte_unused, const char *value, void *extra_args)\n+open_rx_pcap(const char *key, const char *value, void *extra_args)\n {\n \tunsigned i;\n \tconst char *pcap_filename = value;\n \tstruct rx_pcaps *pcaps = extra_args;\n-\tpcap_t *rx_pcap;\n+\tpcap_t *pcap = NULL;\n \n \tfor (i = 0; i < pcaps->num_of_rx; i++) {\n-\t\tif ((rx_pcap = pcap_open_offline(pcap_filename, errbuf)) == NULL) {\n-\t\t\tRTE_LOG(ERR, PMD, \"Couldn't open %s: %s\\n\", pcap_filename, errbuf);\n+\t\tif (open_single_rx_pcap(pcap_filename, &pcap) < 0)\n \t\t\treturn -1;\n-\t\t}\n-\t\tpcaps->pcaps[i] = rx_pcap;\n+\n+\t\tpcaps->pcaps[i] = pcap;\n+\t\tpcaps->names[i] = pcap_filename;\n+\t\tpcaps->types[i] = key;\n \t}\n \n \treturn 0;\n }\n \n+static int\n+open_single_rx_pcap(const char *pcap_filename, pcap_t **pcap)\n+{\n+\tif ((*pcap = pcap_open_offline(pcap_filename, errbuf)) == NULL) {\n+\t\tRTE_LOG(ERR, PMD, \"Couldn't open %s: %s\\n\", pcap_filename, errbuf);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n /*\n  * Opens a pcap file for writing and stores a reference to it\n  * for use it later on.\n  */\n static int\n-open_tx_pcap(const char *key __rte_unused, const char *value, void *extra_args)\n+open_tx_pcap(const char *key, const char *value, void *extra_args)\n {\n \tunsigned i;\n \tconst char *pcap_filename = value;\n \tstruct tx_pcaps *dumpers = extra_args;\n-\tpcap_t *tx_pcap;\n \tpcap_dumper_t *dumper;\n \n \tfor (i = 0; i < dumpers->num_of_tx; i++) {\n-\t\t/*\n-\t\t * We need to create a dummy empty pcap_t to use it\n-\t\t * with pcap_dump_open(). We create big enough an Ethernet\n-\t\t * pcap holder.\n-\t\t */\n-\t\tif ((tx_pcap = pcap_open_dead(DLT_EN10MB, RTE_ETH_PCAP_SNAPSHOT_LEN))\n-\t\t\t\t== NULL) {\n-\t\t\tRTE_LOG(ERR, PMD, \"Couldn't create dead pcap\\n\");\n+\t\tif (open_single_tx_pcap(pcap_filename, &dumper) < 0)\n \t\t\treturn -1;\n-\t\t}\n \n-\t\t/* The dumper is created using the previous pcap_t reference */\n-\t\tif ((dumper = pcap_dump_open(tx_pcap, pcap_filename)) == NULL) {\n-\t\t\tRTE_LOG(ERR, PMD, \"Couldn't open %s for writing.\\n\", pcap_filename);\n-\t\t\treturn -1;\n-\t\t}\n \t\tdumpers->dumpers[i] = dumper;\n+\t\tdumpers->names[i] = pcap_filename;\n+\t\tdumpers->types[i] = key;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+open_single_tx_pcap(const char *pcap_filename, pcap_dumper_t **dumper)\n+{\n+\tpcap_t *tx_pcap;\n+\t/*\n+\t * We need to create a dummy empty pcap_t to use it\n+\t * with pcap_dump_open(). We create big enough an Ethernet\n+\t * pcap holder.\n+\t */\n+\n+\tif ((tx_pcap = pcap_open_dead(DLT_EN10MB, RTE_ETH_PCAP_SNAPSHOT_LEN))\n+\t\t\t== NULL) {\n+\t\tRTE_LOG(ERR, PMD, \"Couldn't create dead pcap\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\t/* The dumper is created using the previous pcap_t reference */\n+\tif ((*dumper = pcap_dump_open(tx_pcap, pcap_filename)) == NULL) {\n+\t\tRTE_LOG(ERR, PMD, \"Couldn't open %s for writing.\\n\", pcap_filename);\n+\t\treturn -1;\n \t}\n \n \treturn 0;\n@@ -482,13 +599,19 @@ open_iface_live(const char *iface, pcap_t **pcap) {\n  * Opens an interface for reading and writing\n  */\n static inline int\n-open_rx_tx_iface(const char *key __rte_unused, const char *value, void *extra_args)\n+open_rx_tx_iface(const char *key, const char *value, void *extra_args)\n {\n \tconst char *iface = value;\n-\tpcap_t **pcap = extra_args;\n+\tstruct rx_pcaps *pcaps = extra_args;\n+\tpcap_t *pcap = NULL;\n \n-\tif(open_iface_live(iface, pcap) < 0)\n+\tif (open_single_iface(iface, &pcap) < 0)\n \t\treturn -1;\n+\n+\tpcaps->pcaps[0] = pcap;\n+\tpcaps->names[0] = iface;\n+\tpcaps->types[0] = key;\n+\n \treturn 0;\n }\n \n@@ -496,7 +619,7 @@ open_rx_tx_iface(const char *key __rte_unused, const char *value, void *extra_ar\n  * Opens a NIC for reading packets from it\n  */\n static inline int\n-open_rx_iface(const char *key __rte_unused, const char *value, void *extra_args)\n+open_rx_iface(const char *key, const char *value, void *extra_args)\n {\n \tunsigned i;\n \tconst char *iface = value;\n@@ -504,9 +627,11 @@ open_rx_iface(const char *key __rte_unused, const char *value, void *extra_args)\n \tpcap_t *pcap = NULL;\n \n \tfor (i = 0; i < pcaps->num_of_rx; i++) {\n-\t\tif(open_iface_live(iface, &pcap) < 0)\n+\t\tif (open_single_iface(iface, &pcap) < 0)\n \t\t\treturn -1;\n \t\tpcaps->pcaps[i] = pcap;\n+\t\tpcaps->names[i] = iface;\n+\t\tpcaps->types[i] = key;\n \t}\n \n \treturn 0;\n@@ -515,8 +640,8 @@ open_rx_iface(const char *key __rte_unused, const char *value, void *extra_args)\n /*\n  * Opens a NIC for writing packets to it\n  */\n-static inline int\n-open_tx_iface(const char *key __rte_unused, const char *value, void *extra_args)\n+static int\n+open_tx_iface(const char *key, const char *value, void *extra_args)\n {\n \tunsigned i;\n \tconst char *iface = value;\n@@ -524,14 +649,26 @@ open_tx_iface(const char *key __rte_unused, const char *value, void *extra_args)\n \tpcap_t *pcap;\n \n \tfor (i = 0; i < pcaps->num_of_tx; i++) {\n-\t\tif(open_iface_live(iface, &pcap) < 0)\n+\t\tif (open_single_iface(iface, &pcap) < 0)\n \t\t\treturn -1;\n \t\tpcaps->pcaps[i] = pcap;\n+\t\tpcaps->names[i] = iface;\n+\t\tpcaps->types[i] = key;\n \t}\n \n \treturn 0;\n }\n \n+static int\n+open_single_iface(const char *iface, pcap_t **pcap)\n+{\n+\tif (open_iface_live(iface, pcap) < 0) {\n+\t\tRTE_LOG(ERR, PMD, \"Couldn't open interface %s\\n\", iface);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n \n static int\n rte_pmd_init_internals(const char *name, const unsigned nb_rx_queues,\n@@ -617,9 +754,10 @@ rte_pmd_init_internals(const char *name, const unsigned nb_rx_queues,\n }\n \n static int\n-rte_eth_from_pcaps_n_dumpers(const char *name, pcap_t * const rx_queues[],\n+rte_eth_from_pcaps_n_dumpers(const char *name,\n+\t\tstruct rx_pcaps *rx_queues,\n \t\tconst unsigned nb_rx_queues,\n-\t\tpcap_dumper_t * const tx_queues[],\n+\t\tstruct tx_pcaps *tx_queues,\n \t\tconst unsigned nb_tx_queues,\n \t\tconst unsigned numa_node,\n \t\tstruct rte_kvargs *kvlist)\n@@ -639,10 +777,14 @@ rte_eth_from_pcaps_n_dumpers(const char *name, pcap_t * const rx_queues[],\n \t\treturn -1;\n \n \tfor (i = 0; i < nb_rx_queues; i++) {\n-\t\tinternals->rx_queue->pcap = rx_queues[i];\n+\t\tinternals->rx_queue->pcap = rx_queues->pcaps[i];\n+\t\tinternals->rx_queue->name = rx_queues->names[i];\n+\t\tinternals->rx_queue->type = rx_queues->types[i];\n \t}\n \tfor (i = 0; i < nb_tx_queues; i++) {\n-\t\tinternals->tx_queue->dumper = tx_queues[i];\n+\t\tinternals->tx_queue->dumper = tx_queues->dumpers[i];\n+\t\tinternals->tx_queue->name = tx_queues->names[i];\n+\t\tinternals->tx_queue->type = tx_queues->types[i];\n \t}\n \n \teth_dev->rx_pkt_burst = eth_pcap_rx;\n@@ -651,10 +793,12 @@ rte_eth_from_pcaps_n_dumpers(const char *name, pcap_t * const rx_queues[],\n \treturn 0;\n }\n \n+\tstruct rx_pcaps pcaps;\n static int\n-rte_eth_from_pcaps(const char *name, pcap_t * const rx_queues[],\n+rte_eth_from_pcaps(const char *name,\n+\t\tstruct rx_pcaps *rx_queues,\n \t\tconst unsigned nb_rx_queues,\n-\t\tpcap_t * const tx_queues[],\n+\t\tstruct tx_pcaps *tx_queues,\n \t\tconst unsigned nb_tx_queues,\n \t\tconst unsigned numa_node,\n \t\tstruct rte_kvargs *kvlist)\n@@ -674,10 +818,14 @@ rte_eth_from_pcaps(const char *name, pcap_t * const rx_queues[],\n \t\treturn -1;\n \n \tfor (i = 0; i < nb_rx_queues; i++) {\n-\t\tinternals->rx_queue->pcap = rx_queues[i];\n+\t\tinternals->rx_queue->pcap = rx_queues->pcaps[i];\n+\t\tinternals->rx_queue->name = rx_queues->names[i];\n+\t\tinternals->rx_queue->type = rx_queues->types[i];\n \t}\n \tfor (i = 0; i < nb_tx_queues; i++) {\n-\t\tinternals->tx_queue->pcap = tx_queues[i];\n+\t\tinternals->tx_queue->pcap = tx_queues->pcaps[i];\n+\t\tinternals->tx_queue->name = tx_queues->names[i];\n+\t\tinternals->tx_queue->type = tx_queues->types[i];\n \t}\n \n \teth_dev->rx_pkt_burst = eth_pcap_rx;\n@@ -715,11 +863,13 @@ rte_pmd_pcap_devinit(const char *name, const char *params)\n \tif (rte_kvargs_count(kvlist, ETH_PCAP_IFACE_ARG) == 1) {\n \n \t\tret = rte_kvargs_process(kvlist, ETH_PCAP_IFACE_ARG,\n-\t\t\t\t&open_rx_tx_iface, &pcaps.pcaps[0]);\n+\t\t\t\t&open_rx_tx_iface, &pcaps);\n \t\tif (ret < 0)\n \t\t\treturn -1;\n-\n-\t\treturn rte_eth_from_pcaps(name, pcaps.pcaps, 1, pcaps.pcaps, 1,\n+\t\tdumpers.pcaps[0] = pcaps.pcaps[0];\n+\t\tdumpers.names[0] = pcaps.names[0];\n+\t\tdumpers.types[0] = pcaps.types[0];\n+\t\treturn rte_eth_from_pcaps(name, &pcaps, 1, &dumpers, 1,\n \t\t\t\tnuma_node, kvlist);\n \t}\n \n@@ -760,10 +910,10 @@ rte_pmd_pcap_devinit(const char *name, const char *params)\n \t\treturn -1;\n \n \tif (using_dumpers)\n-\t\treturn rte_eth_from_pcaps_n_dumpers(name, pcaps.pcaps, pcaps.num_of_rx,\n-\t\t\t\tdumpers.dumpers, dumpers.num_of_tx, numa_node, kvlist);\n+\t\treturn rte_eth_from_pcaps_n_dumpers(name, &pcaps, pcaps.num_of_rx,\n+\t\t\t\t&dumpers, dumpers.num_of_tx, numa_node, kvlist);\n \n-\treturn rte_eth_from_pcaps(name, pcaps.pcaps, pcaps.num_of_rx, dumpers.pcaps,\n+\treturn rte_eth_from_pcaps(name, &pcaps, pcaps.num_of_rx, &dumpers,\n \t\t\tdumpers.num_of_tx, numa_node, kvlist);\n \n }\n",
    "prefixes": [
        "dpdk-dev"
    ]
}