From patchwork Mon Jul 8 12:55:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 168637 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp6514965ock; Mon, 8 Jul 2019 05:56:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvSZ5beqbn1iELzsu53+qQ8b04j6oO1pT2khTzrS640TWp5EDJiSe0X1nicCnJGPqfyGOO X-Received: by 2002:a65:5845:: with SMTP id s5mr23064039pgr.432.1562590586402; Mon, 08 Jul 2019 05:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562590586; cv=none; d=google.com; s=arc-20160816; b=ENUKpFBfL/+i3qsbQQtBqFk6z15gZLydeG5WjhP7OL7bD5gMVTtDm7qbVXC2JhQkTk EoT5nSTbmzeHA4RaAcsUZ4V7nraq7ec4u3L0J6E1UFCwf86Snqb2/vmwuKjmptV+gKBg dMMixUnwu5hdZsPOaInrXyeUcm0tcSFh+m65NJsWaqeDNykwXL2v9ofbGgE49jwNFZSw PIJNwdT7ql1fzkTI2O8ck2d6c9V18TeaR9V0C/HGDHSIIyDHdD1MceuwXpsl16lwZz3V 7DE1UJ3JfoxxpHAoumyunXvFEoJToVHb0NDg4nB9BzAwM3wyOJxaODYOpazx28ZZM/wP V0Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=dBzcFJc3WsX9F9+YpGY4PKflQRf4+++tcfFKBnqgv7g=; b=pKgwecnfE8YSnPb2PiY3EIKIZzoj9farAO50N/AxMQ2j2erVNqdI2uIsozA+fUfuX3 3ggQjIjpNP/2N+IcOi1wCCd4e3J6NeTQhjtyng7X0FBd3+EnWPO1C8Tky4Fd/h+yK20O q2K73GGrnYhofHwn+zs/2s+cyJdvcD2G1tyehzETY0ekGz8Gx5x8VkAgk2HHgmXPxHM5 MpG5w75WRzws2ianYuApg9XRZ4nbVTlzCyBtpiJMGJTyMvyU7Ypokzo1lfRVlGGMHkpH aJ4fqWa46VkCIR41y94wEjDCkIZj/2dqTJgUvC+KuoBqpwejavAK0l0xz1B9X/PXlKNj vFiQ== 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 m67si19443238pgm.319.2019.07.08.05.56.26; Mon, 08 Jul 2019 05:56:26 -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 S1731107AbfGHM4Y (ORCPT + 30 others); Mon, 8 Jul 2019 08:56:24 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:57603 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728892AbfGHM4Y (ORCPT ); Mon, 8 Jul 2019 08:56:24 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MbBQU-1iLzrJ3Egy-00bXQy; Mon, 08 Jul 2019 14:55:57 +0200 From: Arnd Bergmann To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend Cc: Arnd Bergmann , Maxim Mikityanskiy , Tariq Toukan , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, xdp-newbies@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH] [net-next] net/mlx5e: xsk: dynamically allocate mlx5e_channel_param Date: Mon, 8 Jul 2019 14:55:41 +0200 Message-Id: <20190708125554.3863901-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:4ftv1gHczqjAf8xH9IXsCPbra/fMKRspDTr8cIcpEuGznocAdGy iZhmNDyoSPnpnBZOyDHtT8Ynn4XQ9kQfpsqHva0dKZA5Ld4hMScUjAMHEbG6PrAbwLC6ASg g539BORMN8W974gKpYHP5K9v2Y2f956yutZO9dA6870giJkCXQ71FrqA8iO4eyLCZFzDhgI VQdm2P+yiXXKN+C7144Mw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:S7/kq/cX7g0=:jQ0xc1zhHRNbrh7x+xMeHd cA/orRXHrovfvXEwHXZJ26K0GbHxI2WZd/m4ZhxS4FbYUQCEDMUNy2qB1IFuJjaqe4Ok79Rw+ xsVajdjRZLKA8iteii1S1tU6D3sQnjcMYzK9cBDLynaRMXbMijhwmTSSWvoElvXCgDhCTHqgW w0ZKb8UsaLYUJXJV+rtGWcvRINaruEIKSrH6zyPkiFs/7W8mhOpuPxnLYfSic/nmn9RqgeY16 9PpuKCJVcOTuXrv7FXqdCpcEkbg09EeepsRjKkKsJ9YvEiTXd49QbJ9EalG6aIK2+5SXA2OCH FfCwVe4ZWBH2Bf3cWn+IvsRaj/wv13R9p3joz6YNOZAPX0H5LLXq2sA6ckW2FC+QvSKaef0FP IGttL7qBy2wgExG+3GFBaWQHx5wWeH3fnAslbBWvM6JvbHjCUMueZa6l/jnSzleM8dgP1n2dF 3Kb7dt3tQKmc2ANAboFjOqOfOZqzpiye/4XZ1aBxc0wFo6nao0p9Xw+RjcYWxsEBKIY+2US1E Q7A0Ivd4/DgYN0zZDRXUko+thJnndO3/iuaeeJi9C0fcbmplbWvxWHZqPB94wdycirbrWGTbF 4BEHT3RgOKgOABrcp2tsqgnipoNcJTPr1Bq+Up14Mf3MERyrLi7AS4bXJNtz9L2BBMWBbtb/D pVfYxu7EZc+0WEYxD2gQWQwH4ouF7OYRnkAuotdjafrWCeio59oFCnNdU4D/4x9PfSKA6DpwF 7+b1dGFK0pTWht8vSCelCEwDbGj1EbJRNNE0DA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The structure is too large to put on the stack, resulting in a warning on 32-bit ARM: drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c:59:5: error: stack frame size of 1344 bytes in function 'mlx5e_open_xsk' [-Werror,-Wframe-larger-than=] Use kzalloc() instead. Fixes: a038e9794541 ("net/mlx5e: Add XSK zero-copy support") Signed-off-by: Arnd Bergmann --- .../mellanox/mlx5/core/en/xsk/setup.c | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) -- 2.20.0 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c index aaffa6f68dc0..db9bbec68dbf 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c @@ -60,24 +60,28 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params, struct mlx5e_xsk_param *xsk, struct xdp_umem *umem, struct mlx5e_channel *c) { - struct mlx5e_channel_param cparam = {}; + struct mlx5e_channel_param *cparam; struct dim_cq_moder icocq_moder = {}; int err; if (!mlx5e_validate_xsk_param(params, xsk, priv->mdev)) return -EINVAL; - mlx5e_build_xsk_cparam(priv, params, xsk, &cparam); + cparam = kzalloc(sizeof(*cparam), GFP_KERNEL); + if (!cparam) + return -ENOMEM; - err = mlx5e_open_cq(c, params->rx_cq_moderation, &cparam.rx_cq, &c->xskrq.cq); + mlx5e_build_xsk_cparam(priv, params, xsk, cparam); + + err = mlx5e_open_cq(c, params->rx_cq_moderation, &cparam->rx_cq, &c->xskrq.cq); if (unlikely(err)) - return err; + goto err_kfree_cparam; - err = mlx5e_open_rq(c, params, &cparam.rq, xsk, umem, &c->xskrq); + err = mlx5e_open_rq(c, params, &cparam->rq, xsk, umem, &c->xskrq); if (unlikely(err)) goto err_close_rx_cq; - err = mlx5e_open_cq(c, params->tx_cq_moderation, &cparam.tx_cq, &c->xsksq.cq); + err = mlx5e_open_cq(c, params->tx_cq_moderation, &cparam->tx_cq, &c->xsksq.cq); if (unlikely(err)) goto err_close_rq; @@ -87,18 +91,18 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params, * is disabled and then reenabled, but the SQ continues receiving CQEs * from the old UMEM. */ - err = mlx5e_open_xdpsq(c, params, &cparam.xdp_sq, umem, &c->xsksq, true); + err = mlx5e_open_xdpsq(c, params, &cparam->xdp_sq, umem, &c->xsksq, true); if (unlikely(err)) goto err_close_tx_cq; - err = mlx5e_open_cq(c, icocq_moder, &cparam.icosq_cq, &c->xskicosq.cq); + err = mlx5e_open_cq(c, icocq_moder, &cparam->icosq_cq, &c->xskicosq.cq); if (unlikely(err)) goto err_close_sq; /* 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; @@ -123,6 +127,9 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params, err_close_rx_cq: mlx5e_close_cq(&c->xskrq.cq); +err_kfree_cparam: + kfree(cparam); + return err; }