Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3525248pxb; Mon, 16 Nov 2020 17:49:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFHO7D8V0mpOIX2CidXXFPo7qqhnh3ZyzdEnymkuMAf2xX4rK4Nygi9gyXkfYGe+Rljhro X-Received: by 2002:a05:6402:6c9:: with SMTP id n9mr95423edy.67.1605577789217; Mon, 16 Nov 2020 17:49:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605577789; cv=none; d=google.com; s=arc-20160816; b=Hhvno2RZ+PdQuw4LOLKd4chebFoMW6gwRaT2p3fHE5zq3MG/cvAIcb97WLaG3vQdBT JaF506tyhFVzAkpXAyI6IOQAg46Bf17vRnwY9+7pYN+Bd5dq18/BnfxbTP2ZivXkl9OO L2T401xnUuigbckQ7yqTsRrfPTbF54+ccxqxzAWlet/UesZFuM/cI2YH/Y870wP3vjwU ZwDzQQq8FsmjLi33hNIYyPCiieyMvlss0RwGEX2DvLMAF2yVg/rJ5WW3gWGDQFj/STtx 1VIfBbl1PEKMxm58f2l0Td7+oZfAcAOx+jgIPtJOFiAMe0bb8w8LbAD5oeKhKBNWq1ib Q17g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=97VmpTXAdtiBuZSpuvkK0VLB6Qe0uigxKEQsDu39lOA=; b=A+M5d3veCHX3bvu2dOwWvOW5sE5j/48w7QE5kCTlhj9mF5/U1TMlYC/Y4/lzI0n4Uz tX42tgl36cwzLOy1OswDf44K/eE6/pccgUMpDvrtKFx62iH6ZWEl0OfQcgzZPqywZ8PY LfI3igz4NhgDFmt7LRFX4ZSBqeWMwmq+IYxkczd71jOOojCaueK8oD4yeKNDGsw2VXVr SmZ5hSSLBN2EkpYZa3puDzTazbdYg5IIKY05hyzp92J2eE6i8ohrYsNg3df9zA+3zo5n i8PDy6ymNxQyPxjoioqZ4ErkT07vvOkohNJwe8y2hA89ETOHSqJ35JKjBKoqldRjGNsA tQBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="S+F9/FpA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si12162873ejy.346.2020.11.16.17.49.26; Mon, 16 Nov 2020 17:49:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="S+F9/FpA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728658AbgKPLtD (ORCPT + 99 others); Mon, 16 Nov 2020 06:49:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58606 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbgKPLtD (ORCPT ); Mon, 16 Nov 2020 06:49:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605527341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=97VmpTXAdtiBuZSpuvkK0VLB6Qe0uigxKEQsDu39lOA=; b=S+F9/FpAFG4ES2GMcjRpxk2YhHErebd0CvRFvSe8wZFjW22SXhB8UssaEJbUgIKWwvvz8L qo7l8FmPhx61Ks32WwSttf2fuH7mzjPgWDAS8q870KrhKqGak820TQrYN/wpD0fvAjbUcM mhpwUDLNJdJ++eKmGlzbEMn2Xz+hicM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-9BYP-k9dNz6aQgaKYJIWJw-1; Mon, 16 Nov 2020 06:48:59 -0500 X-MC-Unique: 9BYP-k9dNz6aQgaKYJIWJw-1 Received: by mail-wm1-f72.google.com with SMTP id j62so8569807wma.4 for ; Mon, 16 Nov 2020 03:48:59 -0800 (PST) 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:content-transfer-encoding :in-reply-to; bh=97VmpTXAdtiBuZSpuvkK0VLB6Qe0uigxKEQsDu39lOA=; b=SvlbaDouCH8tSvI8EBAJBPDT2zNI9yjOCDHEjmWVmWLNcG40P40DkMbhjYDfIcHBqf w7s9PoSEVxE8KjNklKTR/bIDVNEFYKAjvQxv4pucVuriRr9YtR3teJNokJ6BaFgXHtsl 6bvLXXGwwlogvMocgaL04uoqpX4nmUTtZQgWESPPDFHTuANM2YZTlEjiuez6awWDCdgZ 1ebMmqZHJHQPQ27lI663Am4yOPGV0NtcULZMq0VBSrdddnmnt0z9JflZrL9dCSMXMBr7 NHhI56A9F+UO8yqQe4beSTeXxooaRECiVWIRxzdEPYJmngvvVej53pHZbaQ6UeNa+jsV FWPQ== X-Gm-Message-State: AOAM530mVucvfHynBFiC+pbFXgHqvLR47HB8mFtSAlXhSJprIKRmjgM8 VzQg2MKtZNVvAY67iy9sUOSpvB2T0+JVJ5lhESNCdyToeSC67IBFM1mBPDIB3i/OzQwCTLXbTqP RYALIuPgc6+frFPu0Sn84VmIa X-Received: by 2002:a1c:7215:: with SMTP id n21mr14797812wmc.173.1605527338070; Mon, 16 Nov 2020 03:48:58 -0800 (PST) X-Received: by 2002:a1c:7215:: with SMTP id n21mr14797795wmc.173.1605527337866; Mon, 16 Nov 2020 03:48:57 -0800 (PST) Received: from steredhat (host-79-17-248-175.retail.telecomitalia.it. [79.17.248.175]) by smtp.gmail.com with ESMTPSA id g11sm22694417wrq.7.2020.11.16.03.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 03:48:57 -0800 (PST) Date: Mon, 16 Nov 2020 12:48:54 +0100 From: Stefano Garzarella To: Jason Wang Cc: virtualization@lists.linux-foundation.org, Stefan Hajnoczi , Laurent Vivier , linux-kernel@vger.kernel.org, Eli Cohen , "Michael S. Tsirkin" , Max Gurtovoy Subject: Re: [PATCH RFC 11/12] vringh: allow vringh_iov_xfer() to skip bytes when ptr is NULL Message-ID: <20201116114854.5vrcjzsvhklpfeud@steredhat> References: <20201113134712.69744-1-sgarzare@redhat.com> <20201113134712.69744-12-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 16, 2020 at 12:32:02PM +0800, Jason Wang wrote: > >On 2020/11/13 下午9:47, Stefano Garzarella wrote: >>In some cases, it may be useful to provide a way to skip a number >>of bytes in a vringh_iov. >> >>In order to keep vringh_iov consistent, let's reuse vringh_iov_xfer() >>logic and skip bytes when the ptr is NULL. >> >>Signed-off-by: Stefano Garzarella >>--- >> >>I'm not sure if this is the best option, maybe we can add a new >>function vringh_iov_skip(). >> >>Suggestions? > > >I might be worth to check whether we can convert vringh_iov to use iov >iterator then we can use iov_iterator_advance() here. Make sense, I'll take a look. Thanks for the suggestion, Stefano