From nobody Sun Nov 30 15:52:13 2025 X-Original-To: dev-commits-src-all@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 4dKBP92Ld6z6HmWw for ; Sun, 30 Nov 2025 15:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKBP91NkWz4PqX for ; Sun, 30 Nov 2025 15:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764517933; 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: content-transfer-encoding:content-transfer-encoding; bh=JixXTMfpNkUSI3F8oHb2FbiPpjFbYyhbljEEAi2p3H8=; b=YFaaG/BrRgc+0UQ1NZuzPuO2YBb1xHGLwkjXYM7gWm0SCxSTVgtV/pt0Oia0J4Ld5eGmqo RP6LtpJ7KxR4g3tXRvZ3XkbIEi4kfdKYtVTTF+S76qPA1v6oBcTkpWssMMxHD5GptZmYYi Xxjo2kXchW8RNoCckcpQtg7BatlAq7SAepwQzkMRpjCaYi1Xj8iInhGZlcLlZW2aEdMhQA Hq8x2K+gOAFlsNGchZ6uhBIkIA6wzo0GejqUf4O8pPB5DpMwFA7TeYpkZO7nE65rrDuN9j W1Q++gS0PDnvbvlDqPtfnW9jRMTVxNGw3U1Zt3/IW8YKuDdlgT7K64RhqMduZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764517933; 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: content-transfer-encoding:content-transfer-encoding; bh=JixXTMfpNkUSI3F8oHb2FbiPpjFbYyhbljEEAi2p3H8=; b=uTGZSAyh50F1rCfpaMTco2jyENlDMjp4XDzd9/+h6XC9876zjjFCb1BZ4GaR0LrPGMwZ4B ciwaXLlK4w8QgAVydlYecWTekh4Uwi8BzB7tVfmzscneSlVDqes4iJGRMQrmCDIlR+OmHK 9JrEp8tAG9bOHpRMFX6SMRkOeB6v25OAcyODG0EUat446QLj0EJfhZbFVmsOtlQf/WjcRZ CzTHASIOsfFlKX+NPXbG1fE2VHtbToZpUoGc2kbTYq6jVTnJpAmMJ9z65v4A/4hdXsS3V6 idNW1XAh5ZqLnvEenZmY5Ax2FzJpfACY+AfM5+PdDiE35h2ZQw3i4bNGxsQovA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764517933; a=rsa-sha256; cv=none; b=r/ucJD0/opg/QK1kCuAgoktZ4bk/ibHM3JV68rwN4U4P4acDy5mSLq6Md0r4CsTww8Giq7 Cbkr7qSZgZC9qO6UrKRy4P6pfejrg9ah5VZtAWCNTsRtIqNDflNlOBFu5VuCgDiKX4ENS8 LcW27Ahp814HJT6/niH35Ab7jdy8gCDO6yMICWDNP1AmtNN2Wj4g8Oz8SOYjsLcKIvlXqn SbNJnQryeMn8lja+B6WekqG59XhRGJmbfeUbC2ydz85IMvkoucKrQOsDavLToLE6BvCtI0 829XZfjQOyv5iImJDwaWRKnAApwye4HRkLWt0YIosMeMsH0AW9qkcVdusYFytA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKBP90wdYzhw7 for ; Sun, 30 Nov 2025 15:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3864c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Nov 2025 15:52:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Olivier Cochard From: Ed Maste Subject: git: 4756f5ff8f10 - main - aq(4): Port to IfAPI List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4756f5ff8f10cdda925cab60c0b66606698e49ee Auto-Submitted: auto-generated Date: Sun, 30 Nov 2025 15:52:13 +0000 Message-Id: <692c682d.3864c.1b910a79@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4756f5ff8f10cdda925cab60c0b66606698e49ee commit 4756f5ff8f10cdda925cab60c0b66606698e49ee Author: Olivier Cochard AuthorDate: 2025-11-13 03:17:03 +0000 Commit: Ed Maste CommitDate: 2025-11-30 15:38:33 +0000 aq(4): Port to IfAPI Direct access to struct ifnet members is not possible in FreeBSD 15; accessors must be used. These exist in all supported FreeBSD versions, so we do not need to make this conditional. --- sys/dev/aq/aq_main.c | 16 ++++++++-------- sys/dev/aq/aq_media.c | 12 ++++++------ sys/dev/aq/aq_ring.c | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index 299ed79f9094..7345c7cc2d03 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -379,7 +379,7 @@ static int aq_if_attach_pre(if_ctx_t ctx) #else if_t ifp; ifp = iflib_get_ifp(ctx); - ifp->if_capenable = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_HWCSUM | IFCAP_TSO | + if_setcapenable(ifp, IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; @@ -718,7 +718,7 @@ static void aq_if_stop(if_ctx_t ctx) static uint64_t aq_if_get_counter(if_ctx_t ctx, ift_counter cnt) { struct aq_dev *softc = iflib_get_softc(ctx); - struct ifnet *ifp = iflib_get_ifp(ctx); + if_t ifp = iflib_get_ifp(ctx); switch (cnt) { case IFCOUNTER_IERRORS: @@ -776,7 +776,7 @@ static bool aq_is_mc_promisc_required(struct aq_dev *softc) static void aq_if_multi_set(if_ctx_t ctx) { struct aq_dev *softc = iflib_get_softc(ctx); - struct ifnet *ifp = iflib_get_ifp(ctx); + if_t ifp = iflib_get_ifp(ctx); struct aq_hw *hw = &softc->hw; AQ_DBG_ENTER(); #if __FreeBSD_version >= 1300054 @@ -786,9 +786,9 @@ static void aq_if_multi_set(if_ctx_t ctx) #endif if (softc->mcnt >= AQ_HW_MAC_MAX) { - aq_hw_set_promisc(hw, !!(ifp->if_flags & IFF_PROMISC), + aq_hw_set_promisc(hw, !!(if_getflags(ifp) & IFF_PROMISC), aq_is_vlan_promisc_required(softc), - !!(ifp->if_flags & IFF_ALLMULTI) || aq_is_mc_promisc_required(softc)); + !!(if_getflags(ifp) & IFF_ALLMULTI) || aq_is_mc_promisc_required(softc)); }else{ #if __FreeBSD_version >= 1300054 if_foreach_llmaddr(iflib_get_ifp(ctx), &aq_mc_filter_apply, softc); @@ -810,7 +810,7 @@ static int aq_if_mtu_set(if_ctx_t ctx, uint32_t mtu) static void aq_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr) { - struct ifnet *ifp; + if_t ifp; AQ_DBG_ENTER(); @@ -824,13 +824,13 @@ static void aq_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr) static int aq_if_media_change(if_ctx_t ctx) { struct aq_dev *softc = iflib_get_softc(ctx); - struct ifnet *ifp = iflib_get_ifp(ctx); + if_t ifp = iflib_get_ifp(ctx); int rc = 0; AQ_DBG_ENTER(); /* Not allowd in UP state, since causes unsync of rings */ - if ((ifp->if_flags & IFF_UP)){ + if ((if_getflags(ifp) & IFF_UP)){ rc = EPERM; goto exit; } diff --git a/sys/dev/aq/aq_media.c b/sys/dev/aq/aq_media.c index 914d3d3eb940..fdf7ef38d2dc 100644 --- a/sys/dev/aq/aq_media.c +++ b/sys/dev/aq/aq_media.c @@ -94,9 +94,9 @@ void aq_mediastatus_update(aq_dev_t *aq_dev, u32 link_speed, const struct aq_hw_ aq_dev->media_active |= IFM_AUTO; } -void aq_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) +void aq_mediastatus(if_t ifp, struct ifmediareq *ifmr) { - aq_dev_t *aq_dev = iflib_get_softc(ifp->if_softc); + aq_dev_t *aq_dev = iflib_get_softc(if_getsoftc(ifp)); ifmr->ifm_active = IFM_ETHER; ifmr->ifm_status = IFM_AVALID; @@ -107,11 +107,11 @@ void aq_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) ifmr->ifm_active |= aq_dev->media_active; } -int aq_mediachange(struct ifnet *ifp) +int aq_mediachange(if_t ifp) { - aq_dev_t *aq_dev = iflib_get_softc(ifp->if_softc); + aq_dev_t *aq_dev = iflib_get_softc(if_getsoftc(ifp)); struct aq_hw *hw = &aq_dev->hw; - int old_media_rate = ifp->if_baudrate; + int old_media_rate = if_getbaudrate(ifp); int old_link_speed = hw->link_rate; struct ifmedia *ifm = iflib_get_media(aq_dev->ctx); int user_media = IFM_SUBTYPE(ifm->ifm_media); @@ -169,7 +169,7 @@ int aq_mediachange(struct ifnet *ifp) hw->fc.fc_tx = (ifm->ifm_media & IFM_ETH_TXPAUSE) ? 1 : 0; /* In down state just remember new link speed */ - if (!(ifp->if_flags & IFF_UP)) + if (!(if_getflags(ifp) & IFF_UP)) return (0); if ((media_rate != old_media_rate) || (hw->link_rate != old_link_speed)) { diff --git a/sys/dev/aq/aq_ring.c b/sys/dev/aq/aq_ring.c index 1de52ed0fc79..e20527b8c7c2 100644 --- a/sys/dev/aq/aq_ring.c +++ b/sys/dev/aq/aq_ring.c @@ -331,7 +331,7 @@ static int aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) aq_dev_t *aq_dev = arg; struct aq_ring *ring = aq_dev->rx_rings[ri->iri_qsidx]; aq_rx_desc_t *rx_desc; - struct ifnet *ifp; + if_t ifp; int cidx, rc = 0, i; size_t len, total_len; @@ -370,7 +370,7 @@ static int aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) cidx = aq_next(cidx, ring->rx_size - 1); } while (!rx_desc->wb.eop); - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) { + if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) { aq_rx_set_cso_flags(rx_desc, ri); } ri->iri_rsstype = bsd_rss_type[rx_desc->wb.rss_type & 0xF];