From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: Alejandro Lucero <alejandro.lucero@netronome.com>
Cc: dev <dev@dpdk.org>, Felix Marti <felix@chelsio.com>,
Nirranjan Kirubaharan <nirranjan@chelsio.com>,
Kumar Sanghvi <kumaras@chelsio.com>
Subject: Re: [dpdk-dev] [PATCH v2] vfio: Fix overflow while assigning vfio BAR region offset and size
Date: Tue, 7 Jul 2015 13:26:25 +0530 [thread overview]
Message-ID: <20150707075623.GA28061@scalar.blr.asicdesigners.com> (raw)
In-Reply-To: <CAD+H990F7G2XntE9gzgZ=rCj-74srT2+i01gDqAd1-w6dJHv7A@mail.gmail.com>
Hi Alejandro,
On Mon, Jul 06, 2015 at 16:45:01 +0100, Alejandro Lucero wrote:
> Hi all,
>
> From the kernel VFIO maintainer:
>
> "I suppose in the short term, mmap should not be advertised as available
> on 32bit hosts. Thanks,"
>
> So, as VFIO support for 32bit systems is broken, DPDK should not configure
> VFIO in that case.
>
Thank you very much for the clarification.
>
> If we need to support 4G BARs, our only choice is really to extend the
> vfio region support for a separate file descriptor per region. The only
> devices I'm aware of with 4G BARs are Nvidia Tesla. This is possible,
> but I would expect such devices would be extremely rare on 32bit hosts.
>
Our Chelsio T5 cards can also have 4G bar size. So, it seems this won't work
on 32-bit with current state of kernel vfio driver.
Nevertheless, updating your patch with below diff works fine on 64-bit
for vfio testing on Chelsio T5 cards and it compiles for 32-bit targets
as well.
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index 426953a..6127f5f 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -728,7 +728,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
struct vfio_region_info reg = { .argsz = sizeof(reg) };
void *bar_addr;
struct memreg {
- uint32_t offset, size;
+ unsigned long offset, size;
} memreg[2] = {};
reg.index = i;
@@ -771,7 +771,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
RTE_LOG(DEBUG, EAL,
"Trying to map BAR %d that contains the MSI-X "
"table. Trying offsets: "
- "%04x:%04x, %04x:%04x\n", i,
+ "0x%04lx:0x%04lx, 0x%04lx:0x%04lx\n", i,
memreg[0].offset, memreg[0].size,
memreg[1].offset, memreg[1].size);
}
Thanks,
Rahul
next prev parent reply other threads:[~2015-07-07 7:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 14:16 [dpdk-dev] [PATCH] " Rahul Lakkireddy
2015-06-17 12:09 ` Thomas Monjalon
2015-06-18 14:23 ` Rahul Lakkireddy
2015-06-23 15:00 ` [dpdk-dev] [PATCH v2] " Rahul Lakkireddy
2015-06-30 21:12 ` Thomas Monjalon
2015-07-01 8:34 ` Alejandro Lucero
2015-07-01 10:00 ` Burakov, Anatoly
2015-07-06 15:45 ` Alejandro Lucero
2015-07-07 7:56 ` Rahul Lakkireddy [this message]
2015-07-07 9:08 ` Burakov, Anatoly
2015-07-07 10:40 ` Rahul Lakkireddy
2015-07-07 10:50 ` Burakov, Anatoly
2015-07-10 9:54 ` Rahul Lakkireddy
2015-07-10 17:27 ` Alejandro Lucero
2015-07-13 8:51 ` [dpdk-dev] [PATCH v3] " Rahul Lakkireddy
2015-07-14 8:56 ` Thomas Monjalon
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=20150707075623.GA28061@scalar.blr.asicdesigners.com \
--to=rahul.lakkireddy@chelsio.com \
--cc=alejandro.lucero@netronome.com \
--cc=dev@dpdk.org \
--cc=felix@chelsio.com \
--cc=kumaras@chelsio.com \
--cc=nirranjan@chelsio.com \
/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).