From: Eugene Syromiatnikov <esyr@redhat.com>
To: Jeremy Kerr <jk@codeconstruct.com.au>
Cc: netdev@vger.kernel.org, Matt Johnston <matt@codeconstruct.com.au>,
Andrew Jeffery <andrew@aj.id.au>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH net-next v4 15/15] mctp: Add MCTP overview document
Date: Fri, 15 Oct 2021 15:10:16 +0200 [thread overview]
Message-ID: <20211015131016.GA14244@asgard.redhat.com> (raw)
In-Reply-To: <20210729022053.134453-16-jk@codeconstruct.com.au>
On Thu, Jul 29, 2021 at 10:20:53AM +0800, Jeremy Kerr wrote:
> This change adds a brief document about the sockets API provided for
> sending and receiving MCTP messages from userspace.
[...]
> diff --git a/Documentation/networking/mctp.rst b/Documentation/networking/mctp.rst
[...]
> +``bind()`` : set local socket address
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +Sockets that receive incoming request packets will bind to a local address,
> +using the ``bind()`` syscall.
> +
> +.. code-block:: C
> +
> + struct sockaddr_mctp addr;
> +
> + addr.smctp_family = AF_MCTP;
> + addr.smctp_network = MCTP_NET_ANY;
> + addr.smctp_addr.s_addr = MCTP_ADDR_ANY;
> + addr.smctp_type = MCTP_TYPE_PLDM;
[...]
> +``sendto()``, ``sendmsg()``, ``send()`` : transmit an MCTP message
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +An MCTP message is transmitted using one of the ``sendto()``, ``sendmsg()`` or
> +``send()`` syscalls. Using ``sendto()`` as the primary example:
> +
> +.. code-block:: C
> +
> + struct sockaddr_mctp addr;
> + char buf[14];
> + ssize_t len;
> +
> + /* set message destination */
> + addr.smctp_family = AF_MCTP;
> + addr.smctp_network = 0;
> + addr.smctp_addr.s_addr = 8;
> + addr.smctp_tag = MCTP_TAG_OWNER;
> + addr.smctp_type = MCTP_TYPE_ECHO;
While MCTP_TYPE_PLDM and MCTP_TYPE_ECHO are mentioned
in the documentation, their definition is currently missing in the UAPI
header (or anywhere in the source tree at all). Is that expected?
next prev parent reply other threads:[~2021-10-15 13:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-29 2:20 [PATCH net-next v4 00/15] Add Management Component Transport Protocol support Jeremy Kerr
2021-07-29 2:20 ` [PATCH net-next v4 15/15] mctp: Add MCTP overview document Jeremy Kerr
2021-10-15 13:10 ` Eugene Syromiatnikov [this message]
2021-07-29 14:30 ` [PATCH net-next v4 00/15] Add Management Component Transport Protocol support patchwork-bot+netdevbpf
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=20211015131016.GA14244@asgard.redhat.com \
--to=esyr@redhat.com \
--cc=andrew@aj.id.au \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=matt@codeconstruct.com.au \
--cc=netdev@vger.kernel.org \
/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).