Hi,
Small world, the same thing happened to me today. I've appended some very
preliminary patches to -current -- I've just gotten it to work & not
had a chance to do more than comment out my debugging printfs. Also,
be warned that I have not tested it beyond a simple telnet.
Mohit Aron writes:
> Hi,
> I'm using the latest available snapshot (4.0-19990808-CURRENT) for
> an Alphaserver 500 workstation. Unfortunately, this version of FreeBSD
> panics upon seeing an fxp network interface. Does anyone have an updated driver
> for the Alpha that supports the fxp interface ?
>
> There is also a "de" interface on the Alpha that works with FreeBSD but the
> performance is rather dismal. A webserver running on the machine gives only
> 120 req/s on this machine (as opposed to 800 req/s on a Pentium III). Moreover,
> most of the time the OS shows that its idle - looks like the problem lies in
> the "de" driver. An updated de driver would also be appreciated.
Is this an AlphaStation 500? Eg, a kn20aa kernel? And is the de0 in
question the built-in 10Mb 21040?
Or is this a "miata" (Digital Personal Workstation 500a{,u})? On
miatas, the on-board de0 uses the 21143 chipset. I've yet to find a
free OS that can get the duplex mode right. If this is the case, you
should throw the switch port into 100Mb, 1/2 duplex mode, or ignore
the de0 and proceed on with the fxp.
{\begin shameless-plug} Also, if you're doing performance analysis on
FreeBSD/alpha, you should have a peek at iprobe. Its not quite DCPI,
but it is free ;-) See http://www.cs.duke.edu/ari/iprobe.html {\end
shameless-plug}
Cheers,
Drew
------------------------------------------------------------------------------
Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin
Duke University Email: [EMAIL PROTECTED]
Department of Computer Science Phone: (919) 660-6590
Index: if_fxp.c
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_fxp.c,v
retrieving revision 1.72
diff -u -b -B -r1.72 if_fxp.c
--- if_fxp.c 1999/09/06 06:15:18 1.72
+++ if_fxp.c 1999/09/14 21:18:53
@@ -80,11 +80,6 @@
#include <dev/pci/pcireg.h>
#include <dev/pci/pcidevs.h>
-#ifdef __alpha__ /* XXX */
-/* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */
-#undef vtophys
-#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)(va))
-#endif /* __alpha__ */
#else /* __FreeBSD__ */
@@ -108,6 +103,13 @@
#endif /* __NetBSD__ */
+#ifdef __alpha__ /* XXX */
+/* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */
+#undef vtophys
+#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)(va))
+#endif /* __alpha__ */
+
+
#include "opt_bdg.h"
#ifdef BRIDGE
#include <net/if_types.h>
@@ -548,6 +550,12 @@
goto fail;
}
sc->csr = rman_get_virtual(sc->mem); /* XXX use bus_space */
+ sc->sc_st = rman_get_bustag(sc->mem);
+ sc->sc_sh = rman_get_bushandle(sc->mem);
+#ifdef __alpha__
+ sc->csr = (caddr_t)pci_cvt_to_dense((vm_offset_t)sc->csr);
+ sc->csr = (caddr_t)ALPHA_PHYS_TO_K0SEG((vm_offset_t)sc->csr);
+#endif
/*
* Allocate our interrupt.
@@ -1716,7 +1724,15 @@
*/
rfa = mtod(m, struct fxp_rfa *);
m->m_data += sizeof(struct fxp_rfa);
- rfa->size = MCLBYTES - sizeof(struct fxp_rfa) - RFA_ALIGNMENT_FUDGE;
+/*printf("rfa=%p\n", rfa);
+printf("&rfa->status = %p\n", &rfa->rfa_status);
+printf("&rfa->control = %p\n", &rfa->rfa_control);
+printf("&rfa->link_addr = %p\n", &rfa->link_addr);
+printf("&rfa->rbd_addr = %p\n", &rfa->rbd_addr);
+printf("&rfa->actual_size = %p\n", &rfa->actual_size);
+printf("&rfa->size = %p\n", &rfa->size);
+Debugger("About to panic");*/
+ rfa->size = (u_int16_t)(MCLBYTES - sizeof(struct fxp_rfa) -
+RFA_ALIGNMENT_FUDGE);
/*
* Initialize the rest of the RFA. Note that since the RFA
@@ -1728,8 +1745,8 @@
rfa->actual_size = 0;
v = -1;
- fxp_lwcopy(&v, &rfa->link_addr);
- fxp_lwcopy(&v, &rfa->rbd_addr);
+ fxp_lwcopy(&v, (volatile u_int32_t *) &rfa->link_addr[0]);
+ fxp_lwcopy(&v, (volatile u_int32_t *) &rfa->rbd_addr[0]);
/*
* If there are other buffers already on the list, attach this
@@ -1740,7 +1757,7 @@
RFA_ALIGNMENT_FUDGE);
sc->rfa_tailm->m_next = m;
v = vtophys(rfa);
- fxp_lwcopy(&v, &p_rfa->link_addr);
+ fxp_lwcopy(&v, (volatile u_int32_t *) &p_rfa->link_addr[0]);
p_rfa->rfa_control &= ~FXP_RFA_CONTROL_EL;
} else {
sc->rfa_headm = m;
Index: if_fxpreg.h
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_fxpreg.h,v
retrieving revision 1.17
diff -u -b -B -r1.17 if_fxpreg.h
--- if_fxpreg.h 1999/09/06 06:15:18 1.17
+++ if_fxpreg.h 1999/09/14 20:14:30
@@ -245,8 +245,8 @@
struct fxp_rfa {
volatile u_int16_t rfa_status;
volatile u_int16_t rfa_control;
- volatile u_int32_t link_addr;
- volatile u_int32_t rbd_addr;
+ volatile u_int8_t link_addr[4];
+ volatile u_int8_t rbd_addr[4];
volatile u_int16_t actual_size;
volatile u_int16_t size;
};
Index: if_fxpvar.h
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_fxpvar.h,v
retrieving revision 1.8
diff -u -b -B -r1.8 if_fxpvar.h
--- if_fxpvar.h 1999/08/28 00:50:51 1.8
+++ if_fxpvar.h 1999/09/14 20:46:14
@@ -42,8 +42,6 @@
#if defined(__NetBSD__)
struct device sc_dev; /* generic device structures */
void *sc_ih; /* interrupt handler cookie */
- bus_space_tag_t sc_st; /* bus space tag */
- bus_space_handle_t sc_sh; /* bus space handle */
struct ethercom sc_ethercom; /* ethernet common part */
#else
struct arpcom arpcom; /* per-interface network data */
@@ -52,6 +50,8 @@
struct resource *irq; /* resource descriptor for interrupt */
void *ih; /* interrupt handler cookie */
#endif /* __NetBSD__ */
+ bus_space_tag_t sc_st; /* bus space tag */
+ bus_space_handle_t sc_sh; /* bus space handle */
struct mbuf *rfa_headm; /* first mbuf in receive frame area */
struct mbuf *rfa_tailm; /* last mbuf in receive frame area */
struct fxp_cb_tx *cbl_first; /* first active TxCB in list */
@@ -71,7 +71,7 @@
};
/* Macros to ease CSR access. */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__FreeBSD__)
#define CSR_READ_1(sc, reg) \
bus_space_read_1((sc)->sc_st, (sc)->sc_sh, (reg))
#define CSR_READ_2(sc, reg) \
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message