DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues
@ 2020-01-13 19:12 Stephen Hemminger
  2020-01-13 19:12 ` [dpdk-dev] [PATCH 1/2] net/netvsc: fix crash in secondary process Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stephen Hemminger @ 2020-01-13 19:12 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

First patch is a bug fix for crash in info_get in secondary process.
Second one is modification to prevent similar issues in future.

Stephen Hemminger (2):
  net/netvsc: fix crash in secondary process
  net/netvsc: eliminate numa specific allocation for control messages

 drivers/net/netvsc/hn_ethdev.c | 17 +++++++++--------
 drivers/net/netvsc/hn_rndis.c  | 11 +++++------
 2 files changed, 14 insertions(+), 14 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH 1/2] net/netvsc: fix crash in secondary process
  2020-01-13 19:12 [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues Stephen Hemminger
@ 2020-01-13 19:12 ` Stephen Hemminger
  2020-01-13 19:12 ` [dpdk-dev] [PATCH 2/2] net/netvsc: eliminate numa specific allocation for control messages Stephen Hemminger
  2020-01-14 16:51 ` [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2020-01-13 19:12 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, stable

The secondary process would crash trying to get the offload
capability of the device. Since the device capabilities were
already set by the primary process this was unnecessary.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_ethdev.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 159116f7f691..c79f924379fe 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -257,15 +257,16 @@ static int hn_dev_info_get(struct rte_eth_dev *dev,
 	dev_info->max_rx_queues = hv->max_queues;
 	dev_info->max_tx_queues = hv->max_queues;
 
-	rc = hn_rndis_get_offload(hv, dev_info);
-	if (rc != 0)
-		return rc;
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return 0;
 
-	rc = hn_vf_info_get(hv, dev_info);
+	/* fills in rx and tx offload capability */
+	rc = hn_rndis_get_offload(hv, dev_info);
 	if (rc != 0)
 		return rc;
 
-	return 0;
+	/* merges the offload and queues of vf */
+	return hn_vf_info_get(hv, dev_info);
 }
 
 static int hn_rss_reta_update(struct rte_eth_dev *dev,
@@ -929,6 +930,9 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
 	eth_dev->tx_pkt_burst = &hn_xmit_pkts;
 	eth_dev->rx_pkt_burst = &hn_recv_pkts;
 
+	/* Since Hyper-V only supports one MAC address, just use local data */
+	eth_dev->data->mac_addrs = &hv->mac_addr;
+
 	/*
 	 * for secondary processes, we don't initialize any further as primary
 	 * has already done this work.
@@ -936,9 +940,6 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	/* Since Hyper-V only supports one MAC address, just use local data */
-	eth_dev->data->mac_addrs = &hv->mac_addr;
-
 	hv->vmbus = vmbus;
 	hv->rxbuf_res = &vmbus->resource[HV_RECV_BUF_MAP];
 	hv->chim_res  = &vmbus->resource[HV_SEND_BUF_MAP];
-- 
2.20.1


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

* [dpdk-dev] [PATCH 2/2] net/netvsc: eliminate numa specific allocation for control messages
  2020-01-13 19:12 [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues Stephen Hemminger
  2020-01-13 19:12 ` [dpdk-dev] [PATCH 1/2] net/netvsc: fix crash in secondary process Stephen Hemminger
@ 2020-01-13 19:12 ` Stephen Hemminger
  2020-01-14 16:51 ` [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2020-01-13 19:12 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The control messages do not need NUMA specific allocation.
Numa node is not set anyway in most kernels anyway.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_rndis.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index 2b4714042e04..7947ca2331e2 100644
--- a/drivers/net/netvsc/hn_rndis.c
+++ b/drivers/net/netvsc/hn_rndis.c
@@ -60,10 +60,9 @@ hn_rndis_rid(struct hn_data *hv)
 	return rid;
 }
 
-static void *hn_rndis_alloc(struct hn_data *hv, size_t size)
+static void *hn_rndis_alloc(size_t size)
 {
-	return rte_zmalloc_socket("RNDIS", size, PAGE_SIZE,
-				 hv->vmbus->device.numa_node);
+	return rte_zmalloc("RNDIS", size, PAGE_SIZE);
 }
 
 #ifdef RTE_LIBRTE_NETVSC_DEBUG_DUMP
@@ -442,7 +441,7 @@ hn_rndis_query(struct hn_data *hv, uint32_t oid,
 	uint32_t rid;
 
 	reqlen = sizeof(*req) + idlen;
-	req = hn_rndis_alloc(hv, reqlen);
+	req = hn_rndis_alloc(reqlen);
 	if (req == NULL)
 		return -ENOMEM;
 
@@ -517,7 +516,7 @@ hn_rndis_halt(struct hn_data *hv)
 {
 	struct rndis_halt_req *halt;
 
-	halt = hn_rndis_alloc(hv, sizeof(*halt));
+	halt = hn_rndis_alloc(sizeof(*halt));
 	if (halt == NULL)
 		return -ENOMEM;
 
@@ -1004,7 +1003,7 @@ static int hn_rndis_init(struct hn_data *hv)
 	uint32_t comp_len, rid;
 	int error;
 
-	req = hn_rndis_alloc(hv, sizeof(*req));
+	req = hn_rndis_alloc(sizeof(*req));
 	if (!req) {
 		PMD_DRV_LOG(ERR, "no memory for RNDIS init");
 		return -ENXIO;
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues
  2020-01-13 19:12 [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues Stephen Hemminger
  2020-01-13 19:12 ` [dpdk-dev] [PATCH 1/2] net/netvsc: fix crash in secondary process Stephen Hemminger
  2020-01-13 19:12 ` [dpdk-dev] [PATCH 2/2] net/netvsc: eliminate numa specific allocation for control messages Stephen Hemminger
@ 2020-01-14 16:51 ` Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2020-01-14 16:51 UTC (permalink / raw)
  To: Stephen Hemminger, dev

On 1/13/2020 7:12 PM, Stephen Hemminger wrote:
> First patch is a bug fix for crash in info_get in secondary process.
> Second one is modification to prevent similar issues in future.
> 
> Stephen Hemminger (2):
>   net/netvsc: fix crash in secondary process
>   net/netvsc: eliminate numa specific allocation for control messages
> 

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2020-01-14 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 19:12 [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues Stephen Hemminger
2020-01-13 19:12 ` [dpdk-dev] [PATCH 1/2] net/netvsc: fix crash in secondary process Stephen Hemminger
2020-01-13 19:12 ` [dpdk-dev] [PATCH 2/2] net/netvsc: eliminate numa specific allocation for control messages Stephen Hemminger
2020-01-14 16:51 ` [dpdk-dev] [PATCH 0/2] net/netvsc: fix secondary process issues Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).