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 5 /* 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 unsigned core_id; /* Core ID to bind */
50 char name[RTE_KNI_NAMESIZE]; /* Network device name */
51 struct task_struct *pthread;
53 /* wait queue for req/resp */
55 struct mutex sync_lock;
61 struct net_device *net_dev;
62 struct net_device *lad_dev;
63 struct pci_dev *pci_dev;
65 /* queue for packets to be sent out */
68 /* queue for the packets received */
71 /* queue for the allocated mbufs those can be used to save sk buffs */
74 /* free queue for the mbufs to be freed */
92 /* synchro for request processing */
93 unsigned long synchro;
97 #define KNI_ERR(args...) printk(KERN_DEBUG "KNI: Error: " args)
98 #define KNI_PRINT(args...) printk(KERN_DEBUG "KNI: " args)
99 #ifdef RTE_KNI_KO_DEBUG
100 #define KNI_DBG(args...) printk(KERN_DEBUG "KNI: " args)
102 #define KNI_DBG(args...)