All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] bpf: move bpf csum flag check
@ 2017-12-04 22:18 William Tu
  2017-12-04 22:53 ` Daniel Borkmann
  0 siblings, 1 reply; 2+ messages in thread
From: William Tu @ 2017-12-04 22:18 UTC (permalink / raw)
  To: netdev

trivial move the BPF_F_ZERO_CSUM_TX check right below the
'flags & BPF_F_DONT_FRAGMENT', so common tun_flags handling
is logically together.

Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 net/core/filter.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index 8ec5a504eb28..4d644ad17457 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3013,6 +3013,8 @@ BPF_CALL_4(bpf_skb_set_tunnel_key, struct sk_buff *, skb,
 	info->key.tun_flags = TUNNEL_KEY | TUNNEL_CSUM | TUNNEL_NOCACHE;
 	if (flags & BPF_F_DONT_FRAGMENT)
 		info->key.tun_flags |= TUNNEL_DONT_FRAGMENT;
+	if (flags & BPF_F_ZERO_CSUM_TX)
+		info->key.tun_flags &= ~TUNNEL_CSUM;
 
 	info->key.tun_id = cpu_to_be64(from->tunnel_id);
 	info->key.tos = from->tunnel_tos;
@@ -3028,9 +3030,6 @@ BPF_CALL_4(bpf_skb_set_tunnel_key, struct sk_buff *, skb,
 		info->key.u.ipv4.dst = cpu_to_be32(from->remote_ipv4);
 	}
 
-	if (flags & BPF_F_ZERO_CSUM_TX)
-		info->key.tun_flags &= ~TUNNEL_CSUM;
-
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] bpf: move bpf csum flag check
  2017-12-04 22:18 [PATCH net-next] bpf: move bpf csum flag check William Tu
@ 2017-12-04 22:53 ` Daniel Borkmann
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2017-12-04 22:53 UTC (permalink / raw)
  To: William Tu, netdev

On 12/04/2017 11:18 PM, William Tu wrote:
> trivial move the BPF_F_ZERO_CSUM_TX check right below the
> 'flags & BPF_F_DONT_FRAGMENT', so common tun_flags handling
> is logically together.
> 
> Signed-off-by: William Tu <u9012063@gmail.com>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>

Applied to bpf-next, thanks William.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-04 22:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04 22:18 [PATCH net-next] bpf: move bpf csum flag check William Tu
2017-12-04 22:53 ` Daniel Borkmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.