net/smc: add logic to evaluate CONFIRM_LINK messages to LLC layer
authorKarsten Graul <kgraul@linux.ibm.com>
Thu, 30 Apr 2020 13:55:41 +0000 (15:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Apr 2020 19:44:33 +0000 (12:44 -0700)
Introduce smc_llc_eval_conf_link() to evaluate the CONFIRM_LINK message
contents. This implements this logic at the LLC layer. The function will
be used by af_smc.c to process the received LLC layer messages.

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>
net/smc/smc_llc.c
net/smc/smc_llc.h

index a146b3b43580422508831e10fce58ad8f4d27de3..9248b90fe37e311caa310d67100a00a46779eae8 100644 (file)
@@ -946,6 +946,17 @@ out:
        return rc;
 }
 
+/* evaluate confirm link request or response */
+int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry,
+                          enum smc_llc_reqresp type)
+{
+       if (type == SMC_LLC_REQ)        /* SMC server assigns link_id */
+               qentry->link->link_id = qentry->msg.confirm_link.link_num;
+       if (!(qentry->msg.raw.hdr.flags & SMC_LLC_FLAG_NO_RMBE_EYEC))
+               return -ENOTSUPP;
+       return 0;
+}
+
 /***************************** init, exit, misc ******************************/
 
 static struct smc_wr_rx_handler smc_llc_rx_handlers[] = {
index 49e99ff00ee7fdee46635563010ca4d66ea507fd..637acf91ffb7cbc046d883e5501e18b110c5f67d 100644 (file)
@@ -66,6 +66,8 @@ int smc_llc_do_delete_rkey(struct smc_link *link,
 int smc_llc_flow_initiate(struct smc_link_group *lgr,
                          enum smc_llc_flowtype type);
 void smc_llc_flow_stop(struct smc_link_group *lgr, struct smc_llc_flow *flow);
+int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry,
+                          enum smc_llc_reqresp type);
 struct smc_llc_qentry *smc_llc_wait(struct smc_link_group *lgr,
                                    struct smc_link *lnk,
                                    int time_out, u8 exp_msg);