[dpdk-dev,16/20] cxgbe: copy pci device info to eth_dev data

Message ID 1443445418-18498-17-git-send-email-bernard.iremonger@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Iremonger, Bernard Sept. 28, 2015, 1:03 p.m. UTC
  Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Rahul Lakkireddy Sept. 28, 2015, 6:53 p.m. UTC | #1
Hi Bernard,

On Monday, September 09/28/15, 2015 at 14:03:34 +0100, Bernard Iremonger wrote:
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/cxgbe/cxgbe_ethdev.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
> index 478051a..2fa2cc3 100644
> --- a/drivers/net/cxgbe/cxgbe_ethdev.c
> +++ b/drivers/net/cxgbe/cxgbe_ethdev.c
> @@ -2,6 +2,8 @@
>   *   BSD LICENSE
>   *
>   *   Copyright(c) 2014-2015 Chelsio Communications.
> + *   Copyright(c) 2015 Intel Corporation.
> + *
>   *   All rights reserved.
>   *
>   *   Redistribution and use in source and binary forms, with or without
> @@ -744,6 +746,9 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev)
>  		return 0;
>  
>  	pci_dev = eth_dev->pci_dev;
> +
> +	rte_eth_copy_dev_info(eth_dev, pci_dev);
> +
>  	snprintf(name, sizeof(name), "cxgbeadapter%d", eth_dev->data->port_id);
>  	adapter = rte_zmalloc(name, sizeof(*adapter), 0);
>  	if (!adapter)
> -- 
> 1.9.1
> 

Out of curiosity, do you really need to add Intel copyright on top of source
file for a 3 line change in source file? I see that you have done the same for
cisco, mellanox, broadcom and other vendors as well.

I don't claim to understand Copyright very well. However, I have seen in other
open community projects like kernel.org where people many times do significant
change in someone else's code and yet, don't normally add their own copyright
to source files.

Care to explain what is the intention here with addition of Intel Copyright
statement?

Thanks,
Rahul
  
Iremonger, Bernard Sept. 29, 2015, 8:41 a.m. UTC | #2
Hi Rahul,

<snip>

> Out of curiosity, do you really need to add Intel copyright on top of source
> file for a 3 line change in source file? I see that you have done the same for
> cisco, mellanox, broadcom and other vendors as well.
> 
> I don't claim to understand Copyright very well. However, I have seen in
> other
> open community projects like kernel.org where people many times do
> significant
> change in someone else's code and yet, don't normally add their own
> copyright
> to source files.
> 
> Care to explain what is the intention here with addition of Intel Copyright
> statement?
> 
> Thanks,
> Rahul

I thought it was necessary to add the Intel Copyright, because I had modified the code.
I will remove it in the next revision of the patchset.

Regards,

Bernard.
  

Patch

diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 478051a..2fa2cc3 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -2,6 +2,8 @@ 
  *   BSD LICENSE
  *
  *   Copyright(c) 2014-2015 Chelsio Communications.
+ *   Copyright(c) 2015 Intel Corporation.
+ *
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -744,6 +746,9 @@  static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	pci_dev = eth_dev->pci_dev;
+
+	rte_eth_copy_dev_info(eth_dev, pci_dev);
+
 	snprintf(name, sizeof(name), "cxgbeadapter%d", eth_dev->data->port_id);
 	adapter = rte_zmalloc(name, sizeof(*adapter), 0);
 	if (!adapter)