From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 39E33AA94 for ; Thu, 29 Mar 2018 23:24:43 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id s18so6550608wrg.9 for ; Thu, 29 Mar 2018 14:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=PS8rM5IiXAIHaEiEx9MYdnUE9QvH8A6GZ+vog36vNQY=; b=DMIV21HPRZ3yriglUKCFfxiYr2lyugXhS0PjbXEIGZMUbv+s/izy2PqPX+ke41stki RTMXtU6XwmOAC+va2svh9vTzCLJubtcqD5vDzpy0MfmYRSYLSl4sq/efTGMSZahveBpZ xvjb/e4kHp+rbujdsI/F0IGJF7/QOd1RX7bq36s2+r99NW7S/r5wZxl8wiJNkJRB5sVd eQsN425VLL4DmasLzmBwy7C1dQqXVdrAVJRm0c1T178zFe6L9blNRDxT1R46raYMb89/ xhEW57vfOQaJgAI2jcN4D/ZdZt/SL//DttbXVByqDY8QchFJugG3tKeStpwnpDELCtt2 A4pg== 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:in-reply-to:references; bh=PS8rM5IiXAIHaEiEx9MYdnUE9QvH8A6GZ+vog36vNQY=; b=AF3Be9hUBL0hVEqMx1Ev5CiKq9tX+pl8UXiWZvq71c0ohhGO0AUSGXuZdtAyvddZtL vgVzToYeXOAdcgQRgijILoexquVjYAaoYL0+TvMKVI391SC9Rs3LcNrXQKr2ajZVr3EU l8dqZJnuYGRjlckl/8xrpDWWR0tCveyAha9JuAbAzcvJBh8uhkLNr4Ngc96DHvYQbPk7 1nshhHN6vat6vry0I21xOWZTDGTgzmEyDtRvrIA7cSS2HSt5df721OHa2dmK+TusIJ5D lNCPLCEWedSfja0JqvlUV8PsNILePCUSVYCxx0RnbK9JAoVFwas2L0GNRwgw92WKeOPA +CXA== X-Gm-Message-State: AElRT7GDv6zKxuqXHEdlIe4nBEnwZTREUd4jAsrILFJ9fh1mgSMEbVTE uDj2nOm0QdL6ieMYI8ukkJXtsAeY X-Google-Smtp-Source: AIpwx4/9LUsFeqXmugQzMr2rPurxsnrXZCIXl6ZIOErYLE5/KoefJ87nAUTMqkstxoTuqrjKDPXDwQ== X-Received: by 10.223.154.182 with SMTP id a51mr8295827wrc.176.1522358682395; Thu, 29 Mar 2018 14:24:42 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id m35sm11907457wrm.59.2018.03.29.14.24.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 14:24:41 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 29 Mar 2018 23:23:43 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 19/20] ethdev: add device matching field name 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, 29 Mar 2018 21:24:44 -0000 The eth device class can now parse a field name, matching the eth_dev name with one passed as "class=eth,name=xxxxxx" Signed-off-by: Gaetan Rivet --- lib/librte_ether/rte_class_eth.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_class_eth.c b/lib/librte_ether/rte_class_eth.c index 97d24781d..99aff372e 100644 --- a/lib/librte_ether/rte_class_eth.c +++ b/lib/librte_ether/rte_class_eth.c @@ -14,10 +14,12 @@ #include "rte_ethdev_core.h" enum eth_params { + RTE_ETH_PARAMS_NAME, RTE_ETH_PARAMS_MAX, }; static const char *eth_params_keys[] = { + [RTE_ETH_PARAMS_NAME] = "name", [RTE_ETH_PARAMS_MAX] = NULL, }; @@ -25,8 +27,12 @@ static int eth_dev_match(struct rte_eth_dev *edev, struct rte_kvargs *kvlist) { - (void) kvlist; - (void) edev; + struct rte_eth_dev_data *data; + + data = edev->data; + if (rte_kvargs_process(kvlist, "name", + &rte_kvargs_strcmp, data->name)) + return -1; return 0; } -- 2.11.0