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 2/4] kni: fix header_ops to build with 4.1
Date: Fri, 26 Jun 2015 17:14:36 -0500	[thread overview]
Message-ID: <1435356878-10304-3-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>

rebuild member was removed from headers_ops in kernel release
4.1. Therefore kni module compilation breaks.

This patch add the properly checks to fix it.

Fixes: d476059e77d1 ("net: Kill dev_rebuild_header")

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
---
 lib/librte_eal/linuxapp/kni/kni_net.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c
index e34a0fd..ab5add4 100644
--- a/lib/librte_eal/linuxapp/kni/kni_net.c
+++ b/lib/librte_eal/linuxapp/kni/kni_net.c
@@ -605,6 +605,7 @@ kni_net_header(struct sk_buff *skb, struct net_device *dev,
 /*
  * Re-fill the eth header
  */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
 static int
 kni_net_rebuild_header(struct sk_buff *skb)
 {
@@ -616,6 +617,7 @@ kni_net_rebuild_header(struct sk_buff *skb)
 
 	return 0;
 }
+#endif /* < 4.1.0  */
 
 /**
  * kni_net_set_mac - Change the Ethernet Address of the KNI NIC
@@ -646,7 +648,9 @@ static int kni_net_change_carrier(struct net_device *dev, bool new_carrier)
 
 static const struct header_ops kni_net_header_ops = {
 	.create  = kni_net_header,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
 	.rebuild = kni_net_rebuild_header,
+#endif /* < 4.1.0  */
 	.cache   = NULL,  /* disable caching */
 };
 
-- 
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   ` Miguel Bernal Marin [this message]
2015-07-10 15:31     ` [dpdk-dev] [PATCH v2 2/4] kni: fix header_ops " Zhang, Helin
2015-06-26 22:14   ` [dpdk-dev] [PATCH v2 3/4] kni: fix function parameter from proto_ops pointers Miguel Bernal Marin
2015-07-10 15:34     ` 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-3-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).