DPDK patches and discussions
 help / color / mirror / Atom feed
From: Reshma Pattan <reshma.pattan@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 5/5] doc: update doc for tcpdump feature
Date: Fri, 29 Jan 2016 13:10:52 +0000	[thread overview]
Message-ID: <1454073052-27025-6-git-send-email-reshma.pattan@intel.com> (raw)
In-Reply-To: <1454073052-27025-1-git-send-email-reshma.pattan@intel.com>

Added tcpdump design changes to proc_info section of
sample application user guide.
Added tcpdump design changes env abstraction layer section
of programmers guide.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 doc/guides/prog_guide/env_abstraction_layer.rst |   29 +++++++++++++++++++-
 doc/guides/sample_app_ug/proc_info.rst          |   34 +++++++++++++++++++++--
 2 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index 89feb69..7455664 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -1,5 +1,5 @@
 ..  BSD LICENSE
-    Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+    Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
     All rights reserved.
 
     Redistribution and use in source and binary forms, with or without
@@ -174,6 +174,8 @@ User Space Interrupt Event
 The EAL creates a host thread to poll the UIO device file descriptors to detect the interrupts.
 Callbacks can be registered or unregistered by the EAL functions for a specific interrupt event
 and are called in the host thread asynchronously.
+The EAL thread also polls for tcpdump fd. If fd polled matches tcpdump fd, will initiate tcpdump
+processing.
 The EAL also allows timed callbacks to be used in the same way as for NIC interrupts.
 
 .. note::
@@ -207,6 +209,31 @@ The eth_dev driver takes responsibility to program the latter mapping.
 The RX interrupt are controlled/enabled/disabled by ethdev APIs - 'rte_eth_dev_rx_intr_*'. They return failure if the PMD
 hasn't support them yet. The intr_conf.rxq flag is used to turn on the capability of RX interrupt per device.
 
++ Tcpdump
+Create socket for tcpdump connection with secondary and registers socket with
+tcpdump epoll event. tcpdump event will be polled as part of interrupt thread.
+
+Creates mempool and  two rte_rings for packets duplication and sharing packet info
+with secondary respectively.
+
+Upon receiving tcpdump event, receive either register RX/TX callbacks or remove
+RX/TX callbacks message from secondary on socket.
+
+For Register RX/TX callbacks message:
+        Process port, queue and src ip filter options of message.
+        Registers rte_eth_rxtx_callbacks for a given port and queue information.
+
+        Rx callback will apply src ip filter filter on recived packets and matched packets will be
+        duplicated on to  new mempool. Duplicated packets will be enqueued to one of the rte_ring for
+        secondary process to use.
+
+        TX callback will apply src ip filter filter on original packets and if packet matches,
+        reference count of packet will be incremented and enqueued to second rte_ring for
+        secondary process to use.
+
+For Remove RX/TX callbacks message:
+        Removes the registered rte_erth_rxtx callbacks for the given port and queue.
+
 Blacklisting
 ~~~~~~~~~~~~
 
diff --git a/doc/guides/sample_app_ug/proc_info.rst b/doc/guides/sample_app_ug/proc_info.rst
index 542950b..42e8366 100644
--- a/doc/guides/sample_app_ug/proc_info.rst
+++ b/doc/guides/sample_app_ug/proc_info.rst
@@ -1,6 +1,6 @@
 
 ..  BSD LICENSE
-    Copyright(c) 2015 Intel Corporation. All rights reserved.
+    Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
     All rights reserved.
 
     Redistribution and use in source and binary forms, with or without
@@ -39,19 +39,47 @@ statistics, resetting port statistics and printing DPDK memory information.
 This application extends the original functionality that was supported by
 dump_cfg.
 
+This application now supports tcpdump feature. Using command line options
+user will pass on port, queue information along with src ip as filtering option.
+
+Overview of tcpdump flow
+--------------------------
+*Parse given port, queue and src ip filtering options.
+
+*Creates socket to communicate port, queue & src ip filter information with
+primary process to register RX/TX callbacks.
+
+*Creates two pcap devices only with tx queues, one for ingress and other for
+egress tcpdump packets.
+
+Fetches packets from rte_rings which are used between primary and
+proc_info for sharing ingress and egress packets of given port and queue.
+
+Writes on ingress and egress packets of particular port and queue
+to ingress and egress pcap devices respectively.
+
+Upon application termination i.e ctrl+c, sends on socket request to remove
+RX/TX callbacks registerd by primary.
+
 Running the Application
 -----------------------
 The application has a number of command line options:
 
 .. code-block:: console
 
-   ./$(RTE_TARGET)/app/dpdk_proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
-   --stats-reset | --xstats-reset]
+   ./$(RTE_TARGET)/app/dpdk_proc_info -- -m | [-p PORTMASK] [--tcpdump (port,queue)] [ --src-ip-filter \"A.B.C.D\"]
+        [--stats | --xstats | --stats-reset | --xstats-reset]
 
 Parameters
 ~~~~~~~~~~
 **-p PORTMASK**: Hexadecimal bitmask of ports to configure.
 
+**--tcpdump (port,queue)**:  port and queue info from which packets should be captured
+for tcpdump
+
+**--src-ip-filter \"A.B.C.D\"**: apply src ip as filtering on packets from given
+tcpdump port and queue.
+
 **--stats**
 The stats parameter controls the printing of generic port statistics. If no
 port mask is specified stats are printed for all DPDK ports.
-- 
1.7.4.1

      parent reply	other threads:[~2016-01-29 13:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 13:10 [dpdk-dev] [PATCH 0/5] add dpdk packet capture support for tcpdump Reshma Pattan
2016-01-29 13:10 ` [dpdk-dev] [PATCH 1/5] app/test-pmd: fix nb_rxq and np_txq checks Reshma Pattan
2016-02-05  8:48   ` De Lara Guarch, Pablo
2016-01-29 13:10 ` [dpdk-dev] [PATCH 2/5] drivers/net/pcap: add public api to create pcap device Reshma Pattan
2016-01-29 13:10 ` [dpdk-dev] [PATCH 3/5] app/proc_info: add tcpdump support in secondary process Reshma Pattan
2016-01-29 13:10 ` [dpdk-dev] [PATCH 4/5] lib/librte_eal: add tcpdump support in primary process Reshma Pattan
2016-01-29 13:10 ` Reshma Pattan [this message]

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=1454073052-27025-6-git-send-email-reshma.pattan@intel.com \
    --to=reshma.pattan@intel.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).