Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp371116pxb; Thu, 12 Aug 2021 19:07:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPBzXJYPdVSWwv+Tqj/7n+AD8Xm+vm43mWlyN2iQzLhvcEUIMYpf8be1Oo7ZQviZYrNSmJ X-Received: by 2002:a05:6402:2789:: with SMTP id b9mr14461ede.44.1628820432407; Thu, 12 Aug 2021 19:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628820432; cv=none; d=google.com; s=arc-20160816; b=p6v1TjHQQ7TSKbB83NYFhtEksDUOAZ4aGGGmSgiHQ/hsp178WRJVr0fb2UOGAvbxWx CAVK/yWWVIMi0ny++lSeeAyCEFrDfwzZJMht0SS0j8HpDrQRX3andDRhIxDNqnEThwR4 cj81qjOa5FmBm1FiX6q3Hht+P9sFNVVcqO2ReLbb3hQHjJyGDcmFQTtAHo2cTiF9pugU IDDnUX+yHz8wQPyVVQRm5JRilPehxtIchPB5wXrytIKDc9TwpwIEHqMvlJMx6wQBe/Tf 9F9CN8f7Mz9n9mSaiofHA89Qo/sYX//mOS3iyV1ibv3MCEebwQCH/aeOn2yj0i7478ci PVbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=kGbm7i7jHQHPxBHYCgSPrsU1zq1Y8jqC65p9AsIrF7M=; b=lx12iLTzd3U5N3cFKQF1CbGsjO3rYbf405UmkTUuYgnMtKcGGj4dOE+Ju+KvI2bc17 3Mo4eSWfTQ6JXoIx0OWPPYOADNLy28FNep74fo5pKemJXIBTX657F68QIK2Xiy4gO4Ay FUjzXVKlBQze4K/GJhHWkr19AzRBPiDn2YV5IUsjGoUUMZIhQyjl58VQzNFSwBRnDS9p aZWYrvveUfSdmMQk3PyUypaG287lxin+GeOwhSwgomUYjz2o/nGwg5PiamJ0cRxkSV81 SZ1G6JM1nfmNuMMr3ynosgwG+QYh81Z9RWIKuBmZKpkaocpn7wxzjEWcqtCptI9bCZ71 TbKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si140853ejy.51.2021.08.12.19.06.48; Thu, 12 Aug 2021 19:07:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238331AbhHMBtq (ORCPT + 99 others); Thu, 12 Aug 2021 21:49:46 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:8406 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238266AbhHMBtp (ORCPT ); Thu, 12 Aug 2021 21:49:45 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Gm5wb10Fsz86yj; Fri, 13 Aug 2021 09:45:19 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 13 Aug 2021 09:49:17 +0800 Received: from localhost.localdomain (10.67.165.24) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 13 Aug 2021 09:49:17 +0800 From: Yufeng Mo To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC V3 net-next 1/4] ethtool: add two coalesce attributes for CQE mode Date: Fri, 13 Aug 2021 09:45:26 +0800 Message-ID: <1628819129-23332-2-git-send-email-moyufeng@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1628819129-23332-1-git-send-email-moyufeng@huawei.com> References: <1628819129-23332-1-git-send-email-moyufeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently, there many drivers who support CQE mode configuration, some configure it as a fixed when initialized, some provide an interface to change it by ethtool private flags. In order make it more generic, add two new 'ETHTOOL_A_COALESCE_USE_CQE_TX' and 'ETHTOOL_A_COALESCE_USE_CQE_RX' coalesce attributes, then these parameters can be accessed by ethtool netlink coalesce uAPI. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan --- Documentation/networking/ethtool-netlink.rst | 8 ++++++++ include/linux/ethtool.h | 6 +++++- include/uapi/linux/ethtool_netlink.h | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst index c86628e..af963cf 100644 --- a/Documentation/networking/ethtool-netlink.rst +++ b/Documentation/networking/ethtool-netlink.rst @@ -939,6 +939,10 @@ Kernel response contents: ``ETHTOOL_A_COALESCE_TX_USECS_HIGH`` u32 delay (us), high Tx ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH`` u32 max packets, high Tx ``ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL`` u32 rate sampling interval + ``ETHTOOL_A_COALESCE_USE_CQE_TX`` bool with timer reset on + packet arrival, Tx + ``ETHTOOL_A_COALESCE_USE_CQE_RX`` bool with timer reset on + packet arrival, Rx =========================================== ====== ======================= Attributes are only included in reply if their value is not zero or the @@ -977,6 +981,10 @@ Request contents: ``ETHTOOL_A_COALESCE_TX_USECS_HIGH`` u32 delay (us), high Tx ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH`` u32 max packets, high Tx ``ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL`` u32 rate sampling interval + ``ETHTOOL_A_COALESCE_USE_CQE_TX`` bool with timer reset on + packet arrival, Tx + ``ETHTOOL_A_COALESCE_USE_CQE_RX`` bool with timer reset on + packet arrival, Rx =========================================== ====== ======================= Request is rejected if it attributes declared as unsupported by driver (i.e. diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 4711b96..bad4c7a 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -211,7 +211,9 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32, #define ETHTOOL_COALESCE_TX_USECS_HIGH BIT(19) #define ETHTOOL_COALESCE_TX_MAX_FRAMES_HIGH BIT(20) #define ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL BIT(21) -#define ETHTOOL_COALESCE_ALL_PARAMS GENMASK(21, 0) +#define ETHTOOL_COALESCE_USE_CQE_RX BIT(22) +#define ETHTOOL_COALESCE_USE_CQE_TX BIT(23) +#define ETHTOOL_COALESCE_ALL_PARAMS GENMASK(23, 0) #define ETHTOOL_COALESCE_USECS \ (ETHTOOL_COALESCE_RX_USECS | ETHTOOL_COALESCE_TX_USECS) @@ -237,6 +239,8 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32, ETHTOOL_COALESCE_RX_USECS_LOW | ETHTOOL_COALESCE_RX_USECS_HIGH | \ ETHTOOL_COALESCE_PKT_RATE_LOW | ETHTOOL_COALESCE_PKT_RATE_HIGH | \ ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL) +#define ETHTOOL_COALESCE_USE_CQE \ + (ETHTOOL_COALESCE_USE_CQE_RX | ETHTOOL_COALESCE_USE_CQE_TX) #define ETHTOOL_STAT_NOT_SET (~0ULL) diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h index b3b9371..5545f1c 100644 --- a/include/uapi/linux/ethtool_netlink.h +++ b/include/uapi/linux/ethtool_netlink.h @@ -377,6 +377,8 @@ enum { ETHTOOL_A_COALESCE_TX_USECS_HIGH, /* u32 */ ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH, /* u32 */ ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */ + ETHTOOL_A_COALESCE_USE_CQE_MODE_TX, /* u8 */ + ETHTOOL_A_COALESCE_USE_CQE_MODE_RX, /* u8 */ /* add new constants above here */ __ETHTOOL_A_COALESCE_CNT, -- 2.8.1