From: Tom Herbert <tom@quantonium.net>
To: netdev@vger.kernel.org
Cc: rohit@quantonium.net, davejwatson@fb.com,
Tom Herbert <tom@quantonium.net>
Subject: [PATCH v3 net-next 4/4] ulp: Documention for ULP infrastructure
Date: Thu, 3 Aug 2017 12:31:44 -0700 [thread overview]
Message-ID: <20170803193144.24108-5-tom@quantonium.net> (raw)
In-Reply-To: <20170803193144.24108-1-tom@quantonium.net>
Add a doc in Documentation/networking
Signed-off-by: Tom Herbert <tom@quantonium.net>
---
Documentation/networking/ulp.txt | 82 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
create mode 100644 Documentation/networking/ulp.txt
diff --git a/Documentation/networking/ulp.txt b/Documentation/networking/ulp.txt
new file mode 100644
index 000000000000..4d830314b0ff
--- /dev/null
+++ b/Documentation/networking/ulp.txt
@@ -0,0 +1,82 @@
+Upper Layer Protocol (ULP) Infrastructure
+=========================================
+
+The ULP kernel infrastructure provides a means to hook upper layer
+protocol support on a socket. A module may register a ULP hook
+in the kernel. ULP processing is enabled by a setsockopt on a socket
+that specifies the name of the registered ULP to invoked. An
+initialization function is defined for each ULP that can change the
+function entry points of the socket (sendmsg, rcvmsg, etc.) or change
+the socket in other fundamental ways.
+
+Note, no synchronization is enforced between the setsockopt to enable
+a ULP and ongoing asynchronous operations on the socket (such as a
+blocked read). If synchronization is required this must be handled by
+the ULP and caller.
+
+User interface
+==============
+
+The structure for the socket SOL_ULP options is defined in socket.h.
+
+Example to enable "my_ulp" ULP on a socket:
+
+struct ulp_config ulpc = {
+ .ulp_name = "my_ulp",
+};
+
+setsockopt(sock, SOL_SOCKET, SO_ULP, &ulpc, sizeof(ulpc))
+
+The ulp_config includes a "__u8 ulp_params[0]" filled that may be used
+to refer ULP specific parameters being set.
+
+Kernel interface
+================
+
+The interface for ULP infrastructure is defined in net/ulp_sock.h.
+
+ULP registration functions
+--------------------------
+
+int ulp_register(struct ulp_ops *type)
+
+ Called to register a ULP. The ulp_ops structure is described below.
+
+void ulp_unregister(struct ulp_ops *type);
+
+ Called to unregister a ULP.
+
+ulp_ops structure
+-----------------
+
+int (*init)(struct sock *sk, char __user *optval, int len)
+
+ Initialization function for the ULP. This is called from setsockopt
+ when the ULP name in the ulp_config argument matches the registered
+ ULP. optval is a userspace pointer to the ULP specific parameters.
+ len is the length of the ULP specific parameters.
+
+void (*release)(struct sock *sk)
+
+ Called when socket is being destroyed. The ULP implementation
+ should cancel any asynchronous operations (such as timers) and
+ release any acquired resources.
+
+int (*get_params)(struct sock *sk, char __user *optval, int *optlen)
+
+ Get the ULP specific parameters previous set in the init function
+ for the ULP. Note that optlen is a pointer to kernel memory.
+
+char name[ULP_NAME_MAX]
+
+ Name of the ULP. Must be NULL terminated.
+
+struct module *owner
+
+ Corresponding owner for ref count.
+
+Author
+======
+
+Tom Herbert (tom@quantonium.net)
+
--
2.11.0
next prev parent reply other threads:[~2017-08-03 19:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 19:31 [PATCH v3 net-next 0/4] ulp: Generalize ULP infrastructure Tom Herbert
2017-08-03 19:31 ` [PATCH v3 net-next 1/4] inet: include net/sock.h in inet_common.h Tom Herbert
2017-08-03 19:31 ` [PATCH v3 net-next 2/4] sock: ULP infrastructure Tom Herbert
2017-08-03 23:26 ` Mat Martineau
2017-08-03 19:31 ` [PATCH v3 net-next 3/4] tcp: Adjust TCP ULP to defer to sockets ULP Tom Herbert
2017-08-03 19:31 ` Tom Herbert [this message]
2017-08-03 23:45 ` [PATCH v3 net-next 4/4] ulp: Documention for ULP infrastructure Mat Martineau
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=20170803193144.24108-5-tom@quantonium.net \
--to=tom@quantonium.net \
--cc=davejwatson@fb.com \
--cc=netdev@vger.kernel.org \
--cc=rohit@quantonium.net \
/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