From: Shahaf Shuler <shahafs@mellanox.com>
To: David Marchand <david.marchand@redhat.com>,
Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev <dev@dpdk.org>,
"Damjan Marion (damarion)" <damarion@cisco.com>,
Thomas Monjalon <thomas@monjalon.net>,
Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>,
dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] vfio: fix getting default container
Date: Tue, 5 Nov 2019 12:38:21 +0000 [thread overview]
Message-ID: <AM0PR0502MB379506EBD6C0CA843D3C78BAC37E0@AM0PR0502MB3795.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <CAJFAV8yevu9Z3piNsrQrA_tdahHcoYg0Z44WiXb_zWXniBCHew@mail.gmail.com>
Monday, November 4, 2019 9:35 PM, David Marchand:
> Subject: Re: [PATCH] vfio: fix getting default container
>
> On Mon, Nov 4, 2019 at 6:41 PM Anatoly Burakov
> <anatoly.burakov@intel.com> 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 <anatoly.burakov@intel.com>
> > ---
> > 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/eal/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 == RTE_VFIO_DEFAULT_CONTAINER_FD)
> > + return default_vfio_cfg;
> > +
> > for (i = 0; i < VFIO_MAX_CONTAINERS; i++) {
> > if (vfio_cfgs[i].vfio_container_fd == container_fd)
> > return &vfio_cfgs[i];
> > --
> > 2.17.1
>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
>
> Shahaf, can you review this patch please?
> Thanks.
Looks good. Thanks for spotting this.
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
>
> --
> David Marchand
next prev parent reply other threads:[~2019-11-05 12:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-04 17:41 Anatoly Burakov
2019-11-04 19:35 ` David Marchand
2019-11-05 12:38 ` Shahaf Shuler [this message]
2019-11-06 13:44 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AM0PR0502MB379506EBD6C0CA843D3C78BAC37E0@AM0PR0502MB3795.eurprd05.prod.outlook.com \
--to=shahafs@mellanox.com \
--cc=anatoly.burakov@intel.com \
--cc=damarion@cisco.com \
--cc=dariuszx.stojaczyk@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).