From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755360AbdESLLZ convert rfc822-to-8bit (ORCPT ); Fri, 19 May 2017 07:11:25 -0400 Received: from smtp-out6.electric.net ([192.162.217.182]:58117 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751330AbdESLLV (ORCPT ); Fri, 19 May 2017 07:11:21 -0400 From: David Laight To: "'Jim Baxter'" , "linux-usb@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Oliver Neukum Subject: RE: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low Thread-Topic: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low Thread-Index: AQHSzmuufdEf3ZnqxEOQuresTzkisqH7go7g Date: Fri, 19 May 2017 11:10:40 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFFAA5C@AcuExch.aculab.com> References: <1494956480-6127-1-git-send-email-jim_baxter@mentor.com> <1494956480-6127-2-git-send-email-jim_baxter@mentor.com> In-Reply-To: <1494956480-6127-2-git-send-email-jim_baxter@mentor.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="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: linux-usb-owner@vger.kernel.org [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Jim Baxter > Sent: 16 May 2017 18:41 > > The CDC-NCM driver can require large amounts of memory to create > skb's and this can be a problem when the memory becomes fragmented. > > This especially affects embedded systems that have constrained > resources but wish to maximise the throughput of CDC-NCM with 16KiB > NTB's. Why is this driver copying multiple tx messages into a single skb. Surely there are better ways to do this?? I think it is generating a 'multi-ethernet frame' URB with an overall header for each URB and a header for each ethernet frame. Given that the USB stack allows multiple concurrent transmits I'm surprised that batching large ethernet frames makes much difference. Also the USB target can't actually tell when URB that contain multiples of the USB packet size end. So it is possible to send a single NTB as multiple URB. Of course, the usb_net might have other ideas. David