From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9C75A0353 for ; Mon, 4 Nov 2019 20:35:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 906B1316B; Mon, 4 Nov 2019 20:35:26 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 2A69C2C37 for ; Mon, 4 Nov 2019 20:35:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572896123; 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=k+uR67M8wYjSJv9VRVuosXUXmuPk2bTcOuQ7HawG9Vw=; b=ANzikH+XvDx5TplseTOqblSYUskOrcy4/3dGXJzd35ByqSLxPoMlWnVGreqFaESP2p6dfT Kc8xSyr+pesCyfGsKaxvnEkWRo0nKIJPPPLfWMfwef7radnedl1k2SyZwmHz2AvC1aFsMJ 4UxEFj21TFi9qN3GzSEVa52YpsX4pTo= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-79-tLhkLIoKOXO2e5pYvsNesA-1; Mon, 04 Nov 2019 14:35:22 -0500 Received: by mail-vs1-f72.google.com with SMTP id m188so2972855vsd.4 for ; Mon, 04 Nov 2019 11:35:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K7p6nzxXb1Crjz85R+aIKUuOzNLinysrVyIv/Ex6QkM=; b=fW2H9pCbIaTyGdwXMwZrDJwnrLXXlcr79GVyywPJY5y87vN5cAPTAmSd17BpCDDINl G4cnVNavBittEkkyPOcArEFJGteCSxujU+CANUIRXN85e9tTW+6rdT8jaXr0juETmGCS hWk8HJPt6BocvEfEUEup5BQfxHHl1lYuyJQ1n2BCafP3eO/ni/r+8gJzmfZQHNHq9CWh +ilaYAb9ufZkztKtTUZZ3tykTDHj3WFn5lNDWgjiMMXJUCK9QBvkh3vz7ohl/Mf9YKCX 8ZoJUA1hAgWw12KnLf6yVD2lxaOoydQxqfmVzMV1R+QYiTziifZkccsGujxmv/VTiC7r y5Ww== X-Gm-Message-State: APjAAAVK0WFkuHL2PR2hXPKr3Uif0cBI8pSlI/V60vd4pOhejqndOjYD ck4CpRoCB07m+lYPV+LdItCbhnoBBYo2NWP8U9ECuISXFtolcATYOsd0ZXLs1o/39dGIK16ZvHm 1ozafNfpxIn/yWdXvgwfqLVg= X-Received: by 2002:a67:bd05:: with SMTP id y5mr4351762vsq.180.1572896121659; Mon, 04 Nov 2019 11:35:21 -0800 (PST) X-Google-Smtp-Source: APXvYqz4ObOOZECD8fgI7i99qxOx83DlcjaNdioPHWK58NAIBQ7HgXbdq7dicjOoJV75w+VWouwinh0nmu9hj3cqFME= X-Received: by 2002:a67:bd05:: with SMTP id y5mr4351736vsq.180.1572896121169; Mon, 04 Nov 2019 11:35:21 -0800 (PST) MIME-Version: 1.0 References: <9bfc4c6d563f29ca4ef5cca80e650928e51e5514.1572889140.git.anatoly.burakov@intel.com> In-Reply-To: <9bfc4c6d563f29ca4ef5cca80e650928e51e5514.1572889140.git.anatoly.burakov@intel.com> From: David Marchand Date: Mon, 4 Nov 2019 20:35:10 +0100 Message-ID: To: Anatoly Burakov , Shahaf Shuler Cc: dev , "Damjan Marion (damarion)" , Thomas Monjalon , Dariusz Stojaczyk , dpdk stable X-MC-Unique: tLhkLIoKOXO2e5pYvsNesA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-stable] [PATCH] vfio: fix getting default container X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Mon, Nov 4, 2019 at 6:41 PM Anatoly Burakov wrote: > > When requesting DMA mapping to default container, we are meant to > supply the RTE_VFIO_DEFAULT_CONTAINER_FD value, however this is > not handled correctly by get_vfio_cfg_by_container_fd(), because > it only looks at actual fd values and does not check for this > special case. > > Fix it to return default container if the fd requested is the > special RTE_VFIO_DEFAULT_CONTAINER_FD value. > > Fixes: 4f5519ed8349 ("vfio: cleanup getting group fd") RTE_VFIO_DEFAULT_CONTAINER_FD has been introduced in 4106d89a18f8 ("vfio: allow DMA map to the default container") (19.05) as part of the rework deprecating rte_vfio_dma_map. > > Signed-off-by: Anatoly Burakov > --- > lib/librte_eal/linux/eal/eal_vfio.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/linux/e= al/eal_vfio.c > index d9541b1220..d7887388f9 100644 > --- a/lib/librte_eal/linux/eal/eal_vfio.c > +++ b/lib/librte_eal/linux/eal/eal_vfio.c > @@ -412,6 +412,9 @@ get_vfio_cfg_by_container_fd(int container_fd) > { > int i; > > + if (container_fd =3D=3D RTE_VFIO_DEFAULT_CONTAINER_FD) > + return default_vfio_cfg; > + > for (i =3D 0; i < VFIO_MAX_CONTAINERS; i++) { > if (vfio_cfgs[i].vfio_container_fd =3D=3D container_fd) > return &vfio_cfgs[i]; > -- > 2.17.1 Reviewed-by: David Marchand Shahaf, can you review this patch please? Thanks. --=20 David Marchand