From patchwork Tue Jan 12 09:54:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent MAILHOL X-Patchwork-Id: 361694 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB307C433E6 for ; Tue, 12 Jan 2021 09:57:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83FFF23104 for ; Tue, 12 Jan 2021 09:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389749AbhALJ5O (ORCPT ); Tue, 12 Jan 2021 04:57:14 -0500 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:51046 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389319AbhALJ5O (ORCPT ); Tue, 12 Jan 2021 04:57:14 -0500 Received: from localhost.localdomain ([153.202.107.157]) by mwinf5d28 with ME id Flv22400R3PnFJp03lvPlH; Tue, 12 Jan 2021 10:55:30 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: bWFpbGhvbC52aW5jZW50QHdhbmFkb28uZnI= X-ME-Date: Tue, 12 Jan 2021 10:55:30 +0100 X-ME-IP: 153.202.107.157 From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org, Jeroen Hofstee , Richard Cochran Cc: Wolfgang Grandegger , "David S . Miller" , Jakub Kicinski , "open list : NETWORKING DRIVERS" , Vincent Mailhol Subject: [PATCH v4 0/1] Add software TX timestamps to the CAN devices Date: Tue, 12 Jan 2021 18:54:36 +0900 Message-Id: <20210112095437.6488-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org With the ongoing work to add BQL to Socket CAN, I figured out that it would be nice to have an easy way to mesure the latency. And one easy way to do so it to check the round trip time of the packet by doing the difference between the software rx timestamp and the software tx timestamp. rx timestamps are already available. This patch gives the missing piece: add a tx software timestamp feature to the CAN devices. Of course, the tx software timestamp might also be used for other purposes such as performance measurements of the different queuing disciplines (e.g. by checking the difference between the kernel tx software timestamp and the userland tx software timestamp). v2 was a mistake, please ignore it (fogot to do git add, changes were not reflected...) v3 reflects the comments that Jeroen made in https://lkml.org/lkml/2021/1/10/54 v4 rebases the patch on linux-can-next/testing and suppress the comment related to SOF_TIMESTAMPING_TX_HARDWARE. Reference: https://lore.kernel.org/linux-can/20210111171152.GB11715@hoboy.vegasvil.org/ Vincent Mailhol (1): can: dev: add software tx timestamps drivers/net/can/dev/skb.c | 2 ++ 1 file changed, 2 insertions(+)