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]
Date:	Thu, 17 Jul 2014 13:28:36 +0800
From:	Sonic Zhang <sonic.adi@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	Eric Dumazet <eric.dumazet@...il.com>,
	netdev <netdev@...r.kernel.org>,
	Varka Bhadram <varkabhadram@...il.com>,
	adi-buildroot-devel@...ts.sourceforge.net,
	"Zhang, Sonic" <sonic.zhang@...log.com>
Subject: Re: [PATCH v5] bfin_mac: convert bfin Ethernet driver to NAPI framework

Hi David,

On Thu, Jul 17, 2014 at 5:03 AM, David Miller <davem@...emloft.net> wrote:
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Wed, 16 Jul 2014 15:17:29 +0200
>
>> On Wed, 2014-07-16 at 17:51 +0800, Sonic Zhang wrote:
>>> From: Sonic Zhang <sonic.zhang@...log.com>
>>> +    if (i < budget) {
>>> +            napi_gro_flush(napi, false);
>>> +            local_irq_save(flags);
>>> +            __napi_complete(napi);
>>> +            local_irq_restore(flags);
>>> +            enable_irq(IRQ_MAC_RX);
>>
>> I have no idea why you open-code napi_complete();
>>
>> Why cant you just copy/paste what other drivers do here ?
>>
>>       if (i < budget) {
>>               napi_complete(napi);
>>               enable_irq(IRQ_MAC_RX);
>>       }
>
> Generally speaking, I am very frustrated at how this bfin_mac NAPI
> conversion tries to do things in special ways.
>
> Please mimick what other drivers do rather than trying to do things in
> a special way unique to your driver.

Driver realtek/8139cp.c does things in the same way as the bfin_mac
NAPI code. Bfin EMAC device has no capability to disable the MAC_RX
interrupt in its EMAC register directly. The bfin_mac driver has to do
it in its system interrupt controller via the kernel API
enable_irq()/disable_irq_nosync().

In net_poll loop, if napi_complete() is called, the EMAC IRQ is
enabled more times than the it is disabled. This is not a problem to
drivers which don't call enable_irq()/disable_irq_nosync(). But, the
IRQ enabling and disabling operations have to be balanced in the
bfin_mac driver via __napi_complete() to avoid the kernel warning.


Regards,

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