From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2B46C433E0 for ; Wed, 6 Jan 2021 14:31:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94ADA23110 for ; Wed, 6 Jan 2021 14:31:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbhAFOb5 (ORCPT ); Wed, 6 Jan 2021 09:31:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbhAFOb5 (ORCPT ); Wed, 6 Jan 2021 09:31:57 -0500 Received: from canardo.mork.no (canardo.mork.no [IPv6:2001:4641::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17DD6C06134C for ; Wed, 6 Jan 2021 06:31:16 -0800 (PST) Received: from miraculix.mork.no (miraculix.mork.no [IPv6:2001:4641:0:2:7627:374e:db74:e353]) (authenticated bits=0) by canardo.mork.no (8.15.2/8.15.2) with ESMTPSA id 106EVBn9026740 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 6 Jan 2021 15:31:11 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1609943471; bh=7XNa0Rd+0NgWJogTtC+lEigCFC/n3cqOlkpvGrlPRRU=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=OipCYN/07Ku9F4c4Hr8ZP9VXBfckvmwacDMgkU6CcCXkdx0p7DmdjjNc3M7mIxztt t1Aj6+sFHsY8spV8A9h6ZoaSCNQPScTSWSnpSvSZ6/x8jqs+vK8hd7yAtmvh4Vkrk+ dk7MyXV/0poXREIWnqyxubFwgNCJU04p7XWwEmcQ= Received: from bjorn by miraculix.mork.no with local (Exim 4.94) (envelope-from ) id 1kx9qA-000meC-QN; Wed, 06 Jan 2021 15:31:10 +0100 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Kristian Evensen Cc: netdev@vger.kernel.org Subject: Re: [PATCH net-next] qmi_wwan: Increase headroom for QMAP SKBs Organization: m References: <20210106122403.1321180-1-kristian.evensen@gmail.com> Date: Wed, 06 Jan 2021 15:31:10 +0100 In-Reply-To: <20210106122403.1321180-1-kristian.evensen@gmail.com> (Kristian Evensen's message of "Wed, 6 Jan 2021 13:24:03 +0100") Message-ID: <87ft3e3zo1.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.102.4 at canardo X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Kristian Evensen writes: > When measuring the throughput (iperf3 + TCP) while routing on a > not-so-powerful device (Mediatek MT7621, 880MHz CPU), I noticed that I > achieved significantly lower speeds with QMI-based modems than for > example a USB LAN dongle. The CPU was saturated in all of my tests. > > With the dongle I got ~300 Mbit/s, while I only measured ~200 Mbit/s > with the modems. All offloads, etc. were switched off for the dongle, > and I configured the modems to use QMAP (16k aggregation). The tests > with the dongle were performed in my local (gigabit) network, while the > LTE network the modems were connected to delivers 700-800 Mbit/s. > > Profiling the kernel revealed the cause of the performance difference. > In qmimux_rx_fixup(), an SKB is allocated for each packet contained in > the URB. This SKB has too little headroom, causing the check in > skb_cow() (called from ip_forward()) to fail. pskb_expand_head() is then > called and the SKB is reallocated. In the output from perf, I see that a > significant amount of time is spent in pskb_expand_head() + support > functions. > > In order to ensure that the SKB has enough headroom, this commit > increases the amount of memory allocated in qmimux_rx_fixup() by > LL_MAX_HEADER. The reason for using LL_MAX_HEADER and not a more > accurate value, is that we do not know the type of the outgoing network > interface. After making this change, I achieve the same throughput with > the modems as with the dongle. > > Signed-off-by: Kristian Evensen Nice work! Just wondering: Will the same problem affect the usbnet allocated skbs as well in case of raw-ip? They will obviously be large enough, but the reserved headroom probably isn't when we put an IP packet there without any L2 header? In any case: Acked-by: Bj=C3=B8rn Mork