Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2725322ybc; Mon, 25 Nov 2019 03:10:39 -0800 (PST) X-Google-Smtp-Source: APXvYqx+/gx674qPCIccFNE/iext1CDoSzHTPgDYQ8mpUeOXBccf3o36lq5adXwVYtZsPZjNe6m7 X-Received: by 2002:a17:906:31c3:: with SMTP id f3mr13674299ejf.198.1574680239689; Mon, 25 Nov 2019 03:10:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574680239; cv=none; d=google.com; s=arc-20160816; b=Am8LozvW2PWMxr7L+vGl9v/FOsZYI4Rt30RFRcQJ72wIIX/wq//bJ0yMv6sFrU488o cKBtw0MVOUbEiJPNMLsrcmQGg0g3QKzFfgMCWP3Z7A+ThTcWq1Fl0dHk13PuqZkT8v+W PClQV7s75NlagyOexyTyg/XA0PLTgAVfEoIa48L076jWIddV1eAFN35Qtlrq5W9TEDK1 6oI6qsJEBsUqV5d3tQlSXYfHDOC5/EeM3Tzjz8I1raShLmh6wLs5sYtRIc63sFwL5+vc T2s4RmfWMS7uKfiK7Lvirtxkhu+KhlO1M7ufxPkl/BuwXrFqfSJZAE9i0+Sg4X33WO02 WvlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=3rlbt0nDg8dhSopx8KDNqLFlSzxiI4xqM7pf5C/pzIs=; b=f01sXZ5cd/eiQL7d9da4gaFOgftbWwkfhMrLMyML01CZIIzYJoGACcbCZ+uXqaISQq Bx3giqLHnt5v3Gj0fWouGeYL0eQNOuvcgcgTN6R4zxRDGyi8nZNKLbCW+3fQ2Z6ae3BV 8FyatcryNai8i6Cx/a2llD5e3TY04IB24dYmra4UBKSr6DpFXyFjcskZKzTLBxn3wbP+ P2FZFBxv7rzUAKKaIMvovjVeSQO4sXNWLB2x8GjeTGWPdZUt92SzhArr0V5plATsanPJ 3/2X/oBDXmuw2KbQ5E2uCdJZhLWp4XcMhGBPUuwcr/ymTI2CHniru5V/o3A/Z4+PVSef TM0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23si4336519eji.404.2019.11.25.03.10.13; Mon, 25 Nov 2019 03:10:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727532AbfKYLF5 (ORCPT + 99 others); Mon, 25 Nov 2019 06:05:57 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:43936 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727278AbfKYLF5 (ORCPT ); Mon, 25 Nov 2019 06:05:57 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.3) (envelope-from ) id 1iZCBJ-008CJd-Oj; Mon, 25 Nov 2019 12:05:25 +0100 Message-ID: <414288fcac2ba4fcee48a63bdbf28f7b9a5037c6.camel@sipsolutions.net> Subject: Re: [PATCH v2 net-next] net: core: use listified Rx for GRO_NORMAL in napi_gro_receive() From: Johannes Berg To: Alexander Lobakin , Edward Cree Cc: Nicholas Johnson , David Miller , jiri@mellanox.com, edumazet@google.com, idosch@mellanox.com, pabeni@redhat.com, petrm@mellanox.com, sd@queasysnail.net, f.fainelli@gmail.com, jaswinder.singh@linaro.org, ilias.apalodimas@linaro.org, linux-kernel@vger.kernel.org, emmanuel.grumbach@intel.com, luciano.coelho@intel.com, linuxwifi@intel.com, kvalo@codeaurora.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org Date: Mon, 25 Nov 2019 12:05:22 +0100 In-Reply-To: <3147bff57d58fce651fe2d3ca53983be@dlink.ru> (sfid-20191125_115913_640375_B340BE47) References: <20191014080033.12407-1-alobakin@dlink.ru> <20191015.181649.949805234862708186.davem@davemloft.net> <7e68da00d7c129a8ce290229743beb3d@dlink.ru> <746f768684f266e5a5db1faf8314cd77@dlink.ru> <3147bff57d58fce651fe2d3ca53983be@dlink.ru> (sfid-20191125_115913_640375_B340BE47) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, 2019-11-25 at 13:58 +0300, Alexander Lobakin wrote: > Edward Cree wrote 25.11.2019 13:31: > > On 25/11/2019 09:09, Nicholas Johnson wrote: > > > The default value of /proc/sys/net/core/gro_normal_batch was 8. > > > Setting it to 1 allowed it to connect to Wi-Fi network. > > > > > > Setting it back to 8 did not kill the connection. > > > > > > But when I disconnected and tried to reconnect, it did not re-connect. > > > > > > Hence, it appears that the problem only affects the initial handshake > > > when associating with a network, and not normal packet flow. > > That sounds like the GRO batch isn't getting flushed at the endof the > > NAPI — maybe the driver isn't calling napi_complete_done() at the > > appropriate time? > > Yes, this was the first reason I thought about, but didn't look at > iwlwifi yet. I already knew this driver has some tricky parts, but > this 'fake NAPI' solution seems rather strange to me. Truth be told, we kinda just fudged it until we got GRO, since that's what we really want on wifi (to reduce the costly TCP ACKs if possible). Maybe we should call napi_complete_done() instead? But as Edward noted (below), we don't actually really do NAPI polling, we just fake it for each interrupt since we will often get a lot of frames in one interrupt if there's high throughput (A-MPDUs are basically coming in all at the same time). I've never really looked too much at what exactly happens here, beyond seeing the difference from GRO. > > Indeed, from digging through the layers of iwlwifi I eventually get to > > iwl_pcie_rx_handle() which doesn't really have a NAPI poll (the > > napi->poll function is iwl_pcie_dummy_napi_poll() { WARN_ON(1); > > return 0; }) and instead calls napi_gro_flush() at the end of its RX > > handling. Unfortunately, napi_gro_flush() is no longer enough, > > because it doesn't call gro_normal_list() so the packets on the > > GRO_NORMAL list just sit there indefinitely. > > > > It was seeing drivers calling napi_gro_flush() directly that had me > > worried in the first place about whether listifying napi_gro_receive() > > was safe and where the gro_normal_list() should go. > > I wondered if other drivers that show up in [1] needed fixing with a > > gro_normal_list() next to their napi_gro_flush() call. From a cursory > > check: > > brocade/bna: has a real poller, calls napi_complete_done() so is OK. > > cortina/gemini: calls napi_complete_done() straight after > > napi_gro_flush(), so is OK. > > hisilicon/hns3: calls napi_complete(), so is _probably_ OK. > > But it's far from clear to me why *any* of those drivers are calling > > napi_gro_flush() themselves... > > Agree. I mean, we _can_ handle this particular problem from networking > core side, but from my point of view only rethinking driver's logic is > the correct way to solve this and other issues that may potentionally > appear in future. Do tell what you think it should be doing :) One additional wrinkle is that we have firmware notifications, command completions and actual RX interleaved, so I think we do want to have interrupts for the notifications and command completions? johannes