mirror-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 accel/amdxdna: Fix incorrect PSP firmware size 2025-06-09 07:16:32 -07:00
accessibility
acpi ACPI fix for 6.16-rc5. 2025-07-04 17:25:41 -07:00
amba
android Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
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 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
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 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
cache
cdrom
cdx
char agp/amd64: Check AGP Capability before binding to unsupported devices 2025-07-09 07:23:09 +02:00
clk clk: imx: Fix an out-of-bounds access in dispmix_csr_clk_dev_data 2025-06-19 17:32:40 -07:00
clocksource MFD for v6.16 2025-06-03 11:53:55 -07:00
comedi treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
connector
counter Second set of Counter updates for 6.16 2025-05-24 08:29:32 +02:00
cpufreq rust: Use CpuId in place of raw CPU numbers 2025-06-12 10:31:28 +05:30
cpuidle Merge branch 'pm-cpuidle' 2025-05-30 20:21:36 +02:00
crypto octeontx2: Set appropriate PF, VF masks and shifts based on silicon 2025-06-16 17:37:49 -07:00
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 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
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 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
firmware EFI fixes for v6.16 #1 2025-07-07 18:22:25 -07:00
fpga FPGA Manager changes for 6.16-rc1 2025-05-21 14:08:44 +02:00
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 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
hid hid-for-linus-2025071501 2025-07-15 09:20:44 -07:00
hsi treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
hte
hv hyperv-next for v6.16 2025-06-03 08:39:20 -07:00
hwmon hwmon: (ltc4282) avoid repeated register write 2025-06-16 06:30:58 -07:00
hwspinlock
hwtracing coresight: updates for Linux v6.16 2025-05-22 18:04:43 +02:00
i2c i2c-for-6.16-rc5 2025-07-05 12:54:24 -07:00
i3c i3c: controllers do not need to depend on I3C 2025-05-24 22:49:07 +02:00
idle intel_idle: Update arguments of mwait_idle_with_hints() 2025-06-10 21:09:28 +02:00
iio treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
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 Merge branch 'icc-sa8775p' into icc-next 2025-05-19 17:09:50 +03:00
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 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
leds treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
macintosh
mailbox treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
mcb
md - dm-bufio: fix scheduling in atomic 2025-07-14 19:25:28 -07:00
media treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
memory treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
memstick treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
message
mfd mfd: Fix building without CONFIG_OF 2025-06-19 11:05:30 +01:00
misc treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
mmc mtk-sd: reset host->mrq on prepare_data() error 2025-06-25 14:42:51 +02:00
most treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
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 Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
of - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
opp
parisc
parport treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
pci Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-17 11:00:33 -07:00
pcmcia treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
peci
perf arm64 updates for 6.16 2025-05-28 14:55:35 -07:00
phy phy-for-6.16 2025-06-05 08:20:21 -07:00
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 pmdomain: ti: Fix STANDBY handling of PER power domain 2025-05-19 16:11:05 +02:00
pnp
power - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
powercap powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed 2025-06-30 20:32:29 +02:00
pps treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
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 drivers/rapidio/rio_cm.c: prevent possible heap overwrite 2025-06-11 22:42:36 -07:00
ras
regulator regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods 2025-07-03 12:22:35 +01:00
remoteproc remoteproc updates for v6.16 2025-06-02 11:04:29 -07:00
reset
rpmsg rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send() 2025-05-20 21:46:10 -05:00
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 soundwire updates for 6.16 2025-06-05 08:07:24 -07:00
spi spi: cadence-quadspi: fix cleanup of rx_chan on failure paths 2025-07-01 14:02:26 +01:00
spmi irqdomain: spmi: Switch to irq_domain_create_tree() 2025-05-21 14:53:17 +02:00
ssb ssb: use new GPIO line value setter callbacks 2025-06-20 10:55:19 +02:00
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-04 08:03:18 +02:00
target scsi: target: Fix NULL pointer dereference in core_scsi3_decode_spec_i_port() 2025-06-16 14:35:57 -04:00
tc
tee A fix in the OP-TEE driver for v6.16 2025-07-03 16:26:08 +02:00
thermal Thermal control updates for 6.16-rc1 2025-05-27 16:28:02 -07:00
thunderbolt thunderbolt: Changes for v6.16 merge window 2025-05-21 12:26:51 +02:00
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 Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
usb usb: hub: Fix flushing of delayed work used for post resume purposes 2025-06-30 15:36:00 +02:00
vdpa vdpa/octeon_ep: Control PCI dev enabling manually 2025-05-27 10:27:53 -04:00
vfio pci-v6.16-changes 2025-06-04 11:26:17 -07:00
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 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
virt treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
virtio virtio_pci_modern: allow configuring extended features 2025-07-08 18:05:07 +02:00
w1 Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
watchdog treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
xen xen/x86: fix initial memory balloon target 2025-05-23 07:09:00 +02:00
zorro
Kconfig dpll: Add basic Microchip ZL3073x support 2025-07-09 19:08:52 -07:00
Makefile