git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
datapath: Cleanup netlink compat code.
[sliver-openvswitch.git]
/
datapath
/
datapath.c
diff --git
a/datapath/datapath.c
b/datapath/datapath.c
index
190b61b
..
2063f5c
100644
(file)
--- a/
datapath/datapath.c
+++ b/
datapath/datapath.c
@@
-54,19
+54,12
@@
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
-#include "checksum.h"
#include "datapath.h"
#include "flow.h"
#include "vlan.h"
#include "datapath.h"
#include "flow.h"
#include "vlan.h"
-#include "tunnel.h"
#include "vport-internal_dev.h"
#include "vport-netdev.h"
#include "vport-internal_dev.h"
#include "vport-netdev.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) || \
- LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
-#error Kernels before 2.6.18 or after 3.9 are not supported by this version of Open vSwitch.
-#endif
-
#define REHASH_FLOW_INTERVAL (10 * 60 * HZ)
static void rehash_flow_table(struct work_struct *work);
static DECLARE_DELAYED_WORK(rehash_flow_wq, rehash_flow_table);
#define REHASH_FLOW_INTERVAL (10 * 60 * HZ)
static void rehash_flow_table(struct work_struct *work);
static DECLARE_DELAYED_WORK(rehash_flow_wq, rehash_flow_table);
@@
-279,7
+272,8
@@
static struct genl_family dp_packet_genl_family = {
.name = OVS_PACKET_FAMILY,
.version = OVS_PACKET_VERSION,
.maxattr = OVS_PACKET_ATTR_MAX,
.name = OVS_PACKET_FAMILY,
.version = OVS_PACKET_VERSION,
.maxattr = OVS_PACKET_ATTR_MAX,
- SET_NETNSOK
+ .netnsok = true,
+ SET_PARALLEL_OPS
};
int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
};
int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
@@
-300,8
+294,6
@@
int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
goto err;
}
goto err;
}
- forward_ip_summed(skb, true);
-
if (!skb_is_gso(skb))
err = queue_userspace_packet(ovs_dp_get_net(dp), dp_ifindex, skb, upcall_info);
else
if (!skb_is_gso(skb))
err = queue_userspace_packet(ovs_dp_get_net(dp), dp_ifindex, skb, upcall_info);
else
@@
-419,10
+411,12
@@
static int queue_userspace_packet(struct net *net, int dp_ifindex,
nskb = skb_clone(skb, GFP_ATOMIC);
if (!nskb)
return -ENOMEM;
nskb = skb_clone(skb, GFP_ATOMIC);
if (!nskb)
return -ENOMEM;
-
- err = vlan_deaccel_tag(nskb);
- if (err)
- return err;
+
+ nskb = __vlan_put_tag(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb));
+ if (!nskb)
+ return -ENOMEM;
+
+ vlan_set_tci(nskb, 0);
skb = nskb;
}
skb = nskb;
}
@@
-662,14
+656,8
@@
static int validate_set(const struct nlattr *a,
int err;
case OVS_KEY_ATTR_PRIORITY:
int err;
case OVS_KEY_ATTR_PRIORITY:
- case OVS_KEY_ATTR_ETHERNET:
- break;
-
case OVS_KEY_ATTR_SKB_MARK:
case OVS_KEY_ATTR_SKB_MARK:
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) && !defined(CONFIG_NETFILTER)
- if (nla_get_u32(ovs_key) != 0)
- return -EINVAL;
-#endif
+ case OVS_KEY_ATTR_ETHERNET:
break;
case OVS_KEY_ATTR_TUNNEL:
break;
case OVS_KEY_ATTR_TUNNEL:
@@
-726,6
+714,12
@@
static int validate_set(const struct nlattr *a,
return validate_tp_port(flow_key);
return validate_tp_port(flow_key);
+ case OVS_KEY_ATTR_SCTP:
+ if (flow_key->ip.proto != IPPROTO_SCTP)
+ return -EINVAL;
+
+ return validate_tp_port(flow_key);
+
default:
return -EINVAL;
}
default:
return -EINVAL;
}
@@
-926,7
+920,7
@@
static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
OVS_CB(packet)->flow = flow;
OVS_CB(packet)->pkt_key = &flow->key;
packet->priority = flow->key.phy.priority;
OVS_CB(packet)->flow = flow;
OVS_CB(packet)->pkt_key = &flow->key;
packet->priority = flow->key.phy.priority;
-
skb_set_mark(packet, flow->key.phy.skb_mark)
;
+
packet->mark = flow->key.phy.skb_mark
;
rcu_read_lock();
dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex);
rcu_read_lock();
dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex);
@@
-1009,7
+1003,8
@@
static struct genl_family dp_flow_genl_family = {
.name = OVS_FLOW_FAMILY,
.version = OVS_FLOW_VERSION,
.maxattr = OVS_FLOW_ATTR_MAX,
.name = OVS_FLOW_FAMILY,
.version = OVS_FLOW_VERSION,
.maxattr = OVS_FLOW_ATTR_MAX,
- SET_NETNSOK
+ .netnsok = true,
+ SET_PARALLEL_OPS
};
static struct genl_multicast_group ovs_dp_flow_multicast_group = {
};
static struct genl_multicast_group ovs_dp_flow_multicast_group = {
@@
-1392,7
+1387,7
@@
static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info)
if (!IS_ERR(reply))
ovs_notify(reply, info, &ovs_dp_flow_multicast_group);
else
if (!IS_ERR(reply))
ovs_notify(reply, info, &ovs_dp_flow_multicast_group);
else
- netlink_set_err(
GENL_SOCK(sock_net(skb->sk))
, 0,
+ netlink_set_err(
sock_net(skb->sk)->genl_sock
, 0,
ovs_dp_flow_multicast_group.id, PTR_ERR(reply));
return 0;
ovs_dp_flow_multicast_group.id, PTR_ERR(reply));
return 0;
@@
-1588,7
+1583,8
@@
static struct genl_family dp_datapath_genl_family = {
.name = OVS_DATAPATH_FAMILY,
.version = OVS_DATAPATH_VERSION,
.maxattr = OVS_DP_ATTR_MAX,
.name = OVS_DATAPATH_FAMILY,
.version = OVS_DATAPATH_VERSION,
.maxattr = OVS_DP_ATTR_MAX,
- SET_NETNSOK
+ .netnsok = true,
+ SET_PARALLEL_OPS
};
static struct genl_multicast_group ovs_dp_datapath_multicast_group = {
};
static struct genl_multicast_group ovs_dp_datapath_multicast_group = {
@@
-1854,7
+1850,7
@@
static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info)
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);
- netlink_set_err(
GENL_SOCK(sock_net(skb->sk))
, 0,
+ netlink_set_err(
sock_net(skb->sk)->genl_sock
, 0,
ovs_dp_datapath_multicast_group.id, err);
err = 0;
goto unlock;
ovs_dp_datapath_multicast_group.id, err);
err = 0;
goto unlock;
@@
-1967,7
+1963,8
@@
static struct genl_family dp_vport_genl_family = {
.name = OVS_VPORT_FAMILY,
.version = OVS_VPORT_VERSION,
.maxattr = OVS_VPORT_ATTR_MAX,
.name = OVS_VPORT_FAMILY,
.version = OVS_VPORT_VERSION,
.maxattr = OVS_VPORT_ATTR_MAX,
- SET_NETNSOK
+ .netnsok = true,
+ SET_PARALLEL_OPS
};
struct genl_multicast_group ovs_dp_vport_multicast_group = {
};
struct genl_multicast_group ovs_dp_vport_multicast_group = {