Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp709389pxb; Wed, 20 Jan 2021 19:29:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAfMbgvM3qwLE6mxiFI360FpL+BUdcuQpP/vnpurjKu0enxCvrFvYxazRySj+aJUwjbGdJ X-Received: by 2002:a50:cf02:: with SMTP id c2mr9382008edk.333.1611199750356; Wed, 20 Jan 2021 19:29:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611199750; cv=none; d=google.com; s=arc-20160816; b=GpZEAFdot7TJReUBDzvuKJT3QQavdQBvNXGLl4KILE0O+ayfHhIVOLg/WfailQkS9s 3w2luO6ZP8zx3EHn6v2aGwG9FHopN9plE7/XGDWdBFWA9Qu/hRug13CymSKerp6WN2eq Wkhfehf41dGfAJ25pMOvcu5uapvFDe0jLzr494aSPGvqEFoEOVMKgl5KKLcKGBpqV/Ys w/XtuRyZyw24YQsRZ5X6F+WHNja1bleyDYs91S+Nw8K4h/MW0GIWf7Z92vcup7zF8Xh8 Ph0tsGb5ZLJaWjDgtXGtBt8I8nD/PE7n8fFYUegyl8mlmNibm0z2v8sK8apLB4ZKEsxi a2XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GxBZCxQsCUdkzL0jmb2W+BSX0fHFGApzy9UYWSaFsfA=; b=H/0BNAQ48ZPAFnNPAFFHA7KOJM6tYdeETsrDu7sSf0nQvoZC7odPL0LdjoBrCDk1Xd ZcjKodS08x8ZTLq+xKUTKjspGSTK204LcsITwIYMRTX9QvzhIQz0uqvRvDf9LYA7mvqT RClt6xmXA/Nn3d4hSTaGgNLMmDTHr0JPJOKFOrXHe9V9E+xTH6wrTdneLysYnbfHbAWe r4YPm9iGSuXQwnIKZSKTtzSEeAflQRFDweQuPbcIzyfZ0CTZpae2LLtq6utwJQLMyHTP tyhIjL3oZU7/8YKSj0bEusTFxT4PhHuoYW2O5uEbDSseEnP+Yh3Lb6ZJUXG0RBfVnoW2 I98A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=OhlY4Gug; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si1319186ejy.563.2021.01.20.19.28.45; Wed, 20 Jan 2021 19:29:10 -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=@cloudflare.com header.s=google header.b=OhlY4Gug; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404719AbhATXzy (ORCPT + 99 others); Wed, 20 Jan 2021 18:55:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388386AbhATVdW (ORCPT ); Wed, 20 Jan 2021 16:33:22 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4ED6C061385 for ; Wed, 20 Jan 2021 13:28:02 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id t29so10221635pfg.11 for ; Wed, 20 Jan 2021 13:28:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GxBZCxQsCUdkzL0jmb2W+BSX0fHFGApzy9UYWSaFsfA=; b=OhlY4GugbFiYhJiu50/CtP/Z4AhcGkhphYKSdJZ2/86gZKj5DgbP0xh8gPW72Hu1A6 DdtuijJY97h56PMwDPtGJzrnccfMPqlK/eP0gdY6cZdZZMn4B9DGYTUZorFHmJ1+G8Xr NL/TlrWm7blrSkHJaT1S9y0qoscP5XVa4ICtQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GxBZCxQsCUdkzL0jmb2W+BSX0fHFGApzy9UYWSaFsfA=; b=igSpGdCf+/z/sRZmcElypO43cjJBIFC3kPvduyB4KvJQ+XR9CG2+i/9eAyQzDSjRTJ W1Qoup8wHPCJY2yTcgd/6G0dtHhTxU4duQWKQwmlKCYipuUn/ge4Lpds+j2YUIHR0Ged AWAxiAzpJpMT+lt4JfKZrncP74rejZGBMXS8TuxmbilviCNq49KzrtGmLJ65pXzlqtHJ HpeHauYpRLDsq6pRoyOrqtJlJe0AZWFRC+YYJDOPFMq+fwtrdV1R9Q3crl6KdMRun49j QhKWdNyO8nvYe3uTKRfrWQCnHxkRCT5FV0Zt57r7azNNWsj5Gwjiik3kO1OxwnR/q4Tz ErBw== X-Gm-Message-State: AOAM531CWDiHy8AwKMvJ3j4WplqlxcUCaTQzcfikLlgNdLnN/H9C9cHt lwlYdtwLkMJ8QFc2gVc8V1oZdg== X-Received: by 2002:a63:f255:: with SMTP id d21mr4170608pgk.149.1611178082371; Wed, 20 Jan 2021 13:28:02 -0800 (PST) Received: from localhost ([2604:5500:c29c:d401:f404:1a29:5dd:89c3]) by smtp.gmail.com with ESMTPSA id 14sm2974952pfi.131.2021.01.20.13.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 13:28:01 -0800 (PST) From: Ivan Babrou To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kernel-team@cloudflare.com, Ivan Babrou , Edward Cree , Martin Habets , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend Subject: [PATCH net-next] sfc: reduce the number of requested xdp ev queues Date: Wed, 20 Jan 2021 13:27:59 -0800 Message-Id: <20210120212759.81548-1-ivan@cloudflare.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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