From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796327007; b=HRwQomAfbJwouzdEBiKlmmWK1YNqFh4XGYNTEjAGrqymaXtDeo6y3+x9lUln6D9HXmuX 0XkJKDJ6mgNkJGLcOQYdl/JS0qfEoYUTIY9aQIxN8j3o98fpRlNUinQtmtR8cFeJgBzi3 7NX1O53pXB39T5hNgErvkcb6XftAs9s7nu6Ie98zQlkzgEbdwB6T68Sh79yrN0wfpyJSb rv1mJDoHHaFnSEB7gWzy0vo9WKxe2gZht/eH6S44w8h+gbtukA+iuSZwOXX7O/7w2mq36 jfrH6XaWAjYq510qk0azWD7r3t/FWuu46rqib0UCqK85jIjEX2eOmC5i7dAHP16XsCg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796327007; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=2gUN3NTIGdEcyitdOAqjbJ6q0gDdy1mk0YlfQXAypTk=; b=uXjOCojdv7onw1f0sjtyU9kodSBPdWmN1pOF3/TGlDrk6vA9rJA59PgQB5zDl2MwOFmD Oq95+s9FKaubKQgPxYC4O+iC8OQdbKDny+W9k++DtnPCKkJNfYbiufsc7k1RycJJOys/N lEinvTfjmBfEn2LP3FI0Y96JM3EBB+2LrLVbJSVvUz1Svguh6CgeeUidnDDrN1wqu2fno n9/jd61MAabIZIiaZvkEwb1G+iXHfiHjTAxPF0IfJZl1uUcz06XWOd2K3nlTBDEvf6Hi3 LqHEypbGSN8pemJMMmSYr8FsvX4xwA7k2uR+LBuB4r6aRNR7QlPmBGV93BBRjVsyDWA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TvrKW6kV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52A1E60A3808; Thu, 3 Dec 2026 19:43:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TvrKW6kV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 660191F000C2; Thu, 3 Dec 2026 19:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796327007; bh=2gUN3NTIGdEcyitdOAqjbJ6q0gDdy1mk0YlfQXAypTk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=TvrKW6kVO3MRjmcKVXpyKEiizs9VZWMWAsd6qjPhv6FD1M5oVrdwuFmS+Nhe70zL1 SkthLMRfkgmaU3wwZ2DybfFER63Lcjz8g24phKk72ydLwYjQZRoAdy8in0PjRsdi/3 HGL9stfSCwijkWb3P3HZZbgNdQ8AqEfAeqLnbLN1PNaSjf1VGRcYJ6zPzD+hZDfIvB EAKBvEd2Dv7a4tvCN2NAgO8zDmNRQEjDGvJgDjrjXoV5n0i9Y4JIpBeJ4fIfIJr664 +W/P5yRhDK3KkFGnlcu0UDppHqeDHCdkn9TZKsYwnVBEe2J02i7tGncqiUEKmPZb82 DNvH4wNiAzWmA== Date: Thu, 3 Dec 2026 21:43:23 +0200 From: Leon Romanovsky To: Zhiyue Qiu Cc: Konstantin Taranov , Snehal Sanghvi , "longli@microsoft.com" , "jgg@ziepe.ca" , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH rdma-next v3] RDMA/mana_ib: Enable RDMA devices on the CDX bus Message-ID: <20261203194323.GY31440@unreal> References: X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 03, 2026 at 06:34:37AM +0000, Zhiyue Qiu wrote: > Enable MANA RDMA on CDX by depending on the shared GDMA core and matching > the CDX auxiliary devices. > > On arm64, ioremap() maps the CDX doorbell pages in BAR0 as Device-nGnRE, > but pgprot_writecombine() maps them as Normal-NC in userspace. Using > pgprot_device() to match the kernel mapping fixes the observed CDX > lockup. PCI write-combining is unchanged. > > mana_ib_query_device() reads the vendor ID through to_pci_dev(), but the > GDMA device on CDX is not a pci_dev. Both MANA transport ID tables match > only Microsoft's vendor ID (0x1414). Report PCI_VENDOR_ID_MICROSOFT > directly so userspace gets the same ID on either bus without a PCI cast. > > Allocate missing DMA parameters before GDMA setup using managed memory. > Register a cleanup action to clear the device pointer before the memory > is freed. Set the 32-bit DMA mask and segment limits in CDX probe before > GDMA sets up interrupts or queues. These are device-wide constraints, > not properties of the HWC IRQs. > > Signed-off-by: Zhiyue Qiu > Co-developed-by: Konstantin Taranov > Signed-off-by: Konstantin Taranov > --- > Changes in v3: > - Explain the CDX doorbell memory type and the source of the RDMA vendor ID. > - Leave the Kconfig help text unchanged. > - Move CDX DMA mask and segment setup from HWC IRQ setup to probe. > > Changes in v2: > - Allocate missing CDX DMA parameters before GDMA setup. > > drivers/infiniband/hw/mana/Kconfig | 2 +- > drivers/infiniband/hw/mana/device.c | 2 + > drivers/infiniband/hw/mana/main.c | 9 ++- > .../net/ethernet/microsoft/mana/gdma_cdx.c | 70 ++++++++++++------- > 4 files changed, 54 insertions(+), 29 deletions(-) <...> > +static void mana_cdx_clear_dma_parms(void *data) > +{ > + struct device *dev = data; > + > + dev->dma_parms = NULL; Like I said, this is not needed. > +} > + > static int mana_cdx_gd_probe(struct cdx_device *cdx_dev) > { > struct gdma_context *gc; > @@ -241,6 +224,43 @@ static int mana_cdx_gd_probe(struct cdx_device *cdx_dev) > gc->bar0_va = bar0_va; > gc->dev = &cdx_dev->dev; > gc->bus_ops = &mana_cdx_bus_ops; > + if (!gc->dev->dma_parms) { > + gc->dev->dma_parms = devm_kzalloc(gc->dev, > + sizeof(*gc->dev->dma_parms), > + GFP_KERNEL); I generally avoid devm_* interfaces when the allocation and cleanup paths are explicit. Thanks