[<prev] [next>] [day] [month] [year] [list]
Message-ID: <AANLkTimwcWtmftfwXBFfFG+bUNxNSJqNVnyvU_oWsyNL@mail.gmail.com>
Date: Fri, 21 Jan 2011 15:06:37 +0800
From: Po-Yu Chuang <ratbert.chuang@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
bhutchings@...arflare.com, eric.dumazet@...il.com,
dilinger@...ued.net
Subject: Re: [PATCH v3] net: add Faraday FTMAC100 10/100 Ethernet driver
Dear Joe,
On Fri, Jan 21, 2011 at 2:46 PM, Joe Perches <joe@...ches.com> wrote:
> On Fri, 2011-01-21 at 13:03 +0800, Po-Yu Chuang wrote:
>> > Is it useful to retry the NORXBUF case?
>> The idea is that if I miss packet finished interrupts (then rx buffers used up),
>> I should retrieve the received packets ASAP to free buffers to HW.
>> Maybe this is really unnecessary.
>> I am not quite sure, but I'll do your advice now.
>
> I wasn't giving advice, just asking a question.
> Your concept makes sense to me.
I see. So I will leave it as is.
>> >> + if (status & FTMAC100_INT_NORXBUF) {
>> >> + /* RX buffer unavailable */
>> >> + if (net_ratelimit())
>> >> + netdev_info(netdev, "INT_NORXBUF\n");
>> >> +
>> >> + netdev->stats.rx_over_errors++;
>> >> + }
>> >
>> > Perhaps this "if (status & FTMAC100_INT_NORXBUF)" block should be
>> > moved into the test block above it before the retry?
>>
>> Since status is not changed in the function, it does not matter where
>> the test is.
>> But I agree that it is better to handle error cases earlier.
>
> This wasn't so much a handle error case early, but
> a suggestion that
> if (status & (foo | bar)) {
> ...
> }
> if (status & bar) {
> ...
> }
> should be
> if (status & (foo | bar)) {
> ...
> if (status & bar) {
> ...
> }
> }
>
> so that when the first test fails, a known
> subset of the first test isn't tested again.
Understand. Thanks.
best regards,
Po-Yu Chuang
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists