Skip to content

Commit

Permalink
Merge pull request snabbco#66 from dpino/lwaftr_nutmeg_move_docs_make
Browse files Browse the repository at this point in the history
Add a Makefile rule to build snabb-lwaftr documentation
  • Loading branch information
dpino committed Oct 2, 2015
2 parents 0924652 + 0cc5801 commit 2c9a1ca
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 75 deletions.
35 changes: 35 additions & 0 deletions src/program/snabb_lwaftr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Q= @
E= @echo

# For verbose command line output, uncomment these lines:
#Q=
#E= @:

snabb-lwaftr:
$(Q) (cd ../../; make snabb-lwaftr; ln -sf ../../$@ program/snabb_lwaftr/$@)

snabb-lwaftr-doc: doc/snabb-lwaftr.pdf doc/snabb-lwaftr.html doc/snabb-lwaftr.epub

doc/snabb-lwaftr.md:
(cd doc; ./genbook.sh) > $@

doc/snabb-lwaftr.pdf: doc/snabb-lwaftr.md
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc -S --toc --chapters -o snabb-lwaftr.pdf snabb-lwaftr.md)

doc/snabb-lwaftr.html: doc/snabb-lwaftr.md
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc --self-contained --css="../../../doc/style.css" -S -s --toc --chapters -o snabb-lwaftr.html snabb-lwaftr.md)

doc/snabb-lwaftr.epub: doc/snabb-lwaftr.md
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc --self-contained --css="../../../doc/style.css" -S -s --toc --chapters -o snabb-lwaftr.epub snabb-lwaftr.md)

CLEAN = snabb-lwaftr doc/snabb-lwaftr.*

clean:
$(E) "RM $(CLEAN)"
$(Q)-rm -rf $(CLEAN)
$(Q) (cd ../../; make clean)

.PHONY: clean snabb-lwaftr
6 changes: 3 additions & 3 deletions src/program/snabb_lwaftr/doc/README.build.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# How to build snabb-lwaftr

## Step 1: Fetch the sources
## Fetch the sources

```bash
$ git clone https://github.com/Igalia/snabbswitch.git
```

## Step 2: Check out the lwaftr development branch:
## Check out the lwaftr development branch:

```bash
$ cd snabbswitch && git checkout lwaftr_nutmeg
```

## Step 3: Build
## Build

```bash
$ make
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Welcome to Snabb-lwaftr!
# Running

Here is how to get started with it.

This document assumes that `${SNABB_LW_DIR}` is the location where your checkout
of the **snabb-lwaftr** project.

# Current status

Snabb-lwaftr is alpha/prototype software. It can run 2 10-Gbit NICs at over 90%
of line speed, and it is believed to be [RFC 7596](https://tools.ietf.org/html/rfc7596) compliant.
It is ready for experimentation, but not recommended for production use yet.

# Section 1. Finding out the PCI addresses of your NICs
## Finding out the PCI addresses of your NICs

Snabb-lwaftr is designed to run on **Intel 82599 10-Gigabit** NICs. Find the
address of NICs on your system with `lspci`:
Expand All @@ -35,15 +24,11 @@ require them to match the filenames in `/sys/bus/pci/devices/`, such as
`/sys/bus/pci/devices/0000:04:00.1`: in such cases, you must write `0000:01:00.0`,
with the appropriate prefix (`0000:`, in this example).

# Section 2. Compiling snabb

See [README.build.md](README.build.md).

# Section 3. Running a load generator and the lwaftr

Note: Compile Snabb (see [README.build.md](README.build.md)) before attempting
the following.

## Running a load generator and the lwaftr

To run a load generator and an `lwaftr`, you will need four
interfaces. The following example assumes that `01:00.0` is cabled to
`01:00.1`, and that `02:00.0` is cabled to `02:00.1`. Change the
Expand Down Expand Up @@ -78,27 +63,3 @@ ramping up from 0 Gbps to 10 Gbps (by default) and then coming back
down. It also measures the return traffic from the lwAFTR, and prints
out all this information to the console in CSV format. The load
generator stops when the transient is done.

# Section 4. Troubleshooting

See [README.troubleshooting.md](README.troubleshooting.md).

# Section 5. Configuration

See [README.bindingtable.md](README.bindingtable.md) and [README.configuration.md](README.configuration.md).

# Section 6. RFC Compliance

See [README.rfccompliance.md](README.rfccompliance.md).

# Section 7. Benchmarking

See [README.benchmarking.md](README.benchmarking.md).

# Section 8. Performance

See [README.performance.md](README.performance.md).

# Section 9. Virtualization

See [README.virtualization.md](README.virtualization.md).
12 changes: 12 additions & 0 deletions src/program/snabb_lwaftr/doc/README.welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Welcome to Snabb-lwaftr!

Here is how to get started with it.

This document assumes that `${SNABB_LW_DIR}` is the location where your checkout
of the **snabb-lwaftr** project.

## Current status

Snabb-lwaftr is alpha/prototype software. It can run 2 10-Gbit NICs at over 90%
of line speed, and it is believed to be [RFC 7596](https://tools.ietf.org/html/rfc7596) compliant.
It is ready for experimentation, but not recommended for production use yet.
29 changes: 0 additions & 29 deletions src/program/snabb_lwaftr/doc/build-all.sh

This file was deleted.

46 changes: 46 additions & 0 deletions src/program/snabb_lwaftr/doc/genbook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# This shell scripts generates the top-level Markdown structure of the
# Snabb Switch lwAFTR manual.
#
# The authors list is automatically generated from Git history,
# ordered from most to least commits.

# Script based on src/doc/genbook.sh

lwaftr_app=../../../apps/lwaftr/

cat <<EOF
% Snabb Switch lwAFTR Manual
% $(git log --pretty="%an" $lwaftr_app | \
grep -v -e '^root$' | \
sort | uniq -c | sort -nr | sed 's/^[0-9 ]*//' | \
awk 'BEGIN { first=1; }
(NF >= 2) { if (first) { first=0 } else { printf("; ") };
printf("%s", $0) }
END { print("") }')
% Version $(git log -n1 --format="format:%h, %ad%n")
$(cat README.welcome.md)
$(cat README.build.md)
$(cat README.running.md)
$(cat README.testing.md)
$(cat README.troubleshooting.md)
$(cat README.bindingtable.md)
$(cat README.configuration.md)
$(cat README.rfccompliance.md)
$(cat README.benchmarking.md)
$(cat README.performance.md)
$(cat README.virtualization.md)
EOF

0 comments on commit 2c9a1ca

Please sign in to comment.