Index: share/man/man4/bge.4 =================================================================== --- share/man/man4/bge.4 (revision 249631) +++ share/man/man4/bge.4 (working copy) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2012 +.Dd April 18, 2013 .Dt BGE 4 .Os .Sh NAME @@ -220,6 +220,22 @@ The default value is 0 which disables UDP transmit checksum offloading. The interface need to be brought down and up again before a change takes effect. +.It Va dev.bge.%d.bge_rx_coal_ticks +Controls the maximum time to wait for RX packets before updating the status to +the host. +Defaults to 150us. +.It Va dev.bge.%d.bge_tx_coal_ticks +Controls the maximum time to wait for TX packets before updating the status to +the host. +Defaults to 150us. +.It Va dev.bge.%d.bge_rx_max_coal_bds +Controls the maximum number of buffer descriptors (BD) to be processed before +updating the status to the host. +Defaults to 10. +.It Va dev.bge.%d.bge_tx_max_coal_bds +Controls the maximum number of buffer descriptors (BD) to be processed before +updating the status to the host. +Defaults to 10. .El .Sh DIAGNOSTICS .Bl -diag @@ -243,6 +259,10 @@ The device has stopped responding to the network, or there is a problem with the network connection (cable). .El +.Sh SUPPORT +For general information and support, +go to the Broadcom NIC Open Source Developer Resource Site: +.Pa http://www.broadcom.com/support/ethernet_nic/open_source.php . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , Index: sys/dev/bge/if_bge.c =================================================================== --- sys/dev/bge/if_bge.c (revision 249631) +++ sys/dev/bge/if_bge.c (working copy) @@ -500,6 +500,10 @@ static void bge_add_sysctl_stats(struct bge_softc *, struct sysctl_ctx_list *, struct sysctl_oid_list *); static int bge_sysctl_stats(SYSCTL_HANDLER_ARGS); +static int bge_sysctl_set_rx_coal_ticks(SYSCTL_HANDLER_ARGS); +static int bge_sysctl_set_tx_coal_ticks(SYSCTL_HANDLER_ARGS); +static int bge_sysctl_set_rx_max_coal_bds(SYSCTL_HANDLER_ARGS); +static int bge_sysctl_set_tx_max_coal_bds(SYSCTL_HANDLER_ARGS); static device_method_t bge_methods[] = { /* Device interface */ @@ -6151,6 +6155,37 @@ bge_add_sysctl_stats_regs(sc, ctx, children); else bge_add_sysctl_stats(sc, ctx, children); + + sc->bge_rx_coal_ticks = 150; + snprintf(tn, sizeof(tn), "dev.bge.%d.bge_rx_coal_ticks", unit); + TUNABLE_INT_FETCH(tn, &sc->bge_rx_coal_ticks); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_coal_ticks", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_set_rx_coal_ticks, "I", + "Maximum time(usec) used to coalesce BD ring before host " + "notification of arrival of packets"); + + sc->bge_tx_coal_ticks = 150; + snprintf(tn, sizeof(tn), "dev.bge.%d.bge_tx_coal_ticks", unit); + TUNABLE_INT_FETCH(tn, &sc->bge_tx_coal_ticks); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_coal_ticks", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_set_tx_coal_ticks, "I", + "Maximum time(usec) used to coalesce BD ring before transmit of " + "packets"); + + sc->bge_rx_max_coal_bds = 10; + snprintf(tn, sizeof(tn), "dev.bge.%d.bge_rx_max_coal_bds", unit); + TUNABLE_INT_FETCH(tn, &sc->bge_rx_max_coal_bds); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_max_coal_bds", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_set_rx_max_coal_bds, "I", + "Maximum BD count to coalesce before host notification of " + "arrival of packets"); + + sc->bge_tx_max_coal_bds = 10; + snprintf(tn, sizeof(tn), "dev.bge.%d.bge_tx_max_coal_bds", unit); + TUNABLE_INT_FETCH(tn, &sc->bge_tx_max_coal_bds); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_max_coal_bds", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_set_tx_max_coal_bds, "I", + "Maximum BD count to coalesce before transmit of packets"); } #define BGE_SYSCTL_STAT(sc, ctx, desc, parent, node, oid) \ @@ -6538,6 +6573,59 @@ #endif static int +bge_sysctl_set_rx_coal_ticks(SYSCTL_HANDLER_ARGS) +{ + struct bge_softc *sc; + int error; + + sc = (struct bge_softc *)arg1; + error = sysctl_handle_int(oidp, &sc->bge_rx_coal_ticks, 0, req); + if (error || (req->newptr == NULL)) + return (error); + CSR_WRITE_4(sc, BGE_HCC_RX_COAL_TICKS, sc->bge_rx_coal_ticks); + return (error); +} +static int +bge_sysctl_set_tx_coal_ticks(SYSCTL_HANDLER_ARGS) +{ + struct bge_softc *sc; + int error; + + sc = (struct bge_softc *)arg1; + error = sysctl_handle_int(oidp, &sc->bge_tx_coal_ticks, 0, req); + if (error || (req->newptr == NULL)) + return (error); + CSR_WRITE_4(sc, BGE_HCC_TX_COAL_TICKS, sc->bge_tx_coal_ticks); + return (error); +} +static int +bge_sysctl_set_rx_max_coal_bds(SYSCTL_HANDLER_ARGS) +{ + struct bge_softc *sc; + int error; + + sc = (struct bge_softc *)arg1; + error = sysctl_handle_int(oidp, &sc->bge_rx_max_coal_bds, 0, req); + if (error || (req->newptr == NULL)) + return (error); + CSR_WRITE_4(sc, BGE_HCC_RX_MAX_COAL_BDS, sc->bge_rx_max_coal_bds); + return (error); +} +static int +bge_sysctl_set_tx_max_coal_bds(SYSCTL_HANDLER_ARGS) +{ + struct bge_softc *sc; + int error; + + sc = (struct bge_softc *)arg1; + error = sysctl_handle_int(oidp, &sc->bge_tx_max_coal_bds, 0, req); + if (error || (req->newptr == NULL)) + return (error); + CSR_WRITE_4(sc, BGE_HCC_TX_MAX_COAL_BDS, sc->bge_tx_max_coal_bds); + return (error); +} + +static int bge_get_eaddr_fw(struct bge_softc *sc, uint8_t ether_addr[]) {