From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by dpdk.org (Postfix) with ESMTP id AF675316B for ; Sun, 11 Dec 2016 00:21:18 +0100 (CET) Received: by mail-oi0-f42.google.com with SMTP id v84so54561501oie.3 for ; Sat, 10 Dec 2016 15:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=rjAywtZG04Jt+Sm9c2dHRXqbUeMcsJucq1DDw48AR1E=; b=FlYru/zFTUxTTXN5ZUySHPE4Q1D/aCgGqlb9WgFObEp28GsXEn6V8h2kpk2MOo1RDj F9jckzPuyhzR0rK0XRCs1XUJgWsLtykH2UxXlOmPTStyH7jB3szIstrS0JW7G6lnEFrA +NzZgSM9PdDIZmqqqhMsvVtAkymQsfF5kV4NdPUJaLIlUpQmvxjwYE/0tLBbbutgH5AV MpBJPDh+QxKq4YJtUM+FCmo52df2X7Sr7ikvHUm/n+1UYSdE4ls6Blj28tJwcSE10geE +FaeKXw5frjLPH7ctOMKAWf7+j1p0rbs0ysKbBrQV9v8WuxbYR6/18LxajSqFypQdhqA mfaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=rjAywtZG04Jt+Sm9c2dHRXqbUeMcsJucq1DDw48AR1E=; b=WlvOfIpH6DV9ywomG/YHey37oKKjqVk3LcgWkB50HfWlf8Ht9qOHZETExMCqJm13kQ mdnlMJGLbQ1IlwdG5Zvki7NrDfsIlQ7F+iVOCfenkEt5fEd/PnhQeh1yaMHdCfyPcczs JVkagymG2ozrT/a+4kDkZmlv6kPwyGiB4fep6yJKGwQNt7DF8VI3Thfr1fEZVmqHe+/N Gv8dFeq/wvu/XX7w73kW9eeV07sm7biochRKKWeSuntCic9fHFuUMYhcgKoA5NW5z5Vd cU0V+fx5x1mhGH20Z9M+DCTIGLbNb9vo4h0J8y8LhmPIrWLjSsKufKG7VOUs7kj6h6zE Fekw== X-Gm-Message-State: AKaTC02HpLSjEaeYSQab6ibkKqmUw+kBDLfTUu/QER0kyBsnTYSoOWSoR3txrJzskPA/jvVPMjrk34aNveStjg== X-Received: by 10.157.36.135 with SMTP id z7mr51414479ota.124.1481412078005; Sat, 10 Dec 2016 15:21:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.72.166 with HTTP; Sat, 10 Dec 2016 15:21:17 -0800 (PST) In-Reply-To: References: From: Gopakumar Choorakkot Edakkunni Date: Sat, 10 Dec 2016 15:21:17 -0800 Message-ID: To: dev@dpdk.org, Olivier Matz Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] dpdk16.07 and virtio "Cannot mmap IO port resource" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2016 23:21:19 -0000 Hi Oliver, Looking at the kernel code pci_mmap_resource()--->pci_mmap_fits(), it looks like pci_mmap_fits() expects that the "number of pages" requested to map is no larger than the actual size of the pci resource. But in pci_uio_ioport_map() what is passed as the requested size is the end_addr of the resource, which in my case is 0xc09f, but the size of the resource itself is 0x20 and hence kernel expects one page - but 0xc09f+1 (end_addr+1) gets translated to 13 pages ! And I guess that leads to the mmap to fail .. Thoughts on this ? Rgds, Gopa. On Fri, Dec 9, 2016 at 8:30 PM, Gopakumar Choorakkot Edakkunni < gopakumar.c.e@gmail.com> wrote: > I tried to load up dpdk (bound to uio_pci_generic, tried igb_uio also!) on > a virtio interface. Dpdk exits with the "Cannot mmap IO port resource" > complaint - the call chain is legacy_virtio_resource_init()-->pci_uio_ioport_map(). > > > If anyone can give any clues/pointers as to what might be wrong, that can > greatly help in getting me on the right track fast ! > > --- > EAL: probe driver: 1af4:1000 rte_virtio_pmd > EAL: PCI device 0000:00:05.0 on NUMA socket 0 > EAL: probe driver: 1af4:1000 r[ 330.753458] ------------[ cut here > ]------------ > rte_virtio_pmd > [ 330.754430] WARNING: CPU: 0 PID: 8063 at drivers/pci/pci-sysfs.c:984 > pci_mmap_resource.isra.14+0x113/0x1b0() > [ 330.756083] process "dpdk_master" tried to map 0x0000d000 bytes at page > 0x00000000 on 0000:00:05.0 BAR 0 (start 0x c080, size > 0x 20) > [ 330.758272] Modules linked in: rte_kni igb_uio pppoe ppp_async > iptable_nat cdc_mbim sierra_net rndis_host qmi_wwan qcserial pppox > ppp_generic option nf_nat_pptp nf_nat_ipv4 nf_nat_amanda nf_conntrack_pptp > nf_conntrack_ipv4 nf_conntrack_amanda ipt_MASQUERADE huawei_cdc_ncm > cdc_subset cdc_ncm cdc_ether cdc_eem ax88179_178a asix xt_u32 xt_time > xt_tcpmss xt_string xt_statistic xt_state xt_socket xt_recent xt_quota > xt_pkttype xt_physdev xt_owner xt_nat xt_multiport xt_mark xt_mac xt_limit > xt_length xt_iprange xt_id xt_hl xt_helper xt_hashlimit xt_esp xt_ecn > xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment > xt_addrtype xt_TPROXY xt_TEE xt_TCPMSS xt_REDIRECT xt_NETMAP xt_LOG xt_LED > xt_HL xt_DSCP xt_CT xt_CLASSIFY usbnet usb_wwan ts_kmp ts_fsm ts_bm slhc > sierra pl2303 nfnetlink_queue nfnetlink_log nf_nat_tftp nf_nat_snmp_basic > nf_nat_sip nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat > nf_defrag_ipv4 nf_conntrack_tftp nf_conntrack_snmp nf_conntrack_sip > nf_conntrack_proto_gre nf_conntrack_netlink nf_conntrack_irc > nf_conntrack_h323 nf_conntrack_ftp nf_conntrack_broadcast > lib80211_crypt_wep lib80211_crypt_tkip lib80211_crypt_ccmp lib80211 > iptable_raw iptable_mangle iptable_filter ipt_ah ipt_ULOG ipt_REJECT > ipt_ECN hso ftdi_sio crc8 crc7 crc_itu_t crc_ccitt cp210x cordic > compat_xtables cdc_wdm cdc_acm arptable_filter arpt_mangle arp_tables > sch_teql sch_tbf sch_sfq sch_red sch_prio sch_netem sch_htb sch_gred > sch_dsmark sch_codel em_text em_nbyte em_meta em_cmp cls_basic act_police > act_ipt act_connmark act_skbedit act_mirred em_u32 cls_u32 cls_tcindex > cls_flow cls_route cls_fw sch_hfsc sch_ingress evdev xt_NFQUEUE xt_set > ip_set_list_set ip_set_hash_netport ip_set_hash_netiface ip_set_hash_net > ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport > ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip > ip_set nfnetlink sr_mod cdrom ip6t_REJECT ip6table_raw ip6table_mangle > ip6table_filter ip6_tables nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 > ifb ipip ip6_tunnel tunnel6 tunnel4 ip_tunnel tun mdio loop vfat fat isofs > nls_utf8 nls_iso8859_15 nls_iso8859_1 nls_cp850 nls_cp437 rfkill virtio_rng > sha512_generic sha256_generic sha1_generic md5 arc4 ath10k_pci ath10k_core > ath9k ath9k_common ath9k_hw ath mac80211 cfg80211 compat pcnet32 e1000 > virtio_net ohci_hcd ixgbevf ixgbe hwmon igbvf igb dsa_core mii [last > unloaded: igb_uio] > [ 330.805110] CPU: 0 PID: 8063 Comm: dpdk_master Tainted: G W > 3.14.67 #1 > [ 330.806104] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS > Bochs 01/01/2011 > [ 330.806104] 0000000000000286 0000000000000000 ffffffff814e167c > 0000000000000006 > [ 330.806104] ffff88008b573cd8 ffffffff81259d73 ffffffff81061b72 > ffff88013b24fae0 > [ 330.806104] ffff88013b24f800 0000000000000000 ffff88013a498000 > ffff88013b24f8a8 > [ 330.806104] Call Trace: > [ 330.806104] [] ? dump_stack+0x5e/0x7a > [ 330.806104] [] ? pci_mmap_resource.isra.14+0x11 > 3/0x1b0 > [ 330.806104] [] ? warn_slowpath_common+0x82/0xb0 > [ 330.806104] [] ? warn_slowpath_fmt+0x45/0x50 > [ 330.806104] [] ? do_last.isra.58+0xac1/0xc00 > [ 330.806104] [] ? pci_mmap_resource.isra.14+0x11 > 3/0x1b0 > [ 330.806104] [] ? kernfs_fop_mmap+0x69/0x100 > [ 330.806104] [] ? mmap_region+0x2e8/0x560 > [ 330.806104] [] ? do_mmap_pgoff+0x318/0x3b0 > [ 330.806104] [] ? vm_mmap_pgoff+0x74/0xc0 > [ 330.806104] [] ? SyS_mmap_pgoff+0x18a/0x1e0 > [ 330.806104] [] ? system_call_fastpath+0x16/0x1b > [ 330.823897] ---[ end trace c6106b67c768d501 ]--- > EAL: Cannot mmap IO port resource: Invalid argument > EAL: Error - exiting with code: 1 > Cause: Requested device 0000:00:05.0 cannot be used >