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:	Wed, 3 Sep 2014 22:37:14 +0530
From:	Mugunthan V N <mugunthanvnm@...com>
To:	David Miller <davem@...emloft.net>
CC:	<netdev@...r.kernel.org>
Subject: Re: [net PATCH 1/1] drivers: net: cpsw: dual_emac: fix reducing of
 rx descriptor during ifdown

On Wednesday 03 September 2014 12:46 PM, Mugunthan V N wrote:
> David
> 
> On Wednesday 03 September 2014 12:24 AM, David Miller wrote:
>> From: Mugunthan V N <mugunthanvnm@...com>
>> Date: Tue, 2 Sep 2014 14:51:05 +0530
>>
>>> When ifup and ifdown is run continuously, for each spilled packet (for
>>> interface which is down) from DMA, the total number of rx descriptor
>>> goes down and at one instance all the descriptor is lost and both the
>>> interface stops working.
>>>
>>> To recover from this we need to put down both the interface and open the
>>> interface which will re-init the DMA which intern queues fresh set of
>>> skbs for rx.
>>
>> But you still should not receive packets for a netdev which is down.
>> As far as I can tell, you're feeding it into the stack still.
> 
> If there is separate DMA for each netdev, then it is true that there
> won't be a packet for a closed netdev. But in CPSW dual EMAC case, one
> DMA engine is shared between two slave ports, so when one slave netdev
> is put down, the DMA is not teared down as the other slave netdev is
> still active. In heavy traffic network when putting down netdev, there
> are chances that packets are already processed by DMA, and waiting for
> NAPI to be submitted to network stack might belong to the netdev which
> is already down.
> 
> So instead of just freeing the skb received on netdev which is already
> down (which will reduce the total rx descriptors in rx dma channel),
> requeue it back to DMA and make sure that rx dma descriptor count is
> never reduced.
> 
>>
>> Also this doesn't explain why the "status < 0" case applies to this
>> new logic, you have not explained that at all.
>>
> 
> This scenario is not generated when "status < 0", "status < 0" happens
> when DMA is in tear-down mode, the above scenario happens when
> netif_running(ndev) is false which denotes that netdev is down already.
> 

I found an issue with the patch while testing suspend/resume, will fix
that and submit v2 shortly.

Regards
Mugunthan V N

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