Soft Patch Panel
 help / color / mirror / Atom feed
From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH] spp_nfv: fix error of patch command
Date: Mon, 29 Jul 2019 18:37:19 +0900	[thread overview]
Message-ID: <20190729093719.28678-1-yasufum.o@gmail.com> (raw)

From: Yasufumi Ogawa <yasufum.o@gmail.com>

This patch is to fix for patching ports.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/nfv/params.h          | 1 +
 src/spp-ctl/spp_webapi.py | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/nfv/params.h b/src/nfv/params.h
index 06e6f1f..5850791 100644
--- a/src/nfv/params.h
+++ b/src/nfv/params.h
@@ -18,6 +18,7 @@ struct porttype_map portmap[] = {
 	{ .port_name = "vhost", .port_type = VHOST, },
 	{ .port_name = "pcap", .port_type = PCAP, },
 	{ .port_name = "nullpmd", .port_type = NULLPMD, },
+	{ .port_name = "tap", .port_type = TAP, },
 	{ .port_name = NULL,    .port_type = UNDEF, },
 };
 
diff --git a/src/spp-ctl/spp_webapi.py b/src/spp-ctl/spp_webapi.py
index 89b188a..25b2e6f 100644
--- a/src/spp-ctl/spp_webapi.py
+++ b/src/spp-ctl/spp_webapi.py
@@ -13,6 +13,9 @@ import sys
 
 import spp_proc
 
+PORT_TYPES = ["phy", "vhost", "ring", "pcap", "nullpmd", "tap"]
+VF_PORT_TYPES = ["phy", "vhost", "ring"]
+# TODO(yasufum) consider PCAP_PORT_TYPES is required.
 
 LOG = logging.getLogger(__name__)
 
@@ -50,7 +53,7 @@ class BaseHandler(bottle.Bottle):
     def _validate_port(self, port):
         try:
             if_type, if_num = port.split(":")
-            if if_type not in ["phy", "vhost", "ring", "pcap", "nullpmd"]:
+            if if_type not in PORT_TYPES:
                 raise
             int(if_num)
         except Exception:
@@ -176,7 +179,7 @@ class V1VFCommon(object):
         vf = {}
         vf["client-id"] = info["client-id"]
         vf["ports"] = []
-        for key in ["phy", "vhost", "ring"]:
+        for key in VF_PORT_TYPES:
             for idx in info[key]:
                 vf["ports"].append(key + ":" + str(idx))
         vf["master-lcore"] = info["master-lcore"]
-- 
2.17.1


                 reply	other threads:[~2019-07-29  9:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190729093719.28678-1-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).