[dpdk-dev] net/cxgbe: report configured link auto-negotiation

Message ID 1527098449-10298-1-git-send-email-rahul.lakkireddy@chelsio.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Rahul Lakkireddy May 23, 2018, 6 p.m. UTC
  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")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit May 24, 2018, 5:18 p.m. UTC | #1
On 5/23/2018 7:00 PM, Rahul Lakkireddy wrote:
> 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")
> 
> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>

Will postpone to next release, thanks!
  
Ferruh Yigit May 31, 2018, 4:47 p.m. UTC | #2
On 5/23/2018 7:00 PM, Rahul Lakkireddy wrote:
> 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")
> 
> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 61115e26a..32450915c 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -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;