diff options
author | Markus Schneider-Pargmann <msp@baylibre.com> | 2024-02-07 10:32:20 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2024-02-12 17:02:45 +0100 |
commit | c306c3873de0804bea4bb2ac717bd2c088acc589 (patch) | |
tree | c2ae47f1ce4984aaf8608852a76d03a97a9ccf66 /drivers/net/can/m_can/m_can.h | |
parent | 251f913d19a8a960126359c20bd5719461e5399f (diff) |
can: m_can: Implement transmit submission coalescing
m_can supports submitting multiple transmits with one register write.
This is an interesting option to reduce the number of SPI transfers for
peripheral chips.
The m_can_tx_op is extended with a bool that signals if it is the last
transmission and the submit should be executed immediately.
The worker then writes the skb to the FIFO and submits it only if the
submit bool is set. If it isn't set, the worker will write the next skb
which is waiting in the workqueue to the FIFO, etc.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/all/20240207093220.2681425-15-msp@baylibre.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/m_can/m_can.h')
-rw-r--r-- | drivers/net/can/m_can/m_can.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h index 76b1ce1b7c1b..2986c4ce0b2f 100644 --- a/drivers/net/can/m_can/m_can.h +++ b/drivers/net/can/m_can/m_can.h @@ -74,6 +74,7 @@ struct m_can_tx_op { struct m_can_classdev *cdev; struct work_struct work; struct sk_buff *skb; + bool submit; }; struct m_can_classdev { @@ -102,6 +103,7 @@ struct m_can_classdev { u32 active_interrupts; u32 rx_max_coalesced_frames_irq; u32 rx_coalesce_usecs_irq; + u32 tx_max_coalesced_frames; u32 tx_max_coalesced_frames_irq; u32 tx_coalesce_usecs_irq; @@ -116,6 +118,10 @@ struct m_can_classdev { int tx_fifo_size; int next_tx_op; + int nr_txs_without_submit; + /* bitfield of fifo elements that will be submitted together */ + u32 tx_peripheral_submit; + struct mram_cfg mcfg[MRAM_CFG_NUM]; struct hrtimer hrtimer; |