Skip to content

Commit 2d2bfeb

Browse files
Ursula Braundavem330
authored andcommitted
net/smc: set rx_off for SMCR explicitly
SMC tries to make use of SMCD first. If a problem shows up, it tries to switch to SMCR. If the SMCD initializing problem shows up after the SMCD connection has already been initialized, field rx_off keeps the wrong SMCD value for SMCR, which results in corrupted data at the receiver. This patch adds an explicit (re-)setting of field rx_off to zero if the connection uses SMCR. Fixes: be244f2 ("net/smc: add SMC-D support in data transfer") Reviewed-by: Karsten Graul <[email protected]> Signed-off-by: Ursula Braun <[email protected]> Signed-off-by: Karsten Graul <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fffe83c commit 2d2bfeb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/smc/smc_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,8 @@ int smc_conn_create(struct smc_sock *smc, struct smc_init_info *ini)
13561356
if (ini->is_smcd) {
13571357
conn->rx_off = sizeof(struct smcd_cdc_msg);
13581358
smcd_cdc_rx_init(conn); /* init tasklet for this conn */
1359+
} else {
1360+
conn->rx_off = 0;
13591361
}
13601362
#ifndef KERNEL_HAS_ATOMIC64
13611363
spin_lock_init(&conn->acurs_lock);

0 commit comments

Comments
 (0)