Skip to contentSkip to conversation

doc: refactored fig and table nums into references

PATCH In review John McNamara 4 participants 17 messages Apr 24, 2015 – May 25, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

cover doc: refactored fig and table nums into references

This patch adds automatic figure and table references to the docs. The figure and table numbers in the generated Html and PDF docs can now be automatically numbered based on section.

Requires Sphinx >= 1.3.

Advantages:

* Figues/tables are numbered automatically and adding/removing items no longer requires manual fixing.

Disadvantages:

* Requires Sphinx >= 1.3.

* Table captions are above tables while figure captions are below. This is a current Sphinx/DocUtils limitation.

* Both the :numref: and :ref: directives are required to link to a figure or table number and caption.

John McNamara (2):
doc: refactored figure numbers into references
doc: refactored table numbers into references

 doc/guides/conf.py                                 |    2 +
 doc/guides/nics/index.rst                          |   18 +-
 doc/guides/nics/intel_vf.rst                       |   37 +-
 doc/guides/nics/virtio.rst                         |   18 +-
 doc/guides/nics/vmxnet3.rst                        |   18 +-
 doc/guides/prog_guide/env_abstraction_layer.rst    |    8 +-
 doc/guides/prog_guide/index.rst                    |  162 ++-
 doc/guides/prog_guide/ivshmem_lib.rst              |    8 +-
 doc/guides/prog_guide/kernel_nic_interface.rst     |   40 +-
 .../prog_guide/link_bonding_poll_mode_drv_lib.rst  |   43 +-
 doc/guides/prog_guide/lpm6_lib.rst                 |    8 +-
 doc/guides/prog_guide/lpm_lib.rst                  |    8 +-
 doc/guides/prog_guide/malloc_lib.rst               |    9 +-
 doc/guides/prog_guide/mbuf_lib.rst                 |   20 +-
 doc/guides/prog_guide/mempool_lib.rst              |   32 +-
 doc/guides/prog_guide/multi_proc_support.rst       |    9 +-
 doc/guides/prog_guide/overview.rst                 |    9 +-
 doc/guides/prog_guide/packet_distrib_lib.rst       |   15 +-
 doc/guides/prog_guide/packet_framework.rst         | 1245 ++++++++--------
 doc/guides/prog_guide/qos_framework.rst            | 1511 ++++++++++----------
 doc/guides/prog_guide/ring_lib.rst                 |  159 +-
 doc/guides/sample_app_ug/dist_app.rst              |   20 +-
 doc/guides/sample_app_ug/exception_path.rst        |    8 +-
 doc/guides/sample_app_ug/index.rst                 |   64 +-
 doc/guides/sample_app_ug/intel_quickassist.rst     |   11 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst  |    9 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   23 +-
 .../sample_app_ug/l2_forward_real_virtual.rst      |   22 +-
 .../sample_app_ug/l3_forward_access_ctrl.rst       |   21 +-
 doc/guides/sample_app_ug/load_balancer.rst         |    9 +-
 doc/guides/sample_app_ug/multi_process.rst         |   36 +-
 doc/guides/sample_app_ug/qos_metering.rst          |   46 +-
 doc/guides/sample_app_ug/qos_scheduler.rst         |   55 +-
 doc/guides/sample_app_ug/quota_watermark.rst       |   36 +-
 doc/guides/sample_app_ug/test_pipeline.rst         |  311 ++--
 doc/guides/sample_app_ug/vhost.rst                 |   45 +-
 doc/guides/sample_app_ug/vm_power_management.rst   |   18 +-
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   11 +-
 doc/guides/xen/pkt_switch.rst                      |   30 +-
 39 files changed, 2029 insertions(+), 2125 deletions(-)
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 1/2 doc: refactored figure numbers into references

In reply to a message not in the archive

This change adds automatic figure references to the docs. The figure numbers in the generated Html and PDF docs are now automatically numbered based on section.

Requires Sphinx >= 1.3.

The patch makes the following changes.

* Changes image:: tag to figure:: and moves image caption to the figure.

* Adds captions to figures that didn't previously have any.

* Un-templates the |image-name| substitution definitions into explicit figure:: tags. They weren't used more than once anyway and Sphinx doesn't support them for figure.

* Adds a target to each image that didn't previously have one so that they can be cross-referenced.

* Renamed existing image target to match the image name for consistency.

* Replaces the Figures lists with automatic :numref:
:ref: entries to generate automatic numbering and captions.

* Replaces "Figure" references with automatic :numref:
references.

---
 doc/guides/conf.py                                 |   2 +
 doc/guides/nics/index.rst                          |  18 ++-
 doc/guides/nics/intel_vf.rst                       |  37 ++---
 doc/guides/nics/virtio.rst                         |  18 ++-
 doc/guides/nics/vmxnet3.rst                        |  18 ++-
 doc/guides/prog_guide/env_abstraction_layer.rst    |   8 +-
 doc/guides/prog_guide/index.rst                    |  92 +++++++-----
 doc/guides/prog_guide/ivshmem_lib.rst              |   8 +-
 doc/guides/prog_guide/kernel_nic_interface.rst     |  40 ++---
 .../prog_guide/link_bonding_poll_mode_drv_lib.rst  |  43 ++++--
 doc/guides/prog_guide/lpm6_lib.rst                 |   8 +-
 doc/guides/prog_guide/lpm_lib.rst                  |   8 +-
 doc/guides/prog_guide/malloc_lib.rst               |   9 +-
 doc/guides/prog_guide/mbuf_lib.rst                 |  20 +--
 doc/guides/prog_guide/mempool_lib.rst              |  32 ++--
 doc/guides/prog_guide/multi_proc_support.rst       |   9 +-
 doc/guides/prog_guide/overview.rst                 |   9 +-
 doc/guides/prog_guide/packet_distrib_lib.rst       |  15 +-
 doc/guides/prog_guide/packet_framework.rst         |  81 +++++-----
 doc/guides/prog_guide/qos_framework.rst            | 163 +++++++--------------
 doc/guides/prog_guide/ring_lib.rst                 | 159 +++++++++++---------
 doc/guides/sample_app_ug/dist_app.rst              |  20 ++-
 doc/guides/sample_app_ug/exception_path.rst        |   8 +-
 doc/guides/sample_app_ug/index.rst                 |  58 ++++----
 doc/guides/sample_app_ug/intel_quickassist.rst     |  11 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst  |   9 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |  23 +--
 .../sample_app_ug/l2_forward_real_virtual.rst      |  22 +--
 .../sample_app_ug/l3_forward_access_ctrl.rst       |  21 ++-
 doc/guides/sample_app_ug/load_balancer.rst         |   9 +-
 doc/guides/sample_app_ug/multi_process.rst         |  36 ++---
 doc/guides/sample_app_ug/qos_scheduler.rst         |   9 +-
 doc/guides/sample_app_ug/quota_watermark.rst       |  36 ++---
 doc/guides/sample_app_ug/test_pipeline.rst         |   9 +-
 doc/guides/sample_app_ug/vhost.rst                 |  45 ++----
 doc/guides/sample_app_ug/vm_power_management.rst   |  18 +--
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |  11 +-
 doc/guides/xen/pkt_switch.rst                      |  30 ++--
 38 files changed, 539 insertions(+), 633 deletions(-)
doc/guides/conf.py +2 -0
index b1ef323..1bc031f 100644
@@ -41,6 +41,8 @@ release = version
 
 master_doc = 'index'
 
+numfig = True
+
 latex_documents = [
     ('index',
      'doc.tex',
doc/guides/nics/index.rst +12 -6
index aadbae3..1ee67fa 100644
@@ -50,14 +50,20 @@ Network Interface Controller Drivers
 
 **Figures**
 
-:ref:`Figure 1. Virtualization for a Single Port NIC in SR-IOV Mode <nic_figure_1>`
+:numref:`figure_single_port_nic` :ref:`figure_single_port_nic`
 
-:ref:`Figure 2. SR-IOV Performance Benchmark Setup <nic_figure_2>`
+:numref:`figure_perf_benchmark` :ref:`figure_perf_benchmark`
 
-:ref:`Figure 3. Fast Host-based Packet Processing <nic_figure_3>`
+:numref:`figure_fast_pkt_proc` :ref:`figure_fast_pkt_proc`
 
-:ref:`Figure 4. SR-IOV Inter-VM Communication <nic_figure_4>`
+:numref:`figure_inter_vm_comms` :ref:`figure_inter_vm_comms`
 
-:ref:`Figure 5. Virtio Host2VM Communication Example Using KNI vhost Back End <nic_figure_5>`
+:numref:`figure_host_vm_comms` :ref:`figure_host_vm_comms`
 
-:ref:`Figure 6. Virtio Host2VM Communication Example Using Qemu vhost Back End <nic_figure_6>`
+:numref:`figure_host_vm_comms_qemu` :ref:`figure_host_vm_comms_qemu`
+
+:numref:`figure_vmxnet3_int` :ref:`figure_vmxnet3_int`
+
+:numref:`figure_vswitch_vm` :ref:`figure_vswitch_vm`
+
+:numref:`figure_vm_vm_comms` :ref:`figure_vm_vm_comms`
doc/guides/nics/intel_vf.rst +20 -17
index e773627..17e83a2 100644
@@ -49,9 +49,9 @@ SR-IOV Mode Utilization in a DPDK Environment
 The DPDK uses the SR-IOV feature for hardware-based I/O sharing in IOV mode.
 Therefore, it is possible to partition SR-IOV capability on Ethernet controller NIC resources logically and
 expose them to a virtual machine as a separate PCI function called a "Virtual Function".
-Refer to Figure 10.
+Refer to :numref:`figure_single_port_nic`.
 
-Therefore, a NIC is logically distributed among multiple virtual machines (as shown in Figure 10),
+Therefore, a NIC is logically distributed among multiple virtual machines (as shown in :numref:`figure_single_port_nic`),
 while still having global data in common to share with the Physical Function and other Virtual Functions.
 The DPDK fm10kvf, i40evf, igbvf or ixgbevf as a Poll Mode Driver (PMD) serves for the Intel® 82576 Gigabit Ethernet Controller,
 Intel® Ethernet Controller I350 family, Intel® 82599 10 Gigabit Ethernet Controller NIC,
@@ -72,11 +72,12 @@ For more detail on SR-IOV, please refer to the following documents:
 
 *   `Scalable I/O Virtualized Servers <http://www.intel.com/content/www/us/en/virtualization/server-virtualization/scalable-i-o-virtualized-servers-paper.html>`_
 
-.. _nic_figure_1:
+.. _figure_single_port_nic:
 
-**Figure 1. Virtualization for a Single Port NIC in SR-IOV Mode**
+.. figure:: img/single_port_nic.*
+
+   Virtualization for a Single Port NIC in SR-IOV Mode
 
-.. image:: img/single_port_nic.*
 
 Physical and Virtual Function Infrastructure
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -548,13 +549,14 @@ The setup procedure is as follows:
         can also be used to bind and unbind devices to a virtual machine in Ubuntu.
         If this option is used, step 6 in the instructions provided will be different.
 
-    *   The Virtual Machine Monitor (see Figure 11) is equivalent to a Host OS with KVM installed as described in the instructions.
+    *   The Virtual Machine Monitor (see :numref:`figure_perf_benchmark`) is equivalent to a Host OS with KVM installed as described in the instructions.
+
+.. _figure_perf_benchmark:
 
-.. _nic_figure_2:
+.. figure:: img/perf_benchmark.*
 
-**Figure 2. Performance Benchmark Setup**
+   Performance Benchmark Setup
 
-.. image:: img/perf_benchmark.*
 
 DPDK SR-IOV PMD PF/VF Driver Usage Model
 ----------------------------------------
@@ -569,14 +571,15 @@ the DPDK VF PMD driver performs the same throughput result as a non-VT native en
 With such host instance fast packet processing, lots of services such as filtering, QoS,
 DPI can be offloaded on the host fast path.
 
-Figure 12 shows the scenario where some VMs directly communicate externally via a VFs,
+:numref:`figure_fast_pkt_proc` shows the scenario where some VMs directly communicate externally via a VFs,
 while others connect to a virtual switch and share the same uplink bandwidth.
 
-.. _nic_figure_3:
+.. _figure_fast_pkt_proc:
+
+.. figure:: img/fast_pkt_proc.*
 
-**Figure 3. Fast Host-based Packet Processing**
+   Fast Host-based Packet Processing
 
-.. image:: img/fast_pkt_proc.*
 
 SR-IOV (PF/VF) Approach for Inter-VM Communication
 --------------------------------------------------
@@ -587,7 +590,7 @@ So VF-to-VF traffic within the same physical port (VM0<->VM1) have hardware acce
 However, when VF crosses physical ports (VM0<->VM2), there is no such hardware bridge.
 In this case, the DPDK PMD PF driver provides host forwarding between such VMs.
 
-Figure 13 shows an example.
+:numref:`figure_inter_vm_comms` shows an example.
 In this case an update of the MAC address lookup tables in both the NIC and host DPDK application is required.
 
 In the NIC, writing the destination of a MAC address belongs to another cross device VM to the PF specific pool.
@@ -598,8 +601,8 @@ that is, the packet is forwarded to the correct PF pool.
 The SR-IOV NIC switch forwards the packet to a specific VM according to the MAC destination address
 which belongs to the destination VF on the VM.
 
-.. _nic_figure_4:
+.. _figure_inter_vm_comms:
 
-**Figure 4. Inter-VM Communication**
+.. figure:: img/inter_vm_comms.*
 
-.. image:: img/inter_vm_comms.*
+   Inter-VM Communication
doc/guides/nics/virtio.rst +11 -7
index 073d980..9f18b3a 100644
@@ -106,11 +106,12 @@ Virtio with kni vhost Back End
 
 This section demonstrates kni vhost back end example setup for Phy-VM Communication.
 
-.. _nic_figure_5:
+.. _figure_host_vm_comms:
 
-**Figure 5. Host2VM Communication Example Using kni vhost Back End**
+.. figure:: img/host_vm_comms.*
+
+   Host2VM Communication Example Using kni vhost Back End
 
-.. image:: img/host_vm_comms.*
 
 Host2VM communication example
 
@@ -174,7 +175,9 @@ Host2VM communication example
 
     We use testpmd as the forwarding application in this example.
 
-    .. image:: img/console.*
+    .. figure:: img/console.*
+
+       Running testpmd
 
 #.  Use IXIA packet generator to inject a packet stream into the KNI physical port.
 
@@ -185,11 +188,12 @@ Host2VM communication example
 Virtio with qemu virtio Back End
 --------------------------------
 
-.. _nic_figure_6:
+.. _figure_host_vm_comms_qemu:
+
+.. figure:: img/host_vm_comms_qemu.*
 
-**Figure 6. Host2VM Communication Example Using qemu vhost Back End**
+   Host2VM Communication Example Using qemu vhost Back End
 
-.. image:: img/host_vm_comms_qemu.*
 
 .. code-block:: console
 
doc/guides/nics/vmxnet3.rst +15 -3
index 830530d..e919088 100644
@@ -121,7 +121,11 @@ The following prerequisites apply:
 *   Before starting a VM, a VMXNET3 interface to a VM through VMware vSphere Client must be assigned.
     This is shown in the figure below.
 
-.. image:: img/vmxnet3_int.*
+.. _figure_vmxnet3_int:
+
+.. figure:: img/vmxnet3_int.*
+
+   Assigning a VMXNET3 interface to a VM using VMware vSphere Client
 
 .. note::
 
@@ -142,7 +146,11 @@ VMXNET3 with a Native NIC Connected to a vSwitch
 
 This section describes an example setup for Phy-vSwitch-VM-Phy communication.
 
-.. image:: img/vswitch_vm.*
+.. _figure_vswitch_vm:
+
+.. figure:: img/vswitch_vm.*
+
+   VMXNET3 with a Native NIC Connected to a vSwitch
 
 .. note::
 
@@ -164,7 +172,11 @@ VMXNET3 Chaining VMs Connected to a vSwitch
 
 The following figure shows an example VM-to-VM communication over a Phy-VM-vSwitch-VM-Phy communication channel.
 
-.. image:: img/vm_vm_comms.*
+.. _figure_vm_vm_comms:
+
+.. figure:: img/vm_vm_comms.*
+
+   VMXNET3 Chaining VMs Connected to a vSwitch
 
 .. note::
 
doc/guides/prog_guide/env_abstraction_layer.rst +3 -5
index 06289ed..05a7746 100644
@@ -85,13 +85,12 @@ A check is also performed at initialization time to ensure that the micro archit
 Then, the main() function is called. The core initialization and launch is done in rte_eal_init() (see the API documentation).
 It consist of calls to the pthread library (more specifically, pthread_self(), pthread_create(), and pthread_setaffinity_np()).
 
-.. _pg_figure_2:
+.. _figure_linuxapp_launch:
 
-**Figure 2. EAL Initialization in a Linux Application Environment**
+.. figure:: img/linuxapp_launch.*
 
-.. image3_png has been replaced
+   EAL Initialization in a Linux Application Environment
 
-|linuxapp_launch|
 
 .. note::
 
@@ -367,4 +366,3 @@ We expect only 50% of CPU spend on packet IO.
     echo  50000 > pkt_io/cpu.cfs_quota_us
 
 
-.. |linuxapp_launch| image:: img/linuxapp_launch.*
doc/guides/prog_guide/index.rst +59 -33

130 lines not on this page · raw message

doc/guides/prog_guide/ivshmem_lib.rst +4 -4
index c76d2b3..af4c7a9 100644
@@ -43,9 +43,11 @@ they are automatically recognized by the DPDK Environment Abstraction Layer (EAL
 
 A typical DPDK IVSHMEM use case looks like the following.
 
-.. image28_png has been renamed
 
-|ivshmem|
+.. figure:: img/ivshmem.*
+
+   Typical Ivshmem use case
+
 
 The same could work with several virtual machines, providing host-to-VM or VM-to-VM communication.
 The maximum number of metadata files is 32 (by default) and each metadata file can contain different (or even the same) hugepages.
@@ -154,5 +156,3 @@ It is important to note that once QEMU is started, it holds on to the hugepages
 As a result, if the user wishes to shut down or restart the IVSHMEM host application,
 it is not enough to simply shut the application down.
 The virtual machine must also be shut down (if not, it will hold onto outdated host data).
-
-.. |ivshmem| image:: img/ivshmem.*
doc/guides/prog_guide/kernel_nic_interface.rst +14 -26
index bac2215..3402fd2 100644
@@ -42,15 +42,14 @@ The benefits of using the DPDK KNI are:
 
 *   Allows an interface with the kernel network stack.
 
-The components of an application using the DPDK Kernel NIC Interface are shown in Figure 17.
+The components of an application using the DPDK Kernel NIC Interface are shown in :numref:`figure_kernel_nic_intf`.
 
-.. _pg_figure_17:
+.. _figure_kernel_nic_intf:
 
-**Figure 17. Components of a DPDK KNI Application**
+.. figure:: img/kernel_nic_intf.*
 
-.. image43_png has been renamed
+   Components of a DPDK KNI Application
 
-|kernel_nic_intf|
 
 The DPDK KNI Kernel Module
 --------------------------
@@ -114,15 +113,14 @@ To minimize the amount of DPDK code running in kernel space, the mbuf mempool is
 The kernel module will be aware of mbufs,
 but all mbuf allocation and free operations will be handled by the DPDK application only.
 
-Figure 18 shows a typical scenario with packets sent in both directions.
+:numref:`figure_pkt_flow_kni` shows a typical scenario with packets sent in both directions.
 
-.. _pg_figure_18:
+.. _figure_pkt_flow_kni:
 
-**Figure 18. Packet Flow via mbufs in the DPDK KNI**
+.. figure:: img/pkt_flow_kni.*
 
-.. image44_png has been renamed
+   Packet Flow via mbufs in the DPDK KNI
 
-|pkt_flow_kni|
 
 Use Case: Ingress
 -----------------
@@ -189,13 +187,12 @@ it naturally supports both legacy virtio -net and the DPDK PMD virtio.
 There is a little penalty that comes from the non-polling mode of vhost.
 However, it scales throughput well when using KNI in multi-thread mode.
 
-.. _pg_figure_19:
+.. _figure_vhost_net_arch2:
 
-**Figure 19. vHost-net Architecture Overview**
+.. figure:: img/vhost_net_arch.*
 
-.. image45_png has been renamed
+   vHost-net Architecture Overview
 
-|vhost_net_arch|
 
 Packet Flow
 ~~~~~~~~~~~
@@ -208,13 +205,12 @@ All the packet copying, irrespective of whether it is on the transmit or receive
 happens in the context of vhost kthread.
 Every vhost-net device is exposed to a front end virtio device in the guest.
 
-.. _pg_figure_20:
+.. _figure_kni_traffic_flow:
 
-**Figure 20. KNI Traffic Flow**
+.. figure:: img/kni_traffic_flow.*
 
-.. image46_png  has been renamed
+   KNI Traffic Flow
 
-|kni_traffic_flow|
 
 Sample Usage
 ~~~~~~~~~~~~
@@ -280,11 +276,3 @@ since the kni-vhost does not yet support those features.
 Even if the option is turned on, kni-vhost will ignore the information that the header contains.
 When working with legacy virtio on the guest, it is better to turn off unsupported offload features using ethtool -K.
 Otherwise, there may be problems such as an incorrect L4 checksum error.
-
-.. |kni_traffic_flow| image:: img/kni_traffic_flow.*
-
-.. |vhost_net_arch| image:: img/vhost_net_arch.*
-
-.. |pkt_flow_kni| image:: img/pkt_flow_kni.*
-
-.. |kernel_nic_intf| image:: img/kernel_nic_intf.*
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +28 -15

88 lines not on this page · raw message

doc/guides/prog_guide/lpm6_lib.rst +4 -4
index abc5adb..87f5066 100644
@@ -108,9 +108,11 @@ This is not feasible due to resource restrictions.
 By splitting the process in different tables/levels and limiting the number of tbl8s,
 we can greatly reduce memory consumption while maintaining a very good lookup speed (one memory access per level).
 
-.. image40_png has been renamed
 
-|tbl24_tbl8_tbl8|
+.. figure:: img/tbl24_tbl8_tbl8.*
+
+   Table split into different levels
+
 
 An entry in a table contains the following fields:
 
@@ -231,5 +233,3 @@ Use Case: IPv6 Forwarding
 -------------------------
 
 The LPM algorithm is used to implement the Classless Inter-Domain Routing (CIDR) strategy used by routers implementing IP forwarding.
-
-.. |tbl24_tbl8_tbl8| image:: img/tbl24_tbl8_tbl8.*
doc/guides/prog_guide/lpm_lib.rst +4 -4
index 692e37f..c33e469 100644
@@ -90,9 +90,11 @@ Instead, this approach takes advantage of the fact that rules longer than 24 bit
 By splitting the process in two different tables/levels and limiting the number of tbl8s,
 we can greatly reduce memory consumption while maintaining a very good lookup speed (one memory access, most of the times).
 
-.. image39 has been renamed
 
-|tbl24_tbl8|
+.. figure:: img/tbl24_tbl8.*
+
+   Table split into different levels
+
 
 An entry in tbl24 contains the following fields:
 
@@ -219,5 +221,3 @@ References
 
 *   Pankaj Gupta, Algorithms for Routing Lookups and Packet Classification, PhD Thesis, Stanford University,
     2000  (`http://klamath.stanford.edu/~pankaj/thesis/ thesis_1sided.pdf <http://klamath.stanford.edu/~pankaj/thesis/%20thesis_1sided.pdf>`_ )
-
-.. |tbl24_tbl8| image:: img/tbl24_tbl8.*
doc/guides/prog_guide/malloc_lib.rst +3 -6
index b9298f8..6418fab 100644
@@ -117,13 +117,12 @@ The key fields of the heap structure and their function are described below (see
     since these are never touched except when they are to be freed again -
     at which point the pointer to the block is an input to the free() function.
 
-.. _pg_figure_3:
+.. _figure_malloc_heap:
 
-**Figure 3. Example of a malloc heap and malloc elements within the malloc library**
+.. figure:: img/malloc_heap.*
 
-.. image4_png has been renamed
+   Example of a malloc heap and malloc elements within the malloc library
 
-|malloc_heap|
 
 Structure: malloc_elem
 ^^^^^^^^^^^^^^^^^^^^^^
@@ -232,5 +231,3 @@ These next and previous elements are then checked to see if they too are free,
 and if so, they are merged with the current elements.
 This means that we can never have two free memory blocks adjacent to one another,
 they are always merged into a single block.
-
-.. |malloc_heap| image:: img/malloc_heap.*
doc/guides/prog_guide/mbuf_lib.rst +7 -13
index 8f546e0..8845039 100644
@@ -71,23 +71,21 @@ Message buffers may be used to carry control information, packets, events,
 and so on between different entities in the system.
 Message buffers may also use their buffer pointers to point to other message buffer data sections or other structures.
 
-Figure 8 and Figure 9 show some of these scenarios.
+:numref:`figure_mbuf1` and :numref:`figure_mbuf2` show some of these scenarios.
 
-.. _pg_figure_8:
+.. _figure_mbuf1:
 
-**Figure 8. An mbuf with One Segment**
+.. figure:: img/mbuf1.*
 
-.. image22_png  has been replaced
+   An mbuf with One Segment
 
-|mbuf1|
 
-.. _pg_figure_9:
+.. _figure_mbuf2:
 
-**Figure 9. An mbuf with Three Segments**
+.. figure:: img/mbuf2.*
 
-.. image23_png has been replaced
+   An mbuf with Three Segments
 
-|mbuf2|
 
 The Buffer Manager implements a fairly standard set of buffer access functions to manipulate network packets.
 
@@ -277,7 +275,3 @@ Use Cases
 ---------
 
 All networking application should use mbufs to transport network packets.
-
-.. |mbuf1| image:: img/mbuf1.*
-
-.. |mbuf2| image:: img/mbuf2.*
doc/guides/prog_guide/mempool_lib.rst +12 -20
index f9b7cfe..f0ca06f 100644
@@ -74,28 +74,27 @@ When running an application, the EAL command line options provide the ability to
 
     The command line must always have the number of memory channels specified for the processor.
 
-Examples of alignment for different DIMM architectures are shown in Figure 5 and Figure 6.
+Examples of alignment for different DIMM architectures are shown in
+:numref:`figure_memory-management` and :numref:`figure_memory-management2`.
 
-.. _pg_figure_5:
+.. _figure_memory-management:
 
-**Figure 5. Two Channels and Quad-ranked DIMM Example**
+.. figure:: img/memory-management.*
 
-.. image19_png has been replaced
+   Two Channels and Quad-ranked DIMM Example
 
-|memory-management|
 
 In this case, the assumption is that a packet is 16 blocks of 64 bytes, which is not true.
 
 The Intel® 5520 chipset has three channels, so in most cases,
 no padding is required between objects (except for objects whose size are n x 3 x 64 bytes blocks).
 
-.. _pg_figure_6:
+.. _figure_memory-management2:
 
-**Figure 6. Three Channels and Two Dual-ranked DIMM Example**
+.. figure:: img/memory-management2.*
 
-.. image20_png has been replaced
+   Three Channels and Two Dual-ranked DIMM Example
 
-|memory-management2|
 
 When creating a new pool, the user can specify to use this feature or not.
 
@@ -119,15 +118,14 @@ This cache can be enabled or disabled at creation of the pool.
 
 The maximum size of the cache is static and is defined at compilation time (CONFIG_RTE_MEMPOOL_CACHE_MAX_SIZE).
 
-Figure 7 shows a cache in operation.
+:numref:`figure_mempool` shows a cache in operation.
 
-.. _pg_figure_7:
+.. _figure_mempool:
 
-**Figure 7. A mempool in Memory with its Associated Ring**
+.. figure:: img/mempool.*
 
-.. image21_png has been replaced
+   A mempool in Memory with its Associated Ring
 
-|mempool|
 
 Use Cases
 ---------
@@ -140,9 +138,3 @@ Below are some examples:
 *   :ref:`Environment Abstraction Layer <Environment_Abstraction_Layer>` , for logging service
 
 *   Any application that needs to allocate fixed-sized objects in the data plane and that will be continuously utilized by the system.
-
-.. |memory-management| image:: img/memory-management.*
-
-.. |memory-management2| image:: img/memory-management2.*
-
-.. |mempool| image:: img/mempool.*
doc/guides/prog_guide/multi_proc_support.rst +3 -6
index 25a6056..6562f0d 100644
@@ -83,13 +83,12 @@ and point to the same objects, in both processes.
     Refer to Section 23.3 "Multi-process Limitations" for details of
     how Linux kernel Address-Space Layout Randomization (ASLR) can affect memory sharing.
 
-.. _pg_figure_16:
+.. _figure_multi_process_memory:
 
-**Figure 16. Memory Sharing in the DPDK Multi-process Sample Application**
+.. figure:: img/multi_process_memory.*
 
-.. image42_png has been replaced
+   Memory Sharing in the DPDK Multi-process Sample Application
 
-|multi_process_memory|
 
 The EAL also supports an auto-detection mode (set by EAL --proc-type=auto flag ),
 whereby an DPDK process is started as a secondary instance if a primary instance is already running.
@@ -199,5 +198,3 @@ instead of the functions which do the hashing internally, such as rte_hash_add()
     which means that only the first, primary DPDK process instance can open and mmap  /dev/hpet.
     If the number of required DPDK processes exceeds that of the number of available HPET comparators,
     the TSC (which is the default timer in this release) must be used as a time source across all processes instead of the HPET.
-
-.. |multi_process_memory| image:: img/multi_process_memory.*
doc/guides/prog_guide/overview.rst +3 -6
index 062d923..cef6ca7 100644
@@ -120,13 +120,12 @@ Core Components
 The *core components* are a set of libraries that provide all the elements needed
 for high-performance packet processing applications.
 
-.. _pg_figure_1:
+.. _figure_architecture-overview:
 
-**Figure 1. Core Components Architecture**
+.. figure:: img/architecture-overview.*
 
-.. image2_png has been replaced
+   Core Components Architecture
 
-|architecture-overview|
 
 Memory Manager (librte_malloc)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -203,5 +202,3 @@ librte_net
 The librte_net library is a collection of IP protocol definitions and convenience macros.
 It is based on code from the FreeBSD* IP stack and contains protocol numbers (for use in IP headers),
 IP-related macros, IPv4/IPv6 header structures and TCP, UDP and SCTP header structures.
-
-.. |architecture-overview| image:: img/architecture-overview.*
doc/guides/prog_guide/packet_distrib_lib.rst +8 -7
index 767accc..b5bdabb 100644
@@ -38,7 +38,10 @@ which is responsible for load balancing or distributing packets,
 and a set of worker lcores which are responsible for receiving the packets from the distributor and operating on them.
 The model of operation is shown in the diagram below.
 
-|packet_distributor1|
+.. figure:: img/packet_distributor1.*
+
+   Packet Distributor mode of operation
+
 
 Distributor Core Operation
 --------------------------
@@ -91,9 +94,11 @@ No packet ordering guarantees are made about packets which do not share a common
 Using the process and returned_pkts API, the following application workflow can be used,
 while allowing packet order within a packet flow -- identified by a tag -- to be maintained.
 
-.. image41_png has been renamed
 
-|packet_distributor2|
+.. figure:: img/packet_distributor2.*
+
+   Application workflow
+
 
 The flush and clear_returns API calls, mentioned previously,
 are likely of less use that the process and returned_pkts APIS, and are principally provided to aid in unit testing of the library.
@@ -110,7 +115,3 @@ Since it may be desirable to vary the number of worker cores, depending on the t
 i.e. to save power at times of lighter load,
 it is possible to have a worker stop processing packets by calling "rte_distributor_return_pkt()" to indicate that
 it has finished the current packet and does not want a new one.
-
-.. |packet_distributor1| image:: img/packet_distributor1.*
-
-.. |packet_distributor2| image:: img/packet_distributor2.*
doc/guides/prog_guide/packet_framework.rst +33 -48

155 lines not on this page · raw message

doc/guides/prog_guide/qos_framework.rst +49 -114

333 lines not on this page · raw message

doc/guides/prog_guide/ring_lib.rst +91 -68

265 lines not on this page · raw message

doc/guides/sample_app_ug/dist_app.rst +9 -11
index bcff0dd..25844e0 100644
@@ -47,11 +47,12 @@ into each other.
 This application can be used to benchmark performance using the traffic
 generator as shown in the figure below.
 
-.. _figure_22:
+.. _figure_dist_perf:
 
-**Figure 22. Performance Benchmarking Setup (Basic Environment)**
+.. figure:: img/dist_perf.*
+
+   Performance Benchmarking Setup (Basic Environment)
 
-|dist_perf|
 
 Compiling the Application
 -------------------------
@@ -106,7 +107,7 @@ Explanation
 The distributor application consists of three types of threads: a receive
 thread (lcore_rx()), a set of worker threads(locre_worker())
 and a transmit thread(lcore_tx()). How these threads work together is shown
-in Fig2 below. The main() function launches  threads of these three types.
+in :numref:`figure_dist_app` below. The main() function launches  threads of these three types.
 Each thread has a while loop which will be doing processing and which is
 terminated only upon SIGINT or ctrl+C. The receive and transmit threads
 communicate using a software ring (rte_ring structure).
@@ -136,11 +137,12 @@ Users who wish to terminate the running of the application have to press ctrl+C
 in the application will terminate all running threads gracefully and print
 final statistics to the user.
 
-.. _figure_23:
+.. _figure_dist_app:
+
+.. figure:: img/dist_app.*
 
-**Figure 23. Distributor Sample Application Layout**
+   Distributor Sample Application Layout
 
-|dist_app|
 
 Debug Logging Support
 ---------------------
@@ -171,7 +173,3 @@ Sample Application. See Section 9.4.4, "RX Queue Initialization".
 
 TX queue initialization is done in the same way as it is done in the L2 Forwarding
 Sample Application. See Section 9.4.5, "TX Queue Initialization".
-
-.. |dist_perf| image:: img/dist_perf.*
-
-.. |dist_app| image:: img/dist_app.*
doc/guides/sample_app_ug/exception_path.rst +3 -5
index 6c06959..3cc7cbe 100644
@@ -46,13 +46,12 @@ The second thread reads from a TAP interface and writes the data unmodified to t
 
 The packet flow through the exception path application is as shown in the following figure.
 
-.. _figure_1:
+.. _figure_exception_path_example:
 
-**Figure 1. Packet Flow**
+.. figure:: img/exception_path_example.*
 
-.. image2_png has been replaced
+   Packet Flow
 
-|exception_path_example|
 
 To make throughput measurements, kernel bridges must be setup to forward data between the bridges appropriately.
 
@@ -327,4 +326,3 @@ To remove bridges and persistent TAP interfaces, the following commands are used
     brctl delbr br0
     openvpn --rmtun --dev tap_dpdk_00
 
-.. |exception_path_example| image:: img/exception_path_example.*
doc/guides/sample_app_ug/index.rst +32 -26

89 lines not on this page · raw message

doc/guides/sample_app_ug/intel_quickassist.rst +4 -7
index 7f55282..a80d4ca 100644
@@ -46,17 +46,16 @@ For this sample application, there is a dependency on either of:
 Overview
 --------
 
-An overview of the application is provided in Figure 11.
+An overview of the application is provided in :numref:`figure_quickassist_block_diagram`.
 For simplicity, only two NIC ports and one Intel® QuickAssist Technology device are shown in this diagram,
 although the number of NIC ports and Intel® QuickAssist Technology devices can be different.
 
-.. _figure_11:
+.. _figure_quickassist_block_diagram:
 
-**Figure 11. Intel® QuickAssist Technology Application Block Diagram**
+.. figure:: img/quickassist_block_diagram.*
 
-.. image14_png has been renamed
+   Intel® QuickAssist Technology Application Block Diagram
 
-|quickassist_block_diagram|
 
 The application allows the configuration of the following items:
 
@@ -220,5 +219,3 @@ performing AES-CBC-128 encryption with AES-XCBC-MAC-96 hash, the following setti
 
 Refer to the *DPDK Test Report* for more examples of traffic generator setup and the application startup command lines.
 If no errors are generated in response to the startup commands, the application is running correctly.
-
-.. |quickassist_block_diagram| image:: img/quickassist_block_diagram.*
doc/guides/sample_app_ug/kernel_nic_interface.rst +3 -6
index d6876e2..02dde59 100644
@@ -71,13 +71,12 @@ it is just for performance testing, or it can work together with VMDq support in
 
 The packet flow through the Kernel NIC Interface application is as shown in the following figure.
 
-.. _figure_2:
+.. _figure_kernel_nic:
 
-**Figure 2. Kernel NIC Application Packet Flow**
+.. figure:: img/kernel_nic.*
 
-.. image3_png has been renamed to kernel_nic.*
+   Kernel NIC Application Packet Flow
 
-|kernel_nic|
 
 Compiling the Application
 -------------------------
@@ -616,5 +615,3 @@ Currently, setting a new MTU and configuring the network interface (up/ down) ar
             RTE_LOG(ERR, APP, "Failed to start port %d\n", port_id);
         return ret;
     }
-
-.. |kernel_nic| image:: img/kernel_nic.*
doc/guides/sample_app_ug/l2_forward_job_stats.rst +8 -15
index 54d25cb..f61af52 100644
@@ -55,27 +55,24 @@ Also, the MAC addresses are affected as follows:
 
 *   The destination MAC address is replaced by  02:00:00:00:00:TX_PORT_ID
 
-This application can be used to benchmark performance using a traffic-generator, as shown in the Figure 3.
+This application can be used to benchmark performance using a traffic-generator, as shown in the :numref:`figure_l2_fwd_benchmark_setup_jobstats`.
 
-The application can also be used in a virtualized environment as shown in Figure 4.
+The application can also be used in a virtualized environment as shown in :numref:`figure_l2_fwd_virtenv_benchmark_setup_jobstats`.
 
 The L2 Forwarding application can also be used as a starting point for developing a new application based on the DPDK.
 
-.. _figure_3:
+.. _figure_l2_fwd_benchmark_setup_jobstats:
 
-**Figure 3. Performance Benchmark Setup (Basic Environment)**
+.. figure:: img/l2_fwd_benchmark_setup.*
 
-.. image4_png has been replaced
+   Performance Benchmark Setup (Basic Environment)
 
-|l2_fwd_benchmark_setup|
+.. _figure_l2_fwd_virtenv_benchmark_setup_jobstats:
 
-.. _figure_4:
+.. figure:: img/l2_fwd_virtenv_benchmark_setup.*
 
-**Figure 4. Performance Benchmark Setup (Virtualized Environment)**
+   Performance Benchmark Setup (Virtualized Environment)
 
-.. image5_png has been renamed
-
-|l2_fwd_virtenv_benchmark_setup|
 
 Virtual Function Setup Instructions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -631,7 +628,3 @@ however it improves performance:
          * in which it was called. */
         rte_jobstats_finish(&qconf->flush_job, qconf->flush_job.target);
     }
-
-.. |l2_fwd_benchmark_setup| image:: img/l2_fwd_benchmark_setup.*
-
-.. |l2_fwd_virtenv_benchmark_setup| image:: img/l2_fwd_virtenv_benchmark_setup.*
doc/guides/sample_app_ug/l2_forward_real_virtual.rst +8 -14
index 234d71d..9334e75 100644
@@ -54,27 +54,25 @@ Also, the MAC addresses are affected as follows:
 
 *   The destination MAC address is replaced by  02:00:00:00:00:TX_PORT_ID
 
-This application can be used to benchmark performance using a traffic-generator, as shown in the Figure 3.
+This application can be used to benchmark performance using a traffic-generator, as shown in the :numref:`figure_l2_fwd_benchmark_setup`.
 
-The application can also be used in a virtualized environment as shown in Figure 4.
+The application can also be used in a virtualized environment as shown in :numref:`figure_l2_fwd_virtenv_benchmark_setup`.
 
 The L2 Forwarding application can also be used as a starting point for developing a new application based on the DPDK.
 
-.. _figure_3:
+.. _figure_l2_fwd_benchmark_setup:
 
-**Figure 3. Performance Benchmark Setup (Basic Environment)**
+.. figure:: img/l2_fwd_benchmark_setup.*
 
-.. image4_png has been replaced
+   Performance Benchmark Setup (Basic Environment)
 
-|l2_fwd_benchmark_setup|
 
-.. _figure_4:
+.. _figure_l2_fwd_virtenv_benchmark_setup:
 
-**Figure 4. Performance Benchmark Setup (Virtualized Environment)**
+.. figure:: img/l2_fwd_virtenv_benchmark_setup.*
 
-.. image5_png has been renamed
+   Performance Benchmark Setup (Virtualized Environment)
 
-|l2_fwd_virtenv_benchmark_setup|
 
 Virtual Function Setup Instructions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -526,7 +524,3 @@ however it improves performance:
 
         prev_tsc = cur_tsc;
     }
-
-.. |l2_fwd_benchmark_setup| image:: img/l2_fwd_benchmark_setup.*
-
-.. |l2_fwd_virtenv_benchmark_setup| image:: img/l2_fwd_virtenv_benchmark_setup.*
doc/guides/sample_app_ug/l3_forward_access_ctrl.rst +9 -12
index 73fa4df..dbf47c7 100644
@@ -142,9 +142,13 @@ Other lines types are considered invalid.
 
 *   A typical IPv4 ACL rule line should have a format as shown below:
 
-.. image6_png has been renamed
 
-|ipv4_acl_rule|
+.. _figure_ipv4_acl_rule:
+
+.. figure:: img/ipv4_acl_rule.*
+
+   A typical IPv4 ACL rule
+
 
 IPv4 addresses are specified in CIDR format as specified in RFC 4632.
 They consist of the dot notation for the address and a prefix length separated by '/'.
@@ -164,15 +168,12 @@ For example: 6/0xfe matches protocol values 6 and 7.
 Rules File Example
 ~~~~~~~~~~~~~~~~~~
 
-.. _figure_5_1:
+.. _figure_example_rules:
 
-Figure 5 is an example of a rules file. This file has three rules, one for ACL and two for route information.
+.. figure:: img/example_rules.*
 
-**Figure 5.Example Rules File**
+   Rules example
 
-.. image7_png has been renamed
-
-|example_rules|
 
 Each rule is explained as follows:
 
@@ -397,7 +398,3 @@ Finally, the application creates contexts handler from the ACL library,
 adds rules parsed from the file into the database and build an ACL trie.
 It is important to note that the application creates an independent copy of each database for each socket CPU
 involved in the task to reduce the time for remote memory access.
-
-.. |ipv4_acl_rule| image:: img/ipv4_acl_rule.*
-
-.. |example_rules| image:: img/example_rules.*
doc/guides/sample_app_ug/load_balancer.rst +3 -6
index 6237633..857eb8a 100644
@@ -44,13 +44,12 @@ Overview
 
 The architecture of the Load Balance application is presented in the following figure.
 
-.. _figure_5:
+.. _figure_load_bal_app_arch:
 
-**Figure 5. Load Balancer Application Architecture**
+.. figure:: img/load_bal_app_arch.*
 
-.. image8_png has been renamed
+   Load Balancer Application Architecture
 
-|load_bal_app_arch|
 
 For the sake of simplicity, the diagram illustrates a specific case of two I/O RX and two I/O TX lcores off loading the packet I/O
 overhead incurred by four NIC ports from four worker cores, with each I/O lcore handling RX/TX for two NIC ports.
@@ -241,5 +240,3 @@ are on the same or different CPU sockets, the following run-time scenarios are p
 #.  ABC: The packet is received on socket A, it is processed by an lcore on socket B,
     then it has to be transmitted out by a NIC connected to socket C.
     The performance price for crossing the CPU socket boundary is paid twice for this packet.
-
-.. |load_bal_app_arch| image:: img/load_bal_app_arch.*
doc/guides/sample_app_ug/multi_process.rst +12 -24
index 7ca71ca..f42cb9a 100644
@@ -190,13 +190,12 @@ such as a client-server mode of operation seen in the next example,
 where different processes perform different tasks, yet co-operate to form a packet-processing system.)
 The following diagram shows the data-flow through the application, using two processes.
 
-.. _figure_6:
+.. _figure_sym_multi_proc_app:
 
-**Figure 6. Example Data Flow in a Symmetric Multi-process Application**
+.. figure:: img/sym_multi_proc_app.*
 
-.. image9_png has been renamed
+   Example Data Flow in a Symmetric Multi-process Application
 
-|sym_multi_proc_app|
 
 As the diagram shows, each process reads packets from each of the network ports in use.
 RSS is used to distribute incoming packets on each port to different hardware RX queues.
@@ -296,13 +295,12 @@ In this case, the client applications just perform level-2 forwarding of packets
 
 The following diagram shows the data-flow through the application, using two client processes.
 
-.. _figure_7:
+.. _figure_client_svr_sym_multi_proc_app:
 
-**Figure 7. Example Data Flow in a Client-Server Symmetric Multi-process Application**
+.. figure:: img/client_svr_sym_multi_proc_app.*
 
-.. image10_png has been renamed
+   Example Data Flow in a Client-Server Symmetric Multi-process Application
 
-|client_svr_sym_multi_proc_app|
 
 Running the Application
 ^^^^^^^^^^^^^^^^^^^^^^^
@@ -395,13 +393,12 @@ Once the master process begins to run, it tries to initialize all the resources
 memory, CPU cores, driver, ports, and so on, as the other examples do.
 Thereafter, it creates slave processes, as shown in the following figure.
 
-.. _figure_8:
+.. _figure_master_slave_proc:
 
-**Figure 8. Master-slave Process Workflow**
+.. figure:: img/master_slave_proc.*
 
-.. image11_png has been renamed
+   Master-slave Process Workflow
 
-|master_slave_proc|
 
 The master process calls the rte_eal_mp_remote_launch() EAL function to launch an application function for each pinned thread through the pipe.
 Then, it waits to check if any slave processes have exited.
@@ -475,13 +472,12 @@ Therefore, to provide the capability to resume the new slave instance if the pre
 
 The following diagram describes slave process recovery.
 
-.. _figure_9:
+.. _figure_slave_proc_recov:
 
-**Figure 9. Slave Process Recovery Process Flow**
+.. figure:: img/slave_proc_recov.*
 
-.. image12_png has been renamed
+   Slave Process Recovery Process Flow
 
-|slave_proc_recov|
 
 Floating Process Support
 ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -774,11 +770,3 @@ so it remaps the resource to the new core ID slot.
         }
         return 0;
     }
-
-.. |sym_multi_proc_app| image:: img/sym_multi_proc_app.*
-
-.. |client_svr_sym_multi_proc_app| image:: img/client_svr_sym_multi_proc_app.*
-
-.. |master_slave_proc| image:: img/master_slave_proc.*
-
-.. |slave_proc_recov| image:: img/slave_proc_recov.*
doc/guides/sample_app_ug/qos_scheduler.rst +3 -6
index 56326df..66c261c 100644
@@ -38,13 +38,12 @@ Overview
 
 The architecture of the QoS scheduler application is shown in the following figure.
 
-.. _figure_10:
+.. _figure_qos_sched_app_arch:
 
-**Figure 10. QoS Scheduler Application Architecture**
+.. figure:: img/qos_sched_app_arch.*
 
-.. image13_png has been renamed
+   QoS Scheduler Application Architecture
 
-|qos_sched_app_arch|
 
 There are two flavors of the runtime execution for this application,
 with two or three threads per each packet flow configuration being used.
@@ -347,5 +346,3 @@ This application classifies based on the QinQ double VLAN tags and the IP destin
 +----------------+-------------------------+--------------------------------------------------+----------------------------------+
 
 Please refer to the "QoS Scheduler" chapter in the *DPDK Programmer's Guide* for more information about these parameters.
-
-.. |qos_sched_app_arch| image:: img/qos_sched_app_arch.*
doc/guides/sample_app_ug/quota_watermark.rst +12 -24
index e091ad9..de9e118 100644
@@ -54,15 +54,14 @@ and ports 2 and 3 forward into each other.
 The MAC addresses of the forwarded Ethernet frames are not affected.
 
 Internally, packets are pulled from the ports by the master logical core and put on a variable length processing pipeline,
-each stage of which being connected by rings, as shown in Figure 12.
+each stage of which being connected by rings, as shown in :numref:`figure_pipeline_overview`.
 
-.. _figure_12:
+.. _figure_pipeline_overview:
 
-**Figure 12. Pipeline Overview**
+.. figure:: img/pipeline_overview.*
 
-.. image15_png has been renamed
+   Pipeline Overview
 
-|pipeline_overview|
 
 An adjustable quota value controls how many packets are being moved through the pipeline per enqueue and dequeue.
 Adjustable watermark values associated with the rings control a back-off mechanism that
@@ -79,15 +78,14 @@ eventually lead to an Ethernet flow control frame being send to the source.
 
 On top of serving as an example of quota and watermark usage,
 this application can be used to benchmark ring based processing pipelines performance using a traffic- generator,
-as shown in Figure 13.
+as shown in :numref:`figure_ring_pipeline_perf_setup`.
 
-.. _figure_13:
+.. _figure_ring_pipeline_perf_setup:
 
-**Figure 13. Ring-based Processing Pipeline Performance Setup**
+.. figure:: img/ring_pipeline_perf_setup.*
 
-.. image16_png has been renamed
+   Ring-based Processing Pipeline Performance Setup
 
-|ring_pipeline_perf_setup|
 
 Compiling the Application
 -------------------------
@@ -311,7 +309,7 @@ Logical Cores Assignment
 The application uses the master logical core to poll all the ports for new packets and enqueue them on a ring associated with the port.
 
 Each logical core except the last runs pipeline_stage() after a ring for each used port is initialized on that core.
-pipeline_stage() on core X dequeues packets from core X-1's rings and enqueue them on its own rings. See Figure 14.
+pipeline_stage() on core X dequeues packets from core X-1's rings and enqueue them on its own rings. See :numref:`figure_threads_pipelines`.
 
 .. code-block:: c
 
@@ -340,16 +338,12 @@ sending them out on the destination port setup by pair_ports().
 Receive, Process and Transmit Packets
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. _figure_14:
+.. _figure_threads_pipelines:
 
-Figure 14 shows where each thread in the pipeline is.
-It should be used as a reference while reading the rest of this section.
+.. figure:: img/threads_pipelines.*
 
-**Figure 14. Threads and Pipelines**
+   Threads and Pipelines
 
-.. image17_png has been renamed
-
-|threads_pipelines|
 
 In the receive_stage() function running on the master logical core,
 the main task is to read ingress packets from the RX ports and enqueue them
@@ -498,9 +492,3 @@ low_watermark from the rte_memzone previously created by qw.
 
         low_watermark = (unsigned int *) qw_memzone->addr + sizeof(int);
     }
-
-.. |pipeline_overview| image:: img/pipeline_overview.*
-
-.. |ring_pipeline_perf_setup| image:: img/ring_pipeline_perf_setup.*
-
-.. |threads_pipelines| image:: img/threads_pipelines.*
doc/guides/sample_app_ug/test_pipeline.rst +3 -6
index 0432942..fbc290c 100644
@@ -49,13 +49,12 @@ The application uses three CPU cores:
 
 *   Core C ("TX core") receives traffic from core B through software queues and sends it to the NIC ports for transmission.
 
-.. _figure_21:
+.. _figure_test_pipeline_app:
 
-**Figure 21.Test Pipeline Application**
+.. figure:: img/test_pipeline_app.*
 
-.. image24_png has been renamed
+   Test Pipeline Application
 
-|test_pipeline_app|
 
 Compiling the Application
 -------------------------
@@ -281,5 +280,3 @@ The profile for input traffic is TCP/IPv4 packets with:
 *   destination TCP port fixed to 0
 
 *   source TCP port fixed to 0
-
-.. |test_pipeline_app| image:: img/test_pipeline_app.*
doc/guides/sample_app_ug/vhost.rst +15 -30

90 lines not on this page · raw message

doc/guides/sample_app_ug/vm_power_management.rst +8 -10
index 2a923d8..81db6ad 100644
@@ -74,11 +74,12 @@ The solution is comprised of two high-level components:
    The l3fwd-power application will use this implementation when deployed on a VM
    (see Chapter 11 "L3 Forwarding with Power Management Application").
 
-.. _figure_24:
+.. _figure_vm_power_mgr_highlevel:
 
-**Figure 24. Highlevel Solution**
+.. figure:: img/vm_power_mgr_highlevel.*
+
+   Highlevel Solution
 
-|vm_power_mgr_highlevel|
 
 Overview
 --------
@@ -105,11 +106,12 @@ at runtime based on the environment.
 Upon receiving a request, the host translates the vCPU to a pCPU via
 the libvirt API before forwarding to the host librte_power.
 
-.. _figure_25:
+.. _figure_vm_power_mgr_vm_request_seq:
+
+.. figure:: img/vm_power_mgr_vm_request_seq.*
 
-**Figure 25. VM request to scale frequency**
+   VM request to scale frequency
 
-|vm_power_mgr_vm_request_seq|
 
 Performance Considerations
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -355,7 +357,3 @@ Where {core_num} is the lcore and channel to change frequency by scaling up/down
 .. code-block:: console
 
   set_cpu_freq {core_num} up|down|min|max
-
-.. |vm_power_mgr_highlevel| image:: img/vm_power_mgr_highlevel.*
-
-.. |vm_power_mgr_vm_request_seq| image:: img/vm_power_mgr_vm_request_seq.*
doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst +4 -7
index e5d34e1..49ec6ce 100644
@@ -53,7 +53,7 @@ All traffic is read from a single incoming port (port 0) and output on port 1, w
 The traffic is split into 128 queues on input, where each thread of the application reads from multiple queues.
 For example, when run with 8 threads, that is, with the -c FF option, each thread receives and forwards packets from 16 queues.
 
-As supplied, the sample application configures the VMDQ feature to have 16 pools with 8 queues each as indicated in Figure 15.
+As supplied, the sample application configures the VMDQ feature to have 16 pools with 8 queues each as indicated in :numref:`figure_vmdq_dcb_example`.
 The Intel® 82599 10 Gigabit Ethernet Controller NIC also supports the splitting of traffic into 32 pools of 4 queues each and
 this can be used by changing the NUM_POOLS parameter in the supplied code.
 The NUM_POOLS parameter can be passed on the command line, after the EAL parameters:
@@ -64,13 +64,12 @@ The NUM_POOLS parameter can be passed on the command line, after the EAL paramet
 
 where, NP can be 16 or 32.
 
-.. _figure_15:
+.. _figure_vmdq_dcb_example:
 
-**Figure 15. Packet Flow Through the VMDQ and DCB Sample Application**
+.. figure:: img/vmdq_dcb_example.*
 
-.. image18_png has been replaced
+   Packet Flow Through the VMDQ and DCB Sample Application
 
-|vmdq_dcb_example|
 
 In Linux* user space, the application can display statistics with the number of packets received on each queue.
 To have the application display the statistics, send a SIGHUP signal to the running application process, as follows:
@@ -247,5 +246,3 @@ To generate the statistics output, use the following command:
 
 Please note that the statistics output will appear on the terminal where the vmdq_dcb_app is running,
 rather than the terminal from which the HUP signal was sent.
-
-.. |vmdq_dcb_example| image:: img/vmdq_dcb_example.*
doc/guides/xen/pkt_switch.rst +18 -12
index a9eca52..3a6fc47 100644
@@ -52,9 +52,13 @@ The switching back end maps those grant table references and creates shared ring
 
 The following diagram describes the functionality of the DPDK Xen Packet- Switching Solution.
 
-.. image35_png has been renamed
 
-|dpdk_xen_pkt_switch|
+.. _figure_dpdk_xen_pkt_switch:
+
+.. figure:: img/dpdk_xen_pkt_switch.*
+
+   Functionality of the DPDK Xen Packet Switching Solution.
+
 
 Note 1 The Xen hypervisor uses a mechanism called a Grant Table to share memory between domains
 (`http://wiki.xen.org/wiki/Grant Table <http://wiki.xen.org/wiki/Grant%20Table>`_).
@@ -62,9 +66,13 @@ Note 1 The Xen hypervisor uses a mechanism called a Grant Table to share memory
 A diagram of the design is shown below, where "gva" is the Guest Virtual Address,
 which is the data pointer of the mbuf, and "hva" is the Host Virtual Address:
 
-.. image36_png has been renamed
 
-|grant_table|
+.. _figure_grant_table:
+
+.. figure:: img/grant_table.*
+
+   DPDK Xen Layout
+
 
 In this design, a Virtio ring is used as a para-virtualized interface for better performance over a Xen private ring
 when packet switching to and from a VM.
@@ -139,9 +147,13 @@ Take idx#_mempool_gref node for example, the host maps those Grant references to
 The real Grant reference information is stored in this virtual address space,
 where (gref, pfn) pairs follow each other with -1 as the terminator.
 
-.. image37_pnng has been renamed
 
-|grant_refs|
+.. _figure_grant_refs:
+
+.. figure:: img/grant_refs.*
+
+   Mapping Grant references to a continuous virtual address space
+
 
 After all gref# IDs are retrieved, the host maps them to a continuous virtual address space.
 With the guest mempool virtual address, the host establishes 1:1 address mapping.
@@ -456,9 +468,3 @@ then sent out through hardware with destination MAC address 00:00:00:00:00:33.
 The packet flow is:
 
 packet generator->Virtio in guest VM1->switching backend->Virtio in guest VM2->switching backend->wire
-
-.. |grant_table| image:: img/grant_table.*
-
-.. |grant_refs| image:: img/grant_refs.*
-
-.. |dpdk_xen_pkt_switch| image:: img/dpdk_xen_pkt_switch.*
Signature · 1 line
1.8.1.4
#3 lore raw

PATCH 2/2 doc: refactored table numbers into references

In reply to a message not in the archive

This change adds automatic table references to the docs. The table numbers in the generated Html and PDF docs are now automatically numbered based on section.

Requires Sphinx >= 1.3.

This change:

* Adds a RST table:: directive to each table caption.

* Indents the tables to the required directive level.

---
 doc/guides/prog_guide/index.rst            |   70 +-
 doc/guides/prog_guide/packet_framework.rst | 1124 +++++++++++------------
 doc/guides/prog_guide/qos_framework.rst    | 1340 ++++++++++++++--------------
 doc/guides/sample_app_ug/index.rst         |    6 +-
 doc/guides/sample_app_ug/qos_metering.rst  |   46 +-
 doc/guides/sample_app_ug/qos_scheduler.rst |   46 +-
 doc/guides/sample_app_ug/test_pipeline.rst |  302 +++----
 7 files changed, 1466 insertions(+), 1468 deletions(-)
doc/guides/prog_guide/index.rst +34 -36
index 84a657e..3295661 100644
@@ -174,72 +174,70 @@ Programmer's Guide
 
 **Tables**
 
-:ref:`Table 1. Packet Processing Pipeline Implementing QoS <pg_table_1>`
+:numref:`table_qos_1` :ref:`table_qos_1`
 
-:ref:`Table 2. Infrastructure Blocks Used by the Packet Processing Pipeline <pg_table_2>`
+:numref:`table_qos_2` :ref:`table_qos_2`
 
-:ref:`Table 3. Port Scheduling Hierarchy <pg_table_3>`
+:numref:`table_qos_3` :ref:`table_qos_3`
 
-:ref:`Table 4. Scheduler Internal Data Structures per Port <pg_table_4>`
+:numref:`table_qos_4` :ref:`table_qos_4`
 
-:ref:`Table 5. Ethernet Frame Overhead Fields <pg_table_5>`
+:numref:`table_qos_5` :ref:`table_qos_5`
 
-:ref:`Table 6. Token Bucket Generic Operations <pg_table_6>`
+:numref:`table_qos_6` :ref:`table_qos_6`
 
-:ref:`Table 7. Token Bucket Generic Parameters <pg_table_7>`
+:numref:`table_qos_7` :ref:`table_qos_7`
 
-:ref:`Table 8. Token Bucket Persistent Data Structure <pg_table_8>`
+:numref:`table_qos_8` :ref:`table_qos_8`
 
-:ref:`Table 9. Token Bucket Operations <pg_table_9>`
+:numref:`table_qos_9` :ref:`table_qos_9`
 
-:ref:`Table 10. Subport/Pipe Traffic Class Upper Limit Enforcement Persistent Data Structure <pg_table_10>`
+:numref:`table_qos_10` :ref:`table_qos_10`
 
-:ref:`Table 11. Subport/Pipe Traffic Class Upper Limit Enforcement Operations <pg_table_11>`
+:numref:`table_qos_11` :ref:`table_qos_11`
 
-:ref:`Table 12. Weighted Round Robin (WRR) <pg_table_12>`
+:numref:`table_qos_12` :ref:`table_qos_12`
 
-:ref:`Table 13. Subport Traffic Class Oversubscription <pg_table_13>`
+:numref:`table_qos_13` :ref:`table_qos_13`
 
-:ref:`Table 14. Watermark Propagation from Subport Level to Member Pipes at the Beginning of Each Traffic Class Upper Limit Enforcement Period <pg_table_14>`
+:numref:`table_qos_14` :ref:`table_qos_14`
 
-:ref:`Table 15. Watermark Calculation <pg_table_15>`
+:numref:`table_qos_15` :ref:`table_qos_15`
 
-:ref:`Table 16. RED Configuration Parameters <pg_table_16>`
+:numref:`table_qos_16` :ref:`table_qos_16`
 
-:ref:`Table 17. Relative Performance of Alternative Approaches <pg_table_17>`
+:numref:`table_qos_17` :ref:`table_qos_17`
 
-:ref:`Table 18. RED Configuration Corresponding to RED Configuration File <pg_table_18>`
+:numref:`table_qos_18` :ref:`table_qos_18`
 
-:ref:`Table 19. Port types <pg_table_19>`
+:numref:`table_qos_19` :ref:`table_qos_19`
 
-:ref:`Table 20. Port abstract interface <pg_table_20>`
+:numref:`table_qos_20` :ref:`table_qos_20`
 
-:ref:`Table 21. Table types <pg_table_21>`
+:numref:`table_qos_21` :ref:`table_qos_21`
 
-:ref:`Table 29. Table Abstract Interface <pg_table_29_1>`
+:numref:`table_qos_22` :ref:`table_qos_22`
 
-:ref:`Table 22. Configuration parameters common for all hash table types <pg_table_22>`
+:numref:`table_qos_23` :ref:`table_qos_23`
 
-:ref:`Table 23. Configuration parameters specific to extendible bucket hash table <pg_table_23>`
+:numref:`table_qos_24` :ref:`table_qos_24`
 
-:ref:`Table 24. Configuration parameters specific to pre-computed key signature hash table <pg_table_24>`
+:numref:`table_qos_25` :ref:`table_qos_25`
 
-:ref:`Table 25. The main large data structures (arrays) used for configurable key size hash tables <pg_table_25>`
+:numref:`table_qos_26` :ref:`table_qos_26`
 
-:ref:`Table 26. Field description for bucket array entry (configurable key size hash tables) <pg_table_26>`
+:numref:`table_qos_27` :ref:`table_qos_27`
 
-:ref:`Table 27. Description of the bucket search pipeline stages (configurable key size hash tables) <pg_table_27>`
+:numref:`table_qos_28` :ref:`table_qos_28`
 
-:ref:`Table 28. Lookup tables for match, match_many, match_pos <pg_table_28>`
+:numref:`table_qos_29` :ref:`table_qos_29`
 
-:ref:`Table 29. Collapsed lookup tables for match, match_many and match_pos <pg_table_29>`
+:numref:`table_qos_30` :ref:`table_qos_30`
 
-:ref:`Table 30. The main large data structures (arrays) used for 8-byte and 16-byte key size hash tables <pg_table_30>`
+:numref:`table_qos_31` :ref:`table_qos_31`
 
-:ref:`Table 31. Field description for bucket array entry (8-byte and 16-byte key hash tables) <pg_table_31>`
+:numref:`table_qos_32` :ref:`table_qos_32`
 
-:ref:`Table 32. Description of the bucket search pipeline stages (8-byte and 16-byte key hash tables) <pg_table_32>`
+:numref:`table_qos_33` :ref:`table_qos_33`
 
-:ref:`Table 33. Next hop actions (reserved) <pg_table_33>`
-
-:ref:`Table 34. User action examples <pg_table_34>`
+:numref:`table_qos_34` :ref:`table_qos_34`
doc/guides/prog_guide/packet_framework.rst +562 -562

1,224 lines not on this page · raw message

doc/guides/prog_guide/qos_framework.rst +670 -670

1,428 lines not on this page · raw message

doc/guides/sample_app_ug/index.rst +3 -3
index 745a7ac..e1a0c56 100644
@@ -134,8 +134,8 @@ Sample Applications User Guide
 
 **Tables**
 
-:ref:`Table 1.Output Traffic Marking <table_1>`
+:numref:`table_qos_metering_1` :ref:`table_qos_metering_1`
 
-:ref:`Table 2.Entity Types <table_2>`
+:numref:`table_qos_scheduler_1` :ref:`table_qos_scheduler_1`
 
-:ref:`Table 3.Table Types <table_3>`
+:numref:`table_test_pipeline_1` :ref:`table_test_pipeline_1`
doc/guides/sample_app_ug/qos_metering.rst +23 -23

52 lines not on this page · raw message

doc/guides/sample_app_ug/qos_scheduler.rst +23 -23

51 lines not on this page · raw message

doc/guides/sample_app_ug/test_pipeline.rst +151 -151

128 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.1.4

Part of the diff is not shown here. View the raw message.

#4 lore raw
In reply to a message not in the archive

Hi John,

2015-04-24 14:11, John McNamara:

Quoted 13 lines

This patch adds automatic figure and table references to the docs. The figure and table numbers in the generated Html and PDF docs can now be automatically numbered based on section.

Requires Sphinx >= 1.3.

Advantages:

* Figues/tables are numbered automatically and adding/removing items no longer requires manual fixing.

Disadvantages:

Quoted 7 lines

* Requires Sphinx >= 1.3.

* Table captions are above tables while figure captions are below. This is a current Sphinx/DocUtils limitation.

* Both the :numref: and :ref: directives are required to link to a figure or table number and caption.

This is really a great work but I think it's not reasonnable to require sphinx 1.3. As almost nobody is using this version, it would be equivalent to prevent users and developers to generate the doc by themselves.

It produces this error:
ERROR: Unknown interpreted text role "numref".

Do you think it's possible to implement a fallback in our conf.py in order to ignore this new role if not supported?

#5 lore raw
Quoted 10 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, April 29, 2015 5:13 PM
To: Mcnamara, John
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 0/2] doc: refactored fig and table nums into references

Quoted 3 lines

is really a great work but I think it's not reasonnable to require sphinx 1.3. As almost nobody is using this version, it would be equivalent to prevent users and developers to generate the doc by themselves.

Hi Thomas,

Yes. That is probably right.

Quoted 5 lines

It produces this error:
ERROR: Unknown interpreted text role "numref".

Do you think it's possible to implement a fallback in our conf.py in order to ignore this new role if not supported?

It would be possible but a full implementation probably wouldn't be worth it. We could add a workaround like the following to conf.py that would just render the figure/table ref numbers as the target name as a fallback. That would allow people to generate the docs with older versions of sphinx:

$ git diff doc/guides/conf.py
doc/guides/conf.py +13 -0
index 1bc031f..bbf40f1 100644
@@ -82,3 +82,16 @@ class CustomLatexFormatter(LatexFormatter):
 
 # Replace the default latex formatter.
 PygmentsBridge.latex_formatter = CustomLatexFormatter
+
+from docutils import nodes
+from distutils.version import LooseVersion
+from sphinx import __version__ as sphinx_version
+
+# Workaround to ignore :numref: in older versions of Sphinx.
+def setup(app):
+
+    if LooseVersion(sphinx_version) < LooseVersion('1.3.1'):
+        print('[dpdk docs] Upgrade sphinx to version >= 1.3.1 for '
+              'improved Figure/Table number handling.')
+        app.add_generic_role('numref', nodes.emphasis)
+

That is just a workaround though, and maybe not worth it either.

P.S. Also note, Sphinx 1.3.1 has a nice but very different default Html style.

John

#6 lore raw

2015-04-30 13:34, Mcnamara, John:

Quoted 24 lines

From: Thomas Monjalon [mailto:[email protected]]

Quoted 5 lines

It produces this error:
ERROR: Unknown interpreted text role "numref".

Do you think it's possible to implement a fallback in our conf.py in order to ignore this new role if not supported?

It would be possible but a full implementation probably wouldn't be worth it. We could add a workaround like the following to conf.py that would just render the figure/table ref numbers as the target name as a fallback. That would allow people to generate the docs with older versions of sphinx:

doc/guides/conf.py +11 -0
+from docutils import nodes
+from distutils.version import LooseVersion
+from sphinx import __version__ as sphinx_version
+
+# Workaround to ignore :numref: in older versions of Sphinx.
+def setup(app):
+
+    if LooseVersion(sphinx_version) < LooseVersion('1.3.1'):
+        print('[dpdk docs] Upgrade sphinx to version >= 1.3.1 for '
+              'improved Figure/Table number handling.')
+        app.add_generic_role('numref', nodes.emphasis)
Quoted 1 line

That is just a workaround though, and maybe not worth it either.

The error is removed so it's better.
With this patch, a figure reference looks like this:
:numref:figure_single_port_nic Virtualization for a Single Port NIC in SR-IOV Mode The rst line is:
:numref:figure_single_port_nic :ref:figure_single_port_nic

I was trying to replace the numref output by a working link with "figure" as label. This is my trial to mimic :ref: as a first step:

8<------------------------
from docutils import nodes
from distutils.version import LooseVersion
from sphinx import __version__ as sphinx_version
from sphinx import addnodes
from sphinx.roles import XRefRole

class XNumRefNode(addnodes.pending_xref):
def __init__(self, rawsource='', *children, **attributes):
attributes['reftype'] = 'ref'
super(XNumRefNode, self).__init__(rawsource, *children, **attributes)

class XNumRefRole(XRefRole):
def __init__(self):
super(XNumRefRole, self).__init__(nodeclass=XNumRefNode, innernodeclass=nodes.emphasis, warn_dangling=True)

def setup(app):
if LooseVersion(sphinx_version) < LooseVersion('1.3.1'):
print('Upgrade sphinx to version >= 1.3.1 for '
'improved Figure/Table number handling.')
app.add_node(XNumRefNode) app.add_role('numref', XNumRefRole())
8<------------------------

Unfortunately it gives this error:
_pickle.PicklingError: Can't pickle <class 'XNumRefNode'>: attribute lookup XNumRefNode on builtins failed

Help of python experts is welcome.

References:
http://sphinx-doc.org/markup/inline.html#role-numref
https://bitbucket.org/arjones6/sphinx-numfig/src/b2345f7d9fabefbd103c31cc0c4c26c68b29ac6a/numfig.py
http://code.nabla.net/doc/sphinx/api/sphinx/addnodes/sphinx.addnodes.pending_xref.html

#7 lore raw
Quoted 17 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, May 13, 2015 8:08 PM
To: Mcnamara, John
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 0/2] doc: refactored fig and table nums into references

The error is removed so it's better.
With this patch, a figure reference looks like this:
:numref:figure_single_port_nic Virtualization for a Single Port NIC in SR-IOV Mode The rst line is:
:numref:figure_single_port_nic :ref:figure_single_port_nic

Quoted 3 lines

I was trying to replace the numref output by a working link with "figure" as label.
This is my trial to mimic :ref: as a first step:

Hi Thomas,

I'll take a look at it and see if I can get something working.

John.

#8 lore raw
In reply to Thomas Monjalon
Quoted 11 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, May 13, 2015 8:08 PM
To: Mcnamara, John
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 0/2] doc: refactored fig and table nums into references

Quoted 4 lines

Unfortunately it gives this error:
_pickle.PicklingError: Can't pickle <class 'XNumRefNode'>: attribute
lookup XNumRefNode on builtins failed

Hi Thomas,

I ran into similar pickle.py issues trying to subclass the node.reference classes within sphinx.

I was able to workaround it without a subclass. I'll submit a rebased V2 of the Figure/Table numbering patchset with updates to conf.py. You can review the workaround there.

John.

#9 lore raw

v2 cover doc: refactored fig and table nums into references

In reply to John McNamara

This patchset adds automatic figure and table references to the docs. The figure and table numbers in the generated Html and PDF docs can now be automatically numbered by the build system.

It replaces all hardcoded figure/table numbers and references.

The numfig/numref feature requires Sphinx >= 1.3.1. For backward compatibility with older versions workaround handling is added to the sphinx conf.py file in patch 3/3.

The workaround replaces the :numref: reference with a "Figure" or "Table" link to the target (for all Sphinx doc types). It doesn't number the figures or tables. This produces reasonable documentation links for users with older versions of sphinx while allowing automatic numbering support for newer versions.

Tested with Sphinx 1.2.3 and 1.3.1.

John McNamara (3):
doc: refactored figure numbers into references
doc: refactored table numbers into references
doc: add sphinx numref compatibility workaround

 doc/guides/conf.py                                 |   82 ++
 doc/guides/nics/index.rst                          |   18 +-
 doc/guides/nics/intel_vf.rst                       |   37 +-
 doc/guides/nics/virtio.rst                         |   18 +-
 doc/guides/nics/vmxnet3.rst                        |   18 +-
 doc/guides/prog_guide/env_abstraction_layer.rst    |    8 +-
 doc/guides/prog_guide/index.rst                    |  162 +-
 doc/guides/prog_guide/ivshmem_lib.rst              |    8 +-
 doc/guides/prog_guide/kernel_nic_interface.rst     |   40 +-
 .../prog_guide/link_bonding_poll_mode_drv_lib.rst  |   43 +-
 doc/guides/prog_guide/lpm6_lib.rst                 |    8 +-
 doc/guides/prog_guide/lpm_lib.rst                  |    8 +-
 doc/guides/prog_guide/malloc_lib.rst               |    9 +-
 doc/guides/prog_guide/mbuf_lib.rst                 |   20 +-
 doc/guides/prog_guide/mempool_lib.rst              |   32 +-
 doc/guides/prog_guide/multi_proc_support.rst       |    9 +-
 doc/guides/prog_guide/overview.rst                 |    9 +-
 doc/guides/prog_guide/packet_distrib_lib.rst       |   15 +-
 doc/guides/prog_guide/packet_framework.rst         | 1275 ++++++++--------
 doc/guides/prog_guide/qos_framework.rst            | 1543 ++++++++++----------
 doc/guides/prog_guide/ring_lib.rst                 |  159 +-
 doc/guides/sample_app_ug/dist_app.rst              |   20 +-
 doc/guides/sample_app_ug/exception_path.rst        |    8 +-
 doc/guides/sample_app_ug/index.rst                 |   64 +-
 doc/guides/sample_app_ug/intel_quickassist.rst     |   11 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst  |    9 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   23 +-
 .../sample_app_ug/l2_forward_real_virtual.rst      |   22 +-
 .../sample_app_ug/l3_forward_access_ctrl.rst       |   21 +-
 doc/guides/sample_app_ug/load_balancer.rst         |    9 +-
 doc/guides/sample_app_ug/multi_process.rst         |   36 +-
 doc/guides/sample_app_ug/qos_metering.rst          |   46 +-
 doc/guides/sample_app_ug/qos_scheduler.rst         |   55 +-
 doc/guides/sample_app_ug/quota_watermark.rst       |   36 +-
 doc/guides/sample_app_ug/test_pipeline.rst         |  313 ++--
 doc/guides/sample_app_ug/vhost.rst                 |   45 +-
 doc/guides/sample_app_ug/vm_power_management.rst   |   18 +-
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   11 +-
 doc/guides/xen/pkt_switch.rst                      |   30 +-
 39 files changed, 2141 insertions(+), 2157 deletions(-)

--
1.8.1.4

#11 lore raw

PATCH v2 3/3 doc: add sphinx numref compatibility workaround

From: John McNamara <[email protected]>

This change adds some simple handling for the :numref: directive for Sphinx versions prior to 1.3.1. This allows the Guides documentation to be built with older versions of Sphinx and still produce reasonable results.

The patch replaces the :numref: reference with a link to the target (for all Sphinx doc types). It doesn't try to label figures/tables.

Full numref support with automatic figure/table numbering and links can be obtained by upgrading to Sphinx 1.3.1 or later.

---
 doc/guides/conf.py | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
doc/guides/conf.py +80 -0
index 1bc031f..cab97ac 100644
@@ -31,6 +31,9 @@
 import subprocess
 from sphinx.highlighting import PygmentsBridge
 from pygments.formatters.latex import LatexFormatter
+from docutils import nodes
+from distutils.version import LooseVersion
+from sphinx import __version__ as sphinx_version
 
 project = 'DPDK'
 
@@ -72,6 +75,7 @@ latex_elements = {
     'preamble': latex_preamble
 }
 
+
 # Override the default Latex formatter in order to modify the
 # code/verbatim blocks.
 class CustomLatexFormatter(LatexFormatter):
@@ -82,3 +86,79 @@ class CustomLatexFormatter(LatexFormatter):
 
 # Replace the default latex formatter.
 PygmentsBridge.latex_formatter = CustomLatexFormatter
+
+
+# The following hook functions add some simple handling for the :numref:
+# directive for Sphinx versions prior to 1.3.1. The functions replace the
+# :numref: reference with a link to the target (for all Sphinx doc types). It
+# doesn't try to label figures/tables.
+
+def numref_role(reftype, rawtext, text, lineno, inliner):
+    """
+    Add a Sphinx role to handle numref references. Note, we can't convert the
+    link here because the doctree isn't build and the target information isn't
+    available.
+
+    """
+
+    # Add an identifier to distinguish numref from other references.
+    newnode = nodes.reference('',
+                              '',
+                              refuri='_local_numref_#%s' % text,
+                              internal=True)
+
+    return [newnode], []
+
+
+def process_numref(app, doctree, from_docname):
+    """
+    Process the numref nodes once the doctree has been built and prior to
+    writing the files. The processing involves replacing the numref with a
+    link plus text to indicate if it is a Figure or Table link.
+
+    """
+    env = app.builder.env
+
+    # Iterate over the reference nodes in the doctree.
+    for node in doctree.traverse(nodes.reference):
+        target = node.get('refuri', '')
+
+        # Look for numref nodes.
+        if target.startswith('_local_numref_#'):
+            target = target.replace('_local_numref_#', '')
+
+            # Get the target label and link information from the Sphinx env.
+            data = env.domains['std'].data
+            docname, label, _ = data['labels'].get(target, ('', '', ''))
+            relative_url = app.builder.get_relative_uri(from_docname, docname)
+
+            # Add a text label to the link.
+            if target.startswith('figure'):
+                caption = 'Figure'
+            elif target.startswith('table'):
+                caption = 'Table'
+            else:
+                caption = 'Link'
+
+            # Create a new reference node with the updated link information.
+            newnode = nodes.reference('',
+                                      caption,
+                                      refuri='%s#%s' % (relative_url, label),
+                                      internal=True)
+
+            # Replace the node.
+            node.replace_self(newnode)
+
+
+def setup(app):
+
+    if LooseVersion(sphinx_version) < LooseVersion('1.3.1'):
+
+        print('[dpdk docs] Upgrade sphinx to version >= 1.3.1 for '
+              'improved Figure/Table number handling.')
+
+        # Add a role to handle :numref: references.
+        app.add_role('numref', numref_role)
+
+        # Process the numref references once the doctree has been created.
+        app.connect('doctree-resolved', process_numref)
Signature · 1 line
1.8.1.4
#10 lore raw

PATCH v2 1/3 doc: refactored figure numbers into references

In reply to John McNamara

This change adds automatic figure references to the docs. The figure numbers in the generated Html and PDF docs are now automatically numbered based on section.

Requires Sphinx >= 1.3.1.

The patch makes the following changes.

* Changes image:: tag to figure:: and moves image caption to the figure.

* Adds captions to figures that didn't previously have any.

* Un-templates the |image-name| substitution definitions into explicit figure:: tags. They weren't used more than once anyway and Sphinx doesn't support them for figure.

* Adds a target to each image that didn't previously have one so that they can be cross-referenced.

* Renamed existing image target to match the image name for consistency.

* Replaces the Figures lists with automatic :numref:
:ref: entries to generate automatic numbering and captions.

* Replaces "Figure" references with automatic :numref:
references.

---
 doc/guides/conf.py                                 |   2 +
 doc/guides/nics/index.rst                          |  18 ++-
 doc/guides/nics/intel_vf.rst                       |  37 ++---
 doc/guides/nics/virtio.rst                         |  18 ++-
 doc/guides/nics/vmxnet3.rst                        |  18 ++-
 doc/guides/prog_guide/env_abstraction_layer.rst    |   8 +-
 doc/guides/prog_guide/index.rst                    |  92 +++++++-----
 doc/guides/prog_guide/ivshmem_lib.rst              |   8 +-
 doc/guides/prog_guide/kernel_nic_interface.rst     |  40 ++---
 .../prog_guide/link_bonding_poll_mode_drv_lib.rst  |  43 ++++--
 doc/guides/prog_guide/lpm6_lib.rst                 |   8 +-
 doc/guides/prog_guide/lpm_lib.rst                  |   8 +-
 doc/guides/prog_guide/malloc_lib.rst               |   9 +-
 doc/guides/prog_guide/mbuf_lib.rst                 |  20 +--
 doc/guides/prog_guide/mempool_lib.rst              |  32 ++--
 doc/guides/prog_guide/multi_proc_support.rst       |   9 +-
 doc/guides/prog_guide/overview.rst                 |   9 +-
 doc/guides/prog_guide/packet_distrib_lib.rst       |  15 +-
 doc/guides/prog_guide/packet_framework.rst         |  81 +++++-----
 doc/guides/prog_guide/qos_framework.rst            | 163 +++++++--------------
 doc/guides/prog_guide/ring_lib.rst                 | 159 +++++++++++---------
 doc/guides/sample_app_ug/dist_app.rst              |  20 ++-
 doc/guides/sample_app_ug/exception_path.rst        |   8 +-
 doc/guides/sample_app_ug/index.rst                 |  58 ++++----
 doc/guides/sample_app_ug/intel_quickassist.rst     |  11 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst  |   9 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |  23 +--
 .../sample_app_ug/l2_forward_real_virtual.rst      |  22 +--
 .../sample_app_ug/l3_forward_access_ctrl.rst       |  21 ++-
 doc/guides/sample_app_ug/load_balancer.rst         |   9 +-
 doc/guides/sample_app_ug/multi_process.rst         |  36 ++---
 doc/guides/sample_app_ug/qos_scheduler.rst         |   9 +-
 doc/guides/sample_app_ug/quota_watermark.rst       |  36 ++---
 doc/guides/sample_app_ug/test_pipeline.rst         |   9 +-
 doc/guides/sample_app_ug/vhost.rst                 |  45 ++----
 doc/guides/sample_app_ug/vm_power_management.rst   |  18 +--
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |  11 +-
 doc/guides/xen/pkt_switch.rst                      |  30 ++--
 38 files changed, 539 insertions(+), 633 deletions(-)
doc/guides/conf.py +2 -0
index b1ef323..1bc031f 100644
@@ -41,6 +41,8 @@ release = version
 
 master_doc = 'index'
 
+numfig = True
+
 latex_documents = [
     ('index',
      'doc.tex',
doc/guides/nics/index.rst +12 -6
index aadbae3..1ee67fa 100644
@@ -50,14 +50,20 @@ Network Interface Controller Drivers
 
 **Figures**
 
-:ref:`Figure 1. Virtualization for a Single Port NIC in SR-IOV Mode <nic_figure_1>`
+:numref:`figure_single_port_nic` :ref:`figure_single_port_nic`
 
-:ref:`Figure 2. SR-IOV Performance Benchmark Setup <nic_figure_2>`
+:numref:`figure_perf_benchmark` :ref:`figure_perf_benchmark`
 
-:ref:`Figure 3. Fast Host-based Packet Processing <nic_figure_3>`
+:numref:`figure_fast_pkt_proc` :ref:`figure_fast_pkt_proc`
 
-:ref:`Figure 4. SR-IOV Inter-VM Communication <nic_figure_4>`
+:numref:`figure_inter_vm_comms` :ref:`figure_inter_vm_comms`
 
-:ref:`Figure 5. Virtio Host2VM Communication Example Using KNI vhost Back End <nic_figure_5>`
+:numref:`figure_host_vm_comms` :ref:`figure_host_vm_comms`
 
-:ref:`Figure 6. Virtio Host2VM Communication Example Using Qemu vhost Back End <nic_figure_6>`
+:numref:`figure_host_vm_comms_qemu` :ref:`figure_host_vm_comms_qemu`
+
+:numref:`figure_vmxnet3_int` :ref:`figure_vmxnet3_int`
+
+:numref:`figure_vswitch_vm` :ref:`figure_vswitch_vm`
+
+:numref:`figure_vm_vm_comms` :ref:`figure_vm_vm_comms`
doc/guides/nics/intel_vf.rst +20 -17
index eeca973..db86c64 100644
@@ -49,9 +49,9 @@ SR-IOV Mode Utilization in a DPDK Environment
 The DPDK uses the SR-IOV feature for hardware-based I/O sharing in IOV mode.
 Therefore, it is possible to partition SR-IOV capability on Ethernet controller NIC resources logically and
 expose them to a virtual machine as a separate PCI function called a "Virtual Function".
-Refer to Figure 10.
+Refer to :numref:`figure_single_port_nic`.
 
-Therefore, a NIC is logically distributed among multiple virtual machines (as shown in Figure 10),
+Therefore, a NIC is logically distributed among multiple virtual machines (as shown in :numref:`figure_single_port_nic`),
 while still having global data in common to share with the Physical Function and other Virtual Functions.
 The DPDK fm10kvf, i40evf, igbvf or ixgbevf as a Poll Mode Driver (PMD) serves for the Intel® 82576 Gigabit Ethernet Controller,
 Intel® Ethernet Controller I350 family, Intel® 82599 10 Gigabit Ethernet Controller NIC,
@@ -72,11 +72,12 @@ For more detail on SR-IOV, please refer to the following documents:
 
 *   `Scalable I/O Virtualized Servers <http://www.intel.com/content/www/us/en/virtualization/server-virtualization/scalable-i-o-virtualized-servers-paper.html>`_
 
-.. _nic_figure_1:
+.. _figure_single_port_nic:
 
-**Figure 1. Virtualization for a Single Port NIC in SR-IOV Mode**
+.. figure:: img/single_port_nic.*
+
+   Virtualization for a Single Port NIC in SR-IOV Mode
 
-.. image:: img/single_port_nic.*
 
 Physical and Virtual Function Infrastructure
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -548,13 +549,14 @@ The setup procedure is as follows:
         can also be used to bind and unbind devices to a virtual machine in Ubuntu.
         If this option is used, step 6 in the instructions provided will be different.
 
-    *   The Virtual Machine Monitor (see Figure 11) is equivalent to a Host OS with KVM installed as described in the instructions.
+    *   The Virtual Machine Monitor (see :numref:`figure_perf_benchmark`) is equivalent to a Host OS with KVM installed as described in the instructions.
+
+.. _figure_perf_benchmark:
 
-.. _nic_figure_2:
+.. figure:: img/perf_benchmark.*
 
-**Figure 2. Performance Benchmark Setup**
+   Performance Benchmark Setup
 
-.. image:: img/perf_benchmark.*
 
 DPDK SR-IOV PMD PF/VF Driver Usage Model
 ----------------------------------------
@@ -569,14 +571,15 @@ the DPDK VF PMD driver performs the same throughput result as a non-VT native en
 With such host instance fast packet processing, lots of services such as filtering, QoS,
 DPI can be offloaded on the host fast path.
 
-Figure 12 shows the scenario where some VMs directly communicate externally via a VFs,
+:numref:`figure_fast_pkt_proc` shows the scenario where some VMs directly communicate externally via a VFs,
 while others connect to a virtual switch and share the same uplink bandwidth.
 
-.. _nic_figure_3:
+.. _figure_fast_pkt_proc:
+
+.. figure:: img/fast_pkt_proc.*
 
-**Figure 3. Fast Host-based Packet Processing**
+   Fast Host-based Packet Processing
 
-.. image:: img/fast_pkt_proc.*
 
 SR-IOV (PF/VF) Approach for Inter-VM Communication
 --------------------------------------------------
@@ -587,7 +590,7 @@ So VF-to-VF traffic within the same physical port (VM0<->VM1) have hardware acce
 However, when VF crosses physical ports (VM0<->VM2), there is no such hardware bridge.
 In this case, the DPDK PMD PF driver provides host forwarding between such VMs.
 
-Figure 13 shows an example.
+:numref:`figure_inter_vm_comms` shows an example.
 In this case an update of the MAC address lookup tables in both the NIC and host DPDK application is required.
 
 In the NIC, writing the destination of a MAC address belongs to another cross device VM to the PF specific pool.
@@ -598,8 +601,8 @@ that is, the packet is forwarded to the correct PF pool.
 The SR-IOV NIC switch forwards the packet to a specific VM according to the MAC destination address
 which belongs to the destination VF on the VM.
 
-.. _nic_figure_4:
+.. _figure_inter_vm_comms:
 
-**Figure 4. Inter-VM Communication**
+.. figure:: img/inter_vm_comms.*
 
-.. image:: img/inter_vm_comms.*
+   Inter-VM Communication
doc/guides/nics/virtio.rst +11 -7
index 073d980..9f18b3a 100644
@@ -106,11 +106,12 @@ Virtio with kni vhost Back End
 
 This section demonstrates kni vhost back end example setup for Phy-VM Communication.
 
-.. _nic_figure_5:
+.. _figure_host_vm_comms:
 
-**Figure 5. Host2VM Communication Example Using kni vhost Back End**
+.. figure:: img/host_vm_comms.*
+
+   Host2VM Communication Example Using kni vhost Back End
 
-.. image:: img/host_vm_comms.*
 
 Host2VM communication example
 
@@ -174,7 +175,9 @@ Host2VM communication example
 
     We use testpmd as the forwarding application in this example.
 
-    .. image:: img/console.*
+    .. figure:: img/console.*
+
+       Running testpmd
 
 #.  Use IXIA packet generator to inject a packet stream into the KNI physical port.
 
@@ -185,11 +188,12 @@ Host2VM communication example
 Virtio with qemu virtio Back End
 --------------------------------
 
-.. _nic_figure_6:
+.. _figure_host_vm_comms_qemu:
+
+.. figure:: img/host_vm_comms_qemu.*
 
-**Figure 6. Host2VM Communication Example Using qemu vhost Back End**
+   Host2VM Communication Example Using qemu vhost Back End
 
-.. image:: img/host_vm_comms_qemu.*
 
 .. code-block:: console
 
doc/guides/nics/vmxnet3.rst +15 -3
index 830530d..e919088 100644
@@ -121,7 +121,11 @@ The following prerequisites apply:
 *   Before starting a VM, a VMXNET3 interface to a VM through VMware vSphere Client must be assigned.
     This is shown in the figure below.
 
-.. image:: img/vmxnet3_int.*
+.. _figure_vmxnet3_int:
+
+.. figure:: img/vmxnet3_int.*
+
+   Assigning a VMXNET3 interface to a VM using VMware vSphere Client
 
 .. note::
 
@@ -142,7 +146,11 @@ VMXNET3 with a Native NIC Connected to a vSwitch
 
 This section describes an example setup for Phy-vSwitch-VM-Phy communication.
 
-.. image:: img/vswitch_vm.*
+.. _figure_vswitch_vm:
+
+.. figure:: img/vswitch_vm.*
+
+   VMXNET3 with a Native NIC Connected to a vSwitch
 
 .. note::
 
@@ -164,7 +172,11 @@ VMXNET3 Chaining VMs Connected to a vSwitch
 
 The following figure shows an example VM-to-VM communication over a Phy-VM-vSwitch-VM-Phy communication channel.
 
-.. image:: img/vm_vm_comms.*
+.. _figure_vm_vm_comms:
+
+.. figure:: img/vm_vm_comms.*
+
+   VMXNET3 Chaining VMs Connected to a vSwitch
 
 .. note::
 
doc/guides/prog_guide/env_abstraction_layer.rst +3 -5
index 4ecbe6a..25eb281 100644
@@ -85,13 +85,12 @@ A check is also performed at initialization time to ensure that the micro archit
 Then, the main() function is called. The core initialization and launch is done in rte_eal_init() (see the API documentation).
 It consist of calls to the pthread library (more specifically, pthread_self(), pthread_create(), and pthread_setaffinity_np()).
 
-.. _pg_figure_2:
+.. _figure_linuxapp_launch:
 
-**Figure 2. EAL Initialization in a Linux Application Environment**
+.. figure:: img/linuxapp_launch.*
 
-.. image3_png has been replaced
+   EAL Initialization in a Linux Application Environment
 
-|linuxapp_launch|
 
 .. note::
 
@@ -367,4 +366,3 @@ We expect only 50% of CPU spend on packet IO.
     echo  50000 > pkt_io/cpu.cfs_quota_us
 
 
-.. |linuxapp_launch| image:: img/linuxapp_launch.*
doc/guides/prog_guide/index.rst +59 -33

130 lines not on this page · raw message

doc/guides/prog_guide/ivshmem_lib.rst +4 -4
index 75175fa..9401ccf 100644
@@ -43,9 +43,11 @@ they are automatically recognized by the DPDK Environment Abstraction Layer (EAL
 
 A typical DPDK IVSHMEM use case looks like the following.
 
-.. image28_png has been renamed
 
-|ivshmem|
+.. figure:: img/ivshmem.*
+
+   Typical Ivshmem use case
+
 
 The same could work with several virtual machines, providing host-to-VM or VM-to-VM communication.
 The maximum number of metadata files is 32 (by default) and each metadata file can contain different (or even the same) hugepages.
@@ -154,5 +156,3 @@ It is important to note that once QEMU is started, it holds on to the hugepages
 As a result, if the user wishes to shut down or restart the IVSHMEM host application,
 it is not enough to simply shut the application down.
 The virtual machine must also be shut down (if not, it will hold onto outdated host data).
-
-.. |ivshmem| image:: img/ivshmem.*
doc/guides/prog_guide/kernel_nic_interface.rst +14 -26
index bab376a..fb12d43 100644
@@ -42,15 +42,14 @@ The benefits of using the DPDK KNI are:
 
 *   Allows an interface with the kernel network stack.
 
-The components of an application using the DPDK Kernel NIC Interface are shown in Figure 17.
+The components of an application using the DPDK Kernel NIC Interface are shown in :numref:`figure_kernel_nic_intf`.
 
-.. _pg_figure_17:
+.. _figure_kernel_nic_intf:
 
-**Figure 17. Components of a DPDK KNI Application**
+.. figure:: img/kernel_nic_intf.*
 
-.. image43_png has been renamed
+   Components of a DPDK KNI Application
 
-|kernel_nic_intf|
 
 The DPDK KNI Kernel Module
 --------------------------
@@ -114,15 +113,14 @@ To minimize the amount of DPDK code running in kernel space, the mbuf mempool is
 The kernel module will be aware of mbufs,
 but all mbuf allocation and free operations will be handled by the DPDK application only.
 
-Figure 18 shows a typical scenario with packets sent in both directions.
+:numref:`figure_pkt_flow_kni` shows a typical scenario with packets sent in both directions.
 
-.. _pg_figure_18:
+.. _figure_pkt_flow_kni:
 
-**Figure 18. Packet Flow via mbufs in the DPDK KNI**
+.. figure:: img/pkt_flow_kni.*
 
-.. image44_png has been renamed
+   Packet Flow via mbufs in the DPDK KNI
 
-|pkt_flow_kni|
 
 Use Case: Ingress
 -----------------
@@ -189,13 +187,12 @@ it naturally supports both legacy virtio -net and the DPDK PMD virtio.
 There is a little penalty that comes from the non-polling mode of vhost.
 However, it scales throughput well when using KNI in multi-thread mode.
 
-.. _pg_figure_19:
+.. _figure_vhost_net_arch2:
 
-**Figure 19. vHost-net Architecture Overview**
+.. figure:: img/vhost_net_arch.*
 
-.. image45_png has been renamed
+   vHost-net Architecture Overview
 
-|vhost_net_arch|
 
 Packet Flow
 ~~~~~~~~~~~
@@ -208,13 +205,12 @@ All the packet copying, irrespective of whether it is on the transmit or receive
 happens in the context of vhost kthread.
 Every vhost-net device is exposed to a front end virtio device in the guest.
 
-.. _pg_figure_20:
+.. _figure_kni_traffic_flow:
 
-**Figure 20. KNI Traffic Flow**
+.. figure:: img/kni_traffic_flow.*
 
-.. image46_png  has been renamed
+   KNI Traffic Flow
 
-|kni_traffic_flow|
 
 Sample Usage
 ~~~~~~~~~~~~
@@ -280,11 +276,3 @@ since the kni-vhost does not yet support those features.
 Even if the option is turned on, kni-vhost will ignore the information that the header contains.
 When working with legacy virtio on the guest, it is better to turn off unsupported offload features using ethtool -K.
 Otherwise, there may be problems such as an incorrect L4 checksum error.
-
-.. |kni_traffic_flow| image:: img/kni_traffic_flow.*
-
-.. |vhost_net_arch| image:: img/vhost_net_arch.*
-
-.. |pkt_flow_kni| image:: img/pkt_flow_kni.*
-
-.. |kernel_nic_intf| image:: img/kernel_nic_intf.*
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +28 -15

88 lines not on this page · raw message

doc/guides/prog_guide/lpm6_lib.rst +4 -4
index abc5adb..87f5066 100644
@@ -108,9 +108,11 @@ This is not feasible due to resource restrictions.
 By splitting the process in different tables/levels and limiting the number of tbl8s,
 we can greatly reduce memory consumption while maintaining a very good lookup speed (one memory access per level).
 
-.. image40_png has been renamed
 
-|tbl24_tbl8_tbl8|
+.. figure:: img/tbl24_tbl8_tbl8.*
+
+   Table split into different levels
+
 
 An entry in a table contains the following fields:
 
@@ -231,5 +233,3 @@ Use Case: IPv6 Forwarding
 -------------------------
 
 The LPM algorithm is used to implement the Classless Inter-Domain Routing (CIDR) strategy used by routers implementing IP forwarding.
-
-.. |tbl24_tbl8_tbl8| image:: img/tbl24_tbl8_tbl8.*
doc/guides/prog_guide/lpm_lib.rst +4 -4
index 692e37f..c33e469 100644
@@ -90,9 +90,11 @@ Instead, this approach takes advantage of the fact that rules longer than 24 bit
 By splitting the process in two different tables/levels and limiting the number of tbl8s,
 we can greatly reduce memory consumption while maintaining a very good lookup speed (one memory access, most of the times).
 
-.. image39 has been renamed
 
-|tbl24_tbl8|
+.. figure:: img/tbl24_tbl8.*
+
+   Table split into different levels
+
 
 An entry in tbl24 contains the following fields:
 
@@ -219,5 +221,3 @@ References
 
 *   Pankaj Gupta, Algorithms for Routing Lookups and Packet Classification, PhD Thesis, Stanford University,
     2000  (`http://klamath.stanford.edu/~pankaj/thesis/ thesis_1sided.pdf <http://klamath.stanford.edu/~pankaj/thesis/%20thesis_1sided.pdf>`_ )
-
-.. |tbl24_tbl8| image:: img/tbl24_tbl8.*
doc/guides/prog_guide/malloc_lib.rst +3 -6
index b9298f8..6418fab 100644
@@ -117,13 +117,12 @@ The key fields of the heap structure and their function are described below (see
     since these are never touched except when they are to be freed again -
     at which point the pointer to the block is an input to the free() function.
 
-.. _pg_figure_3:
+.. _figure_malloc_heap:
 
-**Figure 3. Example of a malloc heap and malloc elements within the malloc library**
+.. figure:: img/malloc_heap.*
 
-.. image4_png has been renamed
+   Example of a malloc heap and malloc elements within the malloc library
 
-|malloc_heap|
 
 Structure: malloc_elem
 ^^^^^^^^^^^^^^^^^^^^^^
@@ -232,5 +231,3 @@ These next and previous elements are then checked to see if they too are free,
 and if so, they are merged with the current elements.
 This means that we can never have two free memory blocks adjacent to one another,
 they are always merged into a single block.
-
-.. |malloc_heap| image:: img/malloc_heap.*
doc/guides/prog_guide/mbuf_lib.rst +7 -13
index 338f7da..32a041e 100644
@@ -71,23 +71,21 @@ Message buffers may be used to carry control information, packets, events,
 and so on between different entities in the system.
 Message buffers may also use their buffer pointers to point to other message buffer data sections or other structures.
 
-Figure 8 and Figure 9 show some of these scenarios.
+:numref:`figure_mbuf1` and :numref:`figure_mbuf2` show some of these scenarios.
 
-.. _pg_figure_8:
+.. _figure_mbuf1:
 
-**Figure 8. An mbuf with One Segment**
+.. figure:: img/mbuf1.*
 
-.. image22_png  has been replaced
+   An mbuf with One Segment
 
-|mbuf1|
 
-.. _pg_figure_9:
+.. _figure_mbuf2:
 
-**Figure 9. An mbuf with Three Segments**
+.. figure:: img/mbuf2.*
 
-.. image23_png has been replaced
+   An mbuf with Three Segments
 
-|mbuf2|
 
 The Buffer Manager implements a fairly standard set of buffer access functions to manipulate network packets.
 
@@ -277,7 +275,3 @@ Use Cases
 ---------
 
 All networking application should use mbufs to transport network packets.
-
-.. |mbuf1| image:: img/mbuf1.*
-
-.. |mbuf2| image:: img/mbuf2.*
doc/guides/prog_guide/mempool_lib.rst +12 -20
index f9b7cfe..f0ca06f 100644
@@ -74,28 +74,27 @@ When running an application, the EAL command line options provide the ability to
 
     The command line must always have the number of memory channels specified for the processor.
 
-Examples of alignment for different DIMM architectures are shown in Figure 5 and Figure 6.
+Examples of alignment for different DIMM architectures are shown in
+:numref:`figure_memory-management` and :numref:`figure_memory-management2`.
 
-.. _pg_figure_5:
+.. _figure_memory-management:
 
-**Figure 5. Two Channels and Quad-ranked DIMM Example**
+.. figure:: img/memory-management.*
 
-.. image19_png has been replaced
+   Two Channels and Quad-ranked DIMM Example
 
-|memory-management|
 
 In this case, the assumption is that a packet is 16 blocks of 64 bytes, which is not true.
 
 The Intel® 5520 chipset has three channels, so in most cases,
 no padding is required between objects (except for objects whose size are n x 3 x 64 bytes blocks).
 
-.. _pg_figure_6:
+.. _figure_memory-management2:
 
-**Figure 6. Three Channels and Two Dual-ranked DIMM Example**
+.. figure:: img/memory-management2.*
 
-.. image20_png has been replaced
+   Three Channels and Two Dual-ranked DIMM Example
 
-|memory-management2|
 
 When creating a new pool, the user can specify to use this feature or not.
 
@@ -119,15 +118,14 @@ This cache can be enabled or disabled at creation of the pool.
 
 The maximum size of the cache is static and is defined at compilation time (CONFIG_RTE_MEMPOOL_CACHE_MAX_SIZE).
 
-Figure 7 shows a cache in operation.
+:numref:`figure_mempool` shows a cache in operation.
 
-.. _pg_figure_7:
+.. _figure_mempool:
 
-**Figure 7. A mempool in Memory with its Associated Ring**
+.. figure:: img/mempool.*
 
-.. image21_png has been replaced
+   A mempool in Memory with its Associated Ring
 
-|mempool|
 
 Use Cases
 ---------
@@ -140,9 +138,3 @@ Below are some examples:
 *   :ref:`Environment Abstraction Layer <Environment_Abstraction_Layer>` , for logging service
 
 *   Any application that needs to allocate fixed-sized objects in the data plane and that will be continuously utilized by the system.
-
-.. |memory-management| image:: img/memory-management.*
-
-.. |memory-management2| image:: img/memory-management2.*
-
-.. |mempool| image:: img/mempool.*
doc/guides/prog_guide/multi_proc_support.rst +3 -6
index 25a6056..6562f0d 100644
@@ -83,13 +83,12 @@ and point to the same objects, in both processes.
     Refer to Section 23.3 "Multi-process Limitations" for details of
     how Linux kernel Address-Space Layout Randomization (ASLR) can affect memory sharing.
 
-.. _pg_figure_16:
+.. _figure_multi_process_memory:
 
-**Figure 16. Memory Sharing in the DPDK Multi-process Sample Application**
+.. figure:: img/multi_process_memory.*
 
-.. image42_png has been replaced
+   Memory Sharing in the DPDK Multi-process Sample Application
 
-|multi_process_memory|
 
 The EAL also supports an auto-detection mode (set by EAL --proc-type=auto flag ),
 whereby an DPDK process is started as a secondary instance if a primary instance is already running.
@@ -199,5 +198,3 @@ instead of the functions which do the hashing internally, such as rte_hash_add()
     which means that only the first, primary DPDK process instance can open and mmap  /dev/hpet.
     If the number of required DPDK processes exceeds that of the number of available HPET comparators,
     the TSC (which is the default timer in this release) must be used as a time source across all processes instead of the HPET.
-
-.. |multi_process_memory| image:: img/multi_process_memory.*
doc/guides/prog_guide/overview.rst +3 -6
index 062d923..cef6ca7 100644
@@ -120,13 +120,12 @@ Core Components
 The *core components* are a set of libraries that provide all the elements needed
 for high-performance packet processing applications.
 
-.. _pg_figure_1:
+.. _figure_architecture-overview:
 
-**Figure 1. Core Components Architecture**
+.. figure:: img/architecture-overview.*
 
-.. image2_png has been replaced
+   Core Components Architecture
 
-|architecture-overview|
 
 Memory Manager (librte_malloc)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -203,5 +202,3 @@ librte_net
 The librte_net library is a collection of IP protocol definitions and convenience macros.
 It is based on code from the FreeBSD* IP stack and contains protocol numbers (for use in IP headers),
 IP-related macros, IPv4/IPv6 header structures and TCP, UDP and SCTP header structures.
-
-.. |architecture-overview| image:: img/architecture-overview.*
doc/guides/prog_guide/packet_distrib_lib.rst +8 -7
index 767accc..b5bdabb 100644
@@ -38,7 +38,10 @@ which is responsible for load balancing or distributing packets,
 and a set of worker lcores which are responsible for receiving the packets from the distributor and operating on them.
 The model of operation is shown in the diagram below.
 
-|packet_distributor1|
+.. figure:: img/packet_distributor1.*
+
+   Packet Distributor mode of operation
+
 
 Distributor Core Operation
 --------------------------
@@ -91,9 +94,11 @@ No packet ordering guarantees are made about packets which do not share a common
 Using the process and returned_pkts API, the following application workflow can be used,
 while allowing packet order within a packet flow -- identified by a tag -- to be maintained.
 
-.. image41_png has been renamed
 
-|packet_distributor2|
+.. figure:: img/packet_distributor2.*
+
+   Application workflow
+
 
 The flush and clear_returns API calls, mentioned previously,
 are likely of less use that the process and returned_pkts APIS, and are principally provided to aid in unit testing of the library.
@@ -110,7 +115,3 @@ Since it may be desirable to vary the number of worker cores, depending on the t
 i.e. to save power at times of lighter load,
 it is possible to have a worker stop processing packets by calling "rte_distributor_return_pkt()" to indicate that
 it has finished the current packet and does not want a new one.
-
-.. |packet_distributor1| image:: img/packet_distributor1.*
-
-.. |packet_distributor2| image:: img/packet_distributor2.*
doc/guides/prog_guide/packet_framework.rst +33 -48

155 lines not on this page · raw message

doc/guides/prog_guide/qos_framework.rst +49 -114

333 lines not on this page · raw message

doc/guides/prog_guide/ring_lib.rst +91 -68

265 lines not on this page · raw message

doc/guides/sample_app_ug/dist_app.rst +9 -11
index 56195bb..3c9a991 100644
@@ -47,11 +47,12 @@ into each other.
 This application can be used to benchmark performance using the traffic
 generator as shown in the figure below.
 
-.. _figure_22:
+.. _figure_dist_perf:
 
-**Figure 22. Performance Benchmarking Setup (Basic Environment)**
+.. figure:: img/dist_perf.*
+
+   Performance Benchmarking Setup (Basic Environment)
 
-|dist_perf|
 
 Compiling the Application
 -------------------------
@@ -106,7 +107,7 @@ Explanation
 The distributor application consists of three types of threads: a receive
 thread (lcore_rx()), a set of worker threads(lcore_worker())
 and a transmit thread(lcore_tx()). How these threads work together is shown
-in Fig2 below. The main() function launches  threads of these three types.
+in :numref:`figure_dist_app` below. The main() function launches  threads of these three types.
 Each thread has a while loop which will be doing processing and which is
 terminated only upon SIGINT or ctrl+C. The receive and transmit threads
 communicate using a software ring (rte_ring structure).
@@ -136,11 +137,12 @@ Users who wish to terminate the running of the application have to press ctrl+C
 in the application will terminate all running threads gracefully and print
 final statistics to the user.
 
-.. _figure_23:
+.. _figure_dist_app:
+
+.. figure:: img/dist_app.*
 
-**Figure 23. Distributor Sample Application Layout**
+   Distributor Sample Application Layout
 
-|dist_app|
 
 Debug Logging Support
 ---------------------
@@ -171,7 +173,3 @@ Sample Application. See Section 9.4.4, "RX Queue Initialization".
 
 TX queue initialization is done in the same way as it is done in the L2 Forwarding
 Sample Application. See Section 9.4.5, "TX Queue Initialization".
-
-.. |dist_perf| image:: img/dist_perf.*
-
-.. |dist_app| image:: img/dist_app.*
doc/guides/sample_app_ug/exception_path.rst +3 -5
index 6c06959..3cc7cbe 100644
@@ -46,13 +46,12 @@ The second thread reads from a TAP interface and writes the data unmodified to t
 
 The packet flow through the exception path application is as shown in the following figure.
 
-.. _figure_1:
+.. _figure_exception_path_example:
 
-**Figure 1. Packet Flow**
+.. figure:: img/exception_path_example.*
 
-.. image2_png has been replaced
+   Packet Flow
 
-|exception_path_example|
 
 To make throughput measurements, kernel bridges must be setup to forward data between the bridges appropriately.
 
@@ -327,4 +326,3 @@ To remove bridges and persistent TAP interfaces, the following commands are used
     brctl delbr br0
     openvpn --rmtun --dev tap_dpdk_00
 
-.. |exception_path_example| image:: img/exception_path_example.*
doc/guides/sample_app_ug/index.rst +32 -26

89 lines not on this page · raw message

doc/guides/sample_app_ug/intel_quickassist.rst +4 -7
index 7f55282..a80d4ca 100644
@@ -46,17 +46,16 @@ For this sample application, there is a dependency on either of:
 Overview
 --------
 
-An overview of the application is provided in Figure 11.
+An overview of the application is provided in :numref:`figure_quickassist_block_diagram`.
 For simplicity, only two NIC ports and one Intel® QuickAssist Technology device are shown in this diagram,
 although the number of NIC ports and Intel® QuickAssist Technology devices can be different.
 
-.. _figure_11:
+.. _figure_quickassist_block_diagram:
 
-**Figure 11. Intel® QuickAssist Technology Application Block Diagram**
+.. figure:: img/quickassist_block_diagram.*
 
-.. image14_png has been renamed
+   Intel® QuickAssist Technology Application Block Diagram
 
-|quickassist_block_diagram|
 
 The application allows the configuration of the following items:
 
@@ -220,5 +219,3 @@ performing AES-CBC-128 encryption with AES-XCBC-MAC-96 hash, the following setti
 
 Refer to the *DPDK Test Report* for more examples of traffic generator setup and the application startup command lines.
 If no errors are generated in response to the startup commands, the application is running correctly.
-
-.. |quickassist_block_diagram| image:: img/quickassist_block_diagram.*
doc/guides/sample_app_ug/kernel_nic_interface.rst +3 -6
index d6876e2..02dde59 100644
@@ -71,13 +71,12 @@ it is just for performance testing, or it can work together with VMDq support in
 
 The packet flow through the Kernel NIC Interface application is as shown in the following figure.
 
-.. _figure_2:
+.. _figure_kernel_nic:
 
-**Figure 2. Kernel NIC Application Packet Flow**
+.. figure:: img/kernel_nic.*
 
-.. image3_png has been renamed to kernel_nic.*
+   Kernel NIC Application Packet Flow
 
-|kernel_nic|
 
 Compiling the Application
 -------------------------
@@ -616,5 +615,3 @@ Currently, setting a new MTU and configuring the network interface (up/ down) ar
             RTE_LOG(ERR, APP, "Failed to start port %d\n", port_id);
         return ret;
     }
-
-.. |kernel_nic| image:: img/kernel_nic.*
doc/guides/sample_app_ug/l2_forward_job_stats.rst +8 -15
index 10dfecb..6cbf627 100644
@@ -55,27 +55,24 @@ Also, the MAC addresses are affected as follows:
 
 *   The destination MAC address is replaced by  02:00:00:00:00:TX_PORT_ID
 
-This application can be used to benchmark performance using a traffic-generator, as shown in the Figure 3.
+This application can be used to benchmark performance using a traffic-generator, as shown in the :numref:`figure_l2_fwd_benchmark_setup_jobstats`.
 
-The application can also be used in a virtualized environment as shown in Figure 4.
+The application can also be used in a virtualized environment as shown in :numref:`figure_l2_fwd_virtenv_benchmark_setup_jobstats`.
 
 The L2 Forwarding application can also be used as a starting point for developing a new application based on the DPDK.
 
-.. _figure_3:
+.. _figure_l2_fwd_benchmark_setup_jobstats:
 
-**Figure 3. Performance Benchmark Setup (Basic Environment)**
+.. figure:: img/l2_fwd_benchmark_setup.*
 
-.. image4_png has been replaced
+   Performance Benchmark Setup (Basic Environment)
 
-|l2_fwd_benchmark_setup|
+.. _figure_l2_fwd_virtenv_benchmark_setup_jobstats:
 
-.. _figure_4:
+.. figure:: img/l2_fwd_virtenv_benchmark_setup.*
 
-**Figure 4. Performance Benchmark Setup (Virtualized Environment)**
+   Performance Benchmark Setup (Virtualized Environment)
 
-.. image5_png has been renamed
-
-|l2_fwd_virtenv_benchmark_setup|
 
 Virtual Function Setup Instructions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -631,7 +628,3 @@ however it improves performance:
          * in which it was called. */
         rte_jobstats_finish(&qconf->flush_job, qconf->flush_job.target);
     }
-
-.. |l2_fwd_benchmark_setup| image:: img/l2_fwd_benchmark_setup.*
-
-.. |l2_fwd_virtenv_benchmark_setup| image:: img/l2_fwd_virtenv_benchmark_setup.*
doc/guides/sample_app_ug/l2_forward_real_virtual.rst +8 -14
index 234d71d..9334e75 100644
@@ -54,27 +54,25 @@ Also, the MAC addresses are affected as follows:
 
 *   The destination MAC address is replaced by  02:00:00:00:00:TX_PORT_ID
 
-This application can be used to benchmark performance using a traffic-generator, as shown in the Figure 3.
+This application can be used to benchmark performance using a traffic-generator, as shown in the :numref:`figure_l2_fwd_benchmark_setup`.
 
-The application can also be used in a virtualized environment as shown in Figure 4.
+The application can also be used in a virtualized environment as shown in :numref:`figure_l2_fwd_virtenv_benchmark_setup`.
 
 The L2 Forwarding application can also be used as a starting point for developing a new application based on the DPDK.
 
-.. _figure_3:
+.. _figure_l2_fwd_benchmark_setup:
 
-**Figure 3. Performance Benchmark Setup (Basic Environment)**
+.. figure:: img/l2_fwd_benchmark_setup.*
 
-.. image4_png has been replaced
+   Performance Benchmark Setup (Basic Environment)
 
-|l2_fwd_benchmark_setup|
 
-.. _figure_4:
+.. _figure_l2_fwd_virtenv_benchmark_setup:
 
-**Figure 4. Performance Benchmark Setup (Virtualized Environment)**
+.. figure:: img/l2_fwd_virtenv_benchmark_setup.*
 
-.. image5_png has been renamed
+   Performance Benchmark Setup (Virtualized Environment)
 
-|l2_fwd_virtenv_benchmark_setup|
 
 Virtual Function Setup Instructions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -526,7 +524,3 @@ however it improves performance:
 
         prev_tsc = cur_tsc;
     }
-
-.. |l2_fwd_benchmark_setup| image:: img/l2_fwd_benchmark_setup.*
-
-.. |l2_fwd_virtenv_benchmark_setup| image:: img/l2_fwd_virtenv_benchmark_setup.*
doc/guides/sample_app_ug/l3_forward_access_ctrl.rst +9 -12
index 73fa4df..dbf47c7 100644
@@ -142,9 +142,13 @@ Other lines types are considered invalid.
 
 *   A typical IPv4 ACL rule line should have a format as shown below:
 
-.. image6_png has been renamed
 
-|ipv4_acl_rule|
+.. _figure_ipv4_acl_rule:
+
+.. figure:: img/ipv4_acl_rule.*
+
+   A typical IPv4 ACL rule
+
 
 IPv4 addresses are specified in CIDR format as specified in RFC 4632.
 They consist of the dot notation for the address and a prefix length separated by '/'.
@@ -164,15 +168,12 @@ For example: 6/0xfe matches protocol values 6 and 7.
 Rules File Example
 ~~~~~~~~~~~~~~~~~~
 
-.. _figure_5_1:
+.. _figure_example_rules:
 
-Figure 5 is an example of a rules file. This file has three rules, one for ACL and two for route information.
+.. figure:: img/example_rules.*
 
-**Figure 5.Example Rules File**
+   Rules example
 
-.. image7_png has been renamed
-
-|example_rules|
 
 Each rule is explained as follows:
 
@@ -397,7 +398,3 @@ Finally, the application creates contexts handler from the ACL library,
 adds rules parsed from the file into the database and build an ACL trie.
 It is important to note that the application creates an independent copy of each database for each socket CPU
 involved in the task to reduce the time for remote memory access.
-
-.. |ipv4_acl_rule| image:: img/ipv4_acl_rule.*
-
-.. |example_rules| image:: img/example_rules.*
doc/guides/sample_app_ug/load_balancer.rst +3 -6
index 3b32bdc..615826a 100644
@@ -44,13 +44,12 @@ Overview
 
 The architecture of the Load Balance application is presented in the following figure.
 
-.. _figure_5:
+.. _figure_load_bal_app_arch:
 
-**Figure 5. Load Balancer Application Architecture**
+.. figure:: img/load_bal_app_arch.*
 
-.. image8_png has been renamed
+   Load Balancer Application Architecture
 
-|load_bal_app_arch|
 
 For the sake of simplicity, the diagram illustrates a specific case of two I/O RX and two I/O TX lcores off loading the packet I/O
 overhead incurred by four NIC ports from four worker cores, with each I/O lcore handling RX/TX for two NIC ports.
@@ -241,5 +240,3 @@ are on the same or different CPU sockets, the following run-time scenarios are p
 #.  ABC: The packet is received on socket A, it is processed by an lcore on socket B,
     then it has to be transmitted out by a NIC connected to socket C.
     The performance price for crossing the CPU socket boundary is paid twice for this packet.
-
-.. |load_bal_app_arch| image:: img/load_bal_app_arch.*
doc/guides/sample_app_ug/multi_process.rst +12 -24
index 9ed450b..dc287af 100644
@@ -190,13 +190,12 @@ such as a client-server mode of operation seen in the next example,
 where different processes perform different tasks, yet co-operate to form a packet-processing system.)
 The following diagram shows the data-flow through the application, using two processes.
 
-.. _figure_6:
+.. _figure_sym_multi_proc_app:
 
-**Figure 6. Example Data Flow in a Symmetric Multi-process Application**
+.. figure:: img/sym_multi_proc_app.*
 
-.. image9_png has been renamed
+   Example Data Flow in a Symmetric Multi-process Application
 
-|sym_multi_proc_app|
 
 As the diagram shows, each process reads packets from each of the network ports in use.
 RSS is used to distribute incoming packets on each port to different hardware RX queues.
@@ -296,13 +295,12 @@ In this case, the client applications just perform level-2 forwarding of packets
 
 The following diagram shows the data-flow through the application, using two client processes.
 
-.. _figure_7:
+.. _figure_client_svr_sym_multi_proc_app:
 
-**Figure 7. Example Data Flow in a Client-Server Symmetric Multi-process Application**
+.. figure:: img/client_svr_sym_multi_proc_app.*
 
-.. image10_png has been renamed
+   Example Data Flow in a Client-Server Symmetric Multi-process Application
 
-|client_svr_sym_multi_proc_app|
 
 Running the Application
 ^^^^^^^^^^^^^^^^^^^^^^^
@@ -395,13 +393,12 @@ Once the master process begins to run, it tries to initialize all the resources
 memory, CPU cores, driver, ports, and so on, as the other examples do.
 Thereafter, it creates slave processes, as shown in the following figure.
 
-.. _figure_8:
+.. _figure_master_slave_proc:
 
-**Figure 8. Master-slave Process Workflow**
+.. figure:: img/master_slave_proc.*
 
-.. image11_png has been renamed
+   Master-slave Process Workflow
 
-|master_slave_proc|
 
 The master process calls the rte_eal_mp_remote_launch() EAL function to launch an application function for each pinned thread through the pipe.
 Then, it waits to check if any slave processes have exited.
@@ -475,13 +472,12 @@ Therefore, to provide the capability to resume the new slave instance if the pre
 
 The following diagram describes slave process recovery.
 
-.. _figure_9:
+.. _figure_slave_proc_recov:
 
-**Figure 9. Slave Process Recovery Process Flow**
+.. figure:: img/slave_proc_recov.*
 
-.. image12_png has been renamed
+   Slave Process Recovery Process Flow
 
-|slave_proc_recov|
 
 Floating Process Support
 ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -774,11 +770,3 @@ so it remaps the resource to the new core ID slot.
         }
         return 0;
     }
-
-.. |sym_multi_proc_app| image:: img/sym_multi_proc_app.*
-
-.. |client_svr_sym_multi_proc_app| image:: img/client_svr_sym_multi_proc_app.*
-
-.. |master_slave_proc| image:: img/master_slave_proc.*
-
-.. |slave_proc_recov| image:: img/slave_proc_recov.*
doc/guides/sample_app_ug/qos_scheduler.rst +3 -6
index 56326df..66c261c 100644
@@ -38,13 +38,12 @@ Overview
 
 The architecture of the QoS scheduler application is shown in the following figure.
 
-.. _figure_10:
+.. _figure_qos_sched_app_arch:
 
-**Figure 10. QoS Scheduler Application Architecture**
+.. figure:: img/qos_sched_app_arch.*
 
-.. image13_png has been renamed
+   QoS Scheduler Application Architecture
 
-|qos_sched_app_arch|
 
 There are two flavors of the runtime execution for this application,
 with two or three threads per each packet flow configuration being used.
@@ -347,5 +346,3 @@ This application classifies based on the QinQ double VLAN tags and the IP destin
 +----------------+-------------------------+--------------------------------------------------+----------------------------------+
 
 Please refer to the "QoS Scheduler" chapter in the *DPDK Programmer's Guide* for more information about these parameters.
-
-.. |qos_sched_app_arch| image:: img/qos_sched_app_arch.*
doc/guides/sample_app_ug/quota_watermark.rst +12 -24
index 4274223..c56683a 100644
@@ -54,15 +54,14 @@ and ports 2 and 3 forward into each other.
 The MAC addresses of the forwarded Ethernet frames are not affected.
 
 Internally, packets are pulled from the ports by the master logical core and put on a variable length processing pipeline,
-each stage of which being connected by rings, as shown in Figure 12.
+each stage of which being connected by rings, as shown in :numref:`figure_pipeline_overview`.
 
-.. _figure_12:
+.. _figure_pipeline_overview:
 
-**Figure 12. Pipeline Overview**
+.. figure:: img/pipeline_overview.*
 
-.. image15_png has been renamed
+   Pipeline Overview
 
-|pipeline_overview|
 
 An adjustable quota value controls how many packets are being moved through the pipeline per enqueue and dequeue.
 Adjustable watermark values associated with the rings control a back-off mechanism that
@@ -79,15 +78,14 @@ eventually lead to an Ethernet flow control frame being send to the source.
 
 On top of serving as an example of quota and watermark usage,
 this application can be used to benchmark ring based processing pipelines performance using a traffic- generator,
-as shown in Figure 13.
+as shown in :numref:`figure_ring_pipeline_perf_setup`.
 
-.. _figure_13:
+.. _figure_ring_pipeline_perf_setup:
 
-**Figure 13. Ring-based Processing Pipeline Performance Setup**
+.. figure:: img/ring_pipeline_perf_setup.*
 
-.. image16_png has been renamed
+   Ring-based Processing Pipeline Performance Setup
 
-|ring_pipeline_perf_setup|
 
 Compiling the Application
 -------------------------
@@ -311,7 +309,7 @@ Logical Cores Assignment
 The application uses the master logical core to poll all the ports for new packets and enqueue them on a ring associated with the port.
 
 Each logical core except the last runs pipeline_stage() after a ring for each used port is initialized on that core.
-pipeline_stage() on core X dequeues packets from core X-1's rings and enqueue them on its own rings. See Figure 14.
+pipeline_stage() on core X dequeues packets from core X-1's rings and enqueue them on its own rings. See :numref:`figure_threads_pipelines`.
 
 .. code-block:: c
 
@@ -340,16 +338,12 @@ sending them out on the destination port setup by pair_ports().
 Receive, Process and Transmit Packets
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. _figure_14:
+.. _figure_threads_pipelines:
 
-Figure 14 shows where each thread in the pipeline is.
-It should be used as a reference while reading the rest of this section.
+.. figure:: img/threads_pipelines.*
 
-**Figure 14. Threads and Pipelines**
+   Threads and Pipelines
 
-.. image17_png has been renamed
-
-|threads_pipelines|
 
 In the receive_stage() function running on the master logical core,
 the main task is to read ingress packets from the RX ports and enqueue them
@@ -498,9 +492,3 @@ low_watermark from the rte_memzone previously created by qw.
 
         low_watermark = (unsigned int *) qw_memzone->addr + sizeof(int);
     }
-
-.. |pipeline_overview| image:: img/pipeline_overview.*
-
-.. |ring_pipeline_perf_setup| image:: img/ring_pipeline_perf_setup.*
-
-.. |threads_pipelines| image:: img/threads_pipelines.*
doc/guides/sample_app_ug/test_pipeline.rst +3 -6
index 46aa6d5..3c2c25b 100644
@@ -49,13 +49,12 @@ The application uses three CPU cores:
 
 *   Core C ("TX core") receives traffic from core B through software queues and sends it to the NIC ports for transmission.
 
-.. _figure_21:
+.. _figure_test_pipeline_app:
 
-**Figure 21.Test Pipeline Application**
+.. figure:: img/test_pipeline_app.*
 
-.. image24_png has been renamed
+   Test Pipeline Application
 
-|test_pipeline_app|
 
 Compiling the Application
 -------------------------
@@ -281,5 +280,3 @@ The profile for input traffic is TCP/IPv4 packets with:
 *   destination TCP port fixed to 0
 
 *   source TCP port fixed to 0
-
-.. |test_pipeline_app| image:: img/test_pipeline_app.*
doc/guides/sample_app_ug/vhost.rst +15 -30

90 lines not on this page · raw message

doc/guides/sample_app_ug/vm_power_management.rst +8 -10
index dd6e1e8..da8be12 100644
@@ -74,11 +74,12 @@ The solution is comprised of two high-level components:
    The l3fwd-power application will use this implementation when deployed on a VM
    (see Chapter 11 "L3 Forwarding with Power Management Application").
 
-.. _figure_24:
+.. _figure_vm_power_mgr_highlevel:
 
-**Figure 24. Highlevel Solution**
+.. figure:: img/vm_power_mgr_highlevel.*
+
+   Highlevel Solution
 
-|vm_power_mgr_highlevel|
 
 Overview
 --------
@@ -105,11 +106,12 @@ at runtime based on the environment.
 Upon receiving a request, the host translates the vCPU to a pCPU via
 the libvirt API before forwarding to the host librte_power.
 
-.. _figure_25:
+.. _figure_vm_power_mgr_vm_request_seq:
+
+.. figure:: img/vm_power_mgr_vm_request_seq.*
 
-**Figure 25. VM request to scale frequency**
+   VM request to scale frequency
 
-|vm_power_mgr_vm_request_seq|
 
 Performance Considerations
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -355,7 +357,3 @@ Where {core_num} is the lcore and channel to change frequency by scaling up/down
 .. code-block:: console
 
   set_cpu_freq {core_num} up|down|min|max
-
-.. |vm_power_mgr_highlevel| image:: img/vm_power_mgr_highlevel.*
-
-.. |vm_power_mgr_vm_request_seq| image:: img/vm_power_mgr_vm_request_seq.*
doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst +4 -7
index 9fc1fd5..6fb0f0b 100644
@@ -53,7 +53,7 @@ All traffic is read from a single incoming port (port 0) and output on port 1, w
 The traffic is split into 128 queues on input, where each thread of the application reads from multiple queues.
 For example, when run with 8 threads, that is, with the -c FF option, each thread receives and forwards packets from 16 queues.
 
-As supplied, the sample application configures the VMDQ feature to have 16 pools with 8 queues each as indicated in Figure 15.
+As supplied, the sample application configures the VMDQ feature to have 16 pools with 8 queues each as indicated in :numref:`figure_vmdq_dcb_example`.
 The Intel® 82599 10 Gigabit Ethernet Controller NIC also supports the splitting of traffic into 32 pools of 4 queues each and
 this can be used by changing the NUM_POOLS parameter in the supplied code.
 The NUM_POOLS parameter can be passed on the command line, after the EAL parameters:
@@ -64,13 +64,12 @@ The NUM_POOLS parameter can be passed on the command line, after the EAL paramet
 
 where, NP can be 16 or 32.
 
-.. _figure_15:
+.. _figure_vmdq_dcb_example:
 
-**Figure 15. Packet Flow Through the VMDQ and DCB Sample Application**
+.. figure:: img/vmdq_dcb_example.*
 
-.. image18_png has been replaced
+   Packet Flow Through the VMDQ and DCB Sample Application
 
-|vmdq_dcb_example|
 
 In Linux* user space, the application can display statistics with the number of packets received on each queue.
 To have the application display the statistics, send a SIGHUP signal to the running application process, as follows:
@@ -247,5 +246,3 @@ To generate the statistics output, use the following command:
 
 Please note that the statistics output will appear on the terminal where the vmdq_dcb_app is running,
 rather than the terminal from which the HUP signal was sent.
-
-.. |vmdq_dcb_example| image:: img/vmdq_dcb_example.*
doc/guides/xen/pkt_switch.rst +18 -12
index a9eca52..3a6fc47 100644
@@ -52,9 +52,13 @@ The switching back end maps those grant table references and creates shared ring
 
 The following diagram describes the functionality of the DPDK Xen Packet- Switching Solution.
 
-.. image35_png has been renamed
 
-|dpdk_xen_pkt_switch|
+.. _figure_dpdk_xen_pkt_switch:
+
+.. figure:: img/dpdk_xen_pkt_switch.*
+
+   Functionality of the DPDK Xen Packet Switching Solution.
+
 
 Note 1 The Xen hypervisor uses a mechanism called a Grant Table to share memory between domains
 (`http://wiki.xen.org/wiki/Grant Table <http://wiki.xen.org/wiki/Grant%20Table>`_).
@@ -62,9 +66,13 @@ Note 1 The Xen hypervisor uses a mechanism called a Grant Table to share memory
 A diagram of the design is shown below, where "gva" is the Guest Virtual Address,
 which is the data pointer of the mbuf, and "hva" is the Host Virtual Address:
 
-.. image36_png has been renamed
 
-|grant_table|
+.. _figure_grant_table:
+
+.. figure:: img/grant_table.*
+
+   DPDK Xen Layout
+
 
 In this design, a Virtio ring is used as a para-virtualized interface for better performance over a Xen private ring
 when packet switching to and from a VM.
@@ -139,9 +147,13 @@ Take idx#_mempool_gref node for example, the host maps those Grant references to
 The real Grant reference information is stored in this virtual address space,
 where (gref, pfn) pairs follow each other with -1 as the terminator.
 
-.. image37_pnng has been renamed
 
-|grant_refs|
+.. _figure_grant_refs:
+
+.. figure:: img/grant_refs.*
+
+   Mapping Grant references to a continuous virtual address space
+
 
 After all gref# IDs are retrieved, the host maps them to a continuous virtual address space.
 With the guest mempool virtual address, the host establishes 1:1 address mapping.
@@ -456,9 +468,3 @@ then sent out through hardware with destination MAC address 00:00:00:00:00:33.
 The packet flow is:
 
 packet generator->Virtio in guest VM1->switching backend->Virtio in guest VM2->switching backend->wire
-
-.. |grant_table| image:: img/grant_table.*
-
-.. |grant_refs| image:: img/grant_refs.*
-
-.. |dpdk_xen_pkt_switch| image:: img/dpdk_xen_pkt_switch.*
Signature · 1 line
1.8.1.4
#12 lore raw

v3 cover doc: refactored fig and table nums into references

In reply to John McNamara

This patchset adds automatic figure and table references to the docs. The figure and table numbers in the generated Html and PDF docs can now be automatically numbered.

It replaces all hardcoded figure/table numbers and references.

The numfig/numref feature requires Sphinx >= 1.3.1. For backward compatibility with older versions workaround handling is added to the sphinx conf.py file in patch 3/3.

The workaround replaces the :numref: reference with a "Figure" or "Table" link to the target (for all Sphinx doc types). It doesn't number the figures or tables. This produces reasonable documentation links for users with older versions of sphinx while allowing automatic numbering support for newer versions.

Tested with Sphinx 1.2.3 and 1.3.1.

John McNamara (3):
doc: refactored figure numbers into references
doc: refactored table numbers into references
doc: add sphinx numref compatibility workaround

 doc/guides/conf.py                                 |   82 ++
 doc/guides/nics/index.rst                          |   18 +-
 doc/guides/nics/intel_vf.rst                       |   37 +-
 doc/guides/nics/virtio.rst                         |   18 +-
 doc/guides/nics/vmxnet3.rst                        |   18 +-
 doc/guides/prog_guide/env_abstraction_layer.rst    |    8 +-
 doc/guides/prog_guide/index.rst                    |  162 +-
 doc/guides/prog_guide/ivshmem_lib.rst              |    8 +-
 doc/guides/prog_guide/kernel_nic_interface.rst     |   40 +-
 .../prog_guide/link_bonding_poll_mode_drv_lib.rst  |   43 +-
 doc/guides/prog_guide/lpm6_lib.rst                 |    8 +-
 doc/guides/prog_guide/lpm_lib.rst                  |    8 +-
 doc/guides/prog_guide/malloc_lib.rst               |    9 +-
 doc/guides/prog_guide/mbuf_lib.rst                 |   20 +-
 doc/guides/prog_guide/mempool_lib.rst              |   32 +-
 doc/guides/prog_guide/multi_proc_support.rst       |    9 +-
 doc/guides/prog_guide/overview.rst                 |    9 +-
 doc/guides/prog_guide/packet_distrib_lib.rst       |   15 +-
 doc/guides/prog_guide/packet_framework.rst         | 1275 ++++++++--------
 doc/guides/prog_guide/qos_framework.rst            | 1543 ++++++++++----------
 doc/guides/prog_guide/ring_lib.rst                 |  159 +-
 doc/guides/sample_app_ug/dist_app.rst              |   20 +-
 doc/guides/sample_app_ug/exception_path.rst        |    8 +-
 doc/guides/sample_app_ug/index.rst                 |   64 +-
 doc/guides/sample_app_ug/intel_quickassist.rst     |   11 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst  |    9 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   23 +-
 .../sample_app_ug/l2_forward_real_virtual.rst      |   22 +-
 .../sample_app_ug/l3_forward_access_ctrl.rst       |   21 +-
 doc/guides/sample_app_ug/load_balancer.rst         |    9 +-
 doc/guides/sample_app_ug/multi_process.rst         |   36 +-
 doc/guides/sample_app_ug/qos_metering.rst          |   46 +-
 doc/guides/sample_app_ug/qos_scheduler.rst         |   55 +-
 doc/guides/sample_app_ug/quota_watermark.rst       |   36 +-
 doc/guides/sample_app_ug/test_pipeline.rst         |  313 ++--
 doc/guides/sample_app_ug/vhost.rst                 |   45 +-
 doc/guides/sample_app_ug/vm_power_management.rst   |   18 +-
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   11 +-
 doc/guides/xen/pkt_switch.rst                      |   30 +-
 39 files changed, 2141 insertions(+), 2157 deletions(-)

--
1.8.1.4

#13 lore raw

PATCH v3 1/3 doc: refactored figure numbers into references

This change adds automatic figure references to the docs. The figure numbers in the generated Html and PDF docs are now automatically numbered based on section.

Requires Sphinx >= 1.3.1.

The patch makes the following changes.

* Changes image:: tag to figure:: and moves image caption to the figure.

* Adds captions to figures that didn't previously have any.

* Un-templates the |image-name| substitution definitions into explicit figure:: tags. They weren't used more than once anyway and Sphinx doesn't support them for figure.

* Adds a target to each image that didn't previously have one so that they can be cross-referenced.

* Renamed existing image target to match the image name for consistency.

* Replaces the Figures lists with automatic :numref:
:ref: entries to generate automatic numbering and captions.

* Replaces "Figure" references with automatic :numref:
references.

---
 doc/guides/conf.py                                 |   2 +
 doc/guides/nics/index.rst                          |  18 ++-
 doc/guides/nics/intel_vf.rst                       |  37 ++---
 doc/guides/nics/virtio.rst                         |  18 ++-
 doc/guides/nics/vmxnet3.rst                        |  18 ++-
 doc/guides/prog_guide/env_abstraction_layer.rst    |   8 +-
 doc/guides/prog_guide/index.rst                    |  92 +++++++-----
 doc/guides/prog_guide/ivshmem_lib.rst              |   8 +-
 doc/guides/prog_guide/kernel_nic_interface.rst     |  40 ++---
 .../prog_guide/link_bonding_poll_mode_drv_lib.rst  |  43 ++++--
 doc/guides/prog_guide/lpm6_lib.rst                 |   8 +-
 doc/guides/prog_guide/lpm_lib.rst                  |   8 +-
 doc/guides/prog_guide/malloc_lib.rst               |   9 +-
 doc/guides/prog_guide/mbuf_lib.rst                 |  20 +--
 doc/guides/prog_guide/mempool_lib.rst              |  32 ++--
 doc/guides/prog_guide/multi_proc_support.rst       |   9 +-
 doc/guides/prog_guide/overview.rst                 |   9 +-
 doc/guides/prog_guide/packet_distrib_lib.rst       |  15 +-
 doc/guides/prog_guide/packet_framework.rst         |  81 +++++-----
 doc/guides/prog_guide/qos_framework.rst            | 163 +++++++--------------
 doc/guides/prog_guide/ring_lib.rst                 | 159 +++++++++++---------
 doc/guides/sample_app_ug/dist_app.rst              |  20 ++-
 doc/guides/sample_app_ug/exception_path.rst        |   8 +-
 doc/guides/sample_app_ug/index.rst                 |  58 ++++----
 doc/guides/sample_app_ug/intel_quickassist.rst     |  11 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst  |   9 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |  23 +--
 .../sample_app_ug/l2_forward_real_virtual.rst      |  22 +--
 .../sample_app_ug/l3_forward_access_ctrl.rst       |  21 ++-
 doc/guides/sample_app_ug/load_balancer.rst         |   9 +-
 doc/guides/sample_app_ug/multi_process.rst         |  36 ++---
 doc/guides/sample_app_ug/qos_scheduler.rst         |   9 +-
 doc/guides/sample_app_ug/quota_watermark.rst       |  36 ++---
 doc/guides/sample_app_ug/test_pipeline.rst         |   9 +-
 doc/guides/sample_app_ug/vhost.rst                 |  45 ++----
 doc/guides/sample_app_ug/vm_power_management.rst   |  18 +--
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |  11 +-
 doc/guides/xen/pkt_switch.rst                      |  30 ++--
 38 files changed, 539 insertions(+), 633 deletions(-)
doc/guides/conf.py +2 -0
index b1ef323..1bc031f 100644
@@ -41,6 +41,8 @@ release = version
 
 master_doc = 'index'
 
+numfig = True
+
 latex_documents = [
     ('index',
      'doc.tex',
doc/guides/nics/index.rst +12 -6
index aadbae3..1ee67fa 100644
@@ -50,14 +50,20 @@ Network Interface Controller Drivers
 
 **Figures**
 
-:ref:`Figure 1. Virtualization for a Single Port NIC in SR-IOV Mode <nic_figure_1>`
+:numref:`figure_single_port_nic` :ref:`figure_single_port_nic`
 
-:ref:`Figure 2. SR-IOV Performance Benchmark Setup <nic_figure_2>`
+:numref:`figure_perf_benchmark` :ref:`figure_perf_benchmark`
 
-:ref:`Figure 3. Fast Host-based Packet Processing <nic_figure_3>`
+:numref:`figure_fast_pkt_proc` :ref:`figure_fast_pkt_proc`
 
-:ref:`Figure 4. SR-IOV Inter-VM Communication <nic_figure_4>`
+:numref:`figure_inter_vm_comms` :ref:`figure_inter_vm_comms`
 
-:ref:`Figure 5. Virtio Host2VM Communication Example Using KNI vhost Back End <nic_figure_5>`
+:numref:`figure_host_vm_comms` :ref:`figure_host_vm_comms`
 
-:ref:`Figure 6. Virtio Host2VM Communication Example Using Qemu vhost Back End <nic_figure_6>`
+:numref:`figure_host_vm_comms_qemu` :ref:`figure_host_vm_comms_qemu`
+
+:numref:`figure_vmxnet3_int` :ref:`figure_vmxnet3_int`
+
+:numref:`figure_vswitch_vm` :ref:`figure_vswitch_vm`
+
+:numref:`figure_vm_vm_comms` :ref:`figure_vm_vm_comms`
doc/guides/nics/intel_vf.rst +20 -17
index eeca973..db86c64 100644
@@ -49,9 +49,9 @@ SR-IOV Mode Utilization in a DPDK Environment
 The DPDK uses the SR-IOV feature for hardware-based I/O sharing in IOV mode.
 Therefore, it is possible to partition SR-IOV capability on Ethernet controller NIC resources logically and
 expose them to a virtual machine as a separate PCI function called a "Virtual Function".
-Refer to Figure 10.
+Refer to :numref:`figure_single_port_nic`.
 
-Therefore, a NIC is logically distributed among multiple virtual machines (as shown in Figure 10),
+Therefore, a NIC is logically distributed among multiple virtual machines (as shown in :numref:`figure_single_port_nic`),
 while still having global data in common to share with the Physical Function and other Virtual Functions.
 The DPDK fm10kvf, i40evf, igbvf or ixgbevf as a Poll Mode Driver (PMD) serves for the Intel® 82576 Gigabit Ethernet Controller,
 Intel® Ethernet Controller I350 family, Intel® 82599 10 Gigabit Ethernet Controller NIC,
@@ -72,11 +72,12 @@ For more detail on SR-IOV, please refer to the following documents:
 
 *   `Scalable I/O Virtualized Servers <http://www.intel.com/content/www/us/en/virtualization/server-virtualization/scalable-i-o-virtualized-servers-paper.html>`_
 
-.. _nic_figure_1:
+.. _figure_single_port_nic:
 
-**Figure 1. Virtualization for a Single Port NIC in SR-IOV Mode**
+.. figure:: img/single_port_nic.*
+
+   Virtualization for a Single Port NIC in SR-IOV Mode
 
-.. image:: img/single_port_nic.*
 
 Physical and Virtual Function Infrastructure
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -548,13 +549,14 @@ The setup procedure is as follows:
         can also be used to bind and unbind devices to a virtual machine in Ubuntu.
         If this option is used, step 6 in the instructions provided will be different.
 
-    *   The Virtual Machine Monitor (see Figure 11) is equivalent to a Host OS with KVM installed as described in the instructions.
+    *   The Virtual Machine Monitor (see :numref:`figure_perf_benchmark`) is equivalent to a Host OS with KVM installed as described in the instructions.
+
+.. _figure_perf_benchmark:
 
-.. _nic_figure_2:
+.. figure:: img/perf_benchmark.*
 
-**Figure 2. Performance Benchmark Setup**
+   Performance Benchmark Setup
 
-.. image:: img/perf_benchmark.*
 
 DPDK SR-IOV PMD PF/VF Driver Usage Model
 ----------------------------------------
@@ -569,14 +571,15 @@ the DPDK VF PMD driver performs the same throughput result as a non-VT native en
 With such host instance fast packet processing, lots of services such as filtering, QoS,
 DPI can be offloaded on the host fast path.
 
-Figure 12 shows the scenario where some VMs directly communicate externally via a VFs,
+:numref:`figure_fast_pkt_proc` shows the scenario where some VMs directly communicate externally via a VFs,
 while others connect to a virtual switch and share the same uplink bandwidth.
 
-.. _nic_figure_3:
+.. _figure_fast_pkt_proc:
+
+.. figure:: img/fast_pkt_proc.*
 
-**Figure 3. Fast Host-based Packet Processing**
+   Fast Host-based Packet Processing
 
-.. image:: img/fast_pkt_proc.*
 
 SR-IOV (PF/VF) Approach for Inter-VM Communication
 --------------------------------------------------
@@ -587,7 +590,7 @@ So VF-to-VF traffic within the same physical port (VM0<->VM1) have hardware acce
 However, when VF crosses physical ports (VM0<->VM2), there is no such hardware bridge.
 In this case, the DPDK PMD PF driver provides host forwarding between such VMs.
 
-Figure 13 shows an example.
+:numref:`figure_inter_vm_comms` shows an example.
 In this case an update of the MAC address lookup tables in both the NIC and host DPDK application is required.
 
 In the NIC, writing the destination of a MAC address belongs to another cross device VM to the PF specific pool.
@@ -598,8 +601,8 @@ that is, the packet is forwarded to the correct PF pool.
 The SR-IOV NIC switch forwards the packet to a specific VM according to the MAC destination address
 which belongs to the destination VF on the VM.
 
-.. _nic_figure_4:
+.. _figure_inter_vm_comms:
 
-**Figure 4. Inter-VM Communication**
+.. figure:: img/inter_vm_comms.*
 
-.. image:: img/inter_vm_comms.*
+   Inter-VM Communication
doc/guides/nics/virtio.rst +11 -7
index 073d980..9f18b3a 100644
@@ -106,11 +106,12 @@ Virtio with kni vhost Back End
 
 This section demonstrates kni vhost back end example setup for Phy-VM Communication.
 
-.. _nic_figure_5:
+.. _figure_host_vm_comms:
 
-**Figure 5. Host2VM Communication Example Using kni vhost Back End**
+.. figure:: img/host_vm_comms.*
+
+   Host2VM Communication Example Using kni vhost Back End
 
-.. image:: img/host_vm_comms.*
 
 Host2VM communication example
 
@@ -174,7 +175,9 @@ Host2VM communication example
 
     We use testpmd as the forwarding application in this example.
 
-    .. image:: img/console.*
+    .. figure:: img/console.*
+
+       Running testpmd
 
 #.  Use IXIA packet generator to inject a packet stream into the KNI physical port.
 
@@ -185,11 +188,12 @@ Host2VM communication example
 Virtio with qemu virtio Back End
 --------------------------------
 
-.. _nic_figure_6:
+.. _figure_host_vm_comms_qemu:
+
+.. figure:: img/host_vm_comms_qemu.*
 
-**Figure 6. Host2VM Communication Example Using qemu vhost Back End**
+   Host2VM Communication Example Using qemu vhost Back End
 
-.. image:: img/host_vm_comms_qemu.*
 
 .. code-block:: console
 
doc/guides/nics/vmxnet3.rst +15 -3
index 830530d..e919088 100644
@@ -121,7 +121,11 @@ The following prerequisites apply:
 *   Before starting a VM, a VMXNET3 interface to a VM through VMware vSphere Client must be assigned.
     This is shown in the figure below.
 
-.. image:: img/vmxnet3_int.*
+.. _figure_vmxnet3_int:
+
+.. figure:: img/vmxnet3_int.*
+
+   Assigning a VMXNET3 interface to a VM using VMware vSphere Client
 
 .. note::
 
@@ -142,7 +146,11 @@ VMXNET3 with a Native NIC Connected to a vSwitch
 
 This section describes an example setup for Phy-vSwitch-VM-Phy communication.
 
-.. image:: img/vswitch_vm.*
+.. _figure_vswitch_vm:
+
+.. figure:: img/vswitch_vm.*
+
+   VMXNET3 with a Native NIC Connected to a vSwitch
 
 .. note::
 
@@ -164,7 +172,11 @@ VMXNET3 Chaining VMs Connected to a vSwitch
 
 The following figure shows an example VM-to-VM communication over a Phy-VM-vSwitch-VM-Phy communication channel.
 
-.. image:: img/vm_vm_comms.*
+.. _figure_vm_vm_comms:
+
+.. figure:: img/vm_vm_comms.*
+
+   VMXNET3 Chaining VMs Connected to a vSwitch
 
 .. note::
 
doc/guides/prog_guide/env_abstraction_layer.rst +3 -5
index 4ecbe6a..25eb281 100644
@@ -85,13 +85,12 @@ A check is also performed at initialization time to ensure that the micro archit
 Then, the main() function is called. The core initialization and launch is done in rte_eal_init() (see the API documentation).
 It consist of calls to the pthread library (more specifically, pthread_self(), pthread_create(), and pthread_setaffinity_np()).
 
-.. _pg_figure_2:
+.. _figure_linuxapp_launch:
 
-**Figure 2. EAL Initialization in a Linux Application Environment**
+.. figure:: img/linuxapp_launch.*
 
-.. image3_png has been replaced
+   EAL Initialization in a Linux Application Environment
 
-|linuxapp_launch|
 
 .. note::
 
@@ -367,4 +366,3 @@ We expect only 50% of CPU spend on packet IO.
     echo  50000 > pkt_io/cpu.cfs_quota_us
 
 
-.. |linuxapp_launch| image:: img/linuxapp_launch.*
doc/guides/prog_guide/index.rst +59 -33

130 lines not on this page · raw message

doc/guides/prog_guide/ivshmem_lib.rst +4 -4
index 75175fa..9401ccf 100644
@@ -43,9 +43,11 @@ they are automatically recognized by the DPDK Environment Abstraction Layer (EAL
 
 A typical DPDK IVSHMEM use case looks like the following.
 
-.. image28_png has been renamed
 
-|ivshmem|
+.. figure:: img/ivshmem.*
+
+   Typical Ivshmem use case
+
 
 The same could work with several virtual machines, providing host-to-VM or VM-to-VM communication.
 The maximum number of metadata files is 32 (by default) and each metadata file can contain different (or even the same) hugepages.
@@ -154,5 +156,3 @@ It is important to note that once QEMU is started, it holds on to the hugepages
 As a result, if the user wishes to shut down or restart the IVSHMEM host application,
 it is not enough to simply shut the application down.
 The virtual machine must also be shut down (if not, it will hold onto outdated host data).
-
-.. |ivshmem| image:: img/ivshmem.*
doc/guides/prog_guide/kernel_nic_interface.rst +14 -26
index bab376a..fb12d43 100644
@@ -42,15 +42,14 @@ The benefits of using the DPDK KNI are:
 
 *   Allows an interface with the kernel network stack.
 
-The components of an application using the DPDK Kernel NIC Interface are shown in Figure 17.
+The components of an application using the DPDK Kernel NIC Interface are shown in :numref:`figure_kernel_nic_intf`.
 
-.. _pg_figure_17:
+.. _figure_kernel_nic_intf:
 
-**Figure 17. Components of a DPDK KNI Application**
+.. figure:: img/kernel_nic_intf.*
 
-.. image43_png has been renamed
+   Components of a DPDK KNI Application
 
-|kernel_nic_intf|
 
 The DPDK KNI Kernel Module
 --------------------------
@@ -114,15 +113,14 @@ To minimize the amount of DPDK code running in kernel space, the mbuf mempool is
 The kernel module will be aware of mbufs,
 but all mbuf allocation and free operations will be handled by the DPDK application only.
 
-Figure 18 shows a typical scenario with packets sent in both directions.
+:numref:`figure_pkt_flow_kni` shows a typical scenario with packets sent in both directions.
 
-.. _pg_figure_18:
+.. _figure_pkt_flow_kni:
 
-**Figure 18. Packet Flow via mbufs in the DPDK KNI**
+.. figure:: img/pkt_flow_kni.*
 
-.. image44_png has been renamed
+   Packet Flow via mbufs in the DPDK KNI
 
-|pkt_flow_kni|
 
 Use Case: Ingress
 -----------------
@@ -189,13 +187,12 @@ it naturally supports both legacy virtio -net and the DPDK PMD virtio.
 There is a little penalty that comes from the non-polling mode of vhost.
 However, it scales throughput well when using KNI in multi-thread mode.
 
-.. _pg_figure_19:
+.. _figure_vhost_net_arch2:
 
-**Figure 19. vHost-net Architecture Overview**
+.. figure:: img/vhost_net_arch.*
 
-.. image45_png has been renamed
+   vHost-net Architecture Overview
 
-|vhost_net_arch|
 
 Packet Flow
 ~~~~~~~~~~~
@@ -208,13 +205,12 @@ All the packet copying, irrespective of whether it is on the transmit or receive
 happens in the context of vhost kthread.
 Every vhost-net device is exposed to a front end virtio device in the guest.
 
-.. _pg_figure_20:
+.. _figure_kni_traffic_flow:
 
-**Figure 20. KNI Traffic Flow**
+.. figure:: img/kni_traffic_flow.*
 
-.. image46_png  has been renamed
+   KNI Traffic Flow
 
-|kni_traffic_flow|
 
 Sample Usage
 ~~~~~~~~~~~~
@@ -280,11 +276,3 @@ since the kni-vhost does not yet support those features.
 Even if the option is turned on, kni-vhost will ignore the information that the header contains.
 When working with legacy virtio on the guest, it is better to turn off unsupported offload features using ethtool -K.
 Otherwise, there may be problems such as an incorrect L4 checksum error.
-
-.. |kni_traffic_flow| image:: img/kni_traffic_flow.*
-
-.. |vhost_net_arch| image:: img/vhost_net_arch.*
-
-.. |pkt_flow_kni| image:: img/pkt_flow_kni.*
-
-.. |kernel_nic_intf| image:: img/kernel_nic_intf.*
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +28 -15

88 lines not on this page · raw message

doc/guides/prog_guide/lpm6_lib.rst +4 -4
index abc5adb..87f5066 100644
@@ -108,9 +108,11 @@ This is not feasible due to resource restrictions.
 By splitting the process in different tables/levels and limiting the number of tbl8s,
 we can greatly reduce memory consumption while maintaining a very good lookup speed (one memory access per level).
 
-.. image40_png has been renamed
 
-|tbl24_tbl8_tbl8|
+.. figure:: img/tbl24_tbl8_tbl8.*
+
+   Table split into different levels
+
 
 An entry in a table contains the following fields:
 
@@ -231,5 +233,3 @@ Use Case: IPv6 Forwarding
 -------------------------
 
 The LPM algorithm is used to implement the Classless Inter-Domain Routing (CIDR) strategy used by routers implementing IP forwarding.
-
-.. |tbl24_tbl8_tbl8| image:: img/tbl24_tbl8_tbl8.*
doc/guides/prog_guide/lpm_lib.rst +4 -4
index 692e37f..c33e469 100644
@@ -90,9 +90,11 @@ Instead, this approach takes advantage of the fact that rules longer than 24 bit
 By splitting the process in two different tables/levels and limiting the number of tbl8s,
 we can greatly reduce memory consumption while maintaining a very good lookup speed (one memory access, most of the times).
 
-.. image39 has been renamed
 
-|tbl24_tbl8|
+.. figure:: img/tbl24_tbl8.*
+
+   Table split into different levels
+
 
 An entry in tbl24 contains the following fields:
 
@@ -219,5 +221,3 @@ References
 
 *   Pankaj Gupta, Algorithms for Routing Lookups and Packet Classification, PhD Thesis, Stanford University,
     2000  (`http://klamath.stanford.edu/~pankaj/thesis/ thesis_1sided.pdf <http://klamath.stanford.edu/~pankaj/thesis/%20thesis_1sided.pdf>`_ )
-
-.. |tbl24_tbl8| image:: img/tbl24_tbl8.*
doc/guides/prog_guide/malloc_lib.rst +3 -6
index b9298f8..6418fab 100644
@@ -117,13 +117,12 @@ The key fields of the heap structure and their function are described below (see
     since these are never touched except when they are to be freed again -
     at which point the pointer to the block is an input to the free() function.
 
-.. _pg_figure_3:
+.. _figure_malloc_heap:
 
-**Figure 3. Example of a malloc heap and malloc elements within the malloc library**
+.. figure:: img/malloc_heap.*
 
-.. image4_png has been renamed
+   Example of a malloc heap and malloc elements within the malloc library
 
-|malloc_heap|
 
 Structure: malloc_elem
 ^^^^^^^^^^^^^^^^^^^^^^
@@ -232,5 +231,3 @@ These next and previous elements are then checked to see if they too are free,
 and if so, they are merged with the current elements.
 This means that we can never have two free memory blocks adjacent to one another,
 they are always merged into a single block.
-
-.. |malloc_heap| image:: img/malloc_heap.*
doc/guides/prog_guide/mbuf_lib.rst +7 -13
index 338f7da..32a041e 100644
@@ -71,23 +71,21 @@ Message buffers may be used to carry control information, packets, events,
 and so on between different entities in the system.
 Message buffers may also use their buffer pointers to point to other message buffer data sections or other structures.
 
-Figure 8 and Figure 9 show some of these scenarios.
+:numref:`figure_mbuf1` and :numref:`figure_mbuf2` show some of these scenarios.
 
-.. _pg_figure_8:
+.. _figure_mbuf1:
 
-**Figure 8. An mbuf with One Segment**
+.. figure:: img/mbuf1.*
 
-.. image22_png  has been replaced
+   An mbuf with One Segment
 
-|mbuf1|
 
-.. _pg_figure_9:
+.. _figure_mbuf2:
 
-**Figure 9. An mbuf with Three Segments**
+.. figure:: img/mbuf2.*
 
-.. image23_png has been replaced
+   An mbuf with Three Segments
 
-|mbuf2|
 
 The Buffer Manager implements a fairly standard set of buffer access functions to manipulate network packets.
 
@@ -277,7 +275,3 @@ Use Cases
 ---------
 
 All networking application should use mbufs to transport network packets.
-
-.. |mbuf1| image:: img/mbuf1.*
-
-.. |mbuf2| image:: img/mbuf2.*
doc/guides/prog_guide/mempool_lib.rst +12 -20
index f9b7cfe..f0ca06f 100644
@@ -74,28 +74,27 @@ When running an application, the EAL command line options provide the ability to
 
     The command line must always have the number of memory channels specified for the processor.
 
-Examples of alignment for different DIMM architectures are shown in Figure 5 and Figure 6.
+Examples of alignment for different DIMM architectures are shown in
+:numref:`figure_memory-management` and :numref:`figure_memory-management2`.
 
-.. _pg_figure_5:
+.. _figure_memory-management:
 
-**Figure 5. Two Channels and Quad-ranked DIMM Example**
+.. figure:: img/memory-management.*
 
-.. image19_png has been replaced
+   Two Channels and Quad-ranked DIMM Example
 
-|memory-management|
 
 In this case, the assumption is that a packet is 16 blocks of 64 bytes, which is not true.
 
 The Intel® 5520 chipset has three channels, so in most cases,
 no padding is required between objects (except for objects whose size are n x 3 x 64 bytes blocks).
 
-.. _pg_figure_6:
+.. _figure_memory-management2:
 
-**Figure 6. Three Channels and Two Dual-ranked DIMM Example**
+.. figure:: img/memory-management2.*
 
-.. image20_png has been replaced
+   Three Channels and Two Dual-ranked DIMM Example
 
-|memory-management2|
 
 When creating a new pool, the user can specify to use this feature or not.
 
@@ -119,15 +118,14 @@ This cache can be enabled or disabled at creation of the pool.
 
 The maximum size of the cache is static and is defined at compilation time (CONFIG_RTE_MEMPOOL_CACHE_MAX_SIZE).
 
-Figure 7 shows a cache in operation.
+:numref:`figure_mempool` shows a cache in operation.
 
-.. _pg_figure_7:
+.. _figure_mempool:
 
-**Figure 7. A mempool in Memory with its Associated Ring**
+.. figure:: img/mempool.*
 
-.. image21_png has been replaced
+   A mempool in Memory with its Associated Ring
 
-|mempool|
 
 Use Cases
 ---------
@@ -140,9 +138,3 @@ Below are some examples:
 *   :ref:`Environment Abstraction Layer <Environment_Abstraction_Layer>` , for logging service
 
 *   Any application that needs to allocate fixed-sized objects in the data plane and that will be continuously utilized by the system.
-
-.. |memory-management| image:: img/memory-management.*
-
-.. |memory-management2| image:: img/memory-management2.*
-
-.. |mempool| image:: img/mempool.*
doc/guides/prog_guide/multi_proc_support.rst +3 -6
index 25a6056..6562f0d 100644
@@ -83,13 +83,12 @@ and point to the same objects, in both processes.
     Refer to Section 23.3 "Multi-process Limitations" for details of
     how Linux kernel Address-Space Layout Randomization (ASLR) can affect memory sharing.
 
-.. _pg_figure_16:
+.. _figure_multi_process_memory:
 
-**Figure 16. Memory Sharing in the DPDK Multi-process Sample Application**
+.. figure:: img/multi_process_memory.*
 
-.. image42_png has been replaced
+   Memory Sharing in the DPDK Multi-process Sample Application
 
-|multi_process_memory|
 
 The EAL also supports an auto-detection mode (set by EAL --proc-type=auto flag ),
 whereby an DPDK process is started as a secondary instance if a primary instance is already running.
@@ -199,5 +198,3 @@ instead of the functions which do the hashing internally, such as rte_hash_add()
     which means that only the first, primary DPDK process instance can open and mmap  /dev/hpet.
     If the number of required DPDK processes exceeds that of the number of available HPET comparators,
     the TSC (which is the default timer in this release) must be used as a time source across all processes instead of the HPET.
-
-.. |multi_process_memory| image:: img/multi_process_memory.*
doc/guides/prog_guide/overview.rst +3 -6
index 062d923..cef6ca7 100644
@@ -120,13 +120,12 @@ Core Components
 The *core components* are a set of libraries that provide all the elements needed
 for high-performance packet processing applications.
 
-.. _pg_figure_1:
+.. _figure_architecture-overview:
 
-**Figure 1. Core Components Architecture**
+.. figure:: img/architecture-overview.*
 
-.. image2_png has been replaced
+   Core Components Architecture
 
-|architecture-overview|
 
 Memory Manager (librte_malloc)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -203,5 +202,3 @@ librte_net
 The librte_net library is a collection of IP protocol definitions and convenience macros.
 It is based on code from the FreeBSD* IP stack and contains protocol numbers (for use in IP headers),
 IP-related macros, IPv4/IPv6 header structures and TCP, UDP and SCTP header structures.
-
-.. |architecture-overview| image:: img/architecture-overview.*
doc/guides/prog_guide/packet_distrib_lib.rst +8 -7
index 767accc..b5bdabb 100644
@@ -38,7 +38,10 @@ which is responsible for load balancing or distributing packets,
 and a set of worker lcores which are responsible for receiving the packets from the distributor and operating on them.
 The model of operation is shown in the diagram below.
 
-|packet_distributor1|
+.. figure:: img/packet_distributor1.*
+
+   Packet Distributor mode of operation
+
 
 Distributor Core Operation
 --------------------------
@@ -91,9 +94,11 @@ No packet ordering guarantees are made about packets which do not share a common
 Using the process and returned_pkts API, the following application workflow can be used,
 while allowing packet order within a packet flow -- identified by a tag -- to be maintained.
 
-.. image41_png has been renamed
 
-|packet_distributor2|
+.. figure:: img/packet_distributor2.*
+
+   Application workflow
+
 
 The flush and clear_returns API calls, mentioned previously,
 are likely of less use that the process and returned_pkts APIS, and are principally provided to aid in unit testing of the library.
@@ -110,7 +115,3 @@ Since it may be desirable to vary the number of worker cores, depending on the t
 i.e. to save power at times of lighter load,
 it is possible to have a worker stop processing packets by calling "rte_distributor_return_pkt()" to indicate that
 it has finished the current packet and does not want a new one.
-
-.. |packet_distributor1| image:: img/packet_distributor1.*
-
-.. |packet_distributor2| image:: img/packet_distributor2.*
doc/guides/prog_guide/packet_framework.rst +33 -48

155 lines not on this page · raw message

doc/guides/prog_guide/qos_framework.rst +49 -114

333 lines not on this page · raw message

doc/guides/prog_guide/ring_lib.rst +91 -68

265 lines not on this page · raw message

doc/guides/sample_app_ug/dist_app.rst +9 -11
index 56195bb..3c9a991 100644
@@ -47,11 +47,12 @@ into each other.
 This application can be used to benchmark performance using the traffic
 generator as shown in the figure below.
 
-.. _figure_22:
+.. _figure_dist_perf:
 
-**Figure 22. Performance Benchmarking Setup (Basic Environment)**
+.. figure:: img/dist_perf.*
+
+   Performance Benchmarking Setup (Basic Environment)
 
-|dist_perf|
 
 Compiling the Application
 -------------------------
@@ -106,7 +107,7 @@ Explanation
 The distributor application consists of three types of threads: a receive
 thread (lcore_rx()), a set of worker threads(lcore_worker())
 and a transmit thread(lcore_tx()). How these threads work together is shown
-in Fig2 below. The main() function launches  threads of these three types.
+in :numref:`figure_dist_app` below. The main() function launches  threads of these three types.
 Each thread has a while loop which will be doing processing and which is
 terminated only upon SIGINT or ctrl+C. The receive and transmit threads
 communicate using a software ring (rte_ring structure).
@@ -136,11 +137,12 @@ Users who wish to terminate the running of the application have to press ctrl+C
 in the application will terminate all running threads gracefully and print
 final statistics to the user.
 
-.. _figure_23:
+.. _figure_dist_app:
+
+.. figure:: img/dist_app.*
 
-**Figure 23. Distributor Sample Application Layout**
+   Distributor Sample Application Layout
 
-|dist_app|
 
 Debug Logging Support
 ---------------------
@@ -171,7 +173,3 @@ Sample Application. See Section 9.4.4, "RX Queue Initialization".
 
 TX queue initialization is done in the same way as it is done in the L2 Forwarding
 Sample Application. See Section 9.4.5, "TX Queue Initialization".
-
-.. |dist_perf| image:: img/dist_perf.*
-
-.. |dist_app| image:: img/dist_app.*
doc/guides/sample_app_ug/exception_path.rst +3 -5
index 6c06959..3cc7cbe 100644
@@ -46,13 +46,12 @@ The second thread reads from a TAP interface and writes the data unmodified to t
 
 The packet flow through the exception path application is as shown in the following figure.
 
-.. _figure_1:
+.. _figure_exception_path_example:
 
-**Figure 1. Packet Flow**
+.. figure:: img/exception_path_example.*
 
-.. image2_png has been replaced
+   Packet Flow
 
-|exception_path_example|
 
 To make throughput measurements, kernel bridges must be setup to forward data between the bridges appropriately.
 
@@ -327,4 +326,3 @@ To remove bridges and persistent TAP interfaces, the following commands are used
     brctl delbr br0
     openvpn --rmtun --dev tap_dpdk_00
 
-.. |exception_path_example| image:: img/exception_path_example.*
doc/guides/sample_app_ug/index.rst +32 -26

89 lines not on this page · raw message

doc/guides/sample_app_ug/intel_quickassist.rst +4 -7
index 7f55282..a80d4ca 100644
@@ -46,17 +46,16 @@ For this sample application, there is a dependency on either of:
 Overview
 --------
 
-An overview of the application is provided in Figure 11.
+An overview of the application is provided in :numref:`figure_quickassist_block_diagram`.
 For simplicity, only two NIC ports and one Intel® QuickAssist Technology device are shown in this diagram,
 although the number of NIC ports and Intel® QuickAssist Technology devices can be different.
 
-.. _figure_11:
+.. _figure_quickassist_block_diagram:
 
-**Figure 11. Intel® QuickAssist Technology Application Block Diagram**
+.. figure:: img/quickassist_block_diagram.*
 
-.. image14_png has been renamed
+   Intel® QuickAssist Technology Application Block Diagram
 
-|quickassist_block_diagram|
 
 The application allows the configuration of the following items:
 
@@ -220,5 +219,3 @@ performing AES-CBC-128 encryption with AES-XCBC-MAC-96 hash, the following setti
 
 Refer to the *DPDK Test Report* for more examples of traffic generator setup and the application startup command lines.
 If no errors are generated in response to the startup commands, the application is running correctly.
-
-.. |quickassist_block_diagram| image:: img/quickassist_block_diagram.*
doc/guides/sample_app_ug/kernel_nic_interface.rst +3 -6
index d6876e2..02dde59 100644
@@ -71,13 +71,12 @@ it is just for performance testing, or it can work together with VMDq support in
 
 The packet flow through the Kernel NIC Interface application is as shown in the following figure.
 
-.. _figure_2:
+.. _figure_kernel_nic:
 
-**Figure 2. Kernel NIC Application Packet Flow**
+.. figure:: img/kernel_nic.*
 
-.. image3_png has been renamed to kernel_nic.*
+   Kernel NIC Application Packet Flow
 
-|kernel_nic|
 
 Compiling the Application
 -------------------------
@@ -616,5 +615,3 @@ Currently, setting a new MTU and configuring the network interface (up/ down) ar
             RTE_LOG(ERR, APP, "Failed to start port %d\n", port_id);
         return ret;
     }
-
-.. |kernel_nic| image:: img/kernel_nic.*
doc/guides/sample_app_ug/l2_forward_job_stats.rst +8 -15
index 10dfecb..6cbf627 100644
@@ -55,27 +55,24 @@ Also, the MAC addresses are affected as follows:
 
 *   The destination MAC address is replaced by  02:00:00:00:00:TX_PORT_ID
 
-This application can be used to benchmark performance using a traffic-generator, as shown in the Figure 3.
+This application can be used to benchmark performance using a traffic-generator, as shown in the :numref:`figure_l2_fwd_benchmark_setup_jobstats`.
 
-The application can also be used in a virtualized environment as shown in Figure 4.
+The application can also be used in a virtualized environment as shown in :numref:`figure_l2_fwd_virtenv_benchmark_setup_jobstats`.
 
 The L2 Forwarding application can also be used as a starting point for developing a new application based on the DPDK.
 
-.. _figure_3:
+.. _figure_l2_fwd_benchmark_setup_jobstats:
 
-**Figure 3. Performance Benchmark Setup (Basic Environment)**
+.. figure:: img/l2_fwd_benchmark_setup.*
 
-.. image4_png has been replaced
+   Performance Benchmark Setup (Basic Environment)
 
-|l2_fwd_benchmark_setup|
+.. _figure_l2_fwd_virtenv_benchmark_setup_jobstats:
 
-.. _figure_4:
+.. figure:: img/l2_fwd_virtenv_benchmark_setup.*
 
-**Figure 4. Performance Benchmark Setup (Virtualized Environment)**
+   Performance Benchmark Setup (Virtualized Environment)
 
-.. image5_png has been renamed
-
-|l2_fwd_virtenv_benchmark_setup|
 
 Virtual Function Setup Instructions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -631,7 +628,3 @@ however it improves performance:
          * in which it was called. */
         rte_jobstats_finish(&qconf->flush_job, qconf->flush_job.target);
     }
-
-.. |l2_fwd_benchmark_setup| image:: img/l2_fwd_benchmark_setup.*
-
-.. |l2_fwd_virtenv_benchmark_setup| image:: img/l2_fwd_virtenv_benchmark_setup.*
doc/guides/sample_app_ug/l2_forward_real_virtual.rst +8 -14
index 234d71d..9334e75 100644
@@ -54,27 +54,25 @@ Also, the MAC addresses are affected as follows:
 
 *   The destination MAC address is replaced by  02:00:00:00:00:TX_PORT_ID
 
-This application can be used to benchmark performance using a traffic-generator, as shown in the Figure 3.
+This application can be used to benchmark performance using a traffic-generator, as shown in the :numref:`figure_l2_fwd_benchmark_setup`.
 
-The application can also be used in a virtualized environment as shown in Figure 4.
+The application can also be used in a virtualized environment as shown in :numref:`figure_l2_fwd_virtenv_benchmark_setup`.
 
 The L2 Forwarding application can also be used as a starting point for developing a new application based on the DPDK.
 
-.. _figure_3:
+.. _figure_l2_fwd_benchmark_setup:
 
-**Figure 3. Performance Benchmark Setup (Basic Environment)**
+.. figure:: img/l2_fwd_benchmark_setup.*
 
-.. image4_png has been replaced
+   Performance Benchmark Setup (Basic Environment)
 
-|l2_fwd_benchmark_setup|
 
-.. _figure_4:
+.. _figure_l2_fwd_virtenv_benchmark_setup:
 
-**Figure 4. Performance Benchmark Setup (Virtualized Environment)**
+.. figure:: img/l2_fwd_virtenv_benchmark_setup.*
 
-.. image5_png has been renamed
+   Performance Benchmark Setup (Virtualized Environment)
 
-|l2_fwd_virtenv_benchmark_setup|
 
 Virtual Function Setup Instructions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -526,7 +524,3 @@ however it improves performance:
 
         prev_tsc = cur_tsc;
     }
-
-.. |l2_fwd_benchmark_setup| image:: img/l2_fwd_benchmark_setup.*
-
-.. |l2_fwd_virtenv_benchmark_setup| image:: img/l2_fwd_virtenv_benchmark_setup.*
doc/guides/sample_app_ug/l3_forward_access_ctrl.rst +9 -12
index 73fa4df..dbf47c7 100644
@@ -142,9 +142,13 @@ Other lines types are considered invalid.
 
 *   A typical IPv4 ACL rule line should have a format as shown below:
 
-.. image6_png has been renamed
 
-|ipv4_acl_rule|
+.. _figure_ipv4_acl_rule:
+
+.. figure:: img/ipv4_acl_rule.*
+
+   A typical IPv4 ACL rule
+
 
 IPv4 addresses are specified in CIDR format as specified in RFC 4632.
 They consist of the dot notation for the address and a prefix length separated by '/'.
@@ -164,15 +168,12 @@ For example: 6/0xfe matches protocol values 6 and 7.
 Rules File Example
 ~~~~~~~~~~~~~~~~~~
 
-.. _figure_5_1:
+.. _figure_example_rules:
 
-Figure 5 is an example of a rules file. This file has three rules, one for ACL and two for route information.
+.. figure:: img/example_rules.*
 
-**Figure 5.Example Rules File**
+   Rules example
 
-.. image7_png has been renamed
-
-|example_rules|
 
 Each rule is explained as follows:
 
@@ -397,7 +398,3 @@ Finally, the application creates contexts handler from the ACL library,
 adds rules parsed from the file into the database and build an ACL trie.
 It is important to note that the application creates an independent copy of each database for each socket CPU
 involved in the task to reduce the time for remote memory access.
-
-.. |ipv4_acl_rule| image:: img/ipv4_acl_rule.*
-
-.. |example_rules| image:: img/example_rules.*
doc/guides/sample_app_ug/load_balancer.rst +3 -6
index 3b32bdc..615826a 100644
@@ -44,13 +44,12 @@ Overview
 
 The architecture of the Load Balance application is presented in the following figure.
 
-.. _figure_5:
+.. _figure_load_bal_app_arch:
 
-**Figure 5. Load Balancer Application Architecture**
+.. figure:: img/load_bal_app_arch.*
 
-.. image8_png has been renamed
+   Load Balancer Application Architecture
 
-|load_bal_app_arch|
 
 For the sake of simplicity, the diagram illustrates a specific case of two I/O RX and two I/O TX lcores off loading the packet I/O
 overhead incurred by four NIC ports from four worker cores, with each I/O lcore handling RX/TX for two NIC ports.
@@ -241,5 +240,3 @@ are on the same or different CPU sockets, the following run-time scenarios are p
 #.  ABC: The packet is received on socket A, it is processed by an lcore on socket B,
     then it has to be transmitted out by a NIC connected to socket C.
     The performance price for crossing the CPU socket boundary is paid twice for this packet.
-
-.. |load_bal_app_arch| image:: img/load_bal_app_arch.*
doc/guides/sample_app_ug/multi_process.rst +12 -24
index 9ed450b..dc287af 100644
@@ -190,13 +190,12 @@ such as a client-server mode of operation seen in the next example,
 where different processes perform different tasks, yet co-operate to form a packet-processing system.)
 The following diagram shows the data-flow through the application, using two processes.
 
-.. _figure_6:
+.. _figure_sym_multi_proc_app:
 
-**Figure 6. Example Data Flow in a Symmetric Multi-process Application**
+.. figure:: img/sym_multi_proc_app.*
 
-.. image9_png has been renamed
+   Example Data Flow in a Symmetric Multi-process Application
 
-|sym_multi_proc_app|
 
 As the diagram shows, each process reads packets from each of the network ports in use.
 RSS is used to distribute incoming packets on each port to different hardware RX queues.
@@ -296,13 +295,12 @@ In this case, the client applications just perform level-2 forwarding of packets
 
 The following diagram shows the data-flow through the application, using two client processes.
 
-.. _figure_7:
+.. _figure_client_svr_sym_multi_proc_app:
 
-**Figure 7. Example Data Flow in a Client-Server Symmetric Multi-process Application**
+.. figure:: img/client_svr_sym_multi_proc_app.*
 
-.. image10_png has been renamed
+   Example Data Flow in a Client-Server Symmetric Multi-process Application
 
-|client_svr_sym_multi_proc_app|
 
 Running the Application
 ^^^^^^^^^^^^^^^^^^^^^^^
@@ -395,13 +393,12 @@ Once the master process begins to run, it tries to initialize all the resources
 memory, CPU cores, driver, ports, and so on, as the other examples do.
 Thereafter, it creates slave processes, as shown in the following figure.
 
-.. _figure_8:
+.. _figure_master_slave_proc:
 
-**Figure 8. Master-slave Process Workflow**
+.. figure:: img/master_slave_proc.*
 
-.. image11_png has been renamed
+   Master-slave Process Workflow
 
-|master_slave_proc|
 
 The master process calls the rte_eal_mp_remote_launch() EAL function to launch an application function for each pinned thread through the pipe.
 Then, it waits to check if any slave processes have exited.
@@ -475,13 +472,12 @@ Therefore, to provide the capability to resume the new slave instance if the pre
 
 The following diagram describes slave process recovery.
 
-.. _figure_9:
+.. _figure_slave_proc_recov:
 
-**Figure 9. Slave Process Recovery Process Flow**
+.. figure:: img/slave_proc_recov.*
 
-.. image12_png has been renamed
+   Slave Process Recovery Process Flow
 
-|slave_proc_recov|
 
 Floating Process Support
 ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -774,11 +770,3 @@ so it remaps the resource to the new core ID slot.
         }
         return 0;
     }
-
-.. |sym_multi_proc_app| image:: img/sym_multi_proc_app.*
-
-.. |client_svr_sym_multi_proc_app| image:: img/client_svr_sym_multi_proc_app.*
-
-.. |master_slave_proc| image:: img/master_slave_proc.*
-
-.. |slave_proc_recov| image:: img/slave_proc_recov.*
doc/guides/sample_app_ug/qos_scheduler.rst +3 -6
index 56326df..66c261c 100644
@@ -38,13 +38,12 @@ Overview
 
 The architecture of the QoS scheduler application is shown in the following figure.
 
-.. _figure_10:
+.. _figure_qos_sched_app_arch:
 
-**Figure 10. QoS Scheduler Application Architecture**
+.. figure:: img/qos_sched_app_arch.*
 
-.. image13_png has been renamed
+   QoS Scheduler Application Architecture
 
-|qos_sched_app_arch|
 
 There are two flavors of the runtime execution for this application,
 with two or three threads per each packet flow configuration being used.
@@ -347,5 +346,3 @@ This application classifies based on the QinQ double VLAN tags and the IP destin
 +----------------+-------------------------+--------------------------------------------------+----------------------------------+
 
 Please refer to the "QoS Scheduler" chapter in the *DPDK Programmer's Guide* for more information about these parameters.
-
-.. |qos_sched_app_arch| image:: img/qos_sched_app_arch.*
doc/guides/sample_app_ug/quota_watermark.rst +12 -24
index 4274223..c56683a 100644
@@ -54,15 +54,14 @@ and ports 2 and 3 forward into each other.
 The MAC addresses of the forwarded Ethernet frames are not affected.
 
 Internally, packets are pulled from the ports by the master logical core and put on a variable length processing pipeline,
-each stage of which being connected by rings, as shown in Figure 12.
+each stage of which being connected by rings, as shown in :numref:`figure_pipeline_overview`.
 
-.. _figure_12:
+.. _figure_pipeline_overview:
 
-**Figure 12. Pipeline Overview**
+.. figure:: img/pipeline_overview.*
 
-.. image15_png has been renamed
+   Pipeline Overview
 
-|pipeline_overview|
 
 An adjustable quota value controls how many packets are being moved through the pipeline per enqueue and dequeue.
 Adjustable watermark values associated with the rings control a back-off mechanism that
@@ -79,15 +78,14 @@ eventually lead to an Ethernet flow control frame being send to the source.
 
 On top of serving as an example of quota and watermark usage,
 this application can be used to benchmark ring based processing pipelines performance using a traffic- generator,
-as shown in Figure 13.
+as shown in :numref:`figure_ring_pipeline_perf_setup`.
 
-.. _figure_13:
+.. _figure_ring_pipeline_perf_setup:
 
-**Figure 13. Ring-based Processing Pipeline Performance Setup**
+.. figure:: img/ring_pipeline_perf_setup.*
 
-.. image16_png has been renamed
+   Ring-based Processing Pipeline Performance Setup
 
-|ring_pipeline_perf_setup|
 
 Compiling the Application
 -------------------------
@@ -311,7 +309,7 @@ Logical Cores Assignment
 The application uses the master logical core to poll all the ports for new packets and enqueue them on a ring associated with the port.
 
 Each logical core except the last runs pipeline_stage() after a ring for each used port is initialized on that core.
-pipeline_stage() on core X dequeues packets from core X-1's rings and enqueue them on its own rings. See Figure 14.
+pipeline_stage() on core X dequeues packets from core X-1's rings and enqueue them on its own rings. See :numref:`figure_threads_pipelines`.
 
 .. code-block:: c
 
@@ -340,16 +338,12 @@ sending them out on the destination port setup by pair_ports().
 Receive, Process and Transmit Packets
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. _figure_14:
+.. _figure_threads_pipelines:
 
-Figure 14 shows where each thread in the pipeline is.
-It should be used as a reference while reading the rest of this section.
+.. figure:: img/threads_pipelines.*
 
-**Figure 14. Threads and Pipelines**
+   Threads and Pipelines
 
-.. image17_png has been renamed
-
-|threads_pipelines|
 
 In the receive_stage() function running on the master logical core,
 the main task is to read ingress packets from the RX ports and enqueue them
@@ -498,9 +492,3 @@ low_watermark from the rte_memzone previously created by qw.
 
         low_watermark = (unsigned int *) qw_memzone->addr + sizeof(int);
     }
-
-.. |pipeline_overview| image:: img/pipeline_overview.*
-
-.. |ring_pipeline_perf_setup| image:: img/ring_pipeline_perf_setup.*
-
-.. |threads_pipelines| image:: img/threads_pipelines.*
doc/guides/sample_app_ug/test_pipeline.rst +3 -6
index 46aa6d5..3c2c25b 100644
@@ -49,13 +49,12 @@ The application uses three CPU cores:
 
 *   Core C ("TX core") receives traffic from core B through software queues and sends it to the NIC ports for transmission.
 
-.. _figure_21:
+.. _figure_test_pipeline_app:
 
-**Figure 21.Test Pipeline Application**
+.. figure:: img/test_pipeline_app.*
 
-.. image24_png has been renamed
+   Test Pipeline Application
 
-|test_pipeline_app|
 
 Compiling the Application
 -------------------------
@@ -281,5 +280,3 @@ The profile for input traffic is TCP/IPv4 packets with:
 *   destination TCP port fixed to 0
 
 *   source TCP port fixed to 0
-
-.. |test_pipeline_app| image:: img/test_pipeline_app.*
doc/guides/sample_app_ug/vhost.rst +15 -30

90 lines not on this page · raw message

doc/guides/sample_app_ug/vm_power_management.rst +8 -10
index dd6e1e8..da8be12 100644
@@ -74,11 +74,12 @@ The solution is comprised of two high-level components:
    The l3fwd-power application will use this implementation when deployed on a VM
    (see Chapter 11 "L3 Forwarding with Power Management Application").
 
-.. _figure_24:
+.. _figure_vm_power_mgr_highlevel:
 
-**Figure 24. Highlevel Solution**
+.. figure:: img/vm_power_mgr_highlevel.*
+
+   Highlevel Solution
 
-|vm_power_mgr_highlevel|
 
 Overview
 --------
@@ -105,11 +106,12 @@ at runtime based on the environment.
 Upon receiving a request, the host translates the vCPU to a pCPU via
 the libvirt API before forwarding to the host librte_power.
 
-.. _figure_25:
+.. _figure_vm_power_mgr_vm_request_seq:
+
+.. figure:: img/vm_power_mgr_vm_request_seq.*
 
-**Figure 25. VM request to scale frequency**
+   VM request to scale frequency
 
-|vm_power_mgr_vm_request_seq|
 
 Performance Considerations
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -355,7 +357,3 @@ Where {core_num} is the lcore and channel to change frequency by scaling up/down
 .. code-block:: console
 
   set_cpu_freq {core_num} up|down|min|max
-
-.. |vm_power_mgr_highlevel| image:: img/vm_power_mgr_highlevel.*
-
-.. |vm_power_mgr_vm_request_seq| image:: img/vm_power_mgr_vm_request_seq.*
doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst +4 -7
index 9fc1fd5..6fb0f0b 100644
@@ -53,7 +53,7 @@ All traffic is read from a single incoming port (port 0) and output on port 1, w
 The traffic is split into 128 queues on input, where each thread of the application reads from multiple queues.
 For example, when run with 8 threads, that is, with the -c FF option, each thread receives and forwards packets from 16 queues.
 
-As supplied, the sample application configures the VMDQ feature to have 16 pools with 8 queues each as indicated in Figure 15.
+As supplied, the sample application configures the VMDQ feature to have 16 pools with 8 queues each as indicated in :numref:`figure_vmdq_dcb_example`.
 The Intel® 82599 10 Gigabit Ethernet Controller NIC also supports the splitting of traffic into 32 pools of 4 queues each and
 this can be used by changing the NUM_POOLS parameter in the supplied code.
 The NUM_POOLS parameter can be passed on the command line, after the EAL parameters:
@@ -64,13 +64,12 @@ The NUM_POOLS parameter can be passed on the command line, after the EAL paramet
 
 where, NP can be 16 or 32.
 
-.. _figure_15:
+.. _figure_vmdq_dcb_example:
 
-**Figure 15. Packet Flow Through the VMDQ and DCB Sample Application**
+.. figure:: img/vmdq_dcb_example.*
 
-.. image18_png has been replaced
+   Packet Flow Through the VMDQ and DCB Sample Application
 
-|vmdq_dcb_example|
 
 In Linux* user space, the application can display statistics with the number of packets received on each queue.
 To have the application display the statistics, send a SIGHUP signal to the running application process, as follows:
@@ -247,5 +246,3 @@ To generate the statistics output, use the following command:
 
 Please note that the statistics output will appear on the terminal where the vmdq_dcb_app is running,
 rather than the terminal from which the HUP signal was sent.
-
-.. |vmdq_dcb_example| image:: img/vmdq_dcb_example.*
doc/guides/xen/pkt_switch.rst +18 -12
index a9eca52..3a6fc47 100644
@@ -52,9 +52,13 @@ The switching back end maps those grant table references and creates shared ring
 
 The following diagram describes the functionality of the DPDK Xen Packet- Switching Solution.
 
-.. image35_png has been renamed
 
-|dpdk_xen_pkt_switch|
+.. _figure_dpdk_xen_pkt_switch:
+
+.. figure:: img/dpdk_xen_pkt_switch.*
+
+   Functionality of the DPDK Xen Packet Switching Solution.
+
 
 Note 1 The Xen hypervisor uses a mechanism called a Grant Table to share memory between domains
 (`http://wiki.xen.org/wiki/Grant Table <http://wiki.xen.org/wiki/Grant%20Table>`_).
@@ -62,9 +66,13 @@ Note 1 The Xen hypervisor uses a mechanism called a Grant Table to share memory
 A diagram of the design is shown below, where "gva" is the Guest Virtual Address,
 which is the data pointer of the mbuf, and "hva" is the Host Virtual Address:
 
-.. image36_png has been renamed
 
-|grant_table|
+.. _figure_grant_table:
+
+.. figure:: img/grant_table.*
+
+   DPDK Xen Layout
+
 
 In this design, a Virtio ring is used as a para-virtualized interface for better performance over a Xen private ring
 when packet switching to and from a VM.
@@ -139,9 +147,13 @@ Take idx#_mempool_gref node for example, the host maps those Grant references to
 The real Grant reference information is stored in this virtual address space,
 where (gref, pfn) pairs follow each other with -1 as the terminator.
 
-.. image37_pnng has been renamed
 
-|grant_refs|
+.. _figure_grant_refs:
+
+.. figure:: img/grant_refs.*
+
+   Mapping Grant references to a continuous virtual address space
+
 
 After all gref# IDs are retrieved, the host maps them to a continuous virtual address space.
 With the guest mempool virtual address, the host establishes 1:1 address mapping.
@@ -456,9 +468,3 @@ then sent out through hardware with destination MAC address 00:00:00:00:00:33.
 The packet flow is:
 
 packet generator->Virtio in guest VM1->switching backend->Virtio in guest VM2->switching backend->wire
-
-.. |grant_table| image:: img/grant_table.*
-
-.. |grant_refs| image:: img/grant_refs.*
-
-.. |dpdk_xen_pkt_switch| image:: img/dpdk_xen_pkt_switch.*
Signature · 1 line
1.8.1.4
#14 lore raw

PATCH v3 2/3 doc: refactored table numbers into references

In reply to John McNamara

This change adds automatic table references to the docs. The table numbers in the generated Html and PDF docs are now automatically numbered based on section.

Requires Sphinx >= 1.3.1.

This change:

* Adds a RST table:: directive to each table caption.

* Indents the tables to the required directive level.

---
 doc/guides/prog_guide/index.rst            |   70 +-
 doc/guides/prog_guide/packet_framework.rst | 1164 +++++++++++------------
 doc/guides/prog_guide/qos_framework.rst    | 1372 ++++++++++++++--------------
 doc/guides/sample_app_ug/index.rst         |    6 +-
 doc/guides/sample_app_ug/qos_metering.rst  |   46 +-
 doc/guides/sample_app_ug/qos_scheduler.rst |   46 +-
 doc/guides/sample_app_ug/test_pipeline.rst |  304 +++---
 7 files changed, 1503 insertions(+), 1505 deletions(-)
doc/guides/prog_guide/index.rst +34 -36
index 9a1e337..3295661 100644
@@ -174,72 +174,70 @@ Programmer's Guide
 
 **Tables**
 
-:ref:`Table 1. Packet Processing Pipeline Implementing QoS <pg_table_1>`
+:numref:`table_qos_1` :ref:`table_qos_1`
 
-:ref:`Table 2. Infrastructure Blocks Used by the Packet Processing Pipeline <pg_table_2>`
+:numref:`table_qos_2` :ref:`table_qos_2`
 
-:ref:`Table 3. Port Scheduling Hierarchy <pg_table_3>`
+:numref:`table_qos_3` :ref:`table_qos_3`
 
-:ref:`Table 4. Scheduler Internal Data Structures per Port <pg_table_4>`
+:numref:`table_qos_4` :ref:`table_qos_4`
 
-:ref:`Table 5. Ethernet Frame Overhead Fields <pg_table_5>`
+:numref:`table_qos_5` :ref:`table_qos_5`
 
-:ref:`Table 6. Token Bucket Generic Operations <pg_table_6>`
+:numref:`table_qos_6` :ref:`table_qos_6`
 
-:ref:`Table 7. Token Bucket Generic Parameters <pg_table_7>`
+:numref:`table_qos_7` :ref:`table_qos_7`
 
-:ref:`Table 8. Token Bucket Persistent Data Structure <pg_table_8>`
+:numref:`table_qos_8` :ref:`table_qos_8`
 
-:ref:`Table 9. Token Bucket Operations <pg_table_9>`
+:numref:`table_qos_9` :ref:`table_qos_9`
 
-:ref:`Table 10. Subport/Pipe Traffic Class Upper Limit Enforcement Persistent Data Structure <pg_table_10>`
+:numref:`table_qos_10` :ref:`table_qos_10`
 
-:ref:`Table 11. Subport/Pipe Traffic Class Upper Limit Enforcement Operations <pg_table_11>`
+:numref:`table_qos_11` :ref:`table_qos_11`
 
-:ref:`Table 12. Weighted Round Robin (WRR) <pg_table_12>`
+:numref:`table_qos_12` :ref:`table_qos_12`
 
-:ref:`Table 13. Subport Traffic Class Oversubscription <pg_table_13>`
+:numref:`table_qos_13` :ref:`table_qos_13`
 
-:ref:`Table 14. Watermark Propagation from Subport Level to Member Pipes at the Beginning of Each Traffic Class Upper Limit Enforcement Period <pg_table_14>`
+:numref:`table_qos_14` :ref:`table_qos_14`
 
-:ref:`Table 15. Watermark Calculation <pg_table_15>`
+:numref:`table_qos_15` :ref:`table_qos_15`
 
-:ref:`Table 16. RED Configuration Parameters <pg_table_16>`
+:numref:`table_qos_16` :ref:`table_qos_16`
 
-:ref:`Table 17. Relative Performance of Alternative Approaches <pg_table_17>`
+:numref:`table_qos_17` :ref:`table_qos_17`
 
-:ref:`Table 18. RED Configuration Corresponding to RED Configuration File <pg_table_18>`
+:numref:`table_qos_18` :ref:`table_qos_18`
 
-:ref:`Table 19. Port types <pg_table_19>`
+:numref:`table_qos_19` :ref:`table_qos_19`
 
-:ref:`Table 20. Port abstract interface <pg_table_20>`
+:numref:`table_qos_20` :ref:`table_qos_20`
 
-:ref:`Table 21. Table types <pg_table_21>`
+:numref:`table_qos_21` :ref:`table_qos_21`
 
-:ref:`Table 29. Table Abstract Interface <pg_table_29_1>`
+:numref:`table_qos_22` :ref:`table_qos_22`
 
-:ref:`Table 22. Configuration parameters common for all hash table types <pg_table_22>`
+:numref:`table_qos_23` :ref:`table_qos_23`
 
-:ref:`Table 23. Configuration parameters specific to extendable bucket hash table <pg_table_23>`
+:numref:`table_qos_24` :ref:`table_qos_24`
 
-:ref:`Table 24. Configuration parameters specific to pre-computed key signature hash table <pg_table_24>`
+:numref:`table_qos_25` :ref:`table_qos_25`
 
-:ref:`Table 25. The main large data structures (arrays) used for configurable key size hash tables <pg_table_25>`
+:numref:`table_qos_26` :ref:`table_qos_26`
 
-:ref:`Table 26. Field description for bucket array entry (configurable key size hash tables) <pg_table_26>`
+:numref:`table_qos_27` :ref:`table_qos_27`
 
-:ref:`Table 27. Description of the bucket search pipeline stages (configurable key size hash tables) <pg_table_27>`
+:numref:`table_qos_28` :ref:`table_qos_28`
 
-:ref:`Table 28. Lookup tables for match, match_many, match_pos <pg_table_28>`
+:numref:`table_qos_29` :ref:`table_qos_29`
 
-:ref:`Table 29. Collapsed lookup tables for match, match_many and match_pos <pg_table_29>`
+:numref:`table_qos_30` :ref:`table_qos_30`
 
-:ref:`Table 30. The main large data structures (arrays) used for 8-byte and 16-byte key size hash tables <pg_table_30>`
+:numref:`table_qos_31` :ref:`table_qos_31`
 
-:ref:`Table 31. Field description for bucket array entry (8-byte and 16-byte key hash tables) <pg_table_31>`
+:numref:`table_qos_32` :ref:`table_qos_32`
 
-:ref:`Table 32. Description of the bucket search pipeline stages (8-byte and 16-byte key hash tables) <pg_table_32>`
+:numref:`table_qos_33` :ref:`table_qos_33`
 
-:ref:`Table 33. Next hop actions (reserved) <pg_table_33>`
-
-:ref:`Table 34. User action examples <pg_table_34>`
+:numref:`table_qos_34` :ref:`table_qos_34`
doc/guides/prog_guide/packet_framework.rst +582 -582

1,274 lines not on this page · raw message

doc/guides/prog_guide/qos_framework.rst +686 -686

1,457 lines not on this page · raw message

doc/guides/sample_app_ug/index.rst +3 -3
index 745a7ac..e1a0c56 100644
@@ -134,8 +134,8 @@ Sample Applications User Guide
 
 **Tables**
 
-:ref:`Table 1.Output Traffic Marking <table_1>`
+:numref:`table_qos_metering_1` :ref:`table_qos_metering_1`
 
-:ref:`Table 2.Entity Types <table_2>`
+:numref:`table_qos_scheduler_1` :ref:`table_qos_scheduler_1`
 
-:ref:`Table 3.Table Types <table_3>`
+:numref:`table_test_pipeline_1` :ref:`table_test_pipeline_1`
doc/guides/sample_app_ug/qos_metering.rst +23 -23

52 lines not on this page · raw message

doc/guides/sample_app_ug/qos_scheduler.rst +23 -23

51 lines not on this page · raw message

doc/guides/sample_app_ug/test_pipeline.rst +152 -152

49 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.1.4

Part of the diff is not shown here. View the raw message.

#15 lore raw

PATCH v3 3/3 doc: add sphinx numref compatibility workaround

In reply to John McNamara

This change adds some simple handling for the :numref: directive for Sphinx versions prior to 1.3.1. This allows the Guides documentation to be built with older versions of Sphinx and still produce reasonable results.

The patch replaces the :numref: reference with a link to the target (for all Sphinx doc types). It doesn't try to label figures/tables.

Full numref support with automatic figure/table numbering and links can be obtained by upgrading to Sphinx 1.3.1 or later.

---
 doc/guides/conf.py | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
doc/guides/conf.py +80 -0
index 1bc031f..cab97ac 100644
@@ -31,6 +31,9 @@
 import subprocess
 from sphinx.highlighting import PygmentsBridge
 from pygments.formatters.latex import LatexFormatter
+from docutils import nodes
+from distutils.version import LooseVersion
+from sphinx import __version__ as sphinx_version
 
 project = 'DPDK'
 
@@ -72,6 +75,7 @@ latex_elements = {
     'preamble': latex_preamble
 }
 
+
 # Override the default Latex formatter in order to modify the
 # code/verbatim blocks.
 class CustomLatexFormatter(LatexFormatter):
@@ -82,3 +86,79 @@ class CustomLatexFormatter(LatexFormatter):
 
 # Replace the default latex formatter.
 PygmentsBridge.latex_formatter = CustomLatexFormatter
+
+
+# The following hook functions add some simple handling for the :numref:
+# directive for Sphinx versions prior to 1.3.1. The functions replace the
+# :numref: reference with a link to the target (for all Sphinx doc types). It
+# doesn't try to label figures/tables.
+
+def numref_role(reftype, rawtext, text, lineno, inliner):
+    """
+    Add a Sphinx role to handle numref references. Note, we can't convert the
+    link here because the doctree isn't build and the target information isn't
+    available.
+
+    """
+
+    # Add an identifier to distinguish numref from other references.
+    newnode = nodes.reference('',
+                              '',
+                              refuri='_local_numref_#%s' % text,
+                              internal=True)
+
+    return [newnode], []
+
+
+def process_numref(app, doctree, from_docname):
+    """
+    Process the numref nodes once the doctree has been built and prior to
+    writing the files. The processing involves replacing the numref with a
+    link plus text to indicate if it is a Figure or Table link.
+
+    """
+    env = app.builder.env
+
+    # Iterate over the reference nodes in the doctree.
+    for node in doctree.traverse(nodes.reference):
+        target = node.get('refuri', '')
+
+        # Look for numref nodes.
+        if target.startswith('_local_numref_#'):
+            target = target.replace('_local_numref_#', '')
+
+            # Get the target label and link information from the Sphinx env.
+            data = env.domains['std'].data
+            docname, label, _ = data['labels'].get(target, ('', '', ''))
+            relative_url = app.builder.get_relative_uri(from_docname, docname)
+
+            # Add a text label to the link.
+            if target.startswith('figure'):
+                caption = 'Figure'
+            elif target.startswith('table'):
+                caption = 'Table'
+            else:
+                caption = 'Link'
+
+            # Create a new reference node with the updated link information.
+            newnode = nodes.reference('',
+                                      caption,
+                                      refuri='%s#%s' % (relative_url, label),
+                                      internal=True)
+
+            # Replace the node.
+            node.replace_self(newnode)
+
+
+def setup(app):
+
+    if LooseVersion(sphinx_version) < LooseVersion('1.3.1'):
+
+        print('[dpdk docs] Upgrade sphinx to version >= 1.3.1 for '
+              'improved Figure/Table number handling.')
+
+        # Add a role to handle :numref: references.
+        app.add_role('numref', numref_role)
+
+        # Process the numref references once the doctree has been created.
+        app.connect('doctree-resolved', process_numref)
Signature · 1 line
1.8.1.4
#16 lore raw
In reply to John McNamara

2015-05-18 12:34, John McNamara:

Quoted 16 lines

This patchset adds automatic figure and table references to the docs. The figure and table numbers in the generated Html and PDF docs can now be automatically numbered.

It replaces all hardcoded figure/table numbers and references.

The numfig/numref feature requires Sphinx >= 1.3.1. For backward compatibility with older versions workaround handling is added to the sphinx conf.py file in patch 3/3.

The workaround replaces the :numref: reference with a "Figure" or "Table" link to the target (for all Sphinx doc types). It doesn't number the figures or tables. This produces reasonable documentation links for users with older versions of sphinx while allowing automatic numbering support for newer versions.

Quoted 6 lines

Tested with Sphinx 1.2.3 and 1.3.1.

John McNamara (3):
doc: refactored figure numbers into references
doc: refactored table numbers into references
doc: add sphinx numref compatibility workaround

Applied, thanks
It will be easier to add/remove figures and tables now :)

John, I did some light modifications in comments that I think you'd agree.

This is a really nice feature for the doc and I think this fallback should be documented somewhere in the sphinx project.

#17 lore raw
Quoted 11 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Monday, May 25, 2015 3:06 PM
To: Mcnamara, John
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v3 0/3] doc: refactored fig and table nums into references

Applied, thanks
It will be easier to add/remove figures and tables now :)

Hi Thomas,

Thanks for that. Anything that make the documentation process a little more automated is good. :-)

Note, during the rebase I inadvertently reinstated a few typos within the tables that I had fixed in a previous patch. I'll submit another spellcheck patch to fix them and others prior to the 2.1 release.

John