lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJxxZ0PLapq1jodHN5u+1qNm4dxLkCC9kvbB+D=R3gNfWjk-3w@mail.gmail.com>
Date:	Mon, 14 Jul 2014 11:40:37 +0800
From:	Sonic Zhang <sonic.adi@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev <netdev@...r.kernel.org>,
	adi-buildroot-devel@...ts.sourceforge.net,
	"Zhang, Sonic" <sonic.zhang@...log.com>
Subject: Re: [PATCH v3] bfin_mac: convert bfin Ethernet driver to NAPI framework

Hi David,

On Sat, Jul 12, 2014 at 6:01 AM, David Miller <davem@...emloft.net> wrote:
> From: Sonic Zhang <sonic.adi@...il.com>
> Date: Fri, 11 Jul 2014 18:27:14 +0800
>
>> +     if (i < budget) {
>> +             napi_complete(napi);
>> +             if (!(bfin_read_IPEND() & IRQ_EVX))
>> +                     enable_irq(IRQ_MAC_RX);
>> +     }
>
> This doesn't make any sense, why are you only re-enabling the
> interrupt if the status bit is clear?
>
> You should do this unconditionally.

In the case of netpoll_poll_dev() is invoked repeatedly from an
exception handler and no packet is available in the Ethernet device
buffer, the MAC_RX IRQ is not disabled in bfin_mac_interrupt handler
when ndo_poll_controller() callback is invoked. But, the NAPI poll()
callback is always called with bit NAPI_STATE_NPSVC set in
poll_one_napi(). If the MAC_RX IRQ is enabled unconditionally, kernel
warning "Unbalanced enable for IRQ %d\n" is always printed out in
function __enable_irq().

This exception status checking is to avoid the unbalanced IRQ warning
from enable_irq(). There is no similar warning in
disable_irq_nosync(). Do you have any better solution for this
problem?

Thanks,

Sonic


>
> If your logic triggers, polling is disabled and the interrupt handler
> isn't going to run, so your driver will stop taking packets.
>
> Please please, stop being so clever with the conditions here, simply
> if you didn't use the whole budget turn off NAPI and reenable
> interrupts.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ