Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp997251pxb; Fri, 13 Aug 2021 10:55:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG9uWC+QNduVE3XLK5g/+lf/FpqOveZJgZPzjw5zFq8g3CKWV/DD848uN+Vs4LOEcjScMK X-Received: by 2002:a02:9a13:: with SMTP id b19mr3437314jal.37.1628877343587; Fri, 13 Aug 2021 10:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628877343; cv=none; d=google.com; s=arc-20160816; b=AIt0tOFp6WtibwZrFKm342FssP8z/kKYIzKZCohebrnOcuzzbc6jCAaKWqhUkIKdPa zm1hTHcZig2EMutF6MGMk3AHtaxsW5oo4utgLCIsIDYaOPF3tYImnF8uMXtnr4Hu4zDA vTofJvWxhNa3U7hzUjI5W6RuCF/hYBzEf9oS08z7BpWiViMTLLJVHlFXML/g27myxofg DJKVpIovKuyW6MkSnJLdc6tt024GH1PinBNetwy9dlqdMyXkouIz0ZffOktqIrdnrXf7 1uvxt6CoMuxs/COC3gGjH/F/7akA7urBQZbmR1rOL50kKsvzgYfHAyus7DotNbR/JayV Gjcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=B4pb8gP+ahdxxL+ujp2ch0K2KxrvDeQgs16ROWHl50Y=; b=unl+ELPBvIDuC4ZNHTwnIGxEfsAD3+18q6aFI2k63lKlajDbPYRT/mbRZrxwM06hhS xhw003AieDET/zC3NtJs99FpixVwifQe0f7jmYJ0SLuIlZ4FHGT4NxJoi8j7yiXHLCPf 1io6Unl30hRRBcoPE8EsVLfiwlMMooi1pa7CnIQhoQH4zUsSD3utt1DU8J/9uD8cmeOF QD+Pv5qc3VBJdt+htvnfS8l2qCQqdPIYaPngga3YqI6pZP/9kaXuZ5M8EWlzNMIAtILP xxfCNV0zqs/QmNXpZrbaqJmEtzb02pelQ/woy46Sjrae6kuRi/yVzHp9g+Y2d1XBfss4 c/1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Gp+R5/O+"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si2055503ila.112.2021.08.13.10.55.30; Fri, 13 Aug 2021 10:55:43 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Gp+R5/O+"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232025AbhHMRzj (ORCPT + 99 others); Fri, 13 Aug 2021 13:55:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:43466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbhHMRzf (ORCPT ); Fri, 13 Aug 2021 13:55:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D881260EFE; Fri, 13 Aug 2021 17:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628877304; bh=eSU+ma0haKb2aIUsp/HJIzNk6roGALnzB8QN2POuuW8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Gp+R5/O+YZNgwjbJwcKEdlL4jwnjD1zMNc8tMlFvsCMSX8NyyUq+JCoeW2TsoFgaN ZMvghvB7cZCk3pbB6K48ULDORiwWADVJImvMjrtI3L3D2pqdNywn6/C6nXiFP8WAbc 4GXoRdQztGp3Qv8OXd+0lagSa4ByrukVJhVc+4pP0zSnl8CiBsCtykiHMYhBTpq+pJ bLaLPvX6PsZTlqaE22jVWQSFLxezv88+85qhjsv2GzSnxIUl77MvZ1nAbmuylwEdUY kVeuryam7fQBw7pMaQTXLSIVAny278VEaSxm+M/iND0UiLpY6M4kHs7V9ifYyl3PjR Y+tICLIRN5Jqw== Date: Fri, 13 Aug 2021 10:55:03 -0700 From: Jakub Kicinski To: Yufeng Mo Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [RFC V3 net-next 1/4] ethtool: add two coalesce attributes for CQE mode Message-ID: <20210813105503.600ad1cd@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <1628819129-23332-2-git-send-email-moyufeng@huawei.com> References: <1628819129-23332-1-git-send-email-moyufeng@huawei.com> <1628819129-23332-2-git-send-email-moyufeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 13 Aug 2021 09:45:26 +0800 Yufeng Mo wrote: > 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 The series LGTM. When I was asking for documentation earlier I meant a paragraph explaining the difference between the two modes. Here is an example based on my current understanding, I could very well be wrong but you see what kind of explanation I'm after? If this is more or less correct please feel free to use it and modify as you see fit. diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst index c86628e6a235..fc7ac5938aac 100644 --- a/Documentation/networking/ethtool-netlink.rst +++ b/Documentation/networking/ethtool-netlink.rst @@ -939,12 +939,25 @@ Gets coalescing parameters like ``ETHTOOL_GCOALESCE`` ioctl request. ``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 timer reset mode, Tx + ``ETHTOOL_A_COALESCE_USE_CQE_RX`` bool timer reset mode, Rx =========================================== ====== ======================= Attributes are only included in reply if their value is not zero or the corresponding bit in ``ethtool_ops::supported_coalesce_params`` is set (i.e. they are declared as supported by driver). +Timer reset mode (``ETHTOOL_A_COALESCE_USE_CQE_TX`` and +``ETHTOOL_A_COALESCE_USE_CQE_RX``) control the interaction between packet +arrival and the various time based delay parameters. By default timers are +expected to limit the max delay between any packet arrival/departure +and a corresponding interrupt. In this mode timer should be started by packet +arrival (sometimes delivery of previous interrupt) and reset when interrupt +is delivered. +Setting the appropriate attribute to 1 will enable ``CQE`` mode, where +each packet event resets the timer. In this mode timer is used to force +the interrupt if queue goes idle, while busy queues depend on the packet +limit to trigger interrupts. COALESCE_SET ============ @@ -977,6 +990,8 @@ Sets coalescing parameters like ``ETHTOOL_SCOALESCE`` ioctl request. ``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 timer reset mode, Tx + ``ETHTOOL_A_COALESCE_USE_CQE_RX`` bool timer reset mode, Rx =========================================== ====== ======================= Request is rejected if it attributes declared as unsupported by driver (i.e.