Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp318681rdf; Tue, 21 Nov 2023 03:49:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGu2xO3aYu/lS4bK3N1WZeVIfHzhe0hBEP2tZM4ZUeSczOPaLyoLGPi4OoZ5R7EFGB1wsQW X-Received: by 2002:a17:902:ee95:b0:1cc:7100:2d62 with SMTP id a21-20020a170902ee9500b001cc71002d62mr8763571pld.39.1700567347211; Tue, 21 Nov 2023 03:49:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700567347; cv=none; d=google.com; s=arc-20160816; b=cMlT0jaqRQ7YEaZDhGgE6o4Pj2G5N9pqRFzb4MGe32GeZNxX3eNrK+KUHZZrYmDavT xvSVq91NSvUMIC6xeyCRiwVQohbQkRLcj6x6V2pCMV9Hg2gnOOIswDIriSLtrTU43Gfl ozx8K47HuSnKuCP2JGLISe/E7gSwWcma3UqovMpuChkUvmmS9r31YGq69qFbMuxpWa1G eAjhXbk2VPVeH9WKfmo7D6H7Eul82A8UI/dYgZj9rkH0TOpakku24Zl5RnuNajgRMPJ5 PVbJwfUETtdo240scCjSJzvbkGc9mBtMKvkVQyR88lkwdhWN22aGARPeP0kIw8XdVbd1 jkHg== 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=OqwW+nN9jCnLXNLpNk0WSq6FGv6ylnmnIVDHizsPBaM=; fh=qbM/lAEZP8KqDUA63FE4FuD+YJjNGVeGKVXy3Zs/0iY=; b=HjMNhdVDTBxzsedfybLnesopK/c89agdEqJXUOcCXZfHJ/XDDh6gribxzDfvKlhGf3 0J4c2BC13CB7/isKa2KDfm/ZzRFuZoZLly+ieImjjnScfd22nF11ErvC6AzSMZBPWix7 Z55pZfBzeV0a+Rw+DrguX0WDIEqQ17H1Gxt9q75Xgt/upji3iKgsj2Uae8ZuqF8uUUIQ eGlKXBCaAhyHmaicQH1NARj41tnJXsJGMeGudpdTI2ShCCvYJrLI+lBfmk3Keb824b5Y SIpxpt4qYzMazB0UNmm1LGGySd7hVVzFQ+Wh/XzLAQF8Nve3vCNwKhTSsYvWFvoThJp/ nuew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lQls28AR; 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 q8-20020a170902dac800b001cf5cc12c86si4917904plx.246.2023.11.21.03.49.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 03:49:07 -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=lQls28AR; 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 97BAA80C8412; Tue, 21 Nov 2023 03:49:04 -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 S233592AbjKULs6 (ORCPT + 99 others); Tue, 21 Nov 2023 06:48:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbjKULs5 (ORCPT ); Tue, 21 Nov 2023 06:48:57 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2044E9C for ; Tue, 21 Nov 2023 03:48:54 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E1DFC433C8; Tue, 21 Nov 2023 11:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700567333; bh=LVOxFSwAPN+ofpreb4kzEhImD73DSJhJl3zz/ic5nw4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lQls28AR1h7JUm8TIDaywL6CC3RMHJEXkRbvGqRGHcGH18xd0acGMqGy7yrDFKXhT qPUPJHmGBbbn8r0OBxWI2Hj//XiFKkY6z8ueHVK58DLRuoHdrquhPuyab4LkUNbjHB +8t1z11CRJanX2MjHieo50vG1AAroZCkjuazWRPBvxfnzrBxLyZI9BTfrYsYzzyLrJ cuYXItjv4Q1r9xLEwvCJdFanF7KibWcM4c1VYk+OSc6SjrpKdX4vTfRzt2d2/2mFJl vkveQVD/2LrZR8+ItiygPDJ4N/zGibFecndoWPUMzVD1g9Pnv54iuPHk7no0PB9wBv nMLkd9IMKxEpg== Message-ID: <93e0ef82-ab79-4f46-8f39-5f91f4e8ca89@kernel.org> Date: Tue, 21 Nov 2023 13:48:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support 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-7-rogerq@kernel.org> <20231120232620.uciap4bazypzlg3g@skbuf> From: Roger Quadros In-Reply-To: <20231120232620.uciap4bazypzlg3g@skbuf> 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:49:04 -0800 (PST) On 21/11/2023 01:26, Vladimir Oltean wrote: > On Mon, Nov 20, 2023 at 04:01:46PM +0200, Roger Quadros wrote: >> Changelog: >> >> v6: >> - get mutex around am65_cpsw_iet_commit_preemptible_tcs() in >> am65_cpsw_iet_change_preemptible_tcs() >> - use "preemption" instead of "pre-emption" >> - call am65_cpsw_setup_mqprio() from within am65_cpsw_setup_taprio() >> - Now works with kselftest except the last test which fails >> >> diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c >> index 60f625e1350b..8443c13c9ff6 100644 >> --- a/drivers/net/ethernet/ti/am65-cpsw-qos.c >> +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c >> @@ -4,9 +4,11 @@ >> * >> * quality of service module includes: >> * Enhanced Scheduler Traffic (EST - P802.1Qbv/D2.2) >> + * Interspersed Express Traffic (IET - P802.3br/D2.0) >> */ >> >> #include >> +#include > > If this was ordered alphabetically, u comes after t. > >> #include >> #include >> >> @@ -259,6 +266,196 @@ static int am65_cpsw_setup_mqprio(struct net_device *ndev, void *type_data) >> return ret; >> } >> >> +static int am65_cpsw_iet_set_verify_timeout_count(struct am65_cpsw_port *port) >> +{ >> + int verify_time_ms = port->qos.iet.verify_time_ms; >> + int link_speed = port->qos.link_speed; >> + u32 val; >> + >> + if (WARN_ON(link_speed == SPEED_UNKNOWN)) >> + return -ENODEV; >> + >> + /* The number of wireside clocks contained in the verify >> + * timeout counter. The default is 0x1312d0 >> + * (10ms at 125Mhz in 1G mode). >> + */ >> + val = 125 * HZ_PER_MHZ; /* assuming 125MHz wireside clock */ >> + >> + val /= MILLIHZ_PER_HZ; /* count per ms timeout */ >> + val *= verify_time_ms; /* count for timeout ms */ >> + if (link_speed < SPEED_1000) >> + val <<= 1; /* FIXME: Is this correct? */ > > Is there any way to find out and remove the FIXME? Like running the > selftest at SPEED_100? I checked at SPEED_100 without the above if condition and it works so I'll drop it in next revision. > >> + >> + if (val > AM65_CPSW_PN_MAC_VERIFY_CNT_MASK) >> + return -EINVAL; >> + >> + writel(val, port->port_base + AM65_CPSW_PN_REG_IET_VERIFY); >> + >> + return 0; >> +} >> + -- cheers, -roger