netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
To: Jan Ceuleers <jan.ceuleers@computer.org>
Cc: netdev <netdev@vger.kernel.org>, SH-Linux <linux-sh@vger.kernel.org>
Subject: Re: [PATCH v5 6/6 resend] net: sh_eth: use NAPI
Date: Mon, 04 Jun 2012 20:17:22 +0900	[thread overview]
Message-ID: <4FCC9942.5080809@renesas.com> (raw)
In-Reply-To: <4FC9E56C.4000707@computer.org>

2012/06/02 19:05, Jan Ceuleers wrote:
> 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?

Thank you for the comment.
I also think that the driver should not update the rx_dropped counter
when netif_receive_skb() returns NET_RX_DROP. I will fix this.

Best regards,
Yoshihiro Shimoda

      reply	other threads:[~2012-06-04 11:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29  8:15 [PATCH v5 6/6 resend] net: sh_eth: use NAPI Shimoda, Yoshihiro
2012-06-02 10:05 ` Jan Ceuleers
2012-06-04 11:17   ` Shimoda, Yoshihiro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FCC9942.5080809@renesas.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=jan.ceuleers@computer.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).