From nobody Fri Dec 23 18:42:14 2022 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 4Ndwyc2H6Cz1HMr8; Fri, 23 Dec 2022 18:42:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ndwyc1sPjz3HYy; Fri, 23 Dec 2022 18:42:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671820936; 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: in-reply-to:in-reply-to:references:references; bh=ACP1crppdYWlmbzq5SJCIi7wEyU9lRe5m1oJOPvcZX0=; b=ZaVkqyZIzBgZgI1GiiThiNn3SjkfA+bP3zjU8jDSaeOr55RZeidwz+nywsp2Tdxv7dBP2d tGIvx2jTH0jyivPCYlHxs7aYjj5zQ5DMrvpnJNaj8pw6OzTm/hGHN0SbxuMiTccf+1O/Tl ov8KTNJgs33kxwYq1eA2QtZ47MjMV4bMbXF55FPYQrApe5f8Nw41CYMbfRpx5nMn4EbUrj Jky4NI0pcUMkahZ3No0XQEBuS6vMYb4jw7Z70t9k/770rE9Y2S2iNQ7CodPxDzII/a9x0u +DXSeKIUDSpLdrcRxgBhjIDfJt5NT4XSR1UzKiUg2oT+e1LEh/mcFVDNynFSwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671820936; 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: in-reply-to:in-reply-to:references:references; bh=ACP1crppdYWlmbzq5SJCIi7wEyU9lRe5m1oJOPvcZX0=; b=wW6E20WunLCE1FuPBuONgO2igKpOpOfpmorg7oxpyWzPbR7z6WwICqU74j6I0KTIMTzd7P XhgA10mmeEs5lv4YdvdPXDmb7zGb6qMy2kyI/cb+iqYpWyChpSYv0/P2AyC7OxNJsaLotC ZIbRAIXc0t2iAN1Z+2X+/pWWpzOL9c178cQycc34+2J0PsRr52uA59c0LdKkEfT8chO0Ao JPwY2O8sRWhneHqZ7m00H3rBViyl0xcicm4Tc8B8EFx+3LHxwO1UcR71eFHtdi0fLktT0u VxYEpb5IltMWb7V2fKTBqL2bZYYAxh4BAMMvU9ry7sKdoQWzutrLhoySogvo1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671820936; a=rsa-sha256; cv=none; b=S8TyjmZMszRI+HIJRLMsiNZURRlcxOOXYdOClfD+hzvIKy3/YuWwTT0bPYODvcwQHjnE7x lDC8qpHB2H6BzibJfk6ebp+CwQeVqd41D2TsVDXP1nKnrN1/Mbxhaa1RnYNB1I2QPmroNz FtCgV41ikO17y6a7Xvh3Vg0WQG5ZtX//qyRWF7aceX8S0O6qwPSQY3F+FsIKWRSVXaX3jh W1qwniXu3sZp7mvW03dSciaE8l5lQAa67vf4UA5/AtNuDc348WQxpig9tcmMdfn40J4ZLd zPu6okJISiTPK79Y3BEMrny9I4FMdzwJMJQQF0Pvd0f4lZ/Xj8sAHPZ+9p+lKA== Received: from ralga-linux (dsl-74-83-251-217.fuse.net [74.83.251.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhibbits) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Ndwyb6mrxzYVw; Fri, 23 Dec 2022 18:42:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Date: Fri, 23 Dec 2022 13:42:14 -0500 From: Justin Hibbits To: Gleb Smirnoff 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: <20221223134214.7dcfe0d9@ralga-linux> In-Reply-To: References: <202212201623.2BKGNZDV020962@gitrepo.freebsd.org> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; powerpc64le-unknown-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On Fri, 23 Dec 2022 10:35:54 -0800 Gleb Smirnoff wrote: > 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: > J> 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 > J> address family type. Used by some drivers to iterate over all > J> AF_INET 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; > } > Hi Gleb, You're right, none of it should have the struct ifnet cast, it's completely redundant. I'm going to remove *all* of these casts (even all existing ones) in one fell swoop at the end of this conversion, around mid January. - Justin