Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1257069pxy; Thu, 6 May 2021 04:16:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1feYVvLXNd9zdjTqQV0veNZD7ZK/kVUBToa75jYu86gWIvFSN1GLJf0jIXWUtfVIzQQIf X-Received: by 2002:a17:906:3ec9:: with SMTP id d9mr3778620ejj.479.1620299765257; Thu, 06 May 2021 04:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620299765; cv=none; d=google.com; s=arc-20160816; b=od0AKnwHvH9y8FFq8h5l+a5N7v/WoNpZQIcTt4f0HXfS399+iHkh3IdjvnKXXtlBvX egmhWbiefLzGpnqABkZ2fyPDdRCATGzS84UZ/M9eqK6Ejj+Z9pMLOiQR1CN8T6SFUBMb ++jupSVOeHxrnKNS1gh0mQ0o+BmF44Si+HGWItF3ObBmd2TINo8I3CcfW/rXDM7nEKTu myaKwQRda1YXmCJ6G4P3Bt4YiJRIjvHxUYMsDDhfQ9kbUymzmumyao95lspLhWIIrxkk K58lNrexpZKvMLtv94gEFX7k+dUqwEkeooLqQ4ggqim0MxkohJPohSSx1AH2+XBYPKN1 4g1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=d7D+bhEchk+SPj6FqG/x9Ap/as2vmtxnTBABbzz0IzU=; b=UuSmiDssPKPLfvdyZcydRjdnL2yf09jE++53fUdAvxH+FQ7UL0wcVZvmaXS1XTZ10V 8YFMTibnGobIq5YZcesanRdB+Yfw7wa9vs6a6NIMWaiCfoIsmjJ5iH2A6AgVrcEVcCGl opf/xGt211RTfqyf9g4bw+dt1Zgfkh2G1t4ty1uBgOJdqQORHrvD23iWdbYnEoEpJJjy rwUL9t1hf0zlgYHKQ5t3TgiGkPttF/wdEXk4oPO5mP7/ot6KjiHp0ZoUjCJO4U+L3yMM mfx9thY5Ur2p9GTGY7WkCWgrWBfjVc2IKTu+IR1SuQl+PIuwt7QuV2vzajN2w3AtPtNk 7Bow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si2088585edi.327.2021.05.06.04.15.40; Thu, 06 May 2021 04:16:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234641AbhEFLP0 (ORCPT + 99 others); Thu, 6 May 2021 07:15:26 -0400 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:35296 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234638AbhEFLP0 (ORCPT ); Thu, 6 May 2021 07:15:26 -0400 Received: from tomoyo.flets-east.jp ([153.202.107.157]) by mwinf5d58 with ME id 1PEF250013PnFJp03PEQrr; Thu, 06 May 2021 13:14:26 +0200 X-ME-Helo: tomoyo.flets-east.jp X-ME-Auth: bWFpbGhvbC52aW5jZW50QHdhbmFkb28uZnI= X-ME-Date: Thu, 06 May 2021 13:14:26 +0200 X-ME-IP: 153.202.107.157 From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org Cc: Oliver Hartkopp , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Mailhol Subject: [RFC PATCH v1 0/1] add the netlink interface for CAN-FD Transmitter Delay Compensation (TDC) Date: Thu, 6 May 2021 20:14:11 +0900 Message-Id: <20210506111412.1665835-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This serie contains a single patch which adds a netlink interface for the TDC parameters using netlink nested attributes. In March, I introduced the Transmitter Delay Compensation (TDC) to the kernel though two patches: - commit 289ea9e4ae59 ("can: add new CAN FD bittiming parameters: Transmitter Delay Compensation (TDC)") - commit c25cc7993243 ("can: bittiming: add calculation for CAN FD Transmitter Delay Compensation (TDC)") The netlink interface was missing from this series because the initial patch needed rework in order to make it more flexible for future changes. At that time, Marc suggested to take inspiration from the recently released ethtool-netlink interface. Ref: https://lore.kernel.org/linux-can/20210407081557.m3sotnepbgasarri@pengutronix.de/ After further research, it appears that ethtool uses nested attributes (c.f. NLA_NESTED type in validation policy). A bit of trivia: the NLA_NESTED type was introduced in version 2.6.15 of the kernel and thus actually predates Socket CAN. Ref: commit bfa83a9e03cf ("[NETLINK]: Type-safe netlink messages/attributes interface") It took me a bit of time to understand and figure out how to use those nested attributes. While the patch should be functional, I am not fully done with my testing yet. I thus send this version as an RFC. I wish to receive comments of the overall design. Contents of the functions might still be subjected to small changes. After gathering the comments, I will send a new version in which I will also include an update to Documentation/networking/can.rst. Vincent Mailhol (1): can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) drivers/net/can/dev/Makefile | 1 + drivers/net/can/dev/netlink-tdc.c | 122 ++++++++++++++++++++++++++++++ drivers/net/can/dev/netlink-tdc.h | 18 +++++ drivers/net/can/dev/netlink.c | 15 +++- include/uapi/linux/can/netlink.h | 28 ++++++- 5 files changed, 179 insertions(+), 5 deletions(-) create mode 100644 drivers/net/can/dev/netlink-tdc.c create mode 100644 drivers/net/can/dev/netlink-tdc.h -- 2.26.3