From patchwork Tue Aug 25 23:33:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lawrence Brakmo X-Patchwork-Id: 510674 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 A7638140332 for ; Wed, 26 Aug 2015 09:34:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.b=FpYlqjAQ; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932928AbbHYXe3 (ORCPT ); Tue, 25 Aug 2015 19:34:29 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:44598 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932660AbbHYXe0 (ORCPT ); Tue, 25 Aug 2015 19:34:26 -0400 Received: from pps.filterd (m0004003 [127.0.0.1]) by mx0b-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id t7PNXhB9014675 for ; Tue, 25 Aug 2015 16:34:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=Pm5E/qsn2ESiJynMLjqHtj0jWMXv9w8HMTsPbzs+a4I=; b=FpYlqjAQwWdOvinkHQmdo3DajAd1zztl25DTJRSMT3M6w6zwoSotZoH6eDTLrZQaH88S HTNNJ2bNSQayyzFcxlGYdRaWG1B9xIVAGZZEOHTeDeK9yZ3G9yf8iN9lEZBb3bcO2olI va2h06kpTlWyw2PtDVm+Pk1f9QblnVjHJ1Q= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 1wh1tfg2c2-3 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Tue, 25 Aug 2015 16:34:26 -0700 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB08.TheFacebook.com (192.168.16.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 25 Aug 2015 16:34:24 -0700 Received: from facebook.com (2401:db00:20:a00f:face:0:16:0) by mx-out.facebook.com (10.223.101.97) with ESMTP id d00fd6ea4b8111e59d8e24be0595f910-89bfa240 for ; Tue, 25 Aug 2015 16:34:22 -0700 Received: by devbig294.prn2.facebook.com (Postfix, from userid 10340) id 17C581AC0BAA; Tue, 25 Aug 2015 16:34:21 -0700 (PDT) From: Lawrence Brakmo To: netdev CC: Kernel Team , Neal Cardwell , Eric Dumazet , Yuchung Cheng , Stephen Hemminger , Kenneth Klette Jonassen Subject: [RFC PATCH v6 net-next 2/4] tcp: refactor struct tcp_skb_cb Date: Tue, 25 Aug 2015 16:33:52 -0700 Message-ID: <1440545634-3901299-3-git-send-email-brakmo@fb.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1440545634-3901299-1-git-send-email-brakmo@fb.com> References: <1440545634-3901299-1-git-send-email-brakmo@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151, 1.0.33, 0.0.0000 definitions=2015-08-25_09:2015-08-24, 2015-08-25, 1970-01-01 signatures=0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Refactor tcp_skb_cb to create two overlaping areas to store state for incoming or outgoing skbs based on comments by Neal Cardwell to tcp_nv patch: AFAICT this patch would not require an increase in the size of sk_buff cb[] if it were to take advantage of the fact that the tcp_skb_cb header.h4 and header.h6 fields are only used in the packet reception code path, and this in_flight field is only used on the transmit side. Signed-off-by: Lawrence Brakmo Acked-by: Yuchung Cheng --- include/net/tcp.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 0121529..a086a98 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -755,11 +755,16 @@ struct tcp_skb_cb { /* 1 byte hole */ __u32 ack_seq; /* Sequence number ACK'd */ union { - struct inet_skb_parm h4; + struct { + /* There is space for up to 20 bytes */ + } tx; /* only used for outgoing skbs */ + union { + struct inet_skb_parm h4; #if IS_ENABLED(CONFIG_IPV6) - struct inet6_skb_parm h6; + struct inet6_skb_parm h6; #endif - } header; /* For incoming frames */ + } header; /* For incoming skbs */ + }; }; #define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0]))