DPDK patches and discussions
 help / color / mirror / Atom feed
From: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 3/4] kni: fix function parameter from proto_ops pointers
Date: Fri, 26 Jun 2015 17:14:37 -0500	[thread overview]
Message-ID: <1435356878-10304-4-git-send-email-miguel.bernal.marin@linux.intel.com> (raw)
In-Reply-To: <1435356878-10304-1-git-send-email-miguel.bernal.marin@linux.intel.com>

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.

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

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.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 e01420a..f21b47e 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;
-- 
2.4.4

  parent reply	other threads:[~2015-06-26 22:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 19:09 [dpdk-dev] [PATCH 0/2] kni: fix build with kernel 4.1 Miguel Bernal Marin
2015-06-25 19:09 ` [dpdk-dev] [PATCH 1/2] kni: fix igb_ndo_bridge_getlink to build with 4.1 Miguel Bernal Marin
2015-06-25 19:09 ` [dpdk-dev] [PATCH 2/2] kni: fix header_ops " Miguel Bernal Marin
2015-06-25 21:56 ` [dpdk-dev] [PATCH 0/2] kni: fix build with kernel 4.1 De Lara Guarch, Pablo
2015-06-26 14:36   ` Miguel Bernal Marin
2015-06-26 22:14 ` [dpdk-dev] [PATCH v2 0/4] " Miguel Bernal Marin
2015-06-26 22:14   ` [dpdk-dev] [PATCH v2 1/4] kni: fix igb_ndo_bridge_getlink to build with 4.1 Miguel Bernal Marin
2015-07-10 15:41     ` Zhang, Helin
2015-06-26 22:14   ` [dpdk-dev] [PATCH v2 2/4] kni: fix header_ops " Miguel Bernal Marin
2015-07-10 15:31     ` Zhang, Helin
2015-06-26 22:14   ` Miguel Bernal Marin [this message]
2015-07-10 15:34     ` [dpdk-dev] [PATCH v2 3/4] kni: fix function parameter from proto_ops pointers Zhang, Helin
2015-07-10 15:42       ` Thomas Monjalon
2015-06-26 22:14   ` [dpdk-dev] [PATCH v2 4/4] kni: fix missing validation when vhost HDR is enabled Miguel Bernal Marin
2015-07-10 15:35     ` Zhang, Helin
2015-07-01 13:14   ` [dpdk-dev] [PATCH v2 0/4] kni: fix build with kernel 4.1 De Lara Guarch, Pablo
2015-07-10 10:00     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435356878-10304-4-git-send-email-miguel.bernal.marin@linux.intel.com \
    --to=miguel.bernal.marin@linux.intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).