DPDK patches and discussions
 help / color / mirror / Atom feed
From: 陈毅强 <chenyq3@wangsu.com>
To: dev@dpdk.org
Subject: [dpdk-dev] Question about “PCI memorymmap”
Date: Thu, 2 Jul 2020 10:49:29 +0800 (GMT+08:00)	[thread overview]
Message-ID: <2009b3d5.1b5b.1730d6dd9cb.Coremail.chenyq3@wangsu.com> (raw)

Hi,ALL

  We fail to start dpdk in a newly deployed machine.Failed progress works in proc-type=secondary mode. (DPDK version 16.04).Some logs are shown below

=========================================================================================

Primary progress:

EAL: PCI device 0000:04:00.1 on NUMA socket 0
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7ffff5c04000
EAL:   PCI memory mapped at 0x7ffff6004000
PMD: eth_ixgbe_dev_init(): MAC: 2, PHY: 12, SFP+: 4
PMD: eth_ixgbe_dev_init(): port 1 vendorID=0x8086 deviceID=0x10fb
EAL: PCI device 0000:82:00.0 on NUMA socket 1
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7fffec3ff000
EAL:   PCI memory mapped at 0x7ffff7ff4000
PMD: eth_ixgbe_dev_init(): MAC: 2, PHY: 12, SFP+: 3
PMD: eth_ixgbe_dev_init(): port 2 vendorID=0x8086 deviceID=0x10fb
EAL: PCI device 0000:82:00.1 on NUMA socket 1
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7ffed25d9000
EAL:   PCI memory mapped at 0x7ffff7ff0000




Secondary progress logs:


PMD: ixgbe_set_rx_function(): Rx Burst Bulk Alloc Preconditions are satisfied. Rx Burst Bulk Alloc function will be used on port=0.
EAL: PCI device 0000:04:00.1 on NUMA socket 0
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7ffff5c04000
EAL:   PCI memory mapped at 0x7ffff6004000
PMD: ixgbe_set_tx_function(): Using simple tx code path
PMD: ixgbe_set_rx_function(): Port[1] doesn't meet Vector Rx preconditions or RTE_IXGBE_INC_VECTOR is not enabled
PMD: ixgbe_set_rx_function(): Rx Burst Bulk Alloc Preconditions are satisfied. Rx Burst Bulk Alloc function will be used on port=1.
EAL: PCI device 0000:82:00.0 on NUMA socket 1
EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
EAL:   PCI memory mapped at 0x7ffff65d8000
EAL: Cannot mmap device resource file /sys/bus/pci/devices/0000:82:00.0/resource0 to address: 0x7fffec3ff000
EAL: Error - exiting with code: 1
  Cause: Requested device 0000:82:00.0 cannot be used

==================================================================================

Relevant code is list be below:




pci_uio_map_secondary(struct rte_pci_device *dev)
{
int fd, i;
struct mapped_pci_resource *uio_res;
struct mapped_pci_res_list *uio_res_list =
RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);


TAILQ_FOREACH(uio_res, uio_res_list, next) {


/* skip this element if it doesn't match our PCI address */
if (rte_eal_compare_pci_addr(&uio_res->pci_addr, &dev->addr))
continue;


for (i = 0; i != uio_res->nb_maps; i++) {
/*
* open devname, to mmap it
*/
fd = open(uio_res->maps[i].path, O_RDWR);
if (fd < 0) {
RTE_LOG(ERR, EAL, "Cannot open %s: %s\n",
uio_res->maps[i].path, strerror(errno));
return -1;
}


void *mapaddr = pci_map_resource(uio_res->maps[i].addr,
fd, (off_t)uio_res->maps[i].offset,
(size_t)uio_res->maps[i].size, 0);
/* fd is not needed in slave process, close it */
close(fd);
if (mapaddr != uio_res->maps[i].addr) {
RTE_LOG(ERR, EAL,
"Cannot mmap device resource file %s to address: %p\n",
uio_res->maps[i].path,
uio_res->maps[i].addr);
return -1;
}
}
return 0;
}


RTE_LOG(ERR, EAL, "Cannot find resource for device\n");
return 1;
}







And We check the system config . ASLR is not enabled on our system.  I wondered why mapaddr != uio_res->maps[i].addr .Can anyone tell me why?







Thanks in advance.
















             reply	other threads:[~2020-07-02 11:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02  2:49 陈毅强 [this message]
2020-09-25 15:15 ` Burakov, Anatoly
  -- strict thread matches above, loose matches on Subject: below --
2020-07-08  1:26 陈毅强
2020-07-02  2:43 陈毅强

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=2009b3d5.1b5b.1730d6dd9cb.Coremail.chenyq3@wangsu.com \
    --to=chenyq3@wangsu.com \
    --cc=dev@dpdk.org \
    /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).