Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp174237pxr; Sun, 10 Apr 2022 10:51:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCW0OIH7z48ULsW1oqRdZrgPyKa6csjwp73WVlOr1brdkehWID0i/7jHQAz8X3ShGuMMAK X-Received: by 2002:a05:6402:348b:b0:419:172c:e2aa with SMTP id v11-20020a056402348b00b00419172ce2aamr29675430edc.261.1649613097464; Sun, 10 Apr 2022 10:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649613097; cv=none; d=google.com; s=arc-20160816; b=LlpExDVSJZk1OVS9elwKxzSM77FN9xKleEsHxnz5qFZuts7xK0BVd7VKFcS58Q0DsE mK39blp7VNW2yRUiAs1/iVcB9DYeyswh7rmLlzAgS6vUMM5kER6bQw/wgkQfazEdO5F/ zeDvlTgP7YmbE4Pj2c8zyiCS4dATRRQkKPe6opQOPilEtTrourF7HrrouhNnmAsjpOn8 1D0cktHLllgx/tcquoEdRxt4jQnQIvYDiAXp92bqSK9KkQYlzS3/5idlgtsn7mI+23iY QrhyUeeuVhc1ELVbBjHZ4z6iYQ1T8XedOhngZGJrr0NCLP/RuDC9Ibyr3+eLXNvgXnxQ pARQ== 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=48B5GZdTmp3etDyse839bgfWnLFnS0dg9VdqQ3KdB0w=; b=gO7ZtbLvsqmpyemDHpS2Rezg9k8GeYtLOf5numPyBJfjn4xTtdlrouoY0a6roi9+1N hON1cyrzFjjMOt0iWHlx4Kuxg2CrtoGa3zxQeIRDsrCAiW4/3hBCczrxk9SzYiYYPO8B wTspp+IZTBIctD4mw0ZMxDy80ATzU0NCzyDVYcGwnkd+OGfX+R18AUvCa1c4+k0vCyeg tFctvM9bG5PPqx6XUtkHC/rLOQ+bYMTe5l5wLvd+8s/Z7JHhn8Hyc6ubXmlJyzVlmOF+ zSoYe6WHAl8g0BclthzZftHGeUbg+xLKL7VJbc5ad79OFT8CGiKAM6qw8ld6d2ej3JSj yinQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TUSjt2Eb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020a170906a11500b006e6ed377f42si5312602ejy.754.2022.04.10.10.51.13; Sun, 10 Apr 2022 10:51:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TUSjt2Eb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S239924AbiDHV54 (ORCPT + 99 others); Fri, 8 Apr 2022 17:57:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiDHV5y (ORCPT ); Fri, 8 Apr 2022 17:57:54 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BE2238BF6; Fri, 8 Apr 2022 14:55:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 79F7ECE2BE0; Fri, 8 Apr 2022 21:55:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F73CC385A1; Fri, 8 Apr 2022 21:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649454945; bh=25vW1EczToy4G4r4R/eA4RyVfrlTEyY2y4C5EOTRlZs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TUSjt2Ebn5pR/zhdkpfF+t+eKiABz0vq+AmZWdWsQEHGvN/W/x5eu4vQmpIzrqFks pBsubIwvf/hW+mPV26XlTinTR7QR/xpjA+cEpHkuO72WZK230Xni/4TP2pgB6VPESP KgwXYpr+bUco+yOn3Z6uukac5Ad1xDI0ICLNFKccnfH1lTHTCC8/UCg4TtvPafv2lh jDfBYePRT+m2wTLCDXN68AxBcGEG4PhRHqj4A0V52xcHQAVwgrTvUlxAFlRF0yzRQE NSnyn/jPKUXPMvVoNz4ZSttjTMW6i11fdpe+S4PgnrnJtiD2rEFbqnJofYF4HABJJR 1iCkgxezu5nSw== Date: Fri, 8 Apr 2022 14:55:44 -0700 From: Jakub Kicinski To: Guangbin Huang Cc: , , , , , , , Subject: Re: [PATCH net-next 1/3] net: ethtool: extend ringparam set/get APIs for tx_push Message-ID: <20220408145544.141c0799@kernel.org> In-Reply-To: <20220408071245.40554-2-huangguangbin2@huawei.com> References: <20220408071245.40554-1-huangguangbin2@huawei.com> <20220408071245.40554-2-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 8 Apr 2022 15:12:43 +0800 Guangbin Huang wrote: > From: Jie Wang > > Currently tx push is a standard driver feature which controls use of a fast > path descriptor push. So this patch extends the ringparam APIs and data > structures to support set/get tx push by ethtool -G/g. > > Signed-off-by: Jie Wang > Signed-off-by: Guangbin Huang > +``ETHTOOL_A_RINGS_TX_PUSH`` flag is used to choose the ordinary path or the fast > +path to send packets. In ordinary path, driver fills BDs to DDR memory and > +notifies NIC hardware. In fast path, driver pushes BDs to the device memory > +directly and thus reducing the sending latencies. Setting tx push attribute "on" > +will enable tx push mode and send packets in fast path if packet size matches. > +For those not supported hardwares, this attributes is "off" by default settings. Since you need to respin to fix the kdoc warning - could you also add a mention that enabling this feature may increase CPU cost? Unless it's not the case for your implementation, I thought it usually is.. > RINGS_SET > ========= > @@ -887,6 +894,7 @@ Request contents: > ``ETHTOOL_A_RINGS_TX`` u32 size of TX ring > ``ETHTOOL_A_RINGS_RX_BUF_LEN`` u32 size of buffers on the ring > ``ETHTOOL_A_RINGS_CQE_SIZE`` u32 Size of TX/RX CQE > + ``ETHTOOL_A_RINGS_TX_PUSH`` u8 flag of TX Push mode > ==================================== ====== =========================== > > Kernel checks that requested ring sizes do not exceed limits reported by > diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h > index 4af58459a1e7..ede4f9154cd2 100644 > --- a/include/linux/ethtool.h > +++ b/include/linux/ethtool.h > @@ -71,11 +71,13 @@ enum { > * struct kernel_ethtool_ringparam - RX/TX ring configuration > * @rx_buf_len: Current length of buffers on the rx ring. > * @tcp_data_split: Scatter packet headers and data to separate buffers > + * @tx_push: The flag of tx push mode > * @cqe_size: Size of TX/RX completion queue event > */ > struct kernel_ethtool_ringparam { > u32 rx_buf_len; > u8 tcp_data_split; > + u8 tx_push; > u32 cqe_size; > }; > > @@ -87,6 +89,7 @@ struct kernel_ethtool_ringparam { > enum ethtool_supported_ring_param { > ETHTOOL_RING_USE_RX_BUF_LEN = BIT(0), > ETHTOOL_RING_USE_CQE_SIZE = BIT(1), > + ETHTOOL_RING_USE_TX_PUSH = BIT(2), include/linux/ethtool.h:94: warning: Enum value 'ETHTOOL_RING_USE_TX_PUSH' not described in enum 'ethtool_supported_ring_param'