From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A8BB1A0352 for ; Thu, 16 Jan 2020 13:02:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 93BC71C227; Thu, 16 Jan 2020 13:02:44 +0100 (CET) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 6F5BC1C227 for ; Thu, 16 Jan 2020 13:02:43 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id z16so10134752pfk.0 for ; Thu, 16 Jan 2020 04:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=b6XJ4cHQxKRabkuXgJ2x/sJerQqKyvYOyLME1IDu854=; b=C3HIdpYWKcfh/khV2GnTrEuGq1gWNiKluOUgfCy0Q8zRltDktKIvaBKKkYpjiC7Xq0 +xfrVW/jzbggi5MSEg1ICSVKG4X3ILN/aSizYlbDNOlwDiHQpokZmYNQtI2FTDBynIcN H6HaiOLdPX7nA2RYcl30d3jL64ztZu9a/FjSJniFyZ1YeC2i9+3WDZv/qjDVZwgda5IN +sWTs2EKi377+v5AXYFjSgssv6x5yh9qnu45yX5Fhka82+oZG8TPPmjfFvZjEjjFMenW KH5iGyCsgN1SZ0g33NSQz43un0wQqI1KBxKGS9SZIwzRqV/N9nOW6NtwizgSVVo+CNAj IJYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=b6XJ4cHQxKRabkuXgJ2x/sJerQqKyvYOyLME1IDu854=; b=i6S7ZoU9+T+PrcELUXBqh5upDXf/JdXoOKH1j0TCq02SG8ouBBDHxBL5NQKRrYKfST /cUDvORs8O8gK5VkGAUEnkkiBGF0kb/Ix8KSUMYhXI33poXcnb4IJ4lnmn4byjgZQ2D3 DWoXwsWLYyjKTPUm+uJc4ZQT6PQqyjmKmlSZo9yhrZ0ZnO0i9I6USsxIqUhh3FHpXCZg ah3jHaL8bEHDZNjezZ4xQHlVVeBWNvPX1PMKFcyLy8NiSsCzKcXKnBglPROcbz6bWOaf nWh5qGce1kZW/CaHLHz2HRVp0VEDmZ00DrA9e/E54ZKsrict814EXNUWx2wo8YzB/jxm lPDg== X-Gm-Message-State: APjAAAW1i/Ys5sDTZoernywMpETOwjPNs9xh+9gL9fAYtBxlSfU5RYH0 7wuCdyFg9Aap8IwI86HaDkoZYrV/ X-Google-Smtp-Source: APXvYqxA3w32HebmGpuOMRtfpJ7QDBdi1p9EVq1kLG0nxb7WuNkCEH0HMdy5G3qRS5hXBeUCqn1ulw== X-Received: by 2002:aa7:94b0:: with SMTP id a16mr36731177pfl.35.1579176162311; Thu, 16 Jan 2020 04:02:42 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c8c2:de00:98b6:858d:e282:492e]) by smtp.gmail.com with ESMTPSA id u7sm25392890pfh.128.2020.01.16.04.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 04:02:41 -0800 (PST) From: Yasufumi Ogawa To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Thu, 16 Jan 2020 21:02:29 +0900 Message-Id: <20200116120235.31550-2-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200116120235.31550-1-yasufum.o@gmail.com> References: <20200116120235.31550-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 1/7] shared: revise vdev prefixs of pcap and nullpmd X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" In DPDK, there are two prefixes of RTE eth device, 'eth_' and 'net_' fo r a reason of compatibility. 'eth_' is old one. SPP defines all of prefixes as following. #define VDEV_ETH_VHOST "eth_vhost" #define VDEV_NET_VHOST "net_vhost" ... However, pcap and nullpmd have only 'eth_' or 'net_'. SPP defines them such as VDEV_NULL for simplicity, but it might be confusing for considering the naming rule. This update is revise the prefixes to avoid this ambiguity. Signed-off-by: Yasufumi Ogawa --- src/shared/common.c | 16 ++++++++-------- src/shared/common.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/shared/common.c b/src/shared/common.c index 3145617..a098aed 100644 --- a/src/shared/common.c +++ b/src/shared/common.c @@ -99,11 +99,11 @@ int parse_dev_name(char *dev_name, int *port_type, int *port_id) *port_id = (int)strtol(pid_str, NULL, 10); *port_type = VHOST; - } else if (strncmp(dev_name, VDEV_PCAP, - strlen(VDEV_PCAP)) == 0) { - dev_str_len = strlen(VDEV_PCAP); + } else if (strncmp(dev_name, VDEV_NET_PCAP, + strlen(VDEV_NET_PCAP)) == 0) { + dev_str_len = strlen(VDEV_NET_PCAP); pid_len = dev_name_len - dev_str_len; - strncpy(pid_str, dev_name + strlen(VDEV_PCAP), + strncpy(pid_str, dev_name + strlen(VDEV_NET_PCAP), pid_len); *port_id = (int)strtol(pid_str, NULL, 10); *port_type = PCAP; @@ -119,11 +119,11 @@ int parse_dev_name(char *dev_name, int *port_type, int *port_id) *port_id = (int)strtol(pid_str, NULL, 10); *port_type = TAP; - } else if (strncmp(dev_name, VDEV_NULL, - strlen(VDEV_NULL)) == 0) { - dev_str_len = strlen(VDEV_NULL); + } else if (strncmp(dev_name, VDEV_ETH_NULL, + strlen(VDEV_ETH_NULL)) == 0) { + dev_str_len = strlen(VDEV_ETH_NULL); pid_len = dev_name_len - dev_str_len; - strncpy(pid_str, dev_name + strlen(VDEV_NULL), + strncpy(pid_str, dev_name + strlen(VDEV_ETH_NULL), pid_len); *port_id = (int)strtol(pid_str, NULL, 10); *port_type = PCAP; diff --git a/src/shared/common.h b/src/shared/common.h index 431ad3e..ef8372a 100644 --- a/src/shared/common.h +++ b/src/shared/common.h @@ -36,10 +36,10 @@ #define VDEV_NET_RING "net_ring" #define VDEV_ETH_VHOST "spp_vhost" #define VDEV_NET_VHOST "net_vhost" -#define VDEV_PCAP "net_pcap" +#define VDEV_NET_PCAP "net_pcap" #define VDEV_ETH_TAP "eth_tap" #define VDEV_NET_TAP "net_tap" -#define VDEV_NULL "eth_null" +#define VDEV_ETH_NULL "eth_null" /* Command. */ -- 2.17.1