Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756207AbbLDUPO (ORCPT ); Fri, 4 Dec 2015 15:15:14 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34491 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753964AbbLDUPM (ORCPT ); Fri, 4 Dec 2015 15:15:12 -0500 Message-ID: <5661F449.5020205@gmail.com> Date: Fri, 04 Dec 2015 12:15:05 -0800 From: Florian Fainelli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Marcin Wojtas CC: David Miller , linux-kernel@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , netdev@vger.kernel.org, Thomas Petazzoni , Andrew Lunn , Russell King - ARM Linux , Jason Cooper , Yair Mahalalel , Grzegorz Jaszczyk , Simon Guinot , Evan Wang , nadavh@marvell.com, Lior Amsalem , Tomasz Nowicki , =?UTF-8?B?R3JlZ29yeSBDbMOpbWVudA==?= , nitroshift@yahoo.com, Sebastian Hesselbarth Subject: Re: [PATCH 00/13] mvneta Buffer Management and enhancements References: <20151129.210210.1777978635596463961.davem@davemloft.net> <20151130.112500.293198684175670933.davem@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2135 Lines: 58 (no top posting please) On 02/12/15 00:26, Marcin Wojtas wrote: > Hi Florian, > > Can you please describe in more details, what would you expect from > such special abstraction layer regarding buffer managers? I'd like to > understand more of your expectations and evaluate possible work. Well, something along these lines: - have the ability to register a particular pool (location + number of buffers) in a way that is relatively device agnostic (initialization would of course be device specific) - provide a set of buffer management APIs like those you proposed below, and have some generic code that leverages what drivers/net/ethernet/sun/niu.c does for instance - introduce a netdev_alloc_skb_from_pool() or something like that which would limit the amount of code to change in your network driver to benefit from that feature so based I am sure David would be able to suggest more detailed API. > > Best regards, > Marcin > > 2015-11-30 17:25 GMT+01:00 David Miller : >> From: Marcin Wojtas >> Date: Mon, 30 Nov 2015 15:13:22 +0100 >> >>> What kind of abstraction and helpers do you mean? Some kind of API >>> (e.g. bm_alloc_buffer, bm_initialize_ring bm_put_buffer, >>> bm_get_buffer), which would be used by platform drivers (and specific >>> aplications if one wants to develop on top of the kernel)? >>> >>> In general, what is your top-view of such solution and its cooperation >>> with the drivers? >> >> The tricky parts involved have to do with allocating pages for the >> buffer pools and minimizing the number of atomic refcounting >> operations on those pages for for the puts and gets, particularly >> around buffer replenish runs. >> >> For example, if you're allocating a page for a buffer pool the device >> will chop into N (for any N < PAGE_SIZE) byte pieces, you can >> eliminate many atomic operations. -- Florian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/