From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 4C92A4156C6 for ; Thu, 13 Aug 2026 11:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786621362; cv=none; b=TJqHSFoUcw6ClWNt2EetyR5uGVR8f7o+hE1mUVOvL38QGlqkpheHxClXI+rGhnew7wtaUmCAnTpWsm1EfN61CuWUTU8l/Ym7+KF6IODWGxfTDFY6/rEwRy2iMJWZ6hDWmMrMvGwYW5XRoHYgpyqGL74HMAXsAupK/ggwP9Jl1pU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786621362; c=relaxed/simple; bh=VbN+Et8O+M81UON3mkIv3jA68onfR7gbv44zPP//V3k=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=rtJMULtZ9M9pjQ0aWg/tDm+lJfgKBSQrQs2u+B24RX7y8p2+yGrKRpcWp3WkRq3fJ/QWnmpncP8GPbuJsAKTdi0dYwyPH7LkWmHcfnb/VBLkrPdEV0EtGWyia+LYm+SWwsAOdFwFZWJqtMm0XkwKtXlrC00/SxFJERcaORjrG24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XSFS3yYZ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=opn6Jrrq; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XSFS3yYZ"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="opn6Jrrq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786621360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rb/L5RRc82A7B5E2Iy9LP5QaxJKcUva6+toB0YnDVwY=; b=XSFS3yYZiYVGnJd1Wr7RELvLW4PjUOovysef3QXeCIXISZSw2DfJLuZ4ZZi1LljL+yeuPK nvZJT5oiPgHjMTXAGCbFI2v1PnmOMyd6H/cMFnasW3nXkDPNMrw1XyjFPsNwtEYUp5woqP wFwFbFZmlNPH93efNQvLNLVDd9d2Yic= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-427-y47-X3xCMui6FdG6FRW9nA-1; Thu, 13 Aug 2026 07:42:39 -0400 X-MC-Unique: y47-X3xCMui6FdG6FRW9nA-1 X-Mimecast-MFC-AGG-ID: y47-X3xCMui6FdG6FRW9nA_1786621358 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-47fe23b5acdso1764388f8f.0 for ; Thu, 13 Aug 2026 04:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1786621358; x=1787226158; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to:content-type; bh=rb/L5RRc82A7B5E2Iy9LP5QaxJKcUva6+toB0YnDVwY=; b=opn6JrrqNUffshKC8YxKYQde5957jq20Ehfsrt/+GzL++Cgl1/q8ws2HsYQLbWLP9h JLxMmsdJ4NLDU56Vee/WiDHWLEeS6TiDLW1xfrJI14y9anF2zMN289ojDyzIm+yJzrhi Mf4z1hES0UwyB8IMxa8EEgSYVFXCeDM/43ClBmV1bIPPmQSMPf4aDH5S52FzloC80suD 8rVheZbilXjHg/6+2RyFK9WhH7vReQUE6SLnaQ6lP9Bwc38J36grGEMbPd6ecFCHcU1Z hCrFOIjuzw1YHPh8RkJUFR8mNCFXFuBzpC7cHuGo9FqRZ6lIaZamjFuktthJmMlCsYdr KFxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786621358; x=1787226158; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=rb/L5RRc82A7B5E2Iy9LP5QaxJKcUva6+toB0YnDVwY=; b=UDbsyKc74HqX5Pb2L5335Q/ZMSWE8SObboI20KZlgBBHnWTLEFZWFe40I46/84S2jm 1i+Op/CWUEm1XKjVTVAxkfeGisXHP2LlDSt4GVw7eOV9GML/R1P7wF3Dty2FKShQb8Iv yvaKQqLAfhVAGS26jFPaB73pplgI68MIC9PTaSwoYZWzwYnWqC8RlawwrtUqroFYGV2g N429B6blsltPm4vvl8tFJ9+HI84yqNjDmjmPnjWJJwvaop1Dn+Y1nM4BFICswNS/Mydr VQN12zbcT//MMTVBJ0zTa1OfdwcOA8ESHiNWbs9Fqidm03Urc1ON1qmkgF1PUxHVEIT3 oevw== X-Forwarded-Encrypted: i=1; AHgh+Rq5GBwxApM++sne4dTASEX2fT+VBGmCyTFnRTuZ0oo6uN4bYecVQJWLsyI/cTq7I5xCRjYvd3k+URvledM=@vger.kernel.org X-Gm-Message-State: AOJu0YzVNadt0/hNJK4k3Lkqd9I+d+xafExu1DAPJhXHh2DH8h/9Muro OubbvzUlfeu+JbWZYRX7/FMny8sN31xIvCUgCiobl/sZgoCTtMZtd2XHhiHZXtHpq8SDuzfmD2t EXXhMXVXv73XwdhjSCwq2GlSyodwEgX7Epi9nbSgEnlB0XQ3iPCyx0NGUyNirc2alfg== X-Gm-Gg: AR+sD111WLo74AYRaXMEsT+zERRYwYmkJ/0gHefTqJoZKXKMzbSnB4gLlO7fbFwhjEY GyFrsedvDdc53Qz+zlrowvXmtNK5L+t2t+Q3fRtxIykPI8+3ml0W1jKVYoDkN9r2O2zXo1OT+w4 tUlgu/4qXLOl79Zkcrf3Ejqyh/mAeaeblC/8DSF8A4+iI3CroPalj9obgDEd1yxlaALxJ4uRVqv Lik6QP3CNExukZ8BzQwvCqQ6YPyK/hwJ17C2tLiy0Fk9tS/6wVu1fj9DJuWAXWd3TMgp3ix03u5 ipxtX5zhuaq931MCjzmsx2eL8IRtYqAeiurudvgGyxjL+lm0jYUmTrwQQ/jWdenoGlZM2uYCR+c /sitqRlagg/a2bx7/ii8WWRb0iF2SjtZ+1j04UwIIDVSLrWSTcWCfdZfJFMFLF+Jzd6KuHglDFy I= X-Received: by 2002:a05:600c:1da8:b0:499:726b:7375 with SMTP id 5b1f17b1804b1-499821c3119mr76377025e9.14.1786621357821; Thu, 13 Aug 2026 04:42:37 -0700 (PDT) X-Received: by 2002:a05:600c:1da8:b0:499:726b:7375 with SMTP id 5b1f17b1804b1-499821c3119mr76376185e9.14.1786621357373; Thu, 13 Aug 2026 04:42:37 -0700 (PDT) Received: from [192.168.188.103] (ip239-44-231-195.pool-bba.aruba.it. [195.231.44.239]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499820c2897sm107064505e9.0.2026.08.13.04.42.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Aug 2026 04:42:36 -0700 (PDT) Message-ID: <711d525c-cfc6-472c-b073-0fcfc9f95b14@redhat.com> Date: Thu, 13 Aug 2026 13:42:35 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 0/2] net: mana: Avoid DMA queue allocation failure under memory fragmentation To: Aditya Garg , kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, kotaranov@microsoft.com, horms@kernel.org, ernis@linux.microsoft.com, dipayanroy@linux.microsoft.com, shradhagupta@linux.microsoft.com, kees@kernel.org, sgeorgejohn@microsoft.com, ssengar@linux.microsoft.com, gargaditya@microsoft.com, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org References: <20260807210002.1695263-1-gargaditya@linux.microsoft.com> From: Paolo Abeni Content-Language: en-US In-Reply-To: <20260807210002.1695263-1-gargaditya@linux.microsoft.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 8/7/26 10:56 PM, Aditya Garg wrote: > The MANA driver can fail to bring up its queues on systems with high > memory utilization because every GDMA queue ring is allocated as a > single dma_alloc_coherent() of the whole power-of-2 ring size. Under > memory fragmentation these high-order allocations may fail, preventing > the driver from creating queues when opening the interface, after a VF > reset, or when reconfiguring channels, ring parameters or MTU. > > Per-queue sizes that are problematic, with depth and size given as > (default, max) over the ethtool ring settings: > > ring entry depth size > ------------------------------------------------------------ > TX completion queue 64 B (256, 16384) (16 KB, 1024 KB) > TX send queue 32 B (256, 16384) ( 8 KB, 512 KB) > RX completion queue 64 B (1024, 8192) (64 KB, 512 KB) > RX receive queue 32 B (1024, 8192) (32 KB, 256 KB) > event queue 16 B 2048 (fixed) 32 KB > > This series addresses the issue by: > 1. Routing all CPU-side ring access through mana_gd_ring_ptr() and > mana_gd_ring_contig_avail(). On a contiguous ring these reduce to > simple arithmetic, so this patch is a pure refactor. > 2. Falling back in mana_gd_alloc_memory() to a vector of scattered > order-0 coherent pages when the contiguous allocation fails. The > device sees the same page-list format either way, as > mana_gd_create_dma_region() already describes a ring as a list of > MANA_PAGE_SIZE addresses. The HW channel stays contiguous, as > advertising a scattered page list needs the HW channel itself. > > Throughput testing confirms no regression. Since the fallback only > triggers under memory fragmentation, the scattered-page path was enabled > unconditionally for all eligible GDMA queue rings during testing (iperf3, > Gbit/s): > > Baseline Patched Patched > Connections Contiguous Contiguous Scattered > ----------------------------------------------- > 1 46.1 46.2 46.1 > 16 182 182 182 > 32 182 182 182 > 64 182 182 182 Given the above, I suggest to follow-up and remove entirely the single dma_alloc_coherent() allocation; you will get simpler code and less pressure for later dma users. /P