4 * Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18 * The full GNU General Public License is included in this distribution
19 * in the file called LICENSE.GPL.
21 * Contact Information:
29 #include <linux/wait.h>
30 #include <linux/sched.h>
31 #include <linux/netdevice.h>
32 #include <linux/spinlock.h>
33 #include <linux/list.h>
35 #include <exec-env/rte_kni_common.h>
36 #define KNI_KTHREAD_RESCHEDULE_INTERVAL 10 /* us */
39 * A structure describing the private information for a kni device.
44 struct list_head list;
46 struct net_device_stats stats;
48 uint16_t group_id; /* Group ID of a group of KNI devices */
49 char name[RTE_KNI_NAMESIZE]; /* Network device name */
51 /* wait queue for req/resp */
53 struct mutex sync_lock;
59 struct net_device *net_dev;
60 struct net_device *lad_dev;
61 struct pci_dev *pci_dev;
63 /* queue for packets to be sent out */
66 /* queue for the packets received */
69 /* queue for the allocated mbufs those can be used to save sk buffs */
72 /* free queue for the mbufs to be freed */
90 /* synchro for request processing */
91 unsigned long synchro;
95 #define KNI_ERR(args...) printk(KERN_DEBUG "KNI: Error: " args)
96 #define KNI_PRINT(args...) printk(KERN_DEBUG "KNI: " args)
97 #ifdef RTE_KNI_KO_DEBUG
98 #define KNI_DBG(args...) printk(KERN_DEBUG "KNI: " args)
100 #define KNI_DBG(args...)