Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp702792ybz; Fri, 1 May 2020 07:05:15 -0700 (PDT) X-Google-Smtp-Source: APiQypJ+Q82YjsBFWQjobk5zaVzjABvVPVlAdTeRsC6ebjPd7aPbJGnir1CXS9QK5AcRXAuzWAFs X-Received: by 2002:aa7:c608:: with SMTP id h8mr3770077edq.232.1588341915407; Fri, 01 May 2020 07:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588341915; cv=none; d=google.com; s=arc-20160816; b=Joaqa2rUfnQjQWgJZ0yMrAP/4IoEuJPRhKPzhlveG5qb4qgwYoN9/6wWAXxd+7rlkr CaWR6ag3gV5/usInZj2136by1XeJIYrSqvboXOYUaYcJw4kFpGBOGGZQ+d0MBHrQW3DS JyOFooCd6EWlMYRIHu3MD79+fnod+eG778eYe2JO5vgcYsQ9p968q74A+kNZOC1B81g0 29Ej+aoRzdJuXiIV7HDAecleYqFxJMHlg77Qikx9UF45C88KV3ElhdJNpw4EWO3piae6 DUFP8BmrDPtkM6EvSUqpf8i1GdReTQkodtUJWT5gNvX8ZOMSWhO6uXlDSA2WGHL4ot6Z Ycgg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=L9+btYY/MiDCyFErdCIexBRwET+CBm3koJqXqQc0WDU=; b=mefT7ufihVQ1xONY6S1ErjIDUR5rtCCafxp9LQdok3QZWlfvc3mupBOy+QnsWtMroB K9k6Ak5WDD4ljwUNWQQKEg1dyQ55W9USqoETqtLiH2r/t0+DN0wH/it1o5SreIrQRS4O /N2wIgLK9nBNHthb5A48NysZXosZupJPTzXCJr//FBmchhSPdaUy1QOikqL7BgUfCyiJ Y7is8Q4ji9h71uB7kOFkPmqGx9Pciroeo/FoeifNzFzNCA+uhU/RCqfuquuH/qT9ZW8T rgup//8gSVIgN01Tw3OwtUtvbxME0Hl47TyouVxc2LXa/9iQM4DGQYcMw2oTGbuot9PD aiog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h9HCxwMM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si1613233ejs.396.2020.05.01.07.04.49; Fri, 01 May 2020 07:05:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=default header.b=h9HCxwMM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729941AbgEAOBu (ORCPT + 99 others); Fri, 1 May 2020 10:01:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:46204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728993AbgEANZU (ORCPT ); Fri, 1 May 2020 09:25:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D0542495E; Fri, 1 May 2020 13:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588339519; bh=FIl5LxAo3sAnFk0EG7vW2iQiLwXy00fRa5v3cZeQbw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h9HCxwMM7KTfm6JDv1eiyc0pKGBSAQ3ljJ2/JgRX9P19zJKBcowVlWdfskJNWEt9P 5zygeIKArbCRLDqbPqoza/VQidKPNQCsI26HMo9XNuJQnQc7rICmVYHIzIDmvqEKTQ yPXZvxFi+fwe/N5ton//6e5C7tul3wI+YcPGovyc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Soheil Hassas Yeganeh , "David S. Miller" Subject: [PATCH 4.4 22/70] tcp: cache line align MAX_TCP_HEADER Date: Fri, 1 May 2020 15:21:10 +0200 Message-Id: <20200501131521.123720775@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131513.302599262@linuxfoundation.org> References: <20200501131513.302599262@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet [ Upstream commit 9bacd256f1354883d3c1402655153367982bba49 ] TCP stack is dumb in how it cooks its output packets. Depending on MAX_HEADER value, we might chose a bad ending point for the headers. If we align the end of TCP headers to cache line boundary, we make sure to always use the smallest number of cache lines, which always help. Signed-off-by: Eric Dumazet Cc: Soheil Hassas Yeganeh Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/tcp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -52,7 +52,7 @@ extern struct inet_hashinfo tcp_hashinfo extern struct percpu_counter tcp_orphan_count; void tcp_time_wait(struct sock *sk, int state, int timeo); -#define MAX_TCP_HEADER (128 + MAX_HEADER) +#define MAX_TCP_HEADER L1_CACHE_ALIGN(128 + MAX_HEADER) #define MAX_TCP_OPTION_SPACE 40 #define TCP_MIN_SND_MSS 48 #define TCP_MIN_GSO_SIZE (TCP_MIN_SND_MSS - MAX_TCP_OPTION_SPACE)