Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Feb 2011 09:37:30 -0800
From:      Jack Vogel <jfvogel@gmail.com>
To:        Mike Tancsa <mike@sentex.net>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Ivan Voras <ivoras@freebsd.org>, Sean Bruno <seanbru@yahoo-inc.com>, Jan Koum <jan@whatsapp.com>, "freebsd-hardware@freebsd.org" <freebsd-hardware@freebsd.org>
Subject:   Re: em driver, 82574L chip, and possibly ASPM
Message-ID:  <AANLkTinvEAe0b9vd5bvBUyhh8FO9uwXitTGFAEPCamWg@mail.gmail.com>
In-Reply-To: <4D48C973.7080503@sentex.net>
References:  <icgd44$89l$1@dough.gmane.org> <1290533941.3173.50.camel@home-yahoo> <4CEC0548.1080801@sentex.net> <AANLkTim82pWyf_X%2Bu72uj8RkWeRUb_4KSQ8B_HpNYsP9@mail.gmail.com> <AANLkTinO1yfN--_K63-yD1LY3wusOF7wB2wwG8DUd5Z4@mail.gmail.com> <4D2C636B.5040003@sentex.net> <AANLkTimFzYZOkwdExm5JPRB7BaN8Am8pPcgrMT0wVZqy@mail.gmail.com> <4D3C4795.40205@sentex.net> <4D42EA74.4090807@sentex.net> <1296590190.2326.6.camel@hitfishpass-lx.corp.yahoo.com> <AANLkTimdJNV4Hxm6%2Bi3uVa7es9Vu=TDAFBzfUycuM=sZ@mail.gmail.com> <1296591565.2326.7.camel@hitfishpass-lx.corp.yahoo.com> <AANLkTinD0q3r85fAj0Kju9Vc6fT-MVrR1LRczu_XaRW0@mail.gmail.com> <AANLkTinAh1Hwf80ixVvQwk1DRZpvO26PMko3t94%2B5C0R@mail.gmail.com> <1296597827.2326.12.camel@hitfishpass-lx.corp.yahoo.com> <4D48C973.7080503@sentex.net>

next in thread | previous in thread | raw e-mail | index | archive | help
So has everyone that wanted to get something  testing been able to do so?

Jack


On Tue, Feb 1, 2011 at 7:03 PM, Mike Tancsa <mike@sentex.net> wrote:

> On 2/1/2011 5:03 PM, Sean Bruno wrote:
> > On Tue, 2011-02-01 at 13:43 -0800, Jack Vogel wrote:
> >> To those who are going to test, here is the if_em.c, based on head,
> >> with my
> >> changes, I have to leave for the afternoon, and have not had a chance
> >> to build
> >> this, but it should work. I will check back in the later evening.
> >>
> >> Any blatant problems Sean, feel free to fix them :)
> >>
> >> Jack
> >>
> >
> >
> > I suspect that line 1490 should be:
> >               if (more_rx || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) {
> >
>
>
> I have hacked up a RELENG_8 version which I think is correct including
> the above change
>
> http://www.tancsa.com/if_em-8.c
>
>
>
> --- if_em.c.orig        2011-02-01 21:47:14.000000000 -0500
> +++ if_em.c     2011-02-01 21:47:19.000000000 -0500
> @@ -30,7 +30,7 @@
>   POSSIBILITY OF SUCH DAMAGE.
>
>
>  ******************************************************************************/
> -/*$FreeBSD: src/sys/dev/e1000/if_em.c,v 1.21.2.20 2011/01/22 01:37:53
> jfv Exp $*/
> +/*$FreeBSD$*/
>
>  #ifdef HAVE_KERNEL_OPTION_HEADERS
>  #include "opt_device_polling.h"
> @@ -93,7 +93,7 @@
>  /*********************************************************************
>  *  Driver version:
>  *********************************************************************/
> -char em_driver_version[] = "7.1.9";
> +char em_driver_version[] = "7.1.9-test";
>
>  /*********************************************************************
>  *  PCI Device ID Table
> @@ -927,11 +927,10 @@
>        if (!adapter->link_active)
>                return;
>
> -        /* Call cleanup if number of TX descriptors low */
> -       if (txr->tx_avail <= EM_TX_CLEANUP_THRESHOLD)
> -               em_txeof(txr);
> -
>        while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
> +               /* First cleanup if TX descriptors low */
> +               if (txr->tx_avail <= EM_TX_CLEANUP_THRESHOLD)
> +                       em_txeof(txr);
>                if (txr->tx_avail < EM_MAX_SCATTER) {
>                        ifp->if_drv_flags |= IFF_DRV_OACTIVE;
>                        break;
> @@ -1411,8 +1410,7 @@
>        if (!drbr_empty(ifp, txr->br))
>                em_mq_start_locked(ifp, txr, NULL);
>  #else
> -       if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
> -               em_start_locked(ifp, txr);
> +       em_start_locked(ifp, txr);
>  #endif
>        EM_TX_UNLOCK(txr);
>
> @@ -1475,11 +1473,10 @@
>        struct ifnet    *ifp = adapter->ifp;
>        struct tx_ring  *txr = adapter->tx_rings;
>        struct rx_ring  *rxr = adapter->rx_rings;
> -       bool            more;
> -
>
>        if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
> -               more = em_rxeof(rxr, adapter->rx_process_limit, NULL);
> +               bool    more_rx;
> +               more_rx = em_rxeof(rxr, adapter->rx_process_limit, NULL);
>
>                EM_TX_LOCK(txr);
>                em_txeof(txr);
> @@ -1487,12 +1484,10 @@
>                if (!drbr_empty(ifp, txr->br))
>                        em_mq_start_locked(ifp, txr, NULL);
>  #else
> -               if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
> -                       em_start_locked(ifp, txr);
> +               em_start_locked(ifp, txr);
>  #endif
> -               em_txeof(txr);
>                EM_TX_UNLOCK(txr);
> -               if (more) {
> +               if (more_rx || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) {
>                        taskqueue_enqueue(adapter->tq, &adapter->que_task);
>                        return;
>                }
> @@ -1604,7 +1599,6 @@
>        if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
>                em_start_locked(ifp, txr);
>  #endif
> -       em_txeof(txr);
>        E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims);
>        EM_TX_UNLOCK(txr);
>  }
> @@ -3730,17 +3724,17 @@
>                txr->queue_status = EM_QUEUE_HUNG;
>
>         /*
> -         * If we have enough room, clear IFF_DRV_OACTIVE
> +         * If we have a minimum free, clear IFF_DRV_OACTIVE
>          * to tell the stack that it is OK to send packets.
>          */
> -        if (txr->tx_avail > EM_TX_CLEANUP_THRESHOLD) {
> +        if (txr->tx_avail > EM_MAX_SCATTER)
>                 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
> -               /* Disable watchdog if all clean */
> -                if (txr->tx_avail == adapter->num_tx_desc) {
> -                       txr->queue_status = EM_QUEUE_IDLE;
> -                       return (FALSE);
> -               }
> -        }
> +
> +       /* Disable watchdog if all clean */
> +       if (txr->tx_avail == adapter->num_tx_desc) {
> +               txr->queue_status = EM_QUEUE_IDLE;
> +               return (FALSE);
> +       }
>
>        return (TRUE);
>  }
> @@ -5064,8 +5058,8 @@
>        char namebuf[QUEUE_NAME_LEN];
>
>        /* Driver Statistics */
> -       SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "link_irq",
> -                       CTLFLAG_RD, &adapter->link_irq, 0,
> +       SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "link_irq",
> +                       CTLFLAG_RD, &adapter->link_irq,0,
>                        "Link MSIX IRQ Handled");
>        SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_alloc_fail",
>                         CTLFLAG_RD, &adapter->mbuf_alloc_failed,
> @@ -5108,11 +5102,13 @@
>                queue_list = SYSCTL_CHILDREN(queue_node);
>
>                SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head",
> -                               CTLFLAG_RD, adapter, E1000_TDH(txr->me),
> +                               CTLFLAG_RD, adapter,
> +                               E1000_TDH(txr->me),
>                                em_sysctl_reg_handler, "IU",
>                                "Transmit Descriptor Head");
>                SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail",
> -                               CTLFLAG_RD, adapter, E1000_TDT(txr->me),
> +                               CTLFLAG_RD, adapter,
> +                               E1000_TDT(txr->me),
>                                em_sysctl_reg_handler, "IU",
>                                "Transmit Descriptor Tail");
>                SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tx_irq",
> @@ -5123,11 +5119,13 @@
>                                "Queue No Descriptor Available");
>
>                SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head",
> -                               CTLFLAG_RD, adapter, E1000_RDH(rxr->me),
> +                               CTLFLAG_RD, adapter,
> +                               E1000_RDH(rxr->me),
>                                em_sysctl_reg_handler, "IU",
>                                "Receive Descriptor Head");
>                SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail",
> -                               CTLFLAG_RD, adapter, E1000_RDT(rxr->me),
> +                               CTLFLAG_RD, adapter,
> +                               E1000_RDT(rxr->me),
>                                em_sysctl_reg_handler, "IU",
>                                "Receive Descriptor Tail");
>                SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "rx_irq",
> @@ -5141,19 +5139,19 @@
>                                    CTLFLAG_RD, NULL, "Statistics");
>        stat_list = SYSCTL_CHILDREN(stat_node);
>
> -       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "excess_coll",
> +       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "excess_coll",
>                        CTLFLAG_RD, &stats->ecol,
>                        "Excessive collisions");
> -       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "single_coll",
> +       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "single_coll",
>                        CTLFLAG_RD, &stats->scc,
>                        "Single collisions");
> -       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "multiple_coll",
> +       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "multiple_coll",
>                        CTLFLAG_RD, &stats->mcc,
>                        "Multiple collisions");
> -       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "late_coll",
> +       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "late_coll",
>                        CTLFLAG_RD, &stats->latecol,
>                        "Late collisions");
> -       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "collision_count",
> +       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "collision_count",
>                        CTLFLAG_RD, &stats->colc,
>                        "Collision Count");
>        SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "symbol_errors",
> @@ -5240,12 +5238,12 @@
>        SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_1024_1522",
>                        CTLFLAG_RD, &adapter->stats.prc1522,
>                        "1023-1522 byte frames received");
> -       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd",
> +       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd",
>                        CTLFLAG_RD, &adapter->stats.gorc,
>                        "Good Octets Received");
>
>        /* Packet Transmission Stats */
> -       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd",
> +       SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_txd",
>                        CTLFLAG_RD, &adapter->stats.gotc,
>                        "Good Octets Transmitted");
>        SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd",
>
> --
> -------------------
> Mike Tancsa, tel +1 519 651 3400
> Sentex Communications, mike@sentex.net
> Providing Internet services since 1994 www.sentex.net
> Cambridge, Ontario Canada   http://www.tancsa.com/
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinvEAe0b9vd5bvBUyhh8FO9uwXitTGFAEPCamWg>