Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp75367yba; Fri, 19 Apr 2019 20:51:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzi7G5hmgj2Q2sg8a/8seSHGezP0zzE7Q0GHTAhi2lIHnnMCTWXshY7/nScMwc00BKwlOzV X-Received: by 2002:aa7:9ad4:: with SMTP id x20mr7553928pfp.250.1555732300097; Fri, 19 Apr 2019 20:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555732300; cv=none; d=google.com; s=arc-20160816; b=LyjZn2jVtObS1EfGWqmkwfZ7BXYl5OItvarAMFBb/uzE1OGw9jobsLKrM33y7JGIak 9EJ28Skr8J8FyVcSsc53QesCWTy6LVHRDVNGBei7fxmDu1vsd2YPTMBBTg3yr7GqHDot ds30WuYo0rpREv0GA4VZPTfgU0yZJbLu4eNQYKUUR6avL1TTUpRQSIkofKPOBfoJQBci g/U+52JKHAbD4YzMxTLuwrxwRzmr9rDyG1PUfF8E63DwgWPVsTm3GnsnDwAKFfTPFOXZ CC46qJy2fdkVVF0+Ev0KTsdz+WPw1NG9+mvvYBGSCkG03UC4wWEVpjLDrmZk8x7yjbH2 AyPQ== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=7ZEm9lbmX7fmFaoi3+uSz3YmsHEAaMVD+GpEd5Dg1yM=; b=em6ezoL2HXzeMRi+QAvEpK+9L/d5YpSDObwATYgkjY+ET8W4+v1XbHnsRQC05Ya2OY BXAqzTyYee16dUSftU5bhU02gDyxxZd/4JYD2/duxSSn6SzyfT4jxniC1/QLXLjApL+M 1d5+pqmnlBCuxlbMJgZqIde7D8zigoQhUPgKPhk90OoxCMZP8exHxZDkSuvmvzt67tTj cXYPSXCkJ1kVTrtSUvzC3Nwf60YND6zjJlRfDIzKga9EsUy0o61sMbPVm/y/5Zas3ZI6 LtjY1RICjx2k0Xmr5vPokjG0ELOvwiCYbpCBGPK2m/bcVOJMWFVOdzRPijdYAzLdicW6 UOQw== 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 n22si6438655pgk.102.2019.04.19.20.51.24; Fri, 19 Apr 2019 20:51:40 -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 S1726150AbfDTDsZ (ORCPT + 99 others); Fri, 19 Apr 2019 23:48:25 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:48522 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725911AbfDTDsZ (ORCPT ); Fri, 19 Apr 2019 23:48:25 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DBC377E5CE5585331887; Sat, 20 Apr 2019 11:48:22 +0800 (CST) Received: from [127.0.0.1] (10.63.139.185) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.408.0; Sat, 20 Apr 2019 11:48:12 +0800 Subject: Re: [PATCH] lib: scatterlist: Fix to support no mapped sg To: Robert Jarzmik References: <1555581006-153458-1-git-send-email-wangzhou1@hisilicon.com> <871s1ymg1k.fsf@belgarion.home> CC: , , From: Zhou Wang Message-ID: <5CBA967C.5010502@hisilicon.com> Date: Sat, 20 Apr 2019 11:48:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <871s1ymg1k.fsf@belgarion.home> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.63.139.185] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/4/19 18:43, Robert Jarzmik wrote: > Zhou Wang writes: > >> In function sg_split, the second sg_calculate_split will return -EINVAL >> when in_mapped_nents is 0. >> >> Indeed there is no need to do second sg_calculate_split and sg_split_mapped >> when in_mapped_nents is 0, as in_mapped_nents indicates no mapped entry in >> original sgl. >> >> Signed-off-by: Zhou Wang > That's right. May I know what is the usecase which led you to this fix ? I posted a patchset to support HiSilicon compression engine: https://lkml.org/lkml/2019/1/23/358. As Herber Xu suggested, it should use new crypto acomp API which uses sgl as data input and output. However, our hardware can not handle compress head for input/output data, so I need split input/output sgl firstly which is not mapped sgl. New version of HiSilicon compression engine driver has not been posted to community yet. I will do this later. > > Acked-by: Robert Jarzmik Many thanks for your review, Zhou > > -- > Robert > > . >