From nobody Wed Nov 13 19:29:31 2024 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 4XpYJD0hCRz5cTs9; Wed, 13 Nov 2024 19:29:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XpYJD03bjz45T5; Wed, 13 Nov 2024 19:29:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731526172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tH4V3dYZTeWRaXujU6qD/eA1qDU5k9FBxQu5iSPEC3o=; b=wHdEEOiTaXq4gTMkGi+alcta9u7QFO4PKBakXyYdtguB37Cbsacjj9/ADhuxkJXcrKZMdr qYejV15QdWgTXJBLOQeyRK+/kVemN912qrHGwiVbIZS6hl1qjPB3fDvBKIXoic387jzSeN R1vFLCwINmqL6SqbA0LDnJfAjI60oJ1yFg6YgPkFij72Dt9lPwXbYFlm5XzAaQJkeVmBQp 9unE7ieCT9Csx6rEjahRfBjiZKsG63gBQYwjLgTEhsbfUjQ03Mgj0tMocxVw2ejpbuh5Jx bIXsGx14Es3Lv2/RpxPb5qoDiyk/nJxiKQ9BnCINccIVPn4hiCEDBSifXFJ4bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731526172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tH4V3dYZTeWRaXujU6qD/eA1qDU5k9FBxQu5iSPEC3o=; b=ZJjtK92mn2WvEyBuer1wGxsW0p507OQn/bdBPW8fSfzTSc2wh/kgEb88gPJX4eZWBro7A7 6G3b5DYL5g9Qr0WQWAixXdJ+yCwGllQm5OjwSd6UkkghCdiH4l5i9vUG6G/HP47EVVmjlv ksLxGhsNiQYxHieU6mMcXhOjjL+wTresGZPAmqMPp8F8+f4d1mXEWmjl5KDWLXbI1Yc8T/ 5pM+s7s7Iiq4fzMeIcfP/Oc0A2uY//FbPdnHvFi570KgdI55QuA4qK0sQXPeSzi+rgirtm +Q74OvepPKUB6BCtIJz9UL0HjN2RV+8WeC54XNPN7CORmpmZKSkSF8x7AYc5mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731526172; a=rsa-sha256; cv=none; b=KV/iR89C0j52kylmzs3SeNSXXXmMmbp+mjuHQPpybgw/hVy6rgfijWJyGYPYFSdkwgAcO2 yNdGYGgE6CrVFd/ViM7yjpWSk0fb7VJyYE/3VhV9kTZWMLK88Onk0YydjeJCmgK9j3MTeN aSRSeM1YsHkCWOvEYAmAovoekyd3A35bLJ0ioifIQS7wWNYPVrsHPKj20W0zGg2sujAOa0 LmJl5OcpjJnCxWcqToZI3rkarxzMDjCZONyCiLuar15flULsaV57kliqgDgpGcf30xNRTe ypRNKb/MmfTvGBNK6SRgFln0+mLKAqQWM1M3n6juGRlxKnUoeBMq+Cf2xH1rNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XpYJC6mjqz15jQ; Wed, 13 Nov 2024 19:29:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4ADJTVQM033342; Wed, 13 Nov 2024 19:29:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ADJTV8g033339; Wed, 13 Nov 2024 19:29:31 GMT (envelope-from git) Date: Wed, 13 Nov 2024 19:29:31 GMT Message-Id: <202411131929.4ADJTV8g033339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 84d7ec4c657f - main - bnxt: Use IfAPI accessors where able 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: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84d7ec4c657f406c6cbd29baf32c8e057b663d17 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=84d7ec4c657f406c6cbd29baf32c8e057b663d17 commit 84d7ec4c657f406c6cbd29baf32c8e057b663d17 Author: Justin Hibbits AuthorDate: 2024-10-31 14:04:11 +0000 Commit: Justin Hibbits CommitDate: 2024-11-13 19:30:58 +0000 bnxt: Use IfAPI accessors where able Summary: Don't directly access ifnet members, it's a private structure. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D47353 --- sys/dev/bnxt/bnxt_re/bnxt_re.h | 4 ++-- sys/dev/bnxt/bnxt_re/ib_verbs.c | 6 +++--- sys/dev/bnxt/bnxt_re/main.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/bnxt/bnxt_re/bnxt_re.h b/sys/dev/bnxt/bnxt_re/bnxt_re.h index 56b3c8c0488c..fe7a27f4e216 100644 --- a/sys/dev/bnxt/bnxt_re/bnxt_re.h +++ b/sys/dev/bnxt/bnxt_re/bnxt_re.h @@ -946,8 +946,8 @@ int bnxt_re_setup_cnp_cos(struct bnxt_re_dev *rdev, bool reset); static inline enum ib_port_state bnxt_re_get_link_state(struct bnxt_re_dev *rdev) { - if (rdev->netdev->if_drv_flags & IFF_DRV_RUNNING && - rdev->netdev->if_link_state == LINK_STATE_UP) + if (if_getdrvflags(rdev->netdev) & IFF_DRV_RUNNING && + if_getlinkstate(rdev->netdev) == LINK_STATE_UP) return IB_PORT_ACTIVE; return IB_PORT_DOWN; } diff --git a/sys/dev/bnxt/bnxt_re/ib_verbs.c b/sys/dev/bnxt/bnxt_re/ib_verbs.c index 8d43fa96c048..0383a16757aa 100644 --- a/sys/dev/bnxt/bnxt_re/ib_verbs.c +++ b/sys/dev/bnxt/bnxt_re/ib_verbs.c @@ -299,7 +299,7 @@ int bnxt_re_query_port(struct ib_device *ibdev, u8 port_num, if (port_attr->state == IB_PORT_ACTIVE) port_attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP; port_attr->max_mtu = IB_MTU_4096; - port_attr->active_mtu = iboe_get_mtu(rdev->netdev->if_mtu); + port_attr->active_mtu = iboe_get_mtu(if_getmtu(rdev->netdev)); port_attr->gid_tbl_len = dev_attr->max_sgid; port_attr->port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP | IB_PORT_DEVICE_MGMT_SUP | @@ -2118,7 +2118,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd, qplqp->max_rd_atomic = dev_attr->max_qp_rd_atom; qplqp->max_dest_rd_atomic = dev_attr->max_qp_init_rd_atom; } - qplqp->mtu = ib_mtu_enum_to_int(iboe_get_mtu(rdev->netdev->if_mtu)); + qplqp->mtu = ib_mtu_enum_to_int(iboe_get_mtu(if_getmtu(rdev->netdev))); qplqp->dpi = &rdev->dpi_privileged; /* Doorbell page */ if (init_attr->create_flags) { dev_dbg(rdev_to_dev(rdev), @@ -2691,7 +2691,7 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, /* MTU settings allowed only during INIT -> RTR */ if (qp_attr->qp_state == IB_QPS_RTR) { - bnxt_re_init_qpmtu(qp, rdev->netdev->if_mtu, qp_attr_mask, qp_attr, + bnxt_re_init_qpmtu(qp, if_getmtu(rdev->netdev), qp_attr_mask, qp_attr, &is_qpmtu_high); if (udata && !ib_copy_from_udata(&ureq, udata, sizeof(ureq))) { if (ureq.comp_mask & BNXT_RE_COMP_MASK_MQP_EX_PATH_MTU_MASK) { diff --git a/sys/dev/bnxt/bnxt_re/main.c b/sys/dev/bnxt/bnxt_re/main.c index e6c6f754ea47..3d26d21f3fc7 100644 --- a/sys/dev/bnxt/bnxt_re/main.c +++ b/sys/dev/bnxt/bnxt_re/main.c @@ -4168,8 +4168,8 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier, dev_info(rdev_to_dev(rdev), "%s: Event = %s (0x%lx), rdev %s (real_dev %s)\n", __func__, bnxt_re_netevent(event), event, - rdev ? rdev->netdev ? rdev->netdev->if_dname : "->netdev = NULL" : "= NULL", - (real_dev == netdev) ? "= netdev" : real_dev->if_dname); + rdev ? rdev->netdev ? if_getdname(rdev->netdev) : "->netdev = NULL" : "= NULL", + (real_dev == netdev) ? "= netdev" : if_getdname(real_dev)); if (!test_bit(BNXT_RE_FLAG_IBDEV_REGISTERED, &rdev->flags)) goto exit;