DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [PATCH] net/netvsc: initialize vf spinlock
@ 2019-06-06 16:15 Stephen Hemminger
  2019-06-18 11:53 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2019-06-06 16:15 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Stephen Hemminger

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(+)

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);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/netvsc: initialize vf spinlock
  2019-06-06 16:15 [dpdk-dev] [PATCH] net/netvsc: initialize vf spinlock Stephen Hemminger
@ 2019-06-18 11:53 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2019-06-18 11:53 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Stephen Hemminger

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 16:15 [dpdk-dev] [PATCH] net/netvsc: initialize vf spinlock Stephen Hemminger
2019-06-18 11:53 ` Ferruh Yigit

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox