From patchwork Mon Nov 9 23:50:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 542070 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DE0C11401AD for ; Tue, 10 Nov 2015 10:53:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751864AbbKIXvR (ORCPT ); Mon, 9 Nov 2015 18:51:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:56957 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbbKIXvO (ORCPT ); Mon, 9 Nov 2015 18:51:14 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C6437AAB6; Mon, 9 Nov 2015 23:50:52 +0000 (UTC) From: Benjamin Poirier To: Jeff Kirsher Cc: Alexander Duyck , Frank Steiner , Jesse Brandeburg , Shannon Nelson , Carolyn Wyborny , Don Skidmore , Matthew Vick , John Ronciak , Mitch Williams , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/4] e1000e msi-x fixes Date: Mon, 9 Nov 2015 15:50:17 -0800 Message-Id: <1447113021-1611-1-git-send-email-bpoirier@suse.com> X-Mailer: git-send-email 2.6.2 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, For this series: Benjamin Poirier (4): e1000e: Remove unreachable code e1000e: Do not read icr in Other interrupt e1000e: Do not write lsc to ics in msi-x mode e1000e: Fix msi-x interrupt automask drivers/net/ethernet/intel/e1000e/defines.h | 3 +- drivers/net/ethernet/intel/e1000e/netdev.c | 66 ++++++++++++----------------- 2 files changed, 30 insertions(+), 39 deletions(-) Changes in v3: Preserve LSC in IMS, LSC events are not delivered otherwise. Disable CTRL_EXT.IAME to prevent IMC write on ICR read from external program. Changes in v2: Address review comments from Alexander Duyck: extend cleanup of Other interrupt handler and use tx_ring->ims_val. The first three patches cleanup handling of Other interrupts and the last patch fixes tx and rx interrupts. Please consider reading the description for that patch before proceeding. I believe that the following simple tracing statements are helpful in detecting the problem fixed by the last patch. -------- 8< -------- With that patch but without the patches in this series we can see that rx irqs occur at unexpected times: -0 [000] .Ns. 1986.887517: e1000e_poll: eth1: will enable rxq0 irq -0 [000] d.h. 1986.896654: e1000_intr_msix_rx: eth1: rxq0 irq ims 0x01500004 -0 [000] d.h. 1986.896657: e1000_intr_msix_rx: eth1: scheduling napi -0 [000] d.H. 1986.896662: e1000_intr_msix_rx: eth1: rxq0 irq ims 0x01500004 -0 [000] ..s. 1986.896667: e1000e_poll: eth1: poll starting ims 0x01500004 Warning: many interrupts (2) before napi -0 [000] ..s. 1986.896685: e1000e_poll: eth1: will enable rxq0 irq -0 [000] d.h. 1990.688870: e1000_intr_msix_rx: eth1: scheduling napi -0 [000] ..s. 1990.688875: e1000e_poll: eth1: poll starting ims 0x01500004 -0 [000] dNH. 1990.688913: e1000_intr_msix_rx: eth1: rxq0 irq ims 0x01500004 Warning: interrupt inside napi -0 [000] .Ns. 1990.688916: e1000e_poll: eth1: will enable rxq0 irq -0 [000] d.h. 1990.729688: e1000_intr_msix_rx: eth1: rxq0 irq ims 0x01500004 Here's a typical sequence after applying the patches in this series. Notice that ims is changed. Another printk at the end of e1000e_poll would show it to be 0x01500004. -0 [000] d.h. 23547.977917: e1000_intr_msix_rx: eth1: rxq0 irq ims 0x01400004 -0 [000] d.h. 23547.977922: e1000_intr_msix_rx: eth1: scheduling napi -0 [000] ..s. 23547.977928: e1000e_poll: eth1: poll starting ims 0x01400004 -0 [000] ..s. 23547.977961: e1000e_poll: eth1: will enable rxq0 irq Finally, here's the script I used to generate the warnings above: #!/usr/bin/python3 import sys import re import pprint class NaE(Exception): "Not an Event" pass class Event: def __init__(self, line): # sample events: # -0 [000] d.h. 2025.256536: e1000_intr_msix_rx: eth1: rxq0 irq ims 0x01500004 # -0 [000] d.h. 2025.256539: e1000_intr_msix_rx: eth1: scheduling napi # -0 [000] ..s. 2025.256544: e1000e_poll: eth1: poll starting ims 0x01500004 # -0 [000] ..s. 2025.256558: e1000e_poll: eth1: will enable rxq0 irq retval = re.match(" +.*)>?-(?P[0-9]+) +\[(?P.*)\] (?P[^ ]+) +(?P