[dpdk-dev,v3,6/6] DPDK changes for accommodating ENIC PMD

Message ID D0995111.28833%ssujith@cisco.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Sujith Sankar Nov. 24, 2014, 3:51 p.m. UTC
  Hi David,

During the testing, I saw that the length field was 0.  ENIC PMD validates the length of the BAR against a max value.
In order to get the length in the resource structure, I added this statement.

Thanks,
-Sujith

From: David Marchand <david.marchand@6wind.com<mailto:david.marchand@6wind.com>>
Date: Monday, 24 November 2014 4:33 pm
To: "Sujith Sankar (ssujith)" <ssujith@cisco.com<mailto:ssujith@cisco.com>>
Cc: "dev@dpdk.org<mailto:dev@dpdk.org>" <dev@dpdk.org<mailto:dev@dpdk.org>>, "Prasad Rao (prrao)" <prrao@cisco.com<mailto:prrao@cisco.com>>
Subject: Re: [dpdk-dev] [PATCH v3 6/6] DPDK changes for accommodating ENIC PMD

Hello Sujith,

On Sun, Nov 23, 2014 at 5:08 PM, Sujith Sankar <ssujith@cisco.com<mailto:ssujith@cisco.com>> wrote:

Not sure I understand why you need to overwrite the length value.
This is supposed to be initialised before by "generic" code.
This looks like a hack or a workaround.

Can you elaborate on this change ?
Thanks.


--
David Marchand
  

Comments

David Marchand Nov. 24, 2014, 4:15 p.m. UTC | #1
Mmm, I am not that familiar with vfio code, but I would say that there is
something buggy in pci_vfio_map_resource() when compared
to pci_uio_map_resource().
Is not there a problem with finding the right index of dev->mem_resource[]
array ?
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index c776ddc..6bf8f2e 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -736,6 +736,7 @@  pci_vfio_map_resource(struct rte_pci_device *dev)
                maps[i].offset = reg.offset;
                maps[i].size = reg.size;
                dev->mem_resource[i].addr = bar_addr;
+               dev->mem_resource[i].len = reg.size;
        }

        /* if secondary process, do not set up interrupts */