net/netvsc: initialize vf spinlock

Message ID 20190606161510.8211-1-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/netvsc: initialize vf spinlock |

Checks

Context Check Description
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail Compilation issues
ci/checkpatch warning coding style issues

Commit Message

Stephen Hemminger June 6, 2019, 4:15 p.m. UTC
  The VF spinlock was never initialized. It works because it is
in zmalloc'd memory and an unlocked lock on x86 is 0.
But for good practice, all spinlock's should be initialized.

Fixes: dc7680e8597c ("net/netvsc: support integrated VF")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/netvsc/hn_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ferruh Yigit June 18, 2019, 11:53 a.m. UTC | #1
On 6/6/2019 5:15 PM, Stephen Hemminger wrote:
> The VF spinlock was never initialized. It works because it is
> in zmalloc'd memory and an unlocked lock on x86 is 0.
> But for good practice, all spinlock's should be initialized.
> 
> Fixes: dc7680e8597c ("net/netvsc: support integrated VF")
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

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 9e7cf2df5472..70352f0e1a3d 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -739,6 +739,7 @@  eth_hn_dev_init(struct rte_eth_dev *eth_dev)
 	hv->port_id = eth_dev->data->port_id;
 	hv->latency = HN_CHAN_LATENCY_NS;
 	hv->max_queues = 1;
+	rte_spinlock_init(&hv->vf_lock);
 	hv->vf_port = HN_INVALID_PORT;
 
 	err = hn_parse_args(eth_dev);