Re: [PATCH v3 15/15] can: grcan: Update echo skb handling to match variable length CANFD frame

Marc Kleine-Budde
2026-01-23T14:17:41Z

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

On 22.01.2026 13:10:38, Arun Muthusamy wrote:
[...]

> @@ -1575,7 +1591,16 @@ static netdev_tx_t grcan_start_xmit(struct sk_buff *skb,
> * can_put_echo_skb would be an error unless other measures are
> * taken.
> */
> - can_put_echo_skb(skb, dev, slotindex, 0);
> +
> + priv->echo_skb_idx = priv->next_echo_idx;
> +
> + can_put_echo_skb(skb, dev, priv->next_echo_idx, 0);
> +
> + /* Move to the next index in the echo skb buffer */
> + priv->next_echo_idx = (priv->next_echo_idx + 1) % priv->can.echo_skb_max;
> +
> + if (priv->can.echo_skb[priv->echo_skb_idx])
> + netif_stop_queue(dev);

You also use "if (unlikely(space == 1)) netif_stop_queue(dev);", that
looks suspicious. Why have 2 independent ways to check if the TX queue
is full?

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 --]