From patchwork Fri Oct 30 17:31:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 538458 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 5A65D140D9D for ; Sat, 31 Oct 2015 04:33:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759820AbbJ3Rbk (ORCPT ); Fri, 30 Oct 2015 13:31:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:56862 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758017AbbJ3Rbi (ORCPT ); Fri, 30 Oct 2015 13:31:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BBFF3AC76; Fri, 30 Oct 2015 17:31:56 +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 v2 0/4] e1000e msi-x fixes Date: Fri, 30 Oct 2015 10:31:00 -0700 Message-Id: <1446226264-29660-1-git-send-email-bpoirier@suse.com> X-Mailer: git-send-email 2.6.0 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 | 65 +++++++++++++---------------- 2 files changed, 30 insertions(+), 38 deletions(-) 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 0x01500000. -0 [000] d.h. 672874.016104: e1000_intr_msix_rx: eth1: rxq0 irq ims 0x01400000 -0 [000] d.h. 672874.016107: e1000_intr_msix_rx: eth1: scheduling napi -0 [000] ..s. 672874.016112: e1000e_poll: eth1: poll starting ims 0x01400000 -0 [000] ..s. 672874.016126: 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