Re: [devel] [PATCH 0/9] Review Request for mds: Add solution for TIPC buffer overflow [#1960]

2019-09-22 Thread Nguyen Minh Vu

Thanks Minh. I have no more comments.

Regards, Vu

On 9/23/19 7:48 AM, Minh Hon Chau wrote:

Hi all,

Below is the patch #10 that updates most of comments, it applies on 
top of current patch #9.


This patch #10 does not use the shared_ptr and base:Mutex as comments 
given by Gary and Vu, the reason is that it will cause a similar 
problem reported in #2860 (user call exit() without properly doing mds 
shutdown), unless those variables are allocated on the heap.


I would like to push the #1960 patches today if we don't have any more 
comments. There are some other incremental improvements/fixes that 
will be addressed in other tickets.


Thanks

Minh

---
 src/mds/README   |  2 +-
 src/mds/mds_dt_tipc.c    | 28 -
 src/mds/mds_tipc_fctrl_intf.cc   | 67 
++--

 src/mds/mds_tipc_fctrl_intf.h    |  2 +-
 src/mds/mds_tipc_fctrl_msg.cc    | 44 +-
 src/mds/mds_tipc_fctrl_msg.h | 22 +++--
 src/mds/mds_tipc_fctrl_portid.cc | 46 ---
 7 files changed, 137 insertions(+), 74 deletions(-)

diff --git a/src/mds/README b/src/mds/README
index 1b94632..0819bdc 100644
--- a/src/mds/README
+++ b/src/mds/README
@@ -182,7 +182,7 @@ TIPC portid state machine and its transition
 
 kDisabled, // no flow control support at this state
 kStartup,  // a newly published portid starts at this state
-kTxProb,   // txprob timer is running to confirm if the flow control 
is supported
+kTxProb,   // tx probation timer is running to confirm if the flow 
control is supported

 kEnabled   // flow control support is confirmed, data flow is controlled
 kRcvBuffOverflow // anticipating (or experienced) the receiver's 
buffer overflow


diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
index 1b6c3f8..e7a7b48 100644
--- a/src/mds/mds_dt_tipc.c
+++ b/src/mds/mds_dt_tipc.c
@@ -247,6 +247,7 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, uint32_t 
*mds_tipc_ref)

 if (!get_tipc_port_id(tipc_cb.BSRsock, _id)) {
     close(tipc_cb.Dsock);
     close(tipc_cb.BSRsock);
+        *mds_tipc_ref = 0;
     return NCSCC_RC_FAILURE;
 }
 *mds_tipc_ref = port_id.ref;
@@ -330,7 +331,7 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, uint32_t 
*mds_tipc_ref)

 }

 /* Get tipc socket receive buffer size */
-    int optval;
+    int optval = 0;
 socklen_t optlen = sizeof(optval);
 if (getsockopt(tipc_cb.BSRsock, SOL_SOCKET, SO_RCVBUF,
     , ) != 0) {
@@ -350,12 +351,25 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, uint32_t 
*mds_tipc_ref)

         int acksize = -1;
         if ((ptr = getenv("MDS_TIPC_FCTRL_ACKTIMEOUT")) != NULL) {
             ackto = atoi(ptr);
+                if (ackto == 0) {
+                    syslog(LOG_ERR, "MDTM:TIPC Invalid "
+                            "MDS_TIPC_FCTRL_ACKTIMEOUT, using default 
value");

+                    ackto = -1;
+                }
         }
         if ((ptr = getenv("MDS_TIPC_FCTRL_ACKSIZE")) != NULL) {
             acksize = atoi(ptr);
+                if (acksize == 0) {
+                    syslog(LOG_ERR, "MDTM:TIPC Invalid "
+                            "MDS_TIPC_FCTRL_ACKSIZE, using default 
value");

+                    acksize = -1;
+                }
         }
-            mds_tipc_fctrl_initialize(tipc_cb.BSRsock, port_id, 
(uint64_t)optval,

+            mds_tipc_fctrl_initialize(tipc_cb.BSRsock, port_id, optval,
             ackto, acksize, tipc_mcast_enabled);
+        } else {
+            syslog(LOG_ERR, "MDTM:TIPC Invalid value of"
+                "MDS_TIPC_FCTRL_ENABLED");
     }
 }

@@ -366,6 +380,7 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, uint32_t 
*mds_tipc_ref)

     close(tipc_cb.Dsock);
     close(tipc_cb.BSRsock);
     m_NCS_IPC_RELEASE(_cb.tmr_mbx, NULL);
+        mds_tipc_fctrl_shutdown();
     return NCSCC_RC_FAILURE;
 }

@@ -2528,7 +2543,7 @@ uint32_t mds_mdtm_send_tipc(MDTM_SEND_REQ *req)
  */
 uint32_t status = 0;
 uint32_t sum_mds_hdr_plus_mdtm_hdr_plus_len;
-  uint16_t fctrl_seq_num = 0;
+    uint16_t fctrl_seq_num = 0;
 int version = req->msg_arch_word & 0x7;
 if (version > 1) {
     sum_mds_hdr_plus_mdtm_hdr_plus_len =
@@ -2618,7 +2633,7 @@ uint32_t mds_mdtm_send_tipc(MDTM_SEND_REQ *req)
             return NCSCC_RC_FAILURE;
         }
       /* if sndqueue is capable, then obtain the current sending 
seq */
-          if (mds_tipc_fctrl_sndqueue_capable(tipc_id, len, 
_seq_num)

+          if (mds_tipc_fctrl_sndqueue_capable(tipc_id, _seq_num)
       == NCSCC_RC_FAILURE){
         m_MDS_LOG_ERR("FCTRL: Failed to send message len :%d", len);
         return NCSCC_RC_FAILURE;
@@ -2717,10 +2732,10 @@ uint32_t mds_mdtm_send_tipc(MDTM_SEND_REQ *req)
             }
             /* if sndqueue is capable, then obtain the current 
sending 

Re: [devel] [PATCH 0/9] Review Request for mds: Add solution for TIPC buffer overflow [#1960]

2019-09-22 Thread Minh Hon Chau

Hi all,

Below is the patch #10 that updates most of comments, it applies on top 
of current patch #9.


This patch #10 does not use the shared_ptr and base:Mutex as comments 
given by Gary and Vu, the reason is that it will cause a similar problem 
reported in #2860 (user call exit() without properly doing mds 
shutdown), unless those variables are allocated on the heap.


I would like to push the #1960 patches today if we don't have any more 
comments. There are some other incremental improvements/fixes that will 
be addressed in other tickets.


Thanks

Minh

---
 src/mds/README   |  2 +-
 src/mds/mds_dt_tipc.c    | 28 -
 src/mds/mds_tipc_fctrl_intf.cc   | 67 
++--

 src/mds/mds_tipc_fctrl_intf.h    |  2 +-
 src/mds/mds_tipc_fctrl_msg.cc    | 44 +-
 src/mds/mds_tipc_fctrl_msg.h | 22 +++--
 src/mds/mds_tipc_fctrl_portid.cc | 46 ---
 7 files changed, 137 insertions(+), 74 deletions(-)

diff --git a/src/mds/README b/src/mds/README
index 1b94632..0819bdc 100644
--- a/src/mds/README
+++ b/src/mds/README
@@ -182,7 +182,7 @@ TIPC portid state machine and its transition
 
 kDisabled, // no flow control support at this state
 kStartup,  // a newly published portid starts at this state
-kTxProb,   // txprob timer is running to confirm if the flow control is 
supported
+kTxProb,   // tx probation timer is running to confirm if the flow 
control is supported

 kEnabled   // flow control support is confirmed, data flow is controlled
 kRcvBuffOverflow // anticipating (or experienced) the receiver's 
buffer overflow


diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
index 1b6c3f8..e7a7b48 100644
--- a/src/mds/mds_dt_tipc.c
+++ b/src/mds/mds_dt_tipc.c
@@ -247,6 +247,7 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, uint32_t 
*mds_tipc_ref)

 if (!get_tipc_port_id(tipc_cb.BSRsock, _id)) {
     close(tipc_cb.Dsock);
     close(tipc_cb.BSRsock);
+        *mds_tipc_ref = 0;
     return NCSCC_RC_FAILURE;
 }
 *mds_tipc_ref = port_id.ref;
@@ -330,7 +331,7 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, uint32_t 
*mds_tipc_ref)

 }

 /* Get tipc socket receive buffer size */
-    int optval;
+    int optval = 0;
 socklen_t optlen = sizeof(optval);
 if (getsockopt(tipc_cb.BSRsock, SOL_SOCKET, SO_RCVBUF,
     , ) != 0) {
@@ -350,12 +351,25 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, uint32_t 
*mds_tipc_ref)

         int acksize = -1;
         if ((ptr = getenv("MDS_TIPC_FCTRL_ACKTIMEOUT")) != NULL) {
             ackto = atoi(ptr);
+                if (ackto == 0) {
+                    syslog(LOG_ERR, "MDTM:TIPC Invalid "
+                            "MDS_TIPC_FCTRL_ACKTIMEOUT, using default 
value");

+                    ackto = -1;
+                }
         }
         if ((ptr = getenv("MDS_TIPC_FCTRL_ACKSIZE")) != NULL) {
             acksize = atoi(ptr);
+                if (acksize == 0) {
+                    syslog(LOG_ERR, "MDTM:TIPC Invalid "
+                            "MDS_TIPC_FCTRL_ACKSIZE, using default value");
+                    acksize = -1;
+                }
         }
-            mds_tipc_fctrl_initialize(tipc_cb.BSRsock, port_id, 
(uint64_t)optval,

+            mds_tipc_fctrl_initialize(tipc_cb.BSRsock, port_id, optval,
             ackto, acksize, tipc_mcast_enabled);
+        } else {
+            syslog(LOG_ERR, "MDTM:TIPC Invalid value of"
+                "MDS_TIPC_FCTRL_ENABLED");
     }
 }

@@ -366,6 +380,7 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid, uint32_t 
*mds_tipc_ref)

     close(tipc_cb.Dsock);
     close(tipc_cb.BSRsock);
     m_NCS_IPC_RELEASE(_cb.tmr_mbx, NULL);
+        mds_tipc_fctrl_shutdown();
     return NCSCC_RC_FAILURE;
 }

@@ -2528,7 +2543,7 @@ uint32_t mds_mdtm_send_tipc(MDTM_SEND_REQ *req)
  */
 uint32_t status = 0;
 uint32_t sum_mds_hdr_plus_mdtm_hdr_plus_len;
-  uint16_t fctrl_seq_num = 0;
+    uint16_t fctrl_seq_num = 0;
 int version = req->msg_arch_word & 0x7;
 if (version > 1) {
     sum_mds_hdr_plus_mdtm_hdr_plus_len =
@@ -2618,7 +2633,7 @@ uint32_t mds_mdtm_send_tipc(MDTM_SEND_REQ *req)
             return NCSCC_RC_FAILURE;
         }
       /* if sndqueue is capable, then obtain the current sending 
seq */

-          if (mds_tipc_fctrl_sndqueue_capable(tipc_id, len, _seq_num)
+          if (mds_tipc_fctrl_sndqueue_capable(tipc_id, _seq_num)
       == NCSCC_RC_FAILURE){
         m_MDS_LOG_ERR("FCTRL: Failed to send message len :%d", len);
         return NCSCC_RC_FAILURE;
@@ -2717,10 +2732,10 @@ uint32_t mds_mdtm_send_tipc(MDTM_SEND_REQ *req)
             }
             /* if sndqueue is capable, then obtain the current 
sending seq */

             if (mds_tipc_fctrl_sndqueue_capable(tipc_id,
-                    len + 

[devel] [PATCH 0/9] Review Request for mds: Add solution for TIPC buffer overflow [#1960]

2019-08-14 Thread Minh Chau
Summary: mds: Add solution for TIPC buffer overflow at MDS [#1960]
Review request for Ticket(s): 1960
Peer Reviewer(s): Anders, HansN, Lennart, Gary, Vu, Thuan
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-1960
Base revision: 2d85d5d9264c6a7d1c6601b900fb810facbee3ac
Personal repository: git://git.code.sf.net/u/minh-chau/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n

NOTE: Patch(es) contain lines longer than 80 characers

Comments (indicate scope for each "y" above):
-
Sending on behalf of Thuan & Minh.
Some pending tasks to accomplish

. Handle broadcast/multicast mds message with flow control.
. Reduce the memory re-allocation overhead if enables flow control.
(At this moment, memory is allocated at mds_dt_tip.c and cloned to buffer
for retransmission queue again).
. The sequence number arithmetic (sna) should be implemented in /base code.
. Adding mdstest to cover sna wrapped-round
. MDS_CHECKSUM_ENABLE_FLAG

revision d208cff344c35afd25ac01ab4f9057d153fe9495
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:22:12 +1000

mds: Add TIPC buffer overflow for mdstest [#1960]

(Sending on behalf of Thuan)



revision d04c3e99744b86278c6a54d8ec1e4caabfbcabd2
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:22:12 +1000

mds: Apply serial number arithmetic for sequence counter [#1960]

This patch applies the serial number arithmetic for the flow control
sequence number, referenced to RFC1982.

This is only temporary patch, a proper one could be made in /base
with template for others type, e.g uint32. Then mds reuses it from
/base.



revision 7bbaf4eed324ba0575f4893a37eb10c9b7df4426
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:22:12 +1000

mds: Add configurable parameters [#1960]

This patch makes the solution of TIPC buffer overflow configurable,
as well as the ack timeout/ack size.
For example:
The service config file can export the following environment variables

export MDS_TIPC_FCTRL_ENABLED=1
export MDS_TIPC_FCTRL_ACKTIMEOUT=1000
export MDS_TIPC_FCTRL_ACKSIZE=1

If MDS_TIPC_FCTRL_ACKTIMEOUT, MDS_TIPC_FCTRL_ACKSIZE are not specified,
the default values are used.



revision 842dcecbdbafb3744a99ead42899f955eb79f94f
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:22:12 +1000

mds: Implement kRcvBuffOverflow state [#1960]

This patch implements the kRcvBuffOverflow state machine as
described in README file.



revision ed03d11a194f9775fc43003acc35924ef28227b7
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:22:12 +1000

mds: Add state machine for tipc portid instance [#1960]

This patch adds state machine to support tx probation timer.



revision 759f7ef7b55a8f27118e82c757c21b2f452c8b7c
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:22:12 +1000

mds: Add timeout for ack message [#1960]

If the ack size is configured greater than 1, there should be a timeout
at receiver ends to send the ack message back to senders.
The ack message timeout utilizes the poll timeout in flow control thread
to make mds lightweight (in contrast to additional timer threads).



revision 7c115e411f9de31b2ffe3c32ed401d7b8a3de696
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:21:33 +1000

mds: Add implementation for TIPC buffer overflow solution [#1960]

This is a collaborative patch of two participants:Thuan, Minh.

Main changes:
- Add mds_tipc_fctrl_intf.h, mds_tipc_fctrl_intf.cc: These two files
introduce new functions which are called in mds_dt_tipc.c if the flow
control is enabled
- Add mds_tipc_fctrl_portid.h, mds_tipc_fctrl_portid.cc: These files
implements the tipc portid instance, which supports the sliding window,
mds msg queue
- Add mds_tipc_fctrl_msg.h, mds_tipc_fctrl_msg.cc: These files define
the event and messages which are used for this solution.



revision 4096f66de92f89ef30a54a137465384b74143800
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:12:19 +1000

mds: Resolve c/c++ linking issue [#1960]

(Sending on behalf of Thuan)
This patch solves the linking issue if mds_dt.h or mds_core.h
is included in c++ sources.



revision 04152d708f30abf813dad1c18d5ed3d73df4ef3d
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 16:11:17 +1000

mds: Add README for solution of TIPC buffer overflow at MDS [#1960]



Added Files:

 src/mds/mds_tipc_fctrl_intf.cc
 src/mds/mds_tipc_fctrl_intf.h
 src/mds/mds_tipc_fctrl_msg.cc
 src/mds/mds_tipc_fctrl_msg.h
 src/mds/mds_tipc_fctrl_portid.cc
 src/mds/mds_tipc_fctrl_portid.h
 src/mds/README


Complete diffstat:
--
 src/mds/Makefile.am  |  10 +-
 src/mds/README   | 221 ++

[devel] [PATCH 0/9] Review Request for mds: Add solution for TIPC buffer overflow [#1960]

2019-08-14 Thread Minh Chau
Summary: mds: Add solution of TIPC buffer overflow at MDS [#1960]
Review request for Ticket(s): 1960
Peer Reviewer(s): Anders, HansN, Lennart, Gary, Vu, Thuan
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-1960
Base revision: 2d85d5d9264c6a7d1c6601b900fb810facbee3ac
Personal repository: git://git.code.sf.net/u/minh-chau/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n

NOTE: Patch(es) contain lines longer than 80 characers

Comments (indicate scope for each "y" above):
-
Sending on behalf of Thuan & Minh.
Some pending tasks to accomplish

. Handle broadcast/multicast mds message with flow control.
. Reduce the memory re-allocation overhead if enables flow control.
(At this moment, memory is allocated at mds_dt_tip.c and cloned to buffer
for retransmission queue again).
. The sequence number arithmetic (sna) should be implemented in /base code.
. Adding mdstest to cover sna wrapped-round
. MDS_CHECKSUM_ENABLE_FLAG

revision c49fdeb17fae20b4e0e9af134cc9b60de846c271
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Add TIPC buffer overflow for mdstest [#1960]



revision 6948a2456642600d541b55c9787bb17cfde48a7e
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Apply serial number arithmetic for sequence counter [#1960]

This patch applies the serial number arithmetic for the flow control
sequence number, referenced to RFC1982.

This is only temporary patch, a proper one could be made in /base
with template for others type, e.g uint32. Then mds reuses it from
/base.



revision 87662f659682f813f6746eef0e60d1e52ab03ff1
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Add configurable parameters [#1960]

This patch makes the solution of TIPC buffer overflow configurable,
as well as the ack timeout/ack size.
For example:
The service config file can export the following environment variables

export MDS_TIPC_FCTRL_ENABLED=1
export MDS_TIPC_FCTRL_ACKTIMEOUT=1000
export MDS_TIPC_FCTRL_ACKSIZE=1

If MDS_TIPC_FCTRL_ACKTIMEOUT, MDS_TIPC_FCTRL_ACKSIZE are not specified,
the default values are used.



revision cd4f8af3f53b16aa05d11f30e25da209e7e51e98
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Implement kRcvBuffOverflow state [#1960]

This patch implements the kRcvBuffOverflow state machine as
described in README file.



revision d5c9e8fc8605f453155f4a260ebda0f78ee017b4
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Add state machine for tipc portid instance [#1960]

This patch adds state machine to support tx probation timer.



revision f3f159d0aa3f43c4b28cbd6f0c7c9f041f4b6fd8
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Add timeout for ack message [#1960]

If the ack size is configured greater than 1, there should be a timeout
at receiver ends to send the ack message back to senders.
The ack message timeout utilizes the poll timeout in flow control thread
to make mds lightweight (in contrast to additional timer threads).



revision 6b69713c85dfc46b4d570a61eb2e2c4b71c354f9
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:39:39 +1000

mds: Add implementation for TIPC buffer overflow solution [#1960]

This is a collaborative patch of two participants:
- Tran Thuan 
- Minh Chau 

Main changes:
- Add mds_tipc_fctrl_intf.h, mds_tipc_fctrl_intf.cc: These two files
introduce new functions which are called in mds_dt_tipc.c if the flow
control is enabled
- Add mds_tipc_fctrl_portid.h, mds_tipc_fctrl_portid.cc: These files
implements the tipc portid instance, which supports the sliding window,
mds msg queue
- Add mds_tipc_fctrl_msg.h, mds_tipc_fctrl_msg.cc: These files define
the event and messages which are used for this solution.



revision f71e0ba303ea75b8f845d9f72ab903af93817c87
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:08:30 +1000

mds: Resolve c/c++ linking issue [#1960]

This patch solves the linking issue if mds_dt.h or mds_core.h
is included in c++ sources.



revision 983ad4f94c9b9d458ba5a3f12351cd5b143c78d5
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:08:30 +1000

mds: Add README for solution of TIPC buffer overflow at MDS [#1960]



Added Files:

 src/mds/mds_tipc_fctrl_intf.cc
 src/mds/mds_tipc_fctrl_intf.h
 src/mds/mds_tipc_fctrl_msg.cc
 src/mds/mds_tipc_fctrl_msg.h
 src/mds/mds_tipc_fctrl_portid.cc
 src/mds/mds_tipc_fctrl_portid.h
 src/mds/README


Complete diffstat:
--
 src/mds/Makefile.am  |  10 +-
 src/mds/README   | 221 ++
 src/mds/apitest/mdstest.c|   5 +-
 

Re: [devel] [PATCH 0/9] Review Request for mds: Add solution for TIPC buffer overflow [#1960]

2019-08-14 Thread Minh Hon Chau

Hi all,

Please ignore this patch series, the patch 2/9 and 9/9 committed under 
Thuan name/email, have been dropped (for some reason :) ) when sending 
for review.


I am sending again.

Thanks

Minh

On 14/8/19 4:01 pm, Minh Chau wrote:

Summary: mds: Add solution of TIPC buffer overflow at MDS [#1960]
Review request for Ticket(s): 1960
Peer Reviewer(s): Anders, HansN, Lennart, Gary, Vu, Thuan
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-1960
Base revision: 2d85d5d9264c6a7d1c6601b900fb810facbee3ac
Personal repository: git://git.code.sf.net/u/minh-chau/review


Impacted area   Impact y/n

  Docsn
  Build systemn
  RPM/packaging   n
  Configuration files n
  Startup scripts n
  SAF servicesy
  OpenSAF servicesn
  Core libraries  y
  Samples n
  Tests   n
  Other   n

NOTE: Patch(es) contain lines longer than 80 characers

Comments (indicate scope for each "y" above):
-
Sending on behalf of Thuan & Minh.
Some pending tasks to accomplish

. Handle broadcast/multicast mds message with flow control.
. Reduce the memory re-allocation overhead if enables flow control.
(At this moment, memory is allocated at mds_dt_tip.c and cloned to buffer
for retransmission queue again).
. The sequence number arithmetic (sna) should be implemented in /base code.
. Adding mdstest to cover sna wrapped-round
. MDS_CHECKSUM_ENABLE_FLAG

revision c49fdeb17fae20b4e0e9af134cc9b60de846c271
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Add TIPC buffer overflow for mdstest [#1960]



revision 6948a2456642600d541b55c9787bb17cfde48a7e
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Apply serial number arithmetic for sequence counter [#1960]

This patch applies the serial number arithmetic for the flow control
sequence number, referenced to RFC1982.

This is only temporary patch, a proper one could be made in /base
with template for others type, e.g uint32. Then mds reuses it from
/base.



revision 87662f659682f813f6746eef0e60d1e52ab03ff1
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Add configurable parameters [#1960]

This patch makes the solution of TIPC buffer overflow configurable,
as well as the ack timeout/ack size.
For example:
The service config file can export the following environment variables

export MDS_TIPC_FCTRL_ENABLED=1
export MDS_TIPC_FCTRL_ACKTIMEOUT=1000
export MDS_TIPC_FCTRL_ACKSIZE=1

If MDS_TIPC_FCTRL_ACKTIMEOUT, MDS_TIPC_FCTRL_ACKSIZE are not specified,
the default values are used.



revision cd4f8af3f53b16aa05d11f30e25da209e7e51e98
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Implement kRcvBuffOverflow state [#1960]

This patch implements the kRcvBuffOverflow state machine as
described in README file.



revision d5c9e8fc8605f453155f4a260ebda0f78ee017b4
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Add state machine for tipc portid instance [#1960]

This patch adds state machine to support tx probation timer.



revision f3f159d0aa3f43c4b28cbd6f0c7c9f041f4b6fd8
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:40:05 +1000

mds: Add timeout for ack message [#1960]

If the ack size is configured greater than 1, there should be a timeout
at receiver ends to send the ack message back to senders.
The ack message timeout utilizes the poll timeout in flow control thread
to make mds lightweight (in contrast to additional timer threads).



revision 6b69713c85dfc46b4d570a61eb2e2c4b71c354f9
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:39:39 +1000

mds: Add implementation for TIPC buffer overflow solution [#1960]

This is a collaborative patch of two participants:
- Tran Thuan 
- Minh Chau 

Main changes:
- Add mds_tipc_fctrl_intf.h, mds_tipc_fctrl_intf.cc: These two files
introduce new functions which are called in mds_dt_tipc.c if the flow
control is enabled
- Add mds_tipc_fctrl_portid.h, mds_tipc_fctrl_portid.cc: These files
implements the tipc portid instance, which supports the sliding window,
mds msg queue
- Add mds_tipc_fctrl_msg.h, mds_tipc_fctrl_msg.cc: These files define
the event and messages which are used for this solution.



revision f71e0ba303ea75b8f845d9f72ab903af93817c87
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:08:30 +1000

mds: Resolve c/c++ linking issue [#1960]

This patch solves the linking issue if mds_dt.h or mds_core.h
is included in c++ sources.



revision 983ad4f94c9b9d458ba5a3f12351cd5b143c78d5
Author: Minh Chau 
Date:   Wed, 14 Aug 2019 15:08:30 +1000

mds: Add README for solution of TIPC buffer overflow at MDS [#1960]



Added Files:

  src/mds/mds_tipc_fctrl_intf.cc
  src/mds/mds_tipc_fctrl_intf.h
  src/mds/mds_tipc_fctrl_msg.cc
  src/mds/mds_tipc_fctrl_msg.h