Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Dec 1999 16:37:38 -0600
From:      kvandel <kvandel@cs.duke.edu>
To:        freebsd-hackers@FreeBSD.ORG
Message-ID:  <99120516514304.01102@wookie.vandelden.com>

next in thread | raw e-mail | index | archive | help
Question,

I am a graduate student at Duke University.  Currently, I am part of a team to
build a terabit router using a cluster connected with Myrinet.  One aspect of
the project is to tune the devices & drivers to perform cooperatively... In a
routing situation, the 1500B dma takes roughly 11us over PCI 32/33Mhz.  If the
processor (driver) is checking the command accept status of a NIC, it can
take a "long" time to get a response from the NIC.  For gigabit routing, you
have to roughly processes 1pkt/ 8-10us .  For starters, I  changed up the
driver code in fxp_start to break up a large dma transactions into smaller
chunks,.. to make bus arbitration work using a finer grain time slice. Hence,
the processor stalls less when it checks if a NIC command was accepted.  

The question: Why doesn't this work... it seem so straight forward...
using netperf, the driver works when the message size is less than
FXP_MAX_SEGMENT_SIZE, .. I am using FXP_MAX_SEGMENT_SIZE  of 1024

----------------------------------------------------------
fxp_start()........
                /*
                 * Go through each of the mbufs in the chain and initialize
                 * the transmit buffer descriptors with the physical address
                 * and size of the mbuf.
                 */
tbdinit:

                for (m = mb_head, segment = 0; m != NULL; m = m->m_next) {
                  if (m->m_len != 0) {
                    unsigned int  sub_segments,
                                  counter;
                    uint8_t      *mbuf_data_addr = mtod(m,uint8_t *);

                    sub_segments = (m->m_len / FXP_MAX_SEGMENT_SIZE)
                      + (((m->m_len % FXP_MAX_SEGMENT_SIZE) != 0)?1:0);

                    if (segment + sub_segments >= FXP_NTXSEG)
                      break;

                    for(counter = 0;counter < sub_segments;counter++)
                      {
                        txp->tbd[segment].tb_addr =
                          vtophys(mbuf_data_addr + (counter * FXP_MAX_SEGMENT_SIZE));

                          txp->tbd[segment].tb_size
                            = (sub_segments  == (counter+1))?(m->m_len % FXP_MAX_SEGMENT_SIZE):FXP_MAX_SEGMENT_SIZE;

                          /*
                             vtophys(mtod(m, vm_offset_t))
                             + (counter * FXP_MAX_SEGMENT_SIZE);
                          */
                          segment++;
                      }
                  }
                }
                if (m != NULL) {
 
  .....

-------------------------------------------------------------------------------------------------

Unfortunately, I don't have the intel docs on the card, which requires a NDA...
If you can help, it would be much appreciated.

thanks,
kurt
-- 

Some output when it's running

/*if(mb_head->m_pkthdr.len > FXP_MAX_SEGMENT_SIZE)
printf("Pha %u, Kva %u, counter %u,segment %u, length %u, subs %u, tbs %u, mss %u\n",
	txp->tbd[segment].tb_addr,
	mbuf_data_addr + (counter * FXP_MAX_SEGMENT_SIZE),
	counter, segment, m->m_len,
	sub_segments, txp->tbd[segment].tb_size,
	FXP_MAX_SEGMENT_SIZE);
*/
Pha 39110690, Kva 3229624354, counter 0,segment 0, length 34, subs 1, tbs 34, mss 1024
Pha 129788744, Kva 3229076296, counter 0,segment 1, length 1208, subs 2, tbs 1024, mss 1024
Pha 129789768, Kva 3229077320, counter 1,segment 2, length 1208, subs 2, tbs 184, mss 1024
Pha 131485696, Kva 3229200384, counter 0,segment 3, length 272, subs 1, tbs 272, mss 1024
Pha 39637282, Kva 3229626658, counter 0,segment 0, length 34, subs 1, tbs 34, mss 1024




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99120516514304.01102>