summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2021-09-29 10:26:09 +0300
committerJoel Stanley <joel@jms.id.au>2022-03-18 03:36:26 +0300
commit628aab648216b5f7a33747b571b42f5494b0918e (patch)
treea6aee04f2483ed1099980e01904e63f6ef967126 /include/net
parent686359701767e3f9e5de8386ccc8e64b8a91520d (diff)
downloadlinux-628aab648216b5f7a33747b571b42f5494b0918e.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. OpenBMC-Staging-Count: 1 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 7b14e15ae6f4850392800482efb54d5cf4ae300c) Signed-off-by: Joel Stanley <joel@jms.id.au>
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 ac59537bdf7c..2a83443bdfac 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 {