tdl-xoa-driver 1.0.0b1__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tdl_xoa_driver-1.0.0b1.dist-info → tdl_xoa_driver-1.2.0.dist-info}/METADATA +5 -126
- {tdl_xoa_driver-1.0.0b1.dist-info → tdl_xoa_driver-1.2.0.dist-info}/RECORD +56 -56
- {tdl_xoa_driver-1.0.0b1.dist-info → tdl_xoa_driver-1.2.0.dist-info}/WHEEL +1 -1
- xoa_driver/__init__.py +2 -2
- xoa_driver/functions/anlt.py +0 -30
- xoa_driver/functions/headers.py +312 -11
- xoa_driver/functions/mgmt.py +32 -86
- xoa_driver/functions/tools.py +13 -1
- xoa_driver/internals/commands/c_commands.py +26 -0
- xoa_driver/internals/commands/enums.py +8 -29
- xoa_driver/internals/commands/m_commands.py +0 -4
- xoa_driver/internals/commands/p_commands.py +30 -3
- xoa_driver/internals/commands/pl1_commands.py +96 -71
- xoa_driver/internals/commands/pr_commands.py +0 -8
- xoa_driver/internals/commands/ps_commands.py +0 -2
- xoa_driver/internals/commands/pt_commands.py +0 -6
- xoa_driver/internals/core/transporter/_stream.py +1 -1
- xoa_driver/internals/core/transporter/protocol/payload/base_struct.py +1 -1
- xoa_driver/internals/core/transporter/protocol/payload/descriptor.py +1 -1
- xoa_driver/internals/hli_v1/modules/base_module.py +1 -1
- xoa_driver/internals/hli_v1/modules/module_chimera.py +1 -1
- xoa_driver/internals/hli_v1/modules/module_l23ve.py +1 -1
- xoa_driver/internals/hli_v1/modules/module_l47.py +1 -1
- xoa_driver/internals/hli_v1/modules/modules_l23/module_l23_base.py +1 -1
- xoa_driver/internals/hli_v1/ports/base_port.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_l23.py +7 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_g.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l23/family_h.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l23/family_i.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l23/family_j.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l23/family_k.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l23/family_l.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l23/family_l1.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l23/freya_l1.py +14 -0
- xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_ghijkl.py +1 -1
- xoa_driver/internals/hli_v1/ports/port_l47/main.py +1 -1
- xoa_driver/internals/hli_v1/testers/_base_tester.py +7 -0
- xoa_driver/internals/hli_v1/testers/l47_tester.py +1 -1
- xoa_driver/internals/hli_v2/modules/base_module.py +1 -1
- xoa_driver/internals/hli_v2/modules/module_chimera.py +1 -1
- xoa_driver/internals/hli_v2/modules/module_l23ve.py +1 -1
- xoa_driver/internals/hli_v2/modules/module_l47.py +1 -1
- xoa_driver/internals/hli_v2/modules/modules_l23/module_l23_base.py +1 -1
- xoa_driver/internals/hli_v2/ports/base_port.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l23/family_g.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l23/family_h.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l23/family_i.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l23/family_j.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l23/family_k.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l23/family_l.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l23/family_l1.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ghijkl.py +1 -1
- xoa_driver/internals/hli_v2/ports/port_l47/main.py +1 -1
- xoa_driver/internals/hli_v2/testers/l47_tester.py +1 -1
- {tdl_xoa_driver-1.0.0b1.dist-info → tdl_xoa_driver-1.2.0.dist-info/licenses}/LICENSE +0 -0
- {tdl_xoa_driver-1.0.0b1.dist-info → tdl_xoa_driver-1.2.0.dist-info}/top_level.txt +0 -0
xoa_driver/functions/headers.py
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
################################################################
|
|
2
|
-
#
|
|
3
|
-
# HEADER BUILDER
|
|
4
|
-
#
|
|
5
|
-
# This script shows you how you can build your own header builder
|
|
6
|
-
# that converts human readable values into hex strings
|
|
7
|
-
#
|
|
8
|
-
################################################################
|
|
9
|
-
|
|
10
1
|
from ipaddress import IPv4Address, IPv6Address
|
|
11
2
|
from binascii import hexlify
|
|
12
3
|
from xoa_driver.misc import Hex
|
|
@@ -146,7 +137,7 @@ class Ethernet:
|
|
|
146
137
|
return f"{_dst_mac}{_src_mac}{_ethertype}".upper()
|
|
147
138
|
|
|
148
139
|
####################################
|
|
149
|
-
# VLAN
|
|
140
|
+
# VLAN #
|
|
150
141
|
####################################
|
|
151
142
|
|
|
152
143
|
@dataclass
|
|
@@ -605,4 +596,314 @@ class MACControlPause:
|
|
|
605
596
|
def __str__(self):
|
|
606
597
|
_opcode: str = self.opcode
|
|
607
598
|
_value = '{:04X}'.format(self.value)
|
|
608
|
-
return f"{_opcode}{_value}".upper()
|
|
599
|
+
return f"{_opcode}{_value}".upper()
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
####################################
|
|
603
|
+
# Infiniband Headers #
|
|
604
|
+
####################################
|
|
605
|
+
class BTHOpcode(Enum):
|
|
606
|
+
# OpCodeValues
|
|
607
|
+
# Code Bits [7-5] Connection Type
|
|
608
|
+
# [4-0] Message Type
|
|
609
|
+
|
|
610
|
+
# Reliable Connection (RC)
|
|
611
|
+
# [7-5] = 000
|
|
612
|
+
RC_SEND_FIRST = 0 # /*0x00000000 */ "RC Send First "
|
|
613
|
+
RC_SEND_MIDDLE = 1 # /*0x00000001 */ "RC Send Middle "
|
|
614
|
+
RC_SEND_LAST = 2 # /*0x00000010 */ "RC Send Last "
|
|
615
|
+
RC_SEND_LAST_IMM = 3 # /*0x00000011 */ "RC Send Last Immediate "
|
|
616
|
+
RC_SEND_ONLY = 4 # /*0x00000100 */ "RC Send Only "
|
|
617
|
+
RC_SEND_ONLY_IMM = 5 # /*0x00000101 */ "RC Send Only Immediate "
|
|
618
|
+
RC_RDMA_WRITE_FIRST = 6 # /*0x00000110 */ "RC RDMA Write First "
|
|
619
|
+
RC_RDMA_WRITE_MIDDLE = 7 # /*0x00000111 */ "RC RDMA Write Middle "
|
|
620
|
+
RC_RDMA_WRITE_LAST = 8 # /*0x00001000 */ "RC RDMA Write Last "
|
|
621
|
+
RC_RDMA_WRITE_LAST_IMM = 9 # /*0x00001001 */ "RC RDMA Write Last Immediate "
|
|
622
|
+
RC_RDMA_WRITE_ONLY = 10 # /*0x00001010 */ "RC RDMA Write Only "
|
|
623
|
+
RC_RDMA_WRITE_ONLY_IMM = 11 # /*0x00001011 */ "RC RDMA Write Only Immediate "
|
|
624
|
+
RC_RDMA_READ_REQUEST = 12 # /*0x00001100 */ "RC RDMA Read Request "
|
|
625
|
+
RC_RDMA_READ_RESPONSE_FIRST = 13 # /*0x00001101 */ "RC RDMA Read Response First "
|
|
626
|
+
RC_RDMA_READ_RESPONSE_MIDDLE = 14 # /*0x00001110 */ "RC RDMA Read Response Middle "
|
|
627
|
+
RC_RDMA_READ_RESPONSE_LAST = 15 # /*0x00001111 */ "RC RDMA Read Response Last "
|
|
628
|
+
RC_RDMA_READ_RESPONSE_ONLY = 16 # /*0x00010000 */ "RC RDMA Read Response Only "
|
|
629
|
+
RC_ACKNOWLEDGE = 17 # /*0x00010001 */ "RC Acknowledge "
|
|
630
|
+
RC_ATOMIC_ACKNOWLEDGE = 18 # /*0x00010010 */ "RC Atomic Acknowledge "
|
|
631
|
+
RC_CMP_SWAP = 19 # /*0x00010011 */ "RC Compare Swap "
|
|
632
|
+
RC_FETCH_ADD = 20 # /*0x00010100 */ "RC Fetch Add "
|
|
633
|
+
RC_SEND_LAST_INVAL = 22 # /*0x00010110 */ "RC Send Last Invalidate "
|
|
634
|
+
RC_SEND_ONLY_INVAL = 23 # /*0x00010111 */ "RC Send Only Invalidate "
|
|
635
|
+
|
|
636
|
+
# Reliable Datagram (RD)
|
|
637
|
+
# [7-5] = 010
|
|
638
|
+
RD_SEND_FIRST = 64 # /*0x01000000 */ "RD Send First "
|
|
639
|
+
RD_SEND_MIDDLE = 65 # /*0x01000001 */ "RD Send Middle "
|
|
640
|
+
RD_SEND_LAST = 66 # /*0x01000010 */ "RD Send Last "
|
|
641
|
+
RD_SEND_LAST_IMM = 67 # /*0x01000011 */ "RD Send Last Immediate "
|
|
642
|
+
RD_SEND_ONLY = 68 # /*0x01000100 */ "RD Send Only "
|
|
643
|
+
RD_SEND_ONLY_IMM = 69 # /*0x01000101 */ "RD Send Only Immediate "
|
|
644
|
+
RD_RDMA_WRITE_FIRST = 70 # /*0x01000110 */ "RD RDMA Write First "
|
|
645
|
+
RD_RDMA_WRITE_MIDDLE = 71 # /*0x01000111 */ "RD RDMA Write Middle "
|
|
646
|
+
RD_RDMA_WRITE_LAST = 72 # /*0x01001000 */ "RD RDMA Write Last "
|
|
647
|
+
RD_RDMA_WRITE_LAST_IMM = 73 # /*0x01001001 */ "RD RDMA Write Last Immediate "
|
|
648
|
+
RD_RDMA_WRITE_ONLY = 74 # /*0x01001010 */ "RD RDMA Write Only "
|
|
649
|
+
RD_RDMA_WRITE_ONLY_IMM = 75 # /*0x01001011 */ "RD RDMA Write Only Immediate "
|
|
650
|
+
RD_RDMA_READ_REQUEST = 76 # /*0x01001100 */ "RD RDMA Read Request "
|
|
651
|
+
RD_RDMA_READ_RESPONSE_FIRST = 77 # /*0x01001101 */ "RD RDMA Read Response First "
|
|
652
|
+
RD_RDMA_READ_RESPONSE_MIDDLE = 78 # /*0x01001110 */ "RD RDMA Read Response Middle "
|
|
653
|
+
RD_RDMA_READ_RESPONSE_LAST = 79 # /*0x01001111 */ "RD RDMA Read Response Last "
|
|
654
|
+
RD_RDMA_READ_RESPONSE_ONLY = 80 # /*0x01010000 */ "RD RDMA Read Response Only "
|
|
655
|
+
RD_ACKNOWLEDGE = 81 # /*0x01010001 */ "RD Acknowledge "
|
|
656
|
+
RD_ATOMIC_ACKNOWLEDGE = 82 # /*0x01010010 */ "RD Atomic Acknowledge "
|
|
657
|
+
RD_CMP_SWAP = 83 # /*0x01010011 */ "RD Compare Swap "
|
|
658
|
+
RD_FETCH_ADD = 84 # /*0x01010100 */ "RD Fetch Add "
|
|
659
|
+
RD_RESYNC = 85 # /*0x01010101 */ "RD RESYNC "
|
|
660
|
+
|
|
661
|
+
# Unreliable Datagram (UD)
|
|
662
|
+
# [7-5] = 011
|
|
663
|
+
UD_SEND_ONLY = 100 # /*0x01100100 */ "UD Send Only "
|
|
664
|
+
UD_SEND_ONLY_IMM = 101 # /*0x01100101 */ "UD Send Only Immediate "
|
|
665
|
+
|
|
666
|
+
# Unreliable Connection (UC)
|
|
667
|
+
# [7-5] = 001
|
|
668
|
+
UC_SEND_FIRST = 32 # /*0x00100000 */ "UC Send First "
|
|
669
|
+
UC_SEND_MIDDLE = 33 # /*0x00100001 */ "UC Send Middle "
|
|
670
|
+
UC_SEND_LAST = 34 # /*0x00100010 */ "UC Send Last "
|
|
671
|
+
UC_SEND_LAST_IMM = 35 # /*0x00100011 */ "UC Send Last Immediate "
|
|
672
|
+
UC_SEND_ONLY = 36 # /*0x00100100 */ "UC Send Only "
|
|
673
|
+
UC_SEND_ONLY_IMM = 37 # /*0x00100101 */ "UC Send Only Immediate "
|
|
674
|
+
UC_RDMA_WRITE_FIRST = 38 # /*0x00100110 */ "UC RDMA Write First"
|
|
675
|
+
UC_RDMA_WRITE_MIDDLE = 39 # /*0x00100111 */ "UC RDMA Write Middle "
|
|
676
|
+
UC_RDMA_WRITE_LAST = 40 # /*0x00101000 */ "UC RDMA Write Last "
|
|
677
|
+
UC_RDMA_WRITE_LAST_IMM = 41 # /*0x00101001 */ "UC RDMA Write Last Immediate"
|
|
678
|
+
UC_RDMA_WRITE_ONLY = 42 # /*0x00101010 */ "UC RDMA Write Only "
|
|
679
|
+
UC_RDMA_WRITE_ONLY_IMM = 43 # /*0x00101011 */ "UC RDMA Write Only Immediate"
|
|
680
|
+
|
|
681
|
+
@dataclass
|
|
682
|
+
class BTH:
|
|
683
|
+
"""BASE TRANSPORT HEADER (BTH) - 12 BYTES
|
|
684
|
+
|
|
685
|
+
Base Transport Header contains the fields for IBA transports.
|
|
686
|
+
"""
|
|
687
|
+
opcode: BTHOpcode = BTHOpcode.RC_SEND_FIRST
|
|
688
|
+
"""OpCode indicates the IBA packet type. It also
|
|
689
|
+
specifies which extension headers follow the BTH
|
|
690
|
+
"""
|
|
691
|
+
se = 0
|
|
692
|
+
"""Solicited Event, this bit indicates that an event
|
|
693
|
+
should be generated by the responder
|
|
694
|
+
"""
|
|
695
|
+
migreq = 0
|
|
696
|
+
"""This bit is used to communicate migration state
|
|
697
|
+
"""
|
|
698
|
+
padcnt = 1
|
|
699
|
+
"""Pad Count indicates how many extra bytes are added
|
|
700
|
+
to the payload to align to a 4 byte boundary
|
|
701
|
+
"""
|
|
702
|
+
tver = 0
|
|
703
|
+
"""Transport Header Version indicates the version of
|
|
704
|
+
the IBA Transport Headers
|
|
705
|
+
"""
|
|
706
|
+
pkey = 65535
|
|
707
|
+
"""Partition Key indicates which logical Partition is
|
|
708
|
+
associated with this packet
|
|
709
|
+
"""
|
|
710
|
+
reserved = 7
|
|
711
|
+
"""Reserved
|
|
712
|
+
"""
|
|
713
|
+
destqp = 2
|
|
714
|
+
"""Destination QP indicates the Work Queue Pair Number
|
|
715
|
+
(QP) at the destination
|
|
716
|
+
"""
|
|
717
|
+
ackreq = 0
|
|
718
|
+
"""Acknowledge Request, this bit is used to indicate
|
|
719
|
+
that an acknowledge (for this packet) should be
|
|
720
|
+
scheduled by the responder
|
|
721
|
+
"""
|
|
722
|
+
reserved_7bits = 0
|
|
723
|
+
"""Reserved
|
|
724
|
+
"""
|
|
725
|
+
psn =0
|
|
726
|
+
"""Packet Sequence Number is used to detect a missing
|
|
727
|
+
or duplicate Packet
|
|
728
|
+
"""
|
|
729
|
+
|
|
730
|
+
def __str__(self):
|
|
731
|
+
_opcode = '{:02X}'.format(self.opcode.value)
|
|
732
|
+
_combo_1 = '{:02X}'.format((self.se<<7)+(self.migreq<<6)+(self.padcnt<<4)+self.tver)
|
|
733
|
+
_pk = '{:04X}'.format(self.pkey)
|
|
734
|
+
_reserved = '{:02X}'.format(self.reserved)
|
|
735
|
+
_qp = '{:06X}'.format(self.destqp)
|
|
736
|
+
_combo_2 = '{:02X}'.format((self.ackreq<<7)+self.reserved_7bits)
|
|
737
|
+
_ps = '{:06X}'.format(self.psn)
|
|
738
|
+
return f"{_opcode}{_combo_1}{_pk}{_reserved}{_qp}{_combo_2}{_ps}".upper()
|
|
739
|
+
|
|
740
|
+
@dataclass
|
|
741
|
+
class RETH:
|
|
742
|
+
"""RDMA EXTENDED TRANSPORT HEADER (RETH) - 16 BYTES
|
|
743
|
+
|
|
744
|
+
RDMA Extended Transport Header contains the additional transport fields
|
|
745
|
+
for RDMA operations. The RETH is present in only the first (or only)
|
|
746
|
+
packet of an RDMA Request as indicated by the Base Transport Header
|
|
747
|
+
OpCode field.
|
|
748
|
+
"""
|
|
749
|
+
va = 0
|
|
750
|
+
"""Virtual Address of the RDMA operation
|
|
751
|
+
"""
|
|
752
|
+
r_key = 0
|
|
753
|
+
"""Remote Key that authorizes access for the RDMA operation
|
|
754
|
+
"""
|
|
755
|
+
dma_len = 0
|
|
756
|
+
"""DMA Length indicates the length (in Bytes) of the DMA operation.
|
|
757
|
+
"""
|
|
758
|
+
|
|
759
|
+
def __str__(self):
|
|
760
|
+
_va = '{:016X}'.format(self.va)
|
|
761
|
+
_r_key = '{:08X}'.format(self.r_key)
|
|
762
|
+
_dma_len = '{:08X}'.format(self.dma_len)
|
|
763
|
+
return f"{_va}{_r_key}{_dma_len}".upper()
|
|
764
|
+
|
|
765
|
+
@dataclass
|
|
766
|
+
class AETH:
|
|
767
|
+
"""ACK EXTENDED TRANSPORT HEADER (AETH) - 4 BYTES
|
|
768
|
+
|
|
769
|
+
ACK Extended Transport Header contains the additional transport fields
|
|
770
|
+
for ACK packets. The AETH is only in Acknowledge, RDMA READ Response
|
|
771
|
+
First, RDMA READ Response Last, and RDMA READ Response Only packets
|
|
772
|
+
as indicated by the Base Transport Header OpCode field.
|
|
773
|
+
"""
|
|
774
|
+
syndrome = 0
|
|
775
|
+
"""Syndrome indicates if this is an ACK or NAK
|
|
776
|
+
packet plus additional information about the
|
|
777
|
+
ACK or NAK
|
|
778
|
+
"""
|
|
779
|
+
msn = 0
|
|
780
|
+
"""Message Sequence Number indicates the sequence
|
|
781
|
+
number of the last message completed at the
|
|
782
|
+
responder
|
|
783
|
+
"""
|
|
784
|
+
|
|
785
|
+
def __str__(self):
|
|
786
|
+
_syndrome = '{:02X}'.format(self.syndrome)
|
|
787
|
+
_msn = '{:06X}'.format(self.msn)
|
|
788
|
+
return f"{_syndrome}{_msn}".upper()
|
|
789
|
+
|
|
790
|
+
@dataclass
|
|
791
|
+
class RDETH:
|
|
792
|
+
"""RELIABLE DATAGRAM EXTENDED TRANSPORT HEADER (RDETH) - 4 BYTES
|
|
793
|
+
|
|
794
|
+
Reliable Datagram Extended Transport Header contains the additional
|
|
795
|
+
transport fields for reliable datagram service. The RDETH is only
|
|
796
|
+
in Reliable Datagram packets as indicated by the Base Transport Header
|
|
797
|
+
OpCode field.
|
|
798
|
+
"""
|
|
799
|
+
|
|
800
|
+
reserved = 0
|
|
801
|
+
"""Reserved
|
|
802
|
+
"""
|
|
803
|
+
ee_context = 0
|
|
804
|
+
"""EE-Context indicates which End-to-End Context
|
|
805
|
+
should be used for this Reliable Datagram packet
|
|
806
|
+
"""
|
|
807
|
+
|
|
808
|
+
def __str__(self):
|
|
809
|
+
_reserved = '{:02X}'.format(self.reserved)
|
|
810
|
+
_ee_context = '{:06X}'.format(self.ee_context)
|
|
811
|
+
return f"{_reserved}{_ee_context}".upper()
|
|
812
|
+
|
|
813
|
+
@dataclass
|
|
814
|
+
class DETH:
|
|
815
|
+
"""DATAGRAM EXTENDED TRANSPORT HEADER (DETH) - 8 BYTES
|
|
816
|
+
|
|
817
|
+
Datagram Extended Transport Header contains the additional transport
|
|
818
|
+
fields for datagram service. The DETH is only in datagram packets if
|
|
819
|
+
indicated by the Base Transport Header OpCode field.
|
|
820
|
+
"""
|
|
821
|
+
q_key = 0
|
|
822
|
+
"""Queue Key is required to authorize access to the receive queue
|
|
823
|
+
"""
|
|
824
|
+
reserved = 0
|
|
825
|
+
"""Reserved
|
|
826
|
+
"""
|
|
827
|
+
src_qp = 0
|
|
828
|
+
"""Source QP indicates the Work Queue Pair Number (QP) at the source.
|
|
829
|
+
"""
|
|
830
|
+
|
|
831
|
+
def __str__(self):
|
|
832
|
+
_q_key = '{:08X}'.format(self.q_key)
|
|
833
|
+
_reserved = '{:02X}'.format(self.reserved)
|
|
834
|
+
_src_qp = '{:06X}'.format(self.src_qp)
|
|
835
|
+
return f"{_q_key}{_reserved}{_src_qp}".upper()
|
|
836
|
+
|
|
837
|
+
@dataclass
|
|
838
|
+
class IB:
|
|
839
|
+
bth = BTH()
|
|
840
|
+
reth = RETH()
|
|
841
|
+
aeth = AETH()
|
|
842
|
+
rdeth = RDETH()
|
|
843
|
+
deth = DETH()
|
|
844
|
+
|
|
845
|
+
def __str__(self):
|
|
846
|
+
if self.bth.opcode == BTHOpcode.RC_SEND_FIRST or self.bth.opcode == BTHOpcode.RC_SEND_MIDDLE or self.bth.opcode == BTHOpcode.RC_SEND_LAST:
|
|
847
|
+
return str(self.bth)
|
|
848
|
+
if self.bth.opcode == BTHOpcode.RC_RDMA_WRITE_FIRST:
|
|
849
|
+
return str(self.bth)+str(self.reth)
|
|
850
|
+
if self.bth.opcode == BTHOpcode.RC_RDMA_WRITE_MIDDLE or self.bth.opcode == BTHOpcode.RC_RDMA_WRITE_LAST:
|
|
851
|
+
return str(self.bth)
|
|
852
|
+
if self.bth.opcode == BTHOpcode.RC_RDMA_READ_RESPONSE_FIRST or self.bth.opcode == BTHOpcode.RC_RDMA_READ_RESPONSE_LAST:
|
|
853
|
+
return str(self.bth)+str(self.aeth)
|
|
854
|
+
if self.bth.opcode == BTHOpcode.RC_RDMA_READ_RESPONSE_MIDDLE:
|
|
855
|
+
return str(self.bth)
|
|
856
|
+
if self.bth.opcode == BTHOpcode.RD_SEND_FIRST or self.bth.opcode == BTHOpcode.RD_SEND_MIDDLE or self.bth.opcode == BTHOpcode.RD_SEND_LAST:
|
|
857
|
+
return str(self.bth)+str(self.rdeth)+str(self.deth)
|
|
858
|
+
if self.bth.opcode == BTHOpcode.RD_RDMA_WRITE_FIRST:
|
|
859
|
+
return str(self.bth)+str(self.rdeth)+str(self.deth)+str(self.reth)
|
|
860
|
+
if self.bth.opcode == BTHOpcode.RD_RDMA_WRITE_MIDDLE or self.bth.opcode == BTHOpcode.RD_RDMA_WRITE_LAST:
|
|
861
|
+
return str(self.bth)+str(self.rdeth)+str(self.deth)
|
|
862
|
+
if self.bth.opcode == BTHOpcode.RD_RDMA_READ_RESPONSE_FIRST or self.bth.opcode == BTHOpcode.RD_RDMA_READ_RESPONSE_LAST:
|
|
863
|
+
return str(self.bth)+str(self.rdeth)+str(self.aeth)
|
|
864
|
+
if self.bth.opcode == BTHOpcode.RD_RDMA_READ_RESPONSE_MIDDLE:
|
|
865
|
+
return str(self.bth)+str(self.rdeth)
|
|
866
|
+
if self.bth.opcode == BTHOpcode.UD_SEND_ONLY:
|
|
867
|
+
return str(self.bth)+str(self.deth)
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
######################
|
|
871
|
+
# MPLS #
|
|
872
|
+
######################
|
|
873
|
+
@dataclass
|
|
874
|
+
class MPLS:
|
|
875
|
+
label: int = 0
|
|
876
|
+
exp: int = 0
|
|
877
|
+
s: int = 1
|
|
878
|
+
ttl: int = 0
|
|
879
|
+
|
|
880
|
+
def __str__(self):
|
|
881
|
+
_combo: str = '{:06X}'.format((self.label<<4)+(self.exp<<1)+(self.s))
|
|
882
|
+
_ttl: str = '{:02X}'.format(self.ttl)
|
|
883
|
+
return f"{_combo}{_ttl}".upper()
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
__all__ = (
|
|
887
|
+
"IPV4",
|
|
888
|
+
"IPV6",
|
|
889
|
+
"UDP",
|
|
890
|
+
"TCP",
|
|
891
|
+
"PTP",
|
|
892
|
+
"eCPRIGeneralDataTransfer",
|
|
893
|
+
"DHCPV4",
|
|
894
|
+
"DHCPOptionMessageType",
|
|
895
|
+
"DHCPOptionClientIdentifier",
|
|
896
|
+
"DHCPOptionRequestedIP",
|
|
897
|
+
"DHCPOptionParamRequestList",
|
|
898
|
+
"DHCPOptionPad",
|
|
899
|
+
"DHCPOptionEnd",
|
|
900
|
+
"MACControlPFC",
|
|
901
|
+
"MACControlPause",
|
|
902
|
+
"BTH",
|
|
903
|
+
"RETH",
|
|
904
|
+
"AETH",
|
|
905
|
+
"RDETH",
|
|
906
|
+
"DETH",
|
|
907
|
+
"IB",
|
|
908
|
+
"MPLS"
|
|
909
|
+
)
|
xoa_driver/functions/mgmt.py
CHANGED
|
@@ -25,8 +25,6 @@ LinkTrainingSupported = FamilyL
|
|
|
25
25
|
# region Testers
|
|
26
26
|
async def reserve_tester(tester: GenericAnyTester, force: bool = True) -> None:
|
|
27
27
|
"""
|
|
28
|
-
.. versionadded:: 1.1
|
|
29
|
-
|
|
30
28
|
Reserve a tester regardless whether it is owned by others or not.
|
|
31
29
|
|
|
32
30
|
:param tester: The tester to reserve
|
|
@@ -39,25 +37,23 @@ async def reserve_tester(tester: GenericAnyTester, force: bool = True) -> None:
|
|
|
39
37
|
r = await tester.reservation.get()
|
|
40
38
|
if force and r.operation == enums.ReservedStatus.RESERVED_BY_OTHER:
|
|
41
39
|
await tester.reservation.set_relinquish()
|
|
42
|
-
await asyncio.gather(*(
|
|
40
|
+
await asyncio.gather(*(release_module(m, True) for m in tester.modules))
|
|
43
41
|
await tester.reservation.set_reserve()
|
|
44
42
|
elif r.operation == enums.ReservedStatus.RELEASED:
|
|
45
43
|
await tester.reservation.set_reserve()
|
|
46
44
|
|
|
47
45
|
|
|
48
|
-
async def
|
|
46
|
+
async def release_tester(
|
|
49
47
|
tester: GenericAnyTester,
|
|
50
|
-
|
|
48
|
+
should_release_modules_ports: bool = False,
|
|
51
49
|
) -> None:
|
|
52
50
|
"""
|
|
53
|
-
.. versionadded:: 1.1
|
|
54
|
-
|
|
55
51
|
Free a tester. If the tester is reserved by you, release the tester. If the tester is reserved by others, relinquish the tester. The tester should have no owner afterwards.
|
|
56
52
|
|
|
57
53
|
:param tester: The tester to free
|
|
58
54
|
:type tester: :class:`~xoa_driver.testers.GenericAnyTester`
|
|
59
|
-
:param
|
|
60
|
-
:type
|
|
55
|
+
:param should_release_modules_ports: should modules and ports also be freed, defaults to False
|
|
56
|
+
:type should_release_modules_ports: bool, optional
|
|
61
57
|
:return:
|
|
62
58
|
:rtype: None
|
|
63
59
|
"""
|
|
@@ -66,14 +62,12 @@ async def free_tester(
|
|
|
66
62
|
await tester.reservation.set_relinquish()
|
|
67
63
|
elif r.operation == enums.ReservedStatus.RESERVED_BY_YOU:
|
|
68
64
|
await tester.reservation.set_release()
|
|
69
|
-
if
|
|
70
|
-
await asyncio.gather(*(
|
|
65
|
+
if should_release_modules_ports:
|
|
66
|
+
await asyncio.gather(*(release_module(m, True) for m in tester.modules))
|
|
71
67
|
|
|
72
68
|
|
|
73
69
|
async def get_chassis_sys_uptime_sec(tester: L23Tester) -> int:
|
|
74
70
|
"""
|
|
75
|
-
.. versionadded:: 2.7.2
|
|
76
|
-
|
|
77
71
|
Get chassis system uptime in seconds
|
|
78
72
|
|
|
79
73
|
:param tester: The tester to free
|
|
@@ -96,8 +90,6 @@ async def get_chassis_sys_uptime_sec(tester: L23Tester) -> int:
|
|
|
96
90
|
|
|
97
91
|
def get_module(tester: GenericAnyTester, module_id: int) -> GenericAnyModule:
|
|
98
92
|
"""
|
|
99
|
-
.. versionadded:: 1.1
|
|
100
|
-
|
|
101
93
|
Get a module object of the tester.
|
|
102
94
|
|
|
103
95
|
:param tester: The tester object
|
|
@@ -113,8 +105,6 @@ def get_module(tester: GenericAnyTester, module_id: int) -> GenericAnyModule:
|
|
|
113
105
|
|
|
114
106
|
def get_modules(tester: GenericAnyTester) -> tuple[GenericAnyModule, ...]:
|
|
115
107
|
"""
|
|
116
|
-
.. versionadded:: 1.1
|
|
117
|
-
|
|
118
108
|
Get all modules of the tester
|
|
119
109
|
|
|
120
110
|
:param tester: The tester object
|
|
@@ -127,8 +117,6 @@ def get_modules(tester: GenericAnyTester) -> tuple[GenericAnyModule, ...]:
|
|
|
127
117
|
|
|
128
118
|
async def reserve_module(module: GenericAnyModule, force: bool = True) -> None:
|
|
129
119
|
"""
|
|
130
|
-
.. versionadded:: 1.1
|
|
131
|
-
|
|
132
120
|
Reserve a module regardless whether it is owned by others or not.
|
|
133
121
|
|
|
134
122
|
:param module: The module to reserve
|
|
@@ -140,24 +128,22 @@ async def reserve_module(module: GenericAnyModule, force: bool = True) -> None:
|
|
|
140
128
|
"""
|
|
141
129
|
r = await module.reservation.get()
|
|
142
130
|
if force and r.operation == enums.ReservedStatus.RESERVED_BY_OTHER:
|
|
143
|
-
await
|
|
131
|
+
await release_module(module, True)
|
|
144
132
|
await module.reservation.set_reserve()
|
|
145
133
|
elif r.operation == enums.ReservedStatus.RELEASED:
|
|
146
134
|
await module.reservation.set_reserve()
|
|
147
135
|
|
|
148
136
|
|
|
149
|
-
async def
|
|
150
|
-
module: GenericAnyModule,
|
|
137
|
+
async def release_module(
|
|
138
|
+
module: GenericAnyModule, should_release_ports: bool = False
|
|
151
139
|
) -> None:
|
|
152
140
|
"""
|
|
153
|
-
.. versionadded:: 1.2
|
|
154
|
-
|
|
155
141
|
Free a module. If the module is reserved by you, release the module. If the module is reserved by others, relinquish the module. The module should have no owner afterwards.
|
|
156
142
|
|
|
157
143
|
:param module: The module to free
|
|
158
144
|
:type module: :class:`~xoa_driver.modules.GenericAnyModule`
|
|
159
|
-
:param
|
|
160
|
-
:type
|
|
145
|
+
:param should_release_ports: should ports also be freed, defaults to False
|
|
146
|
+
:type should_release_ports: bool, optional
|
|
161
147
|
:return:
|
|
162
148
|
:rtype: None
|
|
163
149
|
"""
|
|
@@ -166,16 +152,14 @@ async def free_module(
|
|
|
166
152
|
await module.reservation.set_relinquish()
|
|
167
153
|
elif r.operation == enums.ReservedStatus.RESERVED_BY_YOU:
|
|
168
154
|
await module.reservation.set_release()
|
|
169
|
-
if
|
|
170
|
-
await
|
|
155
|
+
if should_release_ports:
|
|
156
|
+
await release_ports(*module.ports)
|
|
171
157
|
|
|
172
158
|
|
|
173
159
|
def get_module_supported_media(
|
|
174
160
|
module: GenericL23Module | ModuleChimera,
|
|
175
161
|
) -> list[dict[str, t.Any]]:
|
|
176
162
|
"""
|
|
177
|
-
.. versionadded:: 1.3
|
|
178
|
-
|
|
179
163
|
Get a list of supported media, port speed and count of the module.
|
|
180
164
|
|
|
181
165
|
:param module: The module object
|
|
@@ -203,8 +187,6 @@ async def set_module_media_config(
|
|
|
203
187
|
force: bool = True,
|
|
204
188
|
) -> None:
|
|
205
189
|
"""
|
|
206
|
-
.. versionadded:: 1.3
|
|
207
|
-
|
|
208
190
|
Set module's media configuration.
|
|
209
191
|
|
|
210
192
|
:param module: The module object
|
|
@@ -241,8 +223,6 @@ async def set_module_port_config(
|
|
|
241
223
|
force: bool = True,
|
|
242
224
|
) -> None:
|
|
243
225
|
"""
|
|
244
|
-
.. versionadded:: 1.3
|
|
245
|
-
|
|
246
226
|
Set module's port-speed configuration
|
|
247
227
|
|
|
248
228
|
:param module: The module object
|
|
@@ -259,7 +239,7 @@ async def set_module_port_config(
|
|
|
259
239
|
"""
|
|
260
240
|
|
|
261
241
|
# reserve the module first
|
|
262
|
-
await
|
|
242
|
+
await release_module(module, True)
|
|
263
243
|
await reserve_module(module, force)
|
|
264
244
|
|
|
265
245
|
# get the supported media by the module
|
|
@@ -280,15 +260,13 @@ async def set_module_port_config(
|
|
|
280
260
|
):
|
|
281
261
|
portspeed_list = [port_count] + port_count * [port_speed]
|
|
282
262
|
await module.cfp.config.set(portspeed_list=portspeed_list)
|
|
283
|
-
await
|
|
263
|
+
await release_module(module, False)
|
|
284
264
|
return None
|
|
285
265
|
raise NotSupportPortSpeed(module)
|
|
286
266
|
|
|
287
267
|
|
|
288
268
|
async def get_module_eol_date(module: GenericAnyModule) -> str:
|
|
289
269
|
"""
|
|
290
|
-
.. versionadded:: 1.3
|
|
291
|
-
|
|
292
270
|
Get module's End-of-Life date
|
|
293
271
|
|
|
294
272
|
:param module: The module object
|
|
@@ -303,8 +281,6 @@ async def get_module_eol_date(module: GenericAnyModule) -> str:
|
|
|
303
281
|
|
|
304
282
|
async def get_module_eol_days(module: GenericAnyModule) -> int:
|
|
305
283
|
"""
|
|
306
|
-
.. versionadded:: 1.3
|
|
307
|
-
|
|
308
284
|
Get days until module's End-of-Life date
|
|
309
285
|
|
|
310
286
|
:param module: The module object
|
|
@@ -321,8 +297,6 @@ async def get_module_eol_days(module: GenericAnyModule) -> int:
|
|
|
321
297
|
|
|
322
298
|
async def get_module_cage_insertion_count(module: Z800FreyaModule, cage_index: int) -> int:
|
|
323
299
|
"""
|
|
324
|
-
.. versionadded:: 2.7.2
|
|
325
|
-
|
|
326
300
|
Get module cage insertion count
|
|
327
301
|
|
|
328
302
|
:param module: The Z800 Freya module object
|
|
@@ -352,8 +326,6 @@ async def get_module_cage_insertion_count(module: Z800FreyaModule, cage_index: i
|
|
|
352
326
|
|
|
353
327
|
def get_all_ports(tester: GenericAnyTester) -> tuple[GenericAnyPort, ...]:
|
|
354
328
|
"""
|
|
355
|
-
.. versionadded:: 1.1
|
|
356
|
-
|
|
357
329
|
Get all ports of the tester
|
|
358
330
|
|
|
359
331
|
:param tester: The tester object
|
|
@@ -367,8 +339,6 @@ def get_all_ports(tester: GenericAnyTester) -> tuple[GenericAnyPort, ...]:
|
|
|
367
339
|
|
|
368
340
|
def get_ports(tester: GenericAnyTester, module_id: int) -> tuple[GenericAnyPort, ...]:
|
|
369
341
|
"""
|
|
370
|
-
.. versionadded:: 1.1
|
|
371
|
-
|
|
372
342
|
Get all ports of the module
|
|
373
343
|
|
|
374
344
|
:param tester: The tester object
|
|
@@ -384,8 +354,6 @@ def get_ports(tester: GenericAnyTester, module_id: int) -> tuple[GenericAnyPort,
|
|
|
384
354
|
|
|
385
355
|
def get_port(tester: GenericAnyTester, module_id: int, port_id: int) -> GenericAnyPort:
|
|
386
356
|
"""
|
|
387
|
-
.. versionadded:: 1.1
|
|
388
|
-
|
|
389
357
|
Get a port of the module
|
|
390
358
|
|
|
391
359
|
:param tester: The tester object
|
|
@@ -402,10 +370,8 @@ def get_port(tester: GenericAnyTester, module_id: int, port_id: int) -> GenericA
|
|
|
402
370
|
return module.ports.obtain(port_id)
|
|
403
371
|
|
|
404
372
|
|
|
405
|
-
async def reserve_port(port: GenericAnyPort, force: bool = True) -> None:
|
|
373
|
+
async def reserve_port(port: GenericAnyPort, force: bool = True, reset: bool = False) -> None:
|
|
406
374
|
"""
|
|
407
|
-
.. versionadded:: 1.1
|
|
408
|
-
|
|
409
375
|
Reserve a port regardless whether it is owned by others or not.
|
|
410
376
|
|
|
411
377
|
:param port: The port to reserve
|
|
@@ -423,27 +389,12 @@ async def reserve_port(port: GenericAnyPort, force: bool = True) -> None:
|
|
|
423
389
|
)
|
|
424
390
|
elif r.status == enums.ReservedStatus.RELEASED:
|
|
425
391
|
await port.reservation.set_reserve()
|
|
392
|
+
if reset:
|
|
393
|
+
await port.reset.set()
|
|
426
394
|
|
|
427
395
|
|
|
428
|
-
async def
|
|
429
|
-
"""
|
|
430
|
-
.. versionadded:: 1.1
|
|
431
|
-
|
|
432
|
-
Reserve and reset a port
|
|
433
|
-
|
|
434
|
-
:param port: The port to reset
|
|
435
|
-
:type port: GenericAnyPort
|
|
436
|
-
:return:
|
|
437
|
-
:rtype: None
|
|
438
|
-
"""
|
|
439
|
-
await reserve_port(port, False)
|
|
440
|
-
await port.reset.set()
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
async def free_port(port: GenericAnyPort) -> None:
|
|
396
|
+
async def release_port(port: GenericAnyPort) -> None:
|
|
444
397
|
"""
|
|
445
|
-
.. versionadded:: 1.1
|
|
446
|
-
|
|
447
398
|
Free a port. If the port is reserved by you, release the port. If the port is reserved by others, relinquish the port. The port should have no owner afterwards.
|
|
448
399
|
|
|
449
400
|
:param port: The port to free
|
|
@@ -458,16 +409,14 @@ async def free_port(port: GenericAnyPort) -> None:
|
|
|
458
409
|
await port.reservation.set_release()
|
|
459
410
|
|
|
460
411
|
|
|
461
|
-
async def
|
|
412
|
+
async def release_ports(*ports: GenericAnyPort) -> None:
|
|
462
413
|
"""
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
Free all ports on a module.
|
|
414
|
+
Free a list of ports. If the port is reserved by you, release the port. If the port is reserved by others, relinquish the port. The port should have no owner afterwards.
|
|
466
415
|
|
|
467
|
-
:param
|
|
468
|
-
:type
|
|
416
|
+
:param ports: The ports to free
|
|
417
|
+
:type ports: GenericAnyPort
|
|
469
418
|
"""
|
|
470
|
-
await asyncio.gather(*(
|
|
419
|
+
await asyncio.gather(*(release_port(port=p) for p in ports))
|
|
471
420
|
|
|
472
421
|
|
|
473
422
|
|
|
@@ -477,12 +426,10 @@ async def free_ports(*ports: GenericAnyPort) -> None:
|
|
|
477
426
|
# region Streams
|
|
478
427
|
async def remove_streams(port: GenericAnyPort) -> None:
|
|
479
428
|
"""
|
|
480
|
-
|
|
429
|
+
Remove all streams on a port witout resetting the port.
|
|
481
430
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
:param module: The port object
|
|
485
|
-
:type module: GenericAnyPort
|
|
431
|
+
:param port: The port object
|
|
432
|
+
:type port: GenericAnyPort
|
|
486
433
|
"""
|
|
487
434
|
await port.streams.server_sync()
|
|
488
435
|
await asyncio.gather(*(s.delete() for s in port.streams))
|
|
@@ -491,10 +438,10 @@ async def remove_streams(port: GenericAnyPort) -> None:
|
|
|
491
438
|
# endregion
|
|
492
439
|
|
|
493
440
|
__all__ = (
|
|
494
|
-
"
|
|
495
|
-
"
|
|
496
|
-
"
|
|
497
|
-
"
|
|
441
|
+
"release_module",
|
|
442
|
+
"release_port",
|
|
443
|
+
"release_ports",
|
|
444
|
+
"release_tester",
|
|
498
445
|
"get_all_ports",
|
|
499
446
|
"get_module",
|
|
500
447
|
"get_module_eol_date",
|
|
@@ -506,7 +453,6 @@ __all__ = (
|
|
|
506
453
|
"reserve_module",
|
|
507
454
|
"reserve_port",
|
|
508
455
|
"reserve_tester",
|
|
509
|
-
"reset_port",
|
|
510
456
|
"set_module_media_config",
|
|
511
457
|
"set_module_port_config",
|
|
512
458
|
"remove_streams",
|
xoa_driver/functions/tools.py
CHANGED
|
@@ -253,4 +253,16 @@ def dictionize_anlt_log_ctrl_status(
|
|
|
253
253
|
"fsm_lt_stimuli": _fsm_lt_stimuli,
|
|
254
254
|
"fsm_lt_alg0": _fsm_lt_alg0,
|
|
255
255
|
"fsm_lt_algn1": _fsm_lt_algn1,
|
|
256
|
-
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
__all__ = (
|
|
259
|
+
"get_ctx",
|
|
260
|
+
"dictionize_autoneg_status",
|
|
261
|
+
"dictionize_lt_status",
|
|
262
|
+
"dictionize_txtap_get",
|
|
263
|
+
"dictionize_anlt_status",
|
|
264
|
+
"dictionize_lt_im_status",
|
|
265
|
+
"dictionize_lt_algorithm_status",
|
|
266
|
+
"MODULE_EOL_INFO",
|
|
267
|
+
"dictionize_anlt_log_ctrl_status",
|
|
268
|
+
)
|