Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1761784rwb; Fri, 7 Oct 2022 18:39:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6b+FyoZXXm8QArwemp7f5QaVf0G9/irpLB1Z/norb6JDQdkn4i3Aj5KsafvNutXe4TbVFG X-Received: by 2002:a05:6402:278e:b0:45a:35dc:ebc8 with SMTP id b14-20020a056402278e00b0045a35dcebc8mr3962205ede.314.1665193185500; Fri, 07 Oct 2022 18:39:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665193185; cv=none; d=google.com; s=arc-20160816; b=AzAxasCb4lAd2TBe9YCC2I873avuruETQ0N5QSvBbHfd+F5KrJqSspVHU4sOsPmO4j K7w0ToWWxlTPV5ni6kgc9MurRu+RNI7WC8Uw+O3WF8xMlH8xNn0AOW199Cr0IUnRkV21 pqtGKWao36SYzj1Gnygeqii3uz8UwRH0/OjGiUjNs9H9ki0kGTCKvZvwzQOTylBPkMr7 OsT2dLAvbNSyWUDfkaK/wxPgWk5+bvogXzU3lnSHXseRFKJvZ0S5AzJanfZXxDEWbHok QHdjYGYcioJEQ5b0bm8aXGiRW/8FTZgl427p3LabeJRNANHSUoSIzoD/fijQ2+z0R9u1 LiRA== 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:date:subject:cc:to:from; bh=bFjqKDyVQrp2+pGF42I6eafV1B4+VdaxzL0A4Uj0fRc=; b=LHlOhh+ogp6NjBHtnDr36hUFK2NbBdcpRvQI1nExqizCWoYBzmSLXKxov6vWDmUwli DBUquytBgFTUvC60KspZtaEisu5GEDTdYgKTW6OQTM9mM6g/WgaVEv1ngrKVJ1N/hqen Owrs6dWs72eQiqJ/BMqP1wXjdrCgfwQjV6G+h37YgAzfKmEnHv040IUaC0GaWjx6rbu0 4N3jnjupCx4gHmGqhKujpHk9yM2S1F4LN1aqA8iktTdavhInFEkuxE8sGSevzUpWIenR QYsxRBwSeIpBt3YTBEHegnSW+ma+Iw1IynWhSwuFYf3jCRt5Fz1mi9v7kda6Y/T80mEI +PtQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a056402084900b0045902320417si4108799edz.301.2022.10.07.18.39.19; Fri, 07 Oct 2022 18:39:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229802AbiJHA5b (ORCPT + 99 others); Fri, 7 Oct 2022 20:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbiJHA5U (ORCPT ); Fri, 7 Oct 2022 20:57:20 -0400 Received: from mailgw.kylinos.cn (unknown [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62EE9115C30; Fri, 7 Oct 2022 17:57:08 -0700 (PDT) X-UUID: 0d9e3e8811a04a70a29cfea6c2e2a9b7-20221001 X-Spam-Fingerprint: 0 X-GW-Reason: 13103 X-Policy-Incident: 5pS25Lu25Lq66LaF6L+HMTDkurrpnIDopoHlrqHmoLg= X-Content-Feature: ica/max.line-size 85 audit/email.address 1 dict/adv 1 meta/cnt.alert 1 X-CPASD-INFO: 1e20c725380d435e9b373a7bdd53d4ae@erVsUJBpYGVfWHKwg3aAn1mTY2djjVe xpp5Va5JkjYWVhH5xTV5uYFV9fWtVYV9dYVR6eGxQYmBgZFJ4i3-XblBoXoZgUZB3gKdsUJtlYg== X-CLOUD-ID: 1e20c725380d435e9b373a7bdd53d4ae X-CPASD-SUMMARY: SIP:-1,APTIP:-2.0,KEY:0.0,FROMBLOCK:1,OB:8.0,URL:-5,TVAL:169. 0,ESV:0.0,ECOM:-5.0,ML:0.0,FD:0.0,CUTS:165.0,IP:-2.0,MAL:-5.0,PHF:-5.0,PHC:-5 .0,SPF:4.0,EDMS:-5,IPLABEL:-2.0,FROMTO:0,AD:0,FFOB:8.0,CFOB:8.0,SPC:0,SIG:-5, AUF:28,DUF:6131,ACD:97,DCD:97,SL:0,EISP:0,AG:0,CFC:0.427,CFSR:0.076,UAT:0,RAF :0,IMG:-5.0,DFA:0,DTA:0,IBL:-2.0,ADI:-5,SBL:0,REDM:0,REIP:0,ESB:0,ATTNUM:0,EA F:0,CID:-5.0,VERSION:2.3.17 X-CPASD-ID: 0d9e3e8811a04a70a29cfea6c2e2a9b7-20221001 X-CPASD-BLOCK: 1000 X-CPASD-STAGE: 1 X-UUID: 0d9e3e8811a04a70a29cfea6c2e2a9b7-20221001 X-User: jianghaoran@kylinos.cn Received: from localhost.localdomain [(183.242.54.212)] by mailgw (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 128/128) with ESMTP id 805110296; Sat, 01 Oct 2022 16:33:42 +0800 From: jianghaoran To: linux-kernel@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, jhs@mojatatu.com, jiri@resnulli.us, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, vinicius.gomes@intel.com, xiyou.wangcong@gmail.com, vladimir.oltean@nxp.com Subject: [PATCH V2] taprio: Set the value of picos_per_byte before fill sched_entry Date: Sat, 1 Oct 2022 16:29:09 +0800 Message-Id: <20221001082909.486567-1-jianghaoran@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220928065830.1544954-1-jianghaoran@kylinos.cn> References: <20220928065830.1544954-1-jianghaoran@kylinos.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,T_SPF_PERMERROR, UNPARSEABLE_RELAY autolearn=no 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 If the value of picos_per_byte is set after fill sched_entry, as a result, the min_duration calculated by length_to_duration is 0, and the validity of the input interval cannot be judged, too small intervals couldn't allow any packet to be transmitted. It will appear like commit b5b73b26b3ca ("taprio: Fix allowing too small intervals") described problem. Here is a further modification of this problem. example configuration which will not be able to transmit: tc qdisc replace dev enp5s0f0 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 \ base-time 1528743495910289987 \ sched-entry S 01 9 \ sched-entry S 02 9 \ sched-entry S 04 9 \ clockid CLOCK_TAI Fixes: b5b73b26b3ca ("taprio: Fix allowing too small intervals") Signed-off-by: jianghaoran --- v2: 1,Add an explanation of what this is an example. 2,add a Fixes tag pointing to the first commit where the issue was presen. --- net/sched/sch_taprio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 86675a79da1e..d95ec2250f24 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -1507,6 +1507,8 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, goto free_sched; } + taprio_set_picos_per_byte(dev, q); + err = parse_taprio_schedule(q, tb, new_admin, extack); if (err < 0) goto free_sched; @@ -1521,8 +1523,6 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, if (err < 0) goto free_sched; - taprio_set_picos_per_byte(dev, q); - if (mqprio) { err = netdev_set_num_tc(dev, mqprio->num_tc); if (err) -- 2.25.1