Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp355119pxj; Thu, 3 Jun 2021 08:19:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBnFWNlgBEKE50IoZSOnP1KsygBsUaxk1U0Wq24s6tYCGBEYmWTocN+QdvZng2rAnmI3Cu X-Received: by 2002:a17:906:3395:: with SMTP id v21mr143827eja.102.1622733591890; Thu, 03 Jun 2021 08:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622733591; cv=none; d=google.com; s=arc-20160816; b=z9MK12xVf87uiZm64PnGyqjP0gxFLIppoEh2MGM321pPJ3kBF56z8YGOXnfpUKTXk7 5oiNDRJVqGXVJeRJKSLHnRbmZPPf4OXhbpfzk9gEbk3Bp4aXqzYRZZ0qiTTDWk1qrsHq ijHU0SrRy4SOJwrNQ4SlJ3ZMLVk45LfLYR12yLtPXAUL/TXWS3KfaatEejJKn5U44UOB Hdjw7o8dzJu4x8AZZLFaOz9zvNE3A2QIxP6DsJ+fOg4dRuLeTm+8LP5zYp2atqZhE3c7 sUMzYsHYmiCZJCTtKHdJbj/SKSajSOljsEEaGwUZgHzQlJEwOR2mwldO5NrTc69uZ33Q ncgg== 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=Ok7Vbh3oY+wIVK/JQop5AN1vyd04KjCRYYTp3eH5SnA=; b=sHUxSEE/Gk7Bp+5Ep0ATbDLaBv6OI8hGdl/LMpg1tTSorUOX3lOkGOUmbavsT/VWJ5 uJ1LdIl8v+lyksgf038bMjYMe6/qMhYXkvTVf60bwmMWgMIBq7MRCZxeFvaRB5Irw/Ok F3Ha1mDp2YPASH79Y0Zbm3QF7jmsjWKJXDotI5zpFsJUR+1/Ulvgv75eWxY4QKMlpbPG QDHT27xp12yprVWB24ZlPU2JXRrIpU4Va9ZVH9ZoU+vE7E5NxvhpCxtC4uv0TYvsgbtm wbYTCLpRAHM9uBhQ+DnmFblq5YLO0Q3iJ+nm5TaEwRGEAtJm0AIkNOtTMNqF1BhCUGHA e9qg== 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 kf11si2489646ejc.490.2021.06.03.08.19.28; Thu, 03 Jun 2021 08:19:51 -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 S231376AbhFCPR5 (ORCPT + 99 others); Thu, 3 Jun 2021 11:17:57 -0400 Received: from smtp13.smtpout.orange.fr ([80.12.242.135]:57235 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231827AbhFCPR5 (ORCPT ); Thu, 3 Jun 2021 11:17:57 -0400 Received: from tomoyo.flets-east.jp ([114.149.34.46]) by mwinf5d75 with ME id CfFu2500H0zjR6y03fG8Pq; Thu, 03 Jun 2021 17:16:10 +0200 X-ME-Helo: tomoyo.flets-east.jp X-ME-Auth: bWFpbGhvbC52aW5jZW50QHdhbmFkb28uZnI= X-ME-Date: Thu, 03 Jun 2021 17:16:10 +0200 X-ME-IP: 114.149.34.46 From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Hartkopp , Vincent Mailhol Subject: [PATCH v2 0/2] add the netlink interface for CAN-FD Transmitter Delay Compensation (TDC) Date: Fri, 4 Jun 2021 00:15:48 +0900 Message-Id: <20210603151550.140727-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds a netlink interface for the TDC parameters using netlink nested attributes. The first patch remove a redundant check. The second patch is the real thing: the TDC netlink interface. 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/ 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") I sent a v1 as an RFC which got zero comments, so I am assuming that the overall design is OK :) Now, I feel confident enough to drop the RFC tag. Thanks for your review! For those who would like to test it, please refer to this iproute2 patch: https://lore.kernel.org/linux-can/20210507102819.1932386-1-mailhol.vincent@wanadoo.fr/t/#u ** Changelog ** The nested structure (IFLAC_CAN_TDC*) remains unchanged since RFC v1. The v2 fixes several issue in can_tdc_get_size() and can_tdc_fill_info(). Namely: can_tdc_get_size() returned an incorrect size if TDC was not implemented and can_tdc_fill_info() did not include a fail path with nla_nest_cancel(). Vincent Mailhol (2): can: netlink: remove redundant check in can_validate() can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) drivers/net/can/dev/netlink.c | 140 ++++++++++++++++++++++++++++++- include/uapi/linux/can/netlink.h | 26 +++++- 2 files changed, 160 insertions(+), 6 deletions(-) -- 2.31.1