Received: by 10.223.176.5 with SMTP id f5csp3030062wra; Mon, 29 Jan 2018 07:49:18 -0800 (PST) X-Google-Smtp-Source: AH8x224rtMC+AiuK82WxTOJXMfEDvckYwU2pYmepcRzukDclW5rujprqaUCgGuHlmSDDUVbiGbmw X-Received: by 10.101.80.6 with SMTP id f6mr12718345pgo.272.1517240958377; Mon, 29 Jan 2018 07:49:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517240958; cv=none; d=google.com; s=arc-20160816; b=CsAGwhoMEuVCJs1eW6c/qB+tKWtQxfNg2DboU7W4aGe28nuS0bt3O6zUTxLKYIA3Db 6pLm9wMWRUeabjxC4dZ31W4/I7bL5hW/AFbQT6Cn6PYcmQlVEsDGm6cjM4x1QeHZ/+xO QUnYS1cK+5PINiYm/n3+8bQP1L+rEoGGHJpVyO4qFVpCiZdwLFJkK08hKbVJtQh1eY68 ydlcNsMVHgoI/p0D9nr4kkOBE3ZlVDo1KPv1TeawTMFEyh1UGpiXdmWzw59oZeO5tSW2 WB5MWR90aB7jbZhaBBddeWiU5IFY+AW+Lw9ItaK/ubbx1Qzgb6PKjgJojEK8r6kjAxTp bswg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=B0WhTXNkgMz3Tc+u0Qo/0Bc8145M6jqem/pl/xIMT6Y=; b=gY2t4XryklR2D/+26TGFJlcULG92q9gGVIea1oOetNeZWNh+WeWsEF7NrlHPBFewo3 7cVm9kKadcz1V8UOxzj9SIlLNNjKlTor60L6ncqiUPp4dVGMRUdxzajW88uuXvIPyrpj 5nCpbMbupbKd9CsgJcfD6e2C3NL4W2hk//HQ1pJ+9vWO0adKHEZJ+tZeo1s3ni0kWZZS SsjNlxd+8DeuDvvczeu1JlowNtFZ8TXN3hdCNDZbMf8I8DQLWu0S7RQSIOxOOEi3HAZC tJhI57hbX+R6hn3Y8S3kUtDiUuWcDqJximh1lqXWUohUAg9aHlEeYb3z/9M89+B+ZnW1 nEDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ppNhiboR; 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 86si1082794pfp.347.2018.01.29.07.49.03; Mon, 29 Jan 2018 07:49:18 -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=ppNhiboR; 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 S1752071AbeA2Psa (ORCPT + 99 others); Mon, 29 Jan 2018 10:48:30 -0500 Received: from mail-qt0-f179.google.com ([209.85.216.179]:33432 "EHLO mail-qt0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbeA2Ps2 (ORCPT ); Mon, 29 Jan 2018 10:48:28 -0500 Received: by mail-qt0-f179.google.com with SMTP id d8so13244169qtm.0; Mon, 29 Jan 2018 07:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=B0WhTXNkgMz3Tc+u0Qo/0Bc8145M6jqem/pl/xIMT6Y=; b=ppNhiboRPZUZWp3kKPUVPtwa/JuK6wv6FLpcSsWFX0mkdhzzvVavzewZRobYnPVDs5 7OK8GQOxaUBF+LVggTyKknl1gTG7c++QazD8pYEVx6009sjldJ1AtuMuN0Bz+2HWKAPo LzUmKmH/tSO2UyONtNRgMrg8QjTakgBODAf02xTbDe98yOk3y16ktw+uvvTjF/HulUSN WfXPu+HPcOfPcOk6BVCCvY1T0TPuX5ny6veyC06z/NjxpKRIKJIpZAm4SChsLRmM94eR fzSM7VpLXDRaInPUhuWILmapQhu7AxnVV+KAex0O7oCyeu/b9d3UwwAanYYyL3Za5O1y bQTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=B0WhTXNkgMz3Tc+u0Qo/0Bc8145M6jqem/pl/xIMT6Y=; b=TtsmxpkvvUBjan0b58WmrNY85JKmk6E5XXzB16PGdDvbhaYSxugfnHJgiankIxsGSC YWNpdV3NLcJRdaCrVijDkqg3GiVCwJHNs4J7CQRujggU7YKEv3CL4j81L0Onpoa2HRG3 AHEufN/b5kVytQSzNHPGQzRpvGAODSCUoun5HU1bvQZANtPAOwV806a5hY9MCmxheFBa nOUbIbT7Lqxch3kC+Uc0LIrc+aii9Y6JP/C4WE0lp749oo349HGg/3FN1hceh8MsvYsn xI55rrEtEME0CQusxelKz24UPXG2dSVJqGxZTy6a/Q0P9qUqfOKq/2knKPLHcltBgFpJ Jfgw== X-Gm-Message-State: AKwxytfaViSI0685LB0s5pn7oWn8UaDe7xFW+O2UXAEvG8D9OARWifob tFUCZbznjb7+G/ZITgKf+F68ZxOdgGBXZh81Vc4= X-Received: by 10.200.25.9 with SMTP id t9mr40702345qtj.75.1517240907428; Mon, 29 Jan 2018 07:48:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.89.199 with HTTP; Mon, 29 Jan 2018 07:48:26 -0800 (PST) In-Reply-To: <20180129072109.2jo5fe4ujozp3ykk@f1.synalogic.ca> References: <20180126091236.13044-1-bpoirier@suse.com> <20180126091236.13044-3-bpoirier@suse.com> <20180129072109.2jo5fe4ujozp3ykk@f1.synalogic.ca> From: Alexander Duyck Date: Mon, 29 Jan 2018 07:48:26 -0800 Message-ID: Subject: Re: [PATCH 2/3] Revert "e1000e: Separate signaling for link check/link up" To: Benjamin Poirier Cc: Jeff Kirsher , intel-wired-lan , Netdev , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 28, 2018 at 11:21 PM, Benjamin Poirier wrote: > On 2018/01/26 09:03, Alexander Duyck wrote: >> On Fri, Jan 26, 2018 at 1:12 AM, Benjamin Poirier wrote: >> > This reverts commit 19110cfbb34d4af0cdfe14cd243f3b09dc95b013. >> > This reverts commit 4110e02eb45ea447ec6f5459c9934de0a273fb91. >> > >> > ... because they cause an extra 2s delay for the link to come up when >> > autoneg is off. >> > >> > After reverting, the race condition described in the log of commit >> > 19110cfbb34d ("e1000e: Separate signaling for link check/link up") is >> > reintroduced. It may still be triggered by LSC events but this should not >> > result in link flap. It may no longer be triggered by RXO events because >> > commit 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts") >> > restored reading icr in the Other handler. >> >> With the RXO events removed the only cause for us to transition the >> bit should be LSC. I'm not sure if the race condition in that state is >> a valid concern or not as the LSC should only get triggered if the >> link state toggled, even briefly. >> >> The bigger concern I would have would be the opposite of the original >> race that was pointed out: >> \ e1000_watchdog_task >> \ e1000e_has_link >> \ hw->mac.ops.check_for_link() === e1000e_check_for_copper_link >> /* link is up */ >> mac->get_link_status = false; >> >> /* interrupt */ >> \ e1000_msix_other >> hw->mac.get_link_status = true; >> >> link_active = !hw->mac.get_link_status >> /* link_active is false, wrongly */ \ e1000_watchdog_task \ e1000e_has_link \ hw->mac.ops.check_for_link() === e1000e_check_for_copper_link /* interrupt */ \ e1000_msix_other hw->mac.get_link_status = true; /* link is up */ mac->get_link_status = false; link_active = !hw->mac.get_link_status /* link_active is true, wrongly */ So basically the idea would be that the interrupt fires after we check for link, but before we have updated get_link_status. It should be a pretty narrow window and I don't know if it will be much of an issue. >> So the question I would have is what if we see the LSC for a link down >> just after the check_for_copper_link call completes? It may not be > > Can you write out exactly what that race would be, in a format similar to the > above? I just did the copy/paste/edit above if that works. Hopefully that makes it clearer. >> anything seen in the real world since I don't know if we have any link >> flapping issues on e1000e or not without this patch. It is something >> to keep in mind for the future though. >> >> >> > As discussed, the driver should be in "maintenance mode". In the interest >> > of stability, revert to the original code as much as possible instead of a >> > half-baked solution. >> >> If nothing else we may want to do a follow-up on this patch as we >> probably shouldn't be returning the error values to trigger link up. >> There are definitely issues to be found here. If nothing else we may >> want to explore just returning 1 if auto-neg is disabled instead of >> returning an error code. >> >> > Link: https://www.spinics.net/lists/netdev/msg479923.html >> > Signed-off-by: Benjamin Poirier > [...]