DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Helin" <helin.zhang@intel.com>
To: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] kni: fix compilation issue with KNI_VHOST enabled
Date: Mon, 16 Nov 2015 15:18:37 +0000	[thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A94A5D0@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1447682850-152756-1-git-send-email-pablo.de.lara.guarch@intel.com>



-----Original Message-----
From: De Lara Guarch, Pablo 
Sent: Monday, November 16, 2015 10:08 PM
To: dev@dpdk.org
Cc: Zhang, Helin <helin.zhang@intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
Subject: [PATCH] kni: fix compilation issue with KNI_VHOST enabled

Fix for the following error, on kernels 4.2.0 or higher, when KNI_VHOST is enabled:

  CC [M]  lib/librte_eal/linuxapp/kni/kni_vhost.o
          lib/librte_eal/linuxapp/kni/kni_vhost.c: In function ‘kni_vhost_backend_init’:
          lib/librte_eal/linuxapp/kni/kni_vhost.c:669:38: error: too few arguments to function ‘sk_alloc’
  if (!(q = (struct kni_vhost_queue *)sk_alloc(
                                      ^
In file included from lib/librte_eal/linuxapp/kni/kni_vhost.c:27:0:
/usr/src/kernels/4.2.3-300.fc23.x86_64/include/net/sock.h:1515:14: note: declared here  struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
              ^
This change in the kernel was added in the following commit:

Linux: 11aa9c28 ("net: Pass kern from net_proto_family.create to sk_alloc")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_eal/linuxapp/kni/kni_vhost.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c
index d0c12a6..2346ff3 100644
--- a/lib/librte_eal/linuxapp/kni/kni_vhost.c
+++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c
@@ -666,9 +666,15 @@ kni_vhost_backend_init(struct kni_dev *kni)
 	if (kni->vhost_queue != NULL)
 		return -1;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
+	if (!(q = (struct kni_vhost_queue *)sk_alloc(
+		      net, AF_UNSPEC, GFP_KERNEL, &kni_raw_proto, 0)))
Is this a kernel socket or else?

/Helin

+		return -ENOMEM;
+#else
 	if (!(q = (struct kni_vhost_queue *)sk_alloc(
 		      net, AF_UNSPEC, GFP_KERNEL, &kni_raw_proto)))
 		return -ENOMEM;
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) */
 
 	err = sock_create_lite(AF_UNSPEC, SOCK_RAW, IPPROTO_RAW, &q->sock);
 	if (err)
--
2.5.0


  reply	other threads:[~2015-11-16 15:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 14:07 Pablo de Lara
2015-11-16 15:18 ` Zhang, Helin [this message]
2015-11-16 15:27   ` De Lara Guarch, Pablo

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=F35DEAC7BCE34641BA9FAC6BCA4A12E70A94A5D0@SHSMSX104.ccr.corp.intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    /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).