summaryrefslogtreecommitdiffstats
path: root/meta-isg/common/recipes-extended/dpdk/dpdk/dpdk-2.0.0-kni-fix-vhost-build-with-kernel-4.1.patch
blob: 1fcf12b49568cd30c585d764e92a1421d66c14c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From 289840d86ddaec3310ee1d6a85fe6f20384de615 Mon Sep 17 00:00:00 2001
From: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Date: Fri, 26 Jun 2015 17:14:37 -0500
Subject: [PATCH 2/2] kni: fix vhost build with kernel 4.1

Upstream-Status: Backport [2.1.0]

Parameters from sendmsg and recvmsg has been changed in 4.1 kernel.
The function pointers belong to proto_ops structure were updated removing
the struct kiocb parameter.

Linux: 1b784140474e ("net: Remove iocb argument from sendmsg and recvmsg")

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
(cherry picked from commit 8d8fb8aa5836e719d5fb896693b16afabd5118b9)
Signed-off-by: Rahul Kumar Gupta <rahul.kumarxx.gupta@intel.com>
---
 lib/librte_eal/linuxapp/kni/compat.h    |  4 ++++
 lib/librte_eal/linuxapp/kni/kni_vhost.c | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h
index 1ad22ba..cf100b6 100644
--- a/lib/librte_eal/linuxapp/kni/compat.h
+++ b/lib/librte_eal/linuxapp/kni/compat.h
@@ -23,3 +23,7 @@
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
 #define HAVE_IOV_ITER_MSGHDR
 #endif
+
+#if ( LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) )
+#define HAVE_KIOCB_MSG_PARAM
+#endif /* < 4.1.0 */
diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c
index 83d3351..4611ff4 100644
--- a/lib/librte_eal/linuxapp/kni/kni_vhost.c
+++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c
@@ -353,8 +353,13 @@ except:
 }
 
 static int
+#ifdef HAVE_KIOCB_MSG_PARAM
 kni_sock_sndmsg(struct kiocb *iocb, struct socket *sock,
 	   struct msghdr *m, size_t total_len)
+#else
+kni_sock_sndmsg(struct socket *sock,
+	   struct msghdr *m, size_t total_len)
+#endif /* HAVE_KIOCB_MSG_PARAM */
 {
  	struct kni_vhost_queue *q =
 		container_of(sock->sk, struct kni_vhost_queue, sk);
@@ -387,8 +392,13 @@ kni_sock_sndmsg(struct kiocb *iocb, struct socket *sock,
 }
 
 static int
+#ifdef HAVE_KIOCB_MSG_PARAM
 kni_sock_rcvmsg(struct kiocb *iocb, struct socket *sock,
 	   struct msghdr *m, size_t len, int flags)
+#else
+kni_sock_rcvmsg(struct socket *sock,
+	   struct msghdr *m, size_t len, int flags)
+#endif /* HAVE_KIOCB_MSG_PARAM */
 {
 	int vnet_hdr_len = 0;
 	int pkt_len = 0;
-- 
1.9.1