All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: also make sch_handle_egress() drop monitor ready
@ 2016-05-15 21:28 Daniel Borkmann
  2016-05-15 21:59 ` Alexei Starovoitov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Borkmann @ 2016-05-15 21:28 UTC (permalink / raw)
  To: davem; +Cc: eric.dumazet, alexei.starovoitov, jhs, netdev, Daniel Borkmann

Follow-up for 8a3a4c6e7b34 ("net: make sch_handle_ingress() drop
monitor ready") to also make the egress side drop monitor ready.

Also here only TC_ACT_SHOT is a clear indication that something
went wrong. Hence don't provide false positives to drop monitors
such as 'perf record -e skb:kfree_skb ...'.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
 net/core/dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 12436d1..904ff43 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3186,12 +3186,12 @@ sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev)
 	case TC_ACT_SHOT:
 		qdisc_qstats_cpu_drop(cl->q);
 		*ret = NET_XMIT_DROP;
-		goto drop;
+		kfree_skb(skb);
+		return NULL;
 	case TC_ACT_STOLEN:
 	case TC_ACT_QUEUED:
 		*ret = NET_XMIT_SUCCESS;
-drop:
-		kfree_skb(skb);
+		consume_skb(skb);
 		return NULL;
 	case TC_ACT_REDIRECT:
 		/* No need to push/pop skb's mac_header here on egress! */
-- 
1.9.3

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

* Re: [PATCH net-next] net: also make sch_handle_egress() drop monitor ready
  2016-05-15 21:28 [PATCH net-next] net: also make sch_handle_egress() drop monitor ready Daniel Borkmann
@ 2016-05-15 21:59 ` Alexei Starovoitov
  2016-05-16 18:03 ` David Miller
  2016-05-17 11:55 ` Jamal Hadi Salim
  2 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2016-05-15 21:59 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: davem, eric.dumazet, jhs, netdev

On Sun, May 15, 2016 at 11:28:29PM +0200, Daniel Borkmann wrote:
> Follow-up for 8a3a4c6e7b34 ("net: make sch_handle_ingress() drop
> monitor ready") to also make the egress side drop monitor ready.
> 
> Also here only TC_ACT_SHOT is a clear indication that something
> went wrong. Hence don't provide false positives to drop monitors
> such as 'perf record -e skb:kfree_skb ...'.
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Acked-by: Alexei Starovoitov <ast@kernel.org>

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

* Re: [PATCH net-next] net: also make sch_handle_egress() drop monitor ready
  2016-05-15 21:28 [PATCH net-next] net: also make sch_handle_egress() drop monitor ready Daniel Borkmann
  2016-05-15 21:59 ` Alexei Starovoitov
@ 2016-05-16 18:03 ` David Miller
  2016-05-17 11:55 ` Jamal Hadi Salim
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-05-16 18:03 UTC (permalink / raw)
  To: daniel; +Cc: eric.dumazet, alexei.starovoitov, jhs, netdev

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Sun, 15 May 2016 23:28:29 +0200

> Follow-up for 8a3a4c6e7b34 ("net: make sch_handle_ingress() drop
> monitor ready") to also make the egress side drop monitor ready.
> 
> Also here only TC_ACT_SHOT is a clear indication that something
> went wrong. Hence don't provide false positives to drop monitors
> such as 'perf record -e skb:kfree_skb ...'.
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied.

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

* Re: [PATCH net-next] net: also make sch_handle_egress() drop monitor ready
  2016-05-15 21:28 [PATCH net-next] net: also make sch_handle_egress() drop monitor ready Daniel Borkmann
  2016-05-15 21:59 ` Alexei Starovoitov
  2016-05-16 18:03 ` David Miller
@ 2016-05-17 11:55 ` Jamal Hadi Salim
  2 siblings, 0 replies; 4+ messages in thread
From: Jamal Hadi Salim @ 2016-05-17 11:55 UTC (permalink / raw)
  To: Daniel Borkmann, davem; +Cc: eric.dumazet, alexei.starovoitov, netdev

On 16-05-15 05:28 PM, Daniel Borkmann wrote:
> Follow-up for 8a3a4c6e7b34 ("net: make sch_handle_ingress() drop
> monitor ready") to also make the egress side drop monitor ready.
>
> Also here only TC_ACT_SHOT is a clear indication that something
> went wrong. Hence don't provide false positives to drop monitors
> such as 'perf record -e skb:kfree_skb ...'.
>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

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

end of thread, other threads:[~2016-05-17 11:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-15 21:28 [PATCH net-next] net: also make sch_handle_egress() drop monitor ready Daniel Borkmann
2016-05-15 21:59 ` Alexei Starovoitov
2016-05-16 18:03 ` David Miller
2016-05-17 11:55 ` Jamal Hadi Salim

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.