Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2429150ybl; Sun, 26 Jan 2020 02:28:55 -0800 (PST) X-Google-Smtp-Source: APXvYqysRDiCx0xXgkWGLab8aXKz+xpacNafarqG1zPDRO66TCMPwsU+szOzFgfNKSW9UNeD67Y8 X-Received: by 2002:a9d:588d:: with SMTP id x13mr8378071otg.6.1580034535182; Sun, 26 Jan 2020 02:28:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580034535; cv=none; d=google.com; s=arc-20160816; b=n54bf9oPl9wu5yAm/OzkpJn00h4k+3vkhzfGdxz7DHp+K8lNyChN6j449IG/bNMo7G QGOuOt/OH5nm07LYjH4zubyzQPjiZX/UTjG1+TkN64DV1ZPuouOqjuOpkYDD5LI0LWkN JzKPntMArhFx0LcEfTJIIP10ZHhCiodxcOIhdj//BDGKJYjma+u+H61IPfguVxIT8rHS 28W0Ompxtjg9rGnqWvIgoinb15OMjt0Sx8g1Gs1Z8fAaCVeHFcUBojamajgCqqIlCYwu c6MLvhVr2iwIIOUr4Dt5w5Ajigr/gWk7mREg1ybwhhc4+dklisGNnC1OWGD12qgezR5l OkLg== 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=wk2jj2fYYk5GwHu4BFLaHNhIS57GW8qarx/Dc82ZtFo=; b=EdBOetHFxJXUPBkJuLADDon5qrDg8dRdroohiv1K+tWzkbK2Ly/Z0q29GwIp3Gchur WFZPI8xFhTnzofJZouFwQdpcp42oA0XN3tfK97DmNSYLUH8+G/JVwttcm3GxFFM8oC69 7c5Ktgnmf6nmZHRTEMvhD1pyNMQfXiU5afn09sjXZRad27rahwuYQNvRhUG7414JSk0x fxeVrpneH407HwNVU2OBui8cgUclrqdPxjBN/n5h0vtae2VXcqEmmODWUhNAHSoxmG0z bPcAo7+2/Kk/VtAAEzipfloSNkME/nGld718t6tOZW8EMIVB3eMpTfmJVFNjFh1N7u60 0mDQ== 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 z21si2343392oic.32.2020.01.26.02.28.17; Sun, 26 Jan 2020 02:28:55 -0800 (PST) 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 S2387395AbgAZKZw (ORCPT + 99 others); Sun, 26 Jan 2020 05:25:52 -0500 Received: from smtp08.smtpout.orange.fr ([80.12.242.130]:20555 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729213AbgAZKZv (ORCPT ); Sun, 26 Jan 2020 05:25:51 -0500 Received: from localhost.localdomain ([92.140.214.230]) by mwinf5d67 with ME id uyRn210074ypjRG03yRo0l; Sun, 26 Jan 2020 11:25:49 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 26 Jan 2020 11:25:49 +0100 X-ME-IP: 92.140.214.230 From: Christophe JAILLET To: snelson@pensando.io, drivers@pensando.io, jakub.kicinski@netronome.com, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] ionic: Fix rx queue allocation in 'ionic_lif_alloc()' Date: Sun, 26 Jan 2020 11:25:40 +0100 Message-Id: <20200126102540.14812-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 'struct ionic' has a 'nrxqs_per_lif' field. So use it instead of using two times the value of 'ntxqs_per_lif'. Note that with the current implementation, this patch is a no-op because both fields are set to the same value in 'ionic_lifs_size()' which is called before reaching 'ionic_lif_alloc()'. However, it is more future-proof. Fixes: 1a58e196467f ("ionic: Add basic lif support") Signed-off-by: Christophe JAILLET --- Another alternative could be to use 'alloc_etherdev_mq()' if really using the same value for both fields is what is expected. --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 60fd14df49d7..96d3b3e993ad 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1663,7 +1663,7 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index int err; netdev = alloc_etherdev_mqs(sizeof(*lif), - ionic->ntxqs_per_lif, ionic->ntxqs_per_lif); + ionic->ntxqs_per_lif, ionic->nrxqs_per_lif); if (!netdev) { dev_err(dev, "Cannot allocate netdev, aborting\n"); return ERR_PTR(-ENOMEM); -- 2.20.1