net/netvsc: minor fixes
cover net/netvsc: minor fixes
These fix some minor issues found during testing and review of netvsc PMD
Stephen Hemminger (4):
net/vmbus: add missing barrier
net/netvsc: fix invalid rte_free on dev_close
net/netvsc: fix comment spelling errors
bus/vmbus: fix comment spelling errors
drivers/bus/vmbus/linux/vmbus_uio.c | 2 +- drivers/bus/vmbus/vmbus_channel.c | 1 + drivers/bus/vmbus/vmbus_common.c | 2 +- drivers/net/netvsc/hn_ethdev.c | 5 ++++- drivers/net/netvsc/hn_nvs.h | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/4 net/vmbus: add missing barrier
The check for event ring being empty needs a barrier to avoid any over agressive optimization. This is same barrier as Linux kernel.
--- drivers/bus/vmbus/vmbus_channel.c | 1 + 1 file changed, 1 insertion(+)
drivers/bus/vmbus/vmbus_channel.c +1 -0
@@ -199,6 +199,7 @@ bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel) {const struct vmbus_br *br = &channel->rxbr; +rte_smp_rmb ();return br->vbr->rindex == br->vbr->windex; }
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH 1/4] net/vmbus: add missing barrier
Quoted 30 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Stephen Hemminger
Sent: Tuesday, April 28, 2020 7:28 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH 1/4] net/vmbus: add missing barrierThe check for event ring being empty needs a barrier to avoid any over agressive optimization.
This is same barrier as Linux kernel.Signed-off-by Stephen Hemminger <[email protected]>--- drivers/bus/vmbus/vmbus_channel.c | 1 + 1 file changed, 1 insertion(+)drivers/bus/vmbus/vmbus_channel.c +1
-1@@ -199,6 +199,7 @@ bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel) {const struct vmbus_br *br = &channel->rxbr; +rte_smp_rmb ();return br->vbr->rindex == br->vbr->windex; } --
Quoted 1 line
2.20.1
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
PATCH 2/4 net/netvsc: fix invalid rte_free on dev_close
In reply to Stephen HemmingerThe netvsc PMD is putting the mac address in private data. Unless dev->data->mac_addrs is NULL'd rte_ethdev_close will try and free the address array.
Causing the following scary error.
EAL: Invalid memory
This is a simpler alternative to the fix already merged in 20.05-rc1
--- drivers/net/netvsc/hn_ethdev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/netvsc/hn_ethdev.c +3 -0
@@ -849,6 +849,9 @@ hn_dev_close(struct rte_eth_dev *dev)hn_vf_close (dev);hn_dev_free_queues (dev); + +/* mac_addrs must not be freed alone because part of dev_private */ + dev->data->mac_addrs =NULL ; }static const struct eth_dev_ops hn_eth_dev_ops = {
Signature · 1 line
2.20.1
PATCH 3/4 net/netvsc: fix comment spelling errors
In reply to Stephen Hemminger--- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/netvsc/hn_nvs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/netvsc/hn_ethdev.c +1 -1
@@ -72,7 +72,7 @@ static const struct hn_xstats_name_off hn_stat_strings[] = {/* The default RSS key. * This value is the same as MLX5 so that flows will be -* received on same path for both VF ans synthetic NIC. +* received on same path for both VF and synthetic NIC. */ static const uint8_t rss_default_key[NDIS_HASH_KEYSIZE_TOEPLITZ ] = {0x2c ,0xc6 ,0x81 ,0xd1 ,0x5b ,0xdb ,0xf4 ,0xf7 ,
drivers/net/netvsc/hn_nvs.h +1 -1
@@ -37,7 +37,7 @@#define NVS_RNDIS_MTYPE_CTRL 1/* -* NVS message transacion status codes. +* NVS message transaction status codes. */ #define NVS_STATUS_OK 1#define NVS_STATUS_FAILED 2
Signature · 1 line
2.20.1
PATCH 4/4 bus/vmbus: fix comment spelling errors
In reply to Stephen Hemminger--- drivers/bus/vmbus/linux/vmbus_uio.c | 2 +- drivers/bus/vmbus/vmbus_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/bus/vmbus/linux/vmbus_uio.c +1 -1
@@ -165,7 +165,7 @@ vmbus_uio_map_resource_by_index(struct rte_vmbus_device *dev, int idx, dev->resource[idx].addr = mapaddr; vmbus_map_addr =RTE_PTR_ADD (mapaddr, size); -/* Record result of sucessful mapping for use by secondary */ +/* Record result of successful mapping for use by secondary */ maps[idx].addr = mapaddr; maps[idx].size = size;
drivers/bus/vmbus/vmbus_common.c +1 -1
@@ -131,7 +131,7 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr, }/* -* IF device class GUID mathces, call the probe function of +* IF device class GUID matches, call the probe function of * registere drivers for the vmbus device. * Return -1 if initialization failed, * and 1 if no driver found for this device.
Signature · 1 line
2.20.1