summaryrefslogtreecommitdiff
path: root/net/smc/smc_llc.h
diff options
context:
space:
mode:
authorKarsten Graul <kgraul@linux.ibm.com>2020-05-04 14:18:45 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-04 10:54:39 -0700
commit3e0c40afce4ea5b08bb7e3f65c55157817116640 (patch)
treeaef0d3695b0a2ea18b3603aed2e5b92ecc7671fb /net/smc/smc_llc.h
parentad6c111b8ae760114df6765d5a5ed1b09020d45d (diff)
net/smc: add termination reason and handle LLC protocol violation
Allow to set the reason code for the link group termination, and set meaningful values before termination processing is triggered. This reason code is sent to the peer in the final delete link message. When the LLC request or response layer receives a message type that was not handled, drop a warning and terminate the link group. Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_llc.h')
-rw-r--r--net/smc/smc_llc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/smc/smc_llc.h b/net/smc/smc_llc.h
index 6d2a5d943b83..f5882ebf357b 100644
--- a/net/smc/smc_llc.h
+++ b/net/smc/smc_llc.h
@@ -60,6 +60,14 @@ static inline struct smc_link *smc_llc_usable_link(struct smc_link_group *lgr)
return NULL;
}
+/* set the termination reason code for the link group */
+static inline void smc_llc_set_termination_rsn(struct smc_link_group *lgr,
+ u32 rsn)
+{
+ if (!lgr->llc_termination_rsn)
+ lgr->llc_termination_rsn = rsn;
+}
+
/* transmit */
int smc_llc_send_confirm_link(struct smc_link *lnk,
enum smc_llc_reqresp reqresp);