From patchwork Wed Jun 24 22:06:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 191715 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp240163ilg; Wed, 24 Jun 2020 15:06:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCQAOjajb1KjvZJd/T7K60BHtSlCYWyeMYyhsN1gwaq9XizPSzapBgN5fn/jGwJi9Yuxvs X-Received: by 2002:a17:906:6dca:: with SMTP id j10mr21832696ejt.64.1593036394472; Wed, 24 Jun 2020 15:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036394; cv=none; d=google.com; s=arc-20160816; b=JlVntdbhNyST9nwcK5rEErg8+O274MVnl4psy2q8Szpi+cIQqb5ZKoh2qgF1o+0hOX GLBIpYYXQCJozHUhAikpx20Wu+SBjO8+FwcE9AVjgZLmrpTEhq2qjbfU1gwZ1l8IdZvt lM9mTgmPL7Jgr1blmIzmc52z7R9iXCplXtu8z23Z2QHiebfhQxs5gp7oZNLKkSVvVhqy FlbmC3IlFEMBjpBsWGBfbx363e8CKdYiJQcAHCE8jRD+6stSlysMlopVOdJ9dsn1XEmY ltEpo5jwT+kndcit1LUQfeGUf+Fi1153Nz2jJMp0S4ds5FhwEZa3Cp94ma2RkKS9GWhr i2Uw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=agpmV68B9qAUP4tABHt4ZycMamM5/jVd5jk3wkCRqO8=; b=lM/T52cOe+f7PXbvp+4c4bwMbZZ1xc2ltxXUspArSYuv+aX3JaGzU35ZlONOGj1P8D kkePs/G3NeHmBF0IQ3YXzrW3ZnBCxz5IFnmaoPt6uSy13kaOVVO6dJ3sbTeKFU+hThkr lpwK6KREj9FmYZj0aJlMaxMfrlpQHCQWeqiGM9Q4YZd1fr3edeIIXZNeF00Uv860MwDX orcK7PzhSa5a90qDvguyt+PLiPrxbpYqg5c/8SAIYx5JsruMr+ibbcKhggeYBY8bJoN0 f0A6Stu1Ltu73RS6m32cMtV3jfuSathmy1q2h67IKwlPn7XrUMxriGBkxPbCHBR8ixjs WrIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=h8d4+Pid; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id va29si14357935ejb.235.2020.06.24.15.06.34; Wed, 24 Jun 2020 15:06:34 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=h8d4+Pid; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389403AbgFXWGT (ORCPT + 9 others); Wed, 24 Jun 2020 18:06:19 -0400 Received: from mail.zx2c4.com ([192.95.5.64]:37289 "EHLO mail.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388749AbgFXWGR (ORCPT ); Wed, 24 Jun 2020 18:06:17 -0400 Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTP id c59dc5be; Wed, 24 Jun 2020 21:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=mail; bh=k6TDfchJl1xwN8eYnLY7MdqX7 ZE=; b=h8d4+PidyauR4fEn6UYPApJO4nHTDiWptKTF5H5VXPs6YxmY+7dOTmB3V PL7k6aKGh+qurZhShm+Y04Btga8HVYdM1AksqjEI2iS9Lm4HsnATaW//rZfSVVlY H3dCakpirhojaYvNldrpSVMa2QFZcbzoX5sugHFaCNYaMzzHnx20Ywu4a8dVkeoQ IwbFy+vhP+nRbPMMTOGSIF8CPh9g2IqDT+TjWqcc9WaccZRFgWBBuzLPKzfjr4ZA Xnq1rsk8ghfYvlrprfUhTZZcAZOgB3NAhID4rE/47QkarJNDO+G9+XaDlmtRHzb0 lbO/sj/KW6+S0ocw+1WTyUCHCRXrw== Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id cfe6519e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jun 2020 21:47:10 +0000 (UTC) From: "Jason A. Donenfeld" To: netdev@vger.kernel.org, davem@davemloft.net Cc: "Jason A. Donenfeld" Subject: [PATCH net 1/4] wireguard: receive: account for napi_gro_receive never returning GRO_DROP Date: Wed, 24 Jun 2020 16:06:03 -0600 Message-Id: <20200624220606.1390542-2-Jason@zx2c4.com> In-Reply-To: <20200624220606.1390542-1-Jason@zx2c4.com> References: <20200624220606.1390542-1-Jason@zx2c4.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The napi_gro_receive function no longer returns GRO_DROP ever, making handling GRO_DROP dead code. This commit removes that dead code. Further, it's not even clear that device drivers have any business in taking action after passing off received packets; that's arguably out of their hands. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Fixes: 6570bc79c0df ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()") Signed-off-by: Jason A. Donenfeld --- drivers/net/wireguard/receive.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.27.0 diff --git a/drivers/net/wireguard/receive.c b/drivers/net/wireguard/receive.c index 91438144e4f7..9b2ab6fc91cd 100644 --- a/drivers/net/wireguard/receive.c +++ b/drivers/net/wireguard/receive.c @@ -414,14 +414,8 @@ static void wg_packet_consume_data_done(struct wg_peer *peer, if (unlikely(routed_peer != peer)) goto dishonest_packet_peer; - if (unlikely(napi_gro_receive(&peer->napi, skb) == GRO_DROP)) { - ++dev->stats.rx_dropped; - net_dbg_ratelimited("%s: Failed to give packet to userspace from peer %llu (%pISpfsc)\n", - dev->name, peer->internal_id, - &peer->endpoint.addr); - } else { - update_rx_stats(peer, message_data_len(len_before_trim)); - } + napi_gro_receive(&peer->napi, skb); + update_rx_stats(peer, message_data_len(len_before_trim)); return; dishonest_packet_peer: From patchwork Wed Jun 24 22:06:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 191712 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp240025ilg; Wed, 24 Jun 2020 15:06:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygEhoyp3qvZYOVO4QW8aUACTEYfU4zxOjWa/56f8/kRiNduHqsfGUhMyucMFzHRkhDCigM X-Received: by 2002:a17:906:3e15:: with SMTP id k21mr28323516eji.525.1593036381409; Wed, 24 Jun 2020 15:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036381; cv=none; d=google.com; s=arc-20160816; b=fpd/E1i4WJiKfSCoWYShg/dKwowCyF9j9lpscKth18Zh+mb4YFq4jlow0a9bmxmtaV 2fL4488C3+b2oav7oAfJwr3ZzSltH3Da5vn2GL1NiPNodEdTtXL6XgZrO3oDMt/Xc+dd jQiGyGZsUTQ67mHaaeuCpK7P2+3CNMCZ68JadTJrTXkQxV8oaRe1t9kcCN0bCGJ8YyVS EzzHAZZvThZG06WFgOUM389Bh1uTE4lAlfVewy8B7kl0eilWWhtMJUGxQ2dVpoVO7r4n Ynzvs+Z/3/qs1YIOp1Kn3m4fE+74SeFj4HMk4zpBW1cIj7Msc4nshMj6vvJoI6nWJUqG RjVw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Q6vPaKBXFglXf14IKkiR8Lb4E8pPnttc5k3YuknDuoY=; b=OHN2+7Ggmr6ZxUMxqEA8pVhmMR1e8+TDBs5YDVwwI8g7ZcSuKD0cOwvAuK0LzUZgPf YddsFN1830bpFKNpeEj9k6S2tOtTA01S9n5Q1o8x+w5M6MnUZk9PQWsJnl4a8XuL31Rx lSHRfjFv4quAl7OVKALQmRZJWe8q7oybNWOds4qR2utsqS1xsV2hAjV8JLjWffa6hZWq w7y4YvR0+EwE9ByQqnXLArBEJj4uNkNRe9LQ6LsvZWp5/rlj/DLfBhfe6zTmOlbiZun6 eTFrNWc1vE1lh0buodjW795udxBTPPdynqeaQeVOO9w7DeYcA7xp/SFmjAv3CYqUldTw uKIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=j6zftUIK; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca21si6832787edb.533.2020.06.24.15.06.21; Wed, 24 Jun 2020 15:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=j6zftUIK; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389611AbgFXWGU (ORCPT + 9 others); Wed, 24 Jun 2020 18:06:20 -0400 Received: from mail.zx2c4.com ([192.95.5.64]:37289 "EHLO mail.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389299AbgFXWGS (ORCPT ); Wed, 24 Jun 2020 18:06:18 -0400 Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTP id aab2e22f; Wed, 24 Jun 2020 21:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=mail; bh=KJFj0AvgPuSYF9k38/rwChLnu Yg=; b=j6zftUIKiGwR4G8Jq1wwk0xC2iXWipAY0vJqhD4aBN8qcWYFm3n78EsDE DVJjSYfw/1u7piveM3263JU48IvruOr8TmyTcnXLvK/hbd5Rn7kLbjr/Grj9nLrQ lHJGc9kX7qm0TF7JePJ6BK1pDvAI/ZGUZ9OFpAh24zMEEIucRierOGRXQrr3mXMD j3Agk9yZLbl9fnbUt/VCwu5+mGjJfAZPUaRDbaOvo833nJLmmu+RN4ZahFZ6cmVf 7QQtJlUqaRsNy3xPqNN83Y9HMw2LppTTk+xpYnsnBVXTAuexw4jweEVySxFi+CAT q1wGqtStbBtq6ayxyxvtMGphU0G9Q== Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 39b7a5a4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jun 2020 21:47:12 +0000 (UTC) From: "Jason A. Donenfeld" To: netdev@vger.kernel.org, davem@davemloft.net Cc: "Jason A. Donenfeld" Subject: [PATCH net 2/4] socionext: account for napi_gro_receive never returning GRO_DROP Date: Wed, 24 Jun 2020 16:06:04 -0600 Message-Id: <20200624220606.1390542-3-Jason@zx2c4.com> In-Reply-To: <20200624220606.1390542-1-Jason@zx2c4.com> References: <20200624220606.1390542-1-Jason@zx2c4.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The napi_gro_receive function no longer returns GRO_DROP ever, making handling GRO_DROP dead code. This commit removes that dead code. Further, it's not even clear that device drivers have any business in taking action after passing off received packets; that's arguably out of their hands. Fixes: 6570bc79c0df ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()") Signed-off-by: Jason A. Donenfeld --- drivers/net/ethernet/socionext/netsec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 328bc38848bb..0f366cc50b74 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -1044,8 +1044,9 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget) skb->ip_summed = CHECKSUM_UNNECESSARY; next: - if ((skb && napi_gro_receive(&priv->napi, skb) != GRO_DROP) || - xdp_result) { + if (skb) + napi_gro_receive(&priv->napi, skb); + if (skb || xdp_result) { ndev->stats.rx_packets++; ndev->stats.rx_bytes += xdp.data_end - xdp.data; } From patchwork Wed Jun 24 22:06:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 191713 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp240054ilg; Wed, 24 Jun 2020 15:06:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaz2Tl4bu4Nc8PycwC0uKU8MeIOgE4ejt2Kp6DQZlfUKD1gMPUOWRd5OOYphAnM+tg7pW5 X-Received: by 2002:a05:6402:1ca2:: with SMTP id cz2mr27637774edb.15.1593036383942; Wed, 24 Jun 2020 15:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036383; cv=none; d=google.com; s=arc-20160816; b=ZBSMo1QMZa4w1GwowErJY4dhFyFNz7MKI5vlQJZKG/aiWNBXxML37Uq11VPEmKXghH CyU0iQ+NSQ8Dyy0H4wQ7TwYjsK2BrQXtBPsYb74qUPgbNAew0RS5aYcjFgRHJI03ACje 65wewbQnIsI3KOzB6TKj2V9aHFiuVbAsDFpWEnqDfbcp3Kd1DLWSP7bpRNpKHjUazEAr qbZ7DUFv0QVdL4va9CxxJkYprw4yCygh8VhoAr4ag8n01HG2uErE7LvHhN3bUhaAYRRj UIS9pzv9vu8tCFEH6bqsa/dZwWMsVhn5HwVLVdr3+bh8GIjFZ37xNPr9oPycSC93s5gr PBbQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nVI3tNFYc9VW8T9pdAkjbyo2Sl/Gt6ztcx6TyFnW4Zw=; b=hcXcEdCqwzWjeVpfNWB+f6BQvBrgRGeHi3DVGakMesntHwmm8eONUGHLd2Y6+UhW0P P9kqEyXvQ2oQl33ZJu5QWoGmrsEERITa6VOt1IQeT0eKEr3Z1tIX6nr8vwJHCNQpdssy 5DfSElLuerObC/GDFp+Ne4M+nby4tVt/MVGCoeYVkOKBklYzQDmNhx5/MVtYXm99dsjh aWmHGJp9FoQ71OVVEJnFdi+UI0MmJgr0e+vkayTL+BF32Jq7Gqg569Rc4Dzquy4Js9uO 7OdLgXF2mnse8lErovEBd22tslD7h8finx3EN50QceQ8o/H2hvszVwzaDsbX4KvKKxfz Cz5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=fIQ1mC3J; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca21si6832787edb.533.2020.06.24.15.06.23; Wed, 24 Jun 2020 15:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=fIQ1mC3J; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389513AbgFXWGW (ORCPT + 9 others); Wed, 24 Jun 2020 18:06:22 -0400 Received: from mail.zx2c4.com ([192.95.5.64]:37289 "EHLO mail.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389453AbgFXWGT (ORCPT ); Wed, 24 Jun 2020 18:06:19 -0400 Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 21483d94; Wed, 24 Jun 2020 21:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=mail; bh=PMSW1JxYMnQhk8qd60Y9kOgVp eM=; b=fIQ1mC3JvgjY9VSaMhXmHUV/x6zWN8RCPRM99WCTZRw4KZdCNuJAt0YJq i4hzHZ4C3giwOSudSZOotsyoVmi57FpEZCymmrqp11smg5AwPSLe1uI+D0Rzfvq4 Zxlmkdw/b3c82Az5rcBmdEuyh8Dayk5LTnguC2EEGfSPiGPybyOkQK4iSKtKRS/6 qaVmcJvAd/65icLDLpVGEOgOvZrEBWY3w9F1+yYuoTmdTc+pQDyxGAYI1K3lpvDM A2nD6zPUKS0tgNVka6RZyCgn2W4TrqQOhTV+6N6TkY3bm8u4Ls03CGUcLBWoQOXH 7mL/aID0K4zyqB8S6pCfWYiQfEm1w== Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 557d7f39 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jun 2020 21:47:13 +0000 (UTC) From: "Jason A. Donenfeld" To: netdev@vger.kernel.org, davem@davemloft.net Cc: "Jason A. Donenfeld" Subject: [PATCH net 3/4] hns: do not cast return value of napi_gro_receive to null Date: Wed, 24 Jun 2020 16:06:05 -0600 Message-Id: <20200624220606.1390542-4-Jason@zx2c4.com> In-Reply-To: <20200624220606.1390542-1-Jason@zx2c4.com> References: <20200624220606.1390542-1-Jason@zx2c4.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Basically no drivers care about the return value here, and there's no __must_check that would make casting to void sensible, so remove it. Signed-off-by: Jason A. Donenfeld --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.27.0 diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index c117074c16e3..23f278e46975 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -699,7 +699,7 @@ static void hns_nic_rx_up_pro(struct hns_nic_ring_data *ring_data, struct net_device *ndev = ring_data->napi.dev; skb->protocol = eth_type_trans(skb, ndev); - (void)napi_gro_receive(&ring_data->napi, skb); + napi_gro_receive(&ring_data->napi, skb); } static int hns_desc_unused(struct hnae_ring *ring) From patchwork Wed Jun 24 22:06:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 191714 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp240140ilg; Wed, 24 Jun 2020 15:06:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweQxDSx+0q7e8AO9oCNW2jD2zVA7hJUtSTiT7eg88Ago8jFW7sU0ZsWU1BW89FZEiXjQ5h X-Received: by 2002:a17:906:c459:: with SMTP id ck25mr18620684ejb.177.1593036392310; Wed, 24 Jun 2020 15:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036392; cv=none; d=google.com; s=arc-20160816; b=fvZbVnbvxu+dxY6HvLjP4HqJVhSIgTG9SZgnOOwd4mTfsrIOkFBquoN6mLJuLvGP8w OJunhYp+Br2pPlnDDWuNTOe/MTFXsa56b8gHYlhPgQb7e2THG0CkctskcpKSkFeBPKg+ wt8SHS42akOne9jyk+DmmuMaHMVSkikFUjg3OB6dkbMhFRtisipa1sRJ5W33+ul/UZ36 iH23b3H0wznLnguF93D42WtFQpkN72D514sKCTDdpHa174YNhBJamkMaaBR/o47yIDGQ uSsxBk1UUrlIwls/eh/b/9TNXH19iUbLEvbdn+F6r9aNCxqHXhCZs1cNVUd//F9kRvhT nmbw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5LsE1RbuFBNCmAud/AXlgSm/A0DXJ/ShmWdOKO+eQaI=; b=HJuPy+g+zaOsbxdtYSr17Q9XO8sMQdI4CIr4gy5Kg+OyuGFWIr7oeQ7rJ+hHjHQZUx 2yG8Cih4JUTGYIn6EdwgIVRNOtQls+b6YCK9BKQL/T+1QYQfHTwAwKwpKHHmtLexiPc5 xWLd6YY+Ua7d2a0o++C5dp/V5ZWQJxT2LfygZHActOZdnKBkaCwgNpKiC8f39RLcyqU1 x7LBwsVqBv6LDZEj5pZiQT/RLx1Tqw6DW9mXfbQ9mEfgdVhZgqR9oqn03DGniKLq6fTl vafhiXDg3u0gM21F2SkZpZyfv6OuVYzArnq+U1tpqWAVOYVLuOjWkj4s2HClWFqqwVMU JJog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=dIrvSI0c; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id va29si14357935ejb.235.2020.06.24.15.06.32; Wed, 24 Jun 2020 15:06:32 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=dIrvSI0c; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389997AbgFXWGZ (ORCPT + 9 others); Wed, 24 Jun 2020 18:06:25 -0400 Received: from mail.zx2c4.com ([192.95.5.64]:37289 "EHLO mail.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389522AbgFXWGV (ORCPT ); Wed, 24 Jun 2020 18:06:21 -0400 Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTP id c7740185; Wed, 24 Jun 2020 21:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=mail; bh=PTK10ChOSlmzM9Yfrj6GYKHJz yc=; b=dIrvSI0care4Ys/MHePuvJGjcFmjd3o1ipGaZ0lFITXLKLcv7gflJg+va kfFPSbEeLeN4nwnyk2ER2WyDgdil0Tg/rTDQDxHnA74dsj7ChTXVuiYXj0a+J3Qp Ab1iSsguMx99g7CjhDbguzuhcaIJa26h8bodYwjNnZNssTKTwzu5EcwDeGvXwbjU /D5WPnAs4YEmS5tmS7KChAXLmfPFO/OhaUV5fRButbDdmTSS/eDzIQTCjDXj5v9m rsVqLLjofXm78Fa1752wYxaMnuY35dUtUqXWJZCT8MBFSLBzpD1yPOn/c/BD5/DZ tWSkSuhZsNfhlVJN/YpIA3lrZ9xig== Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 0aa511e2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jun 2020 21:47:14 +0000 (UTC) From: "Jason A. Donenfeld" To: netdev@vger.kernel.org, davem@davemloft.net Cc: "Jason A. Donenfeld" Subject: [PATCH net 4/4] wil6210: account for napi_gro_receive never returning GRO_DROP Date: Wed, 24 Jun 2020 16:06:06 -0600 Message-Id: <20200624220606.1390542-5-Jason@zx2c4.com> In-Reply-To: <20200624220606.1390542-1-Jason@zx2c4.com> References: <20200624220606.1390542-1-Jason@zx2c4.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The napi_gro_receive function no longer returns GRO_DROP ever, making handling GRO_DROP dead code. This commit removes that dead code. Further, it's not even clear that device drivers have any business in taking action after passing off received packets; that's arguably out of their hands. In this case, too, the non-gro path didn't bother checking the return value. Plus, this had some clunky debugging functions that duplicated code from elsewhere and was generally pretty messy. So, this commit cleans that all up too. Fixes: 6570bc79c0df ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()") Signed-off-by: Jason A. Donenfeld --- drivers/net/wireless/ath/wil6210/txrx.c | 39 +++++++------------------ 1 file changed, 11 insertions(+), 28 deletions(-) -- 2.27.0 diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index bc8c15fb609d..080e5aa60bea 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -897,7 +897,6 @@ static void wil_rx_handle_eapol(struct wil6210_vif *vif, struct sk_buff *skb) void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid, struct wil_net_stats *stats, bool gro) { - gro_result_t rc = GRO_NORMAL; struct wil6210_vif *vif = ndev_to_vif(ndev); struct wil6210_priv *wil = ndev_to_wil(ndev); struct wireless_dev *wdev = vif_to_wdev(vif); @@ -908,22 +907,16 @@ void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid, */ int mcast = is_multicast_ether_addr(da); struct sk_buff *xmit_skb = NULL; - static const char * const gro_res_str[] = { - [GRO_MERGED] = "GRO_MERGED", - [GRO_MERGED_FREE] = "GRO_MERGED_FREE", - [GRO_HELD] = "GRO_HELD", - [GRO_NORMAL] = "GRO_NORMAL", - [GRO_DROP] = "GRO_DROP", - [GRO_CONSUMED] = "GRO_CONSUMED", - }; if (wdev->iftype == NL80211_IFTYPE_STATION) { sa = wil_skb_get_sa(skb); if (mcast && ether_addr_equal(sa, ndev->dev_addr)) { /* mcast packet looped back to us */ - rc = GRO_DROP; dev_kfree_skb(skb); - goto stats; + ndev->stats.rx_dropped++; + stats->rx_dropped++; + wil_dbg_txrx(wil, "Rx drop %d bytes\n", len); + return; } } else if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate) { if (mcast) { @@ -967,26 +960,16 @@ void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid, wil_rx_handle_eapol(vif, skb); if (gro) - rc = napi_gro_receive(&wil->napi_rx, skb); + napi_gro_receive(&wil->napi_rx, skb); else netif_rx_ni(skb); - wil_dbg_txrx(wil, "Rx complete %d bytes => %s\n", - len, gro_res_str[rc]); - } -stats: - /* statistics. rc set to GRO_NORMAL for AP bridging */ - if (unlikely(rc == GRO_DROP)) { - ndev->stats.rx_dropped++; - stats->rx_dropped++; - wil_dbg_txrx(wil, "Rx drop %d bytes\n", len); - } else { - ndev->stats.rx_packets++; - stats->rx_packets++; - ndev->stats.rx_bytes += len; - stats->rx_bytes += len; - if (mcast) - ndev->stats.multicast++; } + ndev->stats.rx_packets++; + stats->rx_packets++; + ndev->stats.rx_bytes += len; + stats->rx_bytes += len; + if (mcast) + ndev->stats.multicast++; } void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)