From: Mark Kettenis Subject: Re: ice max vectors To: Alexander Bluhm Cc: tech@openbsd.org Date: Tue, 24 Feb 2026 21:45:36 +0100 > Date: Tue, 24 Feb 2026 21:06:06 +0100 > From: Alexander Bluhm > > Hi, > > Goal is to use IF_MAX_VECTORS as a global paramter to tune interface > queues. ICE_MAX_VECTORS should contain the actual hardware > limitation. > > For that we need array sizes based on these defines. And I think > the current sw_intr array is too small. iv_qid + 1 is used as an > index, so we need one more. > > ok? > > #define ICE_MAX_VECTORS 8 /* XXX this is pretty arbitrary */ > Does anyone know a more realistic number for ice than 8 ? You could look at pcidump -v output on a few machines. MSI should report the number of vectors; for MSI-X the table size should be equivalent. > Index: dev/pci/if_ice.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/dev/pci/if_ice.c,v > diff -u -p -r1.67 if_ice.c > --- dev/pci/if_ice.c 19 Feb 2026 10:15:36 -0000 1.67 > +++ dev/pci/if_ice.c 24 Feb 2026 19:50:59 -0000 > @@ -308,8 +308,8 @@ struct ice_softc { > > /* isc_* fields inherited from FreeBSD iflib struct if_softc_ctx */ > int isc_tx_nsegments; > - int isc_ntxd[8]; > - int isc_nrxd[8]; > + int isc_ntxd[MIN(ICE_MAX_VECTORS, IF_MAX_VECTORS)]; > + int isc_nrxd[MIN(ICE_MAX_VECTORS, IF_MAX_VECTORS)]; > int isc_tx_tso_segments_max; > int isc_tx_tso_size_max; > int isc_tx_tso_segsize_max; > @@ -339,7 +339,7 @@ struct ice_softc { > > int rebuild_ticks; > > - int sw_intr[ICE_MAX_VECTORS]; > + int sw_intr[MIN(ICE_MAX_VECTORS, IF_MAX_VECTORS) + 1]; > }; > > static int ice_rxrinfo(struct ice_softc *, struct if_rxrinfo *); > >