From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334AbbJaSH7 (ORCPT ); Sat, 31 Oct 2015 14:07:59 -0400 Received: from violet.fr.zoreil.com ([92.243.8.30]:35323 "EHLO violet.fr.zoreil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751478AbbJaSHz (ORCPT ); Sat, 31 Oct 2015 14:07:55 -0400 Date: Sat, 31 Oct 2015 19:07:51 +0100 From: Francois Romieu To: =?utf-8?B?TcOlbnMgUnVsbGfDpXJk?= Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v4] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Message-ID: <20151031180751.GA490@electric-eye.fr.zoreil.com> References: <1446137333-1822-1-git-send-email-mans@mansr.com> <20151030222841.GA24712@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Organisation: Land of Sunshine Inc. User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Måns Rullgård : > Francois Romieu writes: [...] > > It looks like it receives, then tries to allocate new resources. If so > > it may deplete the ring and you should instead consider allocating new > > resources first, then receive data if alloc + map suceeded. > > The hardware receives a frame and stores it in the provided DMA buffer, > then raises an interrupt and moves on to the next buffer. When a buffer > is handed over to the network stack, a new one has to take its place in > the DMA queue. I'm not sure how you're suggesting this be done > differently. - The hardware raises an interrupt and moves on to the next packet - The driver allocates a new buffer - call it Bob - and maps it. - If it succeeds - The driver unmaps the received packet - The driver hands the received packet to the network stack - The driver hands Bob to the hardware - It it fails - The driver updates the dropped packet stats - The driver recycles the received - yet non-unmapped - packet to the hardware -- Ueimor