Skip to content

Commit 4041a8f

Browse files
committed
rxrpc: Remove call->input_lock
Remove call->input_lock as it was only necessary to serialise access to the state stored in the rxrpc_call struct by simultaneous softirq handlers presenting received packets. They now dump the packets in a queue and a single process-context handler now processes them. Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected]
1 parent ff73482 commit 4041a8f

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

net/rxrpc/ar-internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ struct rxrpc_call {
657657
rxrpc_seq_t rx_consumed; /* Highest packet consumed */
658658
rxrpc_serial_t rx_serial; /* Highest serial received for this call */
659659
u8 rx_winsize; /* Size of Rx window */
660-
spinlock_t input_lock; /* Lock for packet input to this call */
661660

662661
/* TCP-style slow-start congestion control [RFC5681]. Since the SMSS
663662
* is fixed, we keep these numbers in terms of segments (ie. DATA

net/rxrpc/call_object.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ struct rxrpc_call *rxrpc_alloc_call(struct rxrpc_sock *rx, gfp_t gfp,
143143
init_waitqueue_head(&call->waitq);
144144
spin_lock_init(&call->notify_lock);
145145
spin_lock_init(&call->tx_lock);
146-
spin_lock_init(&call->input_lock);
147146
spin_lock_init(&call->acks_ack_lock);
148147
rwlock_init(&call->state_lock);
149148
refcount_set(&call->ref, 1);

net/rxrpc/input.c

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,6 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb)
588588
}
589589
}
590590

591-
spin_lock(&call->input_lock);
592-
593591
/* Received data implicitly ACKs all of the request packets we sent
594592
* when we're acting as a client.
595593
*/
@@ -607,8 +605,6 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb)
607605
out:
608606
trace_rxrpc_notify_socket(call->debug_id, serial);
609607
rxrpc_notify_socket(call);
610-
611-
spin_unlock(&call->input_lock);
612608
rxrpc_free_skb(skb, rxrpc_skb_put_input);
613609
_leave(" [queued]");
614610
}
@@ -811,7 +807,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
811807
offset = sizeof(struct rxrpc_wire_header);
812808
if (skb_copy_bits(skb, offset, &ack, sizeof(ack)) < 0) {
813809
rxrpc_proto_abort("XAK", call, 0);
814-
goto out_not_locked;
810+
goto out;
815811
}
816812
offset += sizeof(ack);
817813

@@ -863,7 +859,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
863859
rxrpc_is_client_call(call)) {
864860
rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED,
865861
0, -ENETRESET);
866-
return;
862+
goto out;
867863
}
868864

869865
/* If we get an OUT_OF_SEQUENCE ACK from the server, that can also
@@ -877,30 +873,28 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
877873
rxrpc_is_client_call(call)) {
878874
rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED,
879875
0, -ENETRESET);
880-
return;
876+
goto out;
881877
}
882878

883879
/* Discard any out-of-order or duplicate ACKs (outside lock). */
884880
if (!rxrpc_is_ack_valid(call, first_soft_ack, prev_pkt)) {
885881
trace_rxrpc_rx_discard_ack(call->debug_id, ack_serial,
886882
first_soft_ack, call->acks_first_seq,
887883
prev_pkt, call->acks_prev_seq);
888-
goto out_not_locked;
884+
goto out;
889885
}
890886

891887
info.rxMTU = 0;
892888
ioffset = offset + nr_acks + 3;
893889
if (skb->len >= ioffset + sizeof(info) &&
894890
skb_copy_bits(skb, ioffset, &info, sizeof(info)) < 0) {
895891
rxrpc_proto_abort("XAI", call, 0);
896-
goto out_not_locked;
892+
goto out;
897893
}
898894

899895
if (nr_acks > 0)
900896
skb_condense(skb);
901897

902-
spin_lock(&call->input_lock);
903-
904898
/* Discard any out-of-order or duplicate ACKs (inside lock). */
905899
if (!rxrpc_is_ack_valid(call, first_soft_ack, prev_pkt)) {
906900
trace_rxrpc_rx_discard_ack(call->debug_id, ack_serial,
@@ -992,8 +986,6 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
992986

993987
rxrpc_congestion_management(call, skb, &summary, acked_serial);
994988
out:
995-
spin_unlock(&call->input_lock);
996-
out_not_locked:
997989
rxrpc_free_skb(skb_put, rxrpc_skb_put_input);
998990
rxrpc_free_skb(skb_old, rxrpc_skb_put_ack);
999991
}
@@ -1005,12 +997,8 @@ static void rxrpc_input_ackall(struct rxrpc_call *call, struct sk_buff *skb)
1005997
{
1006998
struct rxrpc_ack_summary summary = { 0 };
1007999

1008-
spin_lock(&call->input_lock);
1009-
10101000
if (rxrpc_rotate_tx_window(call, call->tx_top, &summary))
10111001
rxrpc_end_tx_phase(call, false, "ETL");
1012-
1013-
spin_unlock(&call->input_lock);
10141002
}
10151003

10161004
/*

0 commit comments

Comments
 (0)