From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Ceuleers Date: Sat, 02 Jun 2012 10:05:32 +0000 Subject: Re: [PATCH v5 6/6 resend] net: sh_eth: use NAPI Message-Id: <4FC9E56C.4000707@computer.org> List-Id: References: <4FC48589.6060009@renesas.com> In-Reply-To: <4FC48589.6060009@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Shimoda, Yoshihiro" Cc: netdev , SH-Linux On 05/29/2012 10:15 AM, Shimoda, Yoshihiro wrote: > @@ -1087,13 +1088,17 @@ static int sh_eth_rx(struct net_device *ndev) > skb_reserve(skb, NET_IP_ALIGN); > skb_put(skb, pkt_len); > skb->protocol = eth_type_trans(skb, ndev); > - netif_rx(skb); > - ndev->stats.rx_packets++; > - ndev->stats.rx_bytes += pkt_len; > + if (netif_receive_skb(skb) = NET_RX_DROP) { > + ndev->stats.rx_dropped++; > + } else { > + ndev->stats.rx_packets++; > + ndev->stats.rx_bytes += pkt_len; > + } > } > rxdesc->status |= cpu_to_edmac(mdp, RD_RACT); > entry = (++mdp->cur_rx) % mdp->num_rx_ring; > rxdesc = &mdp->rx_ring[entry]; > + (*work)++; > } > > /* Refill the Rx ring buffers. */ Please forgive a newbie's question/comment; feel free to ignore if I'm wasting your time. Particularly because it's about an aspect of the driver that you're not changing in this patch. (And yes, I know that you've been asked to sit on this patch series until net-next opens up again). I see that most users of netif_receive_skb() ignore its return value. Some drivers (including this-one) do check it and use it to determine whether counters should be updated. But looking at netif_receive_skb() itself I see that there's counter infrastructure there already. So why this in-driver set of counters, I wonder? Thanks, Jan