X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Flinuxapp%2Fkni%2Fkni_dev.h;h=a0e5cb6bb43bd7120d18e547b352cec90f2bb84e;hb=364ea7748187b446cdb1c03ce9fc28773f242b47;hp=ac3949dd10e263ec72413c7dd885c92608fdc7cc;hpb=f2e7592c474cf096266b02c71b292a696d19099e;p=dpdk.git diff --git a/lib/librte_eal/linuxapp/kni/kni_dev.h b/lib/librte_eal/linuxapp/kni/kni_dev.h old mode 100755 new mode 100644 index ac3949dd10..a0e5cb6bb4 --- a/lib/librte_eal/linuxapp/kni/kni_dev.h +++ b/lib/librte_eal/linuxapp/kni/kni_dev.h @@ -1,26 +1,25 @@ /*- * GPL LICENSE SUMMARY - * - * Copyright(c) 2010-2013 Intel Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify + * + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * The full GNU General Public License is included in this distribution + * The full GNU General Public License is included in this distribution * in the file called LICENSE.GPL. - * + * * Contact Information: * Intel Corporation - * */ #ifndef _KNI_DEV_H_ @@ -33,18 +32,27 @@ #include #include -#define KNI_KTHREAD_RESCHEDULE_INTERVAL 10 /* us */ +#ifdef RTE_KNI_VHOST +#include +#endif + +#include +#define KNI_KTHREAD_RESCHEDULE_INTERVAL 5 /* us */ /** * A structure describing the private information for a kni device. */ + struct kni_dev { /* kni list */ struct list_head list; struct net_device_stats stats; int status; - int port_id; + uint16_t group_id; /* Group ID of a group of KNI devices */ + unsigned core_id; /* Core ID to bind */ + char name[RTE_KNI_NAMESIZE]; /* Network device name */ + struct task_struct *pthread; /* wait queue for req/resp */ wait_queue_head_t wq; @@ -87,16 +95,55 @@ struct kni_dev { /* synchro for request processing */ unsigned long synchro; -}; -#define DEBUG_KNI +#ifdef RTE_KNI_VHOST + struct kni_vhost_queue* vhost_queue; + volatile enum { + BE_STOP = 0x1, + BE_START = 0x2, + BE_FINISH = 0x4, + }vq_status; +#endif +}; #define KNI_ERR(args...) printk(KERN_DEBUG "KNI: Error: " args) #define KNI_PRINT(args...) printk(KERN_DEBUG "KNI: " args) -#ifdef DEBUG_KNI +#ifdef RTE_KNI_KO_DEBUG #define KNI_DBG(args...) printk(KERN_DEBUG "KNI: " args) #else #define KNI_DBG(args...) #endif +#ifdef RTE_KNI_VHOST +unsigned int +kni_poll(struct file *file, struct socket *sock, poll_table * wait); +int kni_chk_vhost_rx(struct kni_dev *kni); +int kni_vhost_init(struct kni_dev *kni); +int kni_vhost_backend_release(struct kni_dev *kni); + +struct kni_vhost_queue { + struct sock sk; + struct socket *sock; + int vnet_hdr_sz; + struct kni_dev *kni; + int sockfd; + unsigned int flags; + struct sk_buff* cache; + struct rte_kni_fifo* fifo; +}; + +#endif + +#ifdef RTE_KNI_VHOST_DEBUG_RX + #define KNI_DBG_RX(args...) printk(KERN_DEBUG "KNI RX: " args) +#else + #define KNI_DBG_RX(args...) +#endif + +#ifdef RTE_KNI_VHOST_DEBUG_TX + #define KNI_DBG_TX(args...) printk(KERN_DEBUG "KNI TX: " args) +#else + #define KNI_DBG_TX(args...) +#endif + #endif