All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test_bpf: fix the dummy skb after dissector changes
@ 2016-09-12 12:04 Jakub Kicinski
  2016-09-12 13:31 ` Daniel Borkmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jakub Kicinski @ 2016-09-12 12:04 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: netdev, Hadar Hen Zion, Jakub Kicinski

Commit d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan
info from skb->vlan_tci") made flow dissector look at vlan_proto
when vlan is present.  Since test_bpf sets skb->vlan_tci to ~0
(including VLAN_TAG_PRESENT) we have to populate skb->vlan_proto.

Fixes false negative on test #24:
test_bpf: #24 LD_PAYLOAD_OFF jited:0 175 ret 0 != 42 FAIL (1 times)

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>
---
 lib/test_bpf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 93f45011a59d..94346b4d8984 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -5485,6 +5485,7 @@ static struct sk_buff *populate_skb(char *buf, int size)
 	skb->hash = SKB_HASH;
 	skb->queue_mapping = SKB_QUEUE_MAP;
 	skb->vlan_tci = SKB_VLAN_TCI;
+	skb->vlan_proto = htons(ETH_P_IP);
 	skb->dev = &dev;
 	skb->dev->ifindex = SKB_DEV_IFINDEX;
 	skb->dev->type = SKB_DEV_TYPE;
-- 
1.9.1

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

* Re: [PATCH] test_bpf: fix the dummy skb after dissector changes
  2016-09-12 12:04 [PATCH] test_bpf: fix the dummy skb after dissector changes Jakub Kicinski
@ 2016-09-12 13:31 ` Daniel Borkmann
  2016-09-12 16:18 ` Alexei Starovoitov
  2016-09-15 23:17 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2016-09-12 13:31 UTC (permalink / raw)
  To: Jakub Kicinski, Alexei Starovoitov; +Cc: netdev, Hadar Hen Zion

On 09/12/2016 02:04 PM, Jakub Kicinski wrote:
> Commit d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan
> info from skb->vlan_tci") made flow dissector look at vlan_proto
> when vlan is present.  Since test_bpf sets skb->vlan_tci to ~0
> (including VLAN_TAG_PRESENT) we have to populate skb->vlan_proto.
>
> Fixes false negative on test #24:
> test_bpf: #24 LD_PAYLOAD_OFF jited:0 175 ret 0 != 42 FAIL (1 times)
>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

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

* Re: [PATCH] test_bpf: fix the dummy skb after dissector changes
  2016-09-12 12:04 [PATCH] test_bpf: fix the dummy skb after dissector changes Jakub Kicinski
  2016-09-12 13:31 ` Daniel Borkmann
@ 2016-09-12 16:18 ` Alexei Starovoitov
  2016-09-15 23:17 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2016-09-12 16:18 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Alexei Starovoitov, Daniel Borkmann, netdev, Hadar Hen Zion

On Mon, Sep 12, 2016 at 01:04:57PM +0100, Jakub Kicinski wrote:
> Commit d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan
> info from skb->vlan_tci") made flow dissector look at vlan_proto
> when vlan is present.  Since test_bpf sets skb->vlan_tci to ~0
> (including VLAN_TAG_PRESENT) we have to populate skb->vlan_proto.
> 
> Fixes false negative on test #24:
> test_bpf: #24 LD_PAYLOAD_OFF jited:0 175 ret 0 != 42 FAIL (1 times)
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>

Thanks! This is for net-next. Pls mention that in the subj next time.
Acked-by: Alexei Starovoitov <ast@kernel.org>

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

* Re: [PATCH] test_bpf: fix the dummy skb after dissector changes
  2016-09-12 12:04 [PATCH] test_bpf: fix the dummy skb after dissector changes Jakub Kicinski
  2016-09-12 13:31 ` Daniel Borkmann
  2016-09-12 16:18 ` Alexei Starovoitov
@ 2016-09-15 23:17 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-09-15 23:17 UTC (permalink / raw)
  To: jakub.kicinski; +Cc: ast, daniel, netdev, hadarh

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Mon, 12 Sep 2016 13:04:57 +0100

> Commit d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan
> info from skb->vlan_tci") made flow dissector look at vlan_proto
> when vlan is present.  Since test_bpf sets skb->vlan_tci to ~0
> (including VLAN_TAG_PRESENT) we have to populate skb->vlan_proto.
> 
> Fixes false negative on test #24:
> test_bpf: #24 LD_PAYLOAD_OFF jited:0 175 ret 0 != 42 FAIL (1 times)
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>

Applied.

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

end of thread, other threads:[~2016-09-15 23:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 12:04 [PATCH] test_bpf: fix the dummy skb after dissector changes Jakub Kicinski
2016-09-12 13:31 ` Daniel Borkmann
2016-09-12 16:18 ` Alexei Starovoitov
2016-09-15 23:17 ` David Miller

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.