From nobody Wed Nov 13 19:29:35 2024 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 4XpYJJ0898z5cTcs; Wed, 13 Nov 2024 19:29:36 +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 4XpYJH3mb2z45yr; Wed, 13 Nov 2024 19:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731526175; 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=TqhdXJZgMgH2ztjc2iS0UxA2w9Tt0adb33JxcvgqxYE=; b=pM8YLH9+q8vieurut6dpz65alRlGHi8CrPKbAXTGK0sodEu7gH1tpZ4WlmtfLc9cE0la5e bTpR6EKx7XuCENOpmXFJ44N2BOAca8+NVlikCbozyDQsHjxbby3vZShrIeoUATYQuwJX6G qSkno6rss6AjMutuNOyJoz/Y+0GRH6qq93HLOngWL1ycf3imaRCXUGpPhTU755Qwt26gcD T/L/EVDEsyjRphlURzMVm3Gp9fyovplDce9Qk8dig3nFN9ZipJ48RK5xtk99VT8fohtLKF +V641pysPZIfosVGctq3RQdDrte2uuuOCMbo4Pr8dIuIe/aPvAu43Pl0i136jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731526175; 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=TqhdXJZgMgH2ztjc2iS0UxA2w9Tt0adb33JxcvgqxYE=; b=GUMkEuWTzQcZ+zoKrR9MQQwCTsy2HCf4X20Wo3QsyPe6G8XVnZj78AfbcKL+vm+c/D+/Xc CELeHu5SzMVlH6Jn/QZJFMTYkiwgaJicVNR7VFjpFltfA45QWyd6MbNOhO8oAa8XeWNej7 AAM0sorjZx/Cc/8xEw6m64zJcKFSMiIwY9V9CWZsVD2IBzsKDxV6UObxaUFFfCn8p5aTvn F26gX5mkAdimgOu1Vi2SazVIOdpXpD5qdEu4r/azFydi5uUyaaZn7T2qyKy+6ZdJm/Gbxt wET/PiTiiH3NIDfTyit5wEaNUBuPFmYb0FXINMNtxU2llilHIJePynpnV6S8iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731526175; a=rsa-sha256; cv=none; b=lbfg93Nph0rISWWg68XwDX1lDorxCArUX4b9s2xY2wlKT2/QkoMajIDBd7lDMN/xDKqima NtPGxZGvElFYFGM4ztLeyd5SNh/fXldTu1CFf8/WyZhmcKKLN/qOK+eW+gWVx9D4p/dcMc mtfbW6z+qXBAVTmSLE6oiR8WjmH8vUsQN5UpWugtMH3aW8e2iUOYDUynodiCd9hl+7Ixnd ir9enp9uVyirnifrsCIRzjP4wPvC3q2dSHhWbHNS6Mpn6iFtBNgCMlWBUVKA/t83rIURVe XccM/vC7DRbVa9xAHKg5XhBM0C2tQ3ZM0AVxq1fHxGeW/DJMwVsbu7RXPC2Mxg== 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 4XpYJH2sPPz16cV; Wed, 13 Nov 2024 19:29:35 +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 4ADJTZ05033487; Wed, 13 Nov 2024 19:29:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ADJTZIb033484; Wed, 13 Nov 2024 19:29:35 GMT (envelope-from git) Date: Wed, 13 Nov 2024 19:29:35 GMT Message-Id: <202411131929.4ADJTZIb033484@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: 1eaecc214ea2 - main - qlnx: Convert recent changes to IfAPI 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 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: 1eaecc214ea2bfde84f4194c1d0e20b18117343f Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=1eaecc214ea2bfde84f4194c1d0e20b18117343f commit 1eaecc214ea2bfde84f4194c1d0e20b18117343f Author: Justin Hibbits AuthorDate: 2024-11-08 20:22:11 +0000 Commit: Justin Hibbits CommitDate: 2024-11-13 19:30:59 +0000 qlnx: Convert recent changes to IfAPI Sponsored by: Juniper Networks, Inc. Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D47533 --- sys/dev/qlnx/qlnxe/qlnx_os.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 49d3f20aa0c2..a984908abf34 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -2624,6 +2624,7 @@ static int qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) { int ret = 0, mask; + int flags; struct ifreq *ifr = (struct ifreq *)data; #ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; @@ -2677,15 +2678,16 @@ qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) QL_DPRINT4(ha, "SIOCSIFFLAGS (0x%lx)\n", cmd); QLNX_LOCK(ha); + flags = if_getflags(ifp); - if (if_getflags(ifp) & IFF_UP) { + if (flags & IFF_UP) { if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { - if ((if_getflags(ifp) ^ ha->if_flags) & + if ((flags ^ ha->if_flags) & IFF_PROMISC) { - ret = qlnx_set_promisc(ha, ifp->if_flags & IFF_PROMISC); + ret = qlnx_set_promisc(ha, flags & IFF_PROMISC); } else if ((if_getflags(ifp) ^ ha->if_flags) & IFF_ALLMULTI) { - ret = qlnx_set_allmulti(ha, ifp->if_flags & IFF_ALLMULTI); + ret = qlnx_set_allmulti(ha, flags & IFF_ALLMULTI); } } else { ha->max_frame_size = if_getmtu(ifp) + @@ -7055,12 +7057,14 @@ qlnx_set_rx_mode(qlnx_host_t *ha) { int rc = 0; uint8_t filter; - const struct ifnet *ifp = ha->ifp; + const if_t ifp = ha->ifp; + const struct ifaddr *ifa; struct sockaddr_dl *sdl; - if (ifp->if_type == IFT_ETHER && ifp->if_addr != NULL && - ifp->if_addr->ifa_addr != NULL) { - sdl = (struct sockaddr_dl *) ifp->if_addr->ifa_addr; + ifa = if_getifaddr(ifp); + if (if_gettype(ifp) == IFT_ETHER && ifa != NULL && + ifa->ifa_addr != NULL) { + sdl = (struct sockaddr_dl *) ifa->ifa_addr; rc = qlnx_set_ucast_rx_mac(ha, ECORE_FILTER_REPLACE, LLADDR(sdl)); } else { @@ -7077,10 +7081,10 @@ qlnx_set_rx_mode(qlnx_host_t *ha) ECORE_ACCEPT_MCAST_MATCHED | ECORE_ACCEPT_BCAST; - if (qlnx_vf_device(ha) == 0 || (ha->ifp->if_flags & IFF_PROMISC)) { + if (qlnx_vf_device(ha) == 0 || (if_getflags(ha->ifp) & IFF_PROMISC)) { filter |= ECORE_ACCEPT_UCAST_UNMATCHED; filter |= ECORE_ACCEPT_MCAST_UNMATCHED; - } else if (ha->ifp->if_flags & IFF_ALLMULTI) { + } else if (if_getflags(ha->ifp) & IFF_ALLMULTI) { filter |= ECORE_ACCEPT_MCAST_UNMATCHED; } ha->filter = filter;