Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1766420rwb; Fri, 7 Oct 2022 18:46:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5c2GkYcMvLf9ViXUWd0iTAcVQI7iv2nmJgITcgaNMJpki7A27qTyoyk06k490fGQQ5TiuP X-Received: by 2002:a17:906:9753:b0:787:8e6a:103c with SMTP id o19-20020a170906975300b007878e6a103cmr6370928ejy.337.1665193559942; Fri, 07 Oct 2022 18:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665193559; cv=none; d=google.com; s=arc-20160816; b=D/oFjjwAwW1uFhabYKGKWMBMmm08gJJt9GKZGJhBMEgZ3dIWKJGeSAZOgr9TcMEcr9 OhfjooPOCbRLMxfSRINUaBUtmCdMRtPrREyO68Yf0myFjJuuWEpY9z4mbmnXuqGgbWSP r+AWLpNhURmB2frydW0RCuya1tZ2QTQIRt9XCkRfW31oxD7duPPETpa5HLWlSTtdJy65 HUHqLZbtaIKfDtzlO1lhjf3H/dhHlUkvbkqTnCVC+8VQh4SL6i/dt1QyJAFu1xtfJI1r 25KNKcRmM3/KUcdH77/AXe249xweY8qkAFtQBziw1p/d6lUH+0EupyiDmz8Z8DTnL2N0 J22A== 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=SZ4y76JYWFuQM4z++KrjMmHrSXutJY3fFeDOUsuBEYpA/yY1yJPAoWJamilpX9EAQG tXuaCiWewnTOQPxydslkbWV7kjwtt1y8m9edHKepFP8fmUNRZxvNdAFMCdpOXP+EigPg fqSyjJE7SFu03hk8WwD9dBZah5sNSCcDxyQGwOQ5pSA3debHdjyMngQI4ljbYiti5EsS kAPMXPbNpxm4MUa5kmPZHDkNGmhKTnhkUrDgHf4qwS1jGS04yMR8qh8FecFCbPSAIaZE U4p/vx0EaXLe1ts40ozZ0vltSuECbTjCHkohrwI3Mt9W93gGZsUpRZbuaCXhmeCH8TWI zeig== 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 xg11-20020a170907320b00b0077f4fcfe49csi3393580ejb.905.2022.10.07.18.45.21; Fri, 07 Oct 2022 18:45:59 -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 S229816AbiJHA5h (ORCPT + 99 others); Fri, 7 Oct 2022 20:57:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbiJHA5U (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 7E6D2125858; Fri, 7 Oct 2022 17:57:09 -0700 (PDT) X-UUID: fe8c2c4b80e74fd98e579588e1c09b39-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: f5736cd0f30642d4ba2a96f8f9695e82@r4VxU2OVkmCSU3KCg3WvboKSYpFpYoa HqHNWamOVZFKVhH5xTV5uYFV9fWtVYV9dYVR6eGxQYmBgZFJ4i3-XblBhXoZgUZB3tXdxU2eRlA== X-CLOUD-ID: f5736cd0f30642d4ba2a96f8f9695e82 X-CPASD-SUMMARY: SIP:-1,APTIP:-2.0,KEY:0.0,FROMBLOCK:1,OB:1.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:1,AD:0,FFOB:1.0,CFOB:1.0,SPC:0,SIG:-5, AUF:23,DUF:6126,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: fe8c2c4b80e74fd98e579588e1c09b39-20221001 X-CPASD-BLOCK: 1000 X-CPASD-STAGE: 1 X-UUID: fe8c2c4b80e74fd98e579588e1c09b39-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 1005103208; Sat, 01 Oct 2022 15:55:44 +0800 From: jianghaoran To: jianghaoran@kylinos.cn Cc: davem@davemloft.net, edumazet@google.com, jhs@mojatatu.com, jiri@resnulli.us, kuba@kernel.org, linux-kernel@vger.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 15:51:11 +0800 Message-Id: <20221001075111.449321-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