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>
This commit is contained in:
committed by
David S. Miller
parent
43f55f23f7
commit
7b14e15ae6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user