Re: [PATCH net-next-2.6 v6 04/20] can: EG20T PCH: Add Tx Flow Control

From: Tomoya MORINAGA
Date: Thu Dec 02 2010 - 19:59:11 EST


On Friday, December 03, 2010 6:12 AM, David Miller wrote :

>
> When implementing functionality like this it is better to use other
> existing well tested network drivers as a guide rather then trying
> to be unique and clever, as you are doing here.

Sure. I will do so.

>
> Second of all, checking the state of the device to determine if a
> stop queue should be performed has two problems:
>
> 1) The test uses a magic constant mask, which is undocumented.

Do you above "magic constant" mean "0xfc00" ?
If so, this constant is replaced to MACRO in 08/20 patch.

>
> 2) It causes the race you have on the wake queue side
>
> Use pure software state to guide your actions, and let the hardware
> interrupt trigger the wake queue.
>
> Also, you don't implement this as a true ring buffer, you only
> consider to stop the queue when you hit the last TX object entry. But
> all the previous slots could be available.

We can't use ring buffer.
Because ring buffer causes issue of tx packet out-of-order.

I show EG20T CAN HW spec below
According to priority, EG20T CAN HW sends packet from message object.
The priority is Message object number.
Lower number is high-priority, Higher is low priority

Thus, I think we can't use ring buffer.

Still, do you think I can use ring buffer ?
------
Thanks,

Tomoya MORINAGA
OKI SEMICONDUCTOR CO., LTD.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/