Skip to content

Commit ac93c34

Browse files
authored
Edit user guide (#44)
Infrap4d user guide: - Corrected several errors in the infrap4d user guide. - Added subheadings to the command-line flags section. Building krnlmon with Bazel: - Corrected a number of errors. - Changed "code" to "code-block", for consistency. Building krnlmon with CMake: - Changed "code" to "code-block", for consistency. Signed-off-by: Derek Foster <[email protected]>
1 parent 8b619c6 commit ac93c34

File tree

3 files changed

+57
-40
lines changed

3 files changed

+57
-40
lines changed

docs/executables/infrap4d/infrap4d.rst

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,52 @@ Syntax
2222
2323
infrap4d \
2424
[--help | --helpshort | --helpon MODULE] \
25-
[options]
25+
[--[no]detach] \
26+
[--disable-krnlmon] \
27+
[other options]
2628
2729
infrap4d is located in the ``sbin`` directory of the install tree.
2830

2931

3032
Command-Line Flags
3133
==================
3234

35+
Flag prefix
36+
-----------
37+
3338
A flag may be prefixed with either one or two hyphens.
34-
``-help`` is equivalent to ``--help``.
39+
``-help`` and ``--help`` are equivalent.
40+
41+
Underscores vs. hyphens
42+
-----------------------
3543

3644
Underscores and hyphens may be used interchangeably within the name
37-
of a flag. ``--disable_krnlmon`` is equivalent to ``--disable-krnlmon``.
45+
of a flag. ``--disable_krnlmon`` and ``--disable-krnlmon`` are equivalent.
3846

39-
A Boolean value of *true* may be expressed as ``true``, ``yes``, ``on``,
47+
Boolean values
48+
--------------
49+
50+
A Boolean value of **true** may be expressed as ``true``, ``yes``, ``on``,
4051
or ``1``, or by writing the flag name with no value. For example:
4152

42-
.. code-block text
53+
.. code-block:: text
4354
4455
-detach
4556
-detach=true
4657
-detach yes
4758
48-
A Boolean value of *false* may be expressed as ``false``, ``no``, ``off``,
59+
A Boolean value of **false** may be expressed as ``false``, ``no``, ``off``,
4960
or ``0``, or by prefixing the flag name with ``no``. For example:
5061

51-
.. code-block text
62+
.. code-block:: text
5263
5364
-nodetach
5465
-detach=no
5566
-detach 0
5667
68+
Documentation
69+
-------------
70+
5771
Infrap4d uses the Google ``gflags`` library to process command-line flags.
5872
Technical documentation is available in
5973
`How to Use Gflags <https://gflags.github.io/gflags/>`_.
@@ -70,9 +84,12 @@ The most useful of these are:
7084
Displays just the flags that are specific to the main module
7185
(``infrap4d_main``).
7286

73-
``helpon MODULE``
87+
``--helpon MODULE``
7488
Displays just the flags that are defined by the named module.
7589

90+
MODULE is the name of the source file in which the flags are defined,
91+
without ``.cc`` suffix, e.g. ``logging`` or ``tdi_hal_flags``.
92+
7693
``--help``
7794
Displays the flags for all modules. The list is long.
7895

@@ -88,7 +105,7 @@ Infrap4d Options
88105
These flags influence the way infrap4d starts up.
89106
They are defined by the ``infrap4d_main`` module.
90107

91-
``--detached``
108+
``--detach``
92109
Run infrap4d in detached mode. type: Boolean. default: true.
93110

94111
In detached mode, infrap4d runs as a separate process, as a daemon.
@@ -104,7 +121,7 @@ Other Options
104121
See :ref:`infrap4d_flags` for a complete list of flags supported by
105122
infrap4d.
106123

107-
Verifying settings
124+
Verifying Settings
108125
==================
109126

110127
gflags processes all the flags on the command line before it displays
@@ -121,5 +138,5 @@ flags that have been set, as the following example demonstrates.
121138
-disable_krnlmon (Run infrap4d without krnlmon support) type: bool
122139
default: false currently: true
123140
124-
gflags doesn't always do what you expect. This is a way to check for
125-
anomalies.
141+
gflags doesn't always do what you expect. This is a way to see the effect
142+
of the flags on the command line.

docs/maintainers/building-krnlmon-with-bazel.rst

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ specified before or after the target(s).
4141
``--define target={dpdk|es2k}``
4242
Alternative to the ``--config`` flag.
4343

44-
``--//flags:ovs={on|off}``
45-
Whether to support OVSP4RT. Equivalent to the ``WITH_OVSP4RT`` cmake
46-
variable or (in the negative) the ``--no-ovs`` helper script option.
44+
``--//flags:ovs={true|false}``
45+
Whether to support OVSP4RT. Equivalent to the ``WITH_OVSP4RT={true|false}``
46+
cmake variable or (in the negative) the ``--no-ovs`` helper script option.
4747

48-
Specify ``on``, ``true``, or ``1`` to enable support, and ``off``,
48+
Specify ``yes``, ``true``, or ``1`` to enable support, and ``no``,
4949
``false``, or ``0`` to disable it.
5050

5151
Useful Targets
@@ -66,7 +66,7 @@ Build krnlmon for DPDK
6666
We are using the ``--define`` option and specifying it after the
6767
build target.
6868

69-
.. code:: bash
69+
.. code-block:: bash
7070
7171
bazel build //:krnlmon --define target=dpdk
7272
@@ -76,7 +76,7 @@ Build for ES2K without OVS
7676
We are using ``--config`` instead of ``define`` and specifying the
7777
options before the target.
7878

79-
.. code:: bash
79+
.. code-block:: bash
8080
8181
bazel build --config es2k --//flags:ovs=no //:krnlmon
8282
@@ -90,7 +90,7 @@ The ``dummy_krnlmon`` target links the krnlmon library with a dummy
9090
main program. This allows you to check for unresolved external symbols
9191
in the library.
9292

93-
.. code:: bash
93+
.. code-block:: bash
9494
9595
bazel build --config dpdk //:dummy_krnlmon
9696
@@ -100,7 +100,7 @@ Check for RPATH issues
100100
You can check for RPATH problems by issuing the ``ldd`` comand and
101101
looking for missing libraries in its output.
102102

103-
.. code:: bash
103+
.. code-block:: bash
104104
105105
ldd bazel-bin/dummy_krnlmon
106106
@@ -109,23 +109,23 @@ Run unit tests
109109

110110
To build and run the unit tests for ES2K:
111111

112-
.. code::bash
112+
.. code-block:: bash
113113
114114
bazel test --config es2k //switchlink:all //switchsde:all
115115
116116
Sample output:
117117

118-
.. code:text
118+
.. code-block:: text
119119
120-
INFO: Analyzed 23 targets (2 packages loaded, 92 targets configured).
121-
INFO: Found 18 targets and 5 test targets...
122-
INFO: Elapsed time: 2.372s, Critical Path: 1.79s
123-
INFO: 34 processes: 13 internal, 21 linux-sandbox.
124-
INFO: Build completed successfully, 34 total actions
125-
//switchlink:switchlink_address_test PASSED in 0.0s
126-
//switchlink:switchlink_link_test PASSED in 0.1s
127-
//switchlink:switchlink_neigh_test PASSED in 0.0s
128-
//switchlink:switchlink_route_test PASSED in 0.0s
129-
//switchsde:switchsde_test PASSED in 0.1s
120+
INFO: Analyzed 23 targets (2 packages loaded, 92 targets configured).
121+
INFO: Found 18 targets and 5 test targets...
122+
INFO: Elapsed time: 2.372s, Critical Path: 1.79s
123+
INFO: 34 processes: 13 internal, 21 linux-sandbox.
124+
INFO: Build completed successfully, 34 total actions
125+
//switchlink:switchlink_address_test PASSED in 0.0s
126+
//switchlink:switchlink_link_test PASSED in 0.1s
127+
//switchlink:switchlink_neigh_test PASSED in 0.0s
128+
//switchlink:switchlink_route_test PASSED in 0.0s
129+
//switchsde:switchsde_test PASSED in 0.1s
130130
131-
Executed 5 out of 5 tests: 5 tests pass.
131+
Executed 5 out of 5 tests: 5 tests pass.

docs/maintainers/building-krnlmon-with-cmake.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Integrated builds are usually done using the helper script ``make-all.sh``
4343
You will typically want to start by removing artifacts from previous
4444
builds:
4545

46-
.. code:: text
46+
.. code-block:: text
4747
4848
rm -fr build install
4949
@@ -55,7 +55,7 @@ Full build
5555

5656
To build all of P4 Control Plane, including krnlmon:
5757

58-
.. code:: bash
58+
.. code-block:: bash
5959
6060
./make-all.sh --target=TARGET --rpath
6161
@@ -64,7 +64,7 @@ where TARGET is ``dpdk`` or ``es2k``.
6464
Full build (no OVS)
6565
~~~~~~~~~~~~~~~~~~~
6666

67-
.. code:: bash
67+
.. code-block:: bash
6868
6969
./make-all.sh --target=TARGET --rpath --no-ovs
7070
@@ -76,7 +76,7 @@ Krnlmon only
7676

7777
To build just krnlmon:
7878

79-
.. code:: bash
79+
.. code-block:: bash
8080
8181
./make-all.sh --target-TARGET --rpath --no-build
8282
cmake --build build -j4 --target krnlmon
@@ -97,7 +97,7 @@ Preparation
9797
You will generally want to begin by removing artifacts from previous
9898
builds:
9999

100-
.. code:: bash
100+
.. code-block:: bash
101101
102102
rm -fr build install
103103
@@ -107,7 +107,7 @@ no effect on integrated builds.
107107
DPDK build
108108
~~~~~~~~~~
109109

110-
.. code:: bash
110+
.. code-block:: bash
111111
112112
cmake -B build -C dpdk.cmake [options]
113113
cmake --build build -j4 --target install
@@ -128,7 +128,7 @@ You can also create your own configuration file and use it in place of
128128
ES2K build
129129
^^^^^^^^^^
130130

131-
.. code:: bash
131+
.. code-block:: bash
132132
133133
cmake -B build -C es2k.cmake [options]
134134
cmake --build build -j4 --target install

0 commit comments

Comments
 (0)