From nobody Sun Aug 9 08:29:32 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hHrfp664jz6nJqg; Sun, 09 Aug 2026 08:30:10 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp052.goneo.de (smtp052.goneo.de [85.220.129.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4hHrfp39bHz3glL; Sun, 09 Aug 2026 08:30:10 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; none Received: from hub2.goneo.de (hub2.goneo.de [85.220.129.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by smtp5.goneo.de (Postfix) with ESMTPS id 3601F240AD4; Sun, 09 Aug 2026 10:30:08 +0200 (CEST) Received: from hub2.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPS id DFBB4240327; Sun, 09 Aug 2026 10:30:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1786264205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZybYU5H5zodGHkRr1i292IuS6ON8nwzmP3DnPkgBr64=; b=PUVwSDPRXJiPWV1pGsJ9ZY+mMG93ERddnsry139hGES2pEcPtiI+RaajgUUmco9B+6fPDT bmJiVNQibHq6DuaBa1qTijtSayWqNSw2A8XGT1vSbj+76dEzHi85wqhbQL2Yh+k2HXBGAh 2AptEhibMtdnsFq3az3fe5+ohx6HZOmG4mby3Hoak7D16LF6duSV1QOkrP/v3TC9nOngZL dG1jQVI5rYMkwWOSgY66Er+K6EgQY+KLLSBR6wlcQMKampREtzFuxs1FkLe3biXqtYdzZa d4xPKDe+Lqw0hUGQdbIAnRP7Pv2Ij17N/gbXyJ2/MdGMsyKTDjVO1As4Yo502w== Received: from thor.sb211.local (dynamic-2a02-3100-2218-8c02-8ba5-3252-5c0e-dee7.310.pool.telefonica.de [IPv6:2a02:3100:2218:8c02:8ba5:3252:5c0e:dee7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPSA id 764A124016C; Sun, 09 Aug 2026 10:30:03 +0200 (CEST) Date: Sun, 9 Aug 2026 10:29:32 +0200 From: A FreeBSD User To: Kevin Bowling Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c30021fe0df9 - main - ixgbe: Report SR-IOV VF status Message-ID: <20260809102255.72603b04@thor.sb211.local> In-Reply-To: <6a782297.3fa92.45daf9@gitrepo.freebsd.org> References: <6a782297.3fa92.45daf9@gitrepo.freebsd.org> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; amd64-portbld-freebsd16.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/Q9SbY_F1aj+=imG5oylze/y"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Rspamd-UID: bc843f X-Rspamd-UID: 885d6b X-Rspamd-Queue-Id: 4hHrfp39bHz3glL X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25394, ipnet:85.220.128.0/17, country:DE] X-Spamd-Bar: ---- --Sig_/Q9SbY_F1aj+=imG5oylze/y Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Tage des Herren Sun, 09 Aug 2026 06:47:51 +0000 Kevin Bowling schrieb: > The branch main has been updated by kbowling: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dc30021fe0df9e045a17292dbe5= 0dfc054b69871f >=20 > commit c30021fe0df9e045a17292dbe50dfc054b69871f > Author: Kevin Bowling > AuthorDate: 2026-08-08 17:37:56 +0000 > Commit: Kevin Bowling > CommitDate: 2026-08-09 06:46:57 +0000 >=20 > ixgbe: Report SR-IOV VF status > =20 > Expose cached VF configuration, policy, and runtime state through the > iflib VF status method. Include access or trunk VLAN mode, the queue > count selected by the current virtualization mode, negotiated mailbox > API, whether traffic is enabled, and the MDD-blocked and quarantine > state. > =20 > The query runs under the iflib context lock and does not issue mailbox > requests or read hardware registers. > --- > sys/dev/ixgbe/if_ix.c | 1 + > sys/dev/ixgbe/if_sriov.c | 90 +++++++++++++++++++++++++++++++++++++++= ++++++ > sys/dev/ixgbe/ixgbe_sriov.h | 1 + > 3 files changed, 92 insertions(+) >=20 > diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c > index 545516cb7372..2bdfc20df9bc 100644 > --- a/sys/dev/ixgbe/if_ix.c > +++ b/sys/dev/ixgbe/if_ix.c > @@ -380,6 +380,7 @@ static device_method_t ixgbe_if_methods[] =3D { > DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), > DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), > DEVMETHOD(ifdi_iov_vf_add, ixgbe_if_iov_vf_add), > + DEVMETHOD(ifdi_vf_status, ixgbe_if_vf_status), > #endif /* PCI_IOV */ > DEVMETHOD_END > }; > diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c > index 4e98b2b5de0c..93555d11e72e 100644 > --- a/sys/dev/ixgbe/if_sriov.c > +++ b/sys/dev/ixgbe/if_sriov.c > @@ -1686,6 +1686,96 @@ ixgbe_mbx_pending(struct ixgbe_softc *sc) > return (false); > } > =20 > +static const char * > +ixgbe_vf_api_version(uint16_t api_ver) > +{ > + switch (api_ver) { > + case ixgbe_mbox_api_10: > + return ("1.0"); > + case ixgbe_mbox_api_20: > + return ("2.0"); > + case ixgbe_mbox_api_11: > + return ("1.1"); > + case ixgbe_mbox_api_12: > + return ("1.2"); > + case ixgbe_mbox_api_13: > + return ("1.3"); > + case ixgbe_mbox_api_14: > + return ("1.4"); > + case ixgbe_mbox_api_15: > + return ("1.5"); > + case ixgbe_mbox_api_16: > + return ("1.6"); > + default: > + return (NULL); > + } > +} > + > +int > +ixgbe_if_vf_status(if_ctx_t ctx, nvlist_t *status) > +{ > + struct ixgbe_softc *sc; > + struct ixgbe_vf *vf; > + const char *api_ver; > + nvlist_t **vfs; > + int error, i; > + > + sc =3D iflib_get_softc(ctx); > + if (sc->num_vfs =3D=3D 0) > + return (ENXIO); > + vfs =3D mallocarray(sc->num_vfs, sizeof(*vfs), M_IXGBE_SRIOV, > + M_WAITOK | M_ZERO); > + for (i =3D 0; i < sc->num_vfs; i++) { > + vf =3D &sc->vfs[i]; > + vfs[i] =3D nvlist_create(0); > + nvlist_add_number(vfs[i], IFVF_STATUS_INDEX, i); > + nvlist_add_bool(vfs[i], IFVF_STATUS_CONFIGURED, > + (vf->flags & IXGBE_VF_ACTIVE) !=3D 0); > + nvlist_add_bool(vfs[i], IFVF_STATUS_INITIALIZED, > + (vf->flags & IXGBE_VF_CTS) !=3D 0); > + nvlist_add_binary(vfs[i], IFVF_STATUS_MAC, vf->ether_addr, > + ETHER_ADDR_LEN); > + if (vf->default_vlan =3D=3D 0) > + nvlist_add_string(vfs[i], IFVF_STATUS_VLAN_MODE, > + IFVF_VLAN_MODE_TRUNK); > + else { > + nvlist_add_string(vfs[i], IFVF_STATUS_VLAN_MODE, > + IFVF_VLAN_MODE_ACCESS); > + nvlist_add_number(vfs[i], IFVF_STATUS_VLAN, > + vf->default_vlan); > + } > + nvlist_add_number(vfs[i], IFVF_STATUS_VLAN_COUNT, > + vf->num_vlans); > + nvlist_add_number(vfs[i], IFVF_STATUS_NUM_QUEUES, > + ixgbe_vf_queues(sc->iov_mode)); > + nvlist_add_bool(vfs[i], IFVF_STATUS_ALLOW_SET_MAC, > + (vf->flags & IXGBE_VF_CAP_MAC) !=3D 0); > + nvlist_add_bool(vfs[i], IFVF_STATUS_ALLOW_SET_VLAN, > + (vf->flags & IXGBE_VF_CAP_VLAN) !=3D 0); > + nvlist_add_bool(vfs[i], IFVF_STATUS_MAC_ANTI_SPOOF, > + (vf->flags & IXGBE_VF_ANTI_SPOOF) !=3D 0); > + nvlist_add_bool(vfs[i], IFVF_STATUS_ALLOW_PROMISC, > + (vf->flags & IXGBE_VF_ALLOW_PROMISC) !=3D 0); > + nvlist_add_bool(vfs[i], IFVF_STATUS_TRAFFIC_ENABLED, > + (vf->flags & IXGBE_VF_TRAFFIC_DISABLED) =3D=3D 0); > + nvlist_add_bool(vfs[i], IFVF_STATUS_MDD_BLOCKED, > + (vf->flags & IXGBE_VF_MDD_BLOCKED) !=3D 0); > + nvlist_add_bool(vfs[i], IFVF_STATUS_QUARANTINED, > + (vf->flags & IXGBE_VF_QUARANTINED) !=3D 0); > + api_ver =3D ixgbe_vf_api_version(vf->api_ver); > + if (api_ver !=3D NULL) > + nvlist_add_string(vfs[i], IFVF_STATUS_API_VERSION, > + api_ver); > + } > + nvlist_add_nvlist_array(status, IFVF_STATUS_VFS, > + (const nvlist_t * const *)vfs, sc->num_vfs); > + error =3D nvlist_error(status); > + for (i =3D 0; i < sc->num_vfs; i++) > + nvlist_destroy(vfs[i]); > + free(vfs, M_IXGBE_SRIOV); > + return (error); > +} > + > int > ixgbe_iov_validate(struct ixgbe_softc *sc, u16 num_vfs) > { > diff --git a/sys/dev/ixgbe/ixgbe_sriov.h b/sys/dev/ixgbe/ixgbe_sriov.h > index de0485f6e9a2..3bd86fe06c1b 100644 > --- a/sys/dev/ixgbe/ixgbe_sriov.h > +++ b/sys/dev/ixgbe/ixgbe_sriov.h > @@ -85,6 +85,7 @@ > =20 > int ixgbe_if_iov_vf_add(if_ctx_t, u16, const nvlist_t *); > int ixgbe_if_iov_init(if_ctx_t, u16, const nvlist_t *); > +int ixgbe_if_vf_status(if_ctx_t, nvlist_t *); > int ixgbe_iov_validate(struct ixgbe_softc *, u16); > void ixgbe_if_iov_uninit(if_ctx_t); > void ixgbe_initialize_iov(struct ixgbe_softc *); >=20 The commit seems to disturb build kernel: [...] /usr/src/sys/dev/ixgbe/if_sriov.c:1707:7: error: use of undeclared identifi= er 'ixgbe_mbox_api_16' 1707 | case ixgbe_mbox_api_16: | ^~~~~~~~~~~~~~~~~ 1 error generated. *** Error code 1 Stop. make[4]: stopped making "all" in /usr/src/sys/modules/ix Kind regards, O. Hartmann --=20 A FreeBSD user --Sig_/Q9SbY_F1aj+=imG5oylze/y Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iJEEARYKADkWIQRQheDybVktG5eW/1Kxzvs8OqokrwUCang6hxsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQsc77PDqqJK8aJQEA8qrgi3Dscamirurzj0WF h/bglFYnisHtdylovBeJ1U8A/0wI4AvUJ9E9O3uXo/smSJ5oQIQTRtwPuXgVO87c gM4J =PVbu -----END PGP SIGNATURE----- --Sig_/Q9SbY_F1aj+=imG5oylze/y--