From patchwork Fri Mar 24 17:08:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander H Duyck X-Patchwork-Id: 743290 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vqVKq4zxgz9s7c for ; Sat, 25 Mar 2017 04:10:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gdfdvn/w"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936977AbdCXRIN (ORCPT ); Fri, 24 Mar 2017 13:08:13 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33191 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934993AbdCXRIC (ORCPT ); Fri, 24 Mar 2017 13:08:02 -0400 Received: by mail-pg0-f68.google.com with SMTP id 79so1554957pgf.0; Fri, 24 Mar 2017 10:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=TPvxV4SSm9T7vVCscBu+Gxm+Sy0QIr9Pif9ZX5Y3LSg=; b=gdfdvn/wSnBOeU2xV7CJD5/dYngVqUJVMmYrvYzqR3LR5KdJEfYB7+BNQUx4EShkk9 AyX2xB2JLtTLEV7aInXT8jZWKOsYaAsUu/MlDuZYOK20Pv9zyDSh6Kv8HRo1OImsjJwd eAGHMDd7EnqOMEC3kPPNI9X2dv6kq5NO2ci19vDWC7QNKPohvzPamOWPg4vUDWQlSO3X RucYtXpDpTmECNhjHRh95BU1ugzodoUgweNNcMmJNDE6lJAGkviKEp2qt9UHyYxCMLMX V37BJOafDWrGcRvU+8/vCefjdEt5kPVE76AQI3yOMBqBuestZc37ByiaT6BhReiwlYHK 3Dag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=TPvxV4SSm9T7vVCscBu+Gxm+Sy0QIr9Pif9ZX5Y3LSg=; b=Xb74lcVQR5q3yAxCFedw6UoDWQHsqWTFQ1Sts75H62QG6S7OmZa47y/iaVRZ6q34rC ROUI/wWy12uHigJrXe2qvQRgqGTJlD1hk2LOho3RGkGfyWaqStADcmN/ykwb3oSWPGDl ejq/5EtTGC8IJVU0g+Y1Gc9nSKhK9PAPRB5VmEX/aOkTSeVm5tyr2U5Mn7nOBh8YoLqv eaeEUtulKhDIWHNCmUUJPKMCw3TMUmNUaQb98e+DhksmGbKQeQapLFvrbuJQ8OYdf/vC JjVdnxSVTIgyagtWU0k3z1Xx2CHfxWkBcRvpGfKqw0NNDVobbES2O0XQVB8UD8WrOd0H ubXQ== X-Gm-Message-State: AFeK/H0C3mEk/g4Z9oy7O+VgxszF93FHq1SkAeYvPHPBg4uKpTkMkOFkZoqyOkaJBi4XsA== X-Received: by 10.98.76.91 with SMTP id z88mr10400806pfa.14.1490375281366; Fri, 24 Mar 2017 10:08:01 -0700 (PDT) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id 123sm5803458pgh.21.2017.03.24.10.08.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 10:08:00 -0700 (PDT) Subject: [net-next PATCH v3 2/8] tcp: Record Rx hash and NAPI ID in tcp_child_process From: Alexander Duyck To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: sridhar.samudrala@intel.com, edumazet@google.com, davem@davemloft.net, linux-api@vger.kernel.org Date: Fri, 24 Mar 2017 10:08:00 -0700 Message-ID: <20170324170759.15226.35135.stgit@localhost.localdomain> In-Reply-To: <20170324164902.15226.48358.stgit@localhost.localdomain> References: <20170324164902.15226.48358.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Alexander Duyck While working on some recent busy poll changes we found that child sockets were being instantiated without NAPI ID being set. In our first attempt to fix it, it was suggested that we should just pull programming the NAPI ID into the function itself since all callers will need to have it set. In addition to the NAPI ID change I have dropped the code that was populating the Rx hash since it was actually being populated in tcp_get_cookie_sock. Reported-by: Sridhar Samudrala Signed-off-by: Alexander Duyck Acked-by: Eric Dumazet --- net/ipv4/tcp_ipv4.c | 2 -- net/ipv4/tcp_minisocks.c | 4 ++++ net/ipv6/tcp_ipv6.c | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 7482b5d11861..20cbd2f07f28 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1409,8 +1409,6 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) if (!nsk) goto discard; if (nsk != sk) { - sock_rps_save_rxhash(nsk, skb); - sk_mark_napi_id(nsk, skb); if (tcp_child_process(sk, nsk, skb)) { rsk = nsk; goto reset; diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 692f974e5abe..40f125b19988 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -26,6 +26,7 @@ #include #include #include +#include int sysctl_tcp_abort_on_overflow __read_mostly; @@ -798,6 +799,9 @@ int tcp_child_process(struct sock *parent, struct sock *child, int ret = 0; int state = child->sk_state; + /* record NAPI ID of child */ + sk_mark_napi_id(child, skb); + tcp_segs_in(tcp_sk(child), skb); if (!sock_owned_by_user(child)) { ret = tcp_rcv_state_process(child, skb); diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0f08d718a002..ee13e380c0dd 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1293,8 +1293,6 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) goto discard; if (nsk != sk) { - sock_rps_save_rxhash(nsk, skb); - sk_mark_napi_id(nsk, skb); if (tcp_child_process(sk, nsk, skb)) goto reset; if (opt_skb)