Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4461632ybi; Fri, 19 Jul 2019 23:25:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuyunGKdiO8pCRRFQ1mCx17uFYkrEFnGsSvHr3AqBhZI8ehidTYWy1tmRxfbtjVxA/rOos X-Received: by 2002:a17:902:b497:: with SMTP id y23mr61652625plr.68.1563603933392; Fri, 19 Jul 2019 23:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563603933; cv=none; d=google.com; s=arc-20160816; b=vPXrG/X0wc9cgMff8TnAy0iuTMSvnREpEgLda/haEXhDrN4WaVJ2FDWtDeUhSrbKYE PBSoXUxEuIMYWXVBYkkP2xmK9+fGxtSdS4gRW4tEI3vZX+QHunjn/lTmShgcHei7EgZP pHdSwvxgh2YmSwbmX3lNPzR4s4kdHPVQ7Vfh2psW2j7wU+V5ZxAY7TpP05a1eLuumlhB 9MV/Enf3yy8LX0EjE8RHzhD4jyezwKtH6NiaahZGjOp2wQv1/2qI+g+rw3K8tSWx4uST uRFFBxQ71OdDuOs0st8EH9aIB1kvgIjyd7uh1zS0TAIs4p5vAUmibiYfdscRbGIpEGui S1gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=gy0JnR/tnrfhV+Efa8bF1DV0DwDmurGO320zADtB63E=; b=ku42cjfM3IJMt1RvGGvkUlCXz6rhgVzeSVG0Ac33K8KWh9cafCzlxr1ocKH+pt070T saOZmmrN5nrPJBzg1exO5TGOR+Y9X7ON4nIWlVokiukyikWCtfoB301ISymG5hH7TufL FCpn6jxjrAMVJ1khdsVI1NsXMg3JSJqcM/CS6Lbewjv/JApSrPxLTNM1zdhfJ1zvU+ZU 4qtltDMjz2QDgoUNHEsPYvCZXOYOb3UF4uYJX41RVXtm0A0yC7u3/JoxvjN5OYH51JF3 Gu1mhVERN5uzeW8FW5z4OQPaLC/uiir7clxYEcjbq0hMkOzd27VZUONZI9mNnsGP2ai4 cnBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=urXENChs; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d39si1431184pla.371.2019.07.19.23.25.17; Fri, 19 Jul 2019 23:25:33 -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=@kernel.org header.s=default header.b=urXENChs; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728350AbfGSWEh (ORCPT + 99 others); Fri, 19 Jul 2019 18:04:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:56360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbfGSWEh (ORCPT ); Fri, 19 Jul 2019 18:04:37 -0400 Received: from [172.20.8.67] (fs96f9c61d.tkyc509.ap.nuro.jp [150.249.198.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4CC2E2084D; Fri, 19 Jul 2019 22:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563573877; bh=WpIhaQ1joRo/MH17c0t17VXik9ibq2E9ekgS84Bsqq0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=urXENChsdLG1xeJQdusgUINM/llCFuGkdvhSq4cG5a3Yrv/AiqVp/HQC6s4LD/tDN 14dvkAbSxzCr5Xmpnuc+1tKdq7HTFrwHBmxcsULbDkjOHyaX6O+oTFbk1gnlcncBvT OKOnhmedUzhdkvVUPs7l//ehcSC5UgGGIUhf3SW8= Subject: Re: [PATCH v2 0/2] usbip: Implement SG support To: Suwan Kim , valentina.manea.m@gmail.com, stern@rowland.harvard.edu, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, shuah References: <20190705164355.14025-1-suwan.kim027@gmail.com> From: shuah Message-ID: <7eaaf016-8da5-6089-fe19-bf62c3bbe187@kernel.org> Date: Fri, 19 Jul 2019 16:04:20 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190705164355.14025-1-suwan.kim027@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, -- Shuah