Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp260155pxb; Thu, 17 Feb 2022 03:37:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxV4hWuxzp1sBaSQIpOI4GWHSLI96nhhfVLlhUTe2J27nM7FEaSfD++mJkn17jxOjeRfqVz X-Received: by 2002:a17:907:20dc:b0:6b7:ecde:4ca1 with SMTP id qq28-20020a17090720dc00b006b7ecde4ca1mr2018800ejb.102.1645097833889; Thu, 17 Feb 2022 03:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645097833; cv=none; d=google.com; s=arc-20160816; b=gMVxvXEt71wn6KZ8MEc+U7rF8T93x1DY2AMzgfh1e2m0ryjVY/b6pNaBXLSiZgzXgz omc6/lCJQeWzust+VRi4QQ9Ku+yNEmXELLd8/KBTiF/ZkAqcZsxSMU1aSSgJRGWHJ8HE fJf6sDvnLrnlMD2zz+UTO8cDX0TOauMg6LgYv2g4mGZwKXQG0mKZZJvLRfZQAH7Ofsio SNw3XdHm8TDIv6Zthngz4H+AQmOUzY4mSl9F5EJMo+C699y8kc+in5yzUvc+TNAH3tud qfdnePwUxihw6Eef9JbWCsp9drK7OWgb40bXHJ7OtayzLFWZNozDLUsZzecptK/Dj5Vr 839w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=ShpX2bDBUcU5RWsguD9CwAua/ksrIm/L33CJ1gKR934=; b=MGi+ykC3ZMnIQkOTj+7W/LK9JQkq0TszaSyjcX5t43TSmB7iGljLz8iccODcdrp5xg LS4Aw9lTpd+KqLMYkymxFmval+2USjHIBoMzYRxi2T/ONdHr2Iujx/Ajx/ntCcp+xhD5 1K6SjzzoWUfwaaGX7EVoCsNITRlsRQ3HqeZ3zx219C+8ZIj6xeSHUZaaZ/CAiyAhvNnO La2gTifTeT+fQJQmRghY0LwRFKZSXwx7OE0HPK6uDCgxt9Zki7OSiSyyk8yxy0swqMXj vWc2hV+z0gncDratySKOkWbXhC3xZy2h0Mk3Golb499EmZLqo8qPGuQDl1PqEcwYXhei 8M0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12si1583298ejy.969.2022.02.17.03.36.49; Thu, 17 Feb 2022 03:37:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239611AbiBQLNc (ORCPT + 99 others); Thu, 17 Feb 2022 06:13:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239762AbiBQLN1 (ORCPT ); Thu, 17 Feb 2022 06:13:27 -0500 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 921B61E8BD1; Thu, 17 Feb 2022 03:13:10 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R281e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=xiaoguang.wang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0V4kN2Gv_1645096387; Received: from 30.225.28.137(mailfrom:xiaoguang.wang@linux.alibaba.com fp:SMTPD_---0V4kN2Gv_1645096387) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Feb 2022 19:13:08 +0800 Message-ID: Date: Thu, 17 Feb 2022 19:13:07 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH 2/2] scsi:target:tcmu: reduce once copy by using uio ioctl Content-Language: en-US To: Greg KH , Guixin Liu Cc: bostroesser@gmail.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, xlpang@linux.alibaba.com References: <1645064962-94123-1-git-send-email-kanie@linux.alibaba.com> <1645064962-94123-2-git-send-email-kanie@linux.alibaba.com> From: Xiaoguang Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, > On Thu, Feb 17, 2022 at 10:29:22AM +0800, Guixin Liu wrote: >> --- a/include/uapi/linux/target_core_user.h >> +++ b/include/uapi/linux/target_core_user.h >> @@ -185,4 +185,13 @@ enum tcmu_genl_attr { >> }; >> #define TCMU_ATTR_MAX (__TCMU_ATTR_MAX - 1) >> >> +struct tcmu_data_xfer { >> + unsigned short cmd_id; >> + unsigned long iov_cnt; >> + struct iovec __user *iovec; >> +}; > That is no way to define a structure that crosses the user/kernel > boundry, it just will not work at all, even if we wanted it to :( Sorry, I don't quite understand your comments well, can you explain more why this structure does not work, except that "unsigned short" or "unsigned long" here isn't correct, should use u16 or u32. Syscalls, such as readv/preadv also pass a struct iovec from user to kernel, thanks. Regards, Xiaoguang Wang > > sorry, > > greg k-h