Re: [PATCH] net: add Faraday FTMAC100 10/100 Ethernet driver

From: Po-Yu Chuang
Date: Fri Jan 14 2011 - 01:57:28 EST


Dear Eric,

On Thu, Jan 13, 2011 at 10:22 PM, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> Le jeudi 13 janvier 2011 Ã 19:49 +0800, Po-Yu Chuang a Ãcrit :
>> From: Po-Yu Chuang <ratbert@xxxxxxxxxxxxxxxx>
>>
>> FTMAC100 Ethernet Media Access Controller supports 10/100 Mbps and
>> MII. ÂThis driver has been working on some ARM/NDS32 SoC including
>> Faraday A320 and Andes AG101.
>>
>> Signed-off-by: Po-Yu Chuang <ratbert@xxxxxxxxxxxxxxxx>
> Hi
>
> 1) please use netdev_alloc_skb_ip_align() instead of dev_alloc_skb() +
> skb_reserve(skb, NET_IP_ALIGN);

OK, fixed.

> 2) Dont include a "struct net_device_stats stats" in struct ftmac100,
> you can use the one included in struct net_device
> Â(You can then remove ftmac100_get_stats())

OK, fixed.

> 3) Dont "netdev->last_rx = jiffies;" : This is not driver job.
> ÂDitto for trans_start

OK, fixed.

> 4) You must comment why wmb() is needed in ftmac100_xmit()

OK, comment added.

> 5) Why isnt NAPI used too for TX completions ?
> Â BTW, I am not sure we want a define. All new drivers must use NAPI.

I'll study how to do that

> 6) Use is_valid_ether_addr() instead of is_zero_ether_addr() in
> ftmac100_probe()

OK, fixed.

> 7) "static struct ethtool_ops ftmac100_ethtool_ops" should be const :
> Â Â Â Â"static const struct ethtool_ops ftmac100_ethtool_ops"
> ÂDitto for :
> Â Â Â Â"static struct net_device_ops ftmac100_netdev_ops"

OK, both fixed.

> 8) Why an interrupt handler (ftmac100_interrupt()) needs to block
> interrupts with spin_lock_irqsave(&priv->hw_lock, flags); ?

Fixed. Not a problem anymore since hw_lock is removed now.

> 9) Instead of dev_info(&netdev->dev ...) , please consider netdev_info()

OK, fixed.


Thanks a lot for your detailed review. I'll submit a new version ASAP.

Thanks,
Po-Yu Chuang
--
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/