fa3bc56a | 24-Feb-2025 |
Jeremy Kerr <jk@codeconstruct.com.au> |
README: add 'Target usage' section
I get a few queries from people who are attempting to use libmctp as their MCTP communication interface, and trying to get it to talk to an AF_MCTP socket.
libmct
README: add 'Target usage' section
I get a few queries from people who are attempting to use libmctp as their MCTP communication interface, and trying to get it to talk to an AF_MCTP socket.
libmctp is unnecessary in this scenario, so add a usage note.
Change-Id: I4d46905f19054af3c0e4e3fde2815befc7f4752a Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
2da0a8f4 | 03-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: Id040b283a88667ca68aeff3d06269c3b1713ebe9 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> |
5cc20932 | 01-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: I7a634219b8f2de45f106049e57b40b8212032abb Signed-off-by: Patrick Williams <patrick@stwcx.xyz> |
060c71ed | 08-Jan-2025 |
Matt Johnston <matt@codeconstruct.com.au> |
fuzz: Add fuzzing for core and i2c
Add fuzzing infrastructure and a fuzz target handling mctp-i2c packets. After running for a few days with honggfuzz this achieves close to complete line coverage o
fuzz: Add fuzzing for core and i2c
Add fuzzing infrastructure and a fuzz target handling mctp-i2c packets. After running for a few days with honggfuzz this achieves close to complete line coverage of core.c
Change-Id: I6cd7361e6f600831a319f06fb7c7c0d2186fd7de Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
d8f0c68b | 08-Jan-2025 |
Matt Johnston <matt@codeconstruct.com.au> |
i2c: Add string argument to static_assert()
Some compilers require a string argument.
Change-Id: I241ab3954aaac430804524a5557eab4047a213b4 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> |
0a4957c9 | 07-Jan-2025 |
Matt Johnston <matt@codeconstruct.com.au> |
container_of: Avoid ubsan null pointer
Instead use offsetof() to determine the container pointer, otherwise ubsan fails with "member access within null pointer".
Change-Id: I5472a1a7052fc0d6f02f2df
container_of: Avoid ubsan null pointer
Instead use offsetof() to determine the container pointer, otherwise ubsan fails with "member access within null pointer".
Change-Id: I5472a1a7052fc0d6f02f2df5283eddb3be653d06 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
a3830d25 | 13-Jan-2025 |
Matt Johnston <matt@codeconstruct.com.au> |
Fix test-i2c leak, and mctp_pktbuf storage alignment
- Ensure mctp_pktbuf storage is correctly aligned - Deallocate mctp and i2c instances to avoid failure with asan.
These previously succeeded in
Fix test-i2c leak, and mctp_pktbuf storage alignment
- Ensure mctp_pktbuf storage is correctly aligned - Deallocate mctp and i2c instances to avoid failure with asan.
These previously succeeded in CI so are both fixed in this commit.
Fixes: e5b941d9d764 ("i2c: Add binding for MCTP over I2C transport") Fixes: 4a09e1dc4883 ("core: Reuse buffers for tx, allow message pools") Change-Id: I747bfff6faf3a5b0a982ae266bcef02ecbc4ee8a Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
18b9a37b | 22-Nov-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
core: Drop packets with broadcast source EID
That has no valid use case, so should be disallowed to avoid unforeseen problems.
Change-Id: I514e5d910fb3b92606aae86aee282a97e6166a15 Signed-off-by: Ma
core: Drop packets with broadcast source EID
That has no valid use case, so should be disallowed to avoid unforeseen problems.
Change-Id: I514e5d910fb3b92606aae86aee282a97e6166a15 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
4058b2cb | 07-Nov-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
control: Add basic MCTP Control Protocol handler
This will respond to the 4 mandatory MCTP Control Protocol commands. Applications can register supported types using mctp_control_add_type().
Change
control: Add basic MCTP Control Protocol handler
This will respond to the 4 mandatory MCTP Control Protocol commands. Applications can register supported types using mctp_control_add_type().
Change-Id: Ia904bcbe118626adf9254ffa71dd8e17fbdfc9b7 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
f7749dc3 | 06-Nov-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
core: Remove completion_code field from mctp_ctrl_msg_hdr
That field is only applicable for response messages, not request messages.
Change-Id: I74d0cc206c78d162e5cd210a45d398334e1cdf52 Signed-off-
core: Remove completion_code field from mctp_ctrl_msg_hdr
That field is only applicable for response messages, not request messages.
Change-Id: I74d0cc206c78d162e5cd210a45d398334e1cdf52 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
e5b941d9 | 17-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
i2c: Add binding for MCTP over I2C transport
Implements DSP0237. This has a fixed neighbor table (currently 4 entries), with neighbors learned on reception, or set with mctp_i2c_set_neighbour().
Ch
i2c: Add binding for MCTP over I2C transport
Implements DSP0237. This has a fixed neighbor table (currently 4 entries), with neighbors learned on reception, or set with mctp_i2c_set_neighbour().
Change-Id: I9b1e2c3673149cd0b9fee0d8113f3cac0e336bc7 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
44e64dfa | 05-Nov-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
core: Add allocated tag expiry, mctp_set_now_op()
Allocated tags expire after 6 seconds, requiring a time source. The default will use clock_gettime(), though implementations can set MCTP_DEFAULT_CL
core: Add allocated tag expiry, mctp_set_now_op()
Allocated tags expire after 6 seconds, requiring a time source. The default will use clock_gettime(), though implementations can set MCTP_DEFAULT_CLOCK_GETTIME=0 and use mctp_set_now_op() for custom behavior.
Change-Id: Iaacf500bcd458c987f4b79c698bac9ae5ad5a73e Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
f9b99f1f | 17-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
build: Generate libmctp-sizes.h
This can be used to allocate static storage for a struct mctp used with heapless mctp_setup().
core.c internal data structures are moved to core-internal.h so that s
build: Generate libmctp-sizes.h
This can be used to allocate static storage for a struct mctp used with heapless mctp_setup().
core.c internal data structures are moved to core-internal.h so that sizeof(struct mctp) can be compiled without linking other objects.
Change-Id: I72dcd46ef11d6f4b4f5ba1c9ae6c95e40dda40f8 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
1250727f | 30-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
build/core: Add 'nolog' build option to omit logging entirely
This can be used to avoid dereferencing the global `log_type` which may be inaccessible on platforms with memory protection.
Change-Id:
build/core: Add 'nolog' build option to omit logging entirely
This can be used to avoid dereferencing the global `log_type` which may be inaccessible on platforms with memory protection.
Change-Id: Ib48468018e3afaf05978018199a9a2022cb49fdf Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
bbfcc6e1 | 17-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
build/core: Add MCTP_CUSTOM_ALLOC option
This avoids storing the allocator function pointers in mutable memory, which is a problem when building on platforms with memory protection. Instead the appl
build/core: Add MCTP_CUSTOM_ALLOC option
This avoids storing the allocator function pointers in mutable memory, which is a problem when building on platforms with memory protection. Instead the application/platform defines custom functions that are linked with libmctp.
Change-Id: Icaf88968b50c88bbd2305d325f9530658465e21f Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
61c95992 | 16-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
core: Add mctp_message_tx_request() function
This allocates a tag for messages sent with TO bit set.
Change-Id: Ia8403a06aa449e0218a30edf5ad69781c70d7c52 Signed-off-by: Matt Johnston <matt@codecons
core: Add mctp_message_tx_request() function
This allocates a tag for messages sent with TO bit set.
Change-Id: Ia8403a06aa449e0218a30edf5ad69781c70d7c52 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
0a96544a | 16-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
tests: Allow tx packets in mctp_binding_test
This requires setting src==dest for routing.
Change-Id: I098b67071b111e328cbcc8bb20656638d7baca39 Signed-off-by: Matt Johnston <matt@codeconstruct.com.a
tests: Allow tx packets in mctp_binding_test
This requires setting src==dest for routing.
Change-Id: I098b67071b111e328cbcc8bb20656638d7baca39 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
722d0db2 | 13-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
core: Allow running without heap allocations
Replace buses with a static array, and add mctp_setup/mctp_cleanup to use an existing struct.
__mctp_alloc() and __mctp_free() no longer need to be func
core: Allow running without heap allocations
Replace buses with a static array, and add mctp_setup/mctp_cleanup to use an existing struct.
__mctp_alloc() and __mctp_free() no longer need to be functional, though are used as defaults if m_msg_alloc/m_msg_free are not provided.
Change-Id: Ib5826836efb59e416410b25f138cbaf5931278f3 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
4a09e1dc | 13-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
core: Reuse buffers for tx, allow message pools
Use new m_msg_alloc/m_msg_free operations for whole-message MCTP buffers. m_realloc is no longer used, instead the maximum sized buffer is allocated f
core: Reuse buffers for tx, allow message pools
Use new m_msg_alloc/m_msg_free operations for whole-message MCTP buffers. m_realloc is no longer used, instead the maximum sized buffer is allocated for each reassembly. This allows applications to keep a pool of MCTP message buffers.
Don't create a queue of packets to transmit, instead reuse a single binding-provided tx_storage buffer for each transmitted packet, which can be static for bindings that have a known maximum packet size.
Asynchronous users/bindings can no longer rely on the core for queueing TX packets, instead they should test mctp_is_tx_ready() prior to calling mctp_message_tx(). The stack will return -EBUSY from mctp_message_tx() if there is already a message pending to send.
Bindings must be updated to add the tx_storage member, and the core will no longer free packets passed to mctp_bus_rx().
Change-Id: I2598bb91026ccef01b268c52b06c0f8e20bebb1e Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
ba5f7477 | 11-Dec-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
tests: astlpc: Change high-to-low MTU test for txq
The test relies on internal packet queue state, which is going to change in a future commit (packets generated as required). Instead test that upda
tests: astlpc: Change high-to-low MTU test for txq
The test relies on internal packet queue state, which is going to change in a future commit (packets generated as required). Instead test that updating a host from high to low MTU works correctly, without relying on specific buffering.
Change-Id: Id33c1d0e5bb0b8cc0ac2a8cc964e3c694643ac02 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
63338a2e | 10-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
build: Better fileio test, required for utils
The existing fileio configure test only tests for unistd/fcntl header existence, which isn't sufficient. This change instead tests for linking poll().
build: Better fileio test, required for utils
The existing fileio configure test only tests for unistd/fcntl header existence, which isn't sufficient. This change instead tests for linking poll().
The utils programs need fileio so the meson build is made conditional for those.
Change-Id: I7edf632cf81ed3e78f2f02488e95c28d78edfc31 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
6586fc10 | 10-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
build: Add meson build
This replicates most of the current autotools build.
Code coverage is omitted, it should be possible to use built-in Meson functionality.
Valgrind for tests has not been add
build: Add meson build
This replicates most of the current autotools build.
Code coverage is omitted, it should be possible to use built-in Meson functionality.
Valgrind for tests has not been added, instead it can run as meson test --wrap='valgrind --leak-check=full --error-exitcode=1'
Change-Id: I5566a6c30630c486d22390e126899dbe4a6331ce Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
6e0c5d6d | 10-Sep-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
serial: Fix const correctness of write stub
Change-Id: If76a2f81cdd120c93a4b9bcc1bb08da573d3a755 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> |
7c51d831 | 10-Dec-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
serial: Fix attribute for mctp_serial_tx_fn
cppcheck complains about the function attribute previously at the end.
Change-Id: I781af654e56b062040ae6f553d9ba3a5148ce1b9 Signed-off-by: Matt Johnston
serial: Fix attribute for mctp_serial_tx_fn
cppcheck complains about the function attribute previously at the end.
Change-Id: I781af654e56b062040ae6f553d9ba3a5148ce1b9 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|
e79ac010 | 10-Dec-2024 |
Matt Johnston <matt@codeconstruct.com.au> |
serial: Replace mctp_write_all with a function
Brace grouped expressions are a GNU extension so don't work with -Wpedantic
Change-Id: I9ec2b0542251c59856be0e7470e117c76e210b95 Signed-off-by: Matt J
serial: Replace mctp_write_all with a function
Brace grouped expressions are a GNU extension so don't work with -Wpedantic
Change-Id: I9ec2b0542251c59856be0e7470e117c76e210b95 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
show more ...
|