Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 0/2] Rename env variable SPP_CTRL_IP
@ 2019-08-22  8:28 yasufum.o
  2019-08-22  8:28 ` [spp] [PATCH 1/2] tools/sppc: change env var SPP_CTRL_IP yasufum.o
  2019-08-22  8:28 ` [spp] [PATCH 2/2] docs: rename SPP_CTRL_IP for sppc yasufum.o
  0 siblings, 2 replies; 3+ messages in thread
From: yasufum.o @ 2019-08-22  8:28 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

For using SPP processes as app containers, environmental variable
`SPP_CTRL_IP` should be defined to communicate the processes with
spp-ctl. However, the name `SPP_CTRL_IP` is better to be `SPP_CTL_IP` 
considering the usage.

This series of update is to rename it described in sources and
documents.

Yasufumi Ogawa (2):
  tools/sppc: change env var SPP_CTRL_IP
  docs: rename SPP_CTRL_IP for sppc

 docs/guides/tools/sppc/app_launcher.rst    |  4 ++--
 docs/guides/tools/sppc/getting_started.rst |  6 ++---
 tools/sppc/app/spp-nfv.py                  | 19 +++++++--------
 tools/sppc/app/spp-primary.py              | 27 +++++++++++-----------
 4 files changed, 29 insertions(+), 27 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 1/2] tools/sppc: change env var SPP_CTRL_IP
  2019-08-22  8:28 [spp] [PATCH 0/2] Rename env variable SPP_CTRL_IP yasufum.o
@ 2019-08-22  8:28 ` yasufum.o
  2019-08-22  8:28 ` [spp] [PATCH 2/2] docs: rename SPP_CTRL_IP for sppc yasufum.o
  1 sibling, 0 replies; 3+ messages in thread
From: yasufum.o @ 2019-08-22  8:28 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

The name of `SPP_CTRL_IP` of spp-ctl is ambiguous and it is better to
renmae `SPP_CTL_IP`.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 tools/sppc/app/spp-nfv.py     | 19 ++++++++++---------
 tools/sppc/app/spp-primary.py | 27 ++++++++++++++-------------
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/tools/sppc/app/spp-nfv.py b/tools/sppc/app/spp-nfv.py
index 6506fed..96e25e7 100755
--- a/tools/sppc/app/spp-nfv.py
+++ b/tools/sppc/app/spp-nfv.py
@@ -28,14 +28,14 @@ def parse_args():
         type=int,
         help='Secondary ID')
     parser.add_argument(
-        '-ip', '--ctrl-ip',
+        '-ip', '--ctl-ip',
         type=str,
-        help="IP address of SPP controller")
+        help="IP address of spp-ctl")
     parser.add_argument(
-        '--ctrl-port',
+        '--ctl-port',
         type=int,
         default=6666,
-        help="Port of SPP controller")
+        help="Port for secondary of spp-ctl")
 
     parser = app_helper.add_sppc_args(parser)
 
@@ -99,12 +99,13 @@ def main():
     else:
         spp_opts += ['-n', str(args.sec_id), '\\']
 
-    # IP address of SPP controller.
-    ctrl_ip = os.getenv('SPP_CTRL_IP', args.ctrl_ip)
-    if ctrl_ip is None:
-        common.error_exit('SPP_CTRL_IP')
+    # IP address of spp-ctl.
+    ctl_ip = os.getenv('SPP_CTL_IP', args.ctl_ip)
+    if ctl_ip is None:
+        print('Env variable "SPP_CTL_IP" is not defined!')
+        exit()
     else:
-        spp_opts += ['-s', '%s:%d' % (ctrl_ip, args.ctrl_port), '\\']
+        spp_opts += ['-s', '{}:{}'.format(ctl_ip, args.ctl_port), '\\']
 
     cmds = docker_cmd + docker_opts + spp_cmd + eal_opts + spp_opts
     if cmds[-1] == '\\':
diff --git a/tools/sppc/app/spp-primary.py b/tools/sppc/app/spp-primary.py
index 6a004f6..6a71490 100755
--- a/tools/sppc/app/spp-primary.py
+++ b/tools/sppc/app/spp-primary.py
@@ -41,14 +41,14 @@ def parse_args():
         type=str,
         help='TAP device IDs')
     parser.add_argument(
-        '-ip', '--ctrl-ip',
+        '-ip', '--ctl-ip',
         type=str,
-        help="IP address of SPP controller")
+        help="IP address of spp-ctl")
     parser.add_argument(
-        '--ctrl-port',
+        '--ctl-port',
         type=int,
         default=5555,
-        help="Port of SPP controller")
+        help="Port for primary of spp-ctl")
 
     parser = app_helper.add_sppc_args(parser)
 
@@ -88,8 +88,8 @@ def main():
         socks = []
         for dev_id in dev_vhost_ids:
             socks.append({
-                'host': '/tmp/sock%d' % dev_id,
-                'guest': '/tmp/sock%d' % dev_id})
+                'host': '/tmp/sock{}'.format(dev_id),
+                'guest': '/tmp/sock{}'.format(dev_id)})
     else:
         dev_vhost_ids = []
 
@@ -122,13 +122,13 @@ def main():
     # Add TAP vdevs
     for i in range(len(dev_tap_ids)):
         eal_opts += [
-            '--vdev', 'net_tap%d,iface=foo%d' % (
+            '--vdev', 'net_tap{},iface=foo{}'.format(
                 dev_tap_ids[i], dev_tap_ids[i]), '\\']
 
     # Add vhost vdevs
     for i in range(len(dev_vhost_ids)):
         eal_opts += [
-            '--vdev', 'eth_vhost%d,iface=%s' % (
+            '--vdev', 'eth_vhost{},iface={}'.format(
                 dev_vhost_ids[i], socks[i]['guest']), '\\']
 
     eal_opts += ['--', '\\']
@@ -142,12 +142,13 @@ def main():
 
     spp_opts += ['-n', str(args.nof_ring), '\\']
 
-    # IP address of SPP controller.
-    ctrl_ip = os.getenv('SPP_CTRL_IP', args.ctrl_ip)
-    if ctrl_ip is None:
-        common.error_exit('SPP_CTRL_IP')
+    # IP address of spp-ctl.
+    ctl_ip = os.getenv('SPP_CTL_IP', args.ctl_ip)
+    if ctl_ip is None:
+        print('Env variable "SPP_CTL_IP" is not defined!')
+        exit()
     else:
-        spp_opts += ['-s', '%s:%d' % (ctrl_ip, args.ctrl_port), '\\']
+        spp_opts += ['-s', '{}:{}'.format(ctl_ip, args.ctl_port), '\\']
 
     cmds = docker_cmd + docker_opts + spp_cmd + eal_opts + spp_opts
     if cmds[-1] == '\\':
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 2/2] docs: rename SPP_CTRL_IP for sppc
  2019-08-22  8:28 [spp] [PATCH 0/2] Rename env variable SPP_CTRL_IP yasufum.o
  2019-08-22  8:28 ` [spp] [PATCH 1/2] tools/sppc: change env var SPP_CTRL_IP yasufum.o
@ 2019-08-22  8:28 ` yasufum.o
  1 sibling, 0 replies; 3+ messages in thread
From: yasufum.o @ 2019-08-22  8:28 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

As `SPP_CTRL_IP` is renamed in app container scripts, this update is to
rename it in documentation.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 docs/guides/tools/sppc/app_launcher.rst    | 4 ++--
 docs/guides/tools/sppc/getting_started.rst | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/docs/guides/tools/sppc/app_launcher.rst b/docs/guides/tools/sppc/app_launcher.rst
index 233553a..ae960c2 100644
--- a/docs/guides/tools/sppc/app_launcher.rst
+++ b/docs/guides/tools/sppc/app_launcher.rst
@@ -45,11 +45,11 @@ inside a container.
 Setup
 -----
 
-You should define ``SPP_CTRL_IP`` environment variable to SPP controller
+You should define ``SPP_CTL_IP`` environment variable to SPP controller
 be accessed from other SPP processes inside containers.
 SPP controller is a CLI tool for accepting user's commands.
 
-You cannot use ``127.0.0.1`` or ``localhost`` for ``SPP_CTRL_IP``
+You cannot use ``127.0.0.1`` or ``localhost`` for ``SPP_CTL_IP``
 because SPP processes try to find SPP controller inside each of
 containers and fail to.
 From inside of the container, SPP processes should be known IP address
diff --git a/docs/guides/tools/sppc/getting_started.rst b/docs/guides/tools/sppc/getting_started.rst
index 4834cc0..e088661 100644
--- a/docs/guides/tools/sppc/getting_started.rst
+++ b/docs/guides/tools/sppc/getting_started.rst
@@ -135,14 +135,14 @@ Launch SPP and App Containers
 -----------------------------
 
 Before launch containers, you should set IP address of host machine
-as ``SPP_CTRL_IP`` environment variable
+as ``SPP_CTL_IP`` environment variable
 for controller to be accessed from inside containers.
 It is better to define this variable in ``$HOME/.bashrc``.
 
 .. code-block:: console
 
     # Set your host IP address
-    export SPP_CTRL_IP=HOST_IPADDR
+    export SPP_CTL_IP=HOST_IPADDR
 
 
 SPP Controller
@@ -180,7 +180,7 @@ processes.
 SPP Primary Container
 ~~~~~~~~~~~~~~~~~~~~~
 
-As ``SPP_CTRL_IP`` is activated, you are enalbed to run
+As ``SPP_CTL_IP`` is activated, you are enalbed to run
 ``app/spp-primary.py`` with options of EAL and SPP primary
 in terminal 3.
 In this case, launch spp-primary in background mode using one core
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-22  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22  8:28 [spp] [PATCH 0/2] Rename env variable SPP_CTRL_IP yasufum.o
2019-08-22  8:28 ` [spp] [PATCH 1/2] tools/sppc: change env var SPP_CTRL_IP yasufum.o
2019-08-22  8:28 ` [spp] [PATCH 2/2] docs: rename SPP_CTRL_IP for sppc yasufum.o

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).