Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1365823ybl; Fri, 13 Dec 2019 14:09:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzQElXWpkBMWy30DvkhPYWtaeW1QUFbXmT2js6abvi/IWaNHHsoQ4133eXv+/a3Wa5spJu5 X-Received: by 2002:a05:6830:120c:: with SMTP id r12mr17492438otp.327.1576274954305; Fri, 13 Dec 2019 14:09:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576274954; cv=none; d=google.com; s=arc-20160816; b=Q/bkEKkl61JG4RPoeVgfrYpJJW2WYwMM4HGj4Vd+TSV1yLxJ/1hO8UpceEoaedScyF sQNghzfPELxM9qxPWaCYIB6Y5ZU3BlpsFJFTfavEkr+DO9xtwzsAW05JmERdlxJ/m5Ae mjV+NH9Ft4F+F9NMsG9G+PgtVWqk8ydAMM3cKG8KH+2ngLWkw15UpsCEIaG6++nQrw7d c0/ByI2iD1Lp4uRoq9RpP51npkjDHLkoLU7mZP/ro7JQyS1rRNkPPIcgQ/ddBWHJVL9N 00Sb0ArJ3YN7k+C/oMUTH7zPuCy9YXXd+RtoTibehQOy0ycIq78ZJh5pZ0OFADULndTH n2aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:message-id:to:subject :from:cc:references:in-reply-to:content-transfer-encoding :mime-version; bh=f5s4OdV/6nj10EITA1WwsiAFycpz7Ybz1ZkSCCdGLvg=; b=ieBahrIPBijs0I2CRQqI4i6otzs5iIzoZj7KJsEbv8G9ahZbZVSdFEJLWr0MHxxyMd R5gIbx9pfryqamCHwbZgX5STgsxZl7KlV6rk5G8qHJhxRAIeUyuxnihNXBsjBuTEHpSx FLEILR40T+KrQonXG456zpTZGfFmKmHKhq4Ax15JzA1Fk9KPLVZ8Ni53MnRDC22pQeT+ 6HbShI6138LKvyYfli0ygn/HZC9xR+hPFTd/Z/O0uguLmfFrjrI0m2OQE3zW79UUwZFa RtBtygqUrBsxvem2kFLUsw4/uci+Cbh+wMiage9NUzNqZDDRh06LSo+fZJ0Nw0wFCYIg JGYA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20si6154743otf.271.2019.12.13.14.09.02; Fri, 13 Dec 2019 14:09:14 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbfLMWIE convert rfc822-to-8bit (ORCPT + 99 others); Fri, 13 Dec 2019 17:08:04 -0500 Received: from mga01.intel.com ([192.55.52.88]:6005 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbfLMWIE (ORCPT ); Fri, 13 Dec 2019 17:08:04 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2019 14:08:04 -0800 X-IronPort-AV: E=Sophos;i="5.69,311,1571727600"; d="scan'208";a="204451135" Received: from aguedesl-mac01.jf.intel.com (HELO localhost) ([10.24.12.201]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2019 14:08:03 -0800 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT In-Reply-To: <20191127094517.6255-1-Po.Liu@nxp.com> References: <20191127094517.6255-1-Po.Liu@nxp.com> Cc: "vinicius.gomes@intel.com" , "simon.horman@netronome.com" , Claudiu Manoil , Vladimir Oltean , Alexandru Marginean , Xiaoliang Yang , Roy Zang , Mingkai Hu , Jerry Huang , Leo Li , Po Liu From: Andre Guedes Subject: Re: [v1,net-next, 1/2] ethtool: add setting frame preemption of traffic classes To: "alexandru.ardelean@analog.com" , "allison@lohutok.net" , "andrew@lunn.ch" , "ayal@mellanox.com" , "davem@davemloft.net" , "f.fainelli@gmail.com" , "gregkh@linuxfoundation.org" , "hauke.mehrtens@intel.com" , "hkallweit1@gmail.com" , "jiri@mellanox.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "pablo@netfilter.org" , "saeedm@mellanox.com" , "tglx@linutronix.de" , Po Liu Message-ID: <157603276975.18462.4638422874481955289@pipeline> User-Agent: alot/0.8.1 Date: Tue, 10 Dec 2019 18:52:49 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Po, Quoting Po Liu (2019-11-27 01:59:18) > IEEE Std 802.1Qbu standard defined the frame preemption of port > traffic classes. This patch introduce a method to set traffic > classes preemption. Add a parameter 'preemption' in struct > ethtool_link_settings. The value will be translated to a binary, > each bit represent a traffic class. Bit "1" means preemptable > traffic class. Bit "0" means express traffic class. MSB represent > high number traffic class. > > If hardware support the frame preemption, driver could set the > ethernet device with hw_features and features with NETIF_F_PREEMPTION > when initializing the port driver. > > User can check the feature 'tx-preemption' by command 'ethtool -k > devname'. If hareware set preemption feature. The property would > be a fixed value 'on' if hardware support the frame preemption. > Feature would show a fixed value 'off' if hardware don't support > the frame preemption. > > Command 'ethtool devname' and 'ethtool -s devname preemption N' > would show/set which traffic classes are frame preemptable. > > Port driver would implement the frame preemption in the function > get_link_ksettings() and set_link_ksettings() in the struct ethtool_ops. In an early RFC series [1], we proposed a way to support frame preemption. I'm not sure if you have considered it before implementing this other proposal based on ethtool interface so I thought it would be a good idea to bring that up to your attention, just in case. In that initial proposal, Frame Preemption feature is configured via taprio qdisc. For example: $ tc qdisc add dev IFACE parent root handle 100 taprio \ num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \ queues 1@0 1@1 2@2 \ preemption 0 1 1 1 \ base-time 10000000 \ sched-entry S 01 300000 \ sched-entry S 02 300000 \ sched-entry S 04 400000 \ clockid CLOCK_TAI It also aligns with the gate control operations Set-And-Hold-MAC and Set-And-Release-MAC that can be set via 'sched-entry' (see Table 8.7 from 802.1Q-2018 for further details. Please share your thoughts on this. Regards, Andre