Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8757994ybi; Tue, 23 Jul 2019 14:38:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFRysRoXZuQvY9RXFlxmFs/1x6L2y0F5m7W02gQ2hEdH/QYT0pcYUCLVrLjVboXgi93mnT X-Received: by 2002:a62:cec4:: with SMTP id y187mr7698014pfg.84.1563917904597; Tue, 23 Jul 2019 14:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563917904; cv=none; d=google.com; s=arc-20160816; b=pfD23OpjKN+L03X6o9bjWoPwQRrMgctO7543pPzreqMFki+u4aWW0scG6zWJuOyrCa T7SIeGzHlHiA2BgzZJIHKDuRP0jtinAo9w/TO7o14gVywSFSwsFRoq1FhY3xPXFerTVr dkebbm6J95jrC7H9jp2qsBlZnB0fuBrnhXyCeiO4pucKl1lrNTH0S64s07PGImNISNiQ EQngDTn17a0svo699/3/Ib2wb35t6BmTrT9CN5ODhuVY8LsWCoitsoAaEEIlBPBgLoyM 4lEdWi3mPC/8fTr9bzW9P1aEwVPmjGuDIt6mKSEeNqNN62jsvEEQs265SadQ/KXdKXAW gDsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=KXa/pdiz35ep+mLCr28bqiNqSRHbUGvdnUMCdkRJY1Y=; b=QlgIkpxQEIm0QV1TG5ez6XfQTzlM1EU8JMpHY733FwtgY5e/7tQWOHLcPkT1JAKN5m sDLCAY9xinJRWxyhhS7PHtZQxGKbUTFtJTSQ5A3qkbhllVZmBUSPHR4eQTvlJDruXgi6 6LisyY5V6FLuiQo4DeVb4AohSWjpc9LecDPcydaDcbTi1FkOH6fh77JGYfGb0P2iYImP MOIxht/M4x9q+MmQ8v986N+I1jQivAt9Jb67P4fuA3jLSCFvxirluxdSz1pYtRQf+CZ2 EDrDwejksTpGyI0fMCLEaEA6LIig9RSmsezXpR0XLhkz7v1FKh3cPWkk8deFIs22kvAn ob6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v125si13414191pgb.262.2019.07.23.14.38.08; Tue, 23 Jul 2019 14:38:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbfGWL3m (ORCPT + 99 others); Tue, 23 Jul 2019 07:29:42 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:42065 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728671AbfGWL3k (ORCPT ); Tue, 23 Jul 2019 07:29:40 -0400 Received: by mail-qt1-f195.google.com with SMTP id h18so41496291qtm.9; Tue, 23 Jul 2019 04:29:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KXa/pdiz35ep+mLCr28bqiNqSRHbUGvdnUMCdkRJY1Y=; b=cUyin+8NmP6Kz7ItookwxAVzJLEtQIAgc2TAZ6DfyUGnHm9QQKwwrEFQTHwgAM9MNl buGfYjyB8QYShPYlJBW4Xn9h2EL/3y0o6PpKiBFPc8LuutzTaOTBq9vwe9CB4ZGUkR3O TLEZJvVFKVRMqSyLC+bzQw5eNUb390atQ/6Bg+ldwGE8Oww9YV/8oAoebbgQFeFifh9X UyvHMYnRy8jmYoljcp2b2oJaeZCDF6gVpRxAE8r5JnoX1fnRuatMecYoAOlPO6wabHH0 siT5vEvgho9+EhtYUprlf9NA860JhSL0sIfwBdttDWsXfHkAs4R+Wov6n/vfORBKbbe1 3NLg== X-Gm-Message-State: APjAAAWjAl6kzYMiSu//FhjSAj4vyLiMRPZ3CaphbgQWIL0g+XCLkJPV XcDBR4Q/IX6vrZBFM9o9vSCwj8qpPMTDzaMzyeg= X-Received: by 2002:a0c:ba2c:: with SMTP id w44mr53689627qvf.62.1563881379713; Tue, 23 Jul 2019 04:29:39 -0700 (PDT) MIME-Version: 1.0 References: <20190708125554.3863901-1-arnd@arndb.de> <543fa599-8ea1-dbc8-d94a-f90af2069edd@mellanox.com> <535ebf16-c523-0799-3ffe-6cfbeee3ac57@mellanox.com> In-Reply-To: <535ebf16-c523-0799-3ffe-6cfbeee3ac57@mellanox.com> From: Arnd Bergmann Date: Tue, 23 Jul 2019 13:29:23 +0200 Message-ID: Subject: Re: [PATCH] [net-next] net/mlx5e: xsk: dynamically allocate mlx5e_channel_param To: Maxim Mikityanskiy Cc: Saeed Mahameed , "David S. Miller" , Alexei Starovoitov , Tariq Toukan , Leon Romanovsky , Daniel Borkmann , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , "netdev@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "xdp-newbies@vger.kernel.org" , "bpf@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 23, 2019 at 1:21 PM Maxim Mikityanskiy wrote: > On 2019-07-08 18:16, Maxim Mikityanskiy wrote: > > On 2019-07-08 15:55, Arnd Bergmann wrote: > >> - mlx5e_build_xsk_cparam(priv, params, xsk, &cparam); > >> + cparam = kzalloc(sizeof(*cparam), GFP_KERNEL); > > > > Similar code in mlx5e_open_channels (en_main.c) uses kvzalloc. Although > > the struct is currently smaller than a page anyway, and there should be > > no difference in behavior now, I suggest using the same alloc function > > to keep code uniform. > > > >> /* Create a dedicated SQ for posting NOPs whenever we need an IRQ to be > >> * triggered and NAPI to be called on the correct CPU. > >> */ > >> - err = mlx5e_open_icosq(c, params, &cparam.icosq, &c->xskicosq); > >> + err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->xskicosq); > >> if (unlikely(err)) > >> goto err_close_icocq; > >> > > > > Here is kfree missing. It's a memory leak in the good path. > > Arnd, I'm going to take over your patch and respin it, addressing my own > comments, because it's been quite a while, and we want to have this fix. > > Thanks for spotting it. Thanks for taking care of it now. I was planning to do a respin, but the reply got lost in the depth of my inbox so I forgot about it. Arnd