Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2444575ybi; Thu, 4 Jul 2019 11:14:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLP1YLlRNbb/gC1GMJGTSPeeNH7wt9LOmn35TDPhFiIAM8eJ7iRbFTJQk9NpRCHoW8Pa+0 X-Received: by 2002:a17:902:29e6:: with SMTP id h93mr48387947plb.297.1562264076084; Thu, 04 Jul 2019 11:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562264076; cv=none; d=google.com; s=arc-20160816; b=rIm4dNQNON0SH/Ce4gV2r+FN3i/YEoWCyy+PrnF8dzLzMAYvFP8uMrK8oLEfLaNQwi D+RsdlFtRW6fLtkLirZcbsur+zd1MbqJFypDKObmC4rQub8nr/H+W9dg3NUcMrGIWj1E THcD0SO3BZIhEl+tvb0dOJ8yjTLO243anet/0kvQYmhLjVtVIZhVUbE3O4cmjb3y2wwj VF86tHUeDnGsFcfUz32gtamppxHh7UAFJEN5+0ZV5QVYeBrY1QZvWFavgL71g0EjlOnP M4YAD4iHHMvb0i9kLenEiCk1BHbBPDTdNXS4IlXH6TEJSRtzNIRUtdQKKSfinc9OCOGj pbMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=55QfSNtbMpn+MJxisNfI6ew+wl/zossrT+kRgSB+uK8=; b=wyJWxxbFqfL5b+LufW/Xi7JanpuGboeqaxpEv/DxQOR3eiaeehJrmZXRsvoZzB9IrR r31Km/Va7jYFjagUHRPwkwWXeEhYg54oaaLre0yp0JLPRA9BU3bqAhBZcBjRkKehCUxX byNKhvLhXM9MVwHaemys1joFEH4lfbKusItrebEu/OOlAKBWri2pLwEx3QEreUS79huo aDmi7jZMr4BjXafegBABK67yt+NtLTCAOsuRo2lquR4XnZXSdcaBrxV7Gip0/PkILBy2 9Y0fTzn+E8VVAzSSWfHvQCiLKSeePHTIboigVNGr0kEt291jwz6ZBs9ecj6uKsyMSEP3 Zu9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cck1/oH3"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s33si6231510pgk.112.2019.07.04.11.14.20; Thu, 04 Jul 2019 11:14:36 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cck1/oH3"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727595AbfGDRYo (ORCPT + 99 others); Thu, 4 Jul 2019 13:24:44 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43999 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727308AbfGDRYn (ORCPT ); Thu, 4 Jul 2019 13:24:43 -0400 Received: by mail-pl1-f195.google.com with SMTP id cl9so3346524plb.10; Thu, 04 Jul 2019 10:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=55QfSNtbMpn+MJxisNfI6ew+wl/zossrT+kRgSB+uK8=; b=cck1/oH35+TwFzlHwtp8kI9dhL7sa7e0x16TEOFTU8wG1hlmZ2SNQqOFWQuLhrWd8v LULq0Oy78tMkxMBHSeWbuTcylNGO8i2mnHtZIzMGQwp2RrTpnfdSwJWH33HLce1OKxaJ A+X+OO2r6yE58l9QVLe+DiuIESi77WQqLr5Nx3hvq68OSoKTPzSHUo2HhvzkxpVMBkvi DN4yrrmMaCqWsabjAUZyIJ3kN0WlzYtXbthr2DateTQv1FlyNcy4yWtGfDceoBslsGQ7 ljvxpI5gGdlH+wAe7TDhDDdmWvQPnV9beCqTq52z+2MYQJHZgoE+6jQ4d6jxTOF7NpZC YJEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=55QfSNtbMpn+MJxisNfI6ew+wl/zossrT+kRgSB+uK8=; b=MrFY2hUvkU8tjruhOJxfiTbdDYn7t902UL8pNlFZK5fRH4QBcJgSER3zJNKLrSA0KL /yR0zEC4gHE2D1oYKEookK3hEKzpHTN2uqglGudADCk1hdDLVWmG3pVAjuzYqFZ10Z7g E6G6JHZkkLTlGwqOd2uCc4qVcCcwqX/B8COsZe1O/JRjgLJW2Ho5KUVNxdXc/lXIGcob ZNSIltj+pBkRBBedcVUTxvKsXr7/OE3K/vPf6W5wijJmaQ9McKII7fgajCYHiOd/OYR5 w03yvHXu1OyJd2WOtBIXm8GBKr4RIaZyjKyWdhLo8DAB/IthIaxBrNkZIamjbQPQZG1R YLDA== X-Gm-Message-State: APjAAAXpRLgWxc8rmpav1sAi1OLFll796U+OYYMN0G+3NRa0pzzMW6vf DzWwGSIZ6RnOdLqHly5KZuE= X-Received: by 2002:a17:902:61:: with SMTP id 88mr48065179pla.50.1562261083171; Thu, 04 Jul 2019 10:24:43 -0700 (PDT) Received: from localhost.localdomain ([125.142.23.13]) by smtp.gmail.com with ESMTPSA id s20sm6739366pfe.169.2019.07.04.10.24.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 04 Jul 2019 10:24:42 -0700 (PDT) Date: Fri, 5 Jul 2019 02:24:37 +0900 From: Suwan Kim To: Alan Stern Cc: shuah@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] usbip: Implement SG support to vhci Message-ID: <20190704172435.GA11673@localhost.localdomain> References: <20190624145852.GC7547@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 24, 2019 at 01:24:15PM -0400, Alan Stern wrote: > 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. I also have not seen an HCD with a value other than ~0 or 0 except for whci which uses 2048, but is not 2048 the maximum value of sg_tablesize? If so, ~0 is the minimum value of sg_tablesize that supports SG. Then can vhci use ~0 if we don't consider memory pressure of the server? If all of the HCDs supporting SG have ~0 as sg_tablesize value, I think that whether we use an HCD locally or remotely, the degree of memory pressure is same in both local and remote usage. Regards Suwan Kim