Linux-Can Archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Vincent Mailhol <vincent.mailhol@gmail.com>
Cc: linux-can@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 27/27] can: at91_can: switch to rx-offload implementation
Date: Thu, 5 Oct 2023 21:40:31 +0200	[thread overview]
Message-ID: <20231005-huntress-urban-6d4b7bba5031-mkl@pengutronix.de> (raw)
In-Reply-To: <CAMZ6Rq+v=DqZ1+T+tyN0n5hQRd0Av2APW8OWpEFbKXQsS8itpQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1658 bytes --]

On 06.10.2023 01:29:38, Vincent Mailhol wrote:
> > Yes. I have proof-of-concept patches for it laying around, but I want to
> > get this mainline first. One limitation of the hardware is that the
> > timer is only 16 bits wide and runs on CAN clock, which means a maximum
> > of 1MHz. This causes the timer to overflow every 64ms, which in turn
> > requires a worker every 30ms or so.
> 
> ACK.
> 
> > For this reason, I want hardware TS
> > to be configurable and this is not yet implemented. Also $CUSTOMER
> > doesn't need HW timestamps :)
> 
> Actually, this is already available in the kernel. You just need to
> implement the SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctl in
> net_device_ops->ndo_eth_ioctl().
> 
> More details in:
> 
>   https://git.kernel.org/torvalds/c/90f942c5a6d7

Oh nice, thanks for the pointer. I was talking about the implementation
in the driver, though.

> The caveat is in the userland: the can-utils currently do not follow
> the conventions. It does not send those ioctls and instead expects
> hardware timestamps to be unconditionally always on.
> But at least, it should work with tcpdump or any other generic packet
> capture utilities which follow the kernel conventions.

IIRC tcpdump has a command line option to switch on HW timestamping. And
there is the command line tool hwstamp_ctl that you can use.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2023-10-05 19:40 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  9:23 [PATCH 00/27] can: at91: add can_state_get_by_berr_counter() helper, cleanup and convert to rx_offload Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 01/27] can: dev: add can_state_get_by_berr_counter() to return the CAN state based on the current error counters Marc Kleine-Budde
2023-10-04 10:50   ` Vincent Mailhol
2023-10-04 11:42     ` Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 02/27] can: at91_can: use a consistent indention Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 03/27] can: at91_can: at91_irq_tx(): remove one level of indention Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 04/27] can: at91_can: BR register: convert to FIELD_PREP() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 05/27] can: at91_can: ECR register: convert to FIELD_GET() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 06/27] can: at91_can: MMR registers: convert to FIELD_PREP() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 07/27] can: at91_can: MID registers: convert access to FIELD_PREP(), FIELD_GET() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 08/27] can: at91_can: MSR Register: convert to FIELD_PREP() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 09/27] can: at91_can: MCR " Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 10/27] can: at91_can: add more register definitions Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 11/27] can: at91_can: at91_setup_mailboxes(): update comments Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 12/27] can: at91_can: rename struct at91_priv::{tx_next,tx_echo} to {tx_head,tx_tail} Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 13/27] can: at91_can: at91_set_bittiming(): demote register output to debug level Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 14/27] can: at91_can: at91_chip_start(): don't disable IRQs twice Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 15/27] can: at91_can: at91_open(): forward request_irq()'s return value in case or an error Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 16/27] can: at91_can: add CAN transceiver support Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 17/27] can: at91_can: at91_poll_err(): fold in at91_poll_err_frame() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 18/27] can: at91_can: at91_poll_err(): increase stats even if no quota left or OOM Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 19/27] can: at91_can: at91_irq_err_frame(): call directly from IRQ handler Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 20/27] can: at91_can: at91_irq_err_frame(): move next to at91_irq_err() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 21/27] can: at91_can: at91_irq_err(): rename to at91_irq_err_line() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 22/27] can: at91_can: at91_irq_err_line(): make use of can_state_get_by_berr_counter() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 23/27] can: at91_can: at91_irq_err_line(): take reg_sr into account for bus off Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 24/27] can: at91_can: at91_irq_err_line(): make use of can_change_state() and can_bus_off() Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 25/27] can: at91_can: at91_irq_err_line(): send error counters with state change Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 26/27] can: at91_can: at91_alloc_can_err_skb() introduce new function Marc Kleine-Budde
2023-10-04  9:23 ` [PATCH 27/27] can: at91_can: switch to rx-offload implementation Marc Kleine-Budde
2023-10-04 12:55   ` Vincent Mailhol
2023-10-04 13:13     ` Marc Kleine-Budde
2023-10-04 14:07     ` Vincent Mailhol
2023-10-04 14:16       ` Marc Kleine-Budde
2023-10-05  7:28     ` Marc Kleine-Budde
2023-10-05 16:29       ` Vincent Mailhol
2023-10-05 19:40         ` Marc Kleine-Budde [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231005-huntress-urban-6d4b7bba5031-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=vincent.mailhol@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).