Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490236
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH net-next 10/15] rxrpc: Don't call the tx_ack tracepoint if don't generate an ACK |
| Date | 2016-09-23 17:20 +0200 |
| Message-ID | <skAqB-5wp-19@gated-at.bofh.it> (permalink) |
| References | <skAqB-5wp-5@gated-at.bofh.it> |
| Organization | Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 |
rxrpc_send_call_packet() is invoking the tx_ack tracepoint before it checks
whether there's an ACK to transmit (another thread may jump in and transmit
it).
Fix this by only invoking the tracepoint if we get a valid ACK to transmit.
Further, only allocate a serial number if we're going to actually transmit
something.
Signed-off-by: David Howells <dhowells@redhat.com>
---
net/rxrpc/output.c | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c
index 282cb1e36d06..5c1e008a5323 100644
--- a/net/rxrpc/output.c
+++ b/net/rxrpc/output.c
@@ -80,9 +80,6 @@ static size_t rxrpc_fill_out_ack(struct rxrpc_call *call,
pkt->ackinfo.rwind = htonl(call->rx_winsize);
pkt->ackinfo.jumbo_max = htonl(jmax);
- trace_rxrpc_tx_ack(call, hard_ack + 1, serial, call->ackr_reason,
- top - hard_ack);
-
*ackp++ = 0;
*ackp++ = 0;
*ackp++ = 0;
@@ -119,8 +116,6 @@ int rxrpc_send_call_packet(struct rxrpc_call *call, u8 type)
return -ENOMEM;
}
- serial = atomic_inc_return(&conn->serial);
-
msg.msg_name = &call->peer->srx.transport;
msg.msg_namelen = call->peer->srx.transport_len;
msg.msg_control = NULL;
@@ -131,7 +126,6 @@ int rxrpc_send_call_packet(struct rxrpc_call *call, u8 type)
pkt->whdr.cid = htonl(call->cid);
pkt->whdr.callNumber = htonl(call->call_id);
pkt->whdr.seq = 0;
- pkt->whdr.serial = htonl(serial);
pkt->whdr.type = type;
pkt->whdr.flags = conn->out_clientflag;
pkt->whdr.userStatus = 0;
@@ -157,14 +151,6 @@ int rxrpc_send_call_packet(struct rxrpc_call *call, u8 type)
spin_unlock_bh(&call->lock);
- _proto("Tx ACK %%%u { m=%hu f=#%u p=#%u s=%%%u r=%s n=%u }",
- serial,
- ntohs(pkt->ack.maxSkew),
- ntohl(pkt->ack.firstPacket),
- ntohl(pkt->ack.previousPacket),
- ntohl(pkt->ack.serial),
- rxrpc_acks(pkt->ack.reason),
- pkt->ack.nAcks);
iov[0].iov_len += sizeof(pkt->ack) + n;
iov[1].iov_base = &pkt->ackinfo;
@@ -176,7 +162,6 @@ int rxrpc_send_call_packet(struct rxrpc_call *call, u8 type)
case RXRPC_PACKET_TYPE_ABORT:
abort_code = call->abort_code;
pkt->abort_code = htonl(abort_code);
- _proto("Tx ABORT %%%u { %d }", serial, abort_code);
iov[0].iov_len += sizeof(pkt->abort_code);
len += sizeof(pkt->abort_code);
ioc = 1;
@@ -188,6 +173,17 @@ int rxrpc_send_call_packet(struct rxrpc_call *call, u8 type)
goto out;
}
+ serial = atomic_inc_return(&conn->serial);
+ pkt->whdr.serial = htonl(serial);
+ switch (type) {
+ case RXRPC_PACKET_TYPE_ACK:
+ trace_rxrpc_tx_ack(call,
+ ntohl(pkt->ack.firstPacket),
+ ntohl(pkt->ack.serial),
+ pkt->ack.reason, pkt->ack.nAcks);
+ break;
+ }
+
if (ping) {
call->ackr_ping = serial;
smp_wmb();
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net-next 00/15] rxrpc: Bug fixes and tracepoints David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 13/15] rxrpc: Add a tracepoint to log injected Rx packet loss David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 11/15] rxrpc: Add a tracepoint for the call timer David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 05/15] rxrpc: Use before_eq() and friends to compare serial numbers David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 10/15] rxrpc: Don't call the tx_ack tracepoint if don't generate an ACK David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 08/15] rxrpc: Fix call timer David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
Re: [PATCH net-next 08/15] rxrpc: Fix call timer Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-23 20:10 +0200
Re: [PATCH net-next 08/15] rxrpc: Fix call timer David Howells <dhowells@redhat.com> - 2016-09-23 20:30 +0200
[PATCH net-next 09/15] rxrpc: Pass the last Tx packet marker in the annotation buffer David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 04/15] rxrpc: Should be using ktime_add_ms() not ktime_add_ns() David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 03/15] rxrpc: Make sure sendmsg() is woken on call completion David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 14/15] rxrpc: Add tracepoint for ACK proposal David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 15/15] rxrpc: Add a tracepoint to log which packets will be retransmitted David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 01/15] rxrpc: Preset timestamp on Tx sk_buffs David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
[PATCH net-next 07/15] rxrpc: Fix accidental cancellation of scheduled resend by ACK parser David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
Re: [PATCH net-next 07/15] rxrpc: Fix accidental cancellation of scheduled resend by ACK parser Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-23 20:10 +0200
Re: [PATCH net-next 07/15] rxrpc: Fix accidental cancellation of scheduled resend by ACK parser David Howells <dhowells@redhat.com> - 2016-09-23 20:30 +0200
[PATCH net-next 06/15] rxrpc: Need to start the resend timer on initial transmission David Howells <dhowells@redhat.com> - 2016-09-23 17:20 +0200
Re: [PATCH net-next 00/15] rxrpc: Bug fixes and tracepoints David Miller <davem@davemloft.net> - 2016-09-24 14:30 +0200
csiph-web