[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTikKz6v09VTjtANmmcGHU1eKcVWjuDIO24KqkHWK@mail.gmail.com>
Date: Wed, 19 May 2010 17:23:16 +0800
From: Sonic Zhang <sonic.adi@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 06/11] netdev: bfin_mac: avoid tx skb overflows in the tx
DMA ring
On Wed, May 19, 2010 at 3:29 AM, David Miller <davem@...emloft.net> wrote:
> From: Sonic Zhang <sonic.adi@...il.com>
> Date: Tue, 18 May 2010 18:52:17 +0800
>
> [ Please never drop the mailing list when you're trying to
> discuss something networking related with me, thanks.
> I've put the CC: back. ]
>
>> On Mon, May 10, 2010 at 7:40 PM, David Miller <davem@...emloft.net> wrote:
>>> From: Mike Frysinger <vapier@...too.org>
>>> Date: Sun, 9 May 2010 06:18:52 -0400
>>>
>>>> From: Sonic Zhang <sonic.zhang@...log.com>
>>>>
>>>> Signed-off-by: Sonic Zhang <sonic.zhang@...log.com>
>>>> Signed-off-by: Mike Frysinger <vapier@...too.org>
>>>
>>> This should never ever happen, it's a bug and you should print a warning
>>> message when and if it does actually occur.
>>>
>>> At any point where your ->next pointer hits tx_list_head, the queue
>>> should have been stopped by your driver and therefore the networking
>>> core will never pass another packet to you.
>>
>> To reduce the tx output overhead, the tx interrupt is not enabled and
>> handled in this driver. So, the driver doesn't know when to restart
>> the tx queue if the queue is stopped in ndo_start_xmit() at the point
>> where next pointer hits tx_list_head.
>>
>> In this case, although TX buffer list full rarely happens, the check
>> is still a safeguard.
>
> You can't do that, if you don't use the TX interrupt then you can leave
> SKBs stale in your TX ring for indefinite periods of time which is
> illegal.
No, this doesn't happen, because before ndo_start_xmit() returns, the
old TX buffers and skbs in the ring, which finished DMA operation, are
freed. The only difference is that the free operation of a skb is done
in next tx transfer.
Sonic
>
> SKBs hold onto resources that can't be held indefinitely, such as TCP
> socket references and netfilter conntrack state. So if you leave a
> packet in your TX ring for a long time, there might be a TCP socket
> that now cannot be closed and freed up because of that.
>
> You must therefore free them very as soon as possible after the
> hardware is done with them.
>
--
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