X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=doc%2Fguides%2Fsample_app_ug%2Fkernel_nic_interface.rst;h=ef441cc1e56acada9233cacf9481046f34620268;hb=df39890f0c7ae3d2f5eacebad016aa7be5773c97;hp=f8fe17bd08eb8a8abee930379b2e50cbbc0108aa;hpb=218c4e68c1d9bd4a9281bc1dc4d0ab89859083bf;p=dpdk.git diff --git a/doc/guides/sample_app_ug/kernel_nic_interface.rst b/doc/guides/sample_app_ug/kernel_nic_interface.rst index f8fe17bd08..ef441cc1e5 100644 --- a/doc/guides/sample_app_ug/kernel_nic_interface.rst +++ b/doc/guides/sample_app_ug/kernel_nic_interface.rst @@ -21,14 +21,14 @@ The FIFO queues contain pointers to data packets in the DPDK. This: * Provides a faster mechanism to interface with the kernel net stack and eliminates system calls -* Facilitates the DPDK using standard Linux* userspace net tools (tcpdump, ftp, and so on) +* Facilitates the DPDK using standard Linux* userspace net tools (tshark, rsync, and so on) * Eliminate the copy_to_user and copy_from_user operations on packets. The Kernel NIC Interface sample application is a simple example that demonstrates the use of the DPDK to create a path for packets to go through the Linux* kernel. This is done by creating one or more kernel net devices for each of the DPDK ports. -The application allows the use of standard Linux tools (ethtool, ifconfig, tcpdump) with the DPDK ports and +The application allows the use of standard Linux tools (ethtool, iproute, tshark) with the DPDK ports and also the exchange of packets between the DPDK application and the Linux* kernel. The Kernel NIC Interface sample application requires that the @@ -96,7 +96,7 @@ The ``kni`` example application requires a number of command line options: .. code-block:: console - kni [EAL options] -- -p PORTMASK --config="(port,lcore_rx,lcore_tx[,lcore_kthread,...])[,(port,lcore_rx,lcore_tx[,lcore_kthread,...])]" [-P] [-m] + dpdk-kni [EAL options] -- -p PORTMASK --config="(port,lcore_rx,lcore_tx[,lcore_kthread,...])[,(port,lcore_rx,lcore_tx[,lcore_kthread,...])]" [-P] [-m] Where: @@ -168,8 +168,8 @@ interface ``vEth1_0`` with the kernel thread bound to lcore 9. .. code-block:: console # rmmod rte_kni - # insmod kmod/rte_kni.ko kthread_mode=multiple - # ./build/kni -l 4-7 -n 4 -- -P -p 0x3 -m --config="(0,4,6,8),(1,5,7,9)" + # insmod /kernel/linux/kni/rte_kni.ko kthread_mode=multiple + # .//examples/dpdk-kni -l 4-7 -n 4 -- -P -p 0x3 -m --config="(0,4,6,8),(1,5,7,9)" The following example is identical, except an additional ``lcore_kthread`` core is specified per physical port. In this case, ``kni`` will create @@ -186,8 +186,8 @@ The kernel thread for each interface will be bound as follows: .. code-block:: console # rmmod rte_kni - # insmod kmod/rte_kni.ko kthread_mode=multiple - # ./build/kni -l 4-7 -n 4 -- -P -p 0x3 -m --config="(0,4,6,8,10),(1,5,7,9,11)" + # insmod /kernel/linux/kni/rte_kni.ko kthread_mode=multiple + # .//examples/dpdk-kni -l 4-7 -n 4 -- -P -p 0x3 -m --config="(0,4,6,8,10),(1,5,7,9,11)" The following example can be used to test the interface between the ``kni`` test application and the ``rte_kni`` kernel module. In this example, @@ -206,8 +206,8 @@ disabled by **not** specifying the ``-m`` flag to ``kni``: .. code-block:: console # rmmod rte_kni - # insmod kmod/rte_kni.ko lo_mode=lo_mode_fifo carrier=on - # ./build/kni -l 4-7 -n 4 -- -P -p 0x3 --config="(0,4,6,8),(1,5,7,9)" + # insmod /kernel/linux/kni/rte_kni.ko lo_mode=lo_mode_fifo carrier=on + # .//examples/dpdk-kni -l 4-7 -n 4 -- -P -p 0x3 --config="(0,4,6,8),(1,5,7,9)" KNI Operations -------------- @@ -220,13 +220,13 @@ Enable KNI interface and assign an IP address: .. code-block:: console - # ifconfig vEth0_0 192.168.0.1 + # ip addr add dev vEth0_0 192.168.0.1 Show KNI interface configuration and statistics: .. code-block:: console - # ifconfig vEth0_0 + # ip -s -d addr show vEth0_0 The user can also check and reset the packet statistics inside the ``kni`` application by sending the app the USR1 and USR2 signals: @@ -234,16 +234,16 @@ application by sending the app the USR1 and USR2 signals: .. code-block:: console # Print statistics - # kill -SIGUSR1 `pidof kni` + # pkill -USR1 kni # Zero statistics - # kill -SIGUSR2 `pidof kni` + # pkill -USR2 kni Dump network traffic: .. code-block:: console - # tcpdump -i vEth0_0 + # tshark -n -i vEth0_0 The normal Linux commands can also be used to change the MAC address and MTU size used by the physical NIC which corresponds to the KNI interface. @@ -254,23 +254,19 @@ Change the MAC address: .. code-block:: console - # ifconfig vEth0_0 hw ether 0C:01:02:03:04:08 + # ip link set dev vEth0_0 lladdr 0C:01:02:03:04:08 Change the MTU size: .. code-block:: console - # ifconfig vEth0_0 mtu 1450 + # ip link set dev vEth0_0 mtu 1450 -If DPDK is compiled with ``CONFIG_RTE_KNI_KMOD_ETHTOOL=y`` and an Intel -NIC is used, the user can use ``ethtool`` on the KNI interface as if it -were a normal Linux kernel interface. - -Displaying the NIC registers: +Limited ethtool support: .. code-block:: console - # ethtool -d vEth0_0 + # ethtool -i vEth0_0 When the ``kni`` application is closed, all the KNI interfaces are deleted from the Linux kernel.