Re: [PATCH 12/13] PCI/P2PDMA: Add KUnit coverage for the ACS P2P routing walk

[email protected] Sun, 02 Aug 2026 16:07:19 +0000
Newsgroups org.kernel.vger.linux-pci
Message-ID <[email protected]>
> From: Leon Romanovsky <[email protected]>
> 
> Extend the ACS KUnit suite with end-to-end coverage of
> calc_map_type_and_dist(), the provider-to-client hierarchy walk.
> 
> A fabricated PCIe fabric (host bridge, Root Port, Switch Upstream Port,
> two Switch Downstream Ports and the provider/client endpoints) with a
> fake pci_ops backing the ACS Control, Egress Control Vector and LNKCAP
> reads lets the walk run without real hardware.  The tests assert:
> 
>   - BUS_ADDR when no port on the path enables ACS;
>   - THRU_HOST_BRIDGE when a Downstream Port's Egress Control Vector
>     routes the peer with Request Redirect clear (an ACS Violation) at the
>     path divergence, leaving only the host-bridge route;
>   - BUS_ADDR when Egress Control is enabled but the peer's vector bit is
>     clear;
>   - THRU_HOST_BRIDGE when Request Redirect redirects the request and the
>     host bridge is whitelisted.
> 
> calc_map_type_and_dist() is exposed under CONFIG_KUNIT via
> VISIBLE_IF_KUNIT.
> 
> Signed-off-by: Leon Romanovsky <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=12