From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCHv2] 3c59x: fix missing dma_mapping_error check and bad ring refill logic Date: Wed, 03 Jan 2018 10:26:06 -0500 (EST) Message-ID: <20180103.102606.1453240990448791901.davem@davemloft.net> References: <20180103144415.13446-1-nhorman@tuxdriver.com> <20180103.095849.985156664792555290.davem@davemloft.net> <20180103151333.GB22129@hmswarspite.think-freely.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: nhorman@tuxdriver.com, netdev@vger.kernel.org, tedheadster@gmail.com, klassert@mathematik.tu-chemnitz.de To: nhorman@redhat.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:32866 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbeACP0I (ORCPT ); Wed, 3 Jan 2018 10:26:08 -0500 In-Reply-To: <20180103151333.GB22129@hmswarspite.think-freely.org> Sender: netdev-owner@vger.kernel.org List-ID: From: Neil Horman Date: Wed, 3 Jan 2018 10:13:33 -0500 > Thats exactly what this patch does, instead of creating a second loop to > traverse all the emptied ring buffers, now I: > > 1) Pre-allocate a new skb when I know I'm going to receive the in-place skb > 2) Map the skb into the appropriate dma device domain > 3) If (1) and (2) succede, then I swap the newly allocate skb and dma address > with the old one and recieve the old into the network stack > 4) If (1) or (2) fail, then I goto clear_complete, which leaves the old skb and > dma address in place, sets the buffer status back to 0 (indicating completion), > and write the new ring status back to the hardware > > This is what you wanted, a pre-allocate and swap-if-successful, recycle-if-not > approach, rather than the leave-a-hole-in-the-ring approach that is there > currently, no? Or did I miss something else? I misread the code sorry, you're absolutely right. I'll apply this patch, thanks Neil. :)