(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)
=======================================================================
* 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. 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:
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.
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
+.. _l2_fwd_app_mbuf_init:
+
Mbuf Pool Initialization
~~~~~~~~~~~~~~~~~~~~~~~~
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
~~~~~~~~~~~~~~~~~~~~~
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++)
},
};
+.. _l2_fwd_app_rx_init:
+
RX Queue Initialization
~~~~~~~~~~~~~~~~~~~~~~~
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:
},
};
+.. _l2_fwd_app_tx_init:
+
TX Queue Initialization
~~~~~~~~~~~~~~~~~~~~~~~
.tx_free_thresh = RTE_TEST_TX_DESC_DEFAULT + 1, /* disable feature */
};
+.. _l2_fwd_app_rx_tx_packets:
+
Receive, Process and Transmit Packets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.*