Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp674768rdb; Sat, 30 Sep 2023 23:57:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzW6OjcEL/nidknwGJd8eQ9+XLx2pSuENkivoJQo06mPFBof3T2oFIxtPqweCIURJwGmab X-Received: by 2002:a05:6e02:156b:b0:352:770d:cc23 with SMTP id k11-20020a056e02156b00b00352770dcc23mr3216798ilu.17.1696143427361; Sat, 30 Sep 2023 23:57:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696143427; cv=none; d=google.com; s=arc-20160816; b=oikBXuYgkVceHUGCvMp/3in6m7ZouWjR515cxFfIoTH+4c2J3Rz/SplIw6x7Bt++qs TaM3BtqJobkymHADLjRrqv+AC7J93A1zLMCT1d49Vlha7CnVp2GRkSmRJTtHpCaayKzR buxX8XGkxo5gRcpSK4Wh7DjC9jq7MCLwrpr+PC/7GAHhPs1v0l5/+IRyfcUEN9kpBpo6 y21q8lszVgOBGwsEzAk+v6PDInsxQP9T7OcXn/bPhi81Ug4jlZcIveLEiEToSPrxe2QT gkW1FsZ87lNFfoCoKNEKkZ07rxpttJx0Xo3qZh0l3iTPnl0QyUAoROucbf/Cd2TMVwJn 1nkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=O4PEcZaW/R0QcYiAWsaRuuTJ1ZzyRn33FfS/on1tPF4=; fh=seLZ+V92HPIiHT5t7l7Hjb1I8CYiNU/pmIdQgmamLi0=; b=elQ31LUzoA/HW1jB7DN6eMvpO17i7RbvvWtml9220EjWJD5EZhxQlgvy1gvJCoaSjI HJ2OGLzQ4Cirphcb0khnFLSCzjN/jEHAiTB0DhaZy5uEBpXloMWxQ/Op6hsVqB6TJfZu Oz9Wk6csRFZQM5klp5qUlHHbw8uiJjlFMcBymB7Zw3otSx4ePoM7K2JQyGW7RPOF0MMG Xx45n2TZaYNloJlllG0S9OtLNgnNNUhBW/gjK7FFDeAOImoHqDk1AQPTKQSYNry9FMHi P1mpd7bcY4Qe4W/UPTk+tUEQnfyRgZ3IEOSpc4AVYz7+xMZ2/GXlOrbim/Y+6xUG0R+b ZPSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mXGVdemo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id mh6-20020a17090b4ac600b002736ff3cc79si5641037pjb.23.2023.09.30.23.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 23:57:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mXGVdemo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0125B807D3CE; Sat, 30 Sep 2023 23:56:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234351AbjJAG4D (ORCPT + 99 others); Sun, 1 Oct 2023 02:56:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbjJAG4C (ORCPT ); Sun, 1 Oct 2023 02:56:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 014BFBE for ; Sat, 30 Sep 2023 23:55:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58091C433C8; Sun, 1 Oct 2023 06:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696143359; bh=WtOvsxSyDy2Ri8p3nkqCLB+0h+/ye1kzYWAJnyHQZSk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mXGVdemoffS93wZWKJg68itmONSyRSQsT/6WsnKBOQskhr8vhd2eRGGz723MNYiDb bJE6XVP7niuc0J0UbWMvsz0q2HwY5IODPQpvw0/qBG1XM9coRorAFcjaYIUPMxKbMk 3bYIo9N0N91JWMdeMMnbYit4M+PugaqDVYJ+3wT/o7X/7Ra4+WQiJ6AQ5ptxjPIBCr u1S73LcxVgJN9ymj0Cx6glmiSk8K/wZqCYVwmqAY1os0mcT+i42bvWOwYfAsrn3gzZ 2xfTOuMFoI445w08jDEtbBCaNVyZ3piMAaCjONhp0YFUMc8xh0dKNzYYtZSdkqG2DJ 6th0TmfGqRptA== Date: Sun, 1 Oct 2023 08:55:54 +0200 From: Simon Horman To: Roger Quadros Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, vladimir.oltean@nxp.com, s-vadapalli@ti.com, srk@ti.com, vigneshr@ti.com, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 net-next 2/4] net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode Message-ID: <20231001065554.GH92317@kernel.org> References: <20230927072741.21221-1-rogerq@kernel.org> <20230927072741.21221-3-rogerq@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230927072741.21221-3-rogerq@kernel.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 30 Sep 2023 23:56:19 -0700 (PDT) On Wed, Sep 27, 2023 at 10:27:39AM +0300, Roger Quadros wrote: ... > +static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data) > +{ > + struct am65_cpsw_port *port = am65_ndev_to_port(ndev); > + struct am65_cpsw_mqprio *p_mqprio = &port->qos.mqprio; > + struct tc_mqprio_qopt_offload *mqprio = type_data; > + struct am65_cpsw_common *common = port->common; > + struct tc_mqprio_qopt *qopt = &mqprio->qopt; > + int tc, offset, count, ret, prio; > + u8 num_tc = qopt->num_tc; > + u32 tx_prio_map = 0; > + int i; > + > + memcpy(&p_mqprio->mqprio_hw, mqprio, sizeof(*mqprio)); > + > + ret = pm_runtime_get_sync(common->dev); > + if (ret < 0) { > + pm_runtime_put_noidle(common->dev); > + return ret; > + } > + > + if (!num_tc) { > + am65_cpsw_reset_tc_mqprio(ndev); > + goto exit_put; > + } > + > + ret = am65_cpsw_mqprio_verify_shaper(port, mqprio); > + if (ret) > + goto exit_put; > + > + netdev_set_num_tc(ndev, num_tc); > + > + /* Multiple Linux priorities can map to a Traffic Class > + * A Traffic Class can have multiple contiguous Queues, > + * Queues get mapped to Channels (thread_id), > + * if not VLAN tagged, thread_id is used as packet_priority > + * if VLAN tagged. VLAN priority is used as packet_priorit Hi, I don't think it is worth respinning just because of this, but there seems to be a 'y' missing from the end of the line above. > + * packet_priority gets mapped to header_priority in p0_rx_pri_map, > + * header_priority gets mapped to switch_priority in pn_tx_pri_map. > + * As p0_rx_pri_map is left at defaults (0x76543210), we can > + * assume that Queue_n gets mapped to header_priority_n. We can then > + * set the switch priority in pn_tx_pri_map. > + */ ...