kni->req_q = phys_to_virt(dev_info.req_phys);
kni->resp_q = phys_to_virt(dev_info.resp_phys);
-
kni->sync_va = dev_info.sync_va;
kni->sync_kva = phys_to_virt(dev_info.sync_phys);
(PCI_SLOT(pci->devfn) == dev_info.devid) &&
(PCI_FUNC(pci->devfn) == dev_info.function)) {
found_pci = pci;
-
switch (dev_info.device_id) {
#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) case (dev):
#include <rte_pci_dev_ids.h>
ret = igb_kni_probe(found_pci, &lad_dev);
break;
- #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) case (dev):
+ #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) \
+ case (dev):
#include <rte_pci_dev_ids.h>
ret = ixgbe_kni_probe(found_pci, &lad_dev);
break;
break;
}
- KNI_DBG("PCI found: pci=0x%p, lad_dev=0x%p\n", pci, lad_dev);
+ KNI_DBG("PCI found: pci=0x%p, lad_dev=0x%p\n",
+ pci, lad_dev);
if (ret == 0) {
kni->lad_dev = lad_dev;
kni_set_ethtool_ops(kni->net_dev);
- }
- else {
+ } else {
KNI_ERR("Device not supported by ethtool");
kni->lad_dev = NULL;
}
kni->device_id = dev_info.device_id;
break;
}
- pci = pci_get_device(dev_info.vendor_id, dev_info.device_id,
- pci);
+ pci = pci_get_device(dev_info.vendor_id,
+ dev_info.device_id, pci);
}
-
if (pci)
pci_dev_put(pci);
ret = register_netdev(net_dev);
if (ret) {
- KNI_ERR("error %i registering device \"%s\"\n", ret,
- dev_info.name);
+ KNI_ERR("error %i registering device \"%s\"\n",
+ ret, dev_info.name);
free_netdev(net_dev);
return -ENODEV;
}
* The mbuf size to store a packet.
*
* @return
- * - The pointer to the context of a kni interface.
+ * - The pointer to the context of a KNI interface.
* - NULL indicate error.
*/
extern struct rte_kni *rte_kni_create(uint8_t port_id, unsigned mbuf_size,
struct rte_mempool *pktmbuf_pool, struct rte_kni_ops *ops);
/**
- * Release kni interface according to the context. It will also release the
- * paired KNI interface in kernel space. All processing on the specific kni
+ * Release KNI interface according to the context. It will also release the
+ * paired KNI interface in kernel space. All processing on the specific KNI
* context need to be stopped before calling this interface.
*
* @param kni
- * The pointer to the context of an existant kni interface.
+ * The pointer to the context of an existant KNI interface.
*
* @return
* - 0 indicates success.
* Finally constructs the response mbuf and puts it back to the resp_q.
*
* @param kni
- * The pointer to the context of an existant kni interface.
+ * The pointer to the context of an existant KNI interface.
*
* @return
- * - 0
+ * - 0
* - negative value indicates failure.
*/
extern int rte_kni_handle_request(struct rte_kni *kni);
/**
- * Retrieve a burst of packets from a kni interface. The retrieved packets are
+ * 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.
+ * the mbufs in the free queue of KNI interface.
*
* @param kni
- * The kni interface context.
+ * The KNI interface context.
* @param mbufs
* The array to store the pointers of mbufs.
* @param num
struct rte_mbuf **mbufs, unsigned num);
/**
- * Send a burst of packets to a kni interface. The packets to be sent out are
+ * 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.
+ * the mbufs for KNI interface alloc queue.
*
* @param kni
- * The kni interface context.
+ * The KNI interface context.
* @param mbufs
* The array to store the pointers of mbufs.
* @param num
struct rte_mbuf **mbufs, unsigned num);
/**
- * Get the port id from kni interface.
+ * Get the port id from KNI interface.
*
* @param kni
- * The kni interface context.
+ * The KNI interface context.
*
* @return
* On success: The port id.
extern uint8_t rte_kni_get_port_id(struct rte_kni *kni);
/**
- * Get kni context information of the port.
+ * Get the KNI context of the specific port.
*
- * @port_id
+ * @param port_id
* the port id.
*
* @return
- * On success: Pointer to kni interface.
+ * On success: Pointer to KNI interface.
* On failure: NULL
*/
extern struct rte_kni * rte_kni_info_get(uint8_t port_id);
/**
- * Register kni request handling for a specified port,and it can
+ * Register KNI request handling for a specified port,and it can
* be called by master process or slave process.
*
* @param kni
- * pointer to struct rte_kni.
+ * pointer to struct rte_kni.
* @param ops
* ponter to struct rte_kni_ops.
*
struct rte_kni_ops *ops);
/**
- * Unregister kni request handling for a specified port.
+ * Unregister KNI request handling for a specified port.
*
- * @param kni
- * pointer to struct rte_kni.
+ * @param kni
+ * pointer to struct rte_kni.
*
* @return
* On success: 0