diff options
author | Jeremy Kerr <jk@codeconstruct.com.au> | 2021-09-29 09:26:09 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-29 12:00:11 +0200 |
commit | 7b14e15ae6f4850392800482efb54d5cf4ae300c (patch) | |
tree | 4857420af83ce1abaa4ff581b31303fcc5c5c109 /include/net/mctp.h | |
parent | mctp: Add refcounts to mctp_dev (diff) | |
download | linux-7b14e15ae6f4850392800482efb54d5cf4ae300c.tar.xz linux-7b14e15ae6f4850392800482efb54d5cf4ae300c.zip |
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/mctp.h')
-rw-r--r-- | include/net/mctp.h | 10 |
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 { |