From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 799DE5B3A for ; Fri, 31 Aug 2018 00:35:21 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id ba4-v6so4461474plb.11 for ; Thu, 30 Aug 2018 15:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dyapva7pKCtATp7oPOGZpzT1HL4n/p+f5uT5OPq4VjE=; b=MUPBPb5UmE/YHXSlLhyrce4USpV1e4cBaiPhhWLh4igOlsiLQbXwX27pLRkXo3WuSR fLkQ15UryX/0gm7L8qa0W2nXi57PWldgQ8yCAyKlezBDWyILe5BRXfj/i/4/ODrwBNPA QFSbu1eF2s2BfgpfLTxXtPCbtWLisp9PgieTWZNoyNJ2mube6grky0AqyoF8TuPHe1gT zYujkLDAcYEZFxuR7JiTaDXtuBUoN6HU8K7SbMCutpbeOUIoLi4VHi0unElt1A7KJaDZ /VEnnb1WOf0TL8YABpSuHzwZ2aWaXlWxyYqq0nZDDLhMCPEajOGGjhwPoGi9zPtTR5k7 oKgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dyapva7pKCtATp7oPOGZpzT1HL4n/p+f5uT5OPq4VjE=; b=Ip+zzYu/MNsA6MuS60HStWt5pTxwbrqArDKvUKBWucqv1rKzvZoZ2eHA+xgfFTgiC9 qezRO8/sEl2fHTEbvmkVOFQBNxSSp/0Do3NptY63YlXNwHZNpw0DGBr8kIfXxTmk+4dO Ac1zhjIge3EvV9DYnfB60p+IlZQuviO6J7p/eEDs6NnqWTZ0YpYosIdiJ1PbUH9szN6w gg5cIlhGvcvvdg1KncQvSKSbrKuA6z6Cv11zMv/e+6l7LSw4Z8VmkrFJAXQQ5lo8vPje FxHB8YTkM8HmRmNpqsNa9UpDlRBoxddQguWjjJLGVV+BCiWm+wulhyKkP7Ju1oIp9gd/ epMg== X-Gm-Message-State: APzg51BMyZaL3FXmPQkhjvAeouJvmVG6dNaPm0iJ5Wfgql/NMWrtQuGE F39lkuKWLezoaZur/Jd5ualovql9mmOA7A== X-Google-Smtp-Source: ANB0VdajPJ2VIBDvqwZcqdfkHlA74tjrHy7GxAOdw0M70XljQ9xMyp9LvzGGXZzplGLQCsX0yyZNTg== X-Received: by 2002:a17:902:158b:: with SMTP id m11-v6mr12257308pla.102.1535668520404; Thu, 30 Aug 2018 15:35:20 -0700 (PDT) Received: from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r19-v6sm11746033pgg.39.2018.08.30.15.35.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 15:35:19 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Aug 2018 15:35:08 -0700 Message-Id: <20180830223512.21297-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180830223512.21297-1-stephen@networkplumber.org> References: <20180830223512.21297-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 1/5] bus/vmbus: add devargs support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2018 22:35:21 -0000 From: Stephen Hemminger Take device arguments from command line and put them in the device devargs. Signed-off-by: Stephen Hemminger --- 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