From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 06CD5A0C45; Thu, 28 Oct 2021 10:18:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B90A94067B; Thu, 28 Oct 2021 10:18:53 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id BDACC4003F for ; Thu, 28 Oct 2021 10:18:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635409132; 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: in-reply-to:in-reply-to:references:references; bh=Rc0CF7pOAnDeTccqeM0PLlUxPb2nOyRavO0dTq58/vM=; b=PZKhTAHL4VfvtyfHt9H3nssE1ec6wPXBLeslsxid3w1o7PZ9miR+LLEbaR9AsIAWgM7te4 7wgIyD9K2/LX5zOQWWP83L1n2A7iBuHf9ImzsaIj0PPT3sQ+Le0CuJ+TM17xxwFuuBStuQ kObeSQ0a7xrz9vSgE5NPrrm4Jm2r+AU= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-510-mhMppVWLMLOzw4ifK9_28Q-1; Thu, 28 Oct 2021 04:18:50 -0400 X-MC-Unique: mhMppVWLMLOzw4ifK9_28Q-1 Received: by mail-lf1-f70.google.com with SMTP id g6-20020a0565123b8600b003ffa7685526so2525652lfv.21 for ; Thu, 28 Oct 2021 01:18:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rc0CF7pOAnDeTccqeM0PLlUxPb2nOyRavO0dTq58/vM=; b=MilThHzlkohrHd7XW4ldQTA7wRZA+R/EBaU/o9VTyv9GvYTQkccH+oH8lNBxyPT8OO D8Q5DB93GR9Y59N+1DacXXx6HBiSm6vW4HooJ+v6BwPAFjikPQImPlFr3Y+fHEqbS7u/ Qp4Fi7CHgBWpKEWduQ+TWngH1zBjwqtZCjK4mDE3A9kgreC/IqSaZP1U+r/WLwTDBeos Qkz35kbFoho9tWk1GXzEhuhGIG9Cz6nCynzskf1kyFVTU76TE62YfESUUAwCEoUtolGw mRNh6m/UWE8DFooxCFZEmcy6qaWED1ZnWcUW2yqCFoY9DCF3s9PjdXAlO0UI3x+KhErk lPNA== X-Gm-Message-State: AOAM532DJfI5osL14wotkuI5+LVFW9gUwSTnEhq+7v/NUYJzmP69XVHp uFGo5KpU3C5z3KKOwl8zSae9idAuulrPlD3Er/iwBBRj+8t9vMSiFLAB285HO8Ae7PgIXCPwYFZ vrF2RbDXaxH1c9S+AeuU= X-Received: by 2002:a05:651c:1107:: with SMTP id d7mr3058191ljo.81.1635409129424; Thu, 28 Oct 2021 01:18:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyA6OSlDsFRSA2NG91eindnqurDBq0CYoTEHeqjohM/YlJQeO+S/MZ39n2MOZoMjwDXUIldGPQk5vtiBMxYiM= X-Received: by 2002:a05:651c:1107:: with SMTP id d7mr3058172ljo.81.1635409129245; Thu, 28 Oct 2021 01:18:49 -0700 (PDT) MIME-Version: 1.0 References: <043fc2d53770da8248b9cd0214775f9d41f2e0fb.1631273229.git.anatoly.burakov@intel.com> <9972054c-c68f-5b8c-d8cd-2330fce82369@intel.com> In-Reply-To: <9972054c-c68f-5b8c-d8cd-2330fce82369@intel.com> From: David Marchand Date: Thu, 28 Oct 2021 10:18:38 +0200 Message-ID: To: "Burakov, Anatoly" Cc: dev , Bruce Richardson , Ray Kinsella , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Xuan Ding , "Yigit, Ferruh" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v1 1/1] vfio: add page-by-page mapping API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Sep 29, 2021 at 12:19 PM Burakov, Anatoly wrote: > > @@ -2179,7 +2208,29 @@ rte_vfio_container_dma_map(int container_fd, uint64_t vaddr, uint64_t iova, > > return -1; > > } > > > > - return container_dma_map(vfio_cfg, vaddr, iova, len); > > + /* not having page size means we map entire segment */ > > + return container_dma_map(vfio_cfg, vaddr, iova, len, 0); > > +} > > + > > +int > > +rte_vfio_container_dma_map_paged(int container_fd, uint64_t vaddr, > > + uint64_t iova, uint64_t len, uint64_t pagesz) > > +{ > > + struct vfio_config *vfio_cfg; > > + > > + if (len == 0 || pagesz == 0 || !rte_is_power_of_2(pagesz) || > > + (len % pagesz) != 0) { > > This should also check if VA/IOVA is page-aligned. Will fix in v2. Can you send v2? Thanks. -- David Marchand