linux/drivers/net/ethernet
Akiva Goldberger e5eba42f01 mlx5: Fix default values in create CQ
Currently, CQs without a completion function are assigned the
mlx5_add_cq_to_tasklet function by default. This is problematic since
only user CQs created through the mlx5_ib driver are intended to use
this function.

Additionally, all CQs that will use doorbells instead of polling for
completions must call mlx5_cq_arm. However, the default CQ creation flow
leaves a valid value in the CQ's arm_db field, allowing FW to send
interrupts to polling-only CQs in certain corner cases.

These two factors would allow a polling-only kernel CQ to be triggered
by an EQ interrupt and call a completion function intended only for user
CQs, causing a null pointer exception.

Some areas in the driver have prevented this issue with one-off fixes
but did not address the root cause.

This patch fixes the described issue by adding defaults to the create CQ
flow. It adds a default dummy completion function to protect against
null pointer exceptions, and it sets an invalid command sequence number
by default in kernel CQs to prevent the FW from sending an interrupt to
the CQ until it is armed. User CQs are responsible for their own
initialization values.

Callers of mlx5_core_create_cq are responsible for changing the
completion function and arming the CQ per their needs.

Fixes: cdd04f4d4d ("net/mlx5: Add support to create SQ and CQ for ASO")
Signed-off-by: Akiva Goldberger <agoldberger@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Acked-by: Leon Romanovsky <leon@kernel.org>
Link: https://patch.msgid.link/1762681743-1084694-1-git-send-email-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-11-11 15:12:18 +01:00
..
3com
8390
actions
adaptec
adi
aeroflex
agere et131x: Add missing check after DMA map 2025-07-17 19:02:55 -07:00
airoha net: airoha: Take into account out-of-order tx completions in airoha_dev_xmit() 2025-10-14 12:33:46 +02:00
alacritech
allwinner
alteon
altera
amazon net: ena: return 0 in ena_get_rxfh_key_size() when RSS hash key is not configurable 2025-09-29 18:33:53 -07:00
amd amd-xgbe: Avoid spurious link down messages during interface toggle 2025-10-14 10:30:34 +02:00
apm
apple
aquantia net: atlantic: Rename PCI driver struct to end in _driver 2025-07-01 19:35:58 -07:00
arc
asix
atheros net: Use netif_threaded_enable instead of netif_set_threaded in drivers 2025-07-24 18:34:55 -07:00
broadcom bnxt_en: Fix warning in bnxt_dl_reload_down() 2025-11-04 17:25:19 -08:00
brocade
cadence Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-10-01 10:14:49 +02:00
calxeda
cavium net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
chelsio net: cxgb4/ch_ipsec: fix potential use-after-free in ch_ipsec_xfrm_add_state() callback 2025-10-28 18:40:20 -07:00
cirrus
cisco Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-04 08:03:18 +02:00
cortina
davicom
dec net: Fix typos 2025-07-25 10:29:07 -07:00
dlink net: dlink: use dev_kfree_skb_any instead of dev_kfree_skb 2025-10-21 18:38:38 -07:00
emulex benet: fix BUG when creating VFs 2025-08-04 17:17:31 -07:00
engleder
ezchip
faraday net: ftgmac100: fix potential NULL pointer access in ftgmac100_phy_disconnect 2025-08-05 16:00:53 -07:00
freescale net: fec: correct rx_bytes statistic for the case SHIFT16 is set 2025-11-07 18:55:27 -08:00
fujitsu
fungible ethtool: add FEC bins histogram report 2025-09-26 16:49:18 -07:00
google gve: Implement settime64 with -EOPNOTSUPP 2025-10-31 15:55:32 -07:00
hisilicon net: hibmcge: fix the inappropriate netif_device_detach() 2025-10-28 19:11:04 -07:00
huawei hinic3: Fix NULL vs IS_ERR() check in hinic3_alloc_rxqs_res() 2025-09-19 07:05:51 -07:00
i825xx
ibm ibmvnic: Increase max subcrq indirect entries with fallback 2025-08-26 09:45:50 +02:00
intel libie: depend on DEBUG_FS when building LIBIE_FWLOG 2025-11-05 17:38:03 -08:00
litex
marvell octeontx2-pf: Fix devm_kcalloc() error checking 2025-11-03 17:23:44 -08:00
mediatek net: mtk: wed: add dma mask limitation and GFP_DMA32 for device with more than 4GB DRAM 2025-10-12 18:14:55 +01:00
mellanox mlx5: Fix default values in create CQ 2025-11-11 15:12:18 +01:00
meta eth: fbnic: fix reporting of alloc_failed qstats 2025-10-09 11:10:02 +02:00
micrel net: Fix typos 2025-07-25 10:29:07 -07:00
microchip lan966x: Fix sleeping in atomic context 2025-11-06 07:31:34 -08:00
microsoft net: mana: Reduce waiting time if HWC not responding 2025-09-14 11:54:07 -07:00
moxa
mscc net: mscc: ocelot: Fix use-after-free caused by cyclic delayed work 2025-10-06 11:12:52 -07:00
myricom
natsemi net: natsemi: fix rx_dropped double accounting on netif_rx() failure 2025-09-15 19:06:25 -07:00
neterion net: Fix typos 2025-07-25 10:29:07 -07:00
netronome nfp: xsk: fix memory leak in nfp_net_alloc() 2025-10-29 17:38:23 -07:00
ni
nvidia
nxp
oki-semi
packetengines
pasemi
pensando net: ionic: map SKB after pseudo-header checksum prep 2025-11-03 17:19:21 -08:00
qlogic pci-v6.18-changes 2025-10-06 10:41:03 -07:00
qualcomm net: ethernet: qualcomm: QCOM_PPE should depend on ARCH_QCOM 2025-09-01 12:53:38 -07:00
rdc
realtek r8169: fix packet truncation after S4 resume on RTL8168H/RTL8111H 2025-10-13 17:33:56 -07:00
renesas net: ravb: Ensure memory write completes before ringing TX doorbell 2025-10-22 18:15:14 -07:00
rocker
samsung eth: sxgbe: migrate to new RXFH callbacks 2025-06-18 13:19:01 -07:00
seeq
sfc sfc: fix potential memory leak in efx_mae_process_mport() 2025-10-27 17:55:41 -07:00
sgi
silan
sis
smsc smsc911x: add second read of EEPROM mac when possible corruption seen 2025-09-04 19:09:44 -07:00
socionext
spacemit net: spacemit: Check netif_running() in emac_set_pauseparam() 2025-11-03 17:23:48 -08:00
stmicro net: stmmac: est: Fix GCL bounds checks 2025-10-29 18:49:24 -07:00
sun net: Fix typos 2025-07-25 10:29:07 -07:00
sunplus
synopsys
tehuti net: Fix typos 2025-07-25 10:29:07 -07:00
ti net: ethernet: ti: am65-cpsw-qos: fix IET verify retry mechanism 2025-11-10 18:00:40 -08:00
toshiba
tundra
vertexcom
via
wangxun net: libwx: fix device bus LAN ID 2025-11-05 17:52:13 -08:00
wiznet net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
xilinx net: xilinx: axienet: Fix kernel-doc warnings for missing return descriptions 2025-09-22 16:37:36 -07:00
xircom xirc2ps_cs: fix register access when enabling FullDuplex 2025-08-29 19:05:11 -07:00
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig net: spacemit: Add K1 Ethernet MAC 2025-09-16 12:43:49 +02:00
korina.c
lantiq_etop.c
lantiq_xrx200.c
Makefile net: spacemit: Add K1 Ethernet MAC 2025-09-16 12:43:49 +02:00
oa_tc6.c net: ethernet: oa_tc6: Handle failure of spi_setup 2025-08-29 19:42:07 -07:00