From patchwork Tue Feb 7 13:54:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 53912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2863769wrn; Tue, 7 Feb 2023 06:00:53 -0800 (PST) X-Google-Smtp-Source: AK7set+asxv3Mn971A/NdENtoKxlgpKP2orNghiaIVeC0Q57momeA7nS98QU272H58+c+gvBzH8u X-Received: by 2002:a50:8a9e:0:b0:49c:a7c8:527 with SMTP id j30-20020a508a9e000000b0049ca7c80527mr3442015edj.3.1675778453010; Tue, 07 Feb 2023 06:00:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675778452; cv=pass; d=google.com; s=arc-20160816; b=EOkFiErqgzvt6hzFSX5l/pbcHWLCGgacANFle9CN+3PMsDYSzkP8lmQATq+QkFFbbt K5is3U5kpJU+VR6nKLygAgY7stY72fW6I57RZym6EATiIVC/JDS9CY6nq7I9/j4X0A0V 2vLLkOlwBxU1tYpDOLaGFdeYkipc4Qvl+pLtZe3EFcqVJ5EYXKx8CsvIw/MMbH6i3EGW 6ihAy6UI/qkLo1JKHOSP61fu7uoOu2I/hrR1ai+smv4FG/12YvWtlTJOkosg+4qDbDyA bx1rEvb+kZcSdbOtJ+FpAKdKJkC9sMr5bhlj9DGQrpBj0rLMnQYM7yY0mcJDtJv9Hu5U kY5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nuPLRJ7SNyyCiyR9jFu+ruSdL2kWjmKTnlGihV9wK+U=; b=gfETCLH+7V31cc3YAW9KidaNxG3dzCxhgW1U7upPMmNeH5JDe89r7L0zJQXdvJ89M6 rJhXnyxNwNfDRq4V2Gv7RKWk92nAHPXda+tgDKud91VRE3La9tLDv+Oadj6fZnmJ2SPe t4gIZJ2o0wLZCOiRqmgsN5Ti3h8bdCg17Yd4Il/cKazJRPRAD79DBk2p4PwsW86F3DVs m/qM3PdeowmzD2G4l9AyUV/2A7NH1+MfVJHHmvqONdET+ZKemeCGFMD42E4VtFRBOwtg sOr82hvb6/mQClF8ueeQp2D5Ydt86vRoMgcl54TXHHzcUaF0xCl8LmbPH+Y5/HKe4aFI dUPw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="o4UQ/xy2"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t7-20020a056402240700b004a2687900absi18627411eda.351.2023.02.07.06.00.29; Tue, 07 Feb 2023 06:00:52 -0800 (PST) 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=@nxp.com header.s=selector2 header.b="o4UQ/xy2"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232486AbjBGN6W (ORCPT + 99 others); Tue, 7 Feb 2023 08:58:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbjBGN6E (ORCPT ); Tue, 7 Feb 2023 08:58:04 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2058.outbound.protection.outlook.com [40.107.7.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70B442E0FA; Tue, 7 Feb 2023 05:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NvEjdkoPTcBYhb5IEGmK+YTqtNyz4VGt+cheWFpVlqZFZm/DBmMVU1y2Wxzt7wrgoQyOF6XzY0iJk0/XyG3tAMTzHFJXdEMzJNPgxIUqU81PnZ3mfnPWJ7MjOUKutoBCrISlahjYR7C/yhFzYHtYOaTwReBQYfZNgT/hnXUES7wl9hgej0TjVU3G0jS98AqTq/FGuvGGSVjjomcR6/nMjmrlJ0V82iFmX0mv75UUzYZceRubFBI/IWUQ/gCJ1p2qKi8fpPTiPIvd02EyWWuLAIi0pI+RoV60TyBummMO9q2jaJFzgFQ1erQ1ww9qNHwTj1EG1dvxo7E2t/Eqg5J2cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nuPLRJ7SNyyCiyR9jFu+ruSdL2kWjmKTnlGihV9wK+U=; b=Bc9v7+csCg3VwTtKvtWoUjIqUOSqnOH0AVtriTs0/EJNLmHqL9sA5FgK0/yIV3j+dOPq3dx1v7I6Sy8b0ng9bmT1JxN10rzSNtv+GpLaTrV+0Ktx6XRweWk03+E/aZMCLv1J73PLABfJmCrhHIfVJ44mNci9FihCgUGmcEEUiBcIkatu4RhF7T0hif7QEm+dk1smx0MdQUKNPJz4rqHeBfuHes4PeEZJHik6Majcf/YQzYooSp62CyyMPOJ4IGkFt2ScAb8BOO1LDcd/Nlb4caFoHWE4CJ9kzdf9Bik6n2enFoqswwgMRLBzrgvG1QfPkDjhvF0LOuarti50bwZPuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nuPLRJ7SNyyCiyR9jFu+ruSdL2kWjmKTnlGihV9wK+U=; b=o4UQ/xy2HhZ1Mct7Mdo8KyKf4sl76D4hwpK+RP1luau0OxRj5jJp29SYlORiHrI8N9PZqpm+WW92ujYwBTQ7dHfrZOFZ6TXZkCTWtBjShbw4KqrDUa/Hop0800F/2Ko6MeBRQA3SHx8ybfyNbvSy6sGya5yKWhbpaR/p5B0Fi9I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by AM9PR04MB8115.eurprd04.prod.outlook.com (2603:10a6:20b:3e8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Tue, 7 Feb 2023 13:55:31 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%5]) with mapi id 15.20.6064.034; Tue, 7 Feb 2023 13:55:31 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Vinicius Costa Gomes , Kurt Kanzenbach , Jacob Keller , Gerhard Engleder , Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 net-next 13/15] net/sched: taprio: automatically calculate queueMaxSDU based on TC gate durations Date: Tue, 7 Feb 2023 15:54:38 +0200 Message-Id: <20230207135440.1482856-14-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230207135440.1482856-1-vladimir.oltean@nxp.com> References: <20230207135440.1482856-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR10CA0023.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5d8::15) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|AM9PR04MB8115:EE_ X-MS-Office365-Filtering-Correlation-Id: 11b7ae1c-f9dc-423f-fe88-08db0912f9a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IFp7RQiQHNycD5T6RFxGF1AdmZ4AjDd0mWTaSCkZIXgDzSgYD9NxRdl/RiSNe7jMTqonMCnRzRHuEfbH0RkHUFECamHDpPrKT0RhMXubEOrF7En95RG6Q+Zd6SifVIYCW4LoGvdeZ9sZGeEZaJr2nfm/FGHnJAnygGgxuagtwxWFtEKdOivk5gKSzkl3/lC0zbwWqD3Qot47YIVXBe63jAzUa8/QK3FjT0yW/3KetuOu8cbPtAr4qYBqjRg7nrKRFojTcBEuWAJtnLhi/H9jz9uzt6/itrrxnH5ORB5+SL6ctUO6Aj5ev0qTDFs/6SSjEvbk1A3OK6TAFj3CnArngIpbSshnG8jKtdVKJxPRMvsDshXOYP9wcAuTDSeSkOtZo/FW6LLldTjqAg22djdlUeXwMmWja/nFXs2A5OMknKfuiLgHGqcZ7/kcT0kUoI0QD/taoEpHUrZuATm/P47VUqydXYqYMdtmNVW1EgjZ7VZ0ux+x6++NCToC7ykPB0PQ+6tT4obNsNj4AIXDQEZO3+jeNuJjDaygPKP7uJGPm7JXHAvZ7GV0dexPKnPVojWcXdu15GxUJlfpr7n50UXbwfS1PH095QqKsuz3uJKNfnwS6ubhoiXy7ZkLCcO3DgRryh0CcMGFkaK/XINy7YHnYCYOGPoe5rK0qolQe9AUIGW5I/p4Ob5exPPg2/Umrjt+9ne+LxqkXMRAevACk9L1lg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(396003)(346002)(366004)(136003)(376002)(451199018)(2906002)(8676002)(38350700002)(38100700002)(316002)(83380400001)(6916009)(66556008)(66476007)(8936002)(4326008)(41300700001)(44832011)(5660300002)(7416002)(66946007)(2616005)(1076003)(6506007)(478600001)(6486002)(186003)(26005)(6512007)(86362001)(54906003)(52116002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G37AU/hUAV2bBRRFwti/eXmOl6Zk206s7a8qXxXbIE7ZJ7RMIzoDFsi3AMflJi8hIXZs9Wi1a2L1/gOgCZCvqoNHA0MbTFJ4QwcxMwJVTKqc0juArltLXMIMzEVHt3LDpkvhsigb1ePuz5VPcLKqqN6AxSCtqhbDL1TKERBVBxwulhRuHgoBl84id/1pPt/QEVuf2X++YqfoEnqddfDqqQOvO9V6cY21yxsG02yqikNt2AivmJgiX6QwtqQzC+ZWvYY0hnAqzoxG1pSMiaAgVBp4vmH17wRvnlYYOpL3dghYo8H0jYi29MClmOoBXWHLKof4pnt6svPP1cStnjmNYv/b6A8ehuabb1/K3PvIODqFCrC+civb+Fo0xSD0DUBKI/P7aB3l6NuRxni5ZIp9PWOLF8rWvDDHa65DPnXAnphDVyY0+Ftb3arCuEkEMfKn9V5Kyka/YugofUcZwT3YkGumJNFZRBZ8XgLeaPmrSSTybYKs0+Esd/cqkgecAClmLat65QwMkMH123UCzxvZd4PehRGqD08stVyZaklQP8y2UA2T6d3sP7/0hnd7YdAvr63Fc8HlYxdcLwjIPCYT82eewdD02tMT0x09b4Il0B+UO7kcM60yuJqOTpC+ZfiKC0iel5MBM7lGU8o2f6aZA4nkRCZg3ORRhEnccWo6+M2cYrVkmBCzUrwbaq5jASs8zz0qbO9AvhqA5RLs/bZdlELmFnUAfAGNDg9N1+6xHFhtN043z/sim4+uaBoYcdiSCqGYiWgzLBwykKplccCJxiGE6Opbh4Y5hifhKs4v/31eKUnZu6BheFrZEmb+mQS6742V16+2GN1WzmQyiSeY6LmKxSxdN57sL8eoTHGsIgBjlG0EaUVufWXRJJX0yUS/opzTetUxAn+FQFxXdxaaH6tedU89WGxf5K2/Hq1af0WRVISl811Bb9kgf8Y7qantpiRFoQY5Nri9T+MsP5Wp5i9I+qn4QT+lBmsa7QVXCWxKeDJrKGvWnmOd/OQvESId0uUeAqEWY5OS1NLClECznO6OEyzd3smayGQkcLH8bDUXstXNVIQnAx824ylIgPohaUEaRBQ3bqbO13l+Q8/WZYHc+3bviLTWWS7aa4yXUaqA8JprREd97eAxMrKe5P6wrWSYGB86UZQ5CYGmlsRTqMt9rRjX5CV36TJT6U0vzoDyozq+hPvZNcDYZoOvcNhM4R1//kpLEMK1pt1NeQJChKbVZIB5obHeTxdZ8e2wz37qLtQkH0UL6TzWFWCgeNcvexaYXrSebE65nEzv2nuUA3Z7Vni3M3+w1z7A9Z4ROQSPchlMf44iNJfwOnG4KtuHZ5e9/VNsJi+C0CzBs5uIIFduagg0Mg20EQfYokD+JqclNFHKWFkA31WUJNc0lzmcoz/i8lry9esPluPqbkEnCmNXAcfgt3Idrnn96gcnrkbYM+k5o9bp0mo8ioCFzO1xyvvk74tsmrCVtrtpWbjjQUYibCyfZdYTPJzmpa5ZcumDq8egdoCmIMmZetX9n3tL2z088bu+QJ7tzPaFjHCzI16cgovFFfSFua3aZUDuTZLhkeTaW1Uu3zYu3j3LwD2bo1THmyZO1++LJvfklJcGgw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11b7ae1c-f9dc-423f-fe88-08db0912f9a2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 13:55:30.9701 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1IJtZNyo3eW6YOHTN7tYSvfqDXNVPM+fxsHK+Fpj0eLeY5HuPLRfeSDDF7fqaItItS3EI1V6l9VIJsfNKrvNPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8115 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757181067530318961?= X-GMAIL-MSGID: =?utf-8?q?1757181067530318961?= taprio today has a huge problem with small TC gate durations, because it might accept packets in taprio_enqueue() which will never be sent by taprio_dequeue(). Since not much infrastructure was available, a kludge was added in commit 497cc00224cf ("taprio: Handle short intervals and large packets"), which segmented large TCP segments, but the fact of the matter is that the issue isn't specific to large TCP segments (and even worse, the performance penalty in segmenting those is absolutely huge). In commit a54fc09e4cba ("net/sched: taprio: allow user input of per-tc max SDU"), taprio gained support for queueMaxSDU, which is precisely the mechanism through which packets should be dropped at qdisc_enqueue() if they cannot be sent. After that patch, it was necessary for the user to manually limit the maximum MTU per TC. This change adds the necessary logic for taprio to further limit the values specified (or not specified) by the user to some minimum values which never allow oversized packets to be sent. Signed-off-by: Vladimir Oltean Reviewed-by: Kurt Kanzenbach --- v1->v2: max_open_tc_gate_duration got renamed to max_open_gate_duration net/sched/sch_taprio.c | 70 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index d3e3be543fae..e7163d6fab77 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -64,6 +64,7 @@ struct sched_gate_list { */ u64 max_open_gate_duration[TC_MAX_QUEUE]; u32 max_frm_len[TC_MAX_QUEUE]; /* for the fast path */ + u32 max_sdu[TC_MAX_QUEUE]; /* for dump */ struct rcu_head rcu; struct list_head entries; size_t num_entries; @@ -94,7 +95,7 @@ struct taprio_sched { struct hrtimer advance_timer; struct list_head taprio_list; int cur_txq[TC_MAX_QUEUE]; - u32 max_sdu[TC_MAX_QUEUE]; /* for dump and offloading */ + u32 max_sdu[TC_MAX_QUEUE]; /* save info from the user */ u32 txtime_delay; }; @@ -246,18 +247,52 @@ static int length_to_duration(struct taprio_sched *q, int len) return div_u64(len * atomic64_read(&q->picos_per_byte), PSEC_PER_NSEC); } +static int duration_to_length(struct taprio_sched *q, u64 duration) +{ + return div_u64(duration * PSEC_PER_NSEC, atomic64_read(&q->picos_per_byte)); +} + +/* Sets sched->max_sdu[] and sched->max_frm_len[] to the minimum between the + * q->max_sdu[] requested by the user and the max_sdu dynamically determined by + * the maximum open gate durations at the given link speed. + */ static void taprio_update_queue_max_sdu(struct taprio_sched *q, - struct sched_gate_list *sched) + struct sched_gate_list *sched, + struct qdisc_size_table *stab) { struct net_device *dev = qdisc_dev(q->root); int num_tc = netdev_get_num_tc(dev); + u32 max_sdu_from_user; + u32 max_sdu_dynamic; + u32 max_sdu; int tc; for (tc = 0; tc < num_tc; tc++) { - if (q->max_sdu[tc]) - sched->max_frm_len[tc] = q->max_sdu[tc] + dev->hard_header_len; - else + max_sdu_from_user = q->max_sdu[tc] ?: U32_MAX; + + /* TC gate never closes => keep the queueMaxSDU + * selected by the user + */ + if (sched->max_open_gate_duration[tc] == sched->cycle_time) { + max_sdu_dynamic = U32_MAX; + } else { + u32 max_frm_len; + + max_frm_len = duration_to_length(q, sched->max_open_gate_duration[tc]); + if (stab) + max_frm_len -= stab->szopts.overhead; + max_sdu_dynamic = max_frm_len - dev->hard_header_len; + } + + max_sdu = min(max_sdu_dynamic, max_sdu_from_user); + + if (max_sdu != U32_MAX) { + sched->max_frm_len[tc] = max_sdu + dev->hard_header_len; + sched->max_sdu[tc] = max_sdu; + } else { sched->max_frm_len[tc] = U32_MAX; /* never oversized */ + sched->max_sdu[tc] = 0; + } } } @@ -1243,6 +1278,8 @@ static int taprio_dev_notifier(struct notifier_block *nb, unsigned long event, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); + struct sched_gate_list *oper, *admin; + struct qdisc_size_table *stab; struct taprio_sched *q; ASSERT_RTNL(); @@ -1255,6 +1292,17 @@ static int taprio_dev_notifier(struct notifier_block *nb, unsigned long event, continue; taprio_set_picos_per_byte(dev, q); + + stab = rtnl_dereference(q->root->stab); + + oper = rtnl_dereference(q->oper_sched); + if (oper) + taprio_update_queue_max_sdu(q, oper, stab); + + admin = rtnl_dereference(q->admin_sched); + if (admin) + taprio_update_queue_max_sdu(q, admin, stab); + break; } @@ -1654,7 +1702,8 @@ static int taprio_parse_tc_entries(struct Qdisc *sch, if (nla_type(n) != TCA_TAPRIO_ATTR_TC_ENTRY) continue; - err = taprio_parse_tc_entry(sch, n, max_sdu, &seen_tcs, extack); + err = taprio_parse_tc_entry(sch, n, max_sdu, &seen_tcs, + extack); if (err) goto out; } @@ -1784,7 +1833,7 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, goto free_sched; taprio_set_picos_per_byte(dev, q); - taprio_update_queue_max_sdu(q, new_admin); + taprio_update_queue_max_sdu(q, new_admin, stab); if (mqprio) { err = netdev_set_num_tc(dev, mqprio->num_tc); @@ -2142,7 +2191,8 @@ static int dump_schedule(struct sk_buff *msg, return -1; } -static int taprio_dump_tc_entries(struct taprio_sched *q, struct sk_buff *skb) +static int taprio_dump_tc_entries(struct sk_buff *skb, + struct sched_gate_list *sched) { struct nlattr *n; int tc; @@ -2156,7 +2206,7 @@ static int taprio_dump_tc_entries(struct taprio_sched *q, struct sk_buff *skb) goto nla_put_failure; if (nla_put_u32(skb, TCA_TAPRIO_TC_ENTRY_MAX_SDU, - q->max_sdu[tc])) + sched->max_sdu[tc])) goto nla_put_failure; nla_nest_end(skb, n); @@ -2200,7 +2250,7 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb) nla_put_u32(skb, TCA_TAPRIO_ATTR_TXTIME_DELAY, q->txtime_delay)) goto options_error; - if (taprio_dump_tc_entries(q, skb)) + if (oper && taprio_dump_tc_entries(skb, oper)) goto options_error; if (oper && dump_schedule(skb, oper))