[dpdk-dev,2/7] eal: Helper to convert to struct rte_pci_device

Message ID 1479636327-4166-2-git-send-email-jblunck@infradead.org (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

Jan Blunck Nov. 20, 2016, 10:05 a.m. UTC
  Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
 lib/librte_eal/common/include/rte_pci.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

David Marchand Nov. 20, 2016, 3:20 p.m. UTC | #1
Hello Jan,

On Sun, Nov 20, 2016 at 11:05 AM, Jan Blunck <jblunck@infradead.org> wrote:
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
> ---
>  lib/librte_eal/common/include/rte_pci.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
> index 9ce8847..0376160 100644
> --- a/lib/librte_eal/common/include/rte_pci.h
> +++ b/lib/librte_eal/common/include/rte_pci.h
> @@ -160,6 +160,8 @@ struct rte_pci_device {
>         enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>  };
>
> +#define ETH_DEV_PCI_DEV(ptr) ((ptr)->pci_dev)
> +
>  /** Any PCI device identifier (vendor, device, ...) */
>  #define PCI_ANY_ID (0xffff)
>  #define RTE_CLASS_ANY_ID (0xffffff)

This should come from ethdev, not eal.
  
Jan Blunck Nov. 21, 2016, 4:57 p.m. UTC | #2
On Sun, Nov 20, 2016 at 4:20 PM, David Marchand
<david.marchand@6wind.com> wrote:
> Hello Jan,
>
> On Sun, Nov 20, 2016 at 11:05 AM, Jan Blunck <jblunck@infradead.org> wrote:
>> Signed-off-by: Jan Blunck <jblunck@infradead.org>
>> ---
>>  lib/librte_eal/common/include/rte_pci.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
>> index 9ce8847..0376160 100644
>> --- a/lib/librte_eal/common/include/rte_pci.h
>> +++ b/lib/librte_eal/common/include/rte_pci.h
>> @@ -160,6 +160,8 @@ struct rte_pci_device {
>>         enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
>>  };
>>
>> +#define ETH_DEV_PCI_DEV(ptr) ((ptr)->pci_dev)
>> +
>>  /** Any PCI device identifier (vendor, device, ...) */
>>  #define PCI_ANY_ID (0xffff)
>>  #define RTE_CLASS_ANY_ID (0xffffff)
>
> This should come from ethdev, not eal.
>

Fixed in v2.

Thanks,
Jan
  

Patch

diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index 9ce8847..0376160 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -160,6 +160,8 @@  struct rte_pci_device {
 	enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
 };
 
+#define ETH_DEV_PCI_DEV(ptr) ((ptr)->pci_dev)
+
 /** Any PCI device identifier (vendor, device, ...) */
 #define PCI_ANY_ID (0xffff)
 #define RTE_CLASS_ANY_ID (0xffffff)