[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20131029.153957.1658989244969068757.davem@davemloft.net>
Date: Tue, 29 Oct 2013 15:39:57 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: nlhintz@...mail.com
Cc: zajec5@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH] bgmac: don't update slot on skb alloc/dma mapping error
From: Nathan Hintz <nlhintz@...mail.com>
Date: Tue, 29 Oct 2013 01:22:55 -0700
> On Tue, 29 Oct 2013 07:52:58 +0100
> Rafaİİ Miİİecki <zajec5@...il.com> wrote:
>
>> 2013/10/29 Nathan Hintz <nlhintz@...mail.com>:
>> > Don't update the slot in "bgmac_dma_rx_skb_for_slot" unless both the
>> > skb alloc and dma mapping are successful; and free the newly allocated
>> > skb if a dma mapping error occurs. This will prevent an skb leak upon
>> > returning when an error occurs.
>>
>> In case of bgmac_dma_rx_skb_for_slot failure we're giving up anyway
>> (and freeing everything), but with your patch code is simpler to
>> understand, so I'm OK with that.
>>
>> Acked-by: Rafaİİ Miİİecki <zajec5@...il.com>
>>
>
> I might be misunderstanding; but it in the case of failure, it appeared to me
> that the currently received packet was dropped and the old skb would continue
> to be assigned to the slot and would be used to receive future packets (this
> would continue until bgmac_dma_rx_skb_for_slot was successful).
That's exactly the wanted, and most desirable, behavior for any network
driver.
If you can't allocate a new SKB, reuse the old one, because the worst
thing you can do is prioritize packet reception over making sure the
device doesn't end up with no RX slots to DMA into.
--
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