FW: RTEMS 4.X.X gen68360 Ethernet Tx Reliability

Bob Wisdom bobwis at ascweb.co.uk
Fri Feb 4 09:32:58 UTC 2000


Hi Tim,
Its great to hear from you. We think the problem is at the glue/driver
level - but we are not ruling out our overall port or the hardware, at this
stage. The previous problem we identified in the driver was the case when a
chain of MBUFs is sent to the driver where the last MBUF has a zero size
data buffer. In this case the sendpacket routine gets it wrong. We saw this
happening while debugging:-

A MBUF chain is supplied to the txDaemon consisting of say two MBUFs, the
last one is empty.
The TXDaemon calls sendpacket which queues the first MBUF in the SCC's Bd
ok. When it comes to the second (and last) it detects the zero size and
tosses it. The MBUF pointer "m" will be NULL after the MFREE since the empty
MBUF was the last one. Since m is NULL the next section of code is triggered
which fills in the txBD status. However, txBd is pointing at the wrong
place - it is pointing at the next free Bd, one beyond where it should.

This blows up the retire routine and txBdActiveCount goes negative.

The following code is our quick-fix version - this is not an official fix
you understand!  (note lastusedtxBd variable).
 if (m->m_len) {
                        /*
                         * Fill in the buffer descriptor
                         */
                        lastusedtxBd = txBd;
                        txBd->buffer = mtod (m, void *);
                        txBd->length = m->m_len;
                        sc->txMbuf[sc->txBdHead] = m;
                        nAdded++;
                        if (++sc->txBdHead == sc->txBdCount) {
                                status |= M360_BD_WRAP;
                                sc->txBdHead = 0;
                        }
                        l = m;
                        m = m->m_next;
                }
                else {
                        /*
                         * Just toss empty mbufs
                         */
                        struct mbuf *n;
                        MFREE (m, n);
                        m = n;
                        if (l != NULL)
                                l->m_next = m;
                        txBd = lastusedtxBd;
                }


-----Original Message-----
From: Tim Riches [mailto:timriches at csi.com]
Sent: Friday, February 04, 2000 6:43 AM
To: bobwis at ascweb.co.uk
Subject: Re: RTEMS 4.X.X gen68360 Ethernet Tx Reliability

Hi Bob,

> We have a problem with the Tx Ethernet reliability on the MC68360 and have
> been working on it for weeks to identify the cause. We found one issue in
> the driver which Eric Norum, the author, has looked at, but we still have
> one *big* problem. The problem we see is in 4.0.0 and the latest
(20000118)
> snapshot. Frankly, we are struggling to find it.

I'm just about to start porting the BSD net and driver over to a 68360 (+UCD
SNMP), running under the ATI Nucleus OS (it's v similar to RTEMS). If I find
anything I'll send to a mail - could you send me any issues you've found
with 4.0.0?

Hope it all goes well

Thanks

Tim Riches
Westbridge Design Ltd
timriches at compuserve.com




More information about the users mailing list