From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1602C31E5B for ; Mon, 17 Jun 2019 19:31:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A92922085A for ; Mon, 17 Jun 2019 19:31:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727711AbfFQTbT (ORCPT ); Mon, 17 Jun 2019 15:31:19 -0400 Received: from mga09.intel.com ([134.134.136.24]:50086 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726818AbfFQTbT (ORCPT ); Mon, 17 Jun 2019 15:31:19 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 12:31:19 -0700 X-ExtLoop1: 1 Received: from vpatel-desk.jf.intel.com (HELO localhost.localdomain) ([10.7.159.52]) by orsmga007.jf.intel.com with ESMTP; 17 Jun 2019 12:31:18 -0700 From: Vedang Patel To: netdev@vger.kernel.org Cc: jeffrey.t.kirsher@intel.com, davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, intel-wired-lan@lists.osuosl.org, vinicius.gomes@intel.com, l@dorileo.org, Vedang Patel Subject: [PATCH net-next v3 0/6] net/sched: Add txtime-assist support for taprio. Date: Mon, 17 Jun 2019 12:31:04 -0700 Message-Id: <1560799870-18956-1-git-send-email-vedang.patel@intel.com> X-Mailer: git-send-email 2.7.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Changes in v3: - Simplify implementation for taprio flags. - txtime_delay can only be set if txtime-assist mode is enabled. - txtime_delay and flags will only be visible in tc output if set by user. - Minor changes in error reporting. Changes in v2: - Txtime-offload has now been renamed to txtime-assist mode. - Renamed the offload parameter to flags. - Removed the code which introduced the hardware offloading functionality. Original Cover letter (with above changes included) -------------------------------------------------- Currently, we are seeing packets being transmitted outside their timeslices. We can confirm that the packets are being dequeued at the right time. So, the delay is induced after the packet is dequeued, because taprio, without any offloading, has no control of when a packet is actually transmitted. In order to solve this, we are making use of the txtime feature provided by ETF qdisc. Hardware offloading needs to be supported by the ETF qdisc in order to take advantage of this feature. The taprio qdisc will assign txtime (in skb->tstamp) for all the packets which do not have the txtime allocated via the SO_TXTIME socket option. For the packets which already have SO_TXTIME set, taprio will validate whether the packet will be transmitted in the correct interval. In order to support this, the following parameters have been added: - flags (taprio): This is added in order to support different offloading modes which will be added in the future. - txtime-delay (taprio): This indicates the minimum time it will take for the packet to hit the wire after it reaches taprio_enqueue(). This is useful in determining whether we can transmit the packet in the remaining time if the gate corresponding to the packet is currently open. - skip_skb_check (ETF): ETF currently drops any packet which does not have the SO_TXTIME socket option set. This check can be skipped by specifying this option. Following is an example configuration: tc qdisc replace 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@0 1@0 \\ base-time $BASE_TIME \\ sched-entry S 01 300000 \\ sched-entry S 02 300000 \\ sched-entry S 04 400000 \\ flags 0x1 \\ txtime-delay 200000 \\ clockid CLOCK_TAI tc qdisc replace dev $IFACE parent 100:1 etf \\ offload delta 200000 clockid CLOCK_TAI skip_skb_check Here, the "flags" parameter is indicating that the txtime-assist mode is enabled. Also, all the traffic classes have been assigned the same queue. This is to prevent the traffic classes in the lower priority queues from getting starved. Note that this configuration is specific to the i210 ethernet card. Other network cards where the hardware queues are given the same priority, might be able to utilize more than one queue. Following are some of the other highlights of the series: - Fix a bug where hardware timestamping and SO_TXTIME options cannot be used together. (Patch 1) - Introduces the skip_skb_check option. (Patch 2) - Make TxTime assist mode work with TCP packets (Patch 7). The following changes are recommended to be done in order to get the best performance from taprio in this mode: # TSN in general does not allow Jumbo frames. ip link set dev enp1s0 mtu 1514 # Disable segmentation offload. This is to prevent NIC from sending packets # after the gate for a traffic class has closed. ethtool -K eth0 gso off ethtool -K eth0 tso off # Disable energy efficient ethernet to make sure there are no latency # spikes when NIC is trying to wake up when the packet is supposed to be # sent. ethtool --set-eee eth0 eee off Thanks, Vedang Patel Vedang Patel (6): igb: clear out tstamp after sending the packet. etf: Add skip_sock_check taprio: calculate cycle_time when schedule is installed taprio: Add support for txtime-assist mode. taprio: make clock reference conversions easier taprio: Adjust timestamps for TCP packets. drivers/net/ethernet/intel/igb/igb_main.c | 1 + include/uapi/linux/pkt_sched.h | 5 + net/sched/sch_etf.c | 10 + net/sched/sch_taprio.c | 431 +++++++++++++++++++++++++++--- 4 files changed, 413 insertions(+), 34 deletions(-) -- 2.7.3