Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp300106rdf; Tue, 21 Nov 2023 03:12:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFiucbFI3Kc2BTlnyco4DYRL6oZOFRw8PI4NqK3oxl6jMNHkPzGgNpyhcj6JBC0EVh8aypU X-Received: by 2002:a05:6a00:80cd:b0:6cb:8c70:47c3 with SMTP id ei13-20020a056a0080cd00b006cb8c7047c3mr2873768pfb.0.1700565152591; Tue, 21 Nov 2023 03:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700565152; cv=none; d=google.com; s=arc-20160816; b=IPxkCFfMCOKCT81wpebDan6H4qw3VMyRLhogGzT+SV0gs2U+FKYPTJbnl5pv4dyBxk gvU1EUYvb8SHuTzrXUhVsmimX/WPcA/X/RFkcC6GLAiO3dmLbR45QijvkuG5Kpei/jgV YsMFFGo/n2Wgbr2I1N31Q1iy3JOcykHhhSTNjZjPWjlTtlpfDGFogxeduL6SwqPvelkX OV3QTu0ub5+lYC7qUR37JcLtuTCmJx1W81qjLWIpWyYAkjrwepXfrvgmnpuTl+/loOjv ijMkAj+rOoKTjLXq6wx5BTG7o156qWekA/G99iBpIYI8n/mEZSEA5hAdhlMi26UmEcwI iq6A== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=59/HAMtqBRO0K1/jHoho5fa+tP77cF5p2FLKdp8JHGk=; fh=qbM/lAEZP8KqDUA63FE4FuD+YJjNGVeGKVXy3Zs/0iY=; b=GNiS5roZ6q31Yx7K/I4HqwQqinlCeJuBc/O8Ibqw4Qo+F/qjkf92M1Yum9yxKuFNA4 Sw51O6W7Josi3vkeT5WiurOxUbhEDbaZDt2CRjKIMR9I6toy54W7FHfxSjMsDZDyJWNC 0Il2n/2vMAxsqc7g1GwDxZsSkaVJjBQD7Ngr6kWrEipVfWcyuzJ/hpnSBIw+YwuP2Dtq ZNi4jwUgQIYKRJkOgZ5N8CXGgWAlzjWEjMTqv88LsXtstNC5gLQ1zP/IYRLzGSejgivl nqMtJDcV8J36LEeMFIDprq1eoRkOlp+1pdNGfmmG034A0ak2/Jn/DEa9rY+d3weFKB88 OCXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dMXZumOZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id a190-20020a624dc7000000b0069343bdd500si9859561pfb.319.2023.11.21.03.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 03:12:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dMXZumOZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 9A58980BE60D; Tue, 21 Nov 2023 03:11:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231311AbjKULLN (ORCPT + 99 others); Tue, 21 Nov 2023 06:11:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230126AbjKULLN (ORCPT ); Tue, 21 Nov 2023 06:11:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7DE4CB for ; Tue, 21 Nov 2023 03:11:08 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38623C433C8; Tue, 21 Nov 2023 11:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700565068; bh=2GevDf923F/wmg4AP9lHNhi0wynht5ViVr+6FizelAI=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=dMXZumOZ21LOJQSoNWfD3ARHnJ0BIeFTbpHaK4LkDyOZQT8A0iCzzLkRw76I6P+9g o3FRcHZROQWT8Qdt0atYLyVbq5KfaPeNAXYwEQmu4FvHW5qXBq4eTdDdSWsomiio5x Xmlj3Xy8stT3OnnzbNN/eFGT7VJDuEFoV2Jtj9/y9rYKYzQfZA3l+1DE/6ZApa0Vu8 RGeiFn1yNbVjZ2/BX0au2m+5XnKiuBRCcGXTNDecH9U0V4uLZRUzHEy4GoS1xcuW5B hJWkj3MKowOKwZiX9rs49dZuDh59UxmCzxMjHhk5ADZ+dVzGVH2iUPYlr60xkOTro+ Ff/shOIvmgtYQ== Message-ID: <4f09985e-396b-42e9-b7a0-5f9db58e6131@kernel.org> Date: Tue, 21 Nov 2023 13:11:00 +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 From: Roger Quadros 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 21 Nov 2023 03:11:26 -0800 (PST) On 21/11/2023 11:23, Roger Quadros wrote: > > > 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. Now I recollect. You mentioned this in a different series review https://lore.kernel.org/all/20231011102536.r65xyzmh5kap2cf2@skbuf/ Since this patch is more trivial cleanups I will do the taprio_offload_get/free() change to a separate patch. > >> >>> + >>> +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