nfe trouble
Pyun YongHyeon
pyunyh at gmail.com
Wed Jul 18 03:55:33 UTC 2007
On Tue, Jul 17, 2007 at 09:37:56PM +0300, [CPS] AkirA wrote:
[...]
> after theat
>
>
> nfe0: <NVIDIA nForce MCP55 Networking Adapter> port 0xb000-0xb007 mem
> 0xfe02a000-0xfe02afff,0xfe029000-0xfe0290ff,0xfe028000-0xfe02800f irq 23 at
> device 8.0 on pci0
> nfe0: could not allocate DMA'able memory for jumbo pool
> device_attach: nfe0 attach returned 12
> nfe1: <NVIDIA nForce MCP55 Networking Adapter> port 0xac00-0xac07 mem
> 0xfe027000-0xfe027fff,0xfe026000-0xfe0260ff,0xfe025000-0xfe02500f irq 20 at
> device 9.0 on pci0
> nfe1: could not allocate DMA'able memory for jumbo pool
> device_attach: nfe1 attach returned 12
>
>
> and not start to work network
>
Try attached one. I'm unure how well it could be applied to stable
but you can probably patch manually the source in case of failure.
--
Regards,
Pyun YongHyeon
-------------- next part --------------
Index: if_nfe.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/nfe/if_nfe.c,v
retrieving revision 1.18
diff -u -r1.18 if_nfe.c
--- if_nfe.c 12 Jun 2007 02:35:01 -0000 1.18
+++ if_nfe.c 18 Jul 2007 03:51:22 -0000
@@ -108,7 +108,7 @@
static void nfe_init_locked(void *);
static void nfe_stop(struct ifnet *);
static int nfe_alloc_rx_ring(struct nfe_softc *, struct nfe_rx_ring *);
-static int nfe_alloc_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *);
+static void nfe_alloc_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *);
static int nfe_init_rx_ring(struct nfe_softc *, struct nfe_rx_ring *);
static int nfe_init_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *);
static void nfe_free_rx_ring(struct nfe_softc *, struct nfe_rx_ring *);
@@ -151,8 +151,10 @@
/* Tunables. */
static int msi_disable = 0;
static int msix_disable = 0;
+static int jumbo_disable = 0;
TUNABLE_INT("hw.nfe.msi_disable", &msi_disable);
TUNABLE_INT("hw.nfe.msix_disable", &msix_disable);
+TUNABLE_INT("hw.nfe.jumbo_disable", &jumbo_disable);
static device_method_t nfe_methods[] = {
/* Device interface */
@@ -513,8 +515,7 @@
if ((error = nfe_alloc_rx_ring(sc, &sc->rxq)) != 0)
goto fail;
- if ((error = nfe_alloc_jrx_ring(sc, &sc->jrxq)) != 0)
- goto fail;
+ nfe_alloc_jrx_ring(sc, &sc->jrxq);
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -1140,7 +1141,7 @@
}
-static int
+static void
nfe_alloc_jrx_ring(struct nfe_softc *sc, struct nfe_jrx_ring *ring)
{
struct nfe_dmamap_arg ctx;
@@ -1151,7 +1152,12 @@
int i, error, descsize;
if ((sc->nfe_flags & NFE_JUMBO_SUP) == 0)
- return (0);
+ return;
+ if (jumbo_disable != 0) {
+ device_printf(sc->nfe_dev, "disabling jumbo frame support\n");
+ sc->nfe_jumbo_disable = 1;
+ return;
+ }
if (sc->nfe_flags & NFE_40BIT_ADDR) {
desc = ring->jdesc64;
@@ -1301,11 +1307,17 @@
jpool_entries);
}
- return (0);
+ return;
fail:
+ /*
+ * Running without jumbo frame support is ok for most cases
+ * so don't fail on creating dma tag/map for jumbo frame.
+ */
nfe_free_jrx_ring(sc, ring);
- return (error);
+ device_printf(sc->nfe_dev, "disabling jumbo frame support due to "
+ " resource shortage\n");
+ sc->nfe_jumbo_disable = 1;
}
@@ -1746,7 +1758,8 @@
if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > NFE_JUMBO_MTU)
error = EINVAL;
else if (ifp->if_mtu != ifr->ifr_mtu) {
- if ((sc->nfe_flags & NFE_JUMBO_SUP) == 0 &&
+ if ((((sc->nfe_flags & NFE_JUMBO_SUP) == 0) ||
+ (sc->nfe_jumbo_disable != 0)) &&
ifr->ifr_mtu > ETHERMTU)
error = EINVAL;
else {
Index: if_nfevar.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/nfe/if_nfevar.h,v
retrieving revision 1.4
diff -u -r1.4 if_nfevar.h
--- if_nfevar.h 12 Jun 2007 02:16:02 -0000 1.4
+++ if_nfevar.h 18 Jul 2007 03:51:22 -0000
@@ -103,6 +103,7 @@
#define NFE_PWR_MGMT 0x0010
#define NFE_CORRECT_MACADDR 0x0020
#define NFE_TX_FLOW_CTRL 0x0040
+ int nfe_jumbo_disable;
uint32_t rxtxctl;
uint8_t mii_phyaddr;
uint8_t eaddr[ETHER_ADDR_LEN];
More information about the freebsd-stable
mailing list