Skip to content

Commit 2ab2721

Browse files
committed
rxrpc: Remove skb_count from struct rxrpc_call
Remove the sk_buff count from the rxrpc_call struct as it's less useful once we stop queueing sk_buffs. Signed-off-by: David Howells <dhowells@redhat.com>
1 parent de8d6c7 commit 2ab2721

File tree

3 files changed

+15
-30
lines changed

3 files changed

+15
-30
lines changed

include/trace/events/rxrpc.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@
1818

1919
TRACE_EVENT(rxrpc_call,
2020
TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
21-
int usage, int nskb,
22-
const void *where, const void *aux),
21+
int usage, const void *where, const void *aux),
2322

24-
TP_ARGS(call, op, usage, nskb, where, aux),
23+
TP_ARGS(call, op, usage, where, aux),
2524

2625
TP_STRUCT__entry(
2726
__field(struct rxrpc_call *, call )
2827
__field(int, op )
2928
__field(int, usage )
30-
__field(int, nskb )
3129
__field(const void *, where )
3230
__field(const void *, aux )
3331
),
@@ -36,16 +34,14 @@ TRACE_EVENT(rxrpc_call,
3634
__entry->call = call;
3735
__entry->op = op;
3836
__entry->usage = usage;
39-
__entry->nskb = nskb;
4037
__entry->where = where;
4138
__entry->aux = aux;
4239
),
4340

44-
TP_printk("c=%p %s u=%d s=%d p=%pSR a=%p",
41+
TP_printk("c=%p %s u=%d sp=%pSR a=%p",
4542
__entry->call,
4643
rxrpc_call_traces[__entry->op],
4744
__entry->usage,
48-
__entry->nskb,
4945
__entry->where,
5046
__entry->aux)
5147
);

net/rxrpc/ar-internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ struct rxrpc_call {
467467
enum rxrpc_call_state state; /* current state of call */
468468
enum rxrpc_call_completion completion; /* Call completion condition */
469469
atomic_t usage;
470-
atomic_t skb_count; /* Outstanding packets on this call */
471470
atomic_t sequence; /* Tx data packet sequence counter */
472471
u16 service_id; /* service ID */
473472
u8 security_ix; /* Security type */

net/rxrpc/call_object.c

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,8 @@ struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx,
232232
return call;
233233
}
234234

235-
trace_rxrpc_call(call, rxrpc_call_new_client,
236-
atomic_read(&call->usage), 0,
237-
here, (const void *)user_call_ID);
235+
trace_rxrpc_call(call, 0, atomic_read(&call->usage), here,
236+
(const void *)user_call_ID);
238237

239238
/* Publish the call, even though it is incompletely set up as yet */
240239
call->user_call_ID = user_call_ID;
@@ -325,7 +324,7 @@ struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *rx,
325324
return ERR_PTR(-EBUSY);
326325

327326
trace_rxrpc_call(candidate, rxrpc_call_new_service,
328-
atomic_read(&candidate->usage), 0, here, NULL);
327+
atomic_read(&candidate->usage), here, NULL);
329328

330329
chan = sp->hdr.cid & RXRPC_CHANNELMASK;
331330
candidate->conn = conn;
@@ -446,11 +445,10 @@ bool rxrpc_queue_call(struct rxrpc_call *call)
446445
{
447446
const void *here = __builtin_return_address(0);
448447
int n = __atomic_add_unless(&call->usage, 1, 0);
449-
int m = atomic_read(&call->skb_count);
450448
if (n == 0)
451449
return false;
452450
if (rxrpc_queue_work(&call->processor))
453-
trace_rxrpc_call(call, rxrpc_call_queued, n + 1, m, here, NULL);
451+
trace_rxrpc_call(call, rxrpc_call_queued, n + 1, here, NULL);
454452
else
455453
rxrpc_put_call(call, rxrpc_call_put_noqueue);
456454
return true;
@@ -463,10 +461,9 @@ bool __rxrpc_queue_call(struct rxrpc_call *call)
463461
{
464462
const void *here = __builtin_return_address(0);
465463
int n = atomic_read(&call->usage);
466-
int m = atomic_read(&call->skb_count);
467464
ASSERTCMP(n, >=, 1);
468465
if (rxrpc_queue_work(&call->processor))
469-
trace_rxrpc_call(call, rxrpc_call_queued_ref, n, m, here, NULL);
466+
trace_rxrpc_call(call, rxrpc_call_queued_ref, n, here, NULL);
470467
else
471468
rxrpc_put_call(call, rxrpc_call_put_noqueue);
472469
return true;
@@ -480,9 +477,8 @@ void rxrpc_see_call(struct rxrpc_call *call)
480477
const void *here = __builtin_return_address(0);
481478
if (call) {
482479
int n = atomic_read(&call->usage);
483-
int m = atomic_read(&call->skb_count);
484480

485-
trace_rxrpc_call(call, rxrpc_call_seen, n, m, here, NULL);
481+
trace_rxrpc_call(call, rxrpc_call_seen, n, here, NULL);
486482
}
487483
}
488484

@@ -493,9 +489,8 @@ void rxrpc_get_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
493489
{
494490
const void *here = __builtin_return_address(0);
495491
int n = atomic_inc_return(&call->usage);
496-
int m = atomic_read(&call->skb_count);
497492

498-
trace_rxrpc_call(call, op, n, m, here, NULL);
493+
trace_rxrpc_call(call, op, n, here, NULL);
499494
}
500495

501496
/*
@@ -505,9 +500,8 @@ void rxrpc_get_call_for_skb(struct rxrpc_call *call, struct sk_buff *skb)
505500
{
506501
const void *here = __builtin_return_address(0);
507502
int n = atomic_inc_return(&call->usage);
508-
int m = atomic_inc_return(&call->skb_count);
509503

510-
trace_rxrpc_call(call, rxrpc_call_got_skb, n, m, here, skb);
504+
trace_rxrpc_call(call, rxrpc_call_got_skb, n, here, skb);
511505
}
512506

513507
/*
@@ -642,17 +636,15 @@ void rxrpc_release_calls_on_socket(struct rxrpc_sock *rx)
642636
void rxrpc_put_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
643637
{
644638
const void *here = __builtin_return_address(0);
645-
int n, m;
639+
int n;
646640

647641
ASSERT(call != NULL);
648642

649643
n = atomic_dec_return(&call->usage);
650-
m = atomic_read(&call->skb_count);
651-
trace_rxrpc_call(call, op, n, m, here, NULL);
644+
trace_rxrpc_call(call, op, n, here, NULL);
652645
ASSERTCMP(n, >=, 0);
653646
if (n == 0) {
654647
_debug("call %d dead", call->debug_id);
655-
WARN_ON(m != 0);
656648
rxrpc_cleanup_call(call);
657649
}
658650
}
@@ -663,15 +655,13 @@ void rxrpc_put_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
663655
void rxrpc_put_call_for_skb(struct rxrpc_call *call, struct sk_buff *skb)
664656
{
665657
const void *here = __builtin_return_address(0);
666-
int n, m;
658+
int n;
667659

668660
n = atomic_dec_return(&call->usage);
669-
m = atomic_dec_return(&call->skb_count);
670-
trace_rxrpc_call(call, rxrpc_call_put_skb, n, m, here, skb);
661+
trace_rxrpc_call(call, rxrpc_call_put_skb, n, here, skb);
671662
ASSERTCMP(n, >=, 0);
672663
if (n == 0) {
673664
_debug("call %d dead", call->debug_id);
674-
WARN_ON(m != 0);
675665
rxrpc_cleanup_call(call);
676666
}
677667
}

0 commit comments

Comments
 (0)