Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753315AbcCGQ6t (ORCPT ); Mon, 7 Mar 2016 11:58:49 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35931 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698AbcCGQ6l (ORCPT ); Mon, 7 Mar 2016 11:58:41 -0500 MIME-Version: 1.0 In-Reply-To: <20160307.111534.235286977900488968.davem@davemloft.net> References: <1457336157-31508-1-git-send-email-sunil.kovvuri@gmail.com> <1457336157-31508-2-git-send-email-sunil.kovvuri@gmail.com> <20160307.111534.235286977900488968.davem@davemloft.net> Date: Mon, 7 Mar 2016 22:28:39 +0530 Message-ID: Subject: Re: [PATCH 1/2] net: thunderx: Set recevie buffer page usage count in bulk From: Sunil Kovvuri To: David Miller Cc: Linux Netdev List , LKML , LAKML , Sunil Goutham , Robert Richter Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 616 Lines: 24 Hi David, >> you create a window of time during which the consumer >> can release the page and prematurely free it. Okay, but here the consumer i.e HW is notified only after page count is incremented. For example if you check 'nicvf_refill_rbdr' fn() only after receive buffer ring is refilled with buffers, doorbell is issued to hardware to start using the new buffers. So @@ -241,6 +254,8 @@ refill: new_rb++; } + nicvf_get_page(nic); + calling 'nicvf_get_page' before issuing doorbell ensures page ref count is properly set before hw/consumer can use the buffers. Thanks, Sunil.