Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FC Data corrupt? #47

Closed
bluecmd opened this issue Sep 6, 2020 · 8 comments
Closed

FC Data corrupt? #47

bluecmd opened this issue Sep 6, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@bluecmd
Copy link
Owner

bluecmd commented Sep 6, 2020

There seems to be some odd things going on with the FC data.

This is one of the frames from the C2H DMA:

Fibre Channel Delimiter: SOF: SOFf - SOF Fabric EOF: 0x0
    SOF: SOFf - SOF Fabric (0xbcb55858)
    CRC: 0x00000000 incorrect, should be 0x9b466380
        [Expert Info (Error/Checksum): Bad checksum [should be 0x9b466380]]
            [Bad checksum [should be 0x9b466380]]
            [Severity level: Error]
            [Group: Checksum]
    [CRC Status: Bad]
    EOF: Unknown (0x00000000)
Fibre Channel
    R_CTL: 0x7(Device_Data/Command Status)
    Dest Addr: 9f.7a.fd
    CS_CTL: 0x7c
    Src Addr: 6c.0f.09
    Type: Unknown (0x3f)
    F_CTL: 0x0f6741, ExgRpd: Exchange Originator, SeqRec: Seq Initiator, ExgFst: NOT exchg first, ExgLst: NOT exchg last, SeqLst: Seq Last, Pri: Priority, TSI: Transfer Seq Initiative, LDF: Unknown, A01: Unknown, RetSeq: Retransmitted Sequence
        0... .... .... .... .... .... = ExgRpd: Exchange Originator
        .0.. .... .... .... .... .... = SeqRec: Seq Initiator
        ..0. .... .... .... .... .... = ExgFst: NOT exchg first
        ...0 .... .... .... .... .... = ExgLst: NOT exchg last
        .... 1... .... .... .... .... = SeqLst: Seq Last
        .... ..1. .... .... .... .... = Pri: Priority
        .... ...1 .... .... .... .... = TSI: Transfer Seq Initiative
        .... .... 01.. .... .... .... = LDF: Unknown (0x1)
        .... .... ..10 .... .... .... = A01: Unknown (0x2)
        .... .... .... ..1. .... .... = RetSeq: Retransmitted Sequence
        .... .... .... .... ..00 .... = AA: ABTS - Cont (0x0)
        .... .... .... .... .... 0... = RelOff: rel offset NOT set
    SEQ_ID: 0x1a
    DF_CTL: 0x7d
    SEQ_CNT: 56449
    OX_ID: 0x41f9
    RX_ID: 0xd400
    Parameter: 0x9df4d3f8
    Network DA: 6f:4e:e9:80:8f:ea:63:c8
    Network SA: d2:a5:93:f4:6b:3d:be:c3
Data (2504 bytes)
    Data: 61a98662574702abbecf16959856d5bd18f508cd6f848d17…
    [Length: 2504]

0000  bc b5 58 58 07 9f 7a fd 7c 6c 0f 09 3f 0f 67 41   ..XX..z.|l..?.gA
0010  1a 7d dc 81 41 f9 d4 00 9d f4 d3 f8 6f 4e e9 80   .}..A.......oN..
0020  8f ea 63 c8 d2 a5 93 f4 6b 3d be c3 61 a9 86 62   ..c.....k=..a..b
0030  57 47 02 ab be cf 16 95 98 56 d5 bd 18 f5 08 cd   WG.......V......
0040  6f 84 8d 17 a7 9c 3a 40 ce 6d 7d 9d 66 92 4a c8   o.....:@.m}.f.J.
0050  29 92 4b 8c bc c1 9e dd 7d eb 60 12 8a 9c 61 9f   ).K.....}.`...a.
0060  5f cd 3c 61 99 a7 fd af 30 7c 57 9d 37 9b 92 43   _.<a....0|W.7..C
0070  25 7a d0 4b 60 ae 65 6f ca 76 4b 12 f4 0d b7 64   %z.K`.eo.vK....d
0080  b8 7a db d3 c8 1d 2c 99 b9 26 ce ab 34 39 6b e3   .z....,..&..49k.
0090  1f db d8 1e c8 65 4f 77 34 66 cd 2c f7 3b 10 57   .....eOw4f.,.;.W
00a0  40 5d 3d 1d 60 44 af aa d2 8f ce 07 44 8e f5 28   @]=.`D......D..(
00b0  ad 7a 9c 39 72 e7 bf 10 2c 42 c1 22 99 b7 41 89   .z.9r...,B."..A.
00c0  55 83 26 27 7f 7b 64 1a 2e 37 7f 17 ea 85 68 75   U.&'.{d..7....hu
00d0  a2 0a cf 28 4a 1e 08 f5 d2 27 f6 03 6c 26 72 98   ...(J....'..l&r.
00e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
00f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................

The SOF marker is clearly present, and it is in the correct place - so I wonder what the other data is.
This could be something special that SOFf frames do as well that I need to read up on.

The frames are really huge as well, increasing by 404 bytes every time.

The first packet that is sent to the C2H is:

Fibre Channel Delimiter: SOF: 0xbc94ffff EOF: 0x0
    SOF: Unknown (0xbc94ffff)
    CRC: 0x00000000 incorrect, should be 0xc8c2a7d2
        [Expert Info (Error/Checksum): Bad checksum [should be 0xc8c2a7d2]]
            [Bad checksum [should be 0xc8c2a7d2]]
            [Severity level: Error]
            [Group: Checksum]
    [CRC Status: Bad]
    EOF: Unknown (0x00000000)
Fibre Channel
    R_CTL: 0xbc(0xb0/0xc)
    Dest Addr: 94.ff.ff
    CS_CTL: 0xbc
    Src Addr: 94.ff.ff
    Type: Unknown (0xbc)
    F_CTL: 0x94ffff, ExgRpd: Exchange Responder, SeqRec: Seq Initiator, ExgFst: NOT exchg first, ExgLst: Exchg Last, SeqLst: NOT seq last, Pri: CS_CTL, TSI: NOT transfer seq initiative, LDF: Unknown, A01: Unknown, RetSeq: Retransmitted Sequenc
        1... .... .... .... .... .... = ExgRpd: Exchange Responder
        .0.. .... .... .... .... .... = SeqRec: Seq Initiator
        ..0. .... .... .... .... .... = ExgFst: NOT exchg first
        ...1 .... .... .... .... .... = ExgLst: Exchg Last
        .... 0... .... .... .... .... = SeqLst: NOT seq last
        .... ..0. .... .... .... .... = Pri: CS_CTL
        .... ...0 .... .... .... .... = TSI: NOT transfer seq initiative
        .... .... 11.. .... .... .... = LDF: Unknown (0x3)
        .... .... ..11 .... .... .... = A01: Unknown (0x3)
        .... .... .... ..1. .... .... = RetSeq: Retransmitted Sequence
        .... .... .... .... ..11 .... = AA: Unknown (0x3)
        .... .... .... .... .... 1... = RelOff: Rel Offset SET
    SEQ_ID: 0xbc
    DF_CTL: 0x94
    SEQ_CNT: 65535
    OX_ID: 0xbc94
    RX_ID: 0xffff
    Parameter: 0xbc94ffff
Data (500 bytes)
    Data: bc94ffffbc94ffffbc94ffffbc94ffffbc94ffffbc94ffff…
    [Length: 500]

0000  bc 94 ff ff bc 94 ff ff bc 94 ff ff bc 94 ff ff   ................
0010  bc 94 ff ff bc 94 ff ff bc 94 ff ff bc 94 ff ff   ................
0020  bc 94 ff ff bc 94 ff ff bc 94 ff ff bc 94 ff ff   ................
0030  bc 94 ff ff bc 94 ff ff bc 94 ff ff bc 94 ff ff   ................
0040  bc 94 ff ff bc b5 58 58 07 9f 7a fd 7c 6c 0f 09   ......XX..z.|l..
0050  3f 0f 67 41 07 7d dc 81 41 d8 d4 07 dd f4 91 f8   ?.gA.}..A.......
0060  69 8e e8 d4 8f f7 63 cb ca a5 fc f4 6a 4d be db   i.....c.....jM..
0070  61 b0 a6 62 3b 47 36 eb b8 5f 16 e6 18 56 e5 bc   a..b;G6.._...V..
0080  5b f5 14 4d 6d 0e 8d 7e 67 9e 0e 40 bf 6d 63 85   [[email protected].
0090  66 fd 4a e8 59 95 13 8c e7 e1 98 71 7c 8b 20 09   f.J.Y......q|. .
00a0  1a 9f 0a 1f 30 fd 3c 52 99 a3 7d b4 9a 7c 52 5d   ....0.<R..}..|R]
00b0  01 ef 94 a2 25 17 48 4b 3f af 06 1f d1 ae 49 c3   ....%.HK?.....I.
00c0  d4 62 db 67 ec 3a b1 43 d5 6e ac 99 89 06 8d ac   .b.g.:.C.n......
00d0  68 b9 2b 69 19 72 19 48 fc 78 3e 74 32 7e a2 43   h.+i.r.H.x>t2~.C
00e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
00f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0200  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0210  00 00 00 00 00 00 00 00                           ........

Followed by:

Fibre Channel Delimiter: SOF: SOFf - SOF Fabric EOF: 0x0
    SOF: SOFf - SOF Fabric (0xbcb55858)
    CRC: 0x00000000 incorrect, should be 0xa6752ff1
        [Expert Info (Error/Checksum): Bad checksum [should be 0xa6752ff1]]
            [Bad checksum [should be 0xa6752ff1]]
            [Severity level: Error]
            [Group: Checksum]
    [CRC Status: Bad]
    EOF: Unknown (0x00000000)
Fibre Channel
    R_CTL: 0x7(Device_Data/Command Status)
    Dest Addr: 9f.7a.fd
    CS_CTL: 0x7c
    Src Addr: 6c.0f.09
    Type: Unknown (0x3f)
    F_CTL: 0x0f6741, ExgRpd: Exchange Originator, SeqRec: Seq Initiator, ExgFst: NOT exchg first, ExgLst: NOT exchg last, SeqLst: Seq Last, Pri: Priority, TSI: Transfer Seq Initiative, LDF: Unknown, A01: Unknown, RetSeq: Retransmitted Sequence
        0... .... .... .... .... .... = ExgRpd: Exchange Originator
        .0.. .... .... .... .... .... = SeqRec: Seq Initiator
        ..0. .... .... .... .... .... = ExgFst: NOT exchg first
        ...0 .... .... .... .... .... = ExgLst: NOT exchg last
        .... 1... .... .... .... .... = SeqLst: Seq Last
        .... ..1. .... .... .... .... = Pri: Priority
        .... ...1 .... .... .... .... = TSI: Transfer Seq Initiative
        .... .... 01.. .... .... .... = LDF: Unknown (0x1)
        .... .... ..10 .... .... .... = A01: Unknown (0x2)
        .... .... .... ..1. .... .... = RetSeq: Retransmitted Sequence
        .... .... .... .... ..00 .... = AA: ABTS - Cont (0x0)
        .... .... .... .... .... 0... = RelOff: rel offset NOT set
    SEQ_ID: 0x06
    DF_CTL: 0x7d
    SEQ_CNT: 56449
    OX_ID: 0x41c5
    RX_ID: 0xd407
    Parameter: 0x9df4abf8
    Network DA: 6e:4e:e8:b0:8f:f6:63:ca
    Network SA: f2:a5:e7:f4:68:7d:be:a3
Data (888 bytes)
    Data: 61b2066247472dabb80f16cf985095bc1cf512cd6c1c8d62…
    [Length: 888]

0000  bc b5 58 58 07 9f 7a fd 7c 6c 0f 09 3f 0f 67 41   ..XX..z.|l..?.gA
0010  06 7d dc 81 41 c5 d4 07 9d f4 ab f8 6e 4e e8 b0   .}..A.......nN..
0020  8f f6 63 ca f2 a5 e7 f4 68 7d be a3 61 b2 06 62   ..c.....h}..a..b
0030  47 47 2d ab b8 0f 16 cf 98 50 95 bc 1c f5 12 cd   GG-......P......
0040  6c 1c 8d 62 a7 9d 8a 40 c2 6d 63 bd 66 e6 4a f7   [email protected].
0050  69 95 2b 8c df 41 9f cd 7c f4 60 08 4a 9e 1b 9f   i.+..A..|.`.J...
0060  2d 8d 3e 25 99 dd fd b7 28 7c 32 9d 19 2b 94 8f   -.>%....(|2..+..
0070  25 3e f0 4d 54 af 5e 2f d7 16 48 e9 74 79 a7 64   %>.MT.^/..H.ty.d
0080  17 7a cd 13 d4 47 2c 9f f9 1b ca ac 2e 39 10 7b   .z...G,......9.{
0090  1e ae d9 2f 78 79 43 75 0a 46 b9 58 f4 44 50 30   .../xyCu.F.X.DP0
00a0  20 46 de 9d 71 54 81 b5 d4 55 0e 5f 3e 88 c7 69    F..qT...U._>..i
00b0  ab 3e 86 43 71 67 a7 65 49 43 5f 92 93 7b 5f ed   .>.Cqg.eIC_..{_.
00c0  75 f1 12 19 04 3c 19 7a 4e 4c fe 73 fb 9a c7 6f   u....<.zNL.s...o
00d0  74 c8 a9 72 38 58 4a 8c d6 5a ec 1b 0f be 16 ed   t..r8XJ..Z......
00e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
00f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
01f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0200  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0210  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0220  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0230  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0240  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0250  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0260  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0270  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0280  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0290  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
02a0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
02b0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
02c0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
02d0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
02e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
02f0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0300  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0310  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0320  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0330  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0340  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0350  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0360  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0370  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0380  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
0390  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
03a0  00 00 00 00 00 00 00 00 00 00 00 00               ............
@bluecmd bluecmd added the bug Something isn't working label Sep 6, 2020
@bluecmd
Copy link
Owner Author

bluecmd commented Sep 6, 2020

bc 94 ff ff Is ARBff

@bluecmd
Copy link
Owner Author

bluecmd commented Sep 6, 2020

#28 is likely related to this as well.

@bluecmd
Copy link
Owner Author

bluecmd commented Sep 6, 2020

Expected format:

image

@bluecmd
Copy link
Owner Author

bluecmd commented Sep 6, 2020

Should probably add a Avalon-ST Delay core from the output of the framers. That way the framers can use the error signal to drop packets that are being prepared (e.g. too large, bad SOF/EOF etc)

EDIT: The IP core seems to be for some other version or environment than the one we are using. Instead, making this by ourselves shouldn't be too hard - just add a FIFO before the output stream and tie an _error line to the synchronous clear.

@bluecmd
Copy link
Owner Author

bluecmd commented Sep 6, 2020

The output of the framer looks pretty good actually.

image

Correct first 4 bytes seems to be 07 9F 7A FD which is what we are seeing. Packet length seems to be 102 bytes w/ SOF + EOF markers.

fc2.zip

EDIT: Some more traces: https://gist.github.com/bluecmd/73ff52dae88e1ea6f828cbbb2be6c50b
No clear culprit right now. The alignment might be a good avenue to look into as things sometimes are stable and sometimes they go downhill - and can be triggered by resetting the port.

@bluecmd
Copy link
Owner Author

bluecmd commented Sep 8, 2020

Testing with only fc_xcvr and 2x fifo seems to be a problem as well.

switchdisable; switchenable; switchshow

1/10 of the times

Index Port Address Media Speed       State   Proto
==================================================
  27  27   010000   id    8G	   Online      FC  Loopback->Port 31 
  31  31   010100   id    8G	   Online      FC  Loopback->Port 27 


3/10
Index Port Address Media Speed       State   Proto
==================================================
  27  27   010000   id    8G	   Online      FC  G-Port  
  31  31   010100   id    8G	   Online      FC  E-Port  (unknown)

4/10 (will change to the above after a few seconds)
Index Port Address Media Speed       State   Proto
==================================================
  27  27   010000   id    8G	   In_Sync     FC  
  31  31   010100   id    8G	   In_Sync     FC  

In this mode fejkon is basically just a media converter so this should really work.

@bluecmd
Copy link
Owner Author

bluecmd commented Sep 8, 2020

It seems that when the rx_patterndetect is 4 on both ports the loopback case happens. If it is 4 on only one port the other port becomes an E-port (makes sense, as it would be the one receiving whatever the other port sent out).

In order to solve #28 as well, it might be a good idea to reset the synchronization until it has aligned using a supported alignment. Down side of this is of course I do not know how much this will affect link up, but I bet it will work fine as long as restarting the pattern detection is not prone to sticking to whatever alignment it has now.

In the testbench all xcvr's sync to alignment 4 as well. The branch fc_xcvr_tb, possibly commit a1403f3 should have things needed to get a testbench syncing with other pattern alignment.

@bluecmd
Copy link
Owner Author

bluecmd commented Sep 10, 2020

The length is good, the data is because we have no framer unscrambling yet.
Alignment has been fixed, MTU and various other framing stuff has been addressed.

Closing this in favor of #56

@bluecmd bluecmd closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant