Re: [net-next PATCH] net: reduce cycles spend on ICMP replies that gets rate limited

2017-01-07 Thread Jesper Dangaard Brouer
On Fri, 06 Jan 2017 22:10:42 -0500 (EST) David Miller wrote: > BTW Eric, you asked about kmalloc() allocation, you were CC:'d in the > patch which did this :-) > > commit 9a99d4a50cb8ce516adf0f2436138d4c8e6e4535 > Author: Cong Wang > Date: Sun Jun 2

Re: [net-next PATCH] net: reduce cycles spend on ICMP replies that gets rate limited

2017-01-07 Thread Jesper Dangaard Brouer
On Fri, 06 Jan 2017 14:08:06 -0800 Eric Dumazet wrote: > On Fri, 2017-01-06 at 11:40 -0800, Eric Dumazet wrote: > > On Fri, 2017-01-06 at 18:39 +0100, Jesper Dangaard Brouer wrote: > > > > > > > @@ -648,13 +668,17 @@ void icmp_send(struct sk_buff *skb_in, int type, >

Re: [net-next PATCH] net: reduce cycles spend on ICMP replies that gets rate limited

2017-01-06 Thread David Miller
From: Eric Dumazet Date: Fri, 06 Jan 2017 14:08:06 -0800 > On Fri, 2017-01-06 at 11:40 -0800, Eric Dumazet wrote: >> On Fri, 2017-01-06 at 18:39 +0100, Jesper Dangaard Brouer wrote: >> >> >> > @@ -648,13 +668,17 @@ void icmp_send(struct sk_buff *skb_in, int type, int

Re: [net-next PATCH] net: reduce cycles spend on ICMP replies that gets rate limited

2017-01-06 Thread Eric Dumazet
On Fri, 2017-01-06 at 11:40 -0800, Eric Dumazet wrote: > On Fri, 2017-01-06 at 18:39 +0100, Jesper Dangaard Brouer wrote: > > > > @@ -648,13 +668,17 @@ void icmp_send(struct sk_buff *skb_in, int type, int > > code, __be32 info) > > } > > } > > > > - icmp_param =

Re: [net-next PATCH] net: reduce cycles spend on ICMP replies that gets rate limited

2017-01-06 Thread Eric Dumazet
On Fri, 2017-01-06 at 18:39 +0100, Jesper Dangaard Brouer wrote: > @@ -648,13 +668,17 @@ void icmp_send(struct sk_buff *skb_in, int type, int > code, __be32 info) > } > } > > - icmp_param = kmalloc(sizeof(*icmp_param), GFP_ATOMIC); > - if (!icmp_param) > -

[net-next PATCH] net: reduce cycles spend on ICMP replies that gets rate limited

2017-01-06 Thread Jesper Dangaard Brouer
This patch split the global and per (inet)peer ICMP-reply limiter code, and moves the global limit check to earlier in the packet processing path. Thus, avoid spending cycles on ICMP replies that gets limited/suppressed anyhow. The global ICMP rate limiter icmp_global_allow() is a good solution,