Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2717216ybc; Mon, 25 Nov 2019 03:03:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzrY5UfTcuebFaLtEG5Izn/FUO7VvxYHGXnIRhgZcgRLGBUpQ0pwyorap7SCbqSIfZC3IjL X-Received: by 2002:aa7:c145:: with SMTP id r5mr18051077edp.102.1574679786770; Mon, 25 Nov 2019 03:03:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574679786; cv=none; d=google.com; s=arc-20160816; b=IM3gRK03cqpQwAkcmIYDJzsqxDISIfd9snxK6FQcGBaQ1MBK1uMz8ARSG8qP6QdQSP 9bvaAVSSzBigiiMx7arHnDin0WIzGnHum0m+kMhEVmvSX/P54AE6mD/kafIVgMu9GPGD a8j7h2mIfstDBUU66vkiXo02smpAbQb1ujFcvq1t123S/WfQQUJtsi0hPhFNclQC7KZX ND1BWJwQtaQOeNoeLXxY0MlH87+CZJYT26QR8HQuXYiPFIqnDYx8DYbV+5l+SyFZ97lZ LOQ9bmXkD83rxLdo0zH/OzevcGG3+Y1usbOS4POz3LNy7wHFXlIvGeKCWjMs+lCMh1ya o35A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-filter:dkim-signature:dkim-filter; bh=tXl0CZ8ZQKwituwUIeWFFggmc8Ny9GguiEH02Chb+Rs=; b=wNoRwsNpjqjB+Ta1Xhl2QeGaZuRDGVTjNnwMr20s/oyUtlLV52fpplpmhcpfmFgKSG y1bePYhlRdRC89J4LIpMzkV8t1mwz1T1MACue0MXGJLQ+qCfnYUo13ImqkeFg/2BQxl8 S3/t81za0yCY3zO1tJasWFNXm5WtB+7Q+n4/JyFBx3qJL17AxULClhYJtGPJMJoIN77s oVNgp9IWOohJYVnlGQI+TD4LzhAaPflSoHSMPn6vf7L/wwIozL5Rur7RDs3mW5cJ0oDH 8s0zZvv58J1+OcCJwLhpDgpUrJexYQX9EkSnc/YyIRrA8SNEooIiK68SHY3MsdtWHnnn YBXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dlink.ru header.s=mail header.b=a45o3o3P; 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 rs1si4430657ejb.73.2019.11.25.03.02.28; Mon, 25 Nov 2019 03:03:06 -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; dkim=pass header.i=@dlink.ru header.s=mail header.b=a45o3o3P; 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 S1727495AbfKYK7D (ORCPT + 99 others); Mon, 25 Nov 2019 05:59:03 -0500 Received: from fd.dlink.ru ([178.170.168.18]:44662 "EHLO fd.dlink.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727316AbfKYK7D (ORCPT ); Mon, 25 Nov 2019 05:59:03 -0500 Received: by fd.dlink.ru (Postfix, from userid 5000) id C60AF1B20400; Mon, 25 Nov 2019 13:58:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru C60AF1B20400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dlink.ru; s=mail; t=1574679538; bh=tXl0CZ8ZQKwituwUIeWFFggmc8Ny9GguiEH02Chb+Rs=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=a45o3o3P//4ZWdb4IdfAoRDjCZD7XkSMbb0yFQA7iUnkl6hKnDUU5DOo97J2eTtHm /59+08z/EO6Orx7arCGu/s3sUvTBY/OKOpoHy4u2hcMyyBu5AMUFu4LCnD3ppPxKO8 SI/TyWLseslni3DjGWecwwGYBa89b4nBXpROKk9s= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dlink.ru X-Spam-Level: X-Spam-Status: No, score=-99.2 required=7.5 tests=BAYES_50,URIBL_BLOCKED, USER_IN_WHITELIST autolearn=disabled version=3.4.2 Received: from mail.rzn.dlink.ru (mail.rzn.dlink.ru [178.170.168.13]) by fd.dlink.ru (Postfix) with ESMTP id 3433D1B204A3; Mon, 25 Nov 2019 13:58:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru 3433D1B204A3 Received: from mail.rzn.dlink.ru (localhost [127.0.0.1]) by mail.rzn.dlink.ru (Postfix) with ESMTP id CD5151B210B7; Mon, 25 Nov 2019 13:58:38 +0300 (MSK) Received: from mail.rzn.dlink.ru (localhost [127.0.0.1]) by mail.rzn.dlink.ru (Postfix) with ESMTPA; Mon, 25 Nov 2019 13:58:38 +0300 (MSK) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 25 Nov 2019 13:58:38 +0300 From: Alexander Lobakin To: 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, johannes.berg@intel.com, emmanuel.grumbach@intel.com, luciano.coelho@intel.com, linuxwifi@intel.com, kvalo@codeaurora.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH v2 net-next] net: core: use listified Rx for GRO_NORMAL in napi_gro_receive() In-Reply-To: References: <20191014080033.12407-1-alobakin@dlink.ru> <20191015.181649.949805234862708186.davem@davemloft.net> <7e68da00d7c129a8ce290229743beb3d@dlink.ru> <746f768684f266e5a5db1faf8314cd77@dlink.ru> User-Agent: Roundcube Webmail/1.4.0 Message-ID: <3147bff57d58fce651fe2d3ca53983be@dlink.ru> X-Sender: alobakin@dlink.ru Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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. > 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. > -Ed > > [1]: https://elixir.bootlin.com/linux/latest/ident/napi_gro_flush Regards, ᚷ ᛖ ᚢ ᚦ ᚠ ᚱ