doc: fix numbers power of 2 in LPM6 guide
[dpdk.git] / doc / guides / prog_guide / kernel_nic_interface.rst
index 33ea980..1ce03ec 100644 (file)
@@ -65,7 +65,7 @@ disabled, and the default carrier state of KNI interfaces is set to *off*.
 
 .. code-block:: console
 
-    # insmod kmod/rte_kni.ko
+    # insmod <build_dir>/kernel/linux/kni/rte_kni.ko
 
 .. _kni_loopback_mode:
 
@@ -77,14 +77,14 @@ by specifying the ``lo_mode`` parameter:
 
 .. code-block:: console
 
-    # insmod kmod/rte_kni.ko lo_mode=lo_mode_fifo
+    # insmod <build_dir>/kernel/linux/kni/rte_kni.ko lo_mode=lo_mode_fifo
 
 The ``lo_mode_fifo`` loopback option will loop back ring enqueue/dequeue
 operations in kernel space.
 
 .. code-block:: console
 
-    # insmod kmod/rte_kni.ko lo_mode=lo_mode_fifo_skb
+    # insmod <build_dir>/kernel/linux/kni/rte_kni.ko lo_mode=lo_mode_fifo_skb
 
 The ``lo_mode_fifo_skb`` loopback option will loop back ring enqueue/dequeue
 operations and sk buffer copies in kernel space.
@@ -105,7 +105,7 @@ Single kernel thread mode is enabled as follows:
 
 .. code-block:: console
 
-    # insmod kmod/rte_kni.ko kthread_mode=single
+    # insmod <build_dir>/kernel/linux/kni/rte_kni.ko kthread_mode=single
 
 This mode will create only one kernel thread for all KNI interfaces to
 receive data on the kernel side.  By default, this kernel thread is not
@@ -122,7 +122,7 @@ kernel thread mode is enabled as follows:
 
 .. code-block:: console
 
-    # insmod kmod/rte_kni.ko kthread_mode=multiple
+    # insmod <build_dir>/kernel/linux/kni/rte_kni.ko kthread_mode=multiple
 
 This mode will create a separate kernel thread for each KNI interface to
 receive data on the kernel side.  The core affinity of each ``kni_thread``
@@ -163,13 +163,13 @@ To set the default carrier state to *on*:
 
 .. code-block:: console
 
-    # insmod kmod/rte_kni.ko carrier=on
+    # insmod <build_dir>/kernel/linux/kni/rte_kni.ko carrier=on
 
 To set the default carrier state to *off*:
 
 .. code-block:: console
 
-    # insmod kmod/rte_kni.ko carrier=off
+    # insmod <build_dir>/kernel/linux/kni/rte_kni.ko carrier=off
 
 If the ``carrier`` parameter is not specified, the default carrier state
 of KNI interfaces will be set to *off*.
@@ -178,7 +178,7 @@ KNI Creation and Deletion
 -------------------------
 
 Before any KNI interfaces can be created, the ``rte_kni`` kernel module must
-be loaded into the kernel and configured withe ``rte_kni_init()`` function.
+be loaded into the kernel and configured with the ``rte_kni_init()`` function.
 
 The KNI interfaces are created by a DPDK application dynamically via the
 ``rte_kni_alloc()`` function.
@@ -187,6 +187,8 @@ The ``struct rte_kni_conf`` structure contains fields which allow the
 user to specify the interface name, set the MTU size, set an explicit or
 random MAC address and control the affinity of the kernel Rx thread(s)
 (both single and multi-threaded modes).
+By default the KNI sample example gets the MTU from the matching device,
+and in case of KNI PMD it is derived from mbuf buffer length.
 
 The ``struct rte_kni_ops`` structure contains pointers to functions to
 handle requests from the ``rte_kni`` kernel module.  These functions
@@ -225,7 +227,7 @@ application functions:
 
 ``config_promiscusity``:
 
-    Called when the user changes the promiscusity state of the KNI
+    Called when the user changes the promiscuity state of the KNI
     interface.  For example, when the user runs ``ip link set promisc
     [on|off] dev <ifaceX>``. If the user sets this callback function to
     NULL, but sets the ``port_id`` field to a value other than -1, a default
@@ -233,6 +235,15 @@ application functions:
     will be called which calls ``rte_eth_promiscuous_<enable|disable>()``
     on the specified ``port_id``.
 
+``config_allmulticast``:
+
+    Called when the user changes the allmulticast state of the KNI interface.
+    For example, when the user runs ``ifconfig <ifaceX> [-]allmulti``. If the
+    user sets this callback function to NULL, but sets the ``port_id`` field to
+    a value other than -1, a default callback handler in the rte_kni library
+    ``kni_config_allmulticast()`` will be called which calls
+    ``rte_eth_allmulticast_<enable|disable>()`` on the specified ``port_id``.
+
 In order to run these callbacks, the application must periodically call
 the ``rte_kni_handle_request()`` function.  Any user callback function
 registered will be called directly from ``rte_kni_handle_request()`` so
@@ -243,7 +254,7 @@ to create a separate thread or secondary process to periodically call
 
 The KNI interfaces can be deleted by a DPDK application with
 ``rte_kni_release()``.  All KNI interfaces not explicitly deleted will be
-deleted when the the ``/dev/kni`` device is closed, either explicitly with
+deleted when the ``/dev/kni`` device is closed, either explicitly with
 ``rte_kni_close()`` or when the DPDK application is closed.
 
 DPDK mbuf Flow
@@ -266,12 +277,16 @@ Use Case: Ingress
 -----------------
 
 On the DPDK RX side, the mbuf is allocated by the PMD in the RX thread context.
-This thread will enqueue the mbuf in the rx_q FIFO.
+This thread will enqueue the mbuf in the rx_q FIFO,
+and the next pointers in mbuf-chain will convert to physical address.
 The KNI thread will poll all KNI active devices for the rx_q.
 If an mbuf is dequeued, it will be converted to a sk_buff and sent to the net stack via netif_rx().
-The dequeued mbuf must be freed, so the same pointer is sent back in the free_q FIFO.
+The dequeued mbuf must be freed, so the same pointer is sent back in the free_q FIFO,
+and next pointers must convert back to virtual address if exists before put in the free_q FIFO.
 
 The RX thread, in the same main loop, polls this FIFO and frees the mbuf after dequeuing it.
+The address conversion of the next pointer is to prevent the chained mbuf
+in different hugepage segments from causing kernel crash.
 
 Use Case: Egress
 ----------------
@@ -285,10 +300,24 @@ The sk_buff is then freed and the mbuf sent in the tx_q FIFO.
 The DPDK TX thread dequeues the mbuf and sends it to the PMD via ``rte_eth_tx_burst()``.
 It then puts the mbuf back in the cache.
 
+IOVA = VA: Support
+------------------
+
+KNI operates in IOVA_VA scheme when
+
+- LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) and
+- EAL option `iova-mode=va` is passed or bus IOVA scheme in the DPDK is selected
+  as RTE_IOVA_VA.
+
+Due to IOVA to KVA address translations, based on the KNI use case there
+can be a performance impact. For mitigation, forcing IOVA to PA via EAL
+"--iova-mode=pa" option can be used, IOVA_DC bus iommu scheme can also
+result in IOVA as PA.
+
 Ethtool
 -------
 
-Ethtool is a Linux-specific tool with corresponding support in the kernel
-where each net device must register its own callbacks for the supported operations.
-The current implementation uses the igb/ixgbe modified Linux drivers for ethtool support.
-Ethtool is not supported in i40e and VMs (VF or EM devices).
+Ethtool is a Linux-specific tool with corresponding support in the kernel.
+The current version of kni provides minimal ethtool functionality
+including querying version and link state. It does not support link
+control, statistics, or dumping device registers.