Received: by 10.213.65.68 with SMTP id h4csp1032610imn; Wed, 21 Mar 2018 00:23:51 -0700 (PDT) X-Google-Smtp-Source: AG47ELvRJI/fNb8SEzrYgTWkdFp2w3p5K7PJzhIe3esIQyhFXYlKeu2CcY/mb9fmTboUXdyUb3qL X-Received: by 10.99.53.6 with SMTP id c6mr14457551pga.413.1521617031847; Wed, 21 Mar 2018 00:23:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521617031; cv=none; d=google.com; s=arc-20160816; b=E71aVutrDxb3tRxbKkRl13cydB6BFepEc1XUOMCD4YUU4Mj9nkccZeQfc5sV7fnY/Z 9BV9vDM/OIyr/hW7chHteUr7MtCKtcHkevLnR5ZaIxwmTENt8yGqalseiT6/eT3AYMye S1r3zSSWBRQwjhZrTaYpNpB0aXkMXVPge33Nmdu7D++NimiCPIy7tGrz95n+1qhT8OwZ 4qTJ4qVMqDrKHiipUaApaW97zhY3msaPVkoZV+5UseVegPHxxwRSki9uvNCZ1Lx272o3 QgPZ7w4+XOE9795L0Lkwspnm9YU6uRevhXoBGRXnXwNoT8HZrUmgCQNMawzQpcNteteD gopg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=Yo4VuZvdRr+Tc7bnlwUd2YqzoZuq0Is5geccdnYACjU=; b=f42Jx8tTFy8t93G54Y2ffzy8yWSH29FyaA17SfV/IYCKaqYsD7GNl18T8VcYXHsOJm zu3coEl2Es5MfYMyieLEERWAu40Yy662RNMcgfyyPcC4FDRE4V6LaM3HuJ2JupF78kAB yBc2B1tqLjSQVb53nLPv3TMrw1vWyvHgYgeio4QLGaNajUx8ox8/C+VM6z+YHvDdrFlk T61wXVqpUbCn3ZiiKIL4xdSV+cMorn+beFRJZ/bBVzSjbVqasNCJi/68Oo0QnyPPdjIq khCapFOK3jOQmnUlE6CunNXkWM3kI8R1rJUcktH0P+DWy60fR6w8ZqmXBiPDWxqbl/we SVXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59-v6si3332912plf.596.2018.03.21.00.23.37; Wed, 21 Mar 2018 00:23:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751531AbeCUHSS (ORCPT + 99 others); Wed, 21 Mar 2018 03:18:18 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6658 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751040AbeCUHSP (ORCPT ); Wed, 21 Mar 2018 03:18:15 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B0C765B9B47A1; Wed, 21 Mar 2018 15:18:00 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Wed, 21 Mar 2018 15:17:53 +0800 From: Peng Li To: CC: , , , , Subject: [PATCH net-next 06/11] net: hns3: change GL update rate Date: Wed, 21 Mar 2018 15:49:25 +0800 Message-ID: <1521618570-129694-7-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521618570-129694-1-git-send-email-lipeng321@huawei.com> References: <1521618570-129694-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang The interrupt coalescing self-adaptive function updates the int_gl every interrupt. The GL update rate is too faster to get a better new GL value. This patch changes the GL update rate to every one hundred interrupts. The GL update rate is defined by HNS3_INT_ADAPT_DOWN_START. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 ++++++++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index f700ec1..e7cf7b4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -214,6 +214,7 @@ static void hns3_vector_gl_rl_init(struct hns3_enet_tqp_vector *tqp_vector, /* Default: disable RL */ h->kinfo.int_rl_setting = 0; + tqp_vector->int_adapt_down = HNS3_INT_ADAPT_DOWN_START; tqp_vector->rx_group.coal.flow_level = HNS3_FLOW_LOW; tqp_vector->tx_group.coal.flow_level = HNS3_FLOW_LOW; } @@ -2492,6 +2493,11 @@ static void hns3_update_new_int_gl(struct hns3_enet_tqp_vector *tqp_vector) struct hns3_enet_ring_group *tx_group = &tqp_vector->tx_group; bool rx_update, tx_update; + if (tqp_vector->int_adapt_down > 0) { + tqp_vector->int_adapt_down--; + return; + } + if (rx_group->coal.gl_adapt_enable) { rx_update = hns3_get_new_int_gl(rx_group); if (rx_update) @@ -2505,6 +2511,8 @@ static void hns3_update_new_int_gl(struct hns3_enet_tqp_vector *tqp_vector) hns3_set_vector_coalesce_tx_gl(tqp_vector, tx_group->coal.int_gl); } + + tqp_vector->int_adapt_down = HNS3_INT_ADAPT_DOWN_START; } static int hns3_nic_common_poll(struct napi_struct *napi, int budget) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h index c313780..2fe870b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h @@ -462,6 +462,8 @@ enum hns3_link_mode_bits { #define HNS3_INT_RL_MAX 0x00EC #define HNS3_INT_RL_ENABLE_MASK 0x40 +#define HNS3_INT_ADAPT_DOWN_START 100 + struct hns3_enet_coalesce { u16 int_gl; u8 gl_adapt_enable; -- 2.9.3