linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dario Binacchi <dariobin@libero.it>
To: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Cc: kernel@pengutronix.de
Subject: Re: [PATCH v6 0/12] can: c_can: add support to 64 message objects
Date: Tue, 9 Mar 2021 13:41:31 +0100 (CET)	[thread overview]
Message-ID: <1739785095.246292.1615293691102@mail1.libero.it> (raw)
In-Reply-To: <20210305130211.2860914-1-mkl@pengutronix.de>

Hi Marc,

> Il 05/03/2021 14:01 Marc Kleine-Budde <mkl@pengutronix.de> ha scritto:
> 
>  
> Hello,
> 
> this series picks up Dario Binacchi's patches and adds some cleanup
> patches in front.
> 
> The D_CAN controller supports up to 128 messages. Until now the driver
> only managed 32 messages although Sitara processors and DRA7 SOC can
> handle 64.
> 
> The series was tested on a beaglebone board.
> 
> Note:
> I have not changed the type of tx_field (belonging to the c_can_priv
> structure) to atomic64_t because I think the atomic_t type has size
> of at least 32 bits on x86 and arm, which is enough to handle 64
> messages.
> http://marc.info/?l=linux-can&m=139746476821294&w=2 reports the results
> of tests performed just on x86 and arm architectures.
> 
> Changes in v6:
> - make patches
>   [PATCH v5 0/11] can: c_can: add support to 64 message objects
>   [PATCH v5 0/11] can: c_can: add support to 64 message objects
>   separate again, they have been squashed accidentally 
> 
> Changes in v5:
> - Add cleanup patches
> - alloc_c_can_dev(): make use of struct_size()
> 
> Changes in v4:
> - Restore IF_RX interface.
> - Add a comment to clarify why IF_RX interface is used instead of IF_TX.
> - Use GENMASK() for setting msg_obj_rx_mask.
> - Use BIT() for setting single bits and GENMASK() for setting masks.
> 
> Changes in v3:
> - Use unsigned int instead of int as type of the msg_obj_* fields
>   in the c_can_priv structure.
> - Replace (u64)1 with 1UL in msg_obj_rx_mask setting.
> - Use unsigned int instead of int as type of the msg_obj_num field
>   in c_can_driver_data and c_can_pci_data structures.
> 
> Changes in v2:
> - Fix compiling error reported by kernel test robot.
> - Add Reported-by tag.
> - Pass larger size to alloc_candev() routine to avoid an additional
>   memory allocation/deallocation.
> - Add message objects number to PCI driver data.

I tested the patch series 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 -t can1 >/tmp/can-test-<bitrate>/out

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 45.22s    1000000        0
  250000    3m 25.94s    1000000        0
  500000    1m 45.62s    1000000        0
 1000000    1m  9.28s    1000000        0

After 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

Thanks and regards,
Dario

  parent reply	other threads:[~2021-03-09 12:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 13:01 [PATCH v6 0/12] can: c_can: add support to 64 message objects Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 01/12] can: c_can: convert block comments to network style comments Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 02/12] can: c_can: remove unnecessary blank lines and add suggested ones Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 03/12] can: c_can: fix indention Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 04/12] can: c_can: fix print formating string Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 05/12] can: c_can: replace double assignments by two single ones Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 06/12] can: c_can: fix remaining checkpatch warnings Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 07/12] can: c_can: remove unused code Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 08/12] can: c_can: fix indentation Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 09/12] can: c_can: add a comment about IF_RX interface's use Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 10/12] can: c_can: use 32-bit write to set arbitration register Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 11/12] can: c_can: prepare to up the message objects number Marc Kleine-Budde
2021-03-05 13:02 ` [PATCH v6 12/12] can: c_can: add support to 64 message objects Marc Kleine-Budde
2021-03-09 12:41 ` Dario Binacchi [this message]
2021-03-09 12:47   ` [PATCH v6 0/12] " 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=1739785095.246292.1615293691102@mail1.libero.it \
    --to=dariobin@libero.it \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).