[v2] net/netvsc: initialize link state

Message ID 20200207180816.15699-1-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] net/netvsc: initialize link state |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/travis-robot warning Travis build: failed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Stephen Hemminger Feb. 7, 2020, 6:08 p.m. UTC
  If application is using link state interrupt, the correct link state
needs to be filled in when device is started. This is similar to
how virtio updates link information.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Reported-by: Mohammed Gamal <mgamal@redhat.com>
Tested-by: Mohammed Gamal <mgamal@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
Putting on same email thread as original submission
v2 - new patch that does initialization at start
     added tested-by and fixes tag

 drivers/net/netvsc/hn_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Ferruh Yigit Feb. 10, 2020, 1:10 p.m. UTC | #1
On 2/7/2020 6:08 PM, Stephen Hemminger wrote:
> If application is using link state interrupt, the correct link state
> needs to be filled in when device is started. This is similar to
> how virtio updates link information.
> 
> Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
> Cc: stable@dpdk.org
> Reported-by: Mohammed Gamal <mgamal@redhat.com>
> Tested-by: Mohammed Gamal <mgamal@redhat.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

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

Patch

diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index c79f924379fe..564620748daf 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -823,6 +823,10 @@  hn_dev_start(struct rte_eth_dev *dev)
 	if (error)
 		hn_rndis_set_rxfilter(hv, 0);
 
+	/* Initialize Link state */
+	if (error == 0)
+		hn_dev_link_update(dev, 0);
+
 	return error;
 }