aboutsummaryrefslogtreecommitdiffstats
path: root/net/smc
diff options
context:
space:
mode:
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/smc_cdc.c4
-rw-r--r--net/smc/smc_cdc.h19
2 files changed, 11 insertions, 12 deletions
diff --git a/net/smc/smc_cdc.c b/net/smc/smc_cdc.c
index a712c9f8699b..fb07ad8d69a6 100644
--- a/net/smc/smc_cdc.c
+++ b/net/smc/smc_cdc.c
@@ -101,9 +101,7 @@ int smc_cdc_msg_send(struct smc_connection *conn,
101 101
102 conn->tx_cdc_seq++; 102 conn->tx_cdc_seq++;
103 conn->local_tx_ctrl.seqno = conn->tx_cdc_seq; 103 conn->local_tx_ctrl.seqno = conn->tx_cdc_seq;
104 smc_host_msg_to_cdc((struct smc_cdc_msg *)wr_buf, 104 smc_host_msg_to_cdc((struct smc_cdc_msg *)wr_buf, conn, &cfed);
105 &conn->local_tx_ctrl, conn);
106 smc_curs_copy(&cfed, &((struct smc_host_cdc_msg *)wr_buf)->cons, conn);
107 rc = smc_wr_tx_send(link, (struct smc_wr_tx_pend_priv *)pend); 105 rc = smc_wr_tx_send(link, (struct smc_wr_tx_pend_priv *)pend);
108 if (!rc) 106 if (!rc)
109 smc_curs_copy(&conn->rx_curs_confirmed, &cfed, conn); 107 smc_curs_copy(&conn->rx_curs_confirmed, &cfed, conn);
diff --git a/net/smc/smc_cdc.h b/net/smc/smc_cdc.h
index 271e2524dc8f..f1cdde9d4b89 100644
--- a/net/smc/smc_cdc.h
+++ b/net/smc/smc_cdc.h
@@ -211,26 +211,27 @@ static inline int smc_curs_diff_large(unsigned int size,
211 211
212static inline void smc_host_cursor_to_cdc(union smc_cdc_cursor *peer, 212static inline void smc_host_cursor_to_cdc(union smc_cdc_cursor *peer,
213 union smc_host_cursor *local, 213 union smc_host_cursor *local,
214 union smc_host_cursor *save,
214 struct smc_connection *conn) 215 struct smc_connection *conn)
215{ 216{
216 union smc_host_cursor temp; 217 smc_curs_copy(save, local, conn);
217 218 peer->count = htonl(save->count);
218 smc_curs_copy(&temp, local, conn); 219 peer->wrap = htons(save->wrap);
219 peer->count = htonl(temp.count);
220 peer->wrap = htons(temp.wrap);
221 /* peer->reserved = htons(0); must be ensured by caller */ 220 /* peer->reserved = htons(0); must be ensured by caller */
222} 221}
223 222
224static inline void smc_host_msg_to_cdc(struct smc_cdc_msg *peer, 223static inline void smc_host_msg_to_cdc(struct smc_cdc_msg *peer,
225 struct smc_host_cdc_msg *local, 224 struct smc_connection *conn,
226 struct smc_connection *conn) 225 union smc_host_cursor *save)
227{ 226{
227 struct smc_host_cdc_msg *local = &conn->local_tx_ctrl;
228
228 peer->common.type = local->common.type; 229 peer->common.type = local->common.type;
229 peer->len = local->len; 230 peer->len = local->len;
230 peer->seqno = htons(local->seqno); 231 peer->seqno = htons(local->seqno);
231 peer->token = htonl(local->token); 232 peer->token = htonl(local->token);
232 smc_host_cursor_to_cdc(&peer->prod, &local->prod, conn); 233 smc_host_cursor_to_cdc(&peer->prod, &local->prod, save, conn);
233 smc_host_cursor_to_cdc(&peer->cons, &local->cons, conn); 234 smc_host_cursor_to_cdc(&peer->cons, &local->cons, save, conn);
234 peer->prod_flags = local->prod_flags; 235 peer->prod_flags = local->prod_flags;
235 peer->conn_state_flags = local->conn_state_flags; 236 peer->conn_state_flags = local->conn_state_flags;
236} 237}