DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Subject: [dpdk-dev] [PATCH 1/5] bus/vmbus: add devargs support
Date: Thu, 30 Aug 2018 15:35:08 -0700	[thread overview]
Message-ID: <20180830223512.21297-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20180830223512.21297-1-stephen@networkplumber.org>

From: Stephen Hemminger <sthemmin@microsoft.com>

Take device arguments from command line and put
them in the device devargs.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/bus/vmbus/linux/vmbus_bus.c |  2 ++
 drivers/bus/vmbus/private.h         |  3 +++
 drivers/bus/vmbus/vmbus_common.c    | 22 +++++++++++++++++++++-
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/vmbus/linux/vmbus_bus.c b/drivers/bus/vmbus/linux/vmbus_bus.c
index 52d6a3c05306..527a6a39f2bc 100644
--- a/drivers/bus/vmbus/linux/vmbus_bus.c
+++ b/drivers/bus/vmbus/linux/vmbus_bus.c
@@ -276,6 +276,8 @@ vmbus_scan_one(const char *name)
 		dev->device.numa_node = SOCKET_ID_ANY;
 	}
 
+	dev->device.devargs = vmbus_devargs_lookup(dev);
+
 	/* device is valid, add in list (sorted) */
 	VMBUS_LOG(DEBUG, "Adding vmbus device %s", name);
 
diff --git a/drivers/bus/vmbus/private.h b/drivers/bus/vmbus/private.h
index 9964fc42a7b5..f2022a68cb2b 100644
--- a/drivers/bus/vmbus/private.h
+++ b/drivers/bus/vmbus/private.h
@@ -66,6 +66,9 @@ struct vmbus_channel {
 
 #define VMBUS_MAX_CHANNELS	64
 
+struct rte_devargs *
+vmbus_devargs_lookup(struct rte_vmbus_device *dev);
+
 int vmbus_chan_create(const struct rte_vmbus_device *device,
 		      uint16_t relid, uint16_t subid, uint8_t monitor_id,
 		      struct vmbus_channel **new_chan);
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index c7165ad54fe2..979fabdcbb61 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -85,7 +85,6 @@ vmbus_match(const struct rte_vmbus_driver *dr,
 
 	return false;
 }
-
 /*
  * If device ID match, call the devinit() function of the driver.
  */
@@ -204,6 +203,27 @@ vmbus_parse(const char *name, void *addr)
 	return ret;
 }
 
+/*
+ * scan for matching device args on command line
+ * example:
+ *	-w 'vmbus(635a7ae3-091e-4410-ad59-667c4f8c04c3,latency=20)'
+ */
+struct rte_devargs *
+vmbus_devargs_lookup(struct rte_vmbus_device *dev)
+{
+	struct rte_devargs *devargs;
+	rte_uuid_t addr;
+
+	RTE_EAL_DEVARGS_FOREACH("vmbus", devargs) {
+		vmbus_parse(devargs->name, &addr);
+
+		if (rte_uuid_compare(dev->device_id, addr) == 0)
+			return devargs;
+	}
+	return NULL;
+
+}
+
 /* register vmbus driver */
 void
 rte_vmbus_register(struct rte_vmbus_driver *driver)
-- 
2.18.0

  reply	other threads:[~2018-08-30 22:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 22:35 [dpdk-dev] [PATCH 0/5] netvsc changes for 18.11 Stephen Hemminger
2018-08-30 22:35 ` Stephen Hemminger [this message]
2018-09-14 12:46   ` [dpdk-dev] [PATCH 1/5] bus/vmbus: add devargs support Ferruh Yigit
2018-09-14 13:06     ` Gaëtan Rivet
2018-09-14 13:19       ` Ferruh Yigit
2018-09-14 13:58         ` Gaëtan Rivet
2018-09-14 15:21           ` Stephen Hemminger
2018-08-30 22:35 ` [dpdk-dev] [PATCH 2/5] net/netvsc: allow tuning latency with devargs Stephen Hemminger
2018-09-14 12:47   ` Ferruh Yigit
2018-08-30 22:35 ` [dpdk-dev] [PATCH 3/5] net/netvsc: exhausting transmit descriptors is not an error Stephen Hemminger
2018-08-30 22:35 ` [dpdk-dev] [PATCH 4/5] net/netvsc: implement link state change callback Stephen Hemminger
2018-08-31  8:25   ` Gaëtan Rivet
2018-08-31 15:13     ` Stephen Hemminger
2018-08-30 22:35 ` [dpdk-dev] [PATCH 5/5] net/netvsc: integrated VF support Stephen Hemminger
2018-09-14 12:57   ` Ferruh Yigit
2018-09-14 15:22     ` Stephen Hemminger
2018-08-31 12:04 ` [dpdk-dev] [PATCH 0/5] netvsc changes for 18.11 Ferruh Yigit
2018-08-31 15:15   ` Stephen Hemminger
2018-08-31 16:56     ` Thomas Monjalon
2018-09-14 13:25 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180830223512.21297-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).