Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can: isotp: add module parameter for maximum pdu size #5557

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Jul 29, 2023

commit 96d1c81 upstream.

With ISO 15765-2:2016 the PDU size is not limited to 2^12 - 1 (4095) bytes but can be represented as a 32 bit unsigned integer value which allows 2^32 - 1 bytes (~4GB). The use-cases like automotive unified diagnostic services (UDS) and flashing of ECUs still use the small static buffers which are provided at socket creation time.

When a use-case requires to transfer PDUs up to 1025 kByte the maximum PDU size can now be extended by setting the module parameter max_pdu_size. The extended size buffers are only allocated on a per-socket/connection base when needed at run-time.

changes since v2: https://lore.kernel.org/all/[email protected]

  • use ARRAY_SIZE() to reference DEFAULT_MAX_PDU_SIZE only at one place

changes since v1: https://lore.kernel.org/all/[email protected]

  • limit the minimum 'max_pdu_size' to 4095 to maintain the classic behavior before ISO 15765-2:2016

Link: #5371

Link: https://lore.kernel.org/all/[email protected]

commit 96d1c81 upstream.

With ISO 15765-2:2016 the PDU size is not limited to 2^12 - 1 (4095)
bytes but can be represented as a 32 bit unsigned integer value which
allows 2^32 - 1 bytes (~4GB). The use-cases like automotive unified
diagnostic services (UDS) and flashing of ECUs still use the small
static buffers which are provided at socket creation time.

When a use-case requires to transfer PDUs up to 1025 kByte the maximum
PDU size can now be extended by setting the module parameter
max_pdu_size. The extended size buffers are only allocated on a
per-socket/connection base when needed at run-time.

changes since v2: https://lore.kernel.org/all/[email protected]
- use ARRAY_SIZE() to reference DEFAULT_MAX_PDU_SIZE only at one place

changes since v1: https://lore.kernel.org/all/[email protected]
- limit the minimum 'max_pdu_size' to 4095 to maintain the classic
  behavior before ISO 15765-2:2016

Link: raspberrypi#5371
Signed-off-by: Oliver Hartkopp <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Signed-off-by: Marc Kleine-Budde <[email protected]>
@6by9
Copy link
Contributor Author

6by9 commented Jul 29, 2023

See #5371. Waiting for user testing.

@pelwell
Copy link
Contributor

pelwell commented Jul 31, 2023

I'm happy with this change, but will wait for some user feedback.

@tlalexander
Copy link

Thanks folks! See my comment here:
#5371 (comment)

@pelwell pelwell marked this pull request as ready for review August 1, 2023 05:41
@pelwell pelwell merged commit 4b729a0 into raspberrypi:rpi-6.1.y Aug 1, 2023
10 of 11 checks passed
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Aug 7, 2023
kernel: drivers: media: i2c Updated imx296 driver for external trigger
See: raspberrypi/linux#5560

kernel: overlays: Add bmp380 to i2c-sensor overlay
See: raspberrypi/linux#5558

kernel: drivers: media: imx296: Add standby delay during probe
See: raspberrypi/linux#5555

kernel: can: isotp: add module parameter for maximum pdu size
See: raspberrypi/linux#5557

kernel: media: dt-bindings: imx258: Fix alternate compatible strings
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Aug 9, 2023
kernel: drivers: media: i2c Updated imx296 driver for external trigger
See: raspberrypi/linux#5560

kernel: overlays: Add bmp380 to i2c-sensor overlay
See: raspberrypi/linux#5558

kernel: drivers: media: imx296: Add standby delay during probe
See: raspberrypi/linux#5555

kernel: can: isotp: add module parameter for maximum pdu size
See: raspberrypi/linux#5557

kernel: media: dt-bindings: imx258: Fix alternate compatible strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants