From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754635AbcAHKgG (ORCPT ); Fri, 8 Jan 2016 05:36:06 -0500 Received: from smtp-out6.electric.net ([192.162.217.190]:50022 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754147AbcAHKgE (ORCPT ); Fri, 8 Jan 2016 05:36:04 -0500 From: David Laight To: "'Hans Westgaard Ry'" , "David S. Miller" CC: Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , Alexei Starovoitov , Jiri Pirko , Eric Dumazet , Daniel Borkmann , Nicolas Dichtel , "Eric W. Biederman " , Salam Noureddine , Jarod Wilson , Toshiaki Makita , Julian Anastasov , Ying Xue , Craig Gallek , Mel Gorman , "\" hannes\"@stressinduktion.org " , Edward Jee , Julia Lawall , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Haakon Bugge , Knut Omang , Wei Lin Guay , Santosh Shilimkar , Yuval Shaia Subject: RE: [PATCH] net: add per device sg_max_frags for skb Thread-Topic: [PATCH] net: add per device sg_max_frags for skb Thread-Index: AQHRSISSMwvRT8zmnE6xY3PnxvoTm57ugndggALiCQCAAAkwwA== Date: Fri, 8 Jan 2016 10:33:11 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CCC00C7@AcuExch.aculab.com> References: <1452086182-26748-1-git-send-email-hans.westgaard.ry@oracle.com> <063D6719AE5E284EB5DD2968C1650D6D1CCBE5AA@AcuExch.aculab.com> <568F87AC.60405@oracle.com> In-Reply-To: <568F87AC.60405@oracle.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u08AaCP0016740 From: Hans Westgaard > Sent: 08 January 2016 09:56 ... > >> The patch allows the device to limit the maximum number fragments used > >> in one skb. > > > > This doesn't seem to me to be the correct way to fix this. > > Anything that adds an extra fragment (in this case IPoIB) should allow > > for the skb already having the maximum number of fragments. > > Fully linearising the skb is overkill, but I think the first fragment > > can be added to the linear part of the skb. > > > > David > > > > > When IpoIB handles a skb-request it converts fragments to SGEs to > be handled by a HCA. > The problem arises when the HCA have a limited number of SGEs less than > MAX_SKB_FRAGS. > (it gets a little worse since IPoIB need to yet another segment) > I have not found any easy way of fixing this with currenct codebase. I think one of the xen ethernet interfaces had a similar problem. Just reduce the number of fragments by copying two (or more) of them into a single fragment. In effect, anything that reduces the number of fragments will do a copy. David