kni: fix build on Ubuntu 14.04
[dpdk.git] / lib / librte_eal / linuxapp / kni / kni_fifo.h
index 2022cb2..3ea750e 100644 (file)
@@ -1,23 +1,23 @@
 /*-
  * GPL LICENSE SUMMARY
- * 
- *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
- * 
+ *
+ *   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
  *   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
  *   Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  *   The full GNU General Public License is included in this distribution
  *   in the file called LICENSE.GPL.
- * 
+ *
  *   Contact Information:
  *   Intel Corporation
  */
@@ -91,4 +91,18 @@ kni_fifo_free_count(struct rte_kni_fifo *fifo)
        return (fifo->read - fifo->write - 1) & (fifo->len - 1);
 }
 
+#ifdef RTE_KNI_VHOST
+/**
+ * Initializes the kni fifo structure
+ */
+static inline void
+kni_fifo_init(struct rte_kni_fifo *fifo, unsigned size)
+{
+       fifo->write = 0;
+       fifo->read = 0;
+       fifo->len = size;
+       fifo->elem_size = sizeof(void *);
+}
+#endif
+
 #endif /* _KNI_FIFO_H_ */