X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_kni%2Frte_kni.h;h=f6b66c33de1754d80b092303bb2875e1a2af7bb6;hb=2379572969145312653b144695f6bca44cb794e0;hp=c4dcfffa15c319a9632a10e35591b1aeb973a3b9;hpb=369991d997e4abdee355e19ffbb41a4d246cafa2;p=dpdk.git diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index c4dcfffa15..f6b66c33de 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -20,8 +20,9 @@ #include #include #include +#include -#include +#include #ifdef __cplusplus extern "C" { @@ -41,6 +42,15 @@ struct rte_kni_ops { /* Pointer to function of configuring network interface */ int (*config_network_if)(uint16_t port_id, uint8_t if_up); + + /* Pointer to function of configuring mac address */ + int (*config_mac_address)(uint16_t port_id, uint8_t mac_addr[]); + + /* Pointer to function of configuring promiscuous mode */ + int (*config_promiscusity)(uint16_t port_id, uint8_t to_on); + + /* Pointer to function of configuring allmulticast mode */ + int (*config_allmulticast)(uint16_t port_id, uint8_t to_on); }; /** @@ -56,11 +66,13 @@ struct rte_kni_conf { uint32_t core_id; /* Core ID to bind kernel thread on */ uint16_t group_id; /* Group ID */ unsigned mbuf_size; /* mbuf size */ - struct rte_pci_addr addr; - struct rte_pci_id id; + struct rte_pci_addr addr; /* depreciated */ + struct rte_pci_id id; /* depreciated */ __extension__ uint8_t force_bind : 1; /* Flag to bind kernel thread */ + uint8_t mac_addr[RTE_ETHER_ADDR_LEN]; /* MAC address assigned to KNI */ + uint16_t mtu; }; /** @@ -72,8 +84,12 @@ struct rte_kni_conf { * * @param max_kni_ifaces * The maximum number of KNI interfaces that can coexist concurrently + * + * @return + * - 0 indicates success. + * - negative value indicates failure. */ -void rte_kni_init(unsigned int max_kni_ifaces); +int rte_kni_init(unsigned int max_kni_ifaces); /** @@ -219,6 +235,27 @@ int rte_kni_register_handlers(struct rte_kni *kni, struct rte_kni_ops *ops); */ int rte_kni_unregister_handlers(struct rte_kni *kni); +/** + * Update link carrier state for KNI port. + * + * Update the linkup/linkdown state of a KNI interface in the kernel. + * + * @param kni + * pointer to struct rte_kni. + * @param linkup + * New link state: + * 0 for linkdown. + * > 0 for linkup. + * + * @return + * On failure: -1 + * Previous link state == linkdown: 0 + * Previous link state == linkup: 1 + */ +__rte_experimental +int +rte_kni_update_link(struct rte_kni *kni, unsigned int linkup); + /** * Close KNI device. */