path: root/lib/librte_kni
AgeCommit message (Collapse)Author
2016-06-29mk: fix internal dependenciesThomas Monjalon
Some libraries were missing their dependency on eal, mbuf, mempool, ring and kvargs. It is revealed by the linker option "-z defs". Signed-off-by: Thomas Monjalon <>
2016-06-14kni: describe mempool capacity requirementAlex Wang
Function like 'rte_kni_rx_burst()' keeps allocating 'MAX_MBUF_BURST_NUM' mbufs to kni fifo queue unless the queue's capacity ('KNI_FIFO_COUNT_MAX') is reached. So, if the mempool is under-provisioned, user may run into "Out of Memory" logs from KNI code. This commit documents the need to provision mempool capacity of more than "2 x KNI_FIFO_COUNT_MAX" for each KNI interface. Signed-off-by: Alex Wang <> Acked-by: Ferruh Yigit <> Acked-by: John McNamara <>
2016-06-14kni: fix inverted function commentsAlex Wang
The 'mbufs' alloc/free descriptions for 'rte_kni_tx_burst()' and 'rte_kni_rx_burst()' should be inverted. Fixes: 3fc5ca2 ("kni: initial import") Signed-off-by: Alex Wang <> Acked-by: Ferruh Yigit <>
2016-05-19mempool: allocate in several memory chunks by defaultOlivier Matz
Introduce rte_mempool_populate_default() which allocates mempool objects in several memzones. The mempool header is now always allocated in a specific memzone (not with its objects). Thanks to this modification, we can remove many specific behavior that was required when hugepages are not enabled in case we are using rte_mempool_xmem_create(). This change requires to update how kni and mellanox drivers lookup for mbuf memory. For now, this will only work if there is only one memory chunk (like today), but we could make use of rte_mempool_mem_iter() to support more memory chunks. We can also remove RTE_MEMPOOL_OBJ_NAME that is not required anymore for the lookup, as memory chunks are referenced by the mempool. Note that rte_mempool_create() is still broken (it was the case before) when there is no hugepages support (rte_mempool_create_xmem() has to be used). This is fixed in next commit. Signed-off-by: Olivier Matz <>
2016-01-28lib: remove keyword extern for functionsFerruh Yigit
Remove "extern" keywords in header files, the ones for function prototypes Signed-off-by: Ferruh Yigit <>
2015-09-03kni: remove deprecated functionsStephen Hemminger
These functions were tagged as deprecated in 2.0 so they can be removed in 2.2. The library version is incremented. Signed-off-by: Stephen Hemminger <> Acked-by: Helin Zhang <> [Thomas: update doc and version] Signed-off-by: Thomas Monjalon <> Acked-by: Neil Horman <>
2015-06-22kni: ignore double initializationMarc Sune
Prevent double initialization of the KNI subsytem. Signed-off-by: Marc Sune <> Acked-by: Helin Zhang <>
2015-06-19doc: fix doxygen warningsThomas Monjalon
Signed-off-by: Thomas Monjalon <> Acked-by: Bruce Richardson <>
2015-06-16kni: query the name of an instanceBruce Richardson
When a KNI object is created, a name is assigned to it which is stored internally. There is also an API function to look up a KNI object by name, but there is no API to query the current name of an existing KNI object. This patch adds just such an API. Signed-off-by: Bruce Richardson <> Acked-by: Helin Zhang <>
2015-06-12kni: fix whitespaceStephen Hemminger
Ran this code base through a script which: - removes trailing whitespace - removes space before tabs - removes blank lines at end of file Signed-off-by: Stephen Hemminger <> Acked-by: Helin Zhang <>
2015-05-29kni: fix missing header dependenciesBruce Richardson
The file rte_kni.h depends upon a number of other headers, some of which are missing from the #include lines. The following #includes are added: * rte_memory.h - for the definition of phys_addr_t * rte_mempool.h - for the definition of mempool struct and the mempool create function. Signed-off-by: Bruce Richardson <> Acked-by: Marc Sune <>
2015-05-11kni: remove inclusion of mbuf headerBruce Richardson
The kni header file includes the mbuf header file, but it does not need to do so as it only uses pointers to the struct rte_mbuf type, and does not use any of the mbuf internals, nor any of the mbuf functions or macros. Therefore the inclusion is unnecessary, and can be replaced by a forward declaration of the mbuf type. Signed-off-by: Bruce Richardson <> Acked-by: Olivier Matz <>
2015-02-24kni: optimize Rx burstHemant Agrawal
The current implementation of rte_kni_rx_burst polls the fifo for buffers. Irrespective of success or failure, it allocates the mbuf and try to put them into the alloc_q if the buffers are not added to alloc_q, it frees them. This waste lots of cpu cycles in allocating and freeing the buffers if alloc_q is full. The logic has been changed to: 1. Initially allocand add buffer(burstsize) to alloc_q 2. Add buffers to alloc_q only when you are pulling out the buffers. Signed-off-by: Hemant Agrawal <> Reviewed-by: Jay Rolette <>
2015-02-03mk: add library version extensionNeil Horman
To differentiate libraries that break ABI, we add a library version number suffix to the library, which must be incremented when a given libraries ABI is broken. This patch enforces that addition, sets the initial abi soname extension to 1 for each library and creates a symlink to the base SONAME so that the test applications will link properly. Signed-off-by: Neil Horman <> Acked-by: Sergio Gonzalez Monroy <>
2015-02-03lib: provide initial versioningNeil Horman
Add linker version script files to each DPDK library to put a stake in the ground from which we can start cleaning up API's Signed-off-by: Neil Horman <> Acked-by: Sergio Gonzalez Monroy <>
2014-11-10kni: add build-time checks for mbuf mappingJia Yu
Adding this check is to avoid breakage from future data structure changes. Signed-off-by: Jia Yu <> Acked-by: Thomas Monjalon <>
2014-10-22kni: fix buildMarc Sune
Fix compilation warning 'missing-field-initializers' for some GCC and clang versions introduced in commit 0c6bc8e due to the use of C89/C90 initializers. Using C99-style initializers Signed-off-by: Marc Sune <> Acked-by: Thomas Monjalon <>
2014-10-21kni: memzone pool for alloc and releaseMarc Sune
The previous implementation of rte_kni_alloc() was allocating memzones with a name composed of a fixed string and the interface name. When an application was allocating and deallocating multiple interfaces with different names, memzones were quickly exhausted, even though memzones from deallocated interfaces were never used anymore (unless an interface with the same name was re-allocated). As a result, the application was unable to allocate more KNI interfaces with different names. This patch implements the KNI memzone pool in order to prevent memzone exhaustion when allocating/deallocating KNI interfaces. It adds a new API call, rte_kni_init(max_kni_ifaces) that shall be called before any call to rte_kni_alloc() if KNI is used. The memzones are pre-allocated with interface- independent names so that they can be reused. Signed-off-by: Marc Sune <> Acked-by: Helin Zhang <>
2014-06-27eal: deprecate rte_snprintfStephen Hemminger
The function rte_snprintf serves no useful purpose. It is the same as snprintf() for all valid inputs. Deprecate it and replace all uses in current code. Leave the tests for the deprecated function in place. Signed-off-by: Stephen Hemminger <> Acked-by: Thomas Monjalon <>
2014-06-27eal: fix usage of printf-like functionsBruce Richardson
Mark the rte_log, cmdline_printf and rte_snprintf functions as being printf-style functions. This causes compilation errors due to mis-matched parameter types, so the parameter types are fixed where appropriate. Signed-off-by: Bruce Richardson <> Acked-by: Thomas Monjalon <>
2014-06-11remove trailing whitespacesBruce Richardson
This commit removes trailing whitespace from lines in files. Almost all files are affected, as the BSD license copyright header had trailing whitespace on 4 lines in it [hence the number of files reporting 8 lines changed in the diffstat]. Signed-off-by: Bruce Richardson <> Acked-by: Neil Horman <> [Thomas: remove spaces before tabs in libs] [Thomas: remove more trailing spaces in non-C files] Signed-off-by: Thomas Monjalon <>
2014-05-16spelling fixesStephen Hemminger
Signed-off-by: Stephen Hemminger <> Acked-by: Bruce Richardson <>
2014-02-25kni: add kni close functionBruce Richardson
KNI close function added. Signed-off-by: Bruce Richardson <>
2014-02-25eal: cleanup on mempool and memzone object namesBruce Richardson
Cleanup mempool and memzone object names so that we can more easily rename them from headers. Signed-off-by: Bruce Richardson <> Signed-off-by: David Marchand <>
2014-02-25update Intel copyright years to 2014Bruce Richardson
Signed-off-by: Bruce Richardson <>
2013-10-09kni: allow multiple threadsIntel
In this new mode, each KNI device has its own kernel thread for Rx. The core affinity is configurable. Signed-off-by: Intel
2013-10-09kni: identify device by nameIntel
Some old API functions based on port_id are deprecated. Signed-off-by: Intel
2013-10-09kni: minor changesIntel
Signed-off-by: Intel
2013-10-09doc: whitespace changes in licensesIntel
Signed-off-by: Intel
2013-09-17kni: fix multi-process supportIntel
Signed-off-by: Intel
2013-07-25update copyright date to 2013Intel
Signed-off-by: Intel
2013-07-25kni: initial importIntel
Signed-off-by: Intel