From patchwork Thu Jul 18 18:43:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramon Fried X-Patchwork-Id: 1133815 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DG6E0m1I"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45qNN76g8zz9s7T for ; Fri, 19 Jul 2019 04:44:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A0137C21F32; Thu, 18 Jul 2019 18:44:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, LOTS_OF_MONEY, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BFBD2C22016; Thu, 18 Jul 2019 18:43:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E42AFC21EBB; Thu, 18 Jul 2019 18:43:46 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id A6EC1C21E8A for ; Thu, 18 Jul 2019 18:43:46 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id g17so29793620wrr.5 for ; Thu, 18 Jul 2019 11:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nMUhPLPDjvr0N7OMbHwTB3mpuXmt7/CRq7c3RJEwwGQ=; b=DG6E0m1Ip7RGR5afIVMiuMeWtqMlksUtQ9jZ+4Hi1zH3s9Q/LP2naaNyf+DU1qrgZE bW7XapiSDr50I//kNLEpD7WHSRdqmA8g6htM+bDqSN5BI8xlsX0vT6ijeoO+YZrC1ijs jT421UQdF8cUzVdVQJKXDKy/9s6/KvKFDyCf25WUlHT2AcQBBc2ywNq3eS02GXaW7c0i 9c3lqDAvcsAD3Y494wRoakOjs/hN82ZH38xxlMefSGH/GHII8gGQaisUUyGyVzb1bMnx B6dYuinO33AH4f9S9UV3i7zl86GHtsqRZr3ynIpDurQpZmCTfTURqiixZv5tFJKfGis3 mKUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nMUhPLPDjvr0N7OMbHwTB3mpuXmt7/CRq7c3RJEwwGQ=; b=nkIRFWihqabAEES7T2xNb5D8FITeNdgKrQ5VFZa36zxmpryreC1tEl6Uyif/npWdxQ mXhX98/Rteav7PDcde6svnGFWu4UfyzhdrnLQ8NWVm36yBmsk5ZwPFDw6p7BAWwm6KcR WgmUg+OAkiRKX7NZbvm5bRwHxbKgh3wkt5f4vZtVooVrmbmRjpWVih7DPWc/lfkaD1hm IrVKcP6mJ9GYIREpIk49Iob6+kamcLc4WS+HOm9sqriMY+iXx8r0kO8aLgx1vWAOMWSv zpXUcnXHf/GezRIBkIU8AthAa6NdDjQ62GCpTFO1G9zPQ85bNxURUga8nx/+AZIXLKKT /PZA== X-Gm-Message-State: APjAAAUkdYnglA3ZFNw+eHU7fEcZzIui+7nkk676kZRqmu/blzOkUPgN y25OZkCEpoTceRbzPjHkMPyP+qbr1B0= X-Google-Smtp-Source: APXvYqzHZIytjBr8Th/Ax/WN7qSs9R51bX4Y0YSvhiUSnElZnff+i28vgKDbqFX0LFtuPAybA6CW7g== X-Received: by 2002:adf:e552:: with SMTP id z18mr52578757wrm.45.1563475426145; Thu, 18 Jul 2019 11:43:46 -0700 (PDT) Received: from localhost.localdomain ([141.226.31.91]) by smtp.gmail.com with ESMTPSA id h14sm27550435wrs.66.2019.07.18.11.43.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 18 Jul 2019 11:43:45 -0700 (PDT) From: Ramon Fried To: u-boot@lists.denx.de Date: Thu, 18 Jul 2019 21:43:31 +0300 Message-Id: <20190718184333.27927-2-rfried.dev@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718184333.27927-1-rfried.dev@gmail.com> References: <20190718184333.27927-1-rfried.dev@gmail.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v4 2/3] doc: pcap: add pcap cmd documentation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add documentation for new "pcap" command. Signed-off-by: Ramon Fried Acked-by: Joe Hershberger --- Changes in v4: * Document the new $pcapsize environment variable. * update doc regarding error message when there's not enough memory left. Changes in v3: None Changes in v2: None doc/README.pcap | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 doc/README.pcap diff --git a/doc/README.pcap b/doc/README.pcap new file mode 100644 index 0000000000..97b3e55fd8 --- /dev/null +++ b/doc/README.pcap @@ -0,0 +1,62 @@ +PCAP: + +U-boot supports live Ethernet packet capture in PCAP(2.4) format. +This is enabled by CONFIG_CMD_PCAP. + +The capture is stored on physical memory, and should be copied to +a machine capable of parsing and displaying PCAP files (IE. wireshark) +If networking works properly one can copy the capture file from physical memory +using tftpput, or save it to local storage with (sf write, mmc write, fatwrite, etc) + +the pcap capturing requires maximum buffer size. +when the buffer is full an error message will be displayed and then packets +will silently drop. +the actual capture file size is populate in the environment variable "pcapsize". + +Usage example: + +# Initialize pcap capture to physical address (0x100000) with maximum size of +# 100000 bytes. + +# Start capture +pcap start + +# Initialize network activity +env set ipaddr 10.0.2.15; env set serverip 10.0.2.2; tftp uImage64 + +# Stop capture +pcap stop + +# pcap init 0x100000 100000 +PCAP capture initialized: addr: 0xffffffff80100000 max length: 100000 + +# pcap start +# env set ipaddr 10.0.2.15; env set serverip 10.0.2.2; tftp uImage64 +eth0@10000000: PHY present at 0 +eth0@10000000: link up, 1000Mbps full-duplex (lpa: 0x7c00) +Using eth0@10000000 device +TFTP from server 10.0.2.2; our IP address is 10.0.2.15 +Filename 'uImage64'. +Load address: 0xffffffff88000000 +Loading: ################################################################# + ################################################################# + ################################################################# + ################################################################# +!!! Buffer is full, consider increasing buffer size !!! + ################################################################# + ################################################################# + ################################################################# + ################################################################# + ################################################################# + # + 18.2 MiB/s +done +Bytes transferred = 8359376 (7f8dd0 hex) +PCAP status: + Initialized addr: 0xffffffff80100000 max length: 100000 + Status: Active. file size: 99991 + Incoming packets: 66 Outgoing packets: 67 + +# pcap stop +# tftpput 0xffffffff80100000 $pcapsize 10.0.2.2:capture.pcap +