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=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 51DB6C2D0DB for ; Fri, 31 Jan 2020 15:24:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12BE620707 for ; Fri, 31 Jan 2020 15:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580484296; bh=6eUfGgz3kBEIseVijgM/54BogfoQn6rLjOMr0aFBNS4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=V9E7X9o4afnNer1mtZUDCHVdfBa8keDkzXoUsZNEmIzemVEuhyizP/ekjupYSbRCw PyrvR6yNCwED1G+aBXb8MxYUf8qr+bbhVnl5BIxV/2TIm4146HGO+Tvx0uceNbUhYd T0akb+75PhYtc46bEd9FaqHrmuld6x6w3YixzhEw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728996AbgAaPYz (ORCPT ); Fri, 31 Jan 2020 10:24:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:36772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728839AbgAaPYz (ORCPT ); Fri, 31 Jan 2020 10:24:55 -0500 Received: from cakuba.hsd1.ca.comcast.net (unknown [199.201.64.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2FAF3206D5; Fri, 31 Jan 2020 15:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580484294; bh=6eUfGgz3kBEIseVijgM/54BogfoQn6rLjOMr0aFBNS4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BJ0IZAnpiNXUyO3b5AiQ0cLwWIKDijZXcmZZItkasz9i4p7L8HgVbG2PftuoKzabo l/923c5NGap4iKOx+Lx4rISD87YCnY+rgCRm0MX6lJznbhBm5MfJcFoXC287RZY/T1 epoYGnK5kvY1FQYQfqAhi78TLihUqfKmGtcww9SQ= Date: Fri, 31 Jan 2020 07:24:53 -0800 From: Jakub Kicinski To: Vinicius Costa Gomes Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, vladimir.oltean@nxp.com, po.liu@nxp.com Subject: Re: [PATCH net v3 1/2] taprio: Fix enabling offload with wrong number of traffic classes Message-ID: <20200131072453.454930eb@cakuba.hsd1.ca.comcast.net> In-Reply-To: <20200130013721.33812-2-vinicius.gomes@intel.com> References: <20200130013721.33812-1-vinicius.gomes@intel.com> <20200130013721.33812-2-vinicius.gomes@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 29 Jan 2020 17:37:20 -0800, Vinicius Costa Gomes wrote: > If the driver implementing taprio offloading depends on the value of > the network device number of traffic classes (dev->num_tc) for > whatever reason, it was going to receive the value zero. The value was > only set after the offloading function is called. > > So, moving setting the number of traffic classes to before the > offloading function is called fixes this issue. This is safe because > this only happens when taprio is instantiated (we don't allow this > configuration to be changed without first removing taprio). > > Fixes: 9c66d1564676 ("taprio: Add support for hardware offloading") > Reported-by: Po Liu > Signed-off-by: Vinicius Costa Gomes > Acked-by: Vladimir Oltean What about Dave's question about resetting the tc state with netdev_reset_tc()?