datapath: support Linux 3.7
authorIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 19 Dec 2012 08:43:09 +0000 (17:43 +0900)
committerJesse Gross <jesse@nicira.com>
Thu, 20 Dec 2012 22:47:22 +0000 (14:47 -0800)
datapath: backport 15e473046cb6e5d18a4d0057e61d76315230382b

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[jesse: fix kernel version in error message]
Signed-off-by: Jesse Gross <jesse@nicira.com>
12 files changed:
FAQ
NEWS
datapath/actions.c
datapath/datapath.c
datapath/datapath.h
datapath/linux/Modules.mk
datapath/linux/compat/include/net/genetlink.h
datapath/linux/compat/include/net/inet_frag.h [new file with mode: 0644]
datapath/vport-capwap.c
datapath/vport.c
datapath/vport.h
debian/changelog

diff --git a/FAQ b/FAQ
index 15fb694..190bf18 100644 (file)
--- a/FAQ
+++ b/FAQ
@@ -145,7 +145,7 @@ A: The following table lists the Linux kernel versions against which the
        1.6.x      2.6.18 to 3.2
        1.7.x      2.6.18 to 3.3
        1.8.x      2.6.18 to 3.4
        1.6.x      2.6.18 to 3.2
        1.7.x      2.6.18 to 3.3
        1.8.x      2.6.18 to 3.4
-       1.9.x      2.6.18 to 3.6
+       1.9.x      2.6.18 to 3.7
 
    Open vSwitch userspace should also work with the Linux kernel module
    built into Linux 3.3 and later.
 
    Open vSwitch userspace should also work with the Linux kernel module
    built into Linux 3.3 and later.
diff --git a/NEWS b/NEWS
index 2255805..6afc417 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ v1.9.0 - xx xxx xxxx
     - Datapath:
       - Support for ipv6 set action.
       - SKB mark matching and setting.
     - Datapath:
       - Support for ipv6 set action.
       - SKB mark matching and setting.
+      - support for Linux kernels up to 3.7
     - FreeBSD is now a supported platform, thanks to code contributions from
       Gaetano Catalli, Ed Maste, and Giuseppe Lettieri.
     - ovs-bugtool: New --ovs option to report only OVS related information.
     - FreeBSD is now a supported platform, thanks to code contributions from
       Gaetano Catalli, Ed Maste, and Giuseppe Lettieri.
     - ovs-bugtool: New --ovs option to report only OVS related information.
index faa6a00..f638ffc 100644 (file)
@@ -380,7 +380,7 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb,
        upcall.cmd = OVS_PACKET_CMD_ACTION;
        upcall.key = &OVS_CB(skb)->flow->key;
        upcall.userdata = NULL;
        upcall.cmd = OVS_PACKET_CMD_ACTION;
        upcall.key = &OVS_CB(skb)->flow->key;
        upcall.userdata = NULL;
-       upcall.pid = 0;
+       upcall.portid = 0;
 
        for (a = nla_data(attr), rem = nla_len(attr); rem > 0;
                 a = nla_next(a, &rem)) {
 
        for (a = nla_data(attr), rem = nla_len(attr); rem > 0;
                 a = nla_next(a, &rem)) {
@@ -390,7 +390,7 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb,
                        break;
 
                case OVS_USERSPACE_ATTR_PID:
                        break;
 
                case OVS_USERSPACE_ATTR_PID:
-                       upcall.pid = nla_get_u32(a);
+                       upcall.portid = nla_get_u32(a);
                        break;
                }
        }
                        break;
                }
        }
index f990b73..deb32ee 100644 (file)
@@ -61,8 +61,8 @@
 #include "vport-internal_dev.h"
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) || \
 #include "vport-internal_dev.h"
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) || \
-    LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
-#error Kernels before 2.6.18 or after 3.6 are not supported by this version of Open vSwitch.
+    LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+#error Kernels before 2.6.18 or after 3.7 are not supported by this version of Open vSwitch.
 #endif
 
 #define REHASH_FLOW_INTERVAL (10 * 60 * HZ)
 #endif
 
 #define REHASH_FLOW_INTERVAL (10 * 60 * HZ)
@@ -331,7 +331,7 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
                        upcall.cmd = OVS_PACKET_CMD_MISS;
                        upcall.key = &key;
                        upcall.userdata = NULL;
                        upcall.cmd = OVS_PACKET_CMD_MISS;
                        upcall.key = &key;
                        upcall.userdata = NULL;
-                       upcall.pid = p->upcall_pid;
+                       upcall.portid = p->upcall_portid;
                        ovs_dp_upcall(dp, skb, &upcall);
                        consume_skb(skb);
                        stats_counter = &stats->n_missed;
                        ovs_dp_upcall(dp, skb, &upcall);
                        consume_skb(skb);
                        stats_counter = &stats->n_missed;
@@ -368,7 +368,7 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
        int dp_ifindex;
        int err;
 
        int dp_ifindex;
        int err;
 
-       if (upcall_info->pid == 0) {
+       if (upcall_info->portid == 0) {
                err = -ENOTCONN;
                goto err;
        }
                err = -ENOTCONN;
                goto err;
        }
@@ -503,7 +503,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
 
        skb_copy_and_csum_dev(skb, nla_data(nla));
 
 
        skb_copy_and_csum_dev(skb, nla_data(nla));
 
-       err = genlmsg_unicast(net, user_skb, upcall_info->pid);
+       err = genlmsg_unicast(net, user_skb, upcall_info->portid);
 
 out:
        kfree_skb(nskb);
 
 out:
        kfree_skb(nskb);
@@ -920,7 +920,7 @@ static struct genl_multicast_group ovs_dp_flow_multicast_group = {
 
 /* Called with genl_lock. */
 static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
 
 /* Called with genl_lock. */
 static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
-                                 struct sk_buff *skb, u32 pid,
+                                 struct sk_buff *skb, u32 portid,
                                  u32 seq, u32 flags, u8 cmd)
 {
        const int skb_orig_len = skb->len;
                                  u32 seq, u32 flags, u8 cmd)
 {
        const int skb_orig_len = skb->len;
@@ -935,7 +935,7 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
        sf_acts = rcu_dereference_protected(flow->sf_acts,
                                            lockdep_genl_is_held());
 
        sf_acts = rcu_dereference_protected(flow->sf_acts,
                                            lockdep_genl_is_held());
 
-       ovs_header = genlmsg_put(skb, pid, seq, &dp_flow_genl_family, flags, cmd);
+       ovs_header = genlmsg_put(skb, portid, seq, &dp_flow_genl_family, flags, cmd);
        if (!ovs_header)
                return -EMSGSIZE;
 
        if (!ovs_header)
                return -EMSGSIZE;
 
@@ -1019,7 +1019,7 @@ static struct sk_buff *ovs_flow_cmd_alloc_info(struct sw_flow *flow)
 
 static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow,
                                               struct datapath *dp,
 
 static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow,
                                               struct datapath *dp,
-                                              u32 pid, u32 seq, u8 cmd)
+                                              u32 portid, u32 seq, u8 cmd)
 {
        struct sk_buff *skb;
        int retval;
 {
        struct sk_buff *skb;
        int retval;
@@ -1028,7 +1028,7 @@ static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow,
        if (!skb)
                return ERR_PTR(-ENOMEM);
 
        if (!skb)
                return ERR_PTR(-ENOMEM);
 
-       retval = ovs_flow_cmd_fill_info(flow, dp, skb, pid, seq, 0, cmd);
+       retval = ovs_flow_cmd_fill_info(flow, dp, skb, portid, seq, 0, cmd);
        BUG_ON(retval < 0);
        return skb;
 }
        BUG_ON(retval < 0);
        return skb;
 }
@@ -1108,7 +1108,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info)
                /* Put flow in bucket. */
                ovs_flow_tbl_insert(table, flow, &key, key_len);
 
                /* Put flow in bucket. */
                ovs_flow_tbl_insert(table, flow, &key, key_len);
 
-               reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid,
+               reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid,
                                                info->snd_seq,
                                                OVS_FLOW_CMD_NEW);
        } else {
                                                info->snd_seq,
                                                OVS_FLOW_CMD_NEW);
        } else {
@@ -1146,7 +1146,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info)
                        ovs_flow_deferred_free_acts(old_acts);
                }
 
                        ovs_flow_deferred_free_acts(old_acts);
                }
 
-               reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid,
+               reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid,
                                               info->snd_seq, OVS_FLOW_CMD_NEW);
 
                /* Clear stats. */
                                               info->snd_seq, OVS_FLOW_CMD_NEW);
 
                /* Clear stats. */
@@ -1158,7 +1158,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info)
        }
 
        if (!IS_ERR(reply))
        }
 
        if (!IS_ERR(reply))
-               genl_notify(reply, genl_info_net(info), info->snd_pid,
+               genl_notify(reply, genl_info_net(info), info->snd_portid,
                           ovs_dp_flow_multicast_group.id, info->nlhdr,
                           GFP_KERNEL);
        else
                           ovs_dp_flow_multicast_group.id, info->nlhdr,
                           GFP_KERNEL);
        else
@@ -1199,7 +1199,7 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info)
        if (!flow)
                return -ENOENT;
 
        if (!flow)
                return -ENOENT;
 
-       reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid,
+       reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid,
                                        info->snd_seq, OVS_FLOW_CMD_NEW);
        if (IS_ERR(reply))
                return PTR_ERR(reply);
                                        info->snd_seq, OVS_FLOW_CMD_NEW);
        if (IS_ERR(reply))
                return PTR_ERR(reply);
@@ -1241,13 +1241,13 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
 
        ovs_flow_tbl_remove(table, flow);
 
 
        ovs_flow_tbl_remove(table, flow);
 
-       err = ovs_flow_cmd_fill_info(flow, dp, reply, info->snd_pid,
+       err = ovs_flow_cmd_fill_info(flow, dp, reply, info->snd_portid,
                                     info->snd_seq, 0, OVS_FLOW_CMD_DEL);
        BUG_ON(err < 0);
 
        ovs_flow_deferred_free(flow);
 
                                     info->snd_seq, 0, OVS_FLOW_CMD_DEL);
        BUG_ON(err < 0);
 
        ovs_flow_deferred_free(flow);
 
-       genl_notify(reply, genl_info_net(info), info->snd_pid,
+       genl_notify(reply, genl_info_net(info), info->snd_portid,
                    ovs_dp_flow_multicast_group.id, info->nlhdr, GFP_KERNEL);
        return 0;
 }
                    ovs_dp_flow_multicast_group.id, info->nlhdr, GFP_KERNEL);
        return 0;
 }
@@ -1275,7 +1275,7 @@ static int ovs_flow_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
                        break;
 
                if (ovs_flow_cmd_fill_info(flow, dp, skb,
                        break;
 
                if (ovs_flow_cmd_fill_info(flow, dp, skb,
-                                          NETLINK_CB(cb->skb).pid,
+                                          NETLINK_CB(cb->skb).portid,
                                           cb->nlh->nlmsg_seq, NLM_F_MULTI,
                                           OVS_FLOW_CMD_NEW) < 0)
                        break;
                                           cb->nlh->nlmsg_seq, NLM_F_MULTI,
                                           OVS_FLOW_CMD_NEW) < 0)
                        break;
@@ -1331,13 +1331,13 @@ static struct genl_multicast_group ovs_dp_datapath_multicast_group = {
 };
 
 static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb,
 };
 
 static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb,
-                               u32 pid, u32 seq, u32 flags, u8 cmd)
+                               u32 portid, u32 seq, u32 flags, u8 cmd)
 {
        struct ovs_header *ovs_header;
        struct ovs_dp_stats dp_stats;
        int err;
 
 {
        struct ovs_header *ovs_header;
        struct ovs_dp_stats dp_stats;
        int err;
 
-       ovs_header = genlmsg_put(skb, pid, seq, &dp_datapath_genl_family,
+       ovs_header = genlmsg_put(skb, portid, seq, &dp_datapath_genl_family,
                                   flags, cmd);
        if (!ovs_header)
                goto error;
                                   flags, cmd);
        if (!ovs_header)
                goto error;
@@ -1362,7 +1362,7 @@ error:
        return -EMSGSIZE;
 }
 
        return -EMSGSIZE;
 }
 
-static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 pid,
+static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 portid,
                                             u32 seq, u8 cmd)
 {
        struct sk_buff *skb;
                                             u32 seq, u8 cmd)
 {
        struct sk_buff *skb;
@@ -1372,7 +1372,7 @@ static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 pid,
        if (!skb)
                return ERR_PTR(-ENOMEM);
 
        if (!skb)
                return ERR_PTR(-ENOMEM);
 
-       retval = ovs_dp_cmd_fill_info(dp, skb, pid, seq, 0, cmd);
+       retval = ovs_dp_cmd_fill_info(dp, skb, portid, seq, 0, cmd);
        if (retval < 0) {
                kfree_skb(skb);
                return ERR_PTR(retval);
        if (retval < 0) {
                kfree_skb(skb);
                return ERR_PTR(retval);
@@ -1465,7 +1465,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
        parms.options = NULL;
        parms.dp = dp;
        parms.port_no = OVSP_LOCAL;
        parms.options = NULL;
        parms.dp = dp;
        parms.port_no = OVSP_LOCAL;
-       parms.upcall_pid = nla_get_u32(a[OVS_DP_ATTR_UPCALL_PID]);
+       parms.upcall_portid = nla_get_u32(a[OVS_DP_ATTR_UPCALL_PID]);
 
        vport = new_vport(&parms);
        if (IS_ERR(vport)) {
 
        vport = new_vport(&parms);
        if (IS_ERR(vport)) {
@@ -1476,7 +1476,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
                goto err_destroy_ports_array;
        }
 
                goto err_destroy_ports_array;
        }
 
-       reply = ovs_dp_cmd_build_info(dp, info->snd_pid,
+       reply = ovs_dp_cmd_build_info(dp, info->snd_portid,
                                      info->snd_seq, OVS_DP_CMD_NEW);
        err = PTR_ERR(reply);
        if (IS_ERR(reply))
                                      info->snd_seq, OVS_DP_CMD_NEW);
        err = PTR_ERR(reply);
        if (IS_ERR(reply))
@@ -1488,7 +1488,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
 
        rtnl_unlock();
 
 
        rtnl_unlock();
 
-       genl_notify(reply, genl_info_net(info), info->snd_pid,
+       genl_notify(reply, genl_info_net(info), info->snd_portid,
                    ovs_dp_datapath_multicast_group.id, info->nlhdr,
                    GFP_KERNEL);
        return 0;
                    ovs_dp_datapath_multicast_group.id, info->nlhdr,
                    GFP_KERNEL);
        return 0;
@@ -1555,7 +1555,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info)
        if (IS_ERR(dp))
                return err;
 
        if (IS_ERR(dp))
                return err;
 
-       reply = ovs_dp_cmd_build_info(dp, info->snd_pid,
+       reply = ovs_dp_cmd_build_info(dp, info->snd_portid,
                                      info->snd_seq, OVS_DP_CMD_DEL);
        err = PTR_ERR(reply);
        if (IS_ERR(reply))
                                      info->snd_seq, OVS_DP_CMD_DEL);
        err = PTR_ERR(reply);
        if (IS_ERR(reply))
@@ -1563,7 +1563,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info)
 
        __dp_destroy(dp);
 
 
        __dp_destroy(dp);
 
-       genl_notify(reply, genl_info_net(info), info->snd_pid,
+       genl_notify(reply, genl_info_net(info), info->snd_portid,
                    ovs_dp_datapath_multicast_group.id, info->nlhdr,
                    GFP_KERNEL);
 
                    ovs_dp_datapath_multicast_group.id, info->nlhdr,
                    GFP_KERNEL);
 
@@ -1584,7 +1584,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info)
        if (IS_ERR(dp))
                return PTR_ERR(dp);
 
        if (IS_ERR(dp))
                return PTR_ERR(dp);
 
-       reply = ovs_dp_cmd_build_info(dp, info->snd_pid,
+       reply = ovs_dp_cmd_build_info(dp, info->snd_portid,
                                      info->snd_seq, OVS_DP_CMD_NEW);
        if (IS_ERR(reply)) {
                err = PTR_ERR(reply);
                                      info->snd_seq, OVS_DP_CMD_NEW);
        if (IS_ERR(reply)) {
                err = PTR_ERR(reply);
@@ -1593,7 +1593,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info)
                return 0;
        }
 
                return 0;
        }
 
-       genl_notify(reply, genl_info_net(info), info->snd_pid,
+       genl_notify(reply, genl_info_net(info), info->snd_portid,
                    ovs_dp_datapath_multicast_group.id, info->nlhdr,
                    GFP_KERNEL);
 
                    ovs_dp_datapath_multicast_group.id, info->nlhdr,
                    GFP_KERNEL);
 
@@ -1614,7 +1614,7 @@ static int ovs_dp_cmd_get(struct sk_buff *skb, struct genl_info *info)
        if (IS_ERR(dp))
                return PTR_ERR(dp);
 
        if (IS_ERR(dp))
                return PTR_ERR(dp);
 
-       reply = ovs_dp_cmd_build_info(dp, info->snd_pid,
+       reply = ovs_dp_cmd_build_info(dp, info->snd_portid,
                                      info->snd_seq, OVS_DP_CMD_NEW);
        if (IS_ERR(reply))
                return PTR_ERR(reply);
                                      info->snd_seq, OVS_DP_CMD_NEW);
        if (IS_ERR(reply))
                return PTR_ERR(reply);
@@ -1631,7 +1631,7 @@ static int ovs_dp_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
 
        list_for_each_entry(dp, &ovs_net->dps, list_node) {
                if (i >= skip &&
 
        list_for_each_entry(dp, &ovs_net->dps, list_node) {
                if (i >= skip &&
-                   ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).pid,
+                   ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).portid,
                                         cb->nlh->nlmsg_seq, NLM_F_MULTI,
                                         OVS_DP_CMD_NEW) < 0)
                        break;
                                         cb->nlh->nlmsg_seq, NLM_F_MULTI,
                                         OVS_DP_CMD_NEW) < 0)
                        break;
@@ -1697,13 +1697,13 @@ struct genl_multicast_group ovs_dp_vport_multicast_group = {
 
 /* Called with RTNL lock or RCU read lock. */
 static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb,
 
 /* Called with RTNL lock or RCU read lock. */
 static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb,
-                                  u32 pid, u32 seq, u32 flags, u8 cmd)
+                                  u32 portid, u32 seq, u32 flags, u8 cmd)
 {
        struct ovs_header *ovs_header;
        struct ovs_vport_stats vport_stats;
        int err;
 
 {
        struct ovs_header *ovs_header;
        struct ovs_vport_stats vport_stats;
        int err;
 
-       ovs_header = genlmsg_put(skb, pid, seq, &dp_vport_genl_family,
+       ovs_header = genlmsg_put(skb, portid, seq, &dp_vport_genl_family,
                                 flags, cmd);
        if (!ovs_header)
                return -EMSGSIZE;
                                 flags, cmd);
        if (!ovs_header)
                return -EMSGSIZE;
@@ -1713,7 +1713,7 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb,
        if (nla_put_u32(skb, OVS_VPORT_ATTR_PORT_NO, vport->port_no) ||
            nla_put_u32(skb, OVS_VPORT_ATTR_TYPE, vport->ops->type) ||
            nla_put_string(skb, OVS_VPORT_ATTR_NAME, vport->ops->get_name(vport)) ||
        if (nla_put_u32(skb, OVS_VPORT_ATTR_PORT_NO, vport->port_no) ||
            nla_put_u32(skb, OVS_VPORT_ATTR_TYPE, vport->ops->type) ||
            nla_put_string(skb, OVS_VPORT_ATTR_NAME, vport->ops->get_name(vport)) ||
-           nla_put_u32(skb, OVS_VPORT_ATTR_UPCALL_PID, vport->upcall_pid))
+           nla_put_u32(skb, OVS_VPORT_ATTR_UPCALL_PID, vport->upcall_portid))
                goto nla_put_failure;
 
        ovs_vport_get_stats(vport, &vport_stats);
                goto nla_put_failure;
 
        ovs_vport_get_stats(vport, &vport_stats);
@@ -1739,7 +1739,7 @@ error:
 }
 
 /* Called with RTNL lock or RCU read lock. */
 }
 
 /* Called with RTNL lock or RCU read lock. */
-struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 pid,
+struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 portid,
                                         u32 seq, u8 cmd)
 {
        struct sk_buff *skb;
                                         u32 seq, u8 cmd)
 {
        struct sk_buff *skb;
@@ -1749,7 +1749,7 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 pid,
        if (!skb)
                return ERR_PTR(-ENOMEM);
 
        if (!skb)
                return ERR_PTR(-ENOMEM);
 
-       retval = ovs_vport_cmd_fill_info(vport, skb, pid, seq, 0, cmd);
+       retval = ovs_vport_cmd_fill_info(vport, skb, portid, seq, 0, cmd);
        if (retval < 0) {
                kfree_skb(skb);
                return ERR_PTR(retval);
        if (retval < 0) {
                kfree_skb(skb);
                return ERR_PTR(retval);
@@ -1865,7 +1865,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
        parms.options = a[OVS_VPORT_ATTR_OPTIONS];
        parms.dp = dp;
        parms.port_no = port_no;
        parms.options = a[OVS_VPORT_ATTR_OPTIONS];
        parms.dp = dp;
        parms.port_no = port_no;
-       parms.upcall_pid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);
+       parms.upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);
 
        vport = new_vport(&parms);
        err = PTR_ERR(vport);
 
        vport = new_vport(&parms);
        err = PTR_ERR(vport);
@@ -1876,7 +1876,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
 
        err = change_vport(vport, a);
        if (!err) {
 
        err = change_vport(vport, a);
        if (!err) {
-               reply = ovs_vport_cmd_build_info(vport, info->snd_pid,
+               reply = ovs_vport_cmd_build_info(vport, info->snd_portid,
                                                 info->snd_seq,
                                                 OVS_VPORT_CMD_NEW);
                if (IS_ERR(reply))
                                                 info->snd_seq,
                                                 OVS_VPORT_CMD_NEW);
                if (IS_ERR(reply))
@@ -1886,7 +1886,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
                ovs_dp_detach_port(vport);
                goto exit_unlock;
        }
                ovs_dp_detach_port(vport);
                goto exit_unlock;
        }
-       genl_notify(reply, genl_info_net(info), info->snd_pid,
+       genl_notify(reply, genl_info_net(info), info->snd_portid,
                    ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
 
 exit_unlock:
                    ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
 
 exit_unlock:
@@ -1924,17 +1924,17 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
        else
                goto exit_unlock;
        if (!err && a[OVS_VPORT_ATTR_UPCALL_PID])
        else
                goto exit_unlock;
        if (!err && a[OVS_VPORT_ATTR_UPCALL_PID])
-               vport->upcall_pid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);
+               vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);
 
 
-       reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq,
-                                        OVS_VPORT_CMD_NEW);
+       reply = ovs_vport_cmd_build_info(vport, info->snd_portid,
+                                        info->snd_seq, OVS_VPORT_CMD_NEW);
        if (IS_ERR(reply)) {
                netlink_set_err(GENL_SOCK(sock_net(skb->sk)), 0,
                                ovs_dp_vport_multicast_group.id, PTR_ERR(reply));
                goto exit_unlock;
        }
 
        if (IS_ERR(reply)) {
                netlink_set_err(GENL_SOCK(sock_net(skb->sk)), 0,
                                ovs_dp_vport_multicast_group.id, PTR_ERR(reply));
                goto exit_unlock;
        }
 
-       genl_notify(reply, genl_info_net(info), info->snd_pid,
+       genl_notify(reply, genl_info_net(info), info->snd_portid,
                    ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
 
 exit_unlock:
                    ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
 
 exit_unlock:
@@ -1965,15 +1965,15 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
                goto exit_unlock;
        }
 
                goto exit_unlock;
        }
 
-       reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq,
-                                        OVS_VPORT_CMD_DEL);
+       reply = ovs_vport_cmd_build_info(vport, info->snd_portid,
+                                        info->snd_seq, OVS_VPORT_CMD_DEL);
        err = PTR_ERR(reply);
        if (IS_ERR(reply))
                goto exit_unlock;
 
        ovs_dp_detach_port(vport);
 
        err = PTR_ERR(reply);
        if (IS_ERR(reply))
                goto exit_unlock;
 
        ovs_dp_detach_port(vport);
 
-       genl_notify(reply, genl_info_net(info), info->snd_pid,
+       genl_notify(reply, genl_info_net(info), info->snd_portid,
                    ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
 
 exit_unlock:
                    ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL);
 
 exit_unlock:
@@ -2000,8 +2000,8 @@ static int ovs_vport_cmd_get(struct sk_buff *skb, struct genl_info *info)
        if (IS_ERR(vport))
                goto exit_unlock;
 
        if (IS_ERR(vport))
                goto exit_unlock;
 
-       reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq,
-                                        OVS_VPORT_CMD_NEW);
+       reply = ovs_vport_cmd_build_info(vport, info->snd_portid,
+                                        info->snd_seq, OVS_VPORT_CMD_NEW);
        err = PTR_ERR(reply);
        if (IS_ERR(reply))
                goto exit_unlock;
        err = PTR_ERR(reply);
        if (IS_ERR(reply))
                goto exit_unlock;
@@ -2036,7 +2036,7 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
                hlist_for_each_entry_rcu(vport, n, &dp->ports[i], dp_hash_node) {
                        if (j >= skip &&
                            ovs_vport_cmd_fill_info(vport, skb,
                hlist_for_each_entry_rcu(vport, n, &dp->ports[i], dp_hash_node) {
                        if (j >= skip &&
                            ovs_vport_cmd_fill_info(vport, skb,
-                                                   NETLINK_CB(cb->skb).pid,
+                                                   NETLINK_CB(cb->skb).portid,
                                                    cb->nlh->nlmsg_seq,
                                                    NLM_F_MULTI,
                                                    OVS_VPORT_CMD_NEW) < 0)
                                                    cb->nlh->nlmsg_seq,
                                                    NLM_F_MULTI,
                                                    OVS_VPORT_CMD_NEW) < 0)
index c5df12d..af2e5a1 100644 (file)
@@ -125,7 +125,7 @@ struct ovs_skb_cb {
  * @key: Becomes %OVS_PACKET_ATTR_KEY.  Must be nonnull.
  * @userdata: If nonnull, its u64 value is extracted and passed to userspace as
  * %OVS_PACKET_ATTR_USERDATA.
  * @key: Becomes %OVS_PACKET_ATTR_KEY.  Must be nonnull.
  * @userdata: If nonnull, its u64 value is extracted and passed to userspace as
  * %OVS_PACKET_ATTR_USERDATA.
- * @pid: Netlink PID to which packet should be sent.  If @pid is 0 then no
+ * @portid: Netlink PID to which packet should be sent.  If @portid is 0 then no
  * packet is sent and the packet is accounted in the datapath's @n_lost
  * counter.
  */
  * packet is sent and the packet is accounted in the datapath's @n_lost
  * counter.
  */
@@ -133,7 +133,7 @@ struct dp_upcall_info {
        u8 cmd;
        const struct sw_flow_key *key;
        const struct nlattr *userdata;
        u8 cmd;
        const struct sw_flow_key *key;
        const struct nlattr *userdata;
-       u32 pid;
+       u32 portid;
 };
 
 /**
 };
 
 /**
@@ -189,7 +189,7 @@ int ovs_dp_upcall(struct datapath *, struct sk_buff *,
                  const struct dp_upcall_info *);
 
 const char *ovs_dp_name(const struct datapath *dp);
                  const struct dp_upcall_info *);
 
 const char *ovs_dp_name(const struct datapath *dp);
-struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 pid, u32 seq,
+struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 portid, u32 seq,
                                         u8 cmd);
 
 int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb);
                                         u8 cmd);
 
 int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb);
index 81556d5..eae98e7 100644 (file)
@@ -61,6 +61,7 @@ openvswitch_headers += \
        linux/compat/include/net/checksum.h \
        linux/compat/include/net/dst.h \
        linux/compat/include/net/genetlink.h \
        linux/compat/include/net/checksum.h \
        linux/compat/include/net/dst.h \
        linux/compat/include/net/genetlink.h \
+       linux/compat/include/net/inet_frag.h \
        linux/compat/include/net/ip.h \
        linux/compat/include/net/ipv6.h \
        linux/compat/include/net/net_namespace.h \
        linux/compat/include/net/ip.h \
        linux/compat/include/net/ipv6.h \
        linux/compat/include/net/net_namespace.h \
index af7d5fd..31ff282 100644 (file)
@@ -5,6 +5,17 @@
 #include <linux/netlink.h>
 #include <net/net_namespace.h>
 
 #include <linux/netlink.h>
 #include <net/net_namespace.h>
 
+/*
+ * 15e473046cb6e5d18a4d0057e61d76315230382b renames pid to portid
+ * the affected structures are
+ * netlink_skb_parms::pid -> portid
+ * genl_info::snd_pid -> snd_portid
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+#define snd_portid snd_pid
+#define portid pid
+#endif
+
 /* Very special super-nasty workaround here:
  *
  * Before 2.6.19, nlmsg_multicast() lacked a 'flags' parameter.  We work
 /* Very special super-nasty workaround here:
  *
  * Before 2.6.19, nlmsg_multicast() lacked a 'flags' parameter.  We work
@@ -126,7 +137,7 @@ static inline void *genlmsg_put_reply(struct sk_buff *skb,
                        struct genl_info *info, struct genl_family *family,
                        int flags, u8 cmd)
 {
                        struct genl_info *info, struct genl_family *family,
                        int flags, u8 cmd)
 {
-       return genlmsg_put(skb, info->snd_pid, info->snd_seq, family,
+       return genlmsg_put(skb, info->snd_portid, info->snd_seq, family,
                                flags, cmd);
 }
 
                                flags, cmd);
 }
 
@@ -137,7 +148,7 @@ static inline void *genlmsg_put_reply(struct sk_buff *skb,
  */
 static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info)
 {
  */
 static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info)
 {
-       return genlmsg_unicast(skb, info->snd_pid);
+       return genlmsg_unicast(skb, info->snd_portid);
 }
 
 /**
 }
 
 /**
diff --git a/datapath/linux/compat/include/net/inet_frag.h b/datapath/linux/compat/include/net/inet_frag.h
new file mode 100644 (file)
index 0000000..6767c31
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef __NET_INET_FRAG_WRAPPER_H
+#define __NET_INET_FRAG_WRAPPER_H 1
+
+#include <linux/version.h>
+#include_next <net/inet_frag.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+#define inet_frag_evictor(nf, f, force)                                        \
+       do {                                                            \
+               if (force || atomic_read(&nf->mem) > nf->high_thresh) { \
+                       inet_frag_evictor(nf, f);                       \
+               }                                                       \
+       } while (0)
+#endif
+
+#endif /* inet_frag.h */
index 5f31732..cea6bfd 100644 (file)
@@ -143,7 +143,11 @@ static struct sk_buff *defrag(struct sk_buff *, bool frag_last);
 
 static void capwap_frag_init(struct inet_frag_queue *, void *match);
 static unsigned int capwap_frag_hash(struct inet_frag_queue *);
 
 static void capwap_frag_init(struct inet_frag_queue *, void *match);
 static unsigned int capwap_frag_hash(struct inet_frag_queue *);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 static int capwap_frag_match(struct inet_frag_queue *, void *match);
 static int capwap_frag_match(struct inet_frag_queue *, void *match);
+#else
+static bool capwap_frag_match(struct inet_frag_queue *, void *match);
+#endif
 static void capwap_frag_expire(unsigned long ifq);
 
 static struct inet_frags frag_state = {
 static void capwap_frag_expire(unsigned long ifq);
 
 static struct inet_frags frag_state = {
@@ -769,8 +773,7 @@ static struct sk_buff *defrag(struct sk_buff *skb, bool frag_last)
        u16 frag_off;
        struct frag_queue *fq;
 
        u16 frag_off;
        struct frag_queue *fq;
 
-       if (atomic_read(&ns_frag_state->mem) > ns_frag_state->high_thresh)
-               inet_frag_evictor(ns_frag_state, &frag_state);
+       inet_frag_evictor(ns_frag_state, &frag_state, false);
 
        match.daddr = iph->daddr;
        match.saddr = iph->saddr;
 
        match.daddr = iph->daddr;
        match.saddr = iph->saddr;
@@ -804,7 +807,11 @@ static unsigned int capwap_frag_hash(struct inet_frag_queue *ifq)
        return frag_hash(&ifq_cast(ifq)->match);
 }
 
        return frag_hash(&ifq_cast(ifq)->match);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 static int capwap_frag_match(struct inet_frag_queue *ifq, void *a_)
 static int capwap_frag_match(struct inet_frag_queue *ifq, void *a_)
+#else
+static bool capwap_frag_match(struct inet_frag_queue *ifq, void *a_)
+#endif
 {
        struct frag_match *a = a_;
        struct frag_match *b = &ifq_cast(ifq)->match;
 {
        struct frag_match *a = a_;
        struct frag_match *b = &ifq_cast(ifq)->match;
index a1c7542..d03be10 100644 (file)
@@ -193,7 +193,7 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops,
 
        vport->dp = parms->dp;
        vport->port_no = parms->port_no;
 
        vport->dp = parms->dp;
        vport->port_no = parms->port_no;
-       vport->upcall_pid = parms->upcall_pid;
+       vport->upcall_portid = parms->upcall_portid;
        vport->ops = ops;
        INIT_HLIST_NODE(&vport->dp_hash_node);
 
        vport->ops = ops;
        INIT_HLIST_NODE(&vport->dp_hash_node);
 
index 1a2e9ef..3cea3a0 100644 (file)
@@ -79,7 +79,7 @@ struct vport_err_stats {
  * @linkname: The name of the link from /sys/class/net/<datapath>/brif to this
  * &struct vport.  (We keep this around so that we can delete it if the
  * device gets renamed.)  Set to the null string when no link exists.
  * @linkname: The name of the link from /sys/class/net/<datapath>/brif to this
  * &struct vport.  (We keep this around so that we can delete it if the
  * device gets renamed.)  Set to the null string when no link exists.
- * @upcall_pid: The Netlink port to use for packets received on this port that
+ * @upcall_portid: The Netlink port to use for packets received on this port that
  * miss the flow table.
  * @port_no: Index into @dp's @ports array.
  * @hash_node: Element in @dev_table hash table in vport.c.
  * miss the flow table.
  * @port_no: Index into @dp's @ports array.
  * @hash_node: Element in @dev_table hash table in vport.c.
@@ -96,7 +96,7 @@ struct vport {
        struct datapath *dp;
        struct kobject kobj;
        char linkname[IFNAMSIZ];
        struct datapath *dp;
        struct kobject kobj;
        char linkname[IFNAMSIZ];
-       u32 upcall_pid;
+       u32 upcall_portid;
        u16 port_no;
 
        struct hlist_node hash_node;
        u16 port_no;
 
        struct hlist_node hash_node;
@@ -132,7 +132,7 @@ struct vport_parms {
        /* For ovs_vport_alloc(). */
        struct datapath *dp;
        u16 port_no;
        /* For ovs_vport_alloc(). */
        struct datapath *dp;
        u16 port_no;
-       u32 upcall_pid;
+       u32 upcall_portid;
 };
 
 /**
 };
 
 /**
index a0359bb..9ec352a 100644 (file)
@@ -14,6 +14,7 @@ openvswitch (1.9.0-1) unstable; urgency=low
     - Datapath:
       - Support for ipv6 set action.
       - SKB mark matching and setting.
     - Datapath:
       - Support for ipv6 set action.
       - SKB mark matching and setting.
+      - support for Linux kernels up to 3.7
     - FreeBSD is now a supported platform, thanks to code contributions from
       Gaetano Catalli, Ed Maste, and Giuseppe Lettieri.
     - ovs-bugtool: New --ovs option to report only OVS related information.
     - FreeBSD is now a supported platform, thanks to code contributions from
       Gaetano Catalli, Ed Maste, and Giuseppe Lettieri.
     - ovs-bugtool: New --ovs option to report only OVS related information.