Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/dev sun4v: Ignore spurious ldc CTRL/ACK/VER...



details:   https://anonhg.NetBSD.org/src/rev/ced071fb8736
branches:  trunk
changeset: 960997:ced071fb8736
user:      palle <palle%NetBSD.org@localhost>
date:      Mon Apr 05 12:19:22 2021 +0000

description:
sun4v: Ignore spurious ldc CTRL/ACK/VERS messages (do not reset the connection anymore). Fixes occationals stalls when vdsk uses the ldc service. Observed on both T2000 and T5 host systems

diffstat:

 sys/arch/sparc64/dev/ldc.c |  23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diffs (90 lines):

diff -r 0f801a3ced78 -r ced071fb8736 sys/arch/sparc64/dev/ldc.c
--- a/sys/arch/sparc64/dev/ldc.c        Mon Apr 05 11:36:55 2021 +0000
+++ b/sys/arch/sparc64/dev/ldc.c        Mon Apr 05 12:19:22 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldc.c,v 1.6 2019/10/15 00:13:52 chs Exp $      */
+/*     $NetBSD: ldc.c,v 1.7 2021/04/05 12:19:22 palle Exp $    */
 /*     $OpenBSD: ldc.c,v 1.12 2015/03/21 18:02:58 kettenis Exp $       */
 /*
  * Copyright (c) 2009 Mark Kettenis
@@ -76,24 +76,25 @@
 {
        switch (lp->stype) {
        case LDC_INFO:
-               DPRINTF(("CTRL/INFO/VERS\n"));
+               DPRINTF(("CTRL/INFO/VERS major %d minor %d\n", lp->major, lp->minor));
                if (lp->major == LDC_VERSION_MAJOR &&
                    lp->minor == LDC_VERSION_MINOR)
                        ldc_send_ack(lc);
                else {
                        /* XXX do nothing for now. */
+                       DPRINTF(("CTRL/INFO/VERS unsupported major/minor\n"));
                }
                break;
 
        case LDC_ACK:
+               DPRINTF(("CTRL/ACK/VERS\n"));
                if (lc->lc_state != LDC_SND_VERS) {
-                       DPRINTF(("Spurious CTRL/ACK/VERS: state %d\n",
-                           lc->lc_state));
-                       ldc_reset(lc);
-                       return;
+                       DPRINTF(("Spurious CTRL/ACK/VERS: state %d major %d minor %d (ignored)\n",
+                                        lc->lc_state, lp->major, lp->minor));
                }
-               DPRINTF(("CTRL/ACK/VERS\n"));
-               ldc_send_rts(lc);
+               else {          
+                       ldc_send_rts(lc);
+               }
                break;
 
        case LDC_NACK:
@@ -263,6 +264,7 @@
        lp->ctrl = LDC_VERS;
        lp->major = 1;
        lp->minor = 0;
+       DPRINTF(("ldc_send_vers() major %d minor %d\n", lp->major, lp->minor));
 
        tx_tail += sizeof(*lp);
        tx_tail &= ((lc->lc_txq->lq_nentries * sizeof(*lp)) - 1);
@@ -274,6 +276,7 @@
        }
 
        lc->lc_state = LDC_SND_VERS;
+       DPRINTF(("ldc_send_vers() setting lc->lc_state to %d\n", lc->lc_state));
        mutex_exit(&lc->lc_txq->lq_mtx);
 }
 
@@ -309,6 +312,7 @@
        }
 
        lc->lc_state = LDC_RCV_VERS;
+       DPRINTF(("ldc_send_ack() setting lc->lc_state to %d\n", lc->lc_state));
        mutex_exit(&lc->lc_txq->lq_mtx);
 }
 
@@ -344,6 +348,7 @@
        }
 
        lc->lc_state = LDC_SND_RTS;
+       DPRINTF(("ldc_send_rts() setting lc->lc_state to %d\n", lc->lc_state));
        mutex_exit(&lc->lc_txq->lq_mtx);
 }
 
@@ -379,6 +384,7 @@
        }
 
        lc->lc_state = LDC_SND_RTR;
+       DPRINTF(("ldc_send_rtr() setting lc->lc_state to %d\n", lc->lc_state));
        mutex_exit(&lc->lc_txq->lq_mtx);
 }
 
@@ -414,6 +420,7 @@
        }
 
        lc->lc_state = LDC_SND_RDX;
+       DPRINTF(("ldc_send_rdx() setting lc->lc_state to %d\n", lc->lc_state));
        mutex_exit(&lc->lc_txq->lq_mtx);
 }
 



Home | Main Index | Thread Index | Old Index