From owner-freebsd-net@FreeBSD.ORG Tue Sep 9 05:12:15 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B716392C; Tue, 9 Sep 2014 05:12:15 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69BBBE09; Tue, 9 Sep 2014 05:12:15 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id m5so15298657qaj.35 for ; Mon, 08 Sep 2014 22:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=uFuIApWz9uO/GJmzNmxVWOmRzQG7Z5srD9iTjAY9ka8=; b=svfMywDzIOYQkw/gfyi2W+tMF0mvI+b9BwbMxPH9Gec1YoiC72vBj3kY4bR3jI2HMc 0KK8l5Vl4ZRGxKDqY7H0WmS8BuFw2skB2F4X+AeVwz9nHvsOz6l6sYMza4FizAvUKsaT wPdUF3jeNSI2s7R3758qWlKTvan+Tifit6xgTb2Q7kZel5ahp/xll1HN6PrBE6Lc5QKo zGnkbJTLj6b31q8suEIIt5Fcf9mj5blxLNdN4fKTfO3M+BjXcoLRKpyWQiEQWdG+JING R0SVkV6fKdcd91lAfiRAy7JVHH1U83+gxXVaQldgN6dcR54ytJZeyujnQ2mBi0M76RY7 f5GQ== MIME-Version: 1.0 X-Received: by 10.140.31.75 with SMTP id e69mr46157243qge.2.1410239534540; Mon, 08 Sep 2014 22:12:14 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Mon, 8 Sep 2014 22:12:14 -0700 (PDT) Date: Mon, 8 Sep 2014 22:12:14 -0700 X-Google-Sender-Auth: xJqxmak3LWd_lbucGZMG20mnqi0 Message-ID: Subject: [igb] add DROP_EN to each RX queue config if TX flow control is disabled From: Adrian Chadd To: FreeBSD Net , Jack F Vogel , "Joyner, Eric" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 05:12:15 -0000 Hi, This patch enables the DROP_EN flag to each RX queue if TX flow control is disabled. It (mostly) mirrors what the ixgbe driver does. This prevents a single full RX ring from stalling the rest of the RX rings. How's it look? (indenting and such aside, thanks google.) -a Index: sys/dev/e1000/if_igb.c =================================================================== --- sys/dev/e1000/if_igb.c (revision 271290) +++ sys/dev/e1000/if_igb.c (working copy) @@ -4712,6 +4712,18 @@ rctl |= E1000_RCTL_SZ_2048; } + /* + * If TX flow control is disabled and there's >1 queue defined, + * enable DROP. + * + * This drops frames rather than hanging the RX MAC for all queues. + */ + if ((adapter->num_queues > 1) && + (adapter->fc == e1000_fc_none || + adapter->fc == e1000_fc_rx_pause)) { + srrctl |= E1000_SRRCTL_DROP_EN; + } + /* Setup the Base and Length of the Rx Descriptor Rings */ for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 bus_addr = rxr->rxdma.dma_paddr; @@ -6255,6 +6267,7 @@ adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode; e1000_force_mac_fc(&adapter->hw); + /* XXX TODO: update DROP_EN on each RX queue if appropriate */ return (error); }