X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_kni%2Frte_kni.h;h=37deb47275c831be657cb39f545fc83597ba4d05;hb=31850d26850e59cb20cdb84a8048d9f501f3cb22;hp=ef9faa9f158e78a28eca5f116c900916aeee922b;hpb=fc27caaafd4bcd302cbdb75701a435fbe00b7ce2;p=dpdk.git diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index ef9faa9f15..37deb47275 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -42,7 +42,7 @@ * interfaces that may be used by the RTE application to receive/transmit * packets from/to Linux kernel net interfaces. * - * This library provide two APIs to burst receive packets from KNI interfaces, + * This library provides two APIs to burst receive packets from KNI interfaces, * and burst transmit packets to KNI interfaces. */ @@ -88,6 +88,7 @@ struct rte_kni_conf { struct rte_pci_addr addr; struct rte_pci_id id; + __extension__ uint8_t force_bind : 1; /* Flag to bind kernel thread */ }; @@ -101,7 +102,7 @@ struct rte_kni_conf { * @param max_kni_ifaces * The maximum number of KNI interfaces that can coexist concurrently */ -extern void rte_kni_init(unsigned int max_kni_ifaces); +void rte_kni_init(unsigned int max_kni_ifaces); /** @@ -113,6 +114,9 @@ extern void rte_kni_init(unsigned int max_kni_ifaces); * The rte_kni_alloc shall not be called before rte_kni_init() has been * called. rte_kni_alloc is thread safe. * + * The mempool should have capacity of more than "2 x KNI_FIFO_COUNT_MAX" + * elements for each KNI interface allocated. + * * @param pktmbuf_pool * The mempool for allocting mbufs for packets. * @param conf @@ -124,9 +128,8 @@ extern void rte_kni_init(unsigned int max_kni_ifaces); * - The pointer to the context of a KNI interface. * - NULL indicate error. */ -extern struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool, - const struct rte_kni_conf *conf, - struct rte_kni_ops *ops); +struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool, + const struct rte_kni_conf *conf, struct rte_kni_ops *ops); /** * Release KNI interface according to the context. It will also release the @@ -142,7 +145,7 @@ extern struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool, * - 0 indicates success. * - negative value indicates failure. */ -extern int rte_kni_release(struct rte_kni *kni); +int rte_kni_release(struct rte_kni *kni); /** * It is used to handle the request mbufs sent from kernel space. @@ -156,13 +159,13 @@ extern int rte_kni_release(struct rte_kni *kni); * - 0 * - negative value indicates failure. */ -extern int rte_kni_handle_request(struct rte_kni *kni); +int rte_kni_handle_request(struct rte_kni *kni); /** * Retrieve a burst of packets from a KNI interface. The retrieved packets are * stored in rte_mbuf structures whose pointers are supplied in the array of - * mbufs, and the maximum number is indicated by num. It handles the freeing of - * the mbufs in the free queue of KNI interface. + * mbufs, and the maximum number is indicated by num. It handles allocating + * the mbufs for KNI interface alloc queue. * * @param kni * The KNI interface context. @@ -174,14 +177,14 @@ extern int rte_kni_handle_request(struct rte_kni *kni); * @return * The actual number of packets retrieved. */ -extern unsigned rte_kni_rx_burst(struct rte_kni *kni, - struct rte_mbuf **mbufs, unsigned num); +unsigned rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, + unsigned num); /** * Send a burst of packets to a KNI interface. The packets to be sent out are * stored in rte_mbuf structures whose pointers are supplied in the array of - * mbufs, and the maximum number is indicated by num. It handles allocating - * the mbufs for KNI interface alloc queue. + * mbufs, and the maximum number is indicated by num. It handles the freeing of + * the mbufs in the free queue of KNI interface. * * @param kni * The KNI interface context. @@ -193,8 +196,8 @@ extern unsigned rte_kni_rx_burst(struct rte_kni *kni, * @return * The actual number of packets sent. */ -extern unsigned rte_kni_tx_burst(struct rte_kni *kni, - struct rte_mbuf **mbufs, unsigned num); +unsigned rte_kni_tx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, + unsigned num); /** * Get the KNI context of its name. @@ -206,7 +209,7 @@ extern unsigned rte_kni_tx_burst(struct rte_kni *kni, * On success: Pointer to KNI interface. * On failure: NULL. */ -extern struct rte_kni *rte_kni_get(const char *name); +struct rte_kni *rte_kni_get(const char *name); /** * Get the name given to a KNI device @@ -216,7 +219,7 @@ extern struct rte_kni *rte_kni_get(const char *name); * @return * The pointer to the KNI name */ -extern const char *rte_kni_get_name(const struct rte_kni *kni); +const char *rte_kni_get_name(const struct rte_kni *kni); /** * Register KNI request handling for a specified port,and it can @@ -231,8 +234,7 @@ extern const char *rte_kni_get_name(const struct rte_kni *kni); * On success: 0 * On failure: -1 */ -extern int rte_kni_register_handlers(struct rte_kni *kni, - struct rte_kni_ops *ops); +int rte_kni_register_handlers(struct rte_kni *kni, struct rte_kni_ops *ops); /** * Unregister KNI request handling for a specified port. @@ -244,12 +246,12 @@ extern int rte_kni_register_handlers(struct rte_kni *kni, * On success: 0 * On failure: -1 */ -extern int rte_kni_unregister_handlers(struct rte_kni *kni); +int rte_kni_unregister_handlers(struct rte_kni *kni); /** * Close KNI device. */ -extern void rte_kni_close(void); +void rte_kni_close(void); #ifdef __cplusplus }