From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 85C82C694 for ; Fri, 29 Jan 2016 14:11:01 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 29 Jan 2016 05:11:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,364,1449561600"; d="scan'208";a="891842556" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 29 Jan 2016 05:11:00 -0800 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 u0TDAwqf008931; Fri, 29 Jan 2016 13:10:59 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u0TDAwqE027164; Fri, 29 Jan 2016 13:10:58 GMT Received: (from reshmapa@localhost) by sivswdev02.ir.intel.com with id u0TDAwcL027160; Fri, 29 Jan 2016 13:10:58 GMT From: Reshma Pattan To: dev@dpdk.org Date: Fri, 29 Jan 2016 13:10:52 +0000 Message-Id: <1454073052-27025-6-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1454073052-27025-1-git-send-email-reshma.pattan@intel.com> References: <1454073052-27025-1-git-send-email-reshma.pattan@intel.com> Subject: [dpdk-dev] [PATCH 5/5] doc: update doc for tcpdump feature 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: , X-List-Received-Date: Fri, 29 Jan 2016 13:11:02 -0000 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 --- 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