From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vakul Garg Subject: Re: [net-next v5 3/3] net/tls: Remove redundant array allocation. Date: Tue, 24 Jul 2018 04:43:55 +0000 Message-ID: References: <20180719162613.27184-4-vakul.garg@nxp.com> <20180721.192532.520509909556885779.davem@davemloft.net> <20180723163509.GA91424@davejwatson-mba.local>,<20180723.214109.32924668491950691.davem@davemloft.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_DB7PR04MB4252DEFEDC63C40EF287F22D8B550DB7PR04MB4252eurp_" Cc: "netdev@vger.kernel.org" , "borisp@mellanox.com" , "aviadye@mellanox.com" , "doronrk@fb.com" To: "davejwatson@fb.com" , David Miller Return-path: Received: from mail-eopbgr50060.outbound.protection.outlook.com ([40.107.5.60]:25564 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388166AbeGXFsd (ORCPT ); Tue, 24 Jul 2018 01:48:33 -0400 In-Reply-To: <20180723.214109.32924668491950691.davem@davemloft.net> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: --_000_DB7PR04MB4252DEFEDC63C40EF287F22D8B550DB7PR04MB4252eurp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Dave Can you still apply the rest of two patches in the series or do I need to s= end them again separately? Regards Vakul ________________________________ From: netdev-owner@vger.kernel.org on behalf= of David Miller Sent: Tuesday, July 24, 2018 10:11:09 AM To: davejwatson@fb.com Cc: Vakul Garg; netdev@vger.kernel.org; borisp@mellanox.com; aviadye@mellan= ox.com; doronrk@fb.com Subject: Re: [net-next v5 3/3] net/tls: Remove redundant array allocation. From: Dave Watson Date: Mon, 23 Jul 2018 09:35:09 -0700 > I don't think this patch is safe as-is. sgin_arr is a stack array of > size MAX_SKB_FRAGS (+ overhead), while my read of skb_cow_data is that > it walks the whole chain of skbs from skb->next, and can return any > number of segments. Therefore we need to heap allocate. I think I > copied the IPSEC code here. Ok I see what you are saying. So it means that, when a non-NULL sgout is passed into decrypt_skb(), via decrypt_skb_update(), via tls_sw_recvmsg() it means that it is the zerocopy case and you know that you only have page frags and no SKB frag list, right? I agree with you that this change is therefore incorrect. --_000_DB7PR04MB4252DEFEDC63C40EF287F22D8B550DB7PR04MB4252eurp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi Dave

Can you still apply the rest of two patches in the series or do I need to s= end them again separately?

Regards

Vakul



From: netdev-owner@vger.k= ernel.org <netdev-owner@vger.kernel.org> on behalf of David Miller &l= t;davem@davemloft.net>
Sent: Tuesday, July 24, 2018 10:11:09 AM
To: davejwatson@fb.com
Cc: Vakul Garg; netdev@vger.kernel.org; borisp@mellanox.com; aviadye= @mellanox.com; doronrk@fb.com
Subject: Re: [net-next v5 3/3] net/tls: Remove redundant array alloc= ation.
 
From: Dave Watson <davejwatson@fb.com>
Date: Mon, 23 Jul 2018 09:35:09 -0700

> I don't think this patch is safe as-is.  sgin_arr is a stack arra= y of
> size MAX_SKB_FRAGS (+ overhead), while my read of skb_cow_data is = that
> it walks the whole chain of skbs from skb->next, and can return any=
> number of segments.  Therefore we need to heap allocate.  I = think I
> copied the IPSEC code here.

Ok I see what you are saying.

So it means that, when a non-NULL sgout is passed into decrypt_skb(),
via decrypt_skb_update(), via tls_sw_recvmsg() it means that it is the
zerocopy case and you know that you only have page frags and no SKB
frag list, right?

I agree with you that this change is therefore incorrect.
--_000_DB7PR04MB4252DEFEDC63C40EF287F22D8B550DB7PR04MB4252eurp_--