Other Parts Discussed in Thread: AM5728
Hi:
I have a custom AM5708 based board with SDK6.02.
I have 2 ethernet ports managed by PRU2 and have configured them in RSTP mode (see script attached).
I have an RSTP ring with 2 off-the-self switches plus my board and have connected a PC to one of the switch
to ping my board and inject high ethernet traffic with brodcast messages (attached is the source code of the injector).
If I don´t inject high traffic in the ring, my board works fine from the RSTP point of view every time I plug or unplug the cable.
But if I inject high ethernet traffic after unplugging and plugging back one port gets stuck in BLOCKING state cable is plugged
or DISABLED state if cable is unplugged. There is no way of getting out of this state rather than rerunning again the RSTP script.
I have gone through the kernel source code and put some printk messages (see attached file) to understand the RSTP behavior
when low and high traffic. As a summary it seems that it does not receive RTM_SETLINK message from rtnetlink.
I have tried the same scenario with AM57xx IDK with SDK6.02 and it takes longer to make it fail but finally one port gets blocked.
Regards
Billa
�7zXZ �ִF ! t/��K��] 3���fz�]�=&�>"� ��3���s[�.�y�6;:��y֒�㸠�s��'S-�,��p�Åw��:[��➑e2���#p^�*�=�<��R��xf�R!��gO�V��_@��s�S-Ü0��'������$u�u���/���{!��Y ^ wa��� eU���ȋ�L'�ÿ�yMY�;1�e��-�ꇡ0Ӈ��jw�JT�r��1��t��!�S|]G��<!�a�OX/��>�N�~&�I'����}T��Ì�&\`�X�9}(�h�×���� ������D�T���-dT��x�7|Z YyCf� I�g���1%��݆\��|��a�Y�Q���N�Ej,��_f��u�!�{��h2��I^S�w��Lc$z���н� (Ϗ�@���'����G�����+��H���8�q��.�� ���j7�A��v|N�.Q����C��ۄòß�%Lf�ץ�� �}{�5�s�����mpK�9�������C-?���ܘvg�R�q�ICB%5��}f�d����K3(iqɾ�GzO��|��֥��^�Z���#:��-�5 Ob� 9�O���s�(��.h`�^�S�h�Ϙ�>ȴ" (>C�/�t�=�b�����8%X�n���7ە��ӏ���Ec&m��Ŵٺ����f�e�G��gU�T���y���U��R�Դş�q �F��HYξ �X����c��C�'<4ЋZ|zsg��*q5R���g�f0�� �\���G�9����r@�3�P��Z 9f�R�\��G�������z�k�fC�s��A#g�.����T0nAx�h�{���3dL&�S:�e��"��Cj�Q���O��908�O#�yAez��Jo���nJ�5�0 ���Jw.��h��T��۳��©�7��M`�g��'�bw���M�YЉ����"�|TKԈ�;��g��/��T�.X0����U2����^��/);��� ���+�-%s�(��0�'�u<ܸI�1�MX5B�D����|�n�{BQ�|B���ly+���_U!��$��j�w(˗DT�����H�O��i� 0�w�OT��&�kO������M=�plP�[�h��S@](�Li[k{*�"{��1��>"Tƀ�3JƲM��f���Z��L�� �Z;��Xn��nYz�m��堵��������j¨l�S�p���{��`z6c�^��<���Kdg���pP�}��0 �\����Yk+���g��O��#��%vK�� ���u��]�V����Hu��� �-�rP��I�K��[ ���1^�>�m�qP�3���pE���{a8yC5��s���.9�����"�{}���dv����QQ��U��/��� �4Q�2�l���K�$f�k��S\t�7�1\�o����~X���aɱ������r��D]����0ɥb�������L�~ʫ�}�W���F$��������нGbu�n+��#ܶ�� �b u�-x���ϗ|�� T�(��I�LH2�H���&���$4v�� 䴂L*{˔���tw���"ч�~Q�����`I�0?�({/���֞'�3���ft_�:�!w��nDXL� �L���� �o�,�&�R*��H�=�t�:���>�p5�AT�\� �$ha�H}��Uue�*��LY8�g�=��(^�̼(��4S�l��lr�[���Td>�E�^];�H��YCf� ODOП�W�̖����n�"���z (�r8v�AZ ����h�j!鞒�%�������Q��r��0�����吙L#�|���x�>r�d|:?�ls��u��:�4�3�'V�mC��qʚ�Ԣ�Iؿ�H��zx�b��h�M����*ʀ@�Qͺ�i�)����(#ZD='��4��Z�#=��ʷrC��������:�)�j�d?Ω6���ח�?C�E��#�O'g����a����H,���]�PZ���#8W������E��7�U#7��0"q6�3�KUu��xy�'^�1�"���ѿ-�Ӎ�V�V���n �|��zR~�e�\��-���")��vV�6k+�ց�w/du]G��9o��Hؑ>���T+?��M��Î�@[�r���|Q�aX�@ej��9�(z=�����h�+y���b�L"v���r8}@!x��W<P+�*�'h1�a{�(��b�Ug2.��G��B�i��=.8�0���l&ȟFa`������1��a��ᖣfE�n���|!r�.�q5QN X,�'�� =�(�~ij���Q¦'��+���翷�B#�l[Em�EIE?��)0ϛ�a[��w�_H�x�N}���@�BoR��o&��l�Q� ŒE9b_���H).n�$2jy�=AS�%;�t�0�9K����&��өvu!on- :9V#���G��]tl���PR���և0Q�5���9ad�����$�g��K2�8��ΘI������p�Q�,������Y LXd��R�u_p��fH�[���Ô�r��*�����g-�U�h���[�A��4bm5�>��)j������x�f�.gܒ*���ӎ� i�$�ן ��O�Ig�íNJ����&�������d�xm�>�RD�C�}��3S�Q������S[�κ���1���.*|�L?�V����X�g�����4�.��v!ef*�|xH�֛O4��4\a�]G�7cEaQ`�p���@>B���~Q�� -����9-�NeLeH����f=Z�Ĩ�9���`���S�[�KD�E��3�p�B��c��#*��2b� ��j�� �*K�;�6�i���';��+3<g p�¥=����<���y�C�=����8�zoo�u!�#q�1�t�0�:E��5&� �����>,��/6� gF���jO;&j�Oy�~���� c�& �^\T]����l9:�-×��xT� ����r�"�,�����gCF/�������]�m�_IYv��J�^w�4�( �.��a�ݧ�X1�?̣�;X}1�!�i���6�'Hs��Pb��Pc�A9�۽C���)f,Q:���^�k��b�u�R�1�'�OK�ϭK\Y S`�Fn�=�j`�Bư�P+C!8"7��W<��gc�MM��%���`�����uE'�Ұx��OBQ^��l���!}�@+���'�2��\�k�J{<n�IX+p|;�£�`�36�@��%���}�~�Z`m7,̂ ��Z��{[t�����t=ų}�li���Y�ҡ�%���P��F������/T�^S�c��td0<Ë��܉����cJ�� .H U�*w=b!���.)�2S���V�=b������e�k�G�I��F�9��!��7q�-��TH��H���ý)�O7��px�L� � ��x6l��^xg�X� W#N�MM��ȳ�B�7 �k�]F�l���f�4�W"@�2�����L<�%F�w��(t~���A���$W�^I����)��Ps6=�D�>���X��6��CbKa(��:�C�t������?^��>�ޟ���Z��y��0�(L��y0���7$�mj�`r7W�tp���7�1 ,�� TP��F�E,?�����X^�B釖Z��;k{�4���.pLB@j�X�DH!�8�Hq P�O��)P�햕�V��I ��^:I!��+7�.v���:���|�\*3��x��7Ԕ��>_��o����E`m��C�փ���ܾ�Lji��\�����.5����ZY�t�M�}6��a��C�סk����}���,Ӯ��:K��t@��ɴ��; _��*�&4A~$�܌eGl}�|��<��T�3^X�5"��9 ���Y25���N��v�/��v�#��������v� ʲ�O� ���ĬN+�0C -R�����c0�ӭ6�����}�]�Җ\ F�O� Ĝ2Jq��sD��;����Ǒ ��m+V˘�ăJ&a�I�Y���Ր�?�8�T��{���m��L+�CS*��j�����<K�6W�'狞��r�cCq�oTf�-���t��3u8���!��^�����\7�K#F��N��5y�`�&��:dI�5�U��]u쟚�{�i��%V��?#>���3��Cq� zk1a�|�U�y��4W#,R#Tȩ�J�i�"� '4�?dj�Dl�ɴ��������������8| {��<�D��a�uΆw��NT��츥qK�8�S�r0zO$Xc�C��V�h���4�@J����w�5%���V�<W�l�Vs����Z�>����tB���{܋�)t�� �i�F��l�q��!͆�tҵp> ����3�j�F�� ���K��Dk��(X�� )�ƫ��\�US��0����������/[��-*�D�b �%�q�n6 �#�� �e|��g� YZ
----------------------------------------- LOW ETHERNET TRAFFIC ---------------------------------------------- root@am57xx-evm:~# [ 238.964833] prueth pruss2_eth eth2: Link is Down <------------------------------------------ UNPLUG CABLE [ 238.993417] br0: port 2(eth2) entered disabled state [ 238.998620] Billa: rtnetlink_rcv_msg() type=RTM_SETLINK (19) [ 239.011626] Billa: rtnl_bridge_setlink(): err=-95 root@am57xx-evm:~# [ 245.204627] prueth pruss2_eth eth2: Link is Up - 100Mbps/Full - flow control off <------------- PLUG CABLE [ 245.212177] br0: port 2(eth2) entered blocking state [ 245.230077] Billa: rtnetlink_rcv_msg() type=RTM_SETLINK (19) [ 245.236066] Billa: rtnl_bridge_setlink(): err=-95 [ 245.240815] br0: port 2(eth2) entered learning state [ 245.248062] Billa: rtnetlink_rcv_msg() type=RTM_SETLINK (19) [ 245.253889] Billa: rtnl_bridge_setlink(): err=-95 [ 245.258634] br0: port 2(eth2) entered forwarding state root@am57xx-evm:~# ----------------------------------------- HIGH ETHERNET TRAFFIC ---------------------------------------------- root@am57xx-evm:~# [ 258.725099] prueth pruss2_eth eth2: Link is Down <-------------------------------------------- UNPLUG CABLE [ 258.753780] br0: port 2(eth2) entered disabled state [ 258.759926] Billa: rtnetlink_rcv_msg() type=RTM_SETLINK (19) [ 258.777759] Billa: rtnl_bridge_setlink(): err=-95 root@am57xx-evm:~# [ 269.124841] prueth pruss2_eth eth2: Link is Up - 100Mbps/Full - flow control off <-------------- PLUG CABLE [ 269.132716] br0: port 2(eth2) entered blocking state root@am57xx-evm:~#
#!/bin/bash echo "Get MAC & IPs information ..." MAC_A="00:a0:f4:de:ad:cc" MAC_B="00:a0:f4:de:ad:cd" IP_A="192.168.33.188" MASK_A="255.255.255.0" GW_A="192.168.33.1" IP_B="3.11.33.188" MASK_B="255.255.255.0" GW_B="3.111.33.1" sleep 1 echo "Set LLA interface down .." ifconfig bond0 down ip link delete bond0 rmmod bonding sleep 1 echo "Set PRP interface down .." ifconfig prp0 down ip link delete prp0 sleep 1 echo "Set HSR interface down .." ifconfig hsr0 down ip link delete hsr0 sleep 1 echo "Set RSTP interface down .." ifconfig br0 down ip link delete br0 sleep 1 echo "Set DUAL interfaces down .." ifconfig eth2 0.0.0.0 down ifconfig eth3 0.0.0.0 down sleep 1 echo "Set MAC address ${MAC_A} to eth1 & eth2 interfaces .." ifconfig eth2 hw ether ${MAC_A} ifconfig eth3 hw ether ${MAC_A} sleep 1 echo "Set eth2 & eth3 interfaces up .." ifconfig eth2 up ifconfig eth3 up sleep 1 echo "Create br0 interface and add eth2 & eth3 ports .." brctl addbr br0 brctl addif br0 eth2 brctl addif br0 eth3 sleep 1 echo "Set br0 with IP=${IP_A} interface up .." /opt/edge-agent/ipv4-set eth2 MANUAL ip4 169.254.4.3/24 gw 169.254.4.1 /opt/edge-agent/ipv4-set eth3 MANUAL ip4 169.254.5.3/24 gw 169.254.5.1 ifconfig br0 ${IP_A} netmask ${MASK_A} up route add default gw ${GW_A} br0 sleep 1 echo "Start bridge br0 ..." brctl stp br0 on sleep 1 echo "Set rstp settings ..." mstpctl settreeprio br0 0 8 mstpctl settreeportprio br0 eth2 0 8 mstpctl setportpathcost br0 eth2 200000 mstpctl settreeportprio br0 eth3 0 8 mstpctl setportpathcost br0 eth3 200000 sleep 1 echo "Switch bridge mode from stp to rstp ..." mstpctl setforcevers br0 rstp sleep 1 echo "RSTP ready for PTP configuration ..." ifconfig > /tmp/start_redundancy.ok sleep 1