Lines Matching +full:message +full:- +full:based
1 .. SPDX-License-Identifier: GPL-2.0
11 The core code provides a socket-based interface to send and receive MCTP
24 A network defines a unique address space for MCTP endpoints by endpoint-ID
25 (described by DSP0236, section 3.2.31). A network has a user-visible identifier
39 --------------------
41 MCTP uses ``AF_MCTP`` / ``PF_MCTP`` for the address- and protocol- families.
42 Since MCTP is message-based, only ``SOCK_DGRAM`` sockets are supported.
44 .. code-block:: C
51 specified with a ``sockaddr`` type, with a single-byte endpoint address:
53 .. code-block:: C
74 -----------------
76 The following sections describe the MCTP-specific behaviours of the standard
86 .. code-block:: C
99 match the network, address, and message type will be received by this socket.
101 messages with the TO bit set, to indicate an incoming request message, rather
107 ``MCTP_TAG_OWNER`` is set, the 3 least-significant bits of ``smctp_tag`` are not
111 receive incoming packets from any locally-connected network. A specific network
118 The ``smctp_type`` field specifies which message types to receive. Only the
120 most-significant IC bit is not part of the match). This results in the socket
121 receiving packets with and without a message integrity check footer.
123 ``sendto()``, ``sendmsg()``, ``send()`` : transmit an MCTP message
126 An MCTP message is transmitted using one of the ``sendto()``, ``sendmsg()`` or
129 .. code-block:: C
135 /* set message destination */
142 /* arbitrary message to send, with message-type header */
144 memcpy(buf + 1, "hello, world!", sizeof(buf) - 1);
152 EID. If ``MCTP_TAG_OWNER`` is not set, the message will be sent with the tag
156 The application must provide the message type byte as the first byte of the
157 message buffer passed to ``sendto()``. If a message integrity check is to be
158 included in the transmitted message, it must also be provided in the message
159 buffer, and the most-significant bit of the message type byte must be 1.
162 message buffer to be specified as a scatter-gather list. At present no ancillary
163 message types (used for the ``msg_control`` data passed to ``sendmsg()``) are
166 Transmitting a message on an unconnected socket with ``MCTP_TAG_OWNER``
168 allocated for that destination. The (destination-eid,tag) tuple acts as an
170 outgoing message. If any previous allocation has been performed (to for a
176 ``recvfrom()``, ``recvmsg()``, ``recv()`` : receive an MCTP message
179 An MCTP message can be received by an application using one of the
183 .. code-block:: C
202 remote address of the incoming message, including tag value (this will be needed
203 in order to reply to the message).
205 The first byte of the message buffer will contain the message type byte. If an
206 integrity check follows the message, it will be included in the received buffer.
210 remote address is already known, or the message does not require a reply.
218 These tags give applications more control over MCTP message tags, by allocating
220 allocating a per-message tag at ``sendmsg()`` time.
226 release) from individual message send and receive operations.
230 .. code-block:: C
245 - ``MCTP_TAG_OWNER``: it only makes sense to allocate tags if you're the tag
248 - ``MCTP_TAG_PREALLOC``: to indicate to ``sendmsg()`` that this is a
251 - ... and the actual tag value, within the least-significant three bits
254 The tag value should be used as-is for the ``smctp_tag`` member of ``struct
268 1. local TX to remote endpoint, message <= MTU::
271 -> mctp_local_output()
273 -> rt->output() (== mctp_route_output)
274 -> dev_queue_xmit()
276 2. local TX to remote endpoint, message > MTU::
279 -> mctp_local_output()
280 -> mctp_do_fragment_route()
281 : creates packet-sized skbs. For each new skb:
282 -> rt->output() (== mctp_route_output)
283 -> dev_queue_xmit()
285 3. remote TX to local endpoint, single-packet message::
289 -> rt->output() (== mctp_route_input)
291 -> sock_queue_rcv_skb()
293 4. remote TX to local endpoint, multiple-packet message::
297 -> rt->output() (== mctp_route_input)
299 : stores skb in struct sk_key->reasm_head
303 -> rt->output() (== mctp_route_input)
305 : finds existing reassembly in sk_key->reasm_head
307 -> sock_queue_rcv_skb()
310 -------------
314 - a skb: during route output, stored in ``skb->cb``.
316 - netns and sock lists.
319 reference to the dev (set through ``key->dev``, counted through
320 ``dev->key_count``). Multiple keys can reference the device.