Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp191531rdh; Wed, 7 Feb 2024 01:39:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0TxRMksbYGel2+D0zdkiB2xX9vF0gxkCBQez9Yo/4VY2NYamE06yf2Aw5PlwGDuy5FKp/ X-Received: by 2002:a05:622a:1891:b0:42c:4395:f9e0 with SMTP id v17-20020a05622a189100b0042c4395f9e0mr517313qtc.8.1707298770456; Wed, 07 Feb 2024 01:39:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707298770; cv=pass; d=google.com; s=arc-20160816; b=onpRY49YCIMw4QiTsGbNh2BTijvjLlM3ClpwgcDYqQ2YOW9Fk5B2KJVCYfBJhuC9ri lof+hrZD2ORci9gH8zX+wfHZ1GopTyxAct2UiOfqt1FH5ah92U8ZKwmgWfhx+/BbC2UT B5wiX5C/L7cfOV9GR4DexmI+46RtkKNtmVXPwQx67JNRDMO3/63Hu31C2nhQKNUpOc1A Qjm8J1O0Vbex1KdeP5Czjup4pf2wYzKzZUyRaXqkusu4o7m6KeWZZcqn6yGIK7oBezhy S+FB0jTarFmYg5aKHKDdkQZyjwR0QYwBntgfZo8bq+iq/0bYlsmig/hrbSYZDCzPXIon gFow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5lVUQ+esox3+YZ4FAL/zC0DsXpMXIO/eYNjqHysD3mw=; fh=vKWMth8W19rsph4snNI+HbAyQfhN9/nZARvgym9OB6c=; b=LlnUA7evuhYR54ExeEoillNU+8TAKCgLzAKJqOxLniGrg7Q2xHO8SofB/EwZ2lrYEE CZ2rrxzXt0DSk2cCI+yym883wB1karm7KWnFEoxchUbRXiNI992hrkjDagWqeXUiEIF5 CLygzWpKYtjyUi1XwTZkvWfwm9WXiO+Od2eDoAoFFPUN2pelHyyS2sJ6USBwHcvKFumD AxWoNdRWU6hBrNL+gbD+iD2+vUcew6HrrmXrNyTjAHitNSM5aBfxYc26LMX8X7IuW7fX gQDT4GbUVt2KlKI+lgbn8r1KCZh3Tm3mmvYEeypZsweaRmjLuZ8zqM73syJsmhG75HJ5 3lWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=AmMg+ImI; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-56229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56229-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUSRsH3MgLGDELkEjzLMnWoW32rsvOXbsn312MvjJDlMNYG25NkatxoV3fzlt0zMoa44RlGoQFCogDH23iz7BGAxu9JDiZ/8hLtwy9pDQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y6-20020ac85f46000000b0042bf2cb2cffsi744356qta.468.2024.02.07.01.39.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 01:39:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=AmMg+ImI; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-56229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56229-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2BCF31C21892 for ; Wed, 7 Feb 2024 09:39:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91F732561D; Wed, 7 Feb 2024 09:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="AmMg+ImI" Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B045825561 for ; Wed, 7 Feb 2024 09:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707298517; cv=none; b=UcGoDasAM8mShZZnYiBx4qpJDdjKV6Nb/9+VSAC0SkW82U28K/Mawvic9ZBctJ0NWq1TZX3nxgSZ8oTxnePrnYPxrILLyPNLQ+XNwFDb16a5iaC3+PUGMOTKuMZBQR1Rtc5BT0zKhuDyeqaGmOcovJu/S6F/EdBH+I/wEupLl54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707298517; c=relaxed/simple; bh=q5s5HsLedbmhWblfW5P5IttEtCuzggKcPzjW3KKyicw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FT4zUOnTu+8y6rATiLlI8YlWeiJyRavyj3XQ7sygszqsIX7HO6yhg7qnktgd5RGn0V0kOvaIGCftHeTwnUhM9lLSAKAtyzxzkzxieCps+8DKJZdCs80KvaFGlEunX51p4C+2q9PA34qjq9cQMSNlE1vW9xegB1jK3JIQFatXXtQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=AmMg+ImI; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-55a035669d5so488838a12.2 for ; Wed, 07 Feb 2024 01:35:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1707298514; x=1707903314; darn=vger.kernel.org; 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=5lVUQ+esox3+YZ4FAL/zC0DsXpMXIO/eYNjqHysD3mw=; b=AmMg+ImIMR2rtLUVya0MMt2pI8rGkA13axJeo/bVoNVxjRk7GLS0pEGP3j6UpxohFy lK7W6DrBxP42CgBnlXfXj+pojDo3WLSflyEnEgOMCz4EqMZnNGPiXi+FFTw4QtRS5cys hVvzpo+wtWsnuSMEm7Oejx0A6WI6asPyUIrpJ1gh8WxM1K/mWwqsSuCTcB+KND5YLQBM 87Qv/14EMs1lV5yploiKlzGWMQJSrJ0H/QhZS9SbFjCeNFGx5NYcOnkEJo9NZtUL1ZoJ MBqoQjIz4ivwNb5vi7Jo5NyUNscqB4wJViyNWh16kvN4Pk9gOMaakAwNSE5zT0BhzZ9J ZthQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707298514; x=1707903314; 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=5lVUQ+esox3+YZ4FAL/zC0DsXpMXIO/eYNjqHysD3mw=; b=TAID9KZnberaI016DxJ0pleNsCC1RdMLshwIUOxOFXKufL8yRfq2i6DVDBguwQ3Dv7 mg3pkJ6WLp/2j4w9F0deEXT7+IG3RvXJ16U9rcE7U8IjYbBVdu3rFhWamconreCziaYT 0lubo289cr16M1ckG0hCSDnxe5wW4jgHyXYRUYH/Jv3JSLuXG5h+ZOGEQpnJywpH5G9k ndIFCj2AFumZjbU0ysQcgWqFVVIc+pSOQucUQ0nPA+TxjwB99G0DPGf9S0WW/oGivUuo JbCO4miAI21EreHPn7hB+JRDFRdp3QG9Gyy35b9GWmXdZHOoGtqvt2k+6IsBTuszogm7 9Rrg== X-Gm-Message-State: AOJu0Yyku2u/UkaMabMWTlL32ZrRbJwRk0lN/zZv7aQyIlZl7O91Fbro WycypIhTJqld+21VEIbW2AOr/HQk4brKbkoERNaCAYDWUZczMvzABRIcvce+JuU= X-Received: by 2002:aa7:cfd4:0:b0:55f:d90a:e68b with SMTP id r20-20020aa7cfd4000000b0055fd90ae68bmr3334578edy.20.1707298514040; Wed, 07 Feb 2024 01:35:14 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUhmgTRPKEhVfGCCnkEQ42yYuTwdQJYl26xBRkdKw29eqoP001lXQsIHYUgOQ9qjLnnteyobOoMRvqN4Nl29ukI/AEBoNKWEa51A6KTBURKq6ahfunIDhDG7poEbZNcYTd9FGsS7NCtUpzWntWqKXRmru0qKsNccypFQFLaeQ6cwR/1U1Ra3kDu4GiufpM3sD4MqL+pnpGrWdrOqBO6+tR5Yj9BFD+mu3q+osq12fIQHlaqkZWg+RD4ETwe9suNk1FmVp7QlJsUT1DdUj44I3iw7SzzQCmYavJIbjOtAKGUYvWhviui8WH6MtaqaHaRKAsInUeuodwHVlOr518mlz9XdDnAfQf8AoJxYTJQdX9RI4zoxysjSYdYSE3RTaBWa5Ezt7yXNwXJDmmoKG4KdZC273ojpT8BQofy Received: from blmsp ([2001:4091:a246:821e:6f3b:6b50:4762:8343]) by smtp.gmail.com with ESMTPSA id q15-20020aa7d44f000000b0055ef4a779d9sm477495edr.34.2024.02.07.01.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 01:35:13 -0800 (PST) Date: Wed, 7 Feb 2024 10:35:12 +0100 From: Markus Schneider-Pargmann To: Marc Kleine-Budde , Chandrasekar Ramakrishnan , Wolfgang Grandegger , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Tony Lindgren , Judith Mendez Cc: Vincent MAILHOL , Simon Horman , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Julien Panis Subject: Re: [PATCH 00/14] can: m_can: Optimizations for m_can/tcan part 2 Message-ID: <3rdpfjzahlcdxxszezxrk7vwvgwzpxxgsct32ydinki2xzbxz7@z2suuxtjnwjb> References: <20240207093220.2681425-1-msp@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240207093220.2681425-1-msp@baylibre.com> Sorry, this is of course v7, forgot to add --reroll-count. Best, Markus On Wed, Feb 07, 2024 at 10:32:06AM +0100, Markus Schneider-Pargmann wrote: > Hi Marc, Simon, Martin and everyone, > > v7 is a rebase on v6.8. During my am62 tests I discovered some problems > which are fixed with this update. > > @Simon: I had to remove most of your reviews again, due to a few > fixes I made. > > The series implements many small and bigger throughput improvements and > adds rx/tx coalescing at the end. > > Based on v6.8-rc1. Also available at > https://gitlab.baylibre.com/msp8/linux/-/tree/topic/mcan-optimization/v6.8?ref_type=heads > > Best, > Markus > > Changes in v7: > - Rebased to v6.8-rc1 > - Fixed NULL pointer dereference in m_can_clean() on am62 that happened > when doing ip link up, ip link down, ip link up > - Fixed a racecondition on am62 observed with high throughput tests. > netdev_completed_queue() was called before netdev_sent_queue() as the > interrupt was processed so fast. netdev_sent_queue() is now reported > before the actual sent is done. > - Fixed an initializing issue on am62 where active interrupts are > getting lost between runs. Fixed by resetting cdev->active_interrupts > in m_can_disable_all_interrupts() > - Removed m_can_start_fast_xmit() because of a reordering of operations > due to above mentioned racecondition > > Changes in v6: > - Rebased to v6.6-rc2 > - Added two small changes for the newly integrated polling feature > - Reuse the polling hrtimer for coalescing as the timer used for > coalescing has a similar purpose as the one for polling. Also polling > and coalescing will never be active at the same time. > > Changes in v5: > - Add back parenthesis in m_can_set_coalesce(). This will make > checkpatch unhappy but gcc happy. > - Remove unused fifo_header variable in m_can_tx_handler(). > - Rebased to v6.5-rc1 > > Changes in v4: > - Create and use struct m_can_fifo_element in m_can_tx_handler > - Fix memcpy_and_pad to copy the full buffer > - Fixed a few checkpatch warnings > - Change putidx to be unsigned > - Print hard_xmit error only once when TX FIFO is full > > Changes in v3: > - Remove parenthesis in error messages > - Use memcpy_and_pad for buffer copy in 'can: m_can: Write transmit > header and data in one transaction'. > - Replace spin_lock with spin_lock_irqsave. I got a report of a > interrupt that was calling start_xmit just after the netqueue was > woken up before the locked region was exited. spin_lock_irqsave should > fix this. I attached the full stack at the end of the mail if someone > wants to know. > - Rebased to v6.3-rc1. > - Removed tcan4x5x patches from this series. > > Changes in v2: > - Rebased on v6.2-rc5 > - Fixed missing/broken accounting for non peripheral m_can devices. > > previous versions: > v1 - https://lore.kernel.org/lkml/20221221152537.751564-1-msp@baylibre.com > v2 - https://lore.kernel.org/lkml/20230125195059.630377-1-msp@baylibre.com > v3 - https://lore.kernel.org/lkml/20230315110546.2518305-1-msp@baylibre.com/ > v4 - https://lore.kernel.org/lkml/20230621092350.3130866-1-msp@baylibre.com/ > v5 - https://lore.kernel.org/lkml/20230718075708.958094-1-msp@baylibre.com > v6 - https://lore.kernel.org/lkml/20230929141304.3934380-1-msp@baylibre.com > > Markus Schneider-Pargmann (14): > can: m_can: Start/Cancel polling timer together with interrupts > can: m_can: Move hrtimer init to m_can_class_register > can: m_can: Write transmit header and data in one transaction > can: m_can: Implement receive coalescing > can: m_can: Implement transmit coalescing > can: m_can: Add rx coalescing ethtool support > can: m_can: Add tx coalescing ethtool support > can: m_can: Use u32 for putidx > can: m_can: Cache tx putidx > can: m_can: Use the workqueue as queue > can: m_can: Introduce a tx_fifo_in_flight counter > can: m_can: Use tx_fifo_in_flight for netif_queue control > can: m_can: Implement BQL > can: m_can: Implement transmit submission coalescing > > drivers/net/can/m_can/m_can.c | 551 ++++++++++++++++++------- > drivers/net/can/m_can/m_can.h | 34 +- > drivers/net/can/m_can/m_can_platform.c | 4 - > 3 files changed, 439 insertions(+), 150 deletions(-) > > -- > 2.43.0 >