net/cxgbe: report configured link auto-negotiation
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Wed, 23 May 2018 18:00:49 +0000 (23:30 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 14 Jun 2018 17:27:50 +0000 (19:27 +0200)
Report current configured link auto-negotiation. Also initialize
rte_eth_link.

Coverity issue: 280648
Fixes: f5b3c7b29357 ("net/cxgbevf: fix inter-VM traffic when physical link down")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
drivers/net/cxgbe/cxgbe_ethdev.c

index 61115e2..3245091 100644 (file)
@@ -204,13 +204,14 @@ int cxgbe_dev_link_update(struct rte_eth_dev *eth_dev,
        struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private);
        struct adapter *adapter = pi->adapter;
        struct sge *s = &adapter->sge;
-       struct rte_eth_link new_link;
+       struct rte_eth_link new_link = { 0 };
        unsigned int work_done, budget = 4;
 
        cxgbe_poll(&s->fw_evtq, NULL, budget, &work_done);
 
        new_link.link_status = force_linkup(adapter) ?
                               ETH_LINK_UP : pi->link_cfg.link_ok;
+       new_link.link_autoneg = pi->link_cfg.autoneg;
        new_link.link_duplex = ETH_LINK_FULL_DUPLEX;
        new_link.link_speed = pi->link_cfg.speed;