summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2021-09-29 10:26:09 +0300
committerDavid S. Miller <davem@davemloft.net>2021-09-29 13:00:11 +0300
commit7b14e15ae6f4850392800482efb54d5cf4ae300c (patch)
tree4857420af83ce1abaa4ff581b31303fcc5c5c109 /include/net
parent43f55f23f70881e9c397557f15c8090b368d0af2 (diff)
downloadlinux-7b14e15ae6f4850392800482efb54d5cf4ae300c.tar.xz
mctp: Implement a timeout for tags
Currently, a MCTP (local-eid,remote-eid,tag) tuple is allocated to a socket on send, and only expires when the socket is closed. This change introduces a tag timeout, freeing the tuple after a fixed expiry - currently six seconds. This is greater than (but close to) the max response timeout in upper-layer bindings. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/mctp.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/mctp.h b/include/net/mctp.h
index bf783dc3ea45..b9ed62a63c24 100644
--- a/include/net/mctp.h
+++ b/include/net/mctp.h
@@ -62,6 +62,11 @@ struct mctp_sock {
* by sk->net->keys_lock
*/
struct hlist_head keys;
+
+ /* mechanism for expiring allocated keys; will release an allocated
+ * tag, and any netdev state for a request/response pairing
+ */
+ struct timer_list key_expiry;
};
/* Key for matching incoming packets to sockets or reassembly contexts.
@@ -107,6 +112,8 @@ struct mctp_sock {
* the (complete) reply, or during reassembly errors. Here, we clean up
* the reassembly context (marking reasm_dead, to prevent another from
* starting), and remove the socket from the netns & socket lists.
+ *
+ * - through an expiry timeout, on a per-socket timer
*/
struct mctp_sk_key {
mctp_eid_t peer_addr;
@@ -138,6 +145,9 @@ struct mctp_sk_key {
/* key validity */
bool valid;
+
+ /* expiry timeout; valid (above) cleared on expiry */
+ unsigned long expiry;
};
struct mctp_skb_cb {