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
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
[sliver-openvswitch.git]
/
datapath
/
vport-gre.c
diff --git
a/datapath/vport-gre.c
b/datapath/vport-gre.c
index
c74f5fc
..
8737b63
100644
(file)
--- a/
datapath/vport-gre.c
+++ b/
datapath/vport-gre.c
@@
-26,8
+26,6
@@
#include <linux/if_tunnel.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
#include <linux/if_tunnel.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
-#include <linux/if_vlan.h>
-#include <linux/in.h>
#include <linux/in_route.h>
#include <linux/inetdevice.h>
#include <linux/jhash.h>
#include <linux/in_route.h>
#include <linux/inetdevice.h>
#include <linux/jhash.h>
@@
-35,10
+33,11
@@
#include <linux/kernel.h>
#include <linux/workqueue.h>
#include <linux/rculist.h>
#include <linux/kernel.h>
#include <linux/workqueue.h>
#include <linux/rculist.h>
+#include <net/net_namespace.h>
+#include <net/netns/generic.h>
#include <net/route.h>
#include <net/xfrm.h>
#include <net/route.h>
#include <net/xfrm.h>
-
#include <net/icmp.h>
#include <net/ip.h>
#include <net/ip_tunnels.h>
#include <net/icmp.h>
#include <net/ip.h>
#include <net/ip_tunnels.h>
@@
-46,7
+45,6
@@
#include <net/protocol.h>
#include "datapath.h"
#include <net/protocol.h>
#include "datapath.h"
-#include "tunnel.h"
#include "vport.h"
/* Returns the least-significant 32 bits of a __be64. */
#include "vport.h"
/* Returns the least-significant 32 bits of a __be64. */
@@
-112,7
+110,7
@@
static int gre_rcv(struct sk_buff *skb,
return PACKET_REJECT;
key = key_to_tunnel_id(tpi->key, tpi->seq);
return PACKET_REJECT;
key = key_to_tunnel_id(tpi->key, tpi->seq);
-
tnl
_tun_key_init(&tun_key, ip_hdr(skb), key, filter_tnl_flags(tpi->flags));
+
ovs_flow
_tun_key_init(&tun_key, ip_hdr(skb), key, filter_tnl_flags(tpi->flags));
ovs_vport_receive(vport, skb, &tun_key);
return PACKET_RCVD;
ovs_vport_receive(vport, skb, &tun_key);
return PACKET_RCVD;
@@
-122,15
+120,12
@@
static int __send(struct vport *vport, struct sk_buff *skb,
int tunnel_hlen,
__be32 seq, __be16 gre64_flag)
{
int tunnel_hlen,
__be32 seq, __be16 gre64_flag)
{
- struct net *net = ovs_dp_get_net(vport->dp);
struct rtable *rt;
int min_headroom;
__be16 df;
__be32 saddr;
int err;
struct rtable *rt;
int min_headroom;
__be16 df;
__be32 saddr;
int err;
- forward_ip_summed(skb, true);
-
/* Route lookup */
saddr = OVS_CB(skb)->tun_key->ipv4_src;
rt = find_route(ovs_dp_get_net(vport->dp),
/* Route lookup */
saddr = OVS_CB(skb)->tun_key->ipv4_src;
rt = find_route(ovs_dp_get_net(vport->dp),
@@
-138,7
+133,7
@@
static int __send(struct vport *vport, struct sk_buff *skb,
OVS_CB(skb)->tun_key->ipv4_dst,
IPPROTO_GRE,
OVS_CB(skb)->tun_key->ipv4_tos,
OVS_CB(skb)->tun_key->ipv4_dst,
IPPROTO_GRE,
OVS_CB(skb)->tun_key->ipv4_tos,
- skb
_get_mark(skb)
);
+ skb
->mark
);
if (IS_ERR(rt)) {
err = PTR_ERR(rt);
goto error;
if (IS_ERR(rt)) {
err = PTR_ERR(rt);
goto error;
@@
-158,9
+153,14
@@
static int __send(struct vport *vport, struct sk_buff *skb,
goto err_free_rt;
}
goto err_free_rt;
}
- if (unlikely(vlan_deaccel_tag(skb))) {
- err = -ENOMEM;
- goto err_free_rt;
+ if (vlan_tx_tag_present(skb)) {
+ if (unlikely(!__vlan_put_tag(skb,
+ skb->vlan_proto,
+ vlan_tx_tag_get(skb)))) {
+ err = -ENOMEM;
+ goto err_free_rt;
+ }
+ vlan_set_tci(skb, 0);
}
/* Push Tunnel header. */
}
/* Push Tunnel header. */
@@
-175,7
+175,7
@@
static int __send(struct vport *vport, struct sk_buff *skb,
skb->local_df = 1;
skb->local_df = 1;
- return iptunnel_xmit(
net,
rt, skb, saddr,
+ return iptunnel_xmit(rt, skb, saddr,
OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE,
OVS_CB(skb)->tun_key->ipv4_tos,
OVS_CB(skb)->tun_key->ipv4_ttl, df);
OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE,
OVS_CB(skb)->tun_key->ipv4_tos,
OVS_CB(skb)->tun_key->ipv4_ttl, df);
@@
-335,17
+335,19
@@
static __be32 be64_get_high32(__be64 x)
static int gre64_send(struct vport *vport, struct sk_buff *skb)
{
static int gre64_send(struct vport *vport, struct sk_buff *skb)
{
- int hlen;
+ int hlen = GRE_HEADER_SECTION + /* GRE Hdr */
+ GRE_HEADER_SECTION + /* GRE Key */
+ GRE_HEADER_SECTION; /* GRE SEQ */
__be32 seq;
if (unlikely(!OVS_CB(skb)->tun_key))
return -EINVAL;
__be32 seq;
if (unlikely(!OVS_CB(skb)->tun_key))
return -EINVAL;
-
hlen = ip_gre_calc_hlen(OVS_CB(skb)->tun_key->tun_flags
)
-
+
GRE_HEADER_SECTION;
+
if (OVS_CB(skb)->tun_key->tun_flags & TUNNEL_CSUM
)
+
hlen +=
GRE_HEADER_SECTION;
seq = be64_get_high32(OVS_CB(skb)->tun_key->tun_id);
seq = be64_get_high32(OVS_CB(skb)->tun_key->tun_id);
- return __send(vport, skb, hlen, seq,
TUNNEL_SEQ
);
+ return __send(vport, skb, hlen, seq,
(TUNNEL_KEY|TUNNEL_SEQ)
);
}
const struct vport_ops ovs_gre64_vport_ops = {
}
const struct vport_ops ovs_gre64_vport_ops = {