Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1282566pxt; Sat, 7 Aug 2021 06:09:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZdYbivCPqvAwybOSyoZWVkKcRQ2XjlTLuO4UdMcPl3uZEVypyxWbBePT3OFJvTZZeX4tC X-Received: by 2002:a02:b799:: with SMTP id f25mr14412926jam.143.1628341754372; Sat, 07 Aug 2021 06:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628341754; cv=none; d=google.com; s=arc-20160816; b=HcANHqYgRjtLnTlwwg06oJS8qJo4tRnqF4WEPy2o4+7Z/6e06f7a7JAJ7lGiFN5/qg PPQLZzFAukTyYpr+KusCaeSqNIZducrxqRzXDsapG27+oXMYOHbI+emI4CuhI44712NG sGwxjRMMT3tLmjvC1oh6dnrqN9jQ0um2HQM32T/pmQPCdBmqu4ZoTCHB2i95p18cPqia BpvIeI2aiWrbWvlInKlQJIFwkZDGRxNWn92UT5Rr0ZAB4S4HHXsS6XMipYXbZRMYgbd0 oQiMspg+z+W3qcY39WVuDW/XtCjSbePwwHA42Qtr956yunZlKqcEGdhqYYj9UocbszXT qRdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=whE/smR+GfQX6eqwPlzh75+C188l9V5ywfgFh/erjGo=; b=s20EZuoHWtsa993Jcu2mOQ218zZxwqfeb4s917q6FbpD+8gjCAKQBnn7MpDJaMjSAf LK5FLcLHs0ljLxCPljQJOiCNkL8zk+4euUssPpbRdZ7bVfTjLbbIUDHwcjqyhVHKhWMK h7sRtovg/OswizTh/qbfFAHR7mwd0UUxWd9NDwvmuE+3zYiBL6yBiu3EEl2qhLv6r+Jd i6DuWCXPie4Qzn7nclQdc37CHmRAuyEjYNvuO8BkafdtuqPTlWJ+QN+8EnID9I8Tot4B J+xDSK0QcD45/HapXYJAMqUPHyT7ZSatlxRU0++PQCio0VznYJPffCMQKXiC2huVpwqK ZowA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@libero.it header.s=s2021 header.b=oYgZU853; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=libero.it Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si12041256ilc.45.2021.08.07.06.08.58; Sat, 07 Aug 2021 06:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@libero.it header.s=s2021 header.b=oYgZU853; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=libero.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232280AbhHGNI2 (ORCPT + 99 others); Sat, 7 Aug 2021 09:08:28 -0400 Received: from smtp-32.italiaonline.it ([213.209.10.32]:57646 "EHLO libero.it" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232181AbhHGNI0 (ORCPT ); Sat, 7 Aug 2021 09:08:26 -0400 Received: from passgat-Modern-14-A10M.homenet.telecomitalia.it ([82.60.87.158]) by smtp-32.iol.local with ESMTPA id CM3WmQm3XPvRTCM3amIfYI; Sat, 07 Aug 2021 15:08:07 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2021; t=1628341687; bh=whE/smR+GfQX6eqwPlzh75+C188l9V5ywfgFh/erjGo=; h=From; b=oYgZU853/nnrWGJwIz/IlbPnBsKer7Vppx2tKf7T6sjTf+Dx2HD+NKj68oqWWm8O9 vT80vbCzUPsQdbSNou21+C6mJnmKTAFoAViB31MELxFj/wYgdMyI51C291wmTnjdaG waQ8i2dmQQAhhgDhM+cKawj4XEk2zYSbnZh5Rlh+O09cgG1RUfS28wWu1zxofGfnJd dbDILumkTyoM3e2SSEb1jeWo4Y+agPQCLip5pHNDeBcQCXzOmQ2m8awwqHQlxkfksJ HlJBJjvvc17l7WPnRnZ/bK8pp9ZmkVkf9M6+YTtuBqbz5Pfeq+VEjfPrhp1WPkPay3 H+fD3vyugPJMA== X-CNFS-Analysis: v=2.4 cv=NqgUz+RJ c=1 sm=1 tr=0 ts=610e85b7 cx=a_exe a=Hc/BMeSBGyun2kpB8NmEvQ==:117 a=Hc/BMeSBGyun2kpB8NmEvQ==:17 a=gu6fZOg2AAAA:8 a=8Szu4Ex1LEpqERUTuRwA:9 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=2RSlZUUhi9gRBrsHwhhZ:22 From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Gianluca Falavigna , Dario Binacchi , Andrew Lunn , "David S. Miller" , Jakub Kicinski , Marc Kleine-Budde , Oliver Hartkopp , Tong Zhang , Vincent Mailhol , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3 0/4] can: c_can: cache frames to operate as a true FIFO Date: Sat, 7 Aug 2021 15:07:56 +0200 Message-Id: <20210807130800.5246-1-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4xfJ9UyNdh2EUq9EiRVjihG6s1usW765LlWJv078A5wh5ixuN84y3IBvMwgw4lUiJZrSrqatSlsGEif4bXSpE9eDXh5dZTHBgwrVuLevzoH/tuxkjXnUKo ytfTjkVuo7m47wqHrv9xlhT+LwRHLDgn8rby2qn1v26OePvCUEvnNImjG/5pwt5xi6e8ukqvUXkQlh1nQmMEvi+uOt7aNNQQzYIKNtL1kDq1hdeJCAYbIk+u OUoY//Km+tOjia3+ngzxWnBDeCsLTGGE+UfyFj/Ic3WryEPqShxSUK7H05ybmSx90qeQXPSPsWqN+amu1NYzRuPffwyKKO7TSw6cdjMkk1rVuVb4IHpmDIMv FLCjHqNZRSX+XTcLMxbv8rhWCRUl7aaIwZn/rD5mZ789oO+7QPcTnS6uvdA30Tl5cLXUSeXzsvnerEvKVfSkWgqhOFnF4jva+f0bDLfrW8xZF7I8yDKqhODR N3xgAYqJrn4OdUFckDW2UPw1aT7Jqa/HA+QYmx8wTHoYIrFSuzNrFy/6gjssczAtFg+unHEflG46I6cs2zn/o0KHtoraVGZkbaAfV4pe6LLuEQRYPLN6VPUW KbsQ2eHQaVqhdyRVzxoT1+eED54vHFVs9fWhkHpz3CWZig== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Performance tests of the c_can driver led to the patch that gives the series its name. I also added two patches not really related to the topic of the series. Run test succesfully on a custom board having two CAN ports. I connected the CAN1 port to the CAN2 port with a cable. Then I opened two terminals. On one I issued a dump command and on the other the transmit command used in the tests described in https://marc.info/?l=linux-can&m=139746476821294&w=2. Terminal-1: $ ip link set can1 type can bitrate $ ip link set up can1 $ candump can1 >/tmp/can-test- Terminal-2 $ ip link set can0 type can bitrate $ ip link set up can0 $ time cangen can0 -g0 -p1 -I5A5 -L0 -x -n 1000000 Then I applied the following commands to the file generated by the dump command: $ wc -l # ca $ egrep -v ' can1 5A5 \[0\]' /tmp/can-test- | wc -l # cb I repeated the tests for 1000000, 500000, 250000 and 125000 bitrates, before and after applying the series. Here are the results: Before applying the series: bitrate time ca cb 125000 6m 42.71s 1000000 0 250000 3m 23.28s 1000000 0 500000 1m 44.04s 1000000 0 1000000 1m 8.44s 1000000 0 After applying ring-FIFO series: bitrate time ca cb 125000 6m 40.48s 1000000 0 250000 3m 20.80s 1000000 0 500000 1m 42.56s 1000000 0 1000000 1m 7.89s 1000000 0 Changes in v3: - Remove the transmission spin_lock. - Use IF_RX in c_can_do_tx(). Changes in v2: - Move c_can_get_tx_free() from c_can_main.c to c_can.h. Dario Binacchi (4): can: c_can: remove struct c_can_priv::priv field can: c_can: exit c_can_do_tx() early if no frames have been sent can: c_can: support tx ring algorithm can: c_can: cache frames to operate as a true FIFO drivers/net/can/c_can/c_can.h | 25 ++++++- drivers/net/can/c_can/c_can_main.c | 95 +++++++++++++++++++------- drivers/net/can/c_can/c_can_platform.c | 1 - 3 files changed, 94 insertions(+), 27 deletions(-) -- 2.17.1