Return-Path: From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Sunil Goutham , cjacob , Aleksey Makarov , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 24/84] net: thunderx: Set max queue count taking XDP_TX into account Date: Sat, 3 Mar 2018 22:26:13 +0000 Message-ID: <20180303222518.26271-24-alexander.levin@microsoft.com> References: <20180303222518.26271-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222518.26271-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: From: Sunil Goutham [ Upstream commit 87de083857aa269fb171ef0b39696b2888361c58 ] on T81 there are only 4 cores, hence setting max queue count to 4 would leave nothing for XDP_TX. This patch fixes this by doubling max queue count in above scenarios. Signed-off-by: Sunil Goutham Signed-off-by: cjacob Signed-off-by: Aleksey Makarov Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net= /ethernet/cavium/thunder/nicvf_main.c index 805ab45e9b5a..2237ef8e4344 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1832,6 +1832,11 @@ static int nicvf_probe(struct pci_dev *pdev, const s= truct pci_device_id *ent) nic->pdev =3D pdev; nic->pnicvf =3D nic; nic->max_queues =3D qcount; + /* If no of CPUs are too low, there won't be any queues left + * for XDP_TX, hence double it. + */ + if (!nic->t88) + nic->max_queues *=3D 2; =20 /* MAP VF's configuration registers */ nic->reg_base =3D pcim_iomap(pdev, PCI_CFG_REG_BAR_NUM, 0); --=20 2.14.1