From: Yasufumi Ogawa <yasufum.o@gmail.com>
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 1/7] shared: revise vdev prefixs of pcap and nullpmd
Date: Thu, 16 Jan 2020 21:02:29 +0900 [thread overview]
Message-ID: <20200116120235.31550-2-yasufum.o@gmail.com> (raw)
In-Reply-To: <20200116120235.31550-1-yasufum.o@gmail.com>
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 <yasufum.o@gmail.com>
---
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
next prev parent reply other threads:[~2020-01-16 12:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 12:02 [spp] [PATCH 0/7] Update for fixing errors for CLI Yasufumi Ogawa
2020-01-16 12:02 ` Yasufumi Ogawa [this message]
2020-01-16 12:02 ` [spp] [PATCH 2/7] shared: fix wrong port_type in parsing dev name Yasufumi Ogawa
2020-01-16 12:02 ` [spp] [PATCH 3/7] cli: add filter for running pri commands Yasufumi Ogawa
2020-01-16 12:02 ` [spp] [PATCH 4/7] cli: fix error in asking ports if no pri forwarder Yasufumi Ogawa
2020-01-16 12:02 ` [spp] [PATCH 5/7] cli: fix terminated if spp_primary is not running Yasufumi Ogawa
2020-01-16 12:02 ` [spp] [PATCH 6/7] cli: move logfile to under project log dir Yasufumi Ogawa
2020-01-16 12:02 ` [spp] [PATCH 7/7] cli: fix parsing forward and stop commands Yasufumi Ogawa
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=20200116120235.31550-2-yasufum.o@gmail.com \
--to=yasufum.o@gmail.com \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
/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).