diff options
author | Ursula Braun <ubraun@linux.ibm.com> | 2019-02-07 14:52:54 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 09:21:09 +0100 |
commit | 5c29e33a2245be2a2a21657cf0d7a962e66e9b9b (patch) | |
tree | 5f3a5b44b90bdd4b269a8dff19ffa8244f7a545b /net/smc/smc_cdc.h | |
parent | 932ff095dac83d9ded67b8971c38631343368a2f (diff) | |
download | linux-stable-5c29e33a2245be2a2a21657cf0d7a962e66e9b9b.tar.gz linux-stable-5c29e33a2245be2a2a21657cf0d7a962e66e9b9b.tar.bz2 linux-stable-5c29e33a2245be2a2a21657cf0d7a962e66e9b9b.zip |
net/smc: fix byte_order for rx_curs_confirmed
[ Upstream commit ccc8ca9b90acb45a3309f922b2591b07b4e070ec ]
The recent change in the rx_curs_confirmed assignment disregards
byte order, which causes problems on little endian architectures.
This patch fixes it.
Fixes: b8649efad879 ("net/smc: fix sender_free computation") (net-tree)
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/smc/smc_cdc.h')
-rw-r--r-- | net/smc/smc_cdc.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/smc/smc_cdc.h b/net/smc/smc_cdc.h index 2377a51772d5..34d2e1450320 100644 --- a/net/smc/smc_cdc.h +++ b/net/smc/smc_cdc.h @@ -186,26 +186,27 @@ static inline int smc_curs_diff_large(unsigned int size, static inline void smc_host_cursor_to_cdc(union smc_cdc_cursor *peer, union smc_host_cursor *local, + union smc_host_cursor *save, struct smc_connection *conn) { - union smc_host_cursor temp; - - smc_curs_copy(&temp, local, conn); - peer->count = htonl(temp.count); - peer->wrap = htons(temp.wrap); + smc_curs_copy(save, local, conn); + peer->count = htonl(save->count); + peer->wrap = htons(save->wrap); /* peer->reserved = htons(0); must be ensured by caller */ } static inline void smc_host_msg_to_cdc(struct smc_cdc_msg *peer, - struct smc_host_cdc_msg *local, - struct smc_connection *conn) + struct smc_connection *conn, + union smc_host_cursor *save) { + struct smc_host_cdc_msg *local = &conn->local_tx_ctrl; + peer->common.type = local->common.type; peer->len = local->len; peer->seqno = htons(local->seqno); peer->token = htonl(local->token); - smc_host_cursor_to_cdc(&peer->prod, &local->prod, conn); - smc_host_cursor_to_cdc(&peer->cons, &local->cons, conn); + smc_host_cursor_to_cdc(&peer->prod, &local->prod, save, conn); + smc_host_cursor_to_cdc(&peer->cons, &local->cons, save, conn); peer->prod_flags = local->prod_flags; peer->conn_state_flags = local->conn_state_flags; } |