From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8404AC001E0 for ; Tue, 1 Aug 2023 13:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DRXkAQCKroPgRXYooZsPJIEHSQJOWtIHXkRVnEpix6U=; b=Xma9DQPjScLC25 7RUisDAVEYHTXzRLV79RWvpFrT39gjmjlHr41z+KGTxZ8eEWEUbkBY4JbVpcUzlsa2pUd/Gzx7NWu uOEAfo+OEKLKLAPAMvR0Wf3BBrMVtqXYxBQ1GsPdw3ev8aYHXVgC32pTzzVbrJAZ9BowFNA35hmlJ xfP15jhajqNMUt0tN9qNSdEN1TbZVK0hv0SCIJs8jUN5CSjquji5c6hpubMQMG4rfBdQgYNu7vad5 gUGOy1GfSGzYan0LmMcrFu0JyJD8PliMXIdjThX/Jz2tcBT+ddfRLKME1eBKD59cDvYw3mg31egPv YWrNLJJzfsHdGPCBWBYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQpLg-002RUI-2O; Tue, 01 Aug 2023 13:23:40 +0000 Received: from out-89.mta0.migadu.com ([91.218.175.89]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQpLd-002RTZ-1t for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 13:23:39 +0000 Message-ID: <4f2e91c7-e2e8-6b3a-fc14-8f44503fb6be@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1690896209; 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=NBW3OZNb/cLDZnirr+w27tj54Ks2k4ls9Y5vjfjj6bw=; b=OIxsK8VkfjPpTCrj/CQl8MJRPM+qMAMj5bitylG9vPg2KP/SAyaMkSNj31dM1k06aAXZoN +ymhn4Fp9EyLMTyERo1f2CDtYlJ7xSKPoBg43doL48MpriKySFZH+46JXCqjMWZ/9dKARA YEQB0+gbdh3LLlGJ7n5e8ERY1bv5vVE= Date: Tue, 1 Aug 2023 14:23:26 +0100 MIME-Version: 1.0 Subject: Re: [PATCH net-next 07/11] netdev: expose DPLL pin handle for netdevice Content-Language: en-US To: Jiri Pirko , Jiri Pirko Cc: Milena Olech , Michal Michalik , linux-arm-kernel@lists.infradead.org, poros@redhat.com, mschmidt@redhat.com, netdev@vger.kernel.org, linux-clk@vger.kernel.org, Bart Van Assche , Jakub Kicinski , Arkadiusz Kubalewski , Paolo Abeni , Jonathan Lemon References: <20230720091903.297066-1-vadim.fedorenko@linux.dev> <20230720091903.297066-8-vadim.fedorenko@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20230720091903.297066-8-vadim.fedorenko@linux.dev> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_062338_159585_6F5E8F10 X-CRM114-Status: GOOD ( 25.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 20/07/2023 10:18, Vadim Fedorenko wrote: > From: Jiri Pirko > > In case netdevice represents a SyncE port, the user needs to understand > the connection between netdevice and associated DPLL pin. There might me > multiple netdevices pointing to the same pin, in case of VF/SF > implementation. > > Add a IFLA Netlink attribute to nest the DPLL pin handle, similar to > how it is implemented for devlink port. Add a struct dpll_pin pointer > to netdev and protect access to it by RTNL. Expose netdev_dpll_pin_set() > and netdev_dpll_pin_clear() helpers to the drivers so they can set/clear > the DPLL pin relationship to netdev. > > Note that during the lifetime of struct dpll_pin the pin handle does not > change. Therefore it is save to access it lockless. It is drivers > responsibility to call netdev_dpll_pin_clear() before dpll_pin_put(). > > Signed-off-by: Jiri Pirko > Signed-off-by: Arkadiusz Kubalewski > Signed-off-by: Vadim Fedorenko > --- > RFC v9->v0: > - rearrange function definition according to usage > v8->v9: > - net_device->dpll_pin is only valid if IS_ENABLED(CONFIG_DPLL) fix the > code in net/core/rtnetlink.c to respect that. > - move dpll_msg_add_pin_handle to "dpll: netlink" patch + export the > function with this patch > > drivers/dpll/dpll_netlink.c | 19 ++++++++++++++++--- > include/linux/dpll.h | 20 ++++++++++++++++++++ > include/linux/netdevice.h | 20 ++++++++++++++++++++ > include/uapi/linux/if_link.h | 2 ++ > net/core/dev.c | 22 ++++++++++++++++++++++ > net/core/rtnetlink.c | 35 +++++++++++++++++++++++++++++++++++ > 6 files changed, 115 insertions(+), 3 deletions(-) > > diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c > index c44dda78737d..e4a9bd767b92 100644 > --- a/drivers/dpll/dpll_netlink.c > +++ b/drivers/dpll/dpll_netlink.c > @@ -37,6 +37,18 @@ dpll_msg_add_dev_handle(struct sk_buff *msg, struct dpll_device *dpll) > return 0; > } > > +/** > + * dpll_msg_pin_handle_size - get size of pin handle attribute for given pin > + * @pin: pin pointer > + * > + * Return: byte size of pin handle attribute for given pin. > + */ > +size_t dpll_msg_pin_handle_size(struct dpll_pin *pin) > +{ > + return pin ? nla_total_size(4) : 0; /* DPLL_A_PIN_ID */ > +} > +EXPORT_SYMBOL_GPL(dpll_msg_pin_handle_size); > + > /** > * dpll_msg_add_pin_handle - attach pin handle attribute to a given message > * @msg: pointer to sk_buff message to attach a pin handle > @@ -54,6 +66,7 @@ int dpll_msg_add_pin_handle(struct sk_buff *msg, struct dpll_pin *pin) > return -EMSGSIZE; > return 0; > } > +EXPORT_SYMBOL_GPL(dpll_msg_add_pin_handle); Jiri, could you please remind me what is the reason to export this function? Because I cannot any usage of this function in drivers. [....] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel