From patchwork Sat Sep 17 17:35:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neal Cardwell X-Patchwork-Id: 671240 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 3sbzpk72nkz9ryr for ; Sun, 18 Sep 2016 03:36:30 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=Dt/WBfDd; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754238AbcIQRg1 (ORCPT ); Sat, 17 Sep 2016 13:36:27 -0400 Received: from mail-qt0-f181.google.com ([209.85.216.181]:33107 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754105AbcIQRgQ (ORCPT ); Sat, 17 Sep 2016 13:36:16 -0400 Received: by mail-qt0-f181.google.com with SMTP id 11so56230604qtc.0 for ; Sat, 17 Sep 2016 10:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hECiR/hatuLug6EiduqcLuqFKxQKe627d5pXLMUqzdY=; b=Dt/WBfDd/Cct/1xbWeSB/hnSWu2BdToWIoaXb4LIRreLcFpMdv8GQ9n/2P9KgkcA33 bjs/JcMwwMJcw/0RM5Z8PtHOvyIQhh7Zg/rYWhdjWNSxsm1PH8b4Jla0kMPQcQyyEnra dS+KUaXogQ0OW9CDzhFyCg59sA9D9/WP/jxgPXfMGNoZW/kXQPFm9j2U9Opg8L/VL95z orT0tHKsMkQtQr3zx+lmlS2iYZGRjvMlzRTrH6DhwJDmwyc7FLYK8WGXJiM57khj/To4 q7Yu7hpVIsmUTF9aiNhyePanJ3YL6Te0rEX+F20FUk3Ypyg3CrI12T5SVGr2wlP1jeZt GDOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hECiR/hatuLug6EiduqcLuqFKxQKe627d5pXLMUqzdY=; b=KZEWZbba+d4LmNmoCLvV8rgNDTiJZpetcZBp6Cs028ChQMGMI7+scbw1zkXY3GUp62 A44dKPChd3uiKvBzXN4kVhIdKzNTHTH0XBpQcIIvK+jkC0gkO+LmJf0Un4oOfk17ZpVc Zw12P2RqcxB8vl9znj4kOvvhjFQr70AenjJRTPhD6oedXvV6O6EW7+VHmr8PebtefPxz qmUp5oUdRCfFRkoQ9byWAHpXln7WQwhkmP3LXdjp+zoEaZE9F9tKEFeDk0oK43Usa246 jerHS02PXb/qZwjKP4aLhdrrzfa7AshPH8u782NoXzOp9BqZKLez3x8+VOfDFPntnhes hSng== X-Gm-Message-State: AE9vXwOy6+DPTfQ7ht6f/qcjOlgCLD53GrCxg+prx3JM02JspXevfX8xrXcuJyGkwr56QQob X-Received: by 10.200.41.243 with SMTP id 48mr21553592qtt.20.1474133775165; Sat, 17 Sep 2016 10:36:15 -0700 (PDT) Received: from joy.nyc.corp.google.com ([100.101.230.104]) by smtp.gmail.com with ESMTPSA id t21sm8068625qkg.4.2016.09.17.10.36.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 17 Sep 2016 10:36:14 -0700 (PDT) From: Neal Cardwell To: David Miller Cc: netdev@vger.kernel.org, Eric Dumazet , Soheil Hassas Yeganeh , Neal Cardwell , Yuchung Cheng Subject: [PATCH v2 net-next 05/16] tcp: switch back to proper tcp_skb_cb size check in tcp_init() Date: Sat, 17 Sep 2016 13:35:38 -0400 Message-Id: <1474133749-12895-6-git-send-email-ncardwell@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1474133749-12895-1-git-send-email-ncardwell@google.com> References: <1474133749-12895-1-git-send-email-ncardwell@google.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet Revert to the tcp_skb_cb size check that tcp_init() had before commit b4772ef879a8 ("net: use common macro for assering skb->cb[] available size in protocol families"). As related commit 744d5a3e9fe2 ("net: move skb->dropcount to skb->cb[]") explains, the sock_skb_cb_check_size() mechanism was added to ensure that there is space for dropcount, "for protocol families using it". But TCP is not a protocol using dropcount, so tcp_init() doesn't need to provision space for dropcount in the skb->cb[], and thus we can revert to the older form of the tcp_skb_cb size check. Doing so allows TCP to use 4 more bytes of the skb->cb[] space. Fixes: b4772ef879a8 ("net: use common macro for assering skb->cb[] available size in protocol families") Signed-off-by: Eric Dumazet Signed-off-by: Soheil Hassas Yeganeh Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng --- net/ipv4/tcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 5b0b49c..53798e1 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3244,11 +3244,12 @@ static void __init tcp_init_mem(void) void __init tcp_init(void) { - unsigned long limit; int max_rshare, max_wshare, cnt; + unsigned long limit; + struct sk_buff *skb; unsigned int i; - sock_skb_cb_check_size(sizeof(struct tcp_skb_cb)); + BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb)); percpu_counter_init(&tcp_sockets_allocated, 0, GFP_KERNEL); percpu_counter_init(&tcp_orphan_count, 0, GFP_KERNEL);