]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI: endpoint: pci-epf-vntb: Implement .db_vector_count()/mask() for doorbells
authorKoichiro Den <den@valinux.co.jp>
Wed, 13 May 2026 02:49:18 +0000 (11:49 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 23 Jun 2026 16:37:27 +0000 (11:37 -0500)
commit2579f3f7f52090463596765040aaad71e91ef4d5
tree54cf3f34dda54eb3451882459d8e00b1c7b1f86b
parent823468a4ea1613f1c1235bd16af8b9c6eb9c9677
PCI: endpoint: pci-epf-vntb: Implement .db_vector_count()/mask() for doorbells

Implement .db_vector_count() and .db_vector_mask() so NTB core/clients can
map doorbell events to per-vector work and avoid the thundering-herd
behavior.

pci-epf-vntb reserves two slots in db_count: slot 0 for link events and
slot 1 which is historically unused. Therefore the number of doorbell
vectors is (db_count - 2).

Report vectors as 0..N-1 and return BIT_ULL(db_vector) for the
corresponding doorbell bit. Build db_valid_mask from a validated vector
count so out-of-range db_count values cannot create invalid shifts.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260513024923.451765-8-den@valinux.co.jp
drivers/pci/endpoint/functions/pci-epf-vntb.c