Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2835701ybd; Mon, 24 Jun 2019 13:39:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/XX6z7+MVoKiNoUmSA08TAW2b/rtCgnL/IX6Gv59wUkxbbOqolHS57f2rGXB//wBn3czB X-Received: by 2002:a17:90a:29c5:: with SMTP id h63mr25834144pjd.83.1561408759792; Mon, 24 Jun 2019 13:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561408759; cv=none; d=google.com; s=arc-20160816; b=xfBCfIpItkI1QkeG6lq/JyVNL7kyWXACs6tte5eLr6jbgjtFzbkcNCDbAnh+FAA36+ WHn1Jc3IIB+qSKXi3+6xfP5W2G5eXoGj2qCXv/uEvSBFmPWeqa1XZqo0T76DEFZH85Ed pt3OwCg89409wUt1JbYXaPI5PIFaZ9ZkaZS4kyst0FbLVHAIMw16zFXaSsavEqW9I8At 4yumDark3cWoBBfbWr5ttVuvmp6eea0DK+mLEsblDTuxveCj4fQdth+C3CknfHLoaOIs DdZUnqzR/gEz/D/gyz3yGsK5jeb3SytYJ/Nww/EL921k0xKGK+yQFCt+ONl/X1QPpaWE uPGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=2K/Ge3w1OxRKqlIUW9Wwgxd+9ahO/cIryUt4hu00sX8=; b=LJbEgzL5yMZz3xE9Ey4MIl+FT0SVKTRtOFSxPzp8jyxH6533NBTvq4CvU0AoBTqtXR cFpEUF4tHlpil4rF9RDkkYwnkrDZZdrqhuFyzYTQJe1x8CZ6C0ZzAQ5hTNjxSSUh9d5J cunN7o7vBEPiR6g5MGLrxDKRdkLi5kdBPHFZ/CROsLF5n2SZejLKbRVV2lec3u832NDq uffS6vpAPHshA1t8IYp7nTrrJTGO5B332ZnM2HZekFa9jN9bn6Rx+a4AkofoqNQkXaRf YH3p8DB4bspRnXhAr7SCeFluIEiJXu7qw53lrIVKq79M58o4LaTFF1BBg34D/KhMaJkV dZlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h127si11997389pfe.44.2019.06.24.13.39.04; Mon, 24 Jun 2019 13:39:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732382AbfFXRYQ (ORCPT + 99 others); Mon, 24 Jun 2019 13:24:16 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:57468 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726941AbfFXRYQ (ORCPT ); Mon, 24 Jun 2019 13:24:16 -0400 Received: (qmail 6027 invoked by uid 2102); 24 Jun 2019 13:24:15 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 24 Jun 2019 13:24:15 -0400 Date: Mon, 24 Jun 2019 13:24:15 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Suwan Kim cc: shuah@kernel.org, , , Subject: Re: [PATCH 2/2] usbip: Implement SG support to vhci In-Reply-To: <20190624145852.GC7547@localhost.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 Jun 2019, Suwan Kim wrote: > > > + hcd->self.sg_tablesize = ~0; > > > + hcd->self.no_sg_constraint = 1; > > > > You probably shouldn't do this, for two reasons. First, sg_tablesize > > of the server's HCD may be smaller than ~0. If the client's value is > > larger than the server's, a transfer could be accepted on the client > > but then fail on the server because the SG list was too big. On the other hand, I don't know of any examples where an HCD has sg_tablesize set to anything other than 0 or ~0. vhci-hcd might end up being the only one. > > Also, you may want to restrict the size of SG transfers even further, > > so that you don't have to allocate a tremendous amount of memory all at > > once on the server. An SG transfer can be quite large. I don't know > > what a reasonable limit would be -- 16 perhaps? > > Is there any reason why you think that 16 is ok? Or Can I set this > value as the smallest value of all HC? I think that sg_tablesize > cannot be a variable value because vhci interacts with different > machines and all machines has different sg_tablesize value. I didn't have any good reason for picking 16. Using the smallest value of all the HCDs seems like a good idea. Alan Stern