lkml.org 
[lkml]   [2010]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Gigabit Ethernet driver of Topcliff PCH
From
From: Masayuki Ohtake <masa-korg@dsn.okisemi.com>
Date: Tue, 07 Sep 2010 11:42:53 +0900

> +/**
> + * pch_gbe_clean_rx - Send received data up the network stack; legacy
> + * @adapter: Board private structure
> + * @rx_ring: Rx descriptor ring
> + * @work_done: Completed count
> + * @work_to_do: Request count
> + * Returns
> + * true: Cleaned the descriptor
> + * false: Not cleaned the descriptor
> + */
> +static bool
> +pch_gbe_clean_rx(struct pch_gbe_adapter *adapter,
> + struct pch_gbe_rx_ring *rx_ring,
> + int *work_done, int work_to_do)
> +{
..
> + if (netif_receive_skb(skb) == NET_RX_DROP) {
> + adapter->stats.rx_dropped++;

pch_gbe_clean_rx() should be given the "napi_struct" pointer
argument from it's caller, and packets should be given to the
stack using napi_gro_receive(). Finally, NETIF_F_GRO should
be set in netdev->flags at probe time.

Also, you should not use the return value of netif_receive_skb() to
bump the standard rx_dropped statistics value, those return code are
for other purposes. No other driver does what you are doing with this
return value.

If you wish to increment some extended stastic value (like
drivers/net/gianfar.c does) with another name, that's fine.


\
 
 \ /
  Last update: 2010-09-08 22:39    [W:0.120 / U:2.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site