From ae873cca3e8a525e1698ce694576d5e317b214e9 Mon Sep 17 00:00:00 2001 From: Michael Blizek Date: Sat, 5 Sep 2020 14:03:17 +0200 Subject: [PATCH] full mss for high latency conns --- net/cor/cor.h | 12 ++++++------ net/cor/rcv.c | 44 ++++++++++++++++++-------------------------- net/cor/snd.c | 7 ++++--- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/net/cor/cor.h b/net/cor/cor.h index a2160355a26e..25d34e9d660c 100644 --- a/net/cor/cor.h +++ b/net/cor/cor.h @@ -706,8 +706,7 @@ struct conn{ __u8 sourcetype:4, targettype:4; - __u8 is_client:1, - is_highlatency:1; + __u8 is_client; /* * isreset values: @@ -720,7 +719,8 @@ struct conn{ */ __u8 isreset; - __u8 flush; + __u8 flush:1, + is_highlatency:1; struct kref ref; @@ -1481,12 +1481,12 @@ static inline __u32 mss_cmsg(struct neighbor *nb) return mss(nb, 7); } -static inline __u32 mss_conndata(struct neighbor *nb) +static inline __u32 mss_conndata(struct neighbor *nb, int highlatency) { __u32 mss_tmp = mss(nb, 11); __u32 i; - if (mss_tmp < 256) + if (mss_tmp < 256 || highlatency) return mss_tmp; for (i=256;i<4096;i*=2) { @@ -1499,7 +1499,7 @@ static inline __u32 mss_conndata(struct neighbor *nb) static inline __u32 send_conndata_as_skb(struct neighbor *nb, __u32 size) { - return size >= mss_conndata(nb)/2; + return size >= mss_conndata(nb, 0)/2; } static inline long calc_timeout(__u32 latency_us, __u32 latency_stddev_us, diff --git a/net/cor/rcv.c b/net/cor/rcv.c index 849aa023ef83..ae6777e24c46 100644 --- a/net/cor/rcv.c +++ b/net/cor/rcv.c @@ -816,34 +816,26 @@ static int rcv(struct sk_buff *skb, struct net_device *dev, if (unlikely(packet_type == PACKET_TYPE_ANNOUNCE)) { rcv_announce(skb); return NET_RX_SUCCESS; - } else if (likely(packet_type == PACKET_TYPE_CMSG || - packet_type == PACKET_TYPE_CONNDATA || - packet_type == PACKET_TYPE_CONNDATA_LOWBUFDELAYED || - packet_type == PACKET_TYPE_CONNDATA_FLUSH || - packet_type == - PACKET_TYPE_CONNDATA_LOWBUFDELAYED_FLUSH)) { - if (packet_type == PACKET_TYPE_CMSG) { - rcv_cmsg(skb); - return NET_RX_SUCCESS; - } else if (packet_type == PACKET_TYPE_CONNDATA) { - rcv_conndata(skb, 0, 0); - return NET_RX_SUCCESS; - } else if (packet_type == PACKET_TYPE_CONNDATA_LOWBUFDELAYED) { - rcv_conndata(skb, 1, 0); - return NET_RX_SUCCESS; - } else if (packet_type == PACKET_TYPE_CONNDATA_FLUSH) { - rcv_conndata(skb, 0, 1); - return NET_RX_SUCCESS; - } else if (packet_type == - PACKET_TYPE_CONNDATA_LOWBUFDELAYED_FLUSH) { - rcv_conndata(skb, 1, 1); - return NET_RX_SUCCESS; - } + } else if (packet_type == PACKET_TYPE_CMSG) { + rcv_cmsg(skb); + return NET_RX_SUCCESS; + } else if (packet_type == PACKET_TYPE_CONNDATA) { + rcv_conndata(skb, 0, 0); + return NET_RX_SUCCESS; + } else if (packet_type == PACKET_TYPE_CONNDATA_LOWBUFDELAYED) { + rcv_conndata(skb, 1, 0); + return NET_RX_SUCCESS; + } else if (packet_type == PACKET_TYPE_CONNDATA_FLUSH) { + rcv_conndata(skb, 0, 1); + return NET_RX_SUCCESS; + } else if (packet_type == PACKET_TYPE_CONNDATA_LOWBUFDELAYED_FLUSH) { + rcv_conndata(skb, 1, 1); + return NET_RX_SUCCESS; + } else { + kfree_skb(skb); + return NET_RX_SUCCESS; } - kfree_skb(skb); - return NET_RX_SUCCESS; - drop: kfree_skb(skb); return NET_RX_DROP; diff --git a/net/cor/snd.c b/net/cor/snd.c index ba11dcb9d18b..86f23aa8d87f 100644 --- a/net/cor/snd.c +++ b/net/cor/snd.c @@ -141,7 +141,7 @@ static void print_conn_bufstats(struct neighbor *nb) static void nbcongwin_data_retransmitted(struct neighbor *nb, __u64 bytes_sent) { - __u64 min_cwin = mss_conndata(nb)*2 << NBCONGWIN_SHIFT; + __u64 min_cwin = mss_conndata(nb, 0)*2 << NBCONGWIN_SHIFT; __u64 cwin; unsigned long iflags; @@ -1464,7 +1464,8 @@ static int __send_retrans(struct neighbor *nb, struct conn *trgt_out_l, static int _send_retrans_splitcr_ifneeded(struct neighbor *nb_retransconnlocked, struct conn *trgt_out_l, struct conn_retrans *cr) { - __u32 targetmss = mss_conndata(nb_retransconnlocked); + __u32 targetmss = mss_conndata(nb_retransconnlocked, + trgt_out_l->is_highlatency != 0); __u64 windowlimit = seqno_clean( trgt_out_l->target.out.seqno_windowlimit - cr->seqno); @@ -2200,7 +2201,7 @@ static int _flush_out(struct conn *trgt_out_lx, __u32 maxsend, __u32 *sent, get_windowlimit(trgt_out_l), trgt_out_l->data_buf.read_remaining); */ - targetmss = mss_conndata(nb); + targetmss = mss_conndata(nb, trgt_out_lx->is_highlatency != 0); while (trgt_out_lx->data_buf.read_remaining >= targetmss) { __u64 windowlimit = get_windowlimit(trgt_out_lx); -- 2.11.4.GIT