cxgb4/cxgb4vf: Assign netdev->dev_port with port ID
authorArjun V <arjun@chelsio.com>
Thu, 8 Dec 2016 12:39:23 +0000 (18:09 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Dec 2016 23:20:08 +0000 (18:20 -0500)
Added missing dev_port assignment in cxgb4vf driver.
Also made dev_port assignment of cxgb4 in sync with cxgb4vf driver.

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Arjun V <arjun@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

index 57eb4e1345cb00a49666d1ff147aa4ef971d3d26..19dc9e25aa72d20e0050f5b3f2080e9704647f71 100644 (file)
@@ -4931,6 +4931,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
         */
        for_each_port(adapter, i) {
                pi = adap2pinfo(adapter, i);
+               adapter->port[i]->dev_port = pi->lport;
                netif_set_real_num_tx_queues(adapter->port[i], pi->nqsets);
                netif_set_real_num_rx_queues(adapter->port[i], pi->nqsets);
 
index 20dec85da63db1fd2d871bf35f10368c5db39ab9..e8139514d32ca5ee2df37167d480681e381e37ae 100644 (file)
@@ -7851,7 +7851,6 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf)
                        return ret;
 
                memcpy(adap->port[i]->dev_addr, addr, ETH_ALEN);
-               adap->port[i]->dev_port = j;
                j++;
        }
        return 0;
index 100b2cc064a34cafe8faac0e16e9ce44aa1a4f95..a37481c04a87b6a16541e1d2786a2357a946d82d 100644 (file)
@@ -2969,6 +2969,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
 
                netdev->netdev_ops = &cxgb4vf_netdev_ops;
                netdev->ethtool_ops = &cxgb4vf_ethtool_ops;
+               netdev->dev_port = pi->port_id;
 
                /*
                 * Initialize the hardware/software state for the port.