From: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
To: Ben Walker <benjamin.walker@intel.com>,
dev@dpdk.org, Jianfeng Tan <jianfeng.tan@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] eal: Support running as unprivileged user
Date: Wed, 18 Jan 2017 17:05:29 +0000 [thread overview]
Message-ID: <b9cef700-7c54-7d28-8396-46953afab48e@intel.com> (raw)
In-Reply-To: <20170103225600.51310-1-benjamin.walker@intel.com>
On 03/01/2017 22:56, Ben Walker wrote:
> For Linux kernel 4.0 and newer, the ability to obtain
> physical page frame numbers for unprivileged users from
> /proc/self/pagemap was removed. Instead, when an IOMMU
> is present, simply choose our own DMA addresses instead.
>
> Signed-off-by: Ben Walker <benjamin.walker@intel.com>
> @@ -255,6 +257,22 @@ find_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
> }
>
> /*
> + * For each hugepage in hugepg_tbl, fill the physaddr value sequentially.
> + */
> +static int
> +set_physaddrs(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
> +{
> + unsigned int i;
> + phys_addr_t addr = 0;
> +
> + for (i = 0; i < hpi->num_pages[0]; i++) {
> + hugepg_tbl[i].physaddr = addr;
> + addr += hugepg_tbl[i].size;
> + }
> + return 0;
> +}
> +
Sorry for late catch, but when having multiple hugepage sizes, both
would be mapped from address 0.
I thin making the var static should be enough.
Also I would prefer some randomness on the start address instead of
always 0.
Thanks,
Sergio
next prev parent reply other threads:[~2017-01-18 17:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-03 22:30 [dpdk-dev] [PATCH] " Ben Walker
2017-01-03 22:56 ` [dpdk-dev] [PATCH v2] " Ben Walker
2017-01-18 17:05 ` Sergio Gonzalez Monroy [this message]
2017-01-31 17:40 ` [dpdk-dev] [PATCH v3] " Ben Walker
2017-01-31 17:44 ` [dpdk-dev] [PATCH v4] " Ben Walker
2017-02-17 14:59 ` Sergio Gonzalez Monroy
2017-03-09 16:10 ` Thomas Monjalon
2017-02-17 19:28 ` Stephen Hemminger
2017-03-09 16:11 ` 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=b9cef700-7c54-7d28-8396-46953afab48e@intel.com \
--to=sergio.gonzalez.monroy@intel.com \
--cc=benjamin.walker@intel.com \
--cc=dev@dpdk.org \
--cc=jianfeng.tan@intel.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).