From: Jiri Benc <jbenc@redhat.com>
To: netdev@vger.kernel.org
Subject: [PATCH net-next 1/5] vxlan: consolidate GBP handling even more
Date: Tue, 23 Feb 2016 18:02:55 +0100 [thread overview]
Message-ID: <4efe2a3320a88949ce9ee9aaed5edd80459321c4.1456246786.git.jbenc@redhat.com> (raw)
In-Reply-To: <cover.1456246786.git.jbenc@redhat.com>
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>
---
drivers/net/vxlan.c | 9 +++++----
1 file 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
--
1.8.3.1
next prev parent reply other threads:[~2016-02-23 17:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 17:02 [PATCH net-next 0/5] vxlan: consolidate rx handling Jiri Benc
2016-02-23 17:02 ` Jiri Benc [this message]
2016-02-23 17:02 ` [PATCH net-next 2/5] vxlan: move inner L2 header processing to a separate function Jiri Benc
2016-02-23 17:02 ` [PATCH net-next 3/5] vxlan: move ECN decapsulation " Jiri Benc
2016-02-23 17:02 ` [PATCH net-next 4/5] vxlan: consolidate rx handling to a single function Jiri Benc
2016-02-23 17:02 ` [PATCH net-next 5/5] vxlan: simplify metadata_dst usage in vxlan_rcv Jiri Benc
2016-02-25 20:19 ` [PATCH net-next 0/5] vxlan: consolidate rx handling David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4efe2a3320a88949ce9ee9aaed5edd80459321c4.1456246786.git.jbenc@redhat.com \
--to=jbenc@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).