Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp252176rdf; Tue, 21 Nov 2023 01:24:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQ2NR/NxYE1+jyeE+rSEC05o0E4ax0QzuwL5Vvm/zi4iGO/s7M0f/9FFHyHC5cPlDDact7 X-Received: by 2002:a05:6a21:6d8a:b0:187:d380:fd98 with SMTP id wl10-20020a056a216d8a00b00187d380fd98mr8724168pzb.44.1700558647727; Tue, 21 Nov 2023 01:24:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700558647; cv=none; d=google.com; s=arc-20160816; b=s+OrHuHcszqbwWhzjhlmH3saqknMzDrZ664SDe1BDpJr+YhldBkc4mvAPmQSpo30Cz NpEkJK1HKw/kfqyXTfXwL3Z1oCn8RDr3U7U/uFTOY+B7rJw7Pwx31JNgSe0Msg+RJq1f wCMdbeSBvPjF+Rl9jdRYCNgMJQsoCXD4h9vwFmaZfnK1SdIGtagZFAQpyMCr/DMzuyMz wsnofDijELV4PpKvBDe9H1xvbh46Zn8kUTTo5abUFF+28caN2lp49MNdi03ZjpmFYKw3 XQR/do3ohqhBocERTF2Gg+Sn+BcNfcoXPQ/vt/qSIJ/4hcfxoKmn+Asy/sFmhWvoIOan TFow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=G2JrFF1W8RNnF+CfhObeSvgoZObFsNEJPwl4YTB+rPA=; fh=qbM/lAEZP8KqDUA63FE4FuD+YJjNGVeGKVXy3Zs/0iY=; b=NaMTDnwa1AMMPy9A5O4Kk+YUX3dEmU3Rl1w0xhTWCoX2KxzZC7qPZpj1UUbwwK0XjS +BVwLFMKNbqBeJ76tasBNo2S1nc4TnW5FO0bg5NcxKH/ulpJZHdIZhxfy7AAaozJz8+P R9PZRf9g12PAHWr26pO+KvwGcv7rFS5KgpVWAQPnNNVit/n6Esba9//Pb5IBvJXx2MPI 9MjwicPdyZTr720wpdkQx2r7RiLxSWWinwueOTCW0XlfuwZfIlobpu0k7MFcFvPilTMd kRsqAD4sj+XlriM8ag+dViBDO3+pb0z//LMOZcsXESfvedixPnZMtYMBjLRsbx7c/6Z4 45PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fxLhBpXi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m66-20020a625845000000b006cb4b976a21si7195265pfb.130.2023.11.21.01.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 01:24:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fxLhBpXi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 52D0380E7138; Tue, 21 Nov 2023 01:23:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233661AbjKUJXs (ORCPT + 99 others); Tue, 21 Nov 2023 04:23:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233230AbjKUJXZ (ORCPT ); Tue, 21 Nov 2023 04:23:25 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 199D3E8 for ; Tue, 21 Nov 2023 01:23:19 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB7CFC433C9; Tue, 21 Nov 2023 09:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700558598; bh=LMdfk9OuuUrVhkCelQp93adRK8Ub64vZWMipeZbN5dw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fxLhBpXiqgpBVfRHojxLFmti9lOIWtoD5uXuo0z+HmYTIIL347ryXSyqk4i6egSSW vHQzzrJLGwEBpXKbh03aqWXGH4CgIMYE5MOt8D/VxoX73cLOLpkts0QGr0xYKcAia4 Nc5jHC0erkSou6iMnuBnTnlGo42LxbGYDIuk2WyQYHgqhmtL1eAK16f9yGdLKZU3ac LnPGScOsgmBUec6hHJsEkh4iVnNOVd0mJOB9sRW82V6F0xORNRkOzqkMJihY8AqFt+ Q7Ny/vCrVcbzZ39kRPSKLzR7xOFX2f1wnQatL0GVuJMT6dnP3seOArxPTUb1lCR5So 1BrlR/KIIyLvg== Message-ID: Date: Tue, 21 Nov 2023 11:23:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 net-next 2/7] net: ethernet: am65-cpsw: cleanup TAPRIO handling Content-Language: en-US To: Vladimir Oltean Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, s-vadapalli@ti.com, r-gunasekaran@ti.com, vigneshr@ti.com, srk@ti.com, horms@kernel.org, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231120140147.78726-1-rogerq@kernel.org> <20231120140147.78726-1-rogerq@kernel.org> <20231120140147.78726-3-rogerq@kernel.org> <20231120140147.78726-3-rogerq@kernel.org> <20231120225648.pgvzd2jejg5jll2t@skbuf> From: Roger Quadros In-Reply-To: <20231120225648.pgvzd2jejg5jll2t@skbuf> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 01:23:58 -0800 (PST) On 21/11/2023 00:56, Vladimir Oltean wrote: > On Mon, Nov 20, 2023 at 04:01:42PM +0200, Roger Quadros wrote: >> -static int am65_cpsw_configure_taprio(struct net_device *ndev, >> - struct am65_cpsw_est *est_new) >> +static void am65_cpsw_cp_taprio(struct tc_taprio_qopt_offload *from, >> + struct tc_taprio_qopt_offload *to) >> +{ >> + int i; >> + >> + *to = *from; >> + for (i = 0; i < from->num_entries; i++) >> + to->entries[i] = from->entries[i]; >> +} > > I think I mentioned this before: have you looked at taprio_offload_get() > and taprio_offload_put()? I'm sorry that I missed this. I'll take a look. > >> + >> +static int am65_cpsw_taprio_replace(struct net_device *ndev, >> + struct tc_taprio_qopt_offload *taprio) >> { >> struct am65_cpsw_common *common = am65_ndev_to_common(ndev); >> + struct netlink_ext_ack *extack = taprio->mqprio.extack; >> + struct am65_cpsw_port *port = am65_ndev_to_port(ndev); >> struct am65_cpts *cpts = common->cpts; >> int ret = 0, tact = TACT_PROG; >> + struct am65_cpsw_est *est_new; >> >> - am65_cpsw_est_update_state(ndev); >> + if (!netif_running(ndev)) { >> + NL_SET_ERR_MSG_MOD(extack, "interface is down, link speed unknown\n"); > > The extack message doesn't need a \n. OK. > >> + return -ENETDOWN; >> + } >> >> - if (est_new->taprio.cmd == TAPRIO_CMD_DESTROY) { >> - am65_cpsw_stop_est(ndev); >> - return ret; >> + if (common->pf_p0_rx_ptype_rrobin) { >> + NL_SET_ERR_MSG_MOD(extack, >> + "p0-rx-ptype-rrobin flag conflicts with taprio qdisc\n"); > > Also here. > >> + return -EINVAL; >> + } >> + >> + if (port->qos.link_speed == SPEED_UNKNOWN) >> + return -ENOLINK; >> + >> + if (taprio->cycle_time_extension) { >> + NL_SET_ERR_MSG_MOD(extack, >> + "cycle time extension not supported"); > > Here it's ok. > >> + return -EOPNOTSUPP; >> } Thanks for the detailed review! -- cheers, -roger