Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 May 2001 16:13:53 +0200
From:      Oscar-Ivan Lepe-Aldama <oscar@ac.upc.es>
To:        net@freebsd.org
Subject:   On the workings of the xl dirver
Message-ID:  <3AF950A1.2D4A13F2@ac.upc.es>

next in thread | raw e-mail | index | archive | help
Hi,
I would like to have information regarding the implementation of the
xl_start_90xB function in the xl driver. After reading the code and the
technical reference from 3com I still cannot understand how the driver
signals the NIC for packet downloading. I know the code is OK as my
FreeBSD box, loaded with a pair of 3C905B-TX NICs, works just fine: it
forwards packets. But because I am interested in measuring the
performance of the system (both software and hardware) I need to know
the points where the software signals the hardware. Please help. Some
details follow.

In the case of the xl_start function (the xl driver has two
implementations of the if_start operation: xl_start_90xB for 3c90xB NICs
and xl_start for others) this is clear. It uses the following code,
which follows the algorithm presented in the technical reference:

2276         /*
2277          * Queue the packets. If the TX channel is clear, update
2278          * the downlist pointer register.
2279          */
2280         CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_STALL);
2281         xl_wait(sc);
2282 
2283         if (sc->xl_cdata.xl_tx_head != NULL) {
2284                 sc->xl_cdata.xl_tx_tail->xl_next = start_tx;
2285                 sc->xl_cdata.xl_tx_tail->xl_ptr->xl_next =
2286                                         vtophys(start_tx->xl_ptr);
2287                 sc->xl_cdata.xl_tx_tail->xl_ptr->xl_status &=
2288                                         ~XL_TXSTAT_DL_INTR;
2289                 sc->xl_cdata.xl_tx_tail = cur_tx;
2290         } else {
2291                 sc->xl_cdata.xl_tx_head = start_tx;
2292                 sc->xl_cdata.xl_tx_tail = cur_tx;
2293         }
2294         if (!CSR_READ_4(sc, XL_DOWNLIST_PTR))
2295                 CSR_WRITE_4(sc, XL_DOWNLIST_PTR,
vtophys(start_tx->xl_ptr));
2296 
2297         CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_DOWN_UNSTALL);

But in the case of the xl_start_90xB the code is like this:

2426         /* Start transmission */
2427         sc->xl_cdata.xl_tx_prod = idx;
2428         start_tx->xl_prev->xl_ptr->xl_next = start_tx->xl_phys;

As can be seen in this last case, there are no CSR_WRITE operations for
signaling the NIC. However, the technical reference says the NIC has to
be signaled for it to learn there is work to do. How is this being
implemented is this case? Thanks.

Best regards,

-- 
========================================================================
 0 0 0  Oscar-Ivan Lepe-Aldama     |     UPC-Campus Nord, DAC
 0 0 0  e-mail: oscar@ac.upc.es    |     Modul D6, despatx 116
 0 0 0  phone:  +34 93 401 7187    |     Jordi Girona, 1-3
 U P C  fax:    +34 93 401 7055    |     08034 Barcelona - SPAIN
        WWW:    http://www.ac.upc.es/homes/oscar/
========================================================================

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




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