linux/drivers
Dragos Tatulea 870bc1aaa0 net/mlx5e: TX, Fix dma unmapping for devmem tx
net_iovs should have the dma address set to 0 so that
netmem_dma_unmap_page_attrs() correctly skips the unmap. This was
not done in mlx5 when support for devmem tx was added and resulted
in the splat below when the platform iommu was enabled.

This patch addresses the issue by using netmem_dma_unmap_addr_set()
which handles the net_iov case when setting the dma address. A small
refactoring of mlx5e_dma_push() was required to be able to use this API.
The function was split in two versions and each version called
accordingly. Note that netmem_dma_unmap_addr_set() introduces an
additional if case.

Splat:
  WARNING: CPU: 14 PID: 2587 at drivers/iommu/dma-iommu.c:1228 iommu_dma_unmap_page+0x7d/0x90
  Modules linked in: [...]
  Unloaded tainted modules: i10nm_edac(E):1 fjes(E):1
  CPU: 14 UID: 0 PID: 2587 Comm: ncdevmem Tainted: G S          E       6.15.0+ #3 PREEMPT(voluntary)
  Tainted: [S]=CPU_OUT_OF_SPEC, [E]=UNSIGNED_MODULE
  Hardware name: HPE ProLiant DL380 Gen10 Plus/ProLiant DL380 Gen10 Plus, BIOS U46 06/01/2022
  RIP: 0010:iommu_dma_unmap_page+0x7d/0x90
  Code: [...]
  RSP: 0000:ff6b1e3ea0b2fc58 EFLAGS: 00010246
  RAX: 0000000000000000 RBX: ff46ef2d0a2340c8 RCX: 0000000000000000
  RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001
  RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff8827a120
  R10: 0000000000000000 R11: 0000000000000000 R12: 00000000d8000000
  R13: 0000000000000008 R14: 0000000000000001 R15: 0000000000000000
  FS:  00007feb69adf740(0000) GS:ff46ef2c779f1000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007feb69cca000 CR3: 0000000154b97006 CR4: 0000000000773ef0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  PKRU: 55555554
  Call Trace:
   <TASK>
   dma_unmap_page_attrs+0x227/0x250
   mlx5e_poll_tx_cq+0x163/0x510 [mlx5_core]
   mlx5e_napi_poll+0x94/0x720 [mlx5_core]
   __napi_poll+0x28/0x1f0
   net_rx_action+0x33a/0x420
   ? mlx5e_completion_event+0x3d/0x40 [mlx5_core]
   handle_softirqs+0xe8/0x2f0
   __irq_exit_rcu+0xcd/0xf0
   common_interrupt+0x47/0xa0
   asm_common_interrupt+0x26/0x40
  RIP: 0033:0x7feb69cd08ec
  Code: [...]
  RSP: 002b:00007ffc01b8c880 EFLAGS: 00000246
  RAX: 00000000c3a60cf7 RBX: 0000000000045e12 RCX: 000000000000000e
  RDX: 00000000000035b4 RSI: 0000000000000000 RDI: 00007ffc01b8c8c0
  RBP: 00007ffc01b8c8b0 R08: 0000000000000000 R09: 0000000000000064
  R10: 00007ffc01b8c8c0 R11: 0000000000000000 R12: 00007feb69cca000
  R13: 00007ffc01b90e48 R14: 0000000000427e18 R15: 00007feb69d07000
   </TASK>

Cc: Mina Almasry <almasrymina@google.com>
Reported-by: Stanislav Fomichev <stfomichev@gmail.com>
Closes: https://lore.kernel.org/all/aFM6r9kFHeTdj-25@mini-arch/
Fixes: 5a842c288c ("net/mlx5e: Add TX support for netmems")
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/1752649242-147678-1-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-17 12:10:30 -07:00
..
accel
accessibility
acpi ACPI fix for 6.16-rc5. 2025-07-04 17:25:41 -07:00
amba
android
ata ata: ahci: Use correct DMI identifier for ASUSPRO-D840SA LPM quirk 2025-06-25 15:17:57 +02:00
atm atm: lanai: fix "take a while" typo 2025-07-08 08:27:19 -07:00
auxdisplay
base PM: sleep: Update power.completion for all devices on errors 2025-07-15 14:55:11 +02:00
bcma
block block-6.16-20250710 2025-07-11 10:35:54 -07:00
bluetooth Bluetooth: btusb: QCA: Fix downloading wrong NVM for WCN6855 GF variant without board ID 2025-07-16 15:38:15 -04:00
bus
cache
cdrom
cdx
char agp/amd64: Check AGP Capability before binding to unsupported devices 2025-07-09 07:23:09 +02:00
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl cxl/edac: Fix using wrong repair type to check dram event record 2025-06-25 12:05:45 -07:00
dax
dca
devfreq
dio
dma
dma-buf dma-buf: fix timeout handling in dma_resv_wait_timeout v2 2025-06-30 13:15:44 +02:00
dpll dpll: zl3073x: Add support to get fractional frequency offset 2025-07-17 15:31:55 +02:00
edac EDAC: Initialize EDAC features sysfs attributes 2025-06-30 10:57:24 +02:00
eisa
extcon
firewire
firmware EFI fixes for v6.16 #1 2025-07-07 18:22:25 -07:00
fpga
fsi
fwctl
gnss
gpio gpio: of: initialize local variable passed to the .of_xlate() callback 2025-07-09 16:14:11 +02:00
gpu Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-17 11:00:33 -07:00
greybus
hid hid-for-linus-2025071501 2025-07-15 09:20:44 -07:00
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c i2c-for-6.16-rc5 2025-07-05 12:54:24 -07:00
i3c
idle
iio
infiniband bnxt: move bnxt_hsi.h to include/linux/bnxt/hsi.h 2025-07-15 16:03:24 -07:00
input Input updates for v6.16-rc4 2025-07-04 09:54:15 -07:00
interconnect
iommu iommu/vt-d: Assign devtlb cache tag on ATS enablement 2025-07-04 10:33:56 +02:00
ipack
irqchip irqchip/irq-msi-lib: Select CONFIG_GENERIC_MSI_IRQ 2025-06-30 16:59:12 +02:00
isdn
leds
macintosh
mailbox
mcb
md - dm-bufio: fix scheduling in atomic 2025-07-14 19:25:28 -07:00
media
memory
memstick
message
mfd
misc
mmc mtk-sd: reset host->mrq on prepare_data() error 2025-06-25 14:42:51 +02:00
most
mtd mtd: nand: qpic_common: prevent out of bounds access of BAM arrays 2025-06-29 22:10:47 +01:00
mux
net net/mlx5e: TX, Fix dma unmapping for devmem tx 2025-07-17 12:10:30 -07:00
nfc NFC: trf7970a: Create device-tree parameter for RX gain reduction 2025-06-27 15:08:57 -07:00
ntb
nubus
nvdimm
nvme block-6.16-20250704 2025-07-04 09:33:59 -07:00
nvmem
of
opp
parisc
parport
pci Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-17 11:00:33 -07:00
pcmcia
peci
perf
phy
pinctrl pinctrl: aw9523: fix can_sleep flag for GPIO chip 2025-07-04 10:31:50 +02:00
platform platform-drivers-x86 for v6.16-3 2025-07-04 10:05:31 -07:00
pmdomain
pnp
power
powercap powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed 2025-06-30 20:32:29 +02:00
pps
ps3
ptp ptp: Enable auxiliary clocks for PTP_SYS_OFFSET_EXTENDED 2025-07-03 15:36:06 +02:00
pwm pwm: mediatek: Ensure to disable clocks in error path 2025-07-07 08:34:44 +02:00
rapidio
ras
regulator regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods 2025-07-03 12:22:35 +01:00
remoteproc
reset
rpmsg
rtc rtc: pcf2127: add missing semicolon after statement 2025-06-24 16:06:14 +02:00
s390 s390/net: Remove NETIUCV device driver 2025-07-16 17:53:40 -07:00
sbus
scsi scsi: core: Enforce unlimited max_segment_size when virt_boundary_mask is set 2025-06-24 21:20:58 -04:00
sh
siox
slimbus
soc soc: aspeed: lpc-snoop: Don't disable channels that aren't enabled 2025-07-02 11:05:20 +09:30
soundwire
spi spi: cadence-quadspi: fix cleanup of rx_chan on failure paths 2025-07-01 14:02:26 +01:00
spmi
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-04 08:03:18 +02:00
target
tc
tee A fix in the OP-TEE driver for v6.16 2025-07-03 16:26:08 +02:00
thermal
thunderbolt
tty serial: imx: Restore original RXTL for console to fix data loss 2025-06-24 15:34:21 +01:00
ufs scsi: ufs: core: Fix spelling of a sysfs attribute name 2025-06-24 21:22:20 -04:00
uio
usb usb: hub: Fix flushing of delayed work used for post resume purposes 2025-06-30 15:36:00 +02:00
vdpa
vfio
vhost Merge branch 'virtio_udp_tunnel_08_07_2025' of https://github.com/pabeni/linux-devel 2025-07-10 13:32:35 -07:00
video
virt
virtio virtio_pci_modern: allow configuring extended features 2025-07-08 18:05:07 +02:00
w1
watchdog
xen
zorro
Kconfig dpll: Add basic Microchip ZL3073x support 2025-07-09 19:08:52 -07:00
Makefile