public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ramon Fried <rfried.dev@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 2/3] doc: pcap: add pcap cmd documentation
Date: Thu, 18 Jul 2019 21:43:31 +0300	[thread overview]
Message-ID: <20190718184333.27927-2-rfried.dev@gmail.com> (raw)
In-Reply-To: <20190718184333.27927-1-rfried.dev@gmail.com>

Add documentation for new "pcap" command.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>

---

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 at 10000000: PHY present at 0
+eth0 at 10000000: link up, 1000Mbps full-duplex (lpa: 0x7c00)
+Using eth0 at 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
+
-- 
2.22.0

  reply	other threads:[~2019-07-18 18:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 18:43 [U-Boot] [PATCH v4 1/3] net: introduce packet capture support Ramon Fried
2019-07-18 18:43 ` Ramon Fried [this message]
2019-09-03 22:03   ` [U-Boot] [PATCH v4 2/3] doc: pcap: add pcap cmd documentation Joe Hershberger
2019-09-04 16:40   ` [U-Boot] " Joe Hershberger
2019-07-18 18:43 ` [U-Boot] [PATCH v4 3/3] configs: sandbox: enable PCAP capture cmd Ramon Fried
2019-07-22 23:55   ` Joe Hershberger
2019-09-04 16:40   ` [U-Boot] " Joe Hershberger
2019-07-18 21:37 ` [U-Boot] [PATCH v4 1/3] net: introduce packet capture support Joe Hershberger
2019-07-23  0:01 ` Joe Hershberger
2019-09-04 16:40 ` [U-Boot] " Joe Hershberger

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=20190718184333.27927-2-rfried.dev@gmail.com \
    --to=rfried.dev@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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