Archive-only list for patches
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Long Li <longli@microsoft.com>, Simon Horman <horms@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>,
	leon@kernel.org, kotaranov@microsoft.com,
	shirazsaleem@microsoft.com, shradhagupta@linux.microsoft.com,
	mlevitsk@redhat.com, peterz@infradead.org,
	haiyangz@microsoft.com, ernis@linux.microsoft.com
Subject: [PATCH AUTOSEL 6.12 14/21] net: mana: Record doorbell physical address in PF mode
Date: Mon, 30 Jun 2025 16:45:29 -0400	[thread overview]
Message-ID: <20250630204536.1358327-14-sashal@kernel.org> (raw)
In-Reply-To: <20250630204536.1358327-1-sashal@kernel.org>

From: Long Li <longli@microsoft.com>

[ Upstream commit e0fca6f2cebff539e9317a15a37dcf432e3b851a ]

MANA supports RDMA in PF mode. The driver should record the doorbell
physical address when in PF mode.

The doorbell physical address is used by the RDMA driver to map
doorbell pages of the device to user-mode applications through RDMA
verbs interface. In the past, they have been mapped to user-mode while
the device is in VF mode. With the support for PF mode implemented,
also expose those pages in PF mode.

Support for PF mode is implemented in
290e5d3c49f6 ("net: mana: Add support for Multi Vports on Bare metal")

Signed-off-by: Long Li <longli@microsoft.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/1750210606-12167-1-git-send-email-longli@linuxonhyperv.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

**YES**

This commit should be backported to stable kernel trees. Here's my
detailed analysis:

## Critical Functionality Fix

The commit fixes a missing functionality that prevents RDMA from working
properly in PF (Physical Function) mode. Looking at the code changes:

1. **The Problem**: In `mana_gd_init_pf_regs()`, the driver was not
   recording `gc->phys_db_page_base`, while the VF initialization
   function `mana_gd_init_vf_regs()` does record it (lines 50-51 in the
   existing code).

2. **The Impact**: The RDMA driver critically depends on
   `phys_db_page_base` in its `mana_ib_mmap()` function
   (drivers/infiniband/hw/mana/main.c:535-537):
  ```c
  pfn = (gc->phys_db_page_base +
  gc->db_page_size * mana_ucontext->doorbell) >>
  PAGE_SHIFT;
  ```
  This physical address is used to map doorbell pages to user-space
  applications through `rdma_user_mmap_io()`, which is essential for
  RDMA functionality.

3. **User Impact**: Without this fix, RDMA operations would fail in PF
   mode (bare metal deployments), making the RDMA feature completely
   unusable for those users.

## Meets Stable Criteria

- **Small and contained**: The fix adds only 3 lines of code
- **Fixes a real bug**: RDMA functionality is broken in PF mode without
  this
- **No architectural changes**: Simply records an address that's already
  being recorded in VF mode
- **Low regression risk**: The change is isolated to PF initialization
  path
- **Similar to previous stable fixes**: Commits #3 and #4 in the
  historical examples were both doorbell-related RDMA fixes that were
  backported

The commit essentially brings parity between VF and PF modes for
doorbell physical address recording, which is necessary for proper RDMA
operation. This is a clear functional bug that affects users running
MANA in PF mode with RDMA requirements.

 drivers/net/ethernet/microsoft/mana/gdma_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index 9bac4083d8a09..876de6db63c4f 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
@@ -28,6 +28,9 @@ static void mana_gd_init_pf_regs(struct pci_dev *pdev)
 	gc->db_page_base = gc->bar0_va +
 				mana_gd_r64(gc, GDMA_PF_REG_DB_PAGE_OFF);
 
+	gc->phys_db_page_base = gc->bar0_pa +
+				mana_gd_r64(gc, GDMA_PF_REG_DB_PAGE_OFF);
+
 	sriov_base_off = mana_gd_r64(gc, GDMA_SRIOV_REG_CFG_BASE_OFF);
 
 	sriov_base_va = gc->bar0_va + sriov_base_off;
-- 
2.39.5


  parent reply	other threads:[~2025-06-30 21:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 20:45 [PATCH AUTOSEL 6.12 01/21] ublk: sanity check add_dev input for underflow Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 02/21] atm: idt77252: Add missing `dma_map_error()` Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 03/21] um: vector: Reduce stack usage in vector_eth_configure() Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 04/21] ASoC: SOF: Intel: hda: Use devm_kstrdup() to avoid memleak Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 05/21] Revert "PCI/ACPI: Fix allocated memory release on error in pci_acpi_scan_root()" Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 06/21] ALSA: hda/realtek: Add mic-mute LED setup for ASUS UM5606 Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 07/21] io_uring: make fallocate be hashed work Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 08/21] ASoC: amd: yc: add quirk for Acer Nitro ANV15-41 internal mic Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 09/21] ALSA: hda/realtek - Enable mute LED on HP Pavilion Laptop 15-eg100 Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 10/21] ALSA: hda/realtek: Add quirks for some Clevo laptops Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 11/21] net: usb: qmi_wwan: add SIMCom 8230C composition Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 12/21] driver: bluetooth: hci_qca:fix unable to load the BT driver Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 13/21] HID: lenovo: Add support for ThinkPad X1 Tablet Thin Keyboard Gen2 Sasha Levin
2025-06-30 20:45 ` Sasha Levin [this message]
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 15/21] btrfs: fix assertion when building free space tree Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 16/21] vt: add missing notification when switching back to text mode Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 17/21] bpf: Adjust free target to avoid global starvation of LRU map Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 18/21] riscv: vdso: Exclude .rodata from the PT_DYNAMIC segment Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 19/21] HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 20/21] HID: quirks: Add quirk for 2 Chicony Electronics HP 5MP Cameras Sasha Levin
2025-06-30 20:45 ` [PATCH AUTOSEL 6.12 21/21] HID: nintendo: avoid bluetooth suspend/resume stalls Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250630204536.1358327-14-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=ernis@linux.microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=horms@kernel.org \
    --cc=kotaranov@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=longli@microsoft.com \
    --cc=mlevitsk@redhat.com \
    --cc=patches@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=shirazsaleem@microsoft.com \
    --cc=shradhagupta@linux.microsoft.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox