Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp185295rwb; Thu, 1 Dec 2022 00:29:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Py35/hlRjBLrQiMw3eSvc6jep/RQF5iKaVweGGHUdSD3TgvCc2Vi/xceXe9cvzb48lnzC X-Received: by 2002:a17:902:f641:b0:181:b25e:e7bc with SMTP id m1-20020a170902f64100b00181b25ee7bcmr47287494plg.46.1669883344678; Thu, 01 Dec 2022 00:29:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669883344; cv=none; d=google.com; s=arc-20160816; b=VeSSPx6lcFLv0f1io8xb0ZGGe2aKfpLCgENk+M82ni8oaZ8k7RTS022GrdxiGn/8Fb hmgFkdljqoo2QhAQKJ2qWQIgb3KfOZYSDxE4Wmey9Ne6zK+9eRfdaHLnk1CTFHhuE9RW NLnEes8WEmwtMdhnCyGw07gXy7/hjeUbtYsygHe7pNmZoPFbxRU7VS+D2JcnMdWFXfpO Nenr62YsX2B9/RoXQC3sGgGeVoeIr2PSGOKZNifN1iiAIrlMgwhp75gWiYEVH3dPdpRE jnHTzkGPYtRCr5Ad9uwwFwIRyljdIPvFxQVfz5qoODyagaq36c6HdTVg7AI6hZL9c64r 3eKQ== 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=MPkucWBhogscl9zWbIw6tHCv9NBDHzkjPzeEc9DlEPM=; b=HxleRqx3XSLfxLPp+ozRnUYI1VP7LyAKUGOkfzSUBSbiBlm31atopz3YbBxGuHzGIy IG0EMiez0OeR1xekms+I9Z5tVJq8kFM+uJLJU0y/Wflj2N5sOwmdjFrtRDaN7chxtOyE 7pUdfVQCxiEqBgpSHkGlpEwhFoRA46tznoR9N+DaBw9IFdLu2P8HwncA/XKro6R4ThFP HPPO7lXvO2CCFE2gl7eghLdflTU+tSDQMv2nXSHgHWkWoMYHcxT03kiOScEhhbq24vS7 wwIhi1m2EeMwPwhPeve/AmjI0NjA3ez8y2Nf+MWFJ68H8fuUigWDdjUXpV2F/CFBa8Gj h+fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=GSt+5Adn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a63d94e000000b00477d8b0351asi3716673pgj.261.2022.12.01.00.28.54; Thu, 01 Dec 2022 00:29:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=GSt+5Adn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbiLAIZ3 (ORCPT + 82 others); Thu, 1 Dec 2022 03:25:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiLAIZ0 (ORCPT ); Thu, 1 Dec 2022 03:25:26 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C76995E3EB for ; Thu, 1 Dec 2022 00:25:24 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id ja4-20020a05600c556400b003cf6e77f89cso2770464wmb.0 for ; Thu, 01 Dec 2022 00:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MPkucWBhogscl9zWbIw6tHCv9NBDHzkjPzeEc9DlEPM=; b=GSt+5Adn2ECyXk0aDLQgCLpIe4OEw/AFzkl1XbLYUxsA6oxiiY8fdPYeF9ZsXvj7Uc B+TGzqxLkX9jzb98073SXoOQx9wcfK/+MvEcFQkri9TYmGxWpV2bkLxNabgMYFnMEdbU HBbW4zZkcONX1DQl22e+WcbFGwSJxIYvv62QjWqibzTxElXT/p6u30C+tFzZm5XxUrr1 ipIKsaGCAr1XbAytG/c1EvUViT4ICf1j6MsJwkPgvrU9i5Wj5V4r/k1kbMMHcAt1hesg SoNfWXS/dT5UlWJekSWm7A4i4gysfF+WWUpBTqKelu9tSDWSyTbT1Pb8DFU8enbZpatr PzwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MPkucWBhogscl9zWbIw6tHCv9NBDHzkjPzeEc9DlEPM=; b=MpWF7BiXlYBaPjzREHmH/DVbNXMev8CzyF4v3jPlrY51Sc2zA3gKR53s9YYBpnHTzL Uifo1j1/691pjbX+JvpyXUu4/+cS74V3U8e0wzGlmHwOwC2xWEHWKObLUTNu9v/u1eby gSc8mLSgtOcFksjNd0z4sB7/J4pp5ubJfITD+UeZNZC/B0j8BNCAWo59anFGOapcHlbK r/OCpJ1OTJEZoTfclQLfl0YADmQmeBc1AQlB7RndJoqnRPUwGFrUUH2B7TeZZ8rqkMti 2e7pB/Meqdby+uvUlz6pShyvaRbwyQ99TYrQuBtWWglFoA7QHqEBNvrIjo4dZJ3Ujdza wQOg== X-Gm-Message-State: ANoB5pnSyyNvjSZj2cRzrZrLLJqCL/fAgjmtZhu5HcAUiV5MnXd73s9o hrkU4PHHWPpcOBguG63bnc4lHw== X-Received: by 2002:a05:600c:3110:b0:3cf:b07a:cd56 with SMTP id g16-20020a05600c311000b003cfb07acd56mr49133571wmo.143.1669883123387; Thu, 01 Dec 2022 00:25:23 -0800 (PST) Received: from blmsp ([185.238.219.127]) by smtp.gmail.com with ESMTPSA id l9-20020a05600c1d0900b003cf878c4468sm9433762wms.5.2022.12.01.00.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 00:25:22 -0800 (PST) Date: Thu, 1 Dec 2022 09:25:21 +0100 From: Markus Schneider-Pargmann To: Marc Kleine-Budde Cc: Chandrasekar Ramakrishnan , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/15] can: m_can: Use transmit event FIFO watermark level interrupt Message-ID: <20221201082521.3tqevaygz4nhw52u@blmsp> References: <20221116205308.2996556-1-msp@baylibre.com> <20221116205308.2996556-5-msp@baylibre.com> <20221130171715.nujptzwnut7silbm@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221130171715.nujptzwnut7silbm@pengutronix.de> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Hi Marc, Thanks for reviewing. On Wed, Nov 30, 2022 at 06:17:15PM +0100, Marc Kleine-Budde wrote: > On 16.11.2022 21:52:57, Markus Schneider-Pargmann wrote: > > Currently the only mode of operation is an interrupt for every transmit > > event. This is inefficient for peripheral chips. Use the transmit FIFO > > event watermark interrupt instead if the FIFO size is more than 2. Use > > FIFOsize - 1 for the watermark so the interrupt is triggered early > > enough to not stop transmitting. > > > > Note that if the number of transmits is less than the watermark level, > > the transmit events will not be processed until there is any other > > interrupt. This will only affect statistic counters. Also there is an > > interrupt every time the timestamp wraps around. > > > > Signed-off-by: Markus Schneider-Pargmann > > Please make this configurable with the ethtool TX IRQ coalescing > parameter. Please setup an hwtimer to enable the regular interrupt after > some configurable time to avoid starving of the TX complete events. I guess hwtimer==hrtimer? I thought about setting up a timer but decided against it as the TX completion events are only used to update statistics of the interface, as far as I can tell. I can implement a timer as well. For the upcoming receive side patch I already added a hrtimer. I may try to use the same timer for both directions as it is going to do the exact same thing in both cases (call the interrupt routine). Of course that depends on the details of the coalescing support. Any objections on that? > I've implemented this for the mcp251xfd driver, see: > > 656fc12ddaf8 ("can: mcp251xfd: add TX IRQ coalescing ethtool support") > 169d00a25658 ("can: mcp251xfd: add TX IRQ coalescing support") > 846990e0ed82 ("can: mcp251xfd: add RX IRQ coalescing ethtool support") > 60a848c50d2d ("can: mcp251xfd: add RX IRQ coalescing support") > 9263c2e92be9 ("can: mcp251xfd: ring: add support for runtime configurable RX/TX ring parameters") Thanks for the pointers. I will have a look and try to implement it similarly. Best, Markus