From patchwork Mon Oct 25 22:13:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12583053 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCFB3C433FE for ; Mon, 25 Oct 2021 22:13:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0CF960F70 for ; Mon, 25 Oct 2021 22:13:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233243AbhJYWQM (ORCPT ); Mon, 25 Oct 2021 18:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232817AbhJYWQM (ORCPT ); Mon, 25 Oct 2021 18:16:12 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B33BC061745 for ; Mon, 25 Oct 2021 15:13:49 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id t11so8867548plq.11 for ; Mon, 25 Oct 2021 15:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yxG4+xzDXI12+XDNxP2xEzoUnFRzWOWw6t0IGnV6Cbg=; b=OLVn0GfCYMbqKpmogH9rbCKyAqAh5b/0Uqi9/JgeVLBjphcR2P5Vgktb9H4qBq8KGe husPyKfuozSKcplrZrte0QisyjWwtDB6ajjtbA+p6A++ZHepoQ+/7TBmtt3xXdNxCCTO wTHEJyh+Orr+XHUhVQgfERKqxp0J/L0vySOXikKaD9JVssfefg4W6QurIgzqUTCmlutp vS2IChvATW2pV7kgvupYc4NtgF6vO2jXP3tDJQhHApAqbG30USQ7oBEoD7iwLHAG6mxg AZheUf5S/S1xtvAwRd104KlaXED6Po6P2GxiQCdqNCSIVBb3AfCkrXsd8Faalq50RVKV bRiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yxG4+xzDXI12+XDNxP2xEzoUnFRzWOWw6t0IGnV6Cbg=; b=geAsHcDbdPoNw0Q6YmGwZSNaBxtz9RT9Q+zH4BFNvasoTdUo/gc3qqdRyzfImO76YO Q69zAw2yDu/7t3h4m0LTs7UTzXT82wHCmMnkiB6r2ZK0Bqb1u13aE1mQ1aoU39PkgrF/ m9PoVVh6lmKayax0WzyuZ1TCJtcAPPeTg9yzBe4Nf0cOtq1F2X5SVBvb4i6D2ax93aCS ajZ7A5ExNAbJ3cv6rzvz0NPYp0y4pK3Y46ctcs8g74QzGLkXj4t+4RZauYu7Ote6C6F9 L7BTRL4pmyF0l2KO8mVIfwgHmUwpj129owW/I5Pi1xOMJAjJQXBNsanRVOCw3LawR+MS n2PQ== X-Gm-Message-State: AOAM531EGEBECknrPeIYZ0sqP8gCayUek0AQwlPfuIkN8uYnR3ECCnPO nbVgeI7Xg8GfVTvCmyqIxpq1qzG0sEI= X-Google-Smtp-Source: ABdhPJxgPIp7gFQKppkYPHAytTPfX1nvAyLrwpzCsps2JtPEX5UVPFcEkBIfBARcvyO4Z5Bp+dYefg== X-Received: by 2002:a17:90b:4b06:: with SMTP id lx6mr37840012pjb.220.1635200028992; Mon, 25 Oct 2021 15:13:48 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:b7cd:daa3:a144:1652]) by smtp.gmail.com with ESMTPSA id f15sm22351108pfe.132.2021.10.25.15.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 15:13:48 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Soheil Hassas Yeganeh , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 3/3] tcp: remove unneeded code from tcp_stream_alloc_skb() Date: Mon, 25 Oct 2021 15:13:42 -0700 Message-Id: <20211025221342.806029-4-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211025221342.806029-1-eric.dumazet@gmail.com> References: <20211025221342.806029-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet Aligning @size argument to 4 bytes is not needed. The header alignment has nothing to do with @size. It really depends on skb->head alignment and MAX_TCP_HEADER. Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh --- net/ipv4/tcp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 121400557fde898283a8eae3b09d93479c4a089e..0a27b7ef1a9db8aea8d98cff4b8ab7092994febd 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -861,9 +861,6 @@ struct sk_buff *tcp_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp, { struct sk_buff *skb; - /* The TCP header must be at least 32-bit aligned. */ - size = ALIGN(size, 4); - if (unlikely(tcp_under_memory_pressure(sk))) sk_mem_reclaim_partial(sk);