Article View: linux.kernel.netdev
Article #10820Re: [PATCH net-next v2] mctp i2c: add sysfs control for mux child netdevs
From: Matt Johnston
Date: Wed, 04 Nov 2026 06:44
Date: Wed, 04 Nov 2026 06:44
50 lines
10734 bytes
10734 bytes
Hi Kenny, On Tue, 2026-11-03 at 14:47 +0000, Kenny Hsieh wrote: > Hi Matt, > > On Mon, 2026-11-02 at 17:04 +0800, Matt Johnston wrote: > > An alternative could be to create sysfs attributes under the mctp-i2c device > > instance itself (the i2c slave). > > > > Mux buses could have mctp-i2c netdevs instantiated with > > > > echo "i2c-6" > /sys/bus/i2c/devices/2-1060/add_mctp_controller > > > > (where i2c-6 is a child mux bus of i2c-2, and i2c-2 0x60 is a mctp-i2c i2c > > device). > > > > "echo i2c-6 > .../2-1060/remove_mctp_controller" would remove the mctp-i2c > > netdev. > > Setting a root node as an mctp controller would involve writing its own name > > to the attribute file. > > > > How does that look to you? > > I like that a lot better. Since the attributes live on the mctp-i2c > device, they can just go in dev_groups and the driver core creates and > removes them for us. So I can drop the per-adapter tracking list, and > the remove ordering and probe walk races Sashiko found go away with it. > > Let me know if you'd rather have any of these differently: > > - adding a bus that already has a netdev, or removing one that > doesn't, just returns success Would it be better to return EEXIST (add) or ENODEV (remove) for those cases? That could catch mistakes. Usually there'd be a single userspace program managing it, so it doesn't need to be idempotent? > - a bus that isn't in this controller's mux tree gets -EINVAL > - a bus name that doesn't exist, e.g. i2c-9999, gets -ENODEV Those look good. Cheers, Matt
Technical Details
Message-ID:
<e89969f13177f2e7b3105851d0cf42eaf11bd98e.camel@codeconstruct.com.au>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356236-linux-kernel-netdev=dewy.ruReferences:
<20261015081341.1262695-1-kenny_hsieh@jabil.com> <179239912623.3135.11352652156626817288@kernel.org> <DM8PR02MB808768B7D02FF12777B7777E8E602@DM8PR02MB8087.namprd02.prod.outlook.com> <7486b1fc4dbcca755dd2f6b6de54d17919af873a.camel@codeconstruct.com.au> <DM8PR02MB80878075D2520A9CAD7DF0928E692@DM8PR02MB8087.namprd02.prod.outlook.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356236-linux-kernel-netdev=dewy.ru From: matt@codeconstruct.com.au (Matt Johnston) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2] mctp i2c: add sysfs control for mux child netdevs Date: Wed, 04 Nov 2026 14:44:01 +0800 Organization: Usenet Network Message-ID: <e89969f13177f2e7b3105851d0cf42eaf11bd98e.camel@codeconstruct.com.au> References: <20261015081341.1262695-1-kenny_hsieh@jabil.com> <179239912623.3135.11352652156626817288@kernel.org> <DM8PR02MB808768B7D02FF12777B7777E8E602@DM8PR02MB8087.namprd02.prod.outlook.com> <7486b1fc4dbcca755dd2f6b6de54d17919af873a.camel@codeconstruct.com.au> <DM8PR02MB80878075D2520A9CAD7DF0928E692@DM8PR02MB8087.namprd02.prod.outlook.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="3342209"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:bjP7iTJRgNtP5fey1TmzJPtxm84= sha256:wMxOIS+lGq6hp9xN7LzyIdPSsK6/3xEJPbtDhhPTHHs= sha1:U8Vph8cdZiVFEW0aovJ232iT3nQ= sha256:t6qV8c8pXTG0QQdiVgvckldtIMA8UsmMnW4/s0nYIEo= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 14F2A112B0B; Wed, 4 Nov 2026 09:51:41 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=codeconstruct.com.au X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C6ojGezBBAXQ; Wed, 4 Nov 2026 09:51:37 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-356236-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=codeconstruct.com.au X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id B36A3112B01; Wed, 4 Nov 2026 09:51:27 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 863E52D6CD; Wed, 4 Nov 2026 06:44:30 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793774669; b=itJKHHV0M8Oxy46P3xzM16XMhuAPUiR1EdjkFT3lVzs8r3heqnU5x7gIiGHOyqT+N+dW LkGas/8SQ3jGom2eidsLxitFEzZn1Clwkiz1/UzyjpysrpvuKbF2YIjVDfkepaJ8QgTOD ru6P6C3Qpg3E5FLaxUvAfEAb/QqPysA/6D9Y0hA4s9xlDdX65qZA0Rq4nJ6uvaM3OAQ4r oCd2qVzR4lfOYs4YanYT/9b5/HYW6Er1cwZmZ3m0izKDmzaV8sghj7JqXtX/O6afNM4w6 z0LJa7olsvwMv5xK2d9OuXotk6sdYESDiyVtU4IhQOYa1iPHZfbZCiN75swhVDH2yPA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793774669; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received: Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:Content-Transfer-Encoding:User-Agent:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version; bh=5FrnZXhgWerXcG8ymggsVZPGtznnjgT06atJ+YKwCsw=; b=ota2Gsirvk9s4cpWBdaNsqTIcCP0obayxFe/D0iNGla0Te39i7pUActO5AHuOQmYXSP0 DKTjLhHUjZVcfCXGGi5VbFi5wZ5wVDataX+XJGk2yA8aNY34XKkBgCToVc07/AIYIrOJe ToSOcuqvSofThSOS8YiO7kqCYTM3oZQNA6/u8IefK0k4/YD4ttWehSa1HIdJ6lR8DlzKY jcTH8xt0/mycSa4rRCkVutHOMCRj60JnUiJ5DtGuMvJHJ3x/yx8fo1/HUXa6XI9Oywuhn 4YKiHsXaJTkucswo8le3a+QmiJkYoQ/Dd/J3vBL8Aj5E9aAJyP2EIAPMJ0yD9zvTSJQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.a=rsa-sha256 header.s=2022a header.b=XG6G26+s; dmarc=pass header.from=codeconstruct.com.au; spf=pass smtp.mailfrom=codeconstruct.com.au; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5C00606A333; Wed, 4 Nov 2026 06:44:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.a=rsa-sha256 header.s=2022a header.b=XG6G26+s X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=203.29.241.158 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793774653; b=WBN15moNpcKTXbPooa2oPmz2UXBL4d8zHAMHv5rbnZqPrP81VFNnjrxbILdo8zf0A0Ba m4x2TIKPpB4WcOV3r+oiS6hlCmrNSAgTUOkJbjEBhWFqdEhtlfNRfjXSnUAe3v97Aa1cN /Apl3Y5IK/XQ/f+amU1cOuCrZtvdevxOp9RFa1G7cneDudnHneAqE7lY7tLST7Kmr8en1 Q0djoiFawbYYIDFWT2a8TYGchOnxSigt3pSFmq2Pp4U7s+Ad4qHRZOr1ekxW+ym4H3+E3 uFQHZ9Cy+2rDUzso1K4V6B/kA/ZLM5KlNVL9G/BYRwA2prtnicq6ffJpbZ6w11P6odw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793774653; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Subject:From:To:Cc: Date:In-Reply-To:References:Content-Type:Content-Transfer-Encoding: User-Agent:MIME-Version; bh=5FrnZXhgWerXcG8ymggsVZPGtznnjgT06atJ+YKwCsw=; b=hAy+Iicy5kFy8DPxpKqn8mo3ws/yblMOhyUOdyYISPD7TwR5xh8ztmj5whH0R8dqKIf3 swC+y6livrquA0wU2nYEat2IGZWF/HFWG9JxN7ODodwRlzKUfqiC1pidVMXAPBsPb8urp /HM/KRtzDTJbNYr+K2SHL5/THt0JoETm9OgFcoEJq8BxNVGd+kG2VVvYJbPFMa5pwsILu avN55q8U08dbA989mtkKgplsIfxK3FN4jOLwLZh//aaJLvsgQFhcc8nYmR7V5xXw10nRD E1UfJgpzIee9lOoXwVTAK4CqF+gSQgkPAWvgtf2pF9hyDX6tuyHJHoZ/bwP9VTlyn+g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=codeconstruct.com.au; spf=pass smtp.mailfrom=codeconstruct.com.au; dkim=pass header.d=codeconstruct.com.au header.i=@codeconstruct.com.au header.a=rsa-sha256 header.s=2022a header.b=XG6G26+s; arc=none smtp.remote-ip=203.29.241.158 X-Received: from codeconstruct.com.au (pi.codeconstruct.com.au [203.29.241.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 721A6606A31B; Wed, 4 Nov 2026 06:44:12 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 721A6606A31B X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codeconstruct.com.au X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=codeconstruct.com.au X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeconstruct.com.au; s=2022a; t=1793774643; bh=5FrnZXhgWerXcG8ymggsVZPGtznnjgT06atJ+YKwCsw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=XG6G26+s/bdq0EvP4046nZzifwVf8qL5acbkt2Nu7LMV1FHbmsRc2S6uCJx5Jll3V eHy1N/xOS0SQT3B2Ix/p5Qe81kVZEkm/JoZD/LyiKNj81oh8C+P+EboW68cWki//63 dUQH+O7MwiuWdTiA/BqhnSKLNK6T+u9tQkD2S27/qQXrAVTBYRncWJEwS81JnH6xSq qkRDgWRwW7vDHwCJQqPOPVbODQlWH7TzVOCtI3fhMlgWhx7MvwD8VBgfMi6Q3jF0Ss NJ6ZTjdSzo6qh6Vxsv7e8oMcPo9eBvmu0DqjqMw86y8hYwcr0KeCyedkSk/dWIXXY8 DcJDCqieDCg0Q== X-Received: from [192.168.14.220] (unknown [144.6.157.237]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id AD6156469B; Wed, 4 Nov 2026 14:44:01 +0800 (AWST) X-Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>, "jk@codeconstruct.com.au" <jk@codeconstruct.com.au>, "andi.shyti@kernel.org" <andi.shyti@kernel.org>, "peda@lysator.liu.se" <peda@lysator.liu.se>, "andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>, "davem@davemloft.net" <davem@davemloft.net>, "edumazet@kernel.org" <edumazet@kernel.org>, "kuba@kernel.org" <kuba@kernel.org>, "pabeni@redhat.com" <pabeni@redhat.com>, "linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> X-In-Reply-To: <DM8PR02MB80878075D2520A9CAD7DF0928E692@DM8PR02MB8087.namprd02.prod.outlook.com> X-User-Agent: Evolution 3.56.2-9 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list