summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2024-12-04 07:46:42 +0000
committerJakub Kicinski <kuba@kernel.org>2024-12-09 13:48:26 -0800
commitcd69a07b6d186eeb7df20d8bcbef18d7bbd84c4b (patch)
treed3063a63e6f5acd653c59a0597a0b73c02572389
parent9e3cccd176b5ec6ff78693287fb03097e453e69c (diff)
rxrpc: Fix injection of packet loss
Fix the code that injects packet loss for testing to make sure call->tx_transmitted is updated. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org Link: https://patch.msgid.link/20241204074710.990092-15-dhowells@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--net/rxrpc/output.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c
index aededdd474d7..ca0da5e5d278 100644
--- a/net/rxrpc/output.c
+++ b/net/rxrpc/output.c
@@ -544,16 +544,6 @@ static int rxrpc_send_data_packet(struct rxrpc_call *call, struct rxrpc_txbuf *t
len = rxrpc_prepare_data_packet(call, txb, n);
- if (IS_ENABLED(CONFIG_AF_RXRPC_INJECT_LOSS)) {
- static int lose;
- if ((lose++ & 7) == 7) {
- ret = 0;
- trace_rxrpc_tx_data(call, txb->seq, txb->serial,
- txb->flags, true);
- goto done;
- }
- }
-
iov_iter_kvec(&msg.msg_iter, WRITE, call->local->kvec, n, len);
msg.msg_name = &call->peer->srx.transport;
@@ -579,6 +569,17 @@ static int rxrpc_send_data_packet(struct rxrpc_call *call, struct rxrpc_txbuf *t
frag = rxrpc_tx_point_call_data_nofrag;
}
+ if (IS_ENABLED(CONFIG_AF_RXRPC_INJECT_LOSS)) {
+ static int lose;
+
+ if ((lose++ & 7) == 7) {
+ ret = 0;
+ trace_rxrpc_tx_data(call, txb->seq, txb->serial,
+ txb->flags, true);
+ goto done;
+ }
+ }
+
retry:
/* send the packet by UDP
* - returns -EMSGSIZE if UDP would have to fragment the packet