From nobody Tue Jan 31 20:03:17 2023 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 4P5ww56Hqnz3c888; Tue, 31 Jan 2023 20:03:17 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P5ww550XPz3Crr; Tue, 31 Jan 2023 20:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675195397; 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=uDPqowBnSSQuc+3rlDPGMNd217UBKWqO/g7lX9U0w/U=; b=iW1YxLJeCKYbJR/Bfyj4C5XLd0ElOeIoMrJ4W7ADy5uLdxRVsHA2ERbsI45fiZkqNI+rpq 984brgZKpRzrGuUgEmOCArAb1jMXVeRvk2ysKjN9CGe6PfRVjAtg3aPJ5o0TypLKQIEki/ Nf3IjFOJHtJbzY08liAJjEGaEHU0ST4I7tr8kIPtmbQEIbxbmMHyzepcA0UM6OAIzYXK6c wral3uGRMeQUaNgkzki2ZPTg/YrEtNi/g58AZmjeI8TY0yiPQjq08wY7SwdJz+56aDVBJr Nn3RFJMPH+XeEsJ31kd8AUnq2yXBROo08FS/HB/wRGGUkyRXfUvNHl2r8yBJjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675195397; 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=uDPqowBnSSQuc+3rlDPGMNd217UBKWqO/g7lX9U0w/U=; b=DTrx149EU3POoL8wirbRCfa8ZwxBM7xurK/xiYaLHcTZXKRhNMLXNkZ8nkTpKK33CvuewR Su4Bn9N0iwmNTy/oikoDlP+H+spCEXnHzhi+LRT5wGK+wShH2/KHZRV9a7M+WF6+9zgR/w yQ0K5zQxINCs1LuRWsiT6xx8SywLJQxkL6rVZDkGOPsBdLamNvcWSY392Zy+qjsmh3BNl0 ZgnyCH1CNj2K7X0OefkzYH5mp6h2L6DjljwpNSqP/PescWjGcUNdfapntYSqIyordhB8oD a+uerUXgRFzl5lK40FLhYMDib24X8RkpHkVILTJKiyX5faeOKD2iEH3PL2+mXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675195397; a=rsa-sha256; cv=none; b=hG1nF1amm282lnNyTA+q0f7Bxmtc44nYb8njZz2iPxRtkdoSPpdAdyoCL+rAIqxhZr/Gh1 zR/gBYZncBIwsHFypDM8CXJOCGurLpC2GKxyfSjswWLUbQO7+QHfKZU6DjGKQh+3OvNpyl x6e2GP+N4rS7Krb1EL2OhJ3m/BudPw8Ccj91EUoOGBG0Y79uFhbic5ZWLhyQZktPm1Kvim 6ndi40BQU0ChemVi2XNV8627W4o3TeCn4Unooqwv7bGX8ycvpD6MtNHOepEANVkTl4d2e7 OH2UKlYVKlngLS+ek4E8Lo+4683R6csdc1dx0iZsAh1QQn5tIZqG0wV8kU93sQ== 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 4P5ww53VB4z11dN; Tue, 31 Jan 2023 20:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30VK3HIN024944; Tue, 31 Jan 2023 20:03:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30VK3HEg024943; Tue, 31 Jan 2023 20:03:17 GMT (envelope-from git) Date: Tue, 31 Jan 2023 20:03:17 GMT Message-Id: <202301312003.30VK3HEg024943@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: c255d1a401c7 - main - IfAPI: Add if_llsoftc member accessors for TOEDEV 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c255d1a401c7ed736ba6bb7894deda584356bfaf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=c255d1a401c7ed736ba6bb7894deda584356bfaf commit c255d1a401c7ed736ba6bb7894deda584356bfaf Author: Justin Hibbits AuthorDate: 2023-01-23 15:11:02 +0000 Commit: Justin Hibbits CommitDate: 2023-01-31 20:02:16 +0000 IfAPI: Add if_llsoftc member accessors for TOEDEV Summary: Keep TOEDEV() macro for backwards compatibility, and add a SETTOEDEV() macro to complement with the new accessors. Sponsored by: Juniper Networks, Inc. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D38199 --- sys/dev/cxgbe/tom/t4_tom.c | 2 +- sys/net/if.c | 12 ++++++++++++ sys/net/if_var.h | 5 ++++- sys/net/if_vlan.c | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 869373515a3a..aae78d99abef 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -1901,7 +1901,7 @@ t4_tom_activate(struct adapter *sc) for_each_port(sc, i) { for_each_vi(sc->port[i], v, vi) { - TOEDEV(vi->ifp) = &td->tod; + SETTOEDEV(vi->ifp, &td->tod); } } diff --git a/sys/net/if.c b/sys/net/if.c index a6cf6d050875..1a42b562190d 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4827,6 +4827,18 @@ if_gettype(if_t ifp) return (ifp->if_type); } +void * +if_getllsoftc(if_t ifp) +{ + return (ifp->if_llsoftc); +} + +void +if_setllsoftc(if_t ifp, void *llsoftc) +{ + ifp->if_llsoftc = llsoftc; +}; + #ifdef DDB static void if_show_ifnet(struct ifnet *ifp) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index e9e6086bfa89..3b293cdff26f 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -412,7 +412,8 @@ EVENTHANDLER_DECLARE(group_change_event, group_change_event_handler_t); #define IF_MINMTU 72 #define IF_MAXMTU 65535 -#define TOEDEV(ifp) ((ifp)->if_llsoftc) +#define TOEDEV(ifp) if_getllsoftc(ifp) +#define SETTOEDEV(ifp, sc) if_setllsoftc((ifp), (sc)) /* * The ifaddr structure contains information about one address @@ -597,6 +598,8 @@ int if_togglehwassist(if_t ifp, int toggle_bits); int if_setsoftc(if_t ifp, void *softc); void *if_getsoftc(if_t ifp); int if_setflags(if_t ifp, int flags); +void if_setllsoftc(if_t ifp, void *softc); +void *if_getllsoftc(if_t ifp); int if_gethwaddr(const if_t ifp, struct ifreq *); int if_setmtu(if_t ifp, int mtu); int if_getmtu(const if_t ifp); diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index d908d97b6e6d..d8be44b105f1 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1922,7 +1922,7 @@ vlan_capabilities(struct ifvlan *ifv) if (p->if_capabilities & IFCAP_VLAN_TOE) cap |= p->if_capabilities & IFCAP_TOE; if (p->if_capenable & IFCAP_VLAN_TOE) { - TOEDEV(ifp) = TOEDEV(p); + SETTOEDEV(ifp, TOEDEV(p)); ena |= mena & IFCAP_TOE; }