All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Binacchi <dariobin@libero.it>
To: linux-kernel@vger.kernel.org
Cc: Gianluca Falavigna <gianluca.falavigna@inwind.it>,
	Dario Binacchi <dariobin@libero.it>, Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	Tong Zhang <ztong0001@gmail.com>,
	Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
	Wolfgang Grandegger <wg@grandegger.com>,
	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	[thread overview]
Message-ID: <20210807130800.5246-1-dariobin@libero.it> (raw)


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 <bitrate>
$ ip link set up can1
$ candump can1 >/tmp/can-test-<bitrate>

Terminal-2
$ ip link set can0 type can bitrate <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 </tmp/can-test-<bitrate>                                 # ca
$ egrep -v '  can1  5A5   \[0\]' /tmp/can-test-<bitrate> | 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


             reply	other threads:[~2021-08-07 13:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 13:07 Dario Binacchi [this message]
2021-08-07 13:07 ` [PATCH v3 1/4] can: c_can: remove struct c_can_priv::priv field Dario Binacchi
2021-08-07 13:07 ` [PATCH v3 2/4] can: c_can: exit c_can_do_tx() early if no frames have been sent Dario Binacchi
2021-08-07 13:07 ` [PATCH v3 3/4] can: c_can: support tx ring algorithm Dario Binacchi
2021-08-07 13:08 ` [PATCH v3 4/4] can: c_can: cache frames to operate as a true FIFO Dario Binacchi
2021-08-09  7:08 ` [PATCH v3 0/4] " Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210807130800.5246-1-dariobin@libero.it \
    --to=dariobin@libero.it \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=gianluca.falavigna@inwind.it \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=wg@grandegger.com \
    --cc=ztong0001@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.