cxgbe: fix PCI info copy to ports under same PF
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Thu, 25 Feb 2016 09:37:53 +0000 (15:07 +0530)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 15:55:01 +0000 (16:55 +0100)
Chelsio NIC ports share a single PF. Move rte_eth_copy_pci_info()
to copy the pci device information to the remaining ports as well.

Also update license year to 2016.

Fixes: eeefe73f0af1 ("drivers: copy PCI device info to ethdev data")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/cxgbe/cxgbe_main.c

index 1a4293d..8c6dd59 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2014-2015 Chelsio Communications.
+ *   Copyright(c) 2014-2016 Chelsio Communications.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -819,8 +819,6 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev)
 
        pci_dev = eth_dev->pci_dev;
 
-       rte_eth_copy_pci_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)
index 684a761..ceaf5ab 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2014-2015 Chelsio Communications.
+ *   Copyright(c) 2014-2016 Chelsio Communications.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -1169,6 +1169,9 @@ allocate_mac:
                pi->eth_dev->dev_ops = adapter->eth_dev->dev_ops;
                pi->eth_dev->tx_pkt_burst = adapter->eth_dev->tx_pkt_burst;
                pi->eth_dev->rx_pkt_burst = adapter->eth_dev->rx_pkt_burst;
+
+               rte_eth_copy_pci_info(pi->eth_dev, pi->eth_dev->pci_dev);
+
                TAILQ_INIT(&pi->eth_dev->link_intr_cbs);
 
                pi->eth_dev->data->mac_addrs = rte_zmalloc(name,