BACKPORT: tcp_cubic: use memset and offsetof init

In bictcp_reset(), use memset and offsetof instead of = 0.

Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
Link: https://lore.kernel.org/r/1610597696-128610-1-git-send-email-yejune.deng@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit f4d133d86af7f39a0f5bdaf7a888ec7b84733b5e)
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>

Change-Id: I6c29c4c2d4b7d69b60f8fdabf634e435693ae21b
This commit is contained in:
Yejune Deng 2021-01-14 12:14:56 +08:00 committed by Adithya R
parent 7c195f7d06
commit 79575c4016

View File

@ -103,16 +103,7 @@ struct bictcp {
static inline void bictcp_reset(struct bictcp *ca)
{
ca->cnt = 0;
ca->last_max_cwnd = 0;
ca->last_cwnd = 0;
ca->last_time = 0;
ca->bic_origin_point = 0;
ca->bic_K = 0;
ca->delay_min = 0;
ca->epoch_start = 0;
ca->ack_cnt = 0;
ca->tcp_cwnd = 0;
memset(ca, 0, offsetof(struct bictcp, unused));
ca->found = 0;
}