From patchwork Sun Jan 5 21:30:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Tomlin X-Patchwork-Id: 13926819 X-Patchwork-Delegate: kuba@kernel.org Received: from GBR01-LO4-obe.outbound.protection.outlook.com (mail-lo4gbr01on2112.outbound.protection.outlook.com [40.107.122.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E09F156238; Sun, 5 Jan 2025 21:30:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.122.112 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736112646; cv=fail; b=nIanqtt9aOMwfl5J/eAFZq/MrCt+NN8vt9hMkicnDEeje8CsJGyJR/AO3bNjUeW2PZ3Fvyl5HyjaRjmqxsQwiOay3sE6r+oToBw/0BK6CH11cAHUSaMA07dXAtJeGos8ktgbpAGcI8HJaNwyCDnhnmr5HGqwc3Mi3RxZHWGXZM4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736112646; c=relaxed/simple; bh=qPsBN62Da0J2dSFpXzGMy7ubQq+8L0lOBIH3YOS/g3U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=FJZWGTvMaRilMrC37kokf0k6mi0B940QsMmoX6QgCT3TTu4J7erIJwIhLXq8kGfLnO+FikO6GXsMQoo8h1laW2Kig91o8UGXcpMcyytodzbairunS9HjBkE4104bC0SXRAC++ol+kNr8OWj2YH9aG8+GDIsAY0AzSLRNQQn+KmY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com; spf=pass smtp.mailfrom=atomlin.com; arc=fail smtp.client-ip=40.107.122.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atomlin.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Nae3Zj60V9cXUmNS1i++YYWzgjoIJ3mVxjaKtaLxNVvE9SYYuiSWATRMa/zandcOsSQgQAc58/64jp0dQ9qPem3qGpvjrlsYkUM/oRVCtlnlDbo7pKQefMP+eziQS3ljWKXOyxAybdgxQJgGczYOL/a5MICVZEydkHzVjil83t36zv9APRKYKHMCYYjFqxSeM3L+9YwNEvVII2FtX9uQ/wfHjaiX7kDqYOPbG7PvdHsIuO33WhLpslHYRtwvImXF0rd+lSFOVmCpLGjRVeTww11cKlKnG0gN0NnPoZjCEaOFNe0MfdGHleAEpJK7bxJlmLLxwEZrAmcEVGXJukpK4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7nf/L4Gg3kVMPsldGll9347UPy20rzbGiVkUztrSztw=; b=UEwfNFeWZKtipWZ6xJYAvfh7cNSFRaWk05N8JRtq5h7lQ6mY5lWU0X3wAsnllf0P/roZOLslNV2qNAA1NQ1uzHnYrvq9nmP8Su+ScrHqXeju+Le7K7WR6cMk073Seokf0Fxi6VSg3Z/nwBKDV1AD5544rVVRujJidZzJrMS8j7IOBZplhB6VPPVwOqjJ0Ifu4SnY9Rg6I03kDJavp42NVPWByUy1UAMXh+bLdR2AsrWdXeG7AHYgVU6bpsqyV6WUN0FY+S/lPnVDd3fIWg181mxU5EihU7VXyGmV7vMTGhH8T+5uYy3SwQlORIE0nCIkzPMRuQW12vpaX4WP5ohAbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=atomlin.com; dmarc=pass action=none header.from=atomlin.com; dkim=pass header.d=atomlin.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=atomlin.com; Received: from CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:70::10) by CWXP123MB3461.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:7a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Sun, 5 Jan 2025 21:30:39 +0000 Received: from CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM ([fe80::5352:7866:8b0f:21f6]) by CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM ([fe80::5352:7866:8b0f:21f6%7]) with mapi id 15.20.8314.015; Sun, 5 Jan 2025 21:30:39 +0000 From: Aaron Tomlin To: ronak.doshi@broadcom.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, atomlin@atomlin.com Subject: [RFC PATCH 1/1] vmxnet3: Adjust maximum Rx ring buffer size Date: Sun, 5 Jan 2025 21:30:36 +0000 Message-ID: <20250105213036.288356-2-atomlin@atomlin.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250105213036.288356-1-atomlin@atomlin.com> References: <20250105213036.288356-1-atomlin@atomlin.com> X-ClientProxiedBy: LO4P123CA0169.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::12) To CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:70::10) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLP123MB3523:EE_|CWXP123MB3461:EE_ X-MS-Office365-Filtering-Correlation-Id: eea7282c-5781-4fe1-e056-08dd2dd03309 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: TMUp1Wc6s8cspf3nHtOqRQr3b+pvbXXdOdct9wh5oJhDEBqG9v5ClZdWYXpdCV8C1B0chaEmjlbbqURV4w9lZV7VMK0KfJvWlwTQ5Zy6pnRoOoTYWEaALDxDGKlfkzKGvz7y3/kjqxXdQazghWwQjnBsNDyBh73kgh162714awfN8M6opBYj8P8pvYGMg9K7nPsY8doBYXfFNsLmVGzH5Jyeo0RMkMD9m412vMm4bAFNf1M2OFEj6u8NEr+oWJYEX71m3kaLZAE9aRSpr7uWeY7U3lacM9VT3A+aOL9GK5MC70fC2qlYejIuW2TqSEJk7a4rzqUbjFcYoG4UTj5TDNGFZHHnQIbKTqpTRPA41Pz8aZmyx+KPHzKIY9gLqGCuXgNAJuFun8VglHarra0+qCDpGV6SHM/mDlFdwGkHUhrJk20Vo56k0wlKCeMTat3c1kikcrwkoudN2xUdx99/n4yNmZD52NTJFGGHzYfhsFF1/wAzr47morxX4SjKhUiyQJMuSAEPH/AZnmfpFmffvCOylppRqOwcl/i8wpByXzw6myaD6tdpAFnnd7N4Fnke7xEw/issee7JscolLIsYmmMXt7ZElkzJTHfB7V74wDVIfnT8d7Gv20fFVxwGXQBuyuakKxQ8D0i1A1/jcp9BkWrNN9s0ECfrg6rBEYZa0IqDa0UxY23jS1JEL4WA2xXRLOHn65eS+imobsPFUT3fHLdlJl5EAW0sy4jdZgzSy+wHcZ8zlSlje+ZK4S5MxTuFCreraKB98apzthlQ2n5QLCRg+7zeDKovuB4ey8aOv+HmqUKeOXtuvvamzIoDBkBcfsNW0kMnW7iruh4xihXwXbqfQaoj23JdxlrjJE5UXibWmMSbv0xsSSZruZYffuFCQHjJfdWO90eiAXLtbrw+Ms0UEtvGINLw5m52GSMN0AxDa9Dmjmb8zDDp15XujvNacvXYLmoA2+IB5VzgMrC0b/0NfBRUS/QIqH+sZOSOAlW7HwYHTW0VicYalGti+l1OpKnqTXZ5VlBNo7nUWC/Q7O8umM7C5kc1FM5LHK3R+j7R2Y3K9Gg7sHFJhVKk7YxLjQnwmzkOtDnYSNQ2HLTRPqBq2sdJ2E8Vgz2gXUEeUcfsqY5SLZhnqqxwtLNnYSs/lDSVstmgjZJWA+NErcHTkLn6+9NFliX7mTM/Yo9LEm39DMLVKXC1pWXD0WiaGRndZjtAMx38KWk2f6hVTktXQVjJBSZf0oDUdfhIa6t4cK+1mnsW/eQFjAcB3NQ5X2Xf/mYgoR+6ZQGyz7iIMheNYpiat3fp+1/p6OjEQ6FL6zB5SfZFQz0T4MlX9eY883xWk+wcY7M4nK33eEyDKLk4NlNIBNfxLwgiSZ9AsWUzTwiOfnaMrMIdeuK8TShfRagP X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SUBSyrmngqtli6WsxAerF5ot2oZwuNEFvyw5A+8ETl05cNC7JquqE9AFdmzXwFs+nqg47g1UDs8iUTIJU4UkDu9ZO2j+7CoNV+dAjDAox3Nxeilnv3NNuNF/+q0oHTT3xcZ8WW6gTaI2me2TqMjcrmD78lWG191dZRE+6ZPqa8ujxCrArJR2stUOTSs+Uf6Lj8sYm4fg8+exfW5G7EkfOk5g5YmAcR1TQHqBQzQeV0aNcUmAoU/nW3Rm9S6ki2sd7h5r08Wk+WzaYvrJaLydN4q557R+u9HBjlo8lhzNwTK1Nn9QJB6ZV4ssytE/5CIN8UD0QvZx8LFTNw8CDmiNITrBLrkN+jqlvxVLe1wZrdG9/Ha0TJzhR9CvBSz8p+TTnWSiGu4HOb5oaszmh44xji4Geht33GCqhdrr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8/0YQ5rQ6F5J05ljUwDdomWppexHSy09IZbQD18ZPzI0SMzZ52AuZ5Db+4fw+SJTVWCvgdocU6ifAZOL79puL7MjCg X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: eea7282c-5781-4fe1-e056-08dd2dd03309 X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2025 21:30:38.9936 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e6a32402-7d7b-4830-9a2b-76945bbbcb57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9PZCvWJLlPZTql7SRi/TVLObhVNZE5mNFNsXBCc4YdqbXx54LTm6U/LNW6KWSsdcNzx93AUhN8HsFIzXzBW68g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP123MB3461 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC In the context of vmxnet3_rq_create(), the Rx Data ring's size is calculated by multiplying the size of Ring 0 by the size of the Rx ring buffer. See __dma_direct_alloc_pages(). Now if CMA (Contiguous Memory Allocator) is not available or the allocation attempt failed, the zone buddy allocator is used to try to allocate physically contiguous memory. The problem is, when the maximum supported Ring 0 and Rx ring buffer size is selected, the page-order required to accommodate the new size of the Rx Data ring is greater than the default MAX_PAGE_ORDER (10) i.e. __get_order(4096 * 2048) == 11. Consequently, this request can trigger the following warning condition in __alloc_pages_noprof(): if (WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp)) return NULL; This patch ensures that the maximum Rx ring buffer size is reduced under a Linux kernel without CMA (Contiguous Memory Allocator) support. There is no point attempting a large memory allocation request that could exceed the maximum page-order supported by the system. Signed-off-by: Aaron Tomlin --- drivers/net/vmxnet3/vmxnet3_defs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/vmxnet3/vmxnet3_defs.h b/drivers/net/vmxnet3/vmxnet3_defs.h index 5c5148768039..cc71e697a5f3 100644 --- a/drivers/net/vmxnet3/vmxnet3_defs.h +++ b/drivers/net/vmxnet3/vmxnet3_defs.h @@ -466,7 +466,11 @@ union Vmxnet3_GenericDesc { #define VMXNET3_TXDATA_DESC_MIN_SIZE 128 #define VMXNET3_TXDATA_DESC_MAX_SIZE 2048 +#if defined(CONFIG_DMA_CMA) #define VMXNET3_RXDATA_DESC_MAX_SIZE 2048 +#else +#define VMXNET3_RXDATA_DESC_MAX_SIZE 1024 +#endif #define VMXNET3_TXTS_DESC_MAX_SIZE 256 #define VMXNET3_RXTS_DESC_MAX_SIZE 256