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
-------------------------
In addition, one or more kernel NIC interfaces are allocated for each
of the configured ports according to the command line parameters.
-The code for creating the kernel NIC interface for a specific port is as follows:
-
-.. code-block:: c
-
- kni = rte_kni_create(port, MAX_PACKET_SZ, pktmbuf_pool, &kni_ops);
- if (kni == NULL)
- rte_exit(EXIT_FAILURE, "Fail to create kni dev "
- "for port: %d\n", port);
-
The code for allocating the kernel NIC interfaces for a specific port is as follows:
.. code-block:: c
RTE_LOG(ERR, APP, "Failed to start port %d\n", port_id);
return ret;
}
-
-.. |kernel_nic| image:: img/kernel_nic.*