From patchwork Tue Apr 28 18:24:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 226816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BA91C83000 for ; Tue, 28 Apr 2020 18:49:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CCDC20575 for ; Tue, 28 Apr 2020 18:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099780; bh=a7WLY2vyVTy/LLORuijc1xT8Cr1/9sL3V1qrgS6OCfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SUhg6fQpQETJMDq3iFNytq9+rDIk1GV2IO0XTSP5unz1ck2DDxQQABaAkB+Fr42cm 2Av5bEzrGLKODgd6e468+o0lZPTvpoatuEEOXwJPXpGwm8CjZ6Hg59a/qTApm8keMe 7IqkYn5viUCHMwx1LIODJZcpY2+txZ2Ju8xwQ3sc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730871AbgD1Sj4 (ORCPT ); Tue, 28 Apr 2020 14:39:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:58896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730125AbgD1Sjz (ORCPT ); Tue, 28 Apr 2020 14:39:55 -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 AF2A92085B; Tue, 28 Apr 2020 18:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099195; bh=a7WLY2vyVTy/LLORuijc1xT8Cr1/9sL3V1qrgS6OCfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sV5x0Vb3v0Ee3S0o9XMSAgJVKpuqVJhzGngxUbuvaq6mK4MT/hdkJCipFTQ2dpzJE BQlRm7t/3dkSzrjrTpUasSgMqgcw1YktAqC2YB+ni0T0sQLkvzDEAZxtX3xDpP2Cln sYKbSAqwdLpzS2J5xGPlS57L6AX7C4/T3XjQ93Ic= 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 5.4 071/168] tcp: cache line align MAX_TCP_HEADER Date: Tue, 28 Apr 2020 20:24:05 +0200 Message-Id: <20200428182240.965775655@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428182231.704304409@linuxfoundation.org> References: <20200428182231.704304409@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -50,7 +50,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)