From: kevlo Date: Mon, 20 May 2024 01:51:32 +0000 (+0000) Subject: Map MSI-X in addition to MSI and INTx on rge(4). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d67d920d1bc53c58ec413051dbac20c6029d273e;p=openbsd Map MSI-X in addition to MSI and INTx on rge(4). Brad noticed on Orange Pi 5 Plus apparently the RTL8125 Ethernet controller doesn't support MSIs, but does support MSI-X. With this diff running on Orange Pi 5+ we switch over from shared INTx to device-specific MSI-X interrupts. Tested by Brad. ok kettenis@ --- diff --git a/sys/dev/pci/if_rge.c b/sys/dev/pci/if_rge.c index 07513add23a..6a487c50f1b 100644 --- a/sys/dev/pci/if_rge.c +++ b/sys/dev/pci/if_rge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rge.c,v 1.24 2024/04/13 23:44:11 jsg Exp $ */ +/* $OpenBSD: if_rge.c,v 1.25 2024/05/20 01:51:32 kevlo Exp $ */ /* * Copyright (c) 2019, 2020, 2023 Kevin Lo @@ -209,7 +209,8 @@ rge_attach(struct device *parent, struct device *self, void *aux) /* * Allocate interrupt. */ - 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->rge_flags |= RGE_FLAG_MSI; else if (pci_intr_map(pa, &ih) != 0) { printf(": couldn't map interrupt\n");