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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 4C5D3C433DF for ; Mon, 24 Aug 2020 23:45:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 306352078D for ; Mon, 24 Aug 2020 23:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726347AbgHXXpv (ORCPT ); Mon, 24 Aug 2020 19:45:51 -0400 Received: from mga01.intel.com ([192.55.52.88]:25938 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgHXXpv (ORCPT ); Mon, 24 Aug 2020 19:45:51 -0400 IronPort-SDR: MnPFUZ9zphnoD5OzHv77TpwYAtjedI2cJeSjSBv7xwSjnePdIzvdI2BAREveA6WMcUcGEie10P uXCTVTAC3w1w== X-IronPort-AV: E=McAfee;i="6000,8403,9723"; a="174049287" X-IronPort-AV: E=Sophos;i="5.76,350,1592895600"; d="scan'208";a="174049287" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 16:45:51 -0700 IronPort-SDR: NmAvFCg1vOBHJONklwmSRgHRYXt9YkPchvshhxW0Xm1pvwF9TH6gUmOnOIjLHwf9OWm/gzK1Qw +NyMvvY2c/PA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,350,1592895600"; d="scan'208";a="499099888" Received: from unknown (HELO ellie) ([10.254.31.141]) by fmsmga006.fm.intel.com with ESMTP; 24 Aug 2020 16:45:50 -0700 From: Vinicius Costa Gomes To: Kurt Kanzenbach , Vladimir Oltean Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, Sebastian Andrzej Siewior , Richard Cochran , Kamil Alkhouri , ilias.apalodimas@linaro.org Subject: Re: [PATCH v3 5/8] net: dsa: hellcreek: Add TAPRIO offloading support In-Reply-To: <87imd8zi8z.fsf@kurt> References: <20200820081118.10105-1-kurt@linutronix.de> <20200820081118.10105-6-kurt@linutronix.de> <20200822143922.frjtog4mcyaegtyg@skbuf> <87imd8zi8z.fsf@kurt> Date: Mon, 24 Aug 2020 16:45:50 -0700 Message-ID: <87y2m3txox.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Kurt, Kurt Kanzenbach writes: >>> +static void hellcreek_setup_tc_mapping(struct hellcreek *hellcreek, >>> + struct net_device *netdev) >>> +{ >>> + int i, j; >>> + >>> + /* Setup mapping between traffic classes and port queues. */ >>> + for (i = 0; i < netdev_get_num_tc(netdev); ++i) { >>> + for (j = 0; j < netdev->tc_to_txq[i].count; ++j) { >>> + const int queue = j + netdev->tc_to_txq[i].offset; >>> + >>> + hellcreek_select_prio(hellcreek, i); >>> + hellcreek_write(hellcreek, >>> + queue << HR_PRTCCFG_PCP_TC_MAP_SHIFT, >>> + HR_PRTCCFG); >>> + } >>> + } >>> +} >> >> What other driver have you seen that does this? >> > > Probably none. > > With TAPRIO traffic classes and the mapping to queues can be > configured. The switch can also map traffic classes. That sounded like a > good match to me. The only reason I could think that you would need this that *right now* taprio has pretty glaring oversight: that in the offload parameters each entry 'gate_mask' reference the "Traffic Class" (i.e. bit 0 is Traffic Class 0), and it really should be the HW queue. I have a patch that does the conversion on taprio before talking to the driver. Do you think it would help you avoid doing this on the driver side? > > Thanks, > Kurt Cheers, -- Vinicius