Index | Thread | Search

From:
Mark Kettenis <mark.kettenis@xs4all.nl>
Subject:
Re: bge(4): Enable use of MSI-X interrupts
To:
Brad Smith <brad@comstyle.com>
Cc:
tech@openbsd.org, hrvoje@srce.hr
Date:
Sun, 26 Jan 2025 14:52:20 +0100

Download raw body.

Thread
> Date: Sun, 26 Jan 2025 03:23:02 -0500
> From: Brad Smith <brad@comstyle.com>
> 
> Tested on amd64 and arm64.
> 
> bge0 at pci26 dev 0 function 0 "Broadcom BCM5720" rev 0x00, BCM5720 A0
> (0x5720000), APE firmware NCSI 1.5.14.0: msix, address 34:48:ed:e9:6d:48
> brgphy0 at bge0 phy 1: BCM5720C 10/100/1000baseT PHY, rev. 0
> bge1 at pci26 dev 0 function 1 "Broadcom BCM5720" rev 0x00, BCM5720 A0
> (0x5720000), APE firmware NCSI 1.5.14.0: msix, address 34:48:ed:e9:6d:49
> brgphy1 at bge1 phy 2: BCM5720C 10/100/1000baseT PHY, rev. 0
> 
> 
> bge0 at pci3 dev 0 function 0 "Broadcom BCM57762" rev 0x00, BCM57766 A0 (0x57766000): msix, address 14:98:77:67:d0:5a
> brgphy0 at bge0 phy 1: BCM57765, rev. 0
> 
> BCM5720 tested by Hrvoje.

Does this fix anything?  There is no real benefit in doing this unless
a driver is using multiple interrupt vectors or the hardware doesn't
implement normal MSI.

> Index: if_bge.c
> ===================================================================
> RCS file: /home/cvs/src/sys/dev/pci/if_bge.c,v
> diff -u -p -u -p -r1.404 if_bge.c
> --- if_bge.c	14 Apr 2024 03:26:25 -0000	1.404
> +++ if_bge.c	29 May 2024 08:50:13 -0000
> @@ -2916,7 +2916,8 @@ bge_attach(struct device *parent, struct
>  	}
>  
>  	DPRINTFN(5, ("pci_intr_map\n"));
> -	if (pci_intr_map_msi(pa, &ih) == 0)
> +	if (pci_intr_map_msix(pa, 0, &ih) == 0 ||
> +	    pci_intr_map_msi(pa, &ih) == 0)
>  		sc->bge_flags |= BGE_MSI;
>  	else if (pci_intr_map(pa, &ih)) {
>  		printf(": couldn't map interrupt\n");
> 
>