Received: by 10.223.176.46 with SMTP id f43csp1008723wra; Fri, 19 Jan 2018 05:37:53 -0800 (PST) X-Google-Smtp-Source: ACJfBovdGhZaWGPr7YeNj8payIM92AAUkdK3Iuxepa+b4hwPEJuCptYI3vVxNxYhWFW7IEymC5Qe X-Received: by 2002:a17:902:b288:: with SMTP id u8-v6mr1543899plr.291.1516369073585; Fri, 19 Jan 2018 05:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516369073; cv=none; d=google.com; s=arc-20160816; b=AxI2MqzHmRMiwwcw47lh+veVZwWw1i/tYjcbahDNNCGDXPWOtzIYSPU9saQM5ouD4j MaftZmJXHqn8cN1QD4zMst4CF4a+r/qDFR7AvVNzfTgxYU94/NeBiVDEWtA+HHgGIFSL OSPChJ2yo28byHXxRzj6hhqe7om8RZ2LDOOHqb1XQcrO/NWLFnnpQ4DXfIg/p6oGiglx D2zMTAxo4DT2IYcTzfN5k8iYE/PBAiA0ZrQh7o24hpqnS6/dY5YLR9B+Ej63mG/n7JzC Clco+FKBl/IxvD5/XWHQhYKkxcF38Wty913CV8cg67xub7ZcGsCLButeOQxaYP9PFzC4 Vr/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=9fvsLVsoFEY48Xa78v7wYpDzi3CVHLHRosBvF50au2k=; b=vrw7LUSKaOkdXJsg2BBmNUq0puNSu9xgaA5Ty+ThD3WSYZ3XXjit9cwVz9yvWNPhRM 4DOADnawrDNT0GHVx/Sc0Q80TlFZYUpVIhOtVef05ZwcgmI8JuRintuUhlzF8Z6x7A9t R4B8/pljyI9Pfx4sxNFlnXuoVQudNGHuMaO3fyIcOJblqc3Gw3qAxrWZcj/RFLqMRTPw AI8sSXz55v0EFA5aLodTqmE3+e/jOlfB2+Y9yhPXVuC7WQSefT8JgL/pSOz9AXhG6uej EPAtIlqwEkBTkaceRQP5TCoVvAwrkLA8/23G+1njYmx/zGVDHfmGG/sfA7DzeoTL+7hk g2jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HGxw8tqg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4-v6si840995plf.59.2018.01.19.05.37.39; Fri, 19 Jan 2018 05:37:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HGxw8tqg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755258AbeASNhE (ORCPT + 99 others); Fri, 19 Jan 2018 08:37:04 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:35420 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753841AbeASNgz (ORCPT ); Fri, 19 Jan 2018 08:36:55 -0500 Received: by mail-pf0-f172.google.com with SMTP id t12so1382558pfg.2; Fri, 19 Jan 2018 05:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9fvsLVsoFEY48Xa78v7wYpDzi3CVHLHRosBvF50au2k=; b=HGxw8tqg8gfA0Kqg5bBiVVrgUoJ65zvcUWXs7XymX9bDABjxhYgaiijg4yqM+M8zLi E+oL99s0XROmHh4t0clo7vuCzaEJDpmxG20EwrxI95jnU2c81gY55PyYHtHzBAWmLQ+D hn87RoVH9/Gb2MmfSk9q2WemPgumOtdwwTZTeq0GCfR8gjk1MUpYXdGf9lkDWBrO0Oyb j+0kDfd9G9D8uJGqACQvbyt1Bhe78L6udieJz2ga4/0gVu/xIMCEITZP/rzpAhwQz1PE heYtbDfbksYwwvmZPNukyVxKaOxri/DqAZNb1GS922YjRvL5IoT9O6fV+ralXnSQ/DB8 Oadw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9fvsLVsoFEY48Xa78v7wYpDzi3CVHLHRosBvF50au2k=; b=XP59sbwEUdJALKp224lVm86sb9fgjOd2uRF7uBHYeuQkB4xNLovQFRx/AB9wIvegKM dtTQMfVr70ikV2uTBnzpEHtinN1xwrQPhsMgfDZ9OQUI83NhoSD//kzRmN3mfx9K6jyL DSmN2aHfwSRiWv62X9+/X8VSVNA0H5h4RpjVt2JW34DnXeahTqMxpDvxyN0DJF+iREn7 XvO55okEcmhHanODdllv74YQCDak616lvitDiU9gE1rHAv7un+ecuuaYzMq6JNCFYrqo cBD3vg+Y35nfR42dZ3G9xcVK23EJJGhLMkGT7CIqNaBdZaIsQSfUlMnpeJ5kIr50PibD rAnQ== X-Gm-Message-State: AKGB3mIhqHapvHViMsGhJHyDSfYYO5J+gbznWtG56K7msWfe8mEGEMQo A7Pb4k1J6OgGUDFT8NqergQ= X-Received: by 10.99.112.25 with SMTP id l25mr33482484pgc.154.1516369014199; Fri, 19 Jan 2018 05:36:54 -0800 (PST) Received: from f1.synalogic.ca (pdf86d7d5.tokynt01.ap.so-net.ne.jp. [223.134.215.213]) by smtp.gmail.com with ESMTPSA id e79sm21168265pfl.61.2018.01.19.05.36.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Jan 2018 05:36:53 -0800 (PST) Date: Fri, 19 Jan 2018 22:36:48 +0900 From: Benjamin Poirier To: Alexander Duyck Cc: Shrikrishna Khare , Jeff Kirsher , Netdev , intel-wired-lan , linux-kernel@vger.kernel.org Subject: Re: [Intel-wired-lan] [RFC PATCH] e1000e: Remove Other from EIAC. Message-ID: <20180119133648.s5nbm4gvby6c33av@f1.synalogic.ca> References: <20180118065054.29844-1-bpoirier@suse.com> <20180119085952.u63kius4ud34lleq@f1.synalogic.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119085952.u63kius4ud34lleq@f1.synalogic.ca> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/01/19 17:59, Benjamin Poirier wrote: > On 2018/01/18 07:51, Alexander Duyck wrote: > > On Wed, Jan 17, 2018 at 10:50 PM, Benjamin Poirier wrote: > > > It was reported that emulated e1000e devices in vmware esxi 6.5 Build > > > 7526125 do not link up after commit 4aea7a5c5e94 ("e1000e: Avoid receiver > > > overrun interrupt bursts", v4.15-rc1). Some tracing shows that after > > > e1000e_trigger_lsc() is called, ICR reads out as 0x0 in e1000_msix_other() > > > on emulated e1000e devices. In comparison, on real e1000e 82574 hardware, > > > icr=0x80000004 (_INT_ASSERTED | _OTHER) in the same situation. > > > > Isn't 0x80000004 (_INT_ASSERTED | _LSC)? The assumption I based my > > Yes. The numeric value is correct. I made a mistake when writing down > the flag names. > > > patch on was that the VMware code was sending _OTHER instead of _LSC > > to trigger LSC events. As such in my version of the workaround I just > > It's not so deterministic, sadly. In my tests, upon entry into > e1000_msix_other() after e1000e_trigger_lsc(), with no workaround patch > I've seen: > icr=0x0 > icr=0x3d > Reserved RXDMT0 Reserved LSC TXDW > icr=0x46 > RXO LSC TXQE > and someone else reported: > icr=0x3c > Reserved RXDMT0 Reserved LSC > > > went through and did the testing if the _RXO bit was set, otherwise I > > assumed that whatever event was received must have been meant to > > trigger an _LSC type event since that worked in the past. ^... Re-reading that part, my thoughts are that it worked in the past, before 16ecba59bc33 ("e1000e: Do not read ICR in Other interrupt", v4.5-rc1), because (presumably) Other was not set in EIAC. It worked after 16ecba59bc33 but before 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts", v4.15-rc1) because e1000_msix_other() didn't read the value of icr. If it had, it would've found a bogus value, which is what's happening after 4aea7a5c5e94. I wonder if we're not just getting some uninitialized value from the emulation code... which makes me kind of uneasy about your approach of trying to make sense of the value. Maybe Shrikrishna can clarify where the icr value is coming from when Other is set in EIAC. > > > > > Some experimentation showed that this flaw in vmware e1000e emulation can > > > be worked around by not setting Other in EIAC. This is how it was before > > > 16ecba59bc33 ("e1000e: Do not read ICR in Other interrupt", v4.5-rc1). > > > > Did this actually set the _LSC bit or was it just giving you the > > _OTHER bit? The ICR for that combination would come out 0x81000000. > > With my patch, after e1000e_trigger_lsc(), it results in icr=0x81000004 > on real and emulated hardware. > > IMO, the resulting icr read is cleaner than with your patch but it > depends on an undocumented quirk of the emulated vmware e1000e, so I > don't know which of the two workarounds is more desirable. > > If you'd like to stick with your patch though, I think that you should > definitely rewrite it as: > > diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c > index 9f18d39bdc8f..68c0bcb8287f 100644 > --- a/drivers/net/ethernet/intel/e1000e/netdev.c > +++ b/drivers/net/ethernet/intel/e1000e/netdev.c > @@ -1928,7 +1928,12 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data) > __napi_schedule(&adapter->napi); > } > } > - if (icr & E1000_ICR_LSC) { > + if (icr & E1000_ICR_LSC || !(icr & E1000_ICR_RXO)) { > + /* We assume if the RXO bit is not set that this is a > + * link status change event. This is needed due to emulated > + * versions of the device that may not correctly populate > + * the LSC bit. > + */ > ew32(ICR, E1000_ICR_LSC); > hw->mac.get_link_status = true; > /* guard against interrupt when we're going down */ > > > > > > Fixes: 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts") > > > Signed-off-by: Benjamin Poirier > > > --- > > > > > > Jeff, I'm sending as RFC since it looks like a problem that should be fixed > > > in vmware. If you'd like to have the workaround in e1000e, I'll submit. > > > > I would appreciate it if you could review/test the patch I submitted > > for the same issue. Specifically I would want to make certain that it > > still addresses the original RXO interrupt burst issue your reported. > > I've tested both my patch and yours; they both allow link up on vmware; > link up on real 82574 and rxo mitigation on real 82574. I couldn't > conveniently test rxo on vmware. > > > > > Thanks. > > > > - Alex > >