sctp: remove prsctp_param from sctp_chunk
Now sctp uses chunk->prsctp_param to save the prsctp param for all the
prsctp polices, we didn't need to introduce prsctp_param to sctp_chunk.
We can just use chunk->sinfo.sinfo_timetolive for RTX and BUF polices,
and reuse msg->expires_at for TTL policy, as the prsctp polices and old
expires policy are mutual exclusive.
This patch is to remove prsctp_param from sctp_chunk, and reuse msg's
expires_at for TTL and chunk's sinfo.sinfo_timetolive for RTX and BUF
polices.
Note that sctp can't use chunk's sinfo.sinfo_timetolive for TTL policy,
as it needs a u64 variables to save the expires_at time.
This one also fixes the "netperf-Throughput_Mbps -37.2% regression"
issue.
Fixes: a6c2f79287
("sctp: implement prsctp TTL policy")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
73dca124cd
commit
0605483f6a
@@ -179,6 +179,11 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
|
||||
msg, msg->expires_at, jiffies);
|
||||
}
|
||||
|
||||
if (asoc->prsctp_enable &&
|
||||
SCTP_PR_TTL_ENABLED(sinfo->sinfo_flags))
|
||||
msg->expires_at =
|
||||
jiffies + msecs_to_jiffies(sinfo->sinfo_timetolive);
|
||||
|
||||
/* This is the biggest possible DATA chunk that can fit into
|
||||
* the packet
|
||||
*/
|
||||
@@ -349,14 +354,14 @@ int sctp_chunk_abandoned(struct sctp_chunk *chunk)
|
||||
}
|
||||
|
||||
if (SCTP_PR_TTL_ENABLED(chunk->sinfo.sinfo_flags) &&
|
||||
time_after(jiffies, chunk->prsctp_param)) {
|
||||
time_after(jiffies, chunk->msg->expires_at)) {
|
||||
if (chunk->sent_count)
|
||||
chunk->asoc->abandoned_sent[SCTP_PR_INDEX(TTL)]++;
|
||||
else
|
||||
chunk->asoc->abandoned_unsent[SCTP_PR_INDEX(TTL)]++;
|
||||
return 1;
|
||||
} else if (SCTP_PR_RTX_ENABLED(chunk->sinfo.sinfo_flags) &&
|
||||
chunk->sent_count > chunk->prsctp_param) {
|
||||
chunk->sent_count > chunk->sinfo.sinfo_timetolive) {
|
||||
chunk->asoc->abandoned_sent[SCTP_PR_INDEX(RTX)]++;
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user