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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 D4CCAC433E0 for ; Fri, 29 Jan 2021 21:58:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BA6C64E0C for ; Fri, 29 Jan 2021 21:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233262AbhA2V5p (ORCPT ); Fri, 29 Jan 2021 16:57:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:55796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231335AbhA2V5o (ORCPT ); Fri, 29 Jan 2021 16:57:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 280F564E0C; Fri, 29 Jan 2021 21:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611957423; bh=JFXcp5hcRzeOdQmARynw+e5iZvxPrVy9IZ5Fz2O2o1Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UbcrEIAjID8butS8l1CXsVi68aW2+EnT/corLsU3SEhN5fYHWWB98OLBVyWkVJjIv sdD6D5KnoSxV1zOTx4LGfZt+6UijYId5QYHrjzVvG3nPW+xylFiYEJfXxQgqUtfxdX s1t1mra8GM3NVV8tCL0PlmCAoKvy6FzdhYkqtN92J8H5NoJEuSHobqUIzQc340gEBH CxtaXZW6ZdrW1rXfA2ZgAF/VpbHCbiJpIa+97G5AHMuFeLrkazvIgJo2vOPamUwjAM GOdVhH9uSKFtJfuAb/cgwkaDiINWlgrFKsv7ET467GbO2ggqmW3b9BBdIYqZzZgHvK Og/FsDcRQBTBw== Date: Fri, 29 Jan 2021 13:57:02 -0800 From: Jakub Kicinski To: Vinicius Costa Gomes Cc: Vladimir Oltean , "netdev@vger.kernel.org" , "jhs@mojatatu.com" , "xiyou.wangcong@gmail.com" , "jiri@resnulli.us" , "Jose.Abreu@synopsys.com" , Po Liu , "intel-wired-lan@lists.osuosl.org" , "anthony.l.nguyen@intel.com" , "mkubecek@suse.cz" Subject: Re: [PATCH net-next v3 2/8] taprio: Add support for frame preemption offload Message-ID: <20210129135702.0f8cf702@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <87wnvvsayz.fsf@vcostago-mobl2.amr.corp.intel.com> References: <20210122224453.4161729-1-vinicius.gomes@intel.com> <20210122224453.4161729-3-vinicius.gomes@intel.com> <20210126000924.jjkjruzmh5lgrkry@skbuf> <87wnvvsayz.fsf@vcostago-mobl2.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 29 Jan 2021 13:13:24 -0800 Vinicius Costa Gomes wrote: > Vladimir Oltean writes: > > > On Fri, Jan 22, 2021 at 02:44:47PM -0800, Vinicius Costa Gomes wrote: > >> + /* It's valid to enable frame preemption without any kind of > >> + * offloading being enabled, so keep it separated. > >> + */ > >> + if (tb[TCA_TAPRIO_ATTR_PREEMPT_TCS]) { > >> + u32 preempt = nla_get_u32(tb[TCA_TAPRIO_ATTR_PREEMPT_TCS]); > >> + struct tc_preempt_qopt_offload qopt = { }; > >> + > >> + if (preempt == U32_MAX) { > >> + NL_SET_ERR_MSG(extack, "At least one queue must be not be preemptible"); > >> + err = -EINVAL; > >> + goto free_sched; > >> + } > >> + > >> + qopt.preemptible_queues = tc_map_to_queue_mask(dev, preempt); > >> + > >> + err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_PREEMPT, > >> + &qopt); > >> + if (err) > >> + goto free_sched; > >> + > >> + q->preemptible_tcs = preempt; > >> + } > >> + > > > > First I'm interested in the means: why check for preempt == U32_MAX when > > you determine that all traffic classes are preemptible? What if less > > than 32 traffic classes are used by the netdev? The check will be > > bypassed, won't it? > > Good catch :-) > > I wanted to have this (at least one express queue) handled in a > centralized way, but perhaps this should be handled best per driver. Centralized is good. Much easier than reviewing N drivers to make sure they all behave the same, and right. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Date: Fri, 29 Jan 2021 13:57:02 -0800 Subject: [Intel-wired-lan] [PATCH net-next v3 2/8] taprio: Add support for frame preemption offload In-Reply-To: <87wnvvsayz.fsf@vcostago-mobl2.amr.corp.intel.com> References: <20210122224453.4161729-1-vinicius.gomes@intel.com> <20210122224453.4161729-3-vinicius.gomes@intel.com> <20210126000924.jjkjruzmh5lgrkry@skbuf> <87wnvvsayz.fsf@vcostago-mobl2.amr.corp.intel.com> Message-ID: <20210129135702.0f8cf702@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: On Fri, 29 Jan 2021 13:13:24 -0800 Vinicius Costa Gomes wrote: > Vladimir Oltean writes: > > > On Fri, Jan 22, 2021 at 02:44:47PM -0800, Vinicius Costa Gomes wrote: > >> + /* It's valid to enable frame preemption without any kind of > >> + * offloading being enabled, so keep it separated. > >> + */ > >> + if (tb[TCA_TAPRIO_ATTR_PREEMPT_TCS]) { > >> + u32 preempt = nla_get_u32(tb[TCA_TAPRIO_ATTR_PREEMPT_TCS]); > >> + struct tc_preempt_qopt_offload qopt = { }; > >> + > >> + if (preempt == U32_MAX) { > >> + NL_SET_ERR_MSG(extack, "At least one queue must be not be preemptible"); > >> + err = -EINVAL; > >> + goto free_sched; > >> + } > >> + > >> + qopt.preemptible_queues = tc_map_to_queue_mask(dev, preempt); > >> + > >> + err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_PREEMPT, > >> + &qopt); > >> + if (err) > >> + goto free_sched; > >> + > >> + q->preemptible_tcs = preempt; > >> + } > >> + > > > > First I'm interested in the means: why check for preempt == U32_MAX when > > you determine that all traffic classes are preemptible? What if less > > than 32 traffic classes are used by the netdev? The check will be > > bypassed, won't it? > > Good catch :-) > > I wanted to have this (at least one express queue) handled in a > centralized way, but perhaps this should be handled best per driver. Centralized is good. Much easier than reviewing N drivers to make sure they all behave the same, and right.