Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5753666ybi; Sun, 21 Jul 2019 02:02:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxT4Ucbukq0lMg3rcq3l+5nAD6cU9N/F3HlgNYRjycT9tWKHUKHHT11V3GsEYDG6mSl0hVV X-Received: by 2002:a65:41c6:: with SMTP id b6mr8398964pgq.269.1563699730079; Sun, 21 Jul 2019 02:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563699730; cv=none; d=google.com; s=arc-20160816; b=GyHiL4DzbIUQGOXrTDz4vzRWHKy0E0CGbvTXav+wHUnQNdlgXZpn50K3F7x1rTF1kt VFhHNiGCIDqkhkFT20MqkBP8XoXKn7FFqL4e8fV32CvZ69YoHIxDYyZ6N5KKCFUVnjH6 hPaDyz1sDrPhcFVr7mdT3bC6LN8wiiSApxmfRjoPJT3k0eJamKjZzgbVuOCukbg+QKPR UBnxODBweW6ypY1Jlpd3x5LaW1ihL/LbVay7tGKpHen65319hPE4t2kBSSYrzqDPOD9y z75K9NEatcAFFwjKA5UA6TZYJd+URBm7YWRQkduyS2ul/57zJBh9ICjM/Vn3gTICZOoR 2eKA== 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=uMCT1sRvSpYaoD1Z8FlxTMQ/VpyVpjBJDn9MHa/ZVPo=; b=FKYB0kkrq81KoQEXCErznUjtDfXLSoQBClGvbzuUH3GcFWstdcaYBCwQIxL7qiijj+ xHmrIF5GgkN3ZZImMxmTus0WMnElXe1lugbS1ViAjPJtopbm92E2LjEzo5BjO8zr1d6w ThbUpG+ryW9NoLujuj29Mrl1zRpntNLTHUYFdO6OtWV+aU2Q2+6Y1yAEiz7h8mC9yUaF RBnihXEv6cuOze5aXouqM5HnpJk60d8IlXNN/5pZ2WA7toXAkCAHvPh5/R/IHxj0Knw2 IgIUGBXBLO1dSPuLQRq19l8nmrh1QN3PBZh3ZxH7veBp7X+cRFjm3Cw/0ilCT7NHinWw aJZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bo0U1egZ; 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 q206si49897pgq.483.2019.07.21.02.01.53; Sun, 21 Jul 2019 02:02:10 -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=bo0U1egZ; 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 S1726240AbfGUJBf (ORCPT + 99 others); Sun, 21 Jul 2019 05:01:35 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42268 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfGUJBf (ORCPT ); Sun, 21 Jul 2019 05:01:35 -0400 Received: by mail-pl1-f195.google.com with SMTP id ay6so17710267plb.9; Sun, 21 Jul 2019 02:01:35 -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=uMCT1sRvSpYaoD1Z8FlxTMQ/VpyVpjBJDn9MHa/ZVPo=; b=bo0U1egZOrd62N2e2VId7EPbVmrGg8I6+LSmMCOOlbh1JSpDDny0jX6sY6Aj8uQZ0V FDwFWUnBN6gqTfizZciyH98orjrfc3S1wNDrSeFt9xfMUwXuEtMPunSq0mmpn/0yBnII LbXxrVBLoabcRCyF38hBvo0lu78uBosAsIruwJI7fabIvOmk502+1WzwSFBkr0r4opP5 AOSCNTjUvXB075IaUcpmXtQ/yzFSo4xaLu4+9HD61M4u1Y2DKy69Eu7BOV8xhhCEn7kD rcKWZW93sIpMRRIBniwanhC0t1cWsyyxu/XeFP5EZ1PbxEMTLrTOa6mLnNSmLyW+yWfH Qy0A== 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=uMCT1sRvSpYaoD1Z8FlxTMQ/VpyVpjBJDn9MHa/ZVPo=; b=tEtSZ+2YxJ9X0igWYXGuVOov7YAGhoGbleh+va98G32s3conZVtdoX26yARQTE+QxD 6uOpbS2LNL4H9XjJMqNf8ieon10Z6RFLA/GvN9M7SlgRUZERxXBAPKUEoKmbmqAaBX1g wR131os/5itDbgq2rhtEplMyfMXBfiM5gWSXJ8Oi0xU0wIfBXgMgJcVUTd32U8AA0Ovu 75At1Ea3mzDHPsNrHJ1ArXs1IZyzVNUrK3qkyUex3B3oWZD7EiX8cWuAKvLUokQeu+6c kCDp0p9EGL9kgTciTM4/08ofZYwg7CBLpuoqQ5gOIcuaSGpTx2QEqPmwQtlc0zIyJez3 Kzkg== X-Gm-Message-State: APjAAAWkK+RQ8NPkg4t8nF/0xEGY5G4NmBHp6iTrbXqo/jFttokop71g LgemRtCH9334Fk4HSG/IEhI= X-Received: by 2002:a17:902:b603:: with SMTP id b3mr69739706pls.9.1563699694660; Sun, 21 Jul 2019 02:01:34 -0700 (PDT) Received: from localhost.localdomain ([125.142.23.13]) by smtp.gmail.com with ESMTPSA id r1sm34548144pgv.70.2019.07.21.02.01.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 21 Jul 2019 02:01:34 -0700 (PDT) Date: Sun, 21 Jul 2019 18:01:29 +0900 From: Suwan Kim To: shuah Cc: valentina.manea.m@gmail.com, stern@rowland.harvard.edu, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] usbip: Implement SG support Message-ID: <20190721090129.GA13527@localhost.localdomain> References: <20190705164355.14025-1-suwan.kim027@gmail.com> <7eaaf016-8da5-6089-fe19-bf62c3bbe187@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7eaaf016-8da5-6089-fe19-bf62c3bbe187@kernel.org> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 19, 2019 at 04:04:20PM -0600, shuah wrote: > On 7/5/19 10:43 AM, Suwan Kim wrote: > > There are bugs on vhci with usb 3.0 storage device. Originally, vhci > > doesn't supported SG, so USB storage driver on vhci breaks SG list > > into multiple URBs and it causes error that a transfer got terminated > > too early because the transfer length for one of the URBs was not > > divisible by the maxpacket size. > > > > To support SG, vhci doesn't map and unmap URB for DMA to use native > > SG list (urb->num_sgs). In DMA mapping function of vhci, it sets > > URB_DMA_MAP_SG flag in urb->transfer_flags if URB has SG list and > > this flag will tell the stub driver to use SG list. > > > > In this patch, vhci basically support SG and it sends each SG list > > entry to the stub driver. Then, the stub driver sees the total length > > of the buffer and allocates SG table and pages according to the total > > buffer length calling sgl_alloc(). After the stub driver receives > > completed URB, it again sends each SG list entry to vhci. > > > > If HCD of the server doesn't support SG, the stub driver breaks a > > single SG reqeust into several URBs and submit them to the server's > > HCD. When all the split URBs are completed, the stub driver > > reassembles the URBs into a single return command and sends it to > > vhci. > > > > Alan fixed vhci bug with the USB 3.0 storage device by modifying > > USB storage driver. > > ("usb-storage: Set virt_boundary_mask to avoid SG overflows") > > But the fundamental solution of it is to add SG support to vhci. > > > > This patch works well with the USB 3.0 storage devices without Alan's > > patch, and we can revert Alan's patch if it causes some troubles. > > > > Suwan Kim (2): > > usbip: Skip DMA mapping and unmapping for urb at vhci > > usbip: Implement SG support to vhci > > > > drivers/usb/usbip/stub.h | 7 +- > > drivers/usb/usbip/stub_main.c | 52 +++++--- > > drivers/usb/usbip/stub_rx.c | 207 ++++++++++++++++++++++--------- > > drivers/usb/usbip/stub_tx.c | 108 +++++++++++----- > > drivers/usb/usbip/usbip_common.c | 60 +++++++-- > > drivers/usb/usbip/vhci_hcd.c | 29 ++++- > > drivers/usb/usbip/vhci_tx.c | 49 ++++++-- > > 7 files changed, 391 insertions(+), 121 deletions(-) > > > > Hi Suwan, > > I have been traveling and would like to test this series before I ask > Greg to pick it up. > > Just a quick note that I will get to this early next week. Ok. Thank you for reviewing the patch, Shuah. Please let me know if you have any problems reviewing the patch :) Regards Suwan Kim