From nobody Fri Dec 23 18:35:54 2022 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 4NdwqQ2XPDz1HMDm; Fri, 23 Dec 2022 18:36:02 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4NdwqP2XvSz3Dp5; Fri, 23 Dec 2022 18:36:01 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org; dmarc=none Received: by glebi.us (Postfix, from userid 1000) id C1066DA02; Fri, 23 Dec 2022 10:35:54 -0800 (PST) Date: Fri, 23 Dec 2022 10:35:54 -0800 From: Gleb Smirnoff To: Justin Hibbits Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: eb1da3e52582 - main - DrvAPI: Extend driver KPI with more accessors Message-ID: References: <202212201623.2BKGNZDV020962@gitrepo.freebsd.org> 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202212201623.2BKGNZDV020962@gitrepo.freebsd.org> X-Spamd-Result: default: False [0.55 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.951]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; ARC_NA(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[glebius]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4NdwqP2XvSz3Dp5 X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N Justin, On Tue, Dec 20, 2022 at 04:23:35PM +0000, Justin Hibbits wrote: J> The branch main has been updated by jhibbits: J> J> URL: https://cgit.FreeBSD.org/src/commit/?id=eb1da3e5258238e1c0555c6a006a341df0821d8e J> J> commit eb1da3e5258238e1c0555c6a006a341df0821d8e J> Author: Justin Hibbits J> AuthorDate: 2022-12-09 20:54:51 +0000 J> Commit: Justin Hibbits J> CommitDate: 2022-12-20 16:18:50 +0000 J> J> DrvAPI: Extend driver KPI with more accessors J> J> Summary: J> Add the following accessors to hide some more netstack details: J> * if_get/setcapabilities2 and *bits analogue J> * if_setdname J> * if_getxname J> * if_transmit - wrapper for call to ifp->if_transmit() J> - This required changing the existing if_transmit to J> if_transmit_default, since that's its purpose. J> * if_getalloctype J> * if_getindex J> * if_foreach_addr_type - Like if_foreach_lladdr() but for any address J> family type. Used by some drivers to iterate over all AF_INET J> addresses. J> * if_init() - wrapper for ifp->if_init() call J> * if_setinputfn J> * if_setsndtagallocfn J> * if_togglehwassist J> J> Reviewers: #transport, #network, glebius, melifaro J> J> Reviewed by: #network, melifaro J> Sponsored by: Juniper Networks, Inc. J> Differential Revision: https://reviews.freebsd.org/D37664 sorry for not reviewing in time. I got a question. Lots of added code uses (struct ifnet *) cast on an argument that is already if_t. Why could this be necessary? Example: void if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t alloc_fn) { ((struct ifnet *)ifp)->if_snd_tag_alloc = alloc_fn; } -- Gleb Smirnoff