Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5010193ybc; Fri, 15 Nov 2019 13:22:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwEVvQhXIw3zpvGXhITlopISF+WLWK5WtzPvNAnC5Q4NTVtn1uzOT/m4n8pqHRyZdCubvbd X-Received: by 2002:a17:906:bfe3:: with SMTP id vr3mr3851208ejb.273.1573852952834; Fri, 15 Nov 2019 13:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573852952; cv=none; d=google.com; s=arc-20160816; b=ZzVF253HDWpksVOP2v1J+7fuLIxLI2B/yOhaTb7caFqlRDQshhp+seB0erHf+vghzb VUhHAdyd2kWVn7bcHpXyv/uZFm5lb8BfbetfrbuPdWOOO1v8cN1oPkPEikfNoyLXxOen Kmvf3EZjyDcNpXq6eX2/5JBgplahb/e3SMT/yLsVzEQdo/bdNfyeTW+vfk+XvPDnZJbp fi895VXfJ+I5VscpqvYVk6GsfMV6hvxWtSnPZdvImxOHaMsUhb/beg5I3Ea4uwpYQpAF DLNzYsBrzeZPSuxUQ41e3iPgTSer0laO6Zi54mgUnzd+2j3xr2SMrH3lNHXfLIMf5+70 iFiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=Ow+kgM/O1qMJAd0u4w5CTbSZzz7StLNhey5xHZWph+0=; b=gl/36moulBmBFnXOy6lCVY+guxgZ+0QmLpPU9NrGz3e+UR6kwtJ3dTf3zmacmlcS6D sy9dRdih1HSPjTp0knDwZd36pwD8wUfPKWvf1mnLIjeusMbHd8MgQXz1JtIAMPiNtzdL wgL4FY4TB5NFz2vEaY2Yb/t1j1u7KNysAL7ISirDAoTN89+QOaWCgPg/Gf3RyDOWm0pu gQ172mpFzJyPP/b68Rvq6pQRdcrEW6wSQZm0AJCd/njijFTtPWxDqIR+FZlInA3TIkj1 LEg1CMU53h2vOVyhuhaYb70l/zxYg0Yjh5kLu+VbWkr5SV/JOQbijp82u9EoeH74TZHZ f6AQ== 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 v6si6643091ejj.375.2019.11.15.13.22.07; Fri, 15 Nov 2019 13:22:32 -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 S1726983AbfKOVU7 (ORCPT + 99 others); Fri, 15 Nov 2019 16:20:59 -0500 Received: from mga02.intel.com ([134.134.136.20]:49920 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbfKOVU7 (ORCPT ); Fri, 15 Nov 2019 16:20:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2019 13:20:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,309,1569308400"; d="scan'208";a="406794692" Received: from vcostago-desk1.jf.intel.com (HELO vcostago-desk1) ([10.54.70.26]) by fmsmga006.fm.intel.com with ESMTP; 15 Nov 2019 13:20:58 -0800 From: Vinicius Costa Gomes To: Ivan Khoronzhuk , netdev@vger.kernel.org, davem@davemloft.net Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: Re: [net-next PATCH] taprio: don't reject same mqprio settings In-Reply-To: <20191115015607.11291-1-ivan.khoronzhuk@linaro.org> References: <20191115015607.11291-1-ivan.khoronzhuk@linaro.org> Date: Fri, 15 Nov 2019 13:21:02 -0800 Message-ID: <87mucwhm4h.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ivan Khoronzhuk writes: > The taprio qdisc allows to set mqprio setting but only once. In case > if mqprio settings are provided next time the error is returned as > it's not allowed to change traffic class mapping in-flignt and that > is normal. But if configuration is absolutely the same - no need to > return error. It allows to provide same command couple times, > changing only base time for instance, or changing only scheds maps, > but leaving mqprio setting w/o modification. It more corresponds the > message: "Changing the traffic mapping of a running schedule is not > supported", so reject mqprio if it's really changed. > > Signed-off-by: Ivan Khoronzhuk > --- > net/sched/sch_taprio.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c > index 7cd68628c637..bd844f2cbf7a 100644 > --- a/net/sched/sch_taprio.c > +++ b/net/sched/sch_taprio.c > @@ -1347,6 +1347,26 @@ static int taprio_parse_clockid(struct Qdisc *sch, struct nlattr **tb, > return err; > } > > +static int taprio_mqprio_cmp(struct net_device *dev, > + struct tc_mqprio_qopt *mqprio) Nitpick: for these kinds of functions I like to add a 'const' to the parameters at least as documentation that it doesn't modify its arguments. > +{ > + int i; > + > + if (mqprio->num_tc != dev->num_tc) > + return -1; Optional: you could move the check for a NULL mqprio inside this function. Perhaps, for that to make sense you would need to change the function name to taprio_mqprio_check() or something. These are all optional. Acked-by: Vinicius Costa Gomes