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] [day] [month] [year] [list]
Date:	Sun, 13 Jul 2014 22:11:22 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	sonic.adi@...il.com
Cc:	netdev@...r.kernel.org, adi-buildroot-devel@...ts.sourceforge.net,
	sonic.zhang@...log.com
Subject: Re: [PATCH v3] bfin_mac: convert bfin Ethernet driver to NAPI
 framework

From: Sonic Zhang <sonic.adi@...il.com>
Date: Mon, 14 Jul 2014 11:40:37 +0800

> 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?

Regardless of what your issue is, such a scheme is racey and you're
going to lose events.

You really should unconditionally disable all interrupt sources when a
NAPI poll that covers those events is scheduled, and then
unconditionally re-enable all of them when the NAPI poll is completed.

--
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