aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2016-02-23 18:02:55 +0100
committerDavid S. Miller <davem@davemloft.net>2016-02-25 15:17:11 -0500
commit64f87d3616a01c53262c6e0e948d62df15923f1c (patch)
treeb41fb5468bb8e49fde7076ba6131eb092c34e56d /drivers/net/vxlan.c
parentMerge branch 'tc_action-ns' (diff)
downloadlinux-dev-64f87d3616a01c53262c6e0e948d62df15923f1c.tar.xz
linux-dev-64f87d3616a01c53262c6e0e948d62df15923f1c.zip
vxlan: consolidate GBP handling even more
Now when the packet is scrubbed early, skb->mark can be set in the GBP handling code. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 909f7931c297..656a303c0ac8 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1164,6 +1164,7 @@ out:
}
static void vxlan_parse_gbp_hdr(struct vxlanhdr *unparsed,
+ struct sk_buff *skb, u32 vxflags,
struct vxlan_metadata *md,
struct metadata_dst *tun_dst)
{
@@ -1183,6 +1184,9 @@ static void vxlan_parse_gbp_hdr(struct vxlanhdr *unparsed,
if (gbp->policy_applied)
md->gbp |= VXLAN_GBP_POLICY_APPLIED;
+ /* In flow-based mode, GBP is carried in dst_metadata */
+ if (!(vxflags & VXLAN_F_COLLECT_METADATA))
+ skb->mark = md->gbp;
out:
unparsed->vx_flags &= ~VXLAN_GBP_USED_BITS;
}
@@ -1228,9 +1232,6 @@ static void vxlan_rcv(struct vxlan_dev *vxlan, struct vxlan_sock *vs,
goto drop;
skb_reset_network_header(skb);
- /* In flow-based mode, GBP is carried in dst_metadata */
- if (!(vs->flags & VXLAN_F_COLLECT_METADATA))
- skb->mark = md->gbp;
if (oip6)
err = IP6_ECN_decapsulate(oip6, skb);
@@ -1329,7 +1330,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
if (!vxlan_remcsum(&unparsed, skb, vs->flags))
goto drop;
if (vs->flags & VXLAN_F_GBP)
- vxlan_parse_gbp_hdr(&unparsed, md, tun_dst);
+ vxlan_parse_gbp_hdr(&unparsed, skb, vs->flags, md, tun_dst);
if (unparsed.vx_flags || unparsed.vx_vni) {
/* If there are any unprocessed flags remaining treat