These are 4 constants described in rfc8899#section-5.1.2:

  MAX_PROBES, MIN_PLPMTU, MAX_PLPMTU, BASE_PLPMTU;

And 2 variables described in rfc8899#section-5.1.3:

  PROBED_SIZE, PROBE_COUNT;

And 5 states described in rfc8899#section-5.2:

  DISABLED, BASE, SEARCH, SEARCH_COMPLETE, ERROR;

'count' and 'raise' are used for two timers' counting:
PROBE_TIMER and PMTU_RAISE_TIMER. 'probe_high' is used
for finding the optimal value for pmtu.

Signed-off-by: Xin Long <lucien....@gmail.com>
---
 net/tipc/link.c | 13 +++++++++++++
 net/tipc/link.h | 20 ++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index cf586840caeb..1aa775cef3bb 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -182,6 +182,14 @@ struct tipc_link {
        /* Max packet negotiation */
        u16 mtu;
        u16 advertised_mtu;
+       struct {
+               u16 probe_size;
+               u16 probe_high;
+               u16 pmtu;
+               u8 count;
+               u8 state:3;
+               u8 raise:5;
+       } pl;
 
        /* Sending */
        struct sk_buff_head transmq;
@@ -984,6 +992,11 @@ void tipc_link_reset(struct tipc_link *l)
        l->peer_session--;
        l->session++;
        l->mtu = l->advertised_mtu;
+       l->pl.state = TIPC_PL_BASE;
+       l->pl.pmtu = TIPC_BASE_PLPMTU;
+       l->pl.probe_size = TIPC_BASE_PLPMTU;
+       l->pl.count = 0;
+       l->pl.probe_high = 0;
 
        spin_lock_bh(&l->wakeupq.lock);
        skb_queue_splice_init(&l->wakeupq, &list);
diff --git a/net/tipc/link.h b/net/tipc/link.h
index a16f401fdabd..30bee2562987 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -66,6 +66,26 @@ enum {
        TIPC_LINK_SND_STATE    = (1 << 2)
 };
 
+/* PLPMTUD state
+ */
+enum {
+       TIPC_PL_DISABLED,
+       TIPC_PL_BASE,
+       TIPC_PL_SEARCH,
+       TIPC_PL_COMPLETE,
+       TIPC_PL_ERROR,
+};
+
+#define        TIPC_BASE_PLPMTU        1200
+#define        TIPC_MAX_PLPMTU         9000
+#define        TIPC_MIN_PLPMTU         512
+
+#define        TIPC_MAX_PROBES         3
+#define        TIPC_PROBE_INTERVAL     10
+
+#define        TIPC_PL_BIG_STEP        32
+#define        TIPC_PL_MIN_STEP        4
+
 /* Starting value for maximum packet size negotiation on unicast links
  * (unless bearer MTU is less)
  */
-- 
2.27.0



_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to