examples/ipsec-secgw: fix inbound crash
[dpdk.git] / doc / guides / sample_app_ug / l2_forward_real_virtual.rst
index 234d71d..b51b2dc 100644 (file)
@@ -28,6 +28,8 @@
     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+.. _l2_fwd_app_real_and_virtual:
+
 L2 Forwarding Sample Application (in Real and Virtualized Environments)
 =======================================================================
 
@@ -54,27 +56,26 @@ 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|
+.. _l2_fwd_vf_setup:
 
 Virtual Function Setup Instructions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -103,7 +104,8 @@ Compiling the Application
 
     .. code-block:: console
 
-        export RTE_SDK=/path/to/rte_sdk cd ${RTE_SDK}/examples/l2fwd
+        export RTE_SDK=/path/to/rte_sdk
+        cd ${RTE_SDK}/examples/l2fwd
 
 #.  Set the target (a default target is used if not specified). For example:
 
@@ -148,11 +150,13 @@ Explanation
 
 The following sections provide some explanation of the code.
 
+.. _l2_fwd_app_cmd_arguments:
+
 Command Line Arguments
 ~~~~~~~~~~~~~~~~~~~~~~
 
 The L2 Forwarding sample application takes specific parameters,
-in addition to Environment Abstraction Layer (EAL) arguments (see Section 9.3).
+in addition to Environment Abstraction Layer (EAL) arguments.
 The preferred way to parse parameters is to use the getopt() function,
 since it is part of a well-defined and portable library.
 
@@ -180,6 +184,8 @@ This is done at the beginning of the main() function:
     if (ret < 0)
         rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
 
+.. _l2_fwd_app_mbuf_init:
+
 Mbuf Pool Initialization
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -217,6 +223,8 @@ Two callback pointers are also given to the rte_mempool_create() function:
     If a more complex application wants to extend the rte_pktmbuf structure for its own needs,
     a new function derived from rte_pktmbuf_init( ) can be created.
 
+.. _l2_fwd_app_dvr_init:
+
 Driver Initialization
 ~~~~~~~~~~~~~~~~~~~~~
 
@@ -234,9 +242,6 @@ in the *DPDK Programmer's Guide* - Rel 1.4 EAR and the *DPDK API Reference*.
     if (nb_ports == 0)
         rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
 
-    if (nb_ports > RTE_MAX_ETHPORTS)
-        nb_ports = RTE_MAX_ETHPORTS;
-
     /* reset l2fwd_dst_ports */
 
     for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++)
@@ -304,6 +309,8 @@ The global configuration is stored in a static structure:
         },
     };
 
+.. _l2_fwd_app_rx_init:
+
 RX Queue Initialization
 ~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -336,7 +343,7 @@ The list of queues that must be polled for a given lcore is stored in a private
     struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 The values n_rx_port and rx_port_list[] are used in the main packet processing loop
-(see Section 9.4.6 "Receive, Process and Transmit Packets" later in this chapter).
+(see :ref:`l2_fwd_app_rx_tx_packets`).
 
 The global configuration for the RX queues is stored in a static structure:
 
@@ -350,6 +357,8 @@ The global configuration for the RX queues is stored in a static structure:
         },
     };
 
+.. _l2_fwd_app_tx_init:
+
 TX Queue Initialization
 ~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -378,6 +387,8 @@ The global configuration for TX queues is stored in a static structure:
         .tx_free_thresh = RTE_TEST_TX_DESC_DEFAULT + 1, /* disable feature */
     };
 
+.. _l2_fwd_app_rx_tx_packets:
+
 Receive, Process and Transmit Packets
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -526,7 +537,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.*