kni: memzone pool for alloc and release
[dpdk.git] / lib / librte_kni / rte_kni.h
index 1a0b004..815b8e2 100644 (file)
@@ -89,12 +89,28 @@ struct rte_kni_conf {
        uint8_t force_bind : 1; /* Flag to bind kernel thread */
 };
 
+/**
+ * Initialize and preallocate KNI subsystem
+ *
+ * This function is to be executed on the MASTER lcore only, after EAL
+ * initialization and before any KNI interface is attempted to be
+ * allocated
+ *
+ * @param max_kni_ifaces
+ *  The maximum number of KNI interfaces that can coexist concurrently
+ */
+extern void rte_kni_init(unsigned int max_kni_ifaces);
+
+
 /**
  * Allocate KNI interface according to the port id, mbuf size, mbuf pool,
  * configurations and callbacks for kernel requests.The KNI interface created
  * in the kernel space is the net interface the traditional Linux application
  * talking to.
  *
+ * The rte_kni_alloc shall not be called before rte_kni_init() has been
+ * called. rte_kni_alloc is thread safe.
+ *
  * @param pktmbuf_pool
  *  The mempool for allocting mbufs for packets.
  * @param conf
@@ -139,6 +155,8 @@ extern struct rte_kni *rte_kni_create(uint8_t port_id,
  * paired KNI interface in kernel space. All processing on the specific KNI
  * context need to be stopped before calling this interface.
  *
+ * rte_kni_release is thread safe.
+ *
  * @param kni
  *  The pointer to the context of an existent KNI interface.
  *