Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2629510pxb; Sat, 6 Feb 2021 02:53:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsycn9rZpXxJr2vXwBlX3pJCsV60TY2Krj6KJ6zA1JkwQcSKJngCeskY5NndVyuH7UX6DT X-Received: by 2002:a17:906:33d9:: with SMTP id w25mr8132217eja.489.1612608822399; Sat, 06 Feb 2021 02:53:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612608822; cv=none; d=google.com; s=arc-20160816; b=yGRksvdkYRs013rY3GsOOOszijSvtgq7HAzhUaOvnhga7Tge006hoxzjOWPgulPBei oF8TJ0beuX3WOsDxIimy1cqkBDmlsnm85446m+EFsbJraGvlMEsWa2Ef8pnIItazq6Ho Qqmc1zspe71O8+q45r2CNtSUrjsXhr/kHDx88S4OumevJTb3crsxe+s7GfrC9+d+89+D 7VaXEGo4DuaJODetdqsnuwe6ujFI3DUjMPArv2hezWRpELGpiayhjwV/ifwhbHIqh8TP svCS72kgcsGVvvrzS5fXXCqvBNssA08i5X7DodokLKv4igQ4mxnX+jVAuS474YFNf6bE aVZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=xFEpllDF6MNsO1AqczcedeO+z4wSQaZT1NtWeiz+bgc=; b=Alg2/HsjIvq0osSVTmiQ3z5S5Uc94cvJ5u0i1lxFFK2q06dbtoIrKnvTBVnisMKPyy RGj1RNzzrLFq7ZqeSle3+00RWKnixL3cuGWWxgjVbP5dnlhkOeR09k1704P3/31POWHS NyoSAJTjHbVHNstwcYbHEzd6R0VpHNJlOKzyzSdlO29RLA2cpHujNQEEz88UJD2w77fK ky2YhO7fF08Db95WbLINTZDmHzxzT+0M+z9s9SoHvhSv5mFZZqX3E78av3EH9uEEuXJl XMkohM7y4W/FpFxeSz0GusiXOVhPCjtym5vBHejPFm07FDKi5OQ6cnJdkk7YtXnyqOMq JiRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RT5xbVsw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si6796036ejy.605.2021.02.06.02.52.48; Sat, 06 Feb 2021 02:53:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RT5xbVsw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbhBFKor (ORCPT + 99 others); Sat, 6 Feb 2021 05:44:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbhBFKop (ORCPT ); Sat, 6 Feb 2021 05:44:45 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFE92C06174A; Sat, 6 Feb 2021 02:44:04 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id g10so10697261wrx.1; Sat, 06 Feb 2021 02:44:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xFEpllDF6MNsO1AqczcedeO+z4wSQaZT1NtWeiz+bgc=; b=RT5xbVswQP5ylNw9crSnReWgiQDEbo4aBxM6hnujbUDTsVzB87EdPRIthroD0xOymX wwLJOt7f4PeQx4Xvht03/2l7UWePsnWey23JbTRN2XWMj8Hxf8hZ4vvx1qUSIr+Mi/S/ Q9XuR5nCDBOthv6nESHVLDaCPI4lxG41ocfb+9emM4944IBRFsG4H0pW60IVgUpfqYnM cBKfj+y/QYLTdh920Ie6iR3NfxTZSi49gaWZ+YhTA9QRdBKufys3C58jmx55Ir2PSxrk 0lhe3HX1tF0c+QTQRLQN/PV/ScIg9D5JwgaUKJXvAEE/nHvCTNe3Ss/DgctxHDVuPbmv EYYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=xFEpllDF6MNsO1AqczcedeO+z4wSQaZT1NtWeiz+bgc=; b=pWNa32+KiumKtJe36TBlMPtUKITnTNjTfOH7L2Px3Oc9ignCDhPNZVfoO2VU+sv5Hq DpcEJ2XqX8AX7C0/RDQp/+TuXgTFRDAUNvhHLcPoyjzX8j7ugr+SkOijSU0WAEF6q/f2 l6/0pKp8cULjG/osggn2q5/NAXHfRzSanW4VjBBm6gLPa9FEdO00oRiB73nECkyz4wBn dIPGhhUhGdgtLCzRKW2kN8He/5b8zjoBOiPSdONtDHVeoHTxoKHcVnJMokxXm8ssBaBg WyVaIqrTozz0fe9R/yfTwYDnYeLTBaVSrs9NoXKGIIvyXnapwz/t7mCclYoP6pu9AIFd ntHg== X-Gm-Message-State: AOAM530hyRIXauV4ckDnVAT570W6nYmw7TfqSNiske1/OINhs1mjvru2 0qYN49PkpGL8tRNCY77Kkrk= X-Received: by 2002:a5d:6c66:: with SMTP id r6mr9567421wrz.86.1612608243570; Sat, 06 Feb 2021 02:44:03 -0800 (PST) Received: from gmail.com ([81.168.73.77]) by smtp.gmail.com with ESMTPSA id z1sm15688206wru.70.2021.02.06.02.44.01 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 06 Feb 2021 02:44:02 -0800 (PST) Date: Sat, 6 Feb 2021 10:43:59 +0000 From: Martin Habets To: Ivan Babrou Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kernel-team@cloudflare.com, Edward Cree , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend Subject: Re: [PATCH net-next] sfc: reduce the number of requested xdp ev queues Message-ID: <20210206104359.hzvwdty6pqt4u52z@gmail.com> Mail-Followup-To: Ivan Babrou , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kernel-team@cloudflare.com, Edward Cree , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend References: <20210120212759.81548-1-ivan@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210120212759.81548-1-ivan@cloudflare.com> User-Agent: NeoMutt/20170113 (1.7.2) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 01:27:59PM -0800, Ivan Babrou wrote: > Without this change the driver tries to allocate too many queues, > breaching the number of available msi-x interrupts on machines > with many logical cpus and default adapter settings: > > Insufficient resources for 12 XDP event queues (24 other channels, max 32) > > Which in turn triggers EINVAL on XDP processing: > > sfc 0000:86:00.0 ext0: XDP TX failed (-22) > > Signed-off-by: Ivan Babrou Acked-by: Martin Habets > --- > drivers/net/ethernet/sfc/efx_channels.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c > index a4a626e9cd9a..1bfeee283ea9 100644 > --- a/drivers/net/ethernet/sfc/efx_channels.c > +++ b/drivers/net/ethernet/sfc/efx_channels.c > @@ -17,6 +17,7 @@ > #include "rx_common.h" > #include "nic.h" > #include "sriov.h" > +#include "workarounds.h" > > /* This is the first interrupt mode to try out of: > * 0 => MSI-X > @@ -137,6 +138,7 @@ static int efx_allocate_msix_channels(struct efx_nic *efx, > { > unsigned int n_channels = parallelism; > int vec_count; > + int tx_per_ev; > int n_xdp_tx; > int n_xdp_ev; > > @@ -149,9 +151,9 @@ static int efx_allocate_msix_channels(struct efx_nic *efx, > * multiple tx queues, assuming tx and ev queues are both > * maximum size. > */ > - > + tx_per_ev = EFX_MAX_EVQ_SIZE / EFX_TXQ_MAX_ENT(efx); > n_xdp_tx = num_possible_cpus(); > - n_xdp_ev = DIV_ROUND_UP(n_xdp_tx, EFX_MAX_TXQ_PER_CHANNEL); > + n_xdp_ev = DIV_ROUND_UP(n_xdp_tx, tx_per_ev); > > vec_count = pci_msix_vec_count(efx->pci_dev); > if (vec_count < 0) > -- > 2.29.2