port: Fix unicast negotiation doesn't recover after FAULT_DETECTED

_Problem_
After a port link down/up or a tx_timestamp timeout issue, a port acting
as unicast master does not issue ANNC messages after granting unicast
request for ANNC.

_Analysis_
When a port FAULT occurs, the port transitions to FAULTY on FAULT_DETECTED
and subsequently port_disable(p) and port_initialize(p) are called on port recovery.

A port acting as a unicast master, stores clients in p->unicast_service->queue.

When a port receives a unicast request, unicast_service_add() is called.

In unicast_service_add(), if the request does not match an entry in
p->unicast_service->queue, FD_UNICAST_SRV_TIMER is started via
unicast_service_rearm_timer().

If the unicast request matches an existing p->unicast_service->queue entry
the request is considered an extension and FD_UNICAST_SRV_TIMER must
already be running.

port_disable() clears FD_UNICAST_SRV_TIMER, ie. stops FD_UNICAST_SRV_TIMER.
However, port_disable() does not clear p->unicast_service->queue.
When the port is restarted, the port retains the previous client data.

After port recovery, when the client attempts to restart the unicast
service, the request matches an existing entry in p->unicast_service->queue,
and so FD_UNICAST_SRV_TIMER is not started because the port expected
that the FD_UNICAST_SRV_TIMER is already running.

_Fix_
This patch clears the unicast client data in port_disable() so
that upon recovery, the initial unicast request will be considered
a new request and trigger the start of the FD_UNICAST_SRV_TIMER.

v2:
- Add missing sign-off
- Send to develop-request instead of users list

Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
3 files changed
tree: e82ed679e28ad67ba3a29334eef4ea7fed005854
  1. configs/
  2. .gitignore
  3. address.h
  4. as_capable.h
  5. bmc.c
  6. bmc.h
  7. clock.c
  8. clock.h
  9. clockadj.c
  10. clockadj.h
  11. clockcheck.c
  12. clockcheck.h
  13. CODING_STYLE.org
  14. config.c
  15. config.h
  16. contain.h
  17. COPYING
  18. ddt.h
  19. designated_fsm.c
  20. designated_fsm.h
  21. dm.h
  22. ds.h
  23. e2e_tc.c
  24. ether.h
  25. fault.c
  26. fault.h
  27. fd.h
  28. filter.c
  29. filter.h
  30. filter_private.h
  31. foreign.h
  32. fsm.c
  33. fsm.h
  34. hash.c
  35. hash.h
  36. hwstamp_ctl.8
  37. hwstamp_ctl.c
  38. incdefs.sh
  39. interface.c
  40. interface.h
  41. linreg.c
  42. linreg.h
  43. lstab.c
  44. lstab.h
  45. makefile
  46. mave.c
  47. mave.h
  48. missing.h
  49. mmedian.c
  50. mmedian.h
  51. monitor.c
  52. monitor.h
  53. msg.c
  54. msg.h
  55. mtab.h
  56. nmea.c
  57. nmea.h
  58. notification.h
  59. nsm.8
  60. nsm.c
  61. ntpshm.c
  62. ntpshm.h
  63. nullf.c
  64. nullf.h
  65. p2p_tc.c
  66. pdt.h
  67. phc.c
  68. phc.h
  69. phc2sys.8
  70. phc2sys.c
  71. phc_ctl.8
  72. phc_ctl.c
  73. pi.c
  74. pi.h
  75. pmc.8
  76. pmc.c
  77. pmc_agent.c
  78. pmc_agent.h
  79. pmc_common.c
  80. pmc_common.h
  81. port.c
  82. port.h
  83. port_private.h
  84. port_signaling.c
  85. power_profile.h
  86. pqueue.c
  87. pqueue.h
  88. print.c
  89. print.h
  90. ptp4l.8
  91. ptp4l.c
  92. raw.c
  93. raw.h
  94. README.org
  95. refclock_sock.c
  96. refclock_sock.h
  97. rtnl.c
  98. rtnl.h
  99. sad.c
  100. sad.h
  101. sad_gnupg.c
  102. sad_gnutls.c
  103. sad_nettle.c
  104. sad_openssl.c
  105. sad_private.h
  106. serial.c
  107. serial.h
  108. servo.c
  109. servo.h
  110. servo_private.h
  111. sk.c
  112. sk.h
  113. sock.c
  114. sock.h
  115. stats.c
  116. stats.h
  117. sysoff.c
  118. sysoff.h
  119. tc.c
  120. tc.h
  121. telecom.c
  122. timemaster.8
  123. timemaster.c
  124. tlv.c
  125. tlv.h
  126. tmv.h
  127. transport.c
  128. transport.h
  129. transport_private.h
  130. ts2phc.8
  131. ts2phc.c
  132. ts2phc.h
  133. ts2phc_generic_pps_source.c
  134. ts2phc_generic_pps_source.h
  135. ts2phc_nmea_pps_source.c
  136. ts2phc_nmea_pps_source.h
  137. ts2phc_phc_pps_source.c
  138. ts2phc_phc_pps_source.h
  139. ts2phc_pps_sink.c
  140. ts2phc_pps_sink.h
  141. ts2phc_pps_source.c
  142. ts2phc_pps_source.h
  143. ts2phc_pps_source_private.h
  144. tsproc.c
  145. tsproc.h
  146. tz.h
  147. tz2alt.8
  148. tz2alt.c
  149. udp.c
  150. udp.h
  151. udp6.c
  152. udp6.h
  153. uds.c
  154. uds.h
  155. unicast_client.c
  156. unicast_client.h
  157. unicast_fsm.c
  158. unicast_fsm.h
  159. unicast_service.c
  160. unicast_service.h
  161. util.c
  162. util.h
  163. version.c
  164. version.h
  165. version.sh