From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6A41CA9EAF for ; Mon, 28 Oct 2019 01:25:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9AEC920717 for ; Mon, 28 Oct 2019 01:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729303AbfJ1BZJ (ORCPT ); Sun, 27 Oct 2019 21:25:09 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4772 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729241AbfJ1BZJ (ORCPT ); Sun, 27 Oct 2019 21:25:09 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C616894E157386EA662A; Mon, 28 Oct 2019 09:25:05 +0800 (CST) Received: from [127.0.0.1] (10.67.103.228) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Mon, 28 Oct 2019 09:24:55 +0800 Subject: Re: [PATCH] net: hisilicon: Fix ping latency when deal with high throughput To: Joe Perches , , , References: <1572079779-76449-1-git-send-email-xiaojiangfeng@huawei.com> CC: , , , , , , From: Jiangfeng Xiao Message-ID: <260be568-cbda-5e27-ac06-d6ee6194a0c2@huawei.com> Date: Mon, 28 Oct 2019 09:24:56 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.228] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/10/26 23:44, Joe Perches wrote: > On Sat, 2019-10-26 at 16:49 +0800, Jiangfeng Xiao wrote: >> This is due to error in over budget processing. >> When dealing with high throughput, the used buffers >> that exceeds the budget is not cleaned up. In addition, >> it takes a lot of cycles to clean up the used buffer, >> and then the buffer where the valid data is located can take effect. > [] >> diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c > [] >> @@ -575,7 +575,7 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) >> struct hip04_priv *priv = container_of(napi, struct hip04_priv, napi); >> struct net_device *ndev = priv->ndev; >> struct net_device_stats *stats = &ndev->stats; >> - unsigned int cnt = hip04_recv_cnt(priv); >> + static unsigned int cnt_remaining; > > static doesn't seem a great idea here as it's for just a single > driver instance. Maybe make this part of struct hip04_priv? > Thank you for your review. Your suggestion is very good.