#
f2988977 |
| 08-Nov-2022 |
Rashmica Gupta <rashmica@linux.ibm.com> |
pcap: Use SLL2 linktype for captures
This means we can use wireshark on our pcaps.
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com> Change-Id: I215af00e064d352e41d0a8eb87d5a30582998676
|
#
a721c2d8 |
| 04-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
format: reformat with clang-format
Reformat everything with clang-format and remove .clang-ignore and custom code formatter.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I93dfca67
format: reformat with clang-format
Reformat everything with clang-format and remove .clang-ignore and custom code formatter.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I93dfca67948d3fbcc0f05ece4ae3e4dd9495ab57
show more ...
|
#
0721f585 |
| 28-Sep-2022 |
Andrew Jeffery <andrew@aj.id.au> |
core: Define return value behaviours for binding Tx callbacks
Binding Tx callbacks must return 0 upon success or a negative error code on failure. Some error codes invoke specific error handling beh
core: Define return value behaviours for binding Tx callbacks
Binding Tx callbacks must return 0 upon success or a negative error code on failure. Some error codes invoke specific error handling behaviours. If a binding Tx callback returns the following negative error codes:
1. EMSGSIZE: The packet whose transmission failed is dequeued from the transmit queue and dropped, as it will never be successfully transmitted
2. EBUSY: The packet whose transmission failed remains queued for a subsequent attempt.
This prevents Tx queue stalls for bindings such as astlpc where reinitialisation can renegotiate the Tx buffer size to a lower value than the size of packets already in the Tx queue. Previously the implementation in core failed to discard the packet from the binding Tx queue if transmission of the head packet was not possible.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I7dde22bd7340f2c028adf5112d7d4ab78cac66a6
show more ...
|
Revision tags: v0.11 |
|
#
f39c3857 |
| 10-Jan-2022 |
Sumanth Bhat <sumanth.bhat@linux.intel.com> |
core: Add TX/RX API that exposes message tag and tag owner
MCTP received packets can carry a message tag and tag owner bit which is set by a remote MCTP endpoint. This can be used by the remote MCTP
core: Add TX/RX API that exposes message tag and tag owner
MCTP received packets can carry a message tag and tag owner bit which is set by a remote MCTP endpoint. This can be used by the remote MCTP endpoint to track the responses. Thus, libmctp should provide a mechanism for the upper layer MCTP applications to respond with the same message tag.
This patchset extends TX and RX API with message tag and tag owner bits.
Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com> Change-Id: I6d07eafa86c653abdd4313ab7cc77e5a93124477
show more ...
|
#
2094c3c0 |
| 25-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
libmctp: Add mctp_unregister_bus() Allow for safe cleanup of busses associated with bindings when the binding has work to do in the tear-down path. Signed-off-by: Andrew Jeffery
libmctp: Add mctp_unregister_bus() Allow for safe cleanup of busses associated with bindings when the binding has work to do in the tear-down path. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I7cc45e30d778554cfa33c49a47fe237b23fe5431
show more ...
|
#
5d3d4e6d |
| 20-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
core: Add infrastructure for packet captures A callback and user data member is defined to abstract out the implementation details of capturing the packets. The captured packets are
core: Add infrastructure for packet captures A callback and user data member is defined to abstract out the implementation details of capturing the packets. The captured packets are in DSP0236 form, i.e. no binding metadata is present. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Id8234d6e8f7856c70a0ca3fe5d4cee38ec11bd8c
show more ...
|
#
eba19a3b |
| 09-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
astlpc: Introduce protocol v3 with integrity checks v3 of the binding adds a CRC-32 value as a medium-specific trailer to each packet passing over the binding interface. The pat
astlpc: Introduce protocol v3 with integrity checks v3 of the binding adds a CRC-32 value as a medium-specific trailer to each packet passing over the binding interface. The patch includes a naive bit-shift implementation of CRC-32, we can improve it later as necessary. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I93a95bccef30010d56e10e29b6d84554268ab7af
show more ...
|
#
39da3d03 |
| 12-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
libmctp: Split padding in pktbuf into header and trailer The astlpc binding will shortly make use of a medium-specific trailer to implement a CRC-32 integrity check over packet data. All
libmctp: Split padding in pktbuf into header and trailer The astlpc binding will shortly make use of a medium-specific trailer to implement a CRC-32 integrity check over packet data. Allow for medium-specific trailer data in the pktbuf in order to remove the need for a bounce-buffer. The binding will trim the pktbuf to the payload length before passing the instance up the stack. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ib215a552ff218b007f7f119c5235fbc75d9ca6cb
show more ...
|
#
e889b19f |
| 11-Mar-2021 |
Andrew Jeffery <andrew@aj.id.au> |
core: Make pkt_size and pkt_pad size_t Fix bad signedness comparison: ``` core.c: In function ‘mctp_binding_set_tx_enabled’: core.c:630:25: error: comparison of integer expr
core: Make pkt_size and pkt_pad size_t Fix bad signedness comparison: ``` core.c: In function ‘mctp_binding_set_tx_enabled’: core.c:630:25: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] 630 | if (binding->pkt_size < MCTP_PACKET_SIZE(MCTP_BTU)) { | ^ cc1: all warnings being treated as errors ``` Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Idb91b16efa43526ea8e86fff666d0151f2987247
show more ...
|
#
2c820c5a |
| 01-Jul-2020 |
Sumanth Bhat <sumanth.bhat@linux.intel.com> |
core: Limit maximum size of an assembled MCTP message If libmctp receives sequence of fragment MCTP packets and never receives EOM packet, this will cause heap memory to grow without bou
core: Limit maximum size of an assembled MCTP message If libmctp receives sequence of fragment MCTP packets and never receives EOM packet, this will cause heap memory to grow without bounds. This commit puts an upper cap on maximum MCTP message size. This should protect us from any malicious device trying to exploiting this. Also, this prevents overwhelming of the device's resources. Section 10.1.5 of DSP0236 (v1.3.1) allows configuration of endpoints to protect its resources. Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com> Change-Id: Id62cfab7c25b3e1ccf955f2e924844b58b4be154
show more ...
|
#
b942e3a3 |
| 22-Jun-2020 |
Andrew Jeffery <andrew@aj.id.au> |
core: Return size_t for mctp_pktbuf_size() Large packets are enabled by e.g. MTU negotiation in the astlpc binding. Avoid truncating large packets in calls to the pktbuf APIs. S
core: Return size_t for mctp_pktbuf_size() Large packets are enabled by e.g. MTU negotiation in the astlpc binding. Avoid truncating large packets in calls to the pktbuf APIs. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I1244d70fe93ca7538ca09256110d648c495c6aa7
show more ...
|
Revision tags: v0.10 |
|
#
3a540664 |
| 26-May-2020 |
Andrew Jeffery <andrew@aj.id.au> |
astlpc: Introduce MTU negotiation MTU negotiation is implemented in a backwards-compatible manner with version 1 of the astlpc binding. Functionally, MTU negotation involves proposin
astlpc: Introduce MTU negotiation MTU negotiation is implemented in a backwards-compatible manner with version 1 of the astlpc binding. Functionally, MTU negotation involves proposing arrangements of the Rx and Tx buffer layouts. It is assumed that the MTU is a packet sized to fill the Tx buffer as described in the control space. For v1 of the binding the MTU is defined in terms of the MCTP_BTU constant provided by libmctp.h. MCTP_BTU is used regardless of the buffer sizes specified in the control space (which MUST describe buffers supporting at least MCTP_BTU-sized packets). For v2 of the binding the MTU is defined in terms of the appropriate buffer's size field in the control space. The sequence of events for negotiating the MTU under v2 is as follows: 1. The BMC initialises its binding, filling out the Rx and Tx buffer properties with the largest configuration it supports. 2. The host initialises its binding, writing its maximum Rx buffer size before sending `channel-init` to the BMC. 3. The BMC receives `channel-init`, negotiates protocol version 2 and then validates the host's proposed buffer configuration. If the proposed configuration is invalid (e.g. out-of-bounds values) the BMC terminates channel initialisation leaving the channel-active bit clear and writing the zero to the negotiated version field. If the proposal is valid, the BMC calculates the buffer sizes according to the available constraints and writes the chosen buffer configuration to the control region. 4. Assuming the version negotiation and buffer configuration are successful, the BMC sets `channel-active` and notifies the host 5. The host reads `channel-active`, accepts the negotiation of v2 and validates the buffer configuration. If the validation passes, then the buffer configuration is the configuration used for the remainder of the session. If validation fails then the host MUST NOT send MCTP packets via the LPC binding until a valid buffer configuration can be negotiated. Change-Id: I89107593f220418d746c2d73771348ed8f7f3e87 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
ba6727e6 |
| 13-Mar-2020 |
Wiktor Gołgowski <wiktor.golgowski@linux.intel.com> |
core: Support transport control commands This change introduces a control message request handler for MCTP bindings. If a handler is provided, transport control messages will be forw
core: Support transport control commands This change introduces a control message request handler for MCTP bindings. If a handler is provided, transport control messages will be forwarded to the handler, otherwise they will be forwarded to the default handler. Change-Id: I62266d6bf2d512ec97759c0b8a3477c5e433d609 Signed-off-by: Wiktor Gołgowski <wiktor.golgowski@linux.intel.com> [AJ: Split out general control message handler, formatting] Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
fa56ca5f |
| 10-Mar-2020 |
Andrew Jeffery <andrew@aj.id.au> |
libmctp: Add mctp_destroy() Provide an abstraction to clean up memory to avoid false-positives with leak sanitizers. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-I
libmctp: Add mctp_destroy() Provide an abstraction to clean up memory to avoid false-positives with leak sanitizers. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Id0f03ec61fcaf6eb0ed27e8f735720f1ea7e5e8e
show more ...
|
#
73c268e4 |
| 29-Jan-2020 |
Andrew Jeffery <andrew@aj.id.au> |
libmctp: Clarify BTU-related symbols DSP0236 defines a Baseline Transmission Unit (BTU), which dictates the minimum supported packet payload size. The packet size is the BTU + the pa
libmctp: Clarify BTU-related symbols DSP0236 defines a Baseline Transmission Unit (BTU), which dictates the minimum supported packet payload size. The packet size is the BTU + the packet header. The maximum (payload) transport unit size for a given binding may be larger than the BTU. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I2c4013531efd572d95c5a61e4d59309490505a8f
show more ...
|
#
3b36d17c |
| 03-Sep-2019 |
Jeremy Kerr <jk@ozlabs.org> |
API: Add binding accessors to generic struct mctp_binding Rather than have every binding include their own wrappers around binding<->core functions, introduce an accessor to retrieve the
API: Add binding accessors to generic struct mctp_binding Rather than have every binding include their own wrappers around binding<->core functions, introduce an accessor to retrieve the struct mctp_binding from each. This means we no longer need the binding-specific registration callbacks. However, we do now need a ->start callback, to allow bindings to perform post-registration init. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Change-Id: I6cee9e93f37520f85c155a0ca34017cc0675552c
show more ...
|
#
1a4ec3cd |
| 02-Sep-2019 |
Jeremy Kerr <jk@ozlabs.org> |
core,API: Add bridge support This change introduces a facility to bridge messages between two bindings. This is implemented through a new mctp_bridge_busses() API, which app
core,API: Add bridge support This change introduces a facility to bridge messages between two bindings. This is implemented through a new mctp_bridge_busses() API, which applies a new routing policy, sending packets from one binding to the other. This is in contrast to the current policy of dropping all non-local packets. To do this, the message context code needs to know both source and destination EIDs, so add them to the mctp_msg_ctx_lookup() criteria. Also, add a small test for bridge mode. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Change-Id: If532613525ddbf81df249e26d0f23825996f7bda
show more ...
|
#
df15f7e9 |
| 05-Aug-2019 |
Jeremy Kerr <jk@ozlabs.org> |
core,bindings: Allow bindings to specify packet size Currently, we fix all packet sizes to the baseline MTU size. However, bindings may support larger packet sizes. This change
core,bindings: Allow bindings to specify packet size Currently, we fix all packet sizes to the baseline MTU size. However, bindings may support larger packet sizes. This change makes the packet allocator use binding-specific parameters to suit the binding itself, and uses the max packet size in the packetisation path. Since packet sizes may now exceed 255, we change the size and offset types from uint8_t to size_t. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Change-Id: Ica932479f251dc33c67ea19e9e3e5a193cbe0b32
show more ...
|
#
c1693af4 |
| 05-Aug-2019 |
Jeremy Kerr <jk@ozlabs.org> |
core: Free packet in mctp_bus_rx Change mctp_bus_rx to take ownership of a received packet, freeing it after use. This prevents potential leaks in binding implementations.
core: Free packet in mctp_bus_rx Change mctp_bus_rx to take ownership of a received packet, freeing it after use. This prevents potential leaks in binding implementations. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Change-Id: I76c427df7ffa5172e77eccad682325c1376c424f
show more ...
|
#
cc49e16d |
| 30-May-2019 |
Jeremy Kerr <jk@ozlabs.org> |
headers: move log-level definitions to libmctp.h Since we allow library clients to set the log levels when using a stdio log implementation (through mctp_set_log_stdio()), we need to exp
headers: move log-level definitions to libmctp.h Since we allow library clients to set the log levels when using a stdio log implementation (through mctp_set_log_stdio()), we need to expose values for those log levels. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
#
3d36ee2e |
| 29-May-2019 |
Jeremy Kerr <jk@ozlabs.org> |
LICENSE: add GPLv2 license option. As per the MCTP design document (https://github.com/openbmc/docs/blob/master/designs/mctp.md), a dual-licence (GPLv2+ and Apache-2.0) gives us flex
LICENSE: add GPLv2 license option. As per the MCTP design document (https://github.com/openbmc/docs/blob/master/designs/mctp.md), a dual-licence (GPLv2+ and Apache-2.0) gives us flexibility with including libcmtp code into various firmware environments. This change adds GPLv2+ as a license option. All current contributors have agreed to this change. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
#
c7e764a2 |
| 28-May-2019 |
Jeremy Kerr <jk@ozlabs.org> |
Rework conditional feature usage Currently, the infrastructure that we have to enable a flexible compilation environment has a few issues: - the allocator configuration is perf
Rework conditional feature usage Currently, the infrastructure that we have to enable a flexible compilation environment has a few issues: - the allocator configuration is performed at run-time, while the log configuration is performed at compile-time - for a standard compile (ie, standard userspace, using autoconf+automake to build), we need a few pre-defined configuration options. This change adds a bit of runtime selection to the logging infrastructure, to match the allocator setup. We also unify the compile-time defines into config.h, using MCTP_-prefixed macro names, allowing integration into other build systems. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
#
c2def9f3 |
| 21-Feb-2019 |
Ed Tanous <ed.tanous@intel.com> |
core: Fix sequencing number issues Sequencing in MCTP allows SOM to declare a completely new sequence number. Also add an implementation that handles messages that are neither SOM or
core: Fix sequencing number issues Sequencing in MCTP allows SOM to declare a completely new sequence number. Also add an implementation that handles messages that are neither SOM or EOM. Minor changes from Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Ed Tanous <ed.tanous@intel.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
#
ca7a7c47 |
| 11-Mar-2019 |
Jeremy Kerr <jk@ozlabs.org> |
Merge branch 'externc' of https://github.com/dkodihal/libmctp Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
#
f9ffd59b |
| 05-Mar-2019 |
Jeremy Kerr <jk@ozlabs.org> |
headers: Add stddef.h include ... we need this for size_t Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|