From: Mugunthan V N <mugunthanvnm@ti.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Subject: Re: [net PATCH 1/1] drivers: net: cpsw: dual_emac: fix reducing of rx descriptor during ifdown
Date: Tue, 2 Sep 2014 14:51:05 +0530 [thread overview]
Message-ID: <54058C01.3010402@ti.com> (raw)
In-Reply-To: <20140901.183108.784916699845611422.davem@davemloft.net>
David
On Tuesday 02 September 2014 07:01 AM, David Miller wrote:
> From: Mugunthan V N <mugunthanvnm@ti.com>
> Date: Fri, 29 Aug 2014 14:52:25 +0530
>
>> In Dual EMAC, when both interface are up and while doing ifdown with heavy
>> traffic then skbs already processed by DMA from that slave emac has to be
>> requeued as still the other interface is up and running.
>>
>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
>
> I don't see why this is important.
>
> If the packet arrived via the down interface, let it be dropped and
> the sender will simply resend if necessary.
>
> Also you are putting this new multi-slave logic under the "status < 0"
> condition as well as the interface being down, that's not right either.
>
Multi slave logic is already there though out the driver, this is one
corner case where it fails. Let me explain more
DMA is common for both interfaces and serves both the slave ports. In
heavy traffic when one interface is put down, there are chances that
some packets are already processed in are in completed state.
Since DMA is a common entity for both interface, DMA is disabled only
when there all the slave interfaces are down. so when both interface is
up and putting down one interface, DMA de-init doesn't happen as the
other interface is up.
In this scenario, when cpsw_rx_handler is called for processing the
packet which might have packets for interfaces which is down already.
Previously the driver simply drops the skb and doesn't do re-queue of
the descriptor which results in one descriptor less for rx DMA.
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.
So to overcome this issue, I did this fix by re-queuing the rx
descriptor back to DMA when any one interface is so that the no of rx
descriptor is kept constant always.
Regards
Mugunthan V N
next prev parent reply other threads:[~2014-09-02 9:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 9:22 [net PATCH 1/1] drivers: net: cpsw: dual_emac: fix reducing of rx descriptor during ifdown Mugunthan V N
2014-09-02 1:31 ` David Miller
2014-09-02 9:21 ` Mugunthan V N [this message]
2014-09-02 18:54 ` David Miller
2014-09-03 7:16 ` Mugunthan V N
2014-09-03 17:07 ` Mugunthan V N
2014-09-05 21:29 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54058C01.3010402@ti.com \
--to=mugunthanvnm@ti.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.