From patchwork Wed Mar 2 12:16:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pattan, Reshma" X-Patchwork-Id: 10990 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 98DE4AD96; Wed, 2 Mar 2016 13:16:21 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EF4E2AD8E for ; Wed, 2 Mar 2016 13:16:18 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 02 Mar 2016 04:16:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,528,1449561600"; d="scan'208";a="915207646" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 02 Mar 2016 04:16:16 -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 u22CGGAu009524; Wed, 2 Mar 2016 12:16:16 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u22CGGWV002128; Wed, 2 Mar 2016 12:16:16 GMT Received: (from reshmapa@localhost) by sivswdev02.ir.intel.com with id u22CGGej002124; Wed, 2 Mar 2016 12:16:16 GMT From: Reshma Pattan To: dev@dpdk.org Date: Wed, 2 Mar 2016 12:16:10 +0000 Message-Id: <1456920970-2047-6-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1456920970-2047-1-git-send-email-reshma.pattan@intel.com> References: <1455289045-25915-1-git-send-email-reshma.pattan@intel.com> <1456920970-2047-1-git-send-email-reshma.pattan@intel.com> Subject: [dpdk-dev] [PATCH v3 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Added tcpdump design changes to proc_info section of sample application user guide. Added tcpdump design changes to env abstraction layer section of programmers guide. Updated Release notes Signed-off-by: Reshma Pattan --- doc/guides/prog_guide/env_abstraction_layer.rst | 43 ++++++++++++++++- doc/guides/rel_notes/release_16_04.rst | 6 ++ doc/guides/sample_app_ug/proc_info.rst | 57 +++++++++++++++++++---- 3 files changed, 94 insertions(+), 12 deletions(-) diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst index 4737dc2..be06764 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 @@ -169,7 +169,8 @@ The EAL can query the CPU at runtime (using the rte_cpu_get_feature() function) User Space Interrupt Event ~~~~~~~~~~~~~~~~~~~~~~~~~~ -+ User Space Interrupt and Alarm Handling in Host Thread +User Space Interrupt and Alarm Handling in Host Thread +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 @@ -182,7 +183,8 @@ The EAL also allows timed callbacks to be used in the same way as for NIC interr i.e. link up and link down notification. -+ RX Interrupt Event +RX Interrupt Event +^^^^^^^^^^^^^^^^^^ The receive and transmit routines provided by each PMD don't limit themselves to execute in polling thread mode. To ease the idle polling with tiny throughput, it's useful to pause the polling and wait until the wake-up event happens. @@ -207,6 +209,41 @@ 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 +^^^^^^^ + +The EAL thread polls for the tcpdump file descriptor. +If the polled file descriptor matches the tcpdump file descriptor it will initiate tcpdump processing. + +The EAL thread creates the socket for the tcpdump connection with the secondary process and registers the socket with +the tcpdump epoll event. +The tcpdump event will be polled as part of the interrupt thread. + +The EAL thread also creates the mempool and two rte_rings for packets duplication, and sharing the packet information +with the secondary process respectively. + +Upon receiving the tcpdump event, the EAL thread either receives a "register" or "remove" message for RX/TX callbacks +on the socket. + +For the "register" RX/TX callback message: + +* The EAL thread parses the port and queue information of the message and registers the ``rte_eth_rxtx_callbacks`` + for the given port and queue. + +* The Rx callback will apply a src ip filter to the received packets and the matched packets will be duplicated to the + new mempool. + Duplicated packets will be enqueued to one of the rte_rings for the secondary process to use. + If no filter is provided, all the packets will be duplicated to the new mempool. + +* The TX callback will apply a src ip filter to the received packets and the reference count of the matched + packets will be incremented before enqueuing to the second rte_ring for the secondary process to use. + If no filter is provided, the reference count of all the packets will be incremented. + +For the "remove" RX/TX callback message: + +* The EAL thread parses the port and queue information of the message and removes the ``rte_eth_rxtx_callbacks`` + for the given port and queue. + Blacklisting ~~~~~~~~~~~~ diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index fd7dd1a..bd6f33b 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -51,6 +51,9 @@ This section should contain new features added in this release. Sample format: * **Added vhost-user live migration support.** +* **Added dpdk packet capturing support for tcpdump.** + + Now users have the facility to capture the packets of dpdk ports using dpdk_proc_info application. Resolved Issues --------------- @@ -83,6 +86,7 @@ Drivers This made impossible the creation of more than one aesni_mb device from command line. +* **pcap: Added public API support for creating pcap device using pcaps and dumpers.** Libraries ~~~~~~~~~ @@ -92,6 +96,7 @@ Libraries Fix crc32c hash functions to return a valid crc32c value for data lengths not multiple of 4 bytes. +* **Enhanced eal library to support dpdk packet capturing support for tcpdump.** Examples ~~~~~~~~ @@ -100,6 +105,7 @@ Examples Other ~~~~~ +* **Enhanced app/proc_info to support dpdk packet capturing support for tcpdump.** Known Issues ------------ diff --git a/doc/guides/sample_app_ug/proc_info.rst b/doc/guides/sample_app_ug/proc_info.rst index 542950b..274c9e0 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,33 +39,72 @@ statistics, resetting port statistics and printing DPDK memory information. This application extends the original functionality that was supported by dump_cfg. +The ``dpdk_proc_info`` application supports the command line options for configuring the packet +capturing support for tcpdump. + +Overview of tcpdump flow +------------------------ + +* The ``dpdk_proc_info`` application parses the command line options for the port, queue, src ip filter + and other tcpdump options. + +* The application creates a socket to communicate with the primary process and sends the "register" RX/TX callback + message containing port, queue and src ip filter information. + +* Based on the ``--single-tcpdump-file`` command line option, it either creates a single pcap or two pcap devices for + writing ingress and egress packets for tcpdump. + +* It dequeues the packets sent by the primary process over the rte_rings and writes the packets to the pcap devices. + +* Upon an application termination i.e. using ``ctrl+c``, it sends the "remove" RX/TX callbacks message to the primary + process containing port, queue information. + 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\"] \ + [--single-tcpdump-file] \ + [--stats | --xstats | \ + --stats-reset | --xstats-reset] Parameters ~~~~~~~~~~ -**-p PORTMASK**: Hexadecimal bitmask of ports to configure. -**--stats** +``-p PORTMASK``: Hexadecimal bitmask of ports to configure. + +``--tcpdump (port,queue)`` +The tcpdump (port,queue) parameter controls the packet capturing support on a given port and queue. +User need to specify either an unique queue id or '*' to capture the packets from specific queue or from all the queues +of a given port. + +``--src-ip-filter "A.B.C.D"`` +The src-ip-filter parameter controls the packet filtering support. +If the src ip filter option is not specified, all the packets will be captured. + +``--single-tcpdump-file`` +The single-tcpdump-file parameter controls packet capturing to a single pcap file. +If the option is specified both the ingress and egress packets will be captured to a single pcap file otherwise they +will be captured to two different RX and TX pcap files. + +``--stats`` The stats parameter controls the printing of generic port statistics. If no port mask is specified stats are printed for all DPDK ports. -**--xstats** +``--xstats`` The stats parameter controls the printing of extended port statistics. If no port mask is specified xstats are printed for all DPDK ports. -**--stats-reset** +``--stats-reset`` The stats-reset parameter controls the resetting of generic port statistics. If no port mask is specified, the generic stats are reset for all DPDK ports. -**--xstats-reset** +``--xstats-reset`` The xstats-reset parameter controls the resetting of extended port statistics. If no port mask is specified xstats are reset for all DPDK ports. -**-m**: Print DPDK memory information. +``-m``: Print DPDK memory information.