Date: Tue, 27 Apr 2010 02:14:42 +0000 (UTC) From: Juli Mallett <jmallett@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r207257 - user/jmallett/octeon/sys/mips/cavium/octe Message-ID: <201004270214.o3R2EgWp068709@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jmallett Date: Tue Apr 27 02:14:42 2010 New Revision: 207257 URL: http://svn.freebsd.org/changeset/base/207257 Log: o) Remove the enabling of cvm_oct_common_set_multicast_list(). It's not quite ready and seems to basically not work. o) Avoid some gratuitous link state renegotiations since those are very, very slow. (Inspired in part by em(4).) Modified: user/jmallett/octeon/sys/mips/cavium/octe/ethernet-common.c user/jmallett/octeon/sys/mips/cavium/octe/octe.c Modified: user/jmallett/octeon/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- user/jmallett/octeon/sys/mips/cavium/octe/ethernet-common.c Tue Apr 27 01:00:22 2010 (r207256) +++ user/jmallett/octeon/sys/mips/cavium/octe/ethernet-common.c Tue Apr 27 02:14:42 2010 (r207257) @@ -100,6 +100,7 @@ static struct ifnet_stats *cvm_oct_commo */ void cvm_oct_common_set_multicast_list(struct ifnet *ifp) { +#if 0 cvmx_gmxx_prtx_cfg_t gmx_cfg; cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; int interface = INTERFACE(priv->port); @@ -132,6 +133,7 @@ void cvm_oct_common_set_multicast_list(s cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); } +#endif } Modified: user/jmallett/octeon/sys/mips/cavium/octe/octe.c ============================================================================== --- user/jmallett/octeon/sys/mips/cavium/octe/octe.c Tue Apr 27 01:00:22 2010 (r207256) +++ user/jmallett/octeon/sys/mips/cavium/octe/octe.c Tue Apr 27 02:14:42 2010 (r207257) @@ -38,6 +38,8 @@ * attach the specific PHY for each interface without an miibus in between. */ +#include "opt_inet.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> @@ -58,6 +60,11 @@ #include <net/if_media.h> #include <net/if_types.h> +#ifdef INET +#include <netinet/in.h> +#include <netinet/if_ether.h> +#endif + #include <dev/mii/mii.h> #include <dev/mii/miivar.h> @@ -230,7 +237,8 @@ octe_init(void *arg) priv = arg; ifp = priv->ifp; - octe_stop(priv); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + octe_stop(priv); if (priv->open != NULL) priv->open(ifp); @@ -238,8 +246,6 @@ octe_init(void *arg) if (priv->miibus != NULL) mii_mediachg(device_get_softc(priv->miibus)); - cvm_oct_common_set_multicast_list(ifp); - ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } @@ -253,6 +259,9 @@ octe_stop(void *arg) priv = arg; ifp = priv->ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + if (priv->stop != NULL) priv->stop(ifp); @@ -394,12 +403,37 @@ octe_ioctl(struct ifnet *ifp, u_long cmd cvm_oct_private_t *priv; struct mii_data *mii; struct ifreq *ifr; +#ifdef INET + struct ifaddr *ifa; +#endif int error; priv = ifp->if_softc; ifr = (struct ifreq *)data; +#ifdef INET + ifa = (struct ifaddr *)data; +#endif switch (cmd) { + case SIOCSIFADDR: +#ifdef INET + /* + * Avoid reinitialization unless it's necessary. + */ + if (ifa->ifa_addr->sa_family == AF_INET) { + ifp->if_flags |= IFF_UP; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + octe_init(priv); + arp_ifinit(ifp, ifa); + + return (0); + } +#endif + error = ether_ioctl(ifp, cmd, data); + if (error != 0) + return (error); + return (0); + case SIOCSIFFLAGS: if ((ifp->if_flags & IFF_UP) != 0) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004270214.o3R2EgWp068709>