From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
kernel@pengutronix.de, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH net-next 19/21] can: rx-offload: rename rx_offload_get_echo_skb() -> can_rx_offload_get_echo_skb_queue_timestamp()
Date: Fri, 28 Jul 2023 09:56:12 +0200 [thread overview]
Message-ID: <20230728075614.1014117-20-mkl@pengutronix.de> (raw)
In-Reply-To: <20230728075614.1014117-1-mkl@pengutronix.de>
Rename the rx_offload_get_echo_skb() function to
can_rx_offload_get_echo_skb_queue_timestamp(), since it inserts the
echo skb into the rx-offload queue sorted by timestamp.
This is a preparation for adding
can_rx_offload_get_echo_skb_queue_tail(), which adds the echo skb to
the end of the queue. This is intended for devices that do not support
timestamps.
Link: https://lore.kernel.org/all/20230718-gs_usb-rx-offload-v2-1-716e542d14d5@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/dev/rx-offload.c | 9 +++++----
drivers/net/can/flexcan/flexcan-core.c | 4 ++--
drivers/net/can/m_can/m_can.c | 8 ++++----
drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c | 6 +++---
drivers/net/can/ti_hecc.c | 4 ++--
include/linux/can/rx-offload.h | 6 +++---
6 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/drivers/net/can/dev/rx-offload.c b/drivers/net/can/dev/rx-offload.c
index 161e45a7e8c1..6e87ad908346 100644
--- a/drivers/net/can/dev/rx-offload.c
+++ b/drivers/net/can/dev/rx-offload.c
@@ -240,9 +240,10 @@ int can_rx_offload_queue_timestamp(struct can_rx_offload *offload,
}
EXPORT_SYMBOL_GPL(can_rx_offload_queue_timestamp);
-unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
- unsigned int idx, u32 timestamp,
- unsigned int *frame_len_ptr)
+unsigned int
+can_rx_offload_get_echo_skb_queue_timestamp(struct can_rx_offload *offload,
+ unsigned int idx, u32 timestamp,
+ unsigned int *frame_len_ptr)
{
struct net_device *dev = offload->dev;
struct net_device_stats *stats = &dev->stats;
@@ -262,7 +263,7 @@ unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
return len;
}
-EXPORT_SYMBOL_GPL(can_rx_offload_get_echo_skb);
+EXPORT_SYMBOL_GPL(can_rx_offload_get_echo_skb_queue_timestamp);
int can_rx_offload_queue_tail(struct can_rx_offload *offload,
struct sk_buff *skb)
diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index ff0fc18baf13..48273d51f271 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -1097,8 +1097,8 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
handled = IRQ_HANDLED;
stats->tx_bytes +=
- can_rx_offload_get_echo_skb(&priv->offload, 0,
- reg_ctrl << 16, NULL);
+ can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload, 0,
+ reg_ctrl << 16, NULL);
stats->tx_packets++;
/* after sending a RTR frame MB is in RX mode */
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index a6263a617ac9..d204703521d2 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -1016,10 +1016,10 @@ static void m_can_tx_update_stats(struct m_can_classdev *cdev,
if (cdev->is_peripheral)
stats->tx_bytes +=
- can_rx_offload_get_echo_skb(&cdev->offload,
- msg_mark,
- timestamp,
- NULL);
+ can_rx_offload_get_echo_skb_queue_timestamp(&cdev->offload,
+ msg_mark,
+ timestamp,
+ NULL);
else
stats->tx_bytes += can_get_echo_skb(dev, msg_mark, NULL);
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c
index 237617b0c125..e5bd57b65aaf 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c
@@ -111,9 +111,9 @@ mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv,
if (skb)
mcp251xfd_skb_set_timestamp(priv, skb, hw_tef_obj->ts);
stats->tx_bytes +=
- can_rx_offload_get_echo_skb(&priv->offload,
- tef_tail, hw_tef_obj->ts,
- frame_len_ptr);
+ can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload,
+ tef_tail, hw_tef_obj->ts,
+ frame_len_ptr);
stats->tx_packets++;
priv->tef->tail++;
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index a8243acde92d..5aab440074c6 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -747,8 +747,8 @@ static irqreturn_t ti_hecc_interrupt(int irq, void *dev_id)
spin_unlock_irqrestore(&priv->mbx_lock, flags);
stamp = hecc_read_stamp(priv, mbxno);
stats->tx_bytes +=
- can_rx_offload_get_echo_skb(&priv->offload,
- mbxno, stamp, NULL);
+ can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload,
+ mbxno, stamp, NULL);
stats->tx_packets++;
--priv->tx_tail;
}
diff --git a/include/linux/can/rx-offload.h b/include/linux/can/rx-offload.h
index c205c51d79c9..e3b4199732c6 100644
--- a/include/linux/can/rx-offload.h
+++ b/include/linux/can/rx-offload.h
@@ -44,9 +44,9 @@ int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload,
int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload);
int can_rx_offload_queue_timestamp(struct can_rx_offload *offload,
struct sk_buff *skb, u32 timestamp);
-unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
- unsigned int idx, u32 timestamp,
- unsigned int *frame_len_ptr);
+unsigned int can_rx_offload_get_echo_skb_queue_timestamp(struct can_rx_offload *offload,
+ unsigned int idx, u32 timestamp,
+ unsigned int *frame_len_ptr);
int can_rx_offload_queue_tail(struct can_rx_offload *offload,
struct sk_buff *skb);
void can_rx_offload_irq_finish(struct can_rx_offload *offload);
--
2.40.1
next prev parent reply other threads:[~2023-07-28 7:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-28 7:55 [PATCH net-next 0/21] pull-request: can-next 2023-07-28 Marc Kleine-Budde
2023-07-28 7:55 ` [PATCH net-next 01/21] dt-bindings: net: can: Add support for Allwinner D1 CAN controller Marc Kleine-Budde
2023-07-28 9:00 ` patchwork-bot+netdevbpf
2023-07-28 7:55 ` [PATCH net-next 02/21] riscv: dts: allwinner: d1: Add CAN controller nodes Marc Kleine-Budde
2023-07-28 7:55 ` [PATCH net-next 03/21] can: sun4i_can: Add acceptance register quirk Marc Kleine-Budde
2023-07-28 7:55 ` [PATCH net-next 04/21] MAINTAINERS: Add myself as maintainer of the ems_pci.c driver Marc Kleine-Budde
2023-07-28 7:55 ` [PATCH net-next 05/21] can: sun4i_can: Add support for the Allwinner D1 Marc Kleine-Budde
2023-07-28 7:55 ` [PATCH net-next 06/21] can: peak_usb: remove unused/legacy peak_usb_netif_rx() function Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 07/21] can: Explicitly include correct DT includes, part 2 Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 08/21] can: gs_usb: remove leading space from goto labels Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 09/21] can: gs_usb: gs_usb_probe(): align block comment Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 10/21] can: gs_usb: gs_usb_set_timestamp(): remove return statements form void function Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 11/21] can: gs_usb: uniformly use "parent" as variable name for struct gs_usb Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 12/21] can: gs_usb: gs_usb_receive_bulk_callback(): make use of netdev Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 13/21] can: gs_usb: gs_usb_receive_bulk_callback(): make use of stats Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 14/21] can: gs_usb: gs_usb_receive_bulk_callback(): count RX overflow errors also in case of OOM Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 15/21] can: gs_usb: gs_can_start_xmit(), gs_can_open(): clean up printouts in error path Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 16/21] can: gs_usb: gs_can_close(): don't complain about failed device reset during ndo_stop Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 17/21] can: gs_usb: gs_destroy_candev(): remove not needed usb_kill_anchored_urbs() Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 18/21] can: gs_usb: gs_usb_disconnect(): " Marc Kleine-Budde
2023-07-28 7:56 ` Marc Kleine-Budde [this message]
2023-07-28 7:56 ` [PATCH net-next 20/21] can: rx-offload: add can_rx_offload_get_echo_skb_queue_tail() Marc Kleine-Budde
2023-07-28 7:56 ` [PATCH net-next 21/21] can: gs_usb: convert to NAPI/rx-offload to avoid OoO reception Marc Kleine-Budde
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=20230728075614.1014117-20-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 NNTP newsgroup(s).