2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-15 14:17:18 +00:00

datapath: Update kernel support to 3.2.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>

Bug #7772
This commit is contained in:
Pravin B Shelar
2011-11-08 15:25:12 -08:00
parent 58d01ad97d
commit 143af30e2d
4 changed files with 11 additions and 3 deletions

View File

@@ -8,6 +8,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/uaccess.h>
#include <linux/completion.h>

View File

@@ -53,8 +53,8 @@
#include "vport-internal_dev.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) || \
LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
#error Kernels before 2.6.18 or after 3.1 are not supported by this version of Open vSwitch.
LINUX_VERSION_CODE > KERNEL_VERSION(3,2,0)
#error Kernels before 2.6.18 or after 3.2 are not supported by this version of Open vSwitch.
#endif
int (*dp_ioctl_hook)(struct net_device *dev, struct ifreq *rq, int cmd);

View File

@@ -232,4 +232,11 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb)
#define consume_skb kfree_skb
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
static inline struct page *skb_frag_page(const skb_frag_t *frag)
{
return frag->page;
}
#endif
#endif

View File

@@ -1045,7 +1045,7 @@ static bool need_linearize(const struct sk_buff *skb)
* change them from underneath us and we can skip the linearization.
*/
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
if (unlikely(page_count(skb_shinfo(skb)->frags[i].page) > 1))
if (unlikely(page_count(skb_frag_page(&skb_shinfo(skb)->frags[i])) > 1))
return true;
return false;