All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] add the netlink interface for CAN-FD Transmitter Delay Compensation (TDC)
@ 2021-06-03 15:15 Vincent Mailhol
  2021-06-03 15:15 ` [PATCH v2 1/2] can: netlink: remove redundant check in can_validate() Vincent Mailhol
  2021-06-03 15:15 ` [PATCH v2 2/2] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) Vincent Mailhol
  0 siblings, 2 replies; 20+ messages in thread
From: Vincent Mailhol @ 2021-06-03 15:15 UTC (permalink / raw)
  To: Marc Kleine-Budde, linux-can
  Cc: netdev, linux-kernel, Oliver Hartkopp, Vincent Mailhol

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


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-06-22  0:04 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 15:15 [PATCH v2 0/2] add the netlink interface for CAN-FD Transmitter Delay Compensation (TDC) Vincent Mailhol
2021-06-03 15:15 ` [PATCH v2 1/2] can: netlink: remove redundant check in can_validate() Vincent Mailhol
2021-06-03 15:15 ` [PATCH v2 2/2] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) Vincent Mailhol
2021-06-16  9:46   ` Marc Kleine-Budde
2021-06-16 13:53     ` Vincent MAILHOL
2021-06-16 14:29       ` Marc Kleine-Budde
2021-06-16 14:43         ` Vincent MAILHOL
2021-06-16 14:46           ` Marc Kleine-Budde
2021-06-16 15:44             ` Vincent MAILHOL
2021-06-17 11:38               ` Marc Kleine-Budde
2021-06-18  9:34   ` Marc Kleine-Budde
2021-06-18 10:23     ` Vincent MAILHOL
2021-06-18 11:17       ` Vincent MAILHOL
2021-06-18 12:44         ` CAN-FD Transmitter Delay Compensation (TDC) on mcp2518fd Marc Kleine-Budde
2021-06-18 14:27           ` Vincent MAILHOL
2021-06-18 15:55             ` Stefan Mätje
2021-06-19 12:34               ` Vincent MAILHOL
2021-06-21 18:42                 ` Stefan Mätje
2021-06-21 23:52                   ` Vincent MAILHOL
2021-06-22  0:04                     ` Vincent MAILHOL

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.