On Mon, Jun 27, 2016 at 9:51 AM, Eric Dumazet <eric.duma...@gmail.com> wrote:
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 
> 5c7ed147449c1b7ba029b12e033ad779a631460a..fddc0ab799996c1df82cb05dba03271b773e3b2d
>  100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -2969,8 +2969,18 @@ static void __tcp_alloc_md5sig_pool(void)
>                 return;
>
>         for_each_possible_cpu(cpu) {
> +               void *scratch = per_cpu(tcp_md5sig_pool, cpu).scratch;
>                 struct ahash_request *req;
>
> +               if (!scratch) {
> +                       scratch = kmalloc_node(sizeof(union tcp_md5sum_block) 
> +
> +                                              sizeof(struct tcphdr),
> +                                              GFP_KERNEL,
> +                                              cpu_to_node(cpu));
> +                       if (!scratch)
> +                               return;
> +                       per_cpu(tcp_md5sig_pool, cpu).scratch = scratch;
> +               }
>                 if (per_cpu(tcp_md5sig_pool, cpu).md5_req)
>                         continue;

Not a problem of your patch, but it seems these allocations never
get freed once we start using tcp md5. Maybe we should free them
when the last socket using tcp md5 is gone?

Reply via email to