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

Arun Muthusamy
2026-01-28T08:14:11Z

On 1/23/26 15:17, Marc Kleine-Budde wrote:
> 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?

That's correct.
Current implementation introduces two independent checks where space reflects hardware TX descriptor availability and echo slot availability.
I’ll rework this to use a single check, covering both TX ring space and echo slot availability.

--
--
BR,

Arun Muthusamy
Software Engineer
Frontgrade Gaisler
T : +46 (0) 700 558 528
arun.muthusamy@gaisler.com

Frontgrade Gaisler AB, Kungsgatan 12, SE-411 19 GÖTEBORG, Sweden.
+46 (0) 31 775 8650, www.gaisler.com