From owner-svn-src-all@FreeBSD.ORG Fri Oct 5 06:34:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37E77106566B; Fri, 5 Oct 2012 06:34:15 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8D0C18FC12; Fri, 5 Oct 2012 06:34:13 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id x43so1047170wey.13 for ; Thu, 04 Oct 2012 23:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=rc1ABDFZkaYESpNeImea/np42X+PWXn7GOc7nlOqDQs=; b=L1MnhuK53OR0Y+Ytw/XM1E9ns3HIIpKDMsipr+Rve/cvsTOSyxmXQ6B/30VdYaeHsJ 62qc0JpKiOgG5crDPQ6GZW+cgg1iVQTXKjFN3iKUH5/U7Rf84RcSc0awc2FpyiRYf+yp vnCF16eoxFlq4QMl1zGYTxMs06dJBazaV776i/qVIgpHoTE0iEgQU2qJWan8N5A9K9uc wieymKjxF0ZhhE+/aojbqntV9wnfdqQ/A02Y+M2goMGbGp7X6+qUlGzwA9XT7z8Vz8Yt Xdi8ZwlgnKafjhcmNduZ6kY5GHJ/yvaDI0pNDZWEp33h7Imudq9Yrvh86pdffUQQtw57 Yy1A== Received: by 10.216.195.133 with SMTP id p5mr4953304wen.1.1349418852823; Thu, 04 Oct 2012 23:34:12 -0700 (PDT) Received: from [10.0.0.86] ([93.152.184.10]) by mx.google.com with ESMTPS id q7sm815212wiy.11.2012.10.04.23.34.08 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Oct 2012 23:34:11 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\)) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <201209201005.q8KA5BqZ094414@svn.freebsd.org> Date: Fri, 5 Oct 2012 09:34:07 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <2966A49C-DE3F-4559-A799-D1E9C0A74A9C@gmail.com> References: <201209201005.q8KA5BqZ094414@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1498) Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r240742 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2012 06:34:15 -0000 On Sep 20, 2012, at 1:05 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Sep 20 10:05:10 2012 > New Revision: 240742 > URL: http://svn.freebsd.org/changeset/base/240742 >=20 > Log: > Convert lagg(4) to use if_transmit instead of if_start. >=20 > In collaboration with: thompsa, sbruno, fabient >=20 > Modified: > head/sys/net/if_lagg.c >=20 > Modified: head/sys/net/if_lagg.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/net/if_lagg.c Thu Sep 20 09:52:57 2012 = (r240741) > +++ head/sys/net/if_lagg.c Thu Sep 20 10:05:10 2012 = (r240742) > @@ -110,7 +110,8 @@ static int lagg_ether_cmdmulti(struct la > static int lagg_setflag(struct lagg_port *, int, int, > int (*func)(struct ifnet *, int)); > static int lagg_setflags(struct lagg_port *, int status); > -static void lagg_start(struct ifnet *); > +static int lagg_transmit(struct ifnet *, struct mbuf *); > +static void lagg_qflush(struct ifnet *); > static int lagg_media_change(struct ifnet *); > static void lagg_media_status(struct ifnet *, struct ifmediareq *); > static struct lagg_port *lagg_link_active(struct lagg_softc *, > @@ -312,15 +313,12 @@ lagg_clone_create(struct if_clone *ifc,=20 >=20 > if_initname(ifp, ifc->ifc_name, unit); > ifp->if_softc =3D sc; > - ifp->if_start =3D lagg_start; > + ifp->if_transmit =3D lagg_transmit; > + ifp->if_qflush =3D lagg_qflush; > ifp->if_init =3D lagg_init; > ifp->if_ioctl =3D lagg_ioctl; > ifp->if_flags =3D IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; >=20 > - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); > - ifp->if_snd.ifq_drv_maxlen =3D ifqmaxlen; > - IFQ_SET_READY(&ifp->if_snd); > - > /* > * Attach as an ordinary ethernet device, children will be = attached > * as special device IFT_IEEE8023ADLAG. > @@ -1222,35 +1220,45 @@ lagg_setflags(struct lagg_port *lp, int=20 > return (0); > } >=20 > -static void > -lagg_start(struct ifnet *ifp) > +static int > +lagg_transmit(struct ifnet *ifp, struct mbuf *m) > { > struct lagg_softc *sc =3D (struct lagg_softc *)ifp->if_softc; > - struct mbuf *m; > - int error =3D 0; > + int error, len, mcast; > + > + len =3D m->m_pkthdr.len; > + mcast =3D (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; >=20 > LAGG_RLOCK(sc); > /* We need a Tx algorithm and at least one port */ > if (sc->sc_proto =3D=3D LAGG_PROTO_NONE || sc->sc_count =3D=3D = 0) { > - IF_DRAIN(&ifp->if_snd); > LAGG_RUNLOCK(sc); > - return; > + m_freem(m); > + ifp->if_oerrors++; > + return (ENXIO); > } >=20 > - for (;; error =3D 0) { > - IFQ_DEQUEUE(&ifp->if_snd, m); > - if (m =3D=3D NULL) > - break; > + ETHER_BPF_MTAP(ifp, m); >=20 > - ETHER_BPF_MTAP(ifp, m); > - > - error =3D (*sc->sc_start)(sc, m); > - if (error =3D=3D 0) > - ifp->if_opackets++; > - else > - ifp->if_oerrors++; > - } > + error =3D (*sc->sc_start)(sc, m); > LAGG_RUNLOCK(sc); > + > + if (error =3D=3D 0) { > + ifp->if_opackets++; > + ifp->if_omcasts +=3D mcast; > + ifp->if_obytes +=3D len; > + } else > + ifp->if_oerrors++; > + > + return (error); > +} > + > +/* > + * The ifp->if_qflush entry point for lagg(4) is no-op. > + */ > +static void > +lagg_qflush(struct ifnet *ifp __unused) > +{ > } >=20 > static struct mbuf * > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Hi, Are there any plans to MFC this change and the one for if_bridge? This one applies cleanly on RELENG_9 and I will have the opportunity to = test it later today. Regards, Nikolay=