From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61A5A8BEC; Mon, 28 Jul 2025 12:40:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753706429; cv=none; b=ZW8sc/szafK36HP3tomSsWSGVSn90tmpH8HTqic1N5HDqjNIMlWjx/zv/KO+Yz8Kyu9xoTpAnGdZWXuPjKlkjSHIG5nx8Rk/wj8E3t4EvNVB89rYpahkkgyEsXqxe6ukhmZfFr9HzLopSU5W5hXIb9DhYP8f+6kJBAwu+cESUk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753706429; c=relaxed/simple; bh=dTg4wWkdKPCRfym32aJgAHjXglH8povDWDAynj04Cbc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lJ2G3a/dvHI8nYezZSU44GBgmeZoOimuNJGTdCNaoM4CdncS7s1zhNvvj7eN+NPD/Pu3Wf86w9J8AstciAP0rAdGev+/bIl4ny2VvvhG5Yv5OpAtCkYXUgxdOIk3t6+G6sDSwUx2b1x5QHoGcfQSLXYg8tvNxzG67ml4AXOU9Ro= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bzJ4uFKv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bzJ4uFKv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AF8EC4CEE7; Mon, 28 Jul 2025 12:40:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753706428; bh=dTg4wWkdKPCRfym32aJgAHjXglH8povDWDAynj04Cbc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bzJ4uFKvWPrxZswu2/WOHXEn0za6GOHr7iul3iSHpKipGrDHOCdqWFqSlQR2LLv1J LZ0EmFq6NJSMZkqib/7JgYGPy0LEpdgWKHMDfydtDzwaLaFBcXL8lBTW4wNegSSqxG sEBa2h1DI7wuXLGNw0PVEBG+mbmqZSaHUjuFvIx8R5n9MWYzBrB4CduNdtSkNgww1g jE/Oj2VFFC4eOvbr8g5RQFOR1d4H9icwcwWLwzX8tbxruhZpIHmHR2ruxIApWLOvw4 /ONLxRYv6ywGhkkBR4RfSUNWHlOrwHius9M1+wefaij+u3ooAshCyrEMEO0T/DIa1D o/EAswh8UWkXQ== Message-ID: Date: Mon, 28 Jul 2025 14:40:22 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 2/5] net: rpmsg-eth: Add basic rpmsg skeleton To: MD Danish Anwar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Andrew Lunn , Mengyuan Lou , Michael Ellerman , Madhavan Srinivasan , Fan Gong , Lee Trager , Lorenzo Bianconi , Geert Uytterhoeven , Lukas Bulwahn , Parthiban Veerasooran Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250723080322.3047826-1-danishanwar@ti.com> <20250723080322.3047826-3-danishanwar@ti.com> <296d6846-6a28-4e53-9e62-3439ac57d9c1@kernel.org> <5f4e1f99-ff71-443f-ba34-39396946e5b4@ti.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ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/ JoFzZ4B0p27K+qQCF2R96hVvuEyjzBmdq2esyE6zIqftdo4MOJho8uctOiWbwNNq2U9pPWmu 4vXVFBYIGmpyNPYzRm0QPwARAQABwsF8BBgBCgAmAhsMFiEEm9B+DgxR+NWWd7dUG5NDfTtB YpsFAmgXUF8FCRaWWyoACgkQG5NDfTtBYptO0w//dlXJs5/42hAXKsk+PDg3wyEFb4NpyA1v qmx7SfAzk9Hf6lWwU1O6AbqNMbh6PjEwadKUk1m04S7EjdQLsj/MBSgoQtCT3MDmWUUtHZd5 RYIPnPq3WVB47GtuO6/u375tsxhtf7vt95QSYJwCB+ZUgo4T+FV4hquZ4AsRkbgavtIzQisg Dgv76tnEv3YHV8Jn9mi/Bu0FURF+5kpdMfgo1sq6RXNQ//TVf8yFgRtTUdXxW/qHjlYURrm2 H4kutobVEIxiyu6m05q3e9eZB/TaMMNVORx+1kM3j7f0rwtEYUFzY1ygQfpcMDPl7pRYoJjB dSsm0ZuzDaCwaxg2t8hqQJBzJCezTOIkjHUsWAK+tEbU4Z4SnNpCyM3fBqsgYdJxjyC/tWVT AQ18NRLtPw7tK1rdcwCl0GFQHwSwk5pDpz1NH40e6lU+NcXSeiqkDDRkHlftKPV/dV+lQXiu jWt87ecuHlpL3uuQ0ZZNWqHgZoQLXoqC2ZV5KrtKWb/jyiFX/sxSrodALf0zf+tfHv0FZWT2 zHjUqd0t4njD/UOsuIMOQn4Ig0SdivYPfZukb5cdasKJukG1NOpbW7yRNivaCnfZz6dTawXw XRIV/KDsHQiyVxKvN73bThKhONkcX2LWuD928tAR6XMM2G5ovxLe09vuOzzfTWQDsm++9UKF a/A= In-Reply-To: <5f4e1f99-ff71-443f-ba34-39396946e5b4@ti.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 28/07/2025 10:10, MD Danish Anwar wrote: > Hi Krzysztof, > > On 25/07/25 12:48 am, Krzysztof Kozlowski wrote: >> On 23/07/2025 10:03, MD Danish Anwar wrote: >>> This patch introduces a basic RPMSG Ethernet driver skeleton. It adds >> >> Please do not use "This commit/patch/change", but imperative mood. See >> longer explanation here: >> https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95 >> > > Sure. I will fix this in v2. > >>> support for creating virtual Ethernet devices over RPMSG channels, >>> allowing user-space programs to send and receive messages using a >>> standard Ethernet protocol. The driver includes message handling, >>> probe, and remove functions, along with necessary data structures. >>> >> >> >> ... >> >>> + >>> +/** >>> + * rpmsg_eth_get_shm_info - Get shared memory info from device tree >>> + * @common: Pointer to rpmsg_eth_common structure >>> + * >>> + * Return: 0 on success, negative error code on failure >>> + */ >>> +static int rpmsg_eth_get_shm_info(struct rpmsg_eth_common *common) >>> +{ >>> + struct device_node *peer; >>> + const __be32 *reg; >>> + u64 start_address; >>> + int prop_size; >>> + int reg_len; >>> + u64 size; >>> + >>> + peer = of_find_node_by_name(NULL, "virtual-eth-shm"); >> >> >> This is new ABI and I do not see earlier patch documenting it. >> >> You cannot add undocumented ABI... but even if you documented it, I am >> sorry, but I am pretty sure it is wrong. Why are you choosing random >> nodes just because their name by pure coincidence is "virtual-eth-shm"? >> I cannot name my ethernet like that? >> > > This series adds a new virtual ethernet driver. The tx / rx happens in a > shared memory block. I need to have a way for the driver to know what is > the address / size of this block. This driver can be used by any > vendors. The vendors can create a new node in their dt and specify the > base address / size of the shared memory block. > > I wanted to keep the name of the node constant so that the driver can > just look for this name and then grab the address and size. You should not. > > I can create a new binding file for this but I didn't create thinking > it's a virtual device not a physical and I wasn't sure if bindings can > be created for virtual devices. So you added undocumented ABI intentionally, sorry, that's a no go. > > In my use case, I am reserving this shared memory and during reserving I > named the node "virtual-eth-shm". The memory is reserved by the > ti_k3_r5_remoteproc.c driver. The DT change is not part of this series > but can be found > https://gist.github.com/danish-ti/cdd10525ad834fdb20871ab411ff94fb > > The idea is any vendor who want to use this driver, should name their dt > node as "virtual-eth-shm" (if they also need to reserve the memory) so > that the driver can take the address from DT and use it for tx / rx. > > If this is not the correct way, can you please let me know of some other > way to handle this. > > One idea I had was to create a new binding for this node, and use > compatible string to access the node in driver. But the device is > virtual and not physical so I thought that might not be the way to go so > I went with the current approach. virtual devices do not go to DTS anyway. How do you imagine this works? You add it to DTS but you do not add bindings and you expect checks to succeed? Provide details how you checked your DTS compliance. Best regards, Krzysztof