From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756272AbcBCLgi (ORCPT ); Wed, 3 Feb 2016 06:36:38 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42286 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932613AbcBCLg3 (ORCPT ); Wed, 3 Feb 2016 06:36:29 -0500 X-Sasl-enc: Eha3tt0/tva2AzRderU4CFqQjNVBv6718FNST39EUDx2 1454499388 Subject: Re: [PATCH v3] net:Add sysctl_max_skb_frags To: Herbert Xu , Hans Westgaard Ry References: <568F87AC.60405@oracle.com> <1454488017-8822-1-git-send-email-hans.westgaard.ry@oracle.com> <20160203112550.GB28003@gondor.apana.org.au> Cc: "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , Tom Herbert , Pablo Neira Ayuso , Eric Dumazet , Florian Westphal , Jiri Pirko , Alexander Duyck , Michal Hocko , =?UTF-8?Q?Linus_L=c3=bcssing?= , Tejun Heo , Andrew Morton , Alexey Kodanev , =?UTF-8?Q?H=c3=a5kon_Bugge?= , open list , "open list:NETWORKING [GENERAL]" From: Hannes Frederic Sowa Message-ID: <56B1E635.8020707@stressinduktion.org> Date: Wed, 3 Feb 2016 12:36:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160203112550.GB28003@gondor.apana.org.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03.02.2016 12:25, Herbert Xu wrote: > On Wed, Feb 03, 2016 at 09:26:57AM +0100, Hans Westgaard Ry wrote: >> Devices may have limits on the number of fragments in an skb they support. >> Current codebase uses a constant as maximum for number of fragments one >> skb can hold and use. >> When enabling scatter/gather and running traffic with many small messages >> the codebase uses the maximum number of fragments and may thereby violate >> the max for certain devices. >> The patch introduces a global variable as max number of fragments. >> >> Signed-off-by: Hans Westgaard Ry >> Reviewed-by: HÃ¥kon Bugge > > I have to say this seems rather dirty. I mean if taken to the > extreme wouldn't this mean that we should disable frags altogether > if some NIC can't handle them at all? > > Someone suggested earlier to partially linearise the skb, why > couldn't we do that? IOW let's handle this craziness in the crazy > drivers and not in the general stack. Agreed that it feels like a hack, but a rather simple one. I would consider this to be just a performance improvement. We certainly need a slow-path when virtio drivers submit gso packets to the stack (and already discussed with Hans). The sysctl can't help here. But without the sysctl the packets would constantly hit the slow-path in case of e.g. IPoIB and that would also be rather bad. Thanks, Hannes