DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sunil Kumar Kori <sunilkumarkori1985@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] Error in adding vdev for packet capture from secondary process
Date: Tue, 30 Oct 2018 18:36:58 +0530	[thread overview]
Message-ID: <CAFQa0PZHn_w9UGYL6gnhfEEFWUExxf8d4XFF-_HdHUM_HCnYpg@mail.gmail.com> (raw)

Hello Team,

I have an application (DPDK secondary process) which is required to capture
packet into PCAP file.

As I have gone through *dpdk-pdump* application, I came to know that pcap
driver receives packets from virtual Ethernet device and place them into a
.pcap file.

For the same purpose I did the following code changes:

static bool pdump_vdev_create(void)
{
#define SIZE 64
char vdev_name[SIZE];
char vdev_args[SIZE];
uint16_t portid;
struct ether_addr addr;
const uint16_t rxrings = 0, txrings = 1;
uint16_t q = 0;
struct rte_eth_conf port_conf_default;
int ret;

snprintf(vdev_name, strlen("pdump-vdev") + 1, "%s", "pdump-vdev");
snprintf(vdev_args, strlen("tx_pcap=report.pcap") + 1, "tx_pcap=%s",
"report.pcap");
ret = rte_eal_hotplug_add("vdev", vdev_name, vdev_args);
if (ret < 0)
error message;

if (rte_eth_dev_get_port_by_name(vdev_name, &portid) < 0) {
rte_eal_hotplug_remove("vdev", vdev_name);
error message;
}

memset(&port_conf_default, 0, sizeof(struct rte_eth_conf));
if (rte_eth_dev_configure(portid, rxrings, txrings, &port_conf_default) <
0) {
                rte_eal_hotplug_remove("vdev", vdev_name);
                error message;
    }

if (rte_eth_tx_queue_setup(portid, q, 512, rte_eth_dev_socket_id(portid),
NULL) < 0) {
                rte_eal_hotplug_remove("vdev", vdev_name);
                error message;
    }

if (rte_eth_dev_start(portid) < 0) {
                rte_eal_hotplug_remove("vdev", vdev_name);
                error message;
    }
rte_eth_promiscuous_enable(portid);
pdump_dev_id = portid;
return true;
}

But first API (rte_eal_hotplug_add) call gets failed. Return error code =
-2.

*dpdk-pdump* vs *my_application:*
*1. **dpdk-pdump *captures packets received from NIC while *my_application*
captures packets received from rte_ring.

Can someone point out that what mistake is done ?

                 reply	other threads:[~2018-10-30 13:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFQa0PZHn_w9UGYL6gnhfEEFWUExxf8d4XFF-_HdHUM_HCnYpg@mail.gmail.com \
    --to=sunilkumarkori1985@gmail.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).