Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 0/3] Introduce recipes as config
@ 2018-06-13  2:44 ogawa.yasufumi
  2018-06-13  2:44 ` [spp] [PATCH 1/3] recipes: add recipes directory ogawa.yasufumi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2018-06-13  2:44 UTC (permalink / raw)
  To: ferruh.yigit, spp; +Cc: Yasufumi Ogawa

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Hi,

SPP's network configuration is able to be restored with 'playback'
command. This command is useful especially if the network has a lot
of ports and paths.

Config files are included in 'docs/samples/command' and named as
'*.config'. However, it is not a good habit because path is not
appropriate in meaning and the extension '*config' is ambiguous.

I would like to introduce 'recipe' which is used for describing network
configuration instead of 'config' file. As '*.config', the contents of
recipe file is a set of SPP commands. So, you do not need to change
existing config files, but simply rename it for usign as recipe.

Recipe files will be included in 'recipes' directory under the project
root. Recipe will be named as '*.rcps' it stands for recipe scripts
for SPP. Although you can use any of extension such as '*.txt' or
'*.conf' as long as it is included in 'recipes' directory because it is
just a text file actually, but it is better to use 'rcps' to be
explicit.

Recipe is loaded with 'playback' command to restore the network
configuration. This is an example.

    spp > playback recipes/spp/usecase/dual_bidir.rcps


Yasufumi Ogawa (3):
  recipes: add recipes directory
  recipes: update SPP usecases
  recipes: update SPP_VF usecases

 docs/samples/command/spp/1nfv_1vm_bi.config   | 28 -----------------
 docs/samples/command/spp/1nfv_1vm_uni.config  | 21 -------------
 docs/samples/command/spp/1nfv_bi.config       | 10 -------
 .../samples/command/spp/2nfv_1ring_uni.config | 18 -----------
 docs/samples/command/spp/2nfv_1vm_bi.config   | 30 -------------------
 docs/samples/command/spp/2nfv_bi.config       | 12 --------
 .../spp_vf/usecase1/2-add_ports_path1.config  | 25 ----------------
 .../spp_vf/usecase1/5-add_ports_path2.config  | 25 ----------------
 recipes/spp/usecases/dual_bidir.rcps          |  5 ++++
 recipes/spp/usecases/dual_loopback.rcps       |  4 +++
 recipes/spp/usecases/ring_dual_bidir.rcps     | 14 +++++++++
 recipes/spp/usecases/ring_dual_unidir.rcps    |  9 ++++++
 recipes/spp/usecases/single_bidir.rcps        |  4 +++
 recipes/spp/usecases/vhost_unidir.rcps        |  6 ++++
 .../usecase1/setup/1-start_components.rcps    |  0
 .../usecase1/setup/2-add_ports_path1.rcps     | 20 +++++++++++++
 .../usecase1/setup/3-reg_mac_path1.rcps       |  0
 .../usecase1/setup/4-start_components.rcps    |  0
 .../usecase1/setup/5-add_ports_path2.rcps     | 20 +++++++++++++
 .../usecase1/setup/6-reg_mac_path2.rcps       |  0
 recipes/spp_vf/usecase1/setup/7-flush.rcps    |  1 +
 .../usecase1/shutdown/1-del_mac_path1.rcps    |  3 ++
 .../usecase1/shutdown/2-del_ports_path1.rcps  | 20 +++++++++++++
 .../usecase1/shutdown/3-stop_components.rcps  |  7 +++++
 .../usecase1/shutdown/4-del_mac_path2.rcps    |  3 ++
 .../usecase1/shutdown/5-del_ports_path2.rcps  | 20 +++++++++++++
 .../usecase1/shutdown/6-stop_components.rcps  |  7 +++++
 recipes/spp_vf/usecase1/shutdown/7-flush.rcps |  1 +
 recipes/sppc/samples/l2fwd.rcps               | 22 ++++++++++++++
 recipes/sppc/samples/load_balancer.rcps       | 30 +++++++++++++++++++
 30 files changed, 196 insertions(+), 169 deletions(-)
 delete mode 100644 docs/samples/command/spp/1nfv_1vm_bi.config
 delete mode 100644 docs/samples/command/spp/1nfv_1vm_uni.config
 delete mode 100644 docs/samples/command/spp/1nfv_bi.config
 delete mode 100644 docs/samples/command/spp/2nfv_1ring_uni.config
 delete mode 100644 docs/samples/command/spp/2nfv_1vm_bi.config
 delete mode 100644 docs/samples/command/spp/2nfv_bi.config
 delete mode 100644 docs/samples/command/spp_vf/usecase1/2-add_ports_path1.config
 delete mode 100644 docs/samples/command/spp_vf/usecase1/5-add_ports_path2.config
 create mode 100644 recipes/spp/usecases/dual_bidir.rcps
 create mode 100644 recipes/spp/usecases/dual_loopback.rcps
 create mode 100644 recipes/spp/usecases/ring_dual_bidir.rcps
 create mode 100644 recipes/spp/usecases/ring_dual_unidir.rcps
 create mode 100644 recipes/spp/usecases/single_bidir.rcps
 create mode 100644 recipes/spp/usecases/vhost_unidir.rcps
 rename docs/samples/command/spp_vf/usecase1/1-start_components_path1.config => recipes/spp_vf/usecase1/setup/1-start_components.rcps (100%)
 create mode 100644 recipes/spp_vf/usecase1/setup/2-add_ports_path1.rcps
 rename docs/samples/command/spp_vf/usecase1/3-reg_mac_path1.config => recipes/spp_vf/usecase1/setup/3-reg_mac_path1.rcps (100%)
 rename docs/samples/command/spp_vf/usecase1/4-start_components_path2.config => recipes/spp_vf/usecase1/setup/4-start_components.rcps (100%)
 create mode 100644 recipes/spp_vf/usecase1/setup/5-add_ports_path2.rcps
 rename docs/samples/command/spp_vf/usecase1/6-reg_mac_path2.config => recipes/spp_vf/usecase1/setup/6-reg_mac_path2.rcps (100%)
 create mode 100644 recipes/spp_vf/usecase1/setup/7-flush.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/1-del_mac_path1.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/2-del_ports_path1.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/3-stop_components.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/4-del_mac_path2.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/5-del_ports_path2.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/6-stop_components.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/7-flush.rcps
 create mode 100644 recipes/sppc/samples/l2fwd.rcps
 create mode 100644 recipes/sppc/samples/load_balancer.rcps

-- 
2.17.1

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

* [spp] [PATCH 1/3] recipes: add recipes directory
  2018-06-13  2:44 [spp] [PATCH 0/3] Introduce recipes as config ogawa.yasufumi
@ 2018-06-13  2:44 ` ogawa.yasufumi
  2018-06-13  2:44 ` [spp] [PATCH 2/3] recipes: update SPP usecases ogawa.yasufumi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2018-06-13  2:44 UTC (permalink / raw)
  To: ferruh.yigit, spp; +Cc: Yasufumi Ogawa

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

This patch is to introduce recipes. Recipe is a set of instruction
to configure SPP network. This configuration is a set of SPP command
actually.

Recipe is loaded with 'playback' command to restore the network
configuration. This is an example.

    spp > playback recipes/spp/1nfv_bi.config

Some of recipes are already included in docs/, but moved to recipes/
by this update.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 .../spp/1nfv_1vm_bi.config                    |  0
 .../spp/1nfv_1vm_uni.config                   |  0
 .../command => recipes}/spp/1nfv_bi.config    |  0
 .../spp/2nfv_1ring_uni.config                 |  0
 .../spp/2nfv_1vm_bi.config                    |  0
 .../command => recipes}/spp/2nfv_bi.config    |  0
 .../usecase1/1-start_components_path1.config  |  0
 .../spp_vf/usecase1/2-add_ports_path1.config  |  0
 .../spp_vf/usecase1/3-reg_mac_path1.config    |  0
 .../usecase1/4-start_components_path2.config  |  0
 .../spp_vf/usecase1/5-add_ports_path2.config  |  0
 .../spp_vf/usecase1/6-reg_mac_path2.config    |  0
 recipes/sppc/l2fwd.config                     | 22 ++++++++++++++
 recipes/sppc/load_balancer.config             | 30 +++++++++++++++++++
 14 files changed, 52 insertions(+)
 rename {docs/samples/command => recipes}/spp/1nfv_1vm_bi.config (100%)
 rename {docs/samples/command => recipes}/spp/1nfv_1vm_uni.config (100%)
 rename {docs/samples/command => recipes}/spp/1nfv_bi.config (100%)
 rename {docs/samples/command => recipes}/spp/2nfv_1ring_uni.config (100%)
 rename {docs/samples/command => recipes}/spp/2nfv_1vm_bi.config (100%)
 rename {docs/samples/command => recipes}/spp/2nfv_bi.config (100%)
 rename {docs/samples/command => recipes}/spp_vf/usecase1/1-start_components_path1.config (100%)
 rename {docs/samples/command => recipes}/spp_vf/usecase1/2-add_ports_path1.config (100%)
 rename {docs/samples/command => recipes}/spp_vf/usecase1/3-reg_mac_path1.config (100%)
 rename {docs/samples/command => recipes}/spp_vf/usecase1/4-start_components_path2.config (100%)
 rename {docs/samples/command => recipes}/spp_vf/usecase1/5-add_ports_path2.config (100%)
 rename {docs/samples/command => recipes}/spp_vf/usecase1/6-reg_mac_path2.config (100%)
 create mode 100644 recipes/sppc/l2fwd.config
 create mode 100644 recipes/sppc/load_balancer.config

diff --git a/docs/samples/command/spp/1nfv_1vm_bi.config b/recipes/spp/1nfv_1vm_bi.config
similarity index 100%
rename from docs/samples/command/spp/1nfv_1vm_bi.config
rename to recipes/spp/1nfv_1vm_bi.config
diff --git a/docs/samples/command/spp/1nfv_1vm_uni.config b/recipes/spp/1nfv_1vm_uni.config
similarity index 100%
rename from docs/samples/command/spp/1nfv_1vm_uni.config
rename to recipes/spp/1nfv_1vm_uni.config
diff --git a/docs/samples/command/spp/1nfv_bi.config b/recipes/spp/1nfv_bi.config
similarity index 100%
rename from docs/samples/command/spp/1nfv_bi.config
rename to recipes/spp/1nfv_bi.config
diff --git a/docs/samples/command/spp/2nfv_1ring_uni.config b/recipes/spp/2nfv_1ring_uni.config
similarity index 100%
rename from docs/samples/command/spp/2nfv_1ring_uni.config
rename to recipes/spp/2nfv_1ring_uni.config
diff --git a/docs/samples/command/spp/2nfv_1vm_bi.config b/recipes/spp/2nfv_1vm_bi.config
similarity index 100%
rename from docs/samples/command/spp/2nfv_1vm_bi.config
rename to recipes/spp/2nfv_1vm_bi.config
diff --git a/docs/samples/command/spp/2nfv_bi.config b/recipes/spp/2nfv_bi.config
similarity index 100%
rename from docs/samples/command/spp/2nfv_bi.config
rename to recipes/spp/2nfv_bi.config
diff --git a/docs/samples/command/spp_vf/usecase1/1-start_components_path1.config b/recipes/spp_vf/usecase1/1-start_components_path1.config
similarity index 100%
rename from docs/samples/command/spp_vf/usecase1/1-start_components_path1.config
rename to recipes/spp_vf/usecase1/1-start_components_path1.config
diff --git a/docs/samples/command/spp_vf/usecase1/2-add_ports_path1.config b/recipes/spp_vf/usecase1/2-add_ports_path1.config
similarity index 100%
rename from docs/samples/command/spp_vf/usecase1/2-add_ports_path1.config
rename to recipes/spp_vf/usecase1/2-add_ports_path1.config
diff --git a/docs/samples/command/spp_vf/usecase1/3-reg_mac_path1.config b/recipes/spp_vf/usecase1/3-reg_mac_path1.config
similarity index 100%
rename from docs/samples/command/spp_vf/usecase1/3-reg_mac_path1.config
rename to recipes/spp_vf/usecase1/3-reg_mac_path1.config
diff --git a/docs/samples/command/spp_vf/usecase1/4-start_components_path2.config b/recipes/spp_vf/usecase1/4-start_components_path2.config
similarity index 100%
rename from docs/samples/command/spp_vf/usecase1/4-start_components_path2.config
rename to recipes/spp_vf/usecase1/4-start_components_path2.config
diff --git a/docs/samples/command/spp_vf/usecase1/5-add_ports_path2.config b/recipes/spp_vf/usecase1/5-add_ports_path2.config
similarity index 100%
rename from docs/samples/command/spp_vf/usecase1/5-add_ports_path2.config
rename to recipes/spp_vf/usecase1/5-add_ports_path2.config
diff --git a/docs/samples/command/spp_vf/usecase1/6-reg_mac_path2.config b/recipes/spp_vf/usecase1/6-reg_mac_path2.config
similarity index 100%
rename from docs/samples/command/spp_vf/usecase1/6-reg_mac_path2.config
rename to recipes/spp_vf/usecase1/6-reg_mac_path2.config
diff --git a/recipes/sppc/l2fwd.config b/recipes/sppc/l2fwd.config
new file mode 100644
index 0000000..bb434ff
--- /dev/null
+++ b/recipes/sppc/l2fwd.config
@@ -0,0 +1,22 @@
+sec 1;add vhost 1
+sec 2;add vhost 2
+sec 3;add vhost 3
+sec 4;add vhost 4
+
+sec 1;add ring 1
+sec 2;add ring 0
+sec 3;add ring 0
+sec 4;add ring 1
+
+topo_subgraph add c1 vhost:1;vhost:2
+topo_subgraph add c2 vhost:3;vhost:4
+
+sec 1;patch ring:1 vhost:1
+sec 2;patch vhost:2 ring:0
+sec 3;patch ring:0 vhost:3
+sec 4;patch vhost:4 ring:1
+
+sec 1;forward
+sec 2;forward
+sec 3;forward
+sec 4;forward
diff --git a/recipes/sppc/load_balancer.config b/recipes/sppc/load_balancer.config
new file mode 100644
index 0000000..3e4b24f
--- /dev/null
+++ b/recipes/sppc/load_balancer.config
@@ -0,0 +1,30 @@
+sec 1;add vhost 1
+sec 2;add vhost 2
+sec 3;add vhost 3
+sec 4;add vhost 4
+sec 5;add vhost 5
+sec 6;add vhost 6
+
+sec 1;add ring 0
+sec 2;add ring 1
+sec 3;add ring 2
+sec 4;add ring 0
+sec 5;add ring 1
+sec 6;add ring 2
+
+topo_subgraph add c1 vhost:1,vhost:2,vhost:3
+topo_subgraph add c2 vhost:4,vhost:5,vhost:6
+
+sec 1;patch vhost:1 ring:0
+sec 2;patch ring:1 vhost:2
+sec 3;patch ring:2 vhost:3
+sec 4;patch ring:0 vhost:4
+sec 5;patch vhost:5 ring:1
+sec 6;patch vhost:6 ring:2
+
+sec 1;forward
+sec 2;forward
+sec 3;forward
+sec 4;forward
+sec 5;forward
+sec 6;forward
-- 
2.17.1

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

* [spp] [PATCH 2/3] recipes: update SPP usecases
  2018-06-13  2:44 [spp] [PATCH 0/3] Introduce recipes as config ogawa.yasufumi
  2018-06-13  2:44 ` [spp] [PATCH 1/3] recipes: add recipes directory ogawa.yasufumi
@ 2018-06-13  2:44 ` ogawa.yasufumi
  2018-06-13  2:44 ` [spp] [PATCH 3/3] recipes: update SPP_VF usecases ogawa.yasufumi
  2018-08-15 15:19 ` [spp] [PATCH 0/3] Introduce recipes as config Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2018-06-13  2:44 UTC (permalink / raw)
  To: ferruh.yigit, spp; +Cc: Yasufumi Ogawa

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Description of resource ID has changed from earlier version. However,
recipes for SPP usecases are still remained old.

This patch is to correct invalid command of old version. It also
updates to revise directory and name of the recipes. File extension is
changed from 'config' to 'rcps' for SPP recipe script.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 recipes/spp/1nfv_1vm_bi.config             | 28 --------------------
 recipes/spp/1nfv_1vm_uni.config            | 21 ---------------
 recipes/spp/1nfv_bi.config                 | 10 --------
 recipes/spp/2nfv_1ring_uni.config          | 18 -------------
 recipes/spp/2nfv_1vm_bi.config             | 30 ----------------------
 recipes/spp/2nfv_bi.config                 | 12 ---------
 recipes/spp/usecases/dual_bidir.rcps       |  5 ++++
 recipes/spp/usecases/dual_loopback.rcps    |  4 +++
 recipes/spp/usecases/ring_dual_bidir.rcps  | 14 ++++++++++
 recipes/spp/usecases/ring_dual_unidir.rcps |  9 +++++++
 recipes/spp/usecases/single_bidir.rcps     |  4 +++
 recipes/spp/usecases/vhost_unidir.rcps     |  6 +++++
 12 files changed, 42 insertions(+), 119 deletions(-)
 delete mode 100644 recipes/spp/1nfv_1vm_bi.config
 delete mode 100644 recipes/spp/1nfv_1vm_uni.config
 delete mode 100644 recipes/spp/1nfv_bi.config
 delete mode 100644 recipes/spp/2nfv_1ring_uni.config
 delete mode 100644 recipes/spp/2nfv_1vm_bi.config
 delete mode 100644 recipes/spp/2nfv_bi.config
 create mode 100644 recipes/spp/usecases/dual_bidir.rcps
 create mode 100644 recipes/spp/usecases/dual_loopback.rcps
 create mode 100644 recipes/spp/usecases/ring_dual_bidir.rcps
 create mode 100644 recipes/spp/usecases/ring_dual_unidir.rcps
 create mode 100644 recipes/spp/usecases/single_bidir.rcps
 create mode 100644 recipes/spp/usecases/vhost_unidir.rcps

diff --git a/recipes/spp/1nfv_1vm_bi.config b/recipes/spp/1nfv_1vm_bi.config
deleted file mode 100644
index ae6104b..0000000
--- a/recipes/spp/1nfv_1vm_bi.config
+++ /dev/null
@@ -1,28 +0,0 @@
-# Show status
-status
-
-# Show status of secondaries
-sec 1;status
-sec 2;status
-
-# Add rings to secondaries
-sec 1;add ring 0
-sec 1;add ring 1
-sec 1;add ring 2
-sec 1;add ring 3
-sec 2;add ring 0
-sec 2;add ring 1
-sec 2;add ring 2
-sec 2;add ring 3
-
-# Patch all of ports as bi-directional
-sec 1;patch 0 2
-sec 1;patch 3 0
-sec 1;patch 1 4
-sec 1;patch 5 1
-sec 2;patch 0 3
-sec 2;patch 2 1
-
-# Start forwarding
-sec 1;forward
-sec 2;forward
diff --git a/recipes/spp/1nfv_1vm_uni.config b/recipes/spp/1nfv_1vm_uni.config
deleted file mode 100644
index 74aff3d..0000000
--- a/recipes/spp/1nfv_1vm_uni.config
+++ /dev/null
@@ -1,21 +0,0 @@
-# Show status
-status
-
-# Show status of secondaries
-sec 1;status
-sec 2;status
-
-# Add rings to secondaries
-sec 1;add ring 0
-sec 1;add ring 1
-sec 2;add ring 0
-sec 2;add ring 1
-
-# Patch all of ports as uni-directional
-sec 1;patch 0 2
-sec 1;patch 3 1
-sec 2;patch 0 1
-
-# Start forwarding
-sec 1;forward
-sec 2;forward
diff --git a/recipes/spp/1nfv_bi.config b/recipes/spp/1nfv_bi.config
deleted file mode 100644
index 0142988..0000000
--- a/recipes/spp/1nfv_bi.config
+++ /dev/null
@@ -1,10 +0,0 @@
-# Show status
-status
-sec 1;status
-
-# Patch ports as bi-directional
-sec 1;patch 0 1
-sec 1;patch 1 0
-
-# Start forwarding
-sec 1;forward
diff --git a/recipes/spp/2nfv_1ring_uni.config b/recipes/spp/2nfv_1ring_uni.config
deleted file mode 100644
index c3e391c..0000000
--- a/recipes/spp/2nfv_1ring_uni.config
+++ /dev/null
@@ -1,18 +0,0 @@
-# Show status
-status
-
-# Show status of secondaries
-sec 1;status
-sec 2;status
-
-# Add a ring to secondaries
-sec 1;add ring 0
-sec 2;add ring 0
-
-# Patch all of ports as uni-directional
-sec 1;patch 0 2
-sec 2;patch 2 1
-
-# Start forwarding
-sec 1;forward
-sec 2;forward
diff --git a/recipes/spp/2nfv_1vm_bi.config b/recipes/spp/2nfv_1vm_bi.config
deleted file mode 100644
index 3537c91..0000000
--- a/recipes/spp/2nfv_1vm_bi.config
+++ /dev/null
@@ -1,30 +0,0 @@
-# Show status
-status
-
-# Show status of secondaries
-sec 1;status
-sec 2;status
-sec 3;status
-
-# Add rings to secondaries
-sec 1;add ring 0
-sec 1;add ring 1
-sec 2;add ring 2
-sec 2;add ring 3
-sec 3;add ring 0
-sec 3;add ring 1
-sec 3;add ring 2
-sec 3;add ring 3
-
-# Patch all of ports as bi-directional
-sec 1;patch 0 2
-sec 1;patch 3 0
-sec 2;patch 3 1
-sec 2;patch 1 2
-sec 3;patch 0 3
-sec 3;patch 2 1
-
-# Start forwarding
-sec 2;forward
-sec 2;forward
-sec 3;forward
diff --git a/recipes/spp/2nfv_bi.config b/recipes/spp/2nfv_bi.config
deleted file mode 100644
index 4c4768c..0000000
--- a/recipes/spp/2nfv_bi.config
+++ /dev/null
@@ -1,12 +0,0 @@
-# Show status
-status
-
-# Patch port 0 and 1 as bi-directioonal
-sec 1;status
-sec 2;status
-sec 1;patch 0 1
-sec 2;patch 1 0
-
-# Start forwarding
-sec 1;forward
-sec 2;forward
diff --git a/recipes/spp/usecases/dual_bidir.rcps b/recipes/spp/usecases/dual_bidir.rcps
new file mode 100644
index 0000000..f3d186b
--- /dev/null
+++ b/recipes/spp/usecases/dual_bidir.rcps
@@ -0,0 +1,5 @@
+# Patch port 0 and 1 as bi-directioonal
+sec 1;patch phy:0 phy:1
+sec 2;patch phy:1 phy:0
+sec 1;forward
+sec 2;forward
diff --git a/recipes/spp/usecases/dual_loopback.rcps b/recipes/spp/usecases/dual_loopback.rcps
new file mode 100644
index 0000000..8d3350d
--- /dev/null
+++ b/recipes/spp/usecases/dual_loopback.rcps
@@ -0,0 +1,4 @@
+sec 1;patch phy:0 phy:0
+sec 2;patch phy:1 phy:1
+sec 1;forward
+sec 2;forward
diff --git a/recipes/spp/usecases/ring_dual_bidir.rcps b/recipes/spp/usecases/ring_dual_bidir.rcps
new file mode 100644
index 0000000..167c90f
--- /dev/null
+++ b/recipes/spp/usecases/ring_dual_bidir.rcps
@@ -0,0 +1,14 @@
+# Bi-directional with two rings
+
+sec 1;add ring 0
+sec 1;add ring 1
+sec 2;add ring 0
+sec 2;add ring 1
+
+sec 1;patch phy:0 ring:0
+sec 1;patch ring:1 phy:0
+sec 2;patch phy:1 ring:1
+sec 2;patch ring:0 phy:1
+
+sec 1;forward
+sec 2;forward
diff --git a/recipes/spp/usecases/ring_dual_unidir.rcps b/recipes/spp/usecases/ring_dual_unidir.rcps
new file mode 100644
index 0000000..eb6377e
--- /dev/null
+++ b/recipes/spp/usecases/ring_dual_unidir.rcps
@@ -0,0 +1,9 @@
+# Uni-directional with ring
+sec 1;add ring 0
+sec 2;add ring 0
+
+sec 1;patch phy:0 ring:0
+sec 2;patch ring:0 phy:1
+
+sec 1;forward
+sec 2;forward
diff --git a/recipes/spp/usecases/single_bidir.rcps b/recipes/spp/usecases/single_bidir.rcps
new file mode 100644
index 0000000..e56e29e
--- /dev/null
+++ b/recipes/spp/usecases/single_bidir.rcps
@@ -0,0 +1,4 @@
+# Patch ports as bi-directional
+sec 1;patch phy:0 phy:1
+sec 1;patch phy:1 phy:0
+sec 1;forward
diff --git a/recipes/spp/usecases/vhost_unidir.rcps b/recipes/spp/usecases/vhost_unidir.rcps
new file mode 100644
index 0000000..d835719
--- /dev/null
+++ b/recipes/spp/usecases/vhost_unidir.rcps
@@ -0,0 +1,6 @@
+# Uni-directional with vhost
+sec 1;patch phy:0 vhost:0
+sec 1;patch vhost:0 phy:1
+sec 2;patch phy:0 phy:0
+sec 1;forward
+sec 2;forward
-- 
2.17.1

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

* [spp] [PATCH 3/3] recipes: update SPP_VF usecases
  2018-06-13  2:44 [spp] [PATCH 0/3] Introduce recipes as config ogawa.yasufumi
  2018-06-13  2:44 ` [spp] [PATCH 1/3] recipes: add recipes directory ogawa.yasufumi
  2018-06-13  2:44 ` [spp] [PATCH 2/3] recipes: update SPP usecases ogawa.yasufumi
@ 2018-06-13  2:44 ` ogawa.yasufumi
  2018-08-15 15:19 ` [spp] [PATCH 0/3] Introduce recipes as config Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: ogawa.yasufumi @ 2018-06-13  2:44 UTC (permalink / raw)
  To: ferruh.yigit, spp; +Cc: Yasufumi Ogawa

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

In spp_vf documentation, some of commands was invalid and fix in commit
260c390. So, recipes should also be corrected.

This update is for correcting invalid commands. It also include revising
directory and file names to be more understandable. File extension is
changed from 'config' to 'rcps' for SPP recipe script.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 .../spp_vf/usecase1/2-add_ports_path1.config  | 25 -------------------
 .../spp_vf/usecase1/5-add_ports_path2.config  | 25 -------------------
 .../1-start_components.rcps}                  |  0
 .../usecase1/setup/2-add_ports_path1.rcps     | 20 +++++++++++++++
 .../3-reg_mac_path1.rcps}                     |  0
 .../4-start_components.rcps}                  |  0
 .../usecase1/setup/5-add_ports_path2.rcps     | 20 +++++++++++++++
 .../6-reg_mac_path2.rcps}                     |  0
 recipes/spp_vf/usecase1/setup/7-flush.rcps    |  1 +
 .../usecase1/shutdown/1-del_mac_path1.rcps    |  3 +++
 .../usecase1/shutdown/2-del_ports_path1.rcps  | 20 +++++++++++++++
 .../usecase1/shutdown/3-stop_components.rcps  |  7 ++++++
 .../usecase1/shutdown/4-del_mac_path2.rcps    |  3 +++
 .../usecase1/shutdown/5-del_ports_path2.rcps  | 20 +++++++++++++++
 .../usecase1/shutdown/6-stop_components.rcps  |  7 ++++++
 recipes/spp_vf/usecase1/shutdown/7-flush.rcps |  1 +
 .../sppc/{l2fwd.config => samples/l2fwd.rcps} |  0
 .../load_balancer.rcps}                       |  0
 18 files changed, 102 insertions(+), 50 deletions(-)
 delete mode 100644 recipes/spp_vf/usecase1/2-add_ports_path1.config
 delete mode 100644 recipes/spp_vf/usecase1/5-add_ports_path2.config
 rename recipes/spp_vf/usecase1/{1-start_components_path1.config => setup/1-start_components.rcps} (100%)
 create mode 100644 recipes/spp_vf/usecase1/setup/2-add_ports_path1.rcps
 rename recipes/spp_vf/usecase1/{3-reg_mac_path1.config => setup/3-reg_mac_path1.rcps} (100%)
 rename recipes/spp_vf/usecase1/{4-start_components_path2.config => setup/4-start_components.rcps} (100%)
 create mode 100644 recipes/spp_vf/usecase1/setup/5-add_ports_path2.rcps
 rename recipes/spp_vf/usecase1/{6-reg_mac_path2.config => setup/6-reg_mac_path2.rcps} (100%)
 create mode 100644 recipes/spp_vf/usecase1/setup/7-flush.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/1-del_mac_path1.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/2-del_ports_path1.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/3-stop_components.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/4-del_mac_path2.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/5-del_ports_path2.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/6-stop_components.rcps
 create mode 100644 recipes/spp_vf/usecase1/shutdown/7-flush.rcps
 rename recipes/sppc/{l2fwd.config => samples/l2fwd.rcps} (100%)
 rename recipes/sppc/{load_balancer.config => samples/load_balancer.rcps} (100%)

diff --git a/recipes/spp_vf/usecase1/2-add_ports_path1.config b/recipes/spp_vf/usecase1/2-add_ports_path1.config
deleted file mode 100644
index e7c1924..0000000
--- a/recipes/spp_vf/usecase1/2-add_ports_path1.config
+++ /dev/null
@@ -1,25 +0,0 @@
-# Add ports to classifier1
-sec 1;port add phy:0 rx classifier1
-sec 1;port add ring:0 tx classifier1
-sec 1;port add ring:1 tx classifier1
-
-# Add ports to forwarder1
-sec 1;port add ring:0 rx forwarder1
-sec 1;port add vhost:0 tx forwarder1
-
-# Add ports to forwarder2
-sec 1;port add vhost:0 rx forwarder2
-sec 1;port add ring:2 tx forwarder2
-
-# Add ports to forwarder3
-sec 1;port add ring:1 rx forwarder3
-sec 1;port add vhost:2 rx forwarder3
-
-# Add ports to forwarder4
-sec 1;port add vhost:2 tx forwarder4
-sec 1;port add ring:3 rx forwarder4
-
-# Add ports to merger1
-sec 1;port add ring:2 rx merger1
-sec 1;port add ring:3 rx merger1
-sec 1;port add phy:0 tx merger1
diff --git a/recipes/spp_vf/usecase1/5-add_ports_path2.config b/recipes/spp_vf/usecase1/5-add_ports_path2.config
deleted file mode 100644
index 6e7bec2..0000000
--- a/recipes/spp_vf/usecase1/5-add_ports_path2.config
+++ /dev/null
@@ -1,25 +0,0 @@
-# Add ports to classifier2
-sec 1;port add phy:1 rx classifier2
-sec 1;port add ring:4 tx classifier2
-sec 1;port add ring:5 tx classifier2
-
-# Add ports to forwarder5
-sec 1;port add ring:4 rx forwarder5
-sec 1;port add vhost:1 tx forwarder5
-
-# Add ports to forwarder6
-sec 1;port add vhost:1 rx forwarder6
-sec 1;port add ring:6 tx forwarder6
-
-# Add ports to forwarder7
-sec 1;port add ring:5 rx forwarder7
-sec 1;port add vhost:3 rx forwarder7
-
-# Add ports to forwarder8
-sec 1;port add vhost:3 tx forwarder8
-sec 1;port add ring:7 rx forwarder8
-
-# Add ports to merger2
-sec 1;port add ring:6 rx merger2
-sec 1;port add ring:7 rx merger2
-sec 1;port add phy:1 tx merger2
diff --git a/recipes/spp_vf/usecase1/1-start_components_path1.config b/recipes/spp_vf/usecase1/setup/1-start_components.rcps
similarity index 100%
rename from recipes/spp_vf/usecase1/1-start_components_path1.config
rename to recipes/spp_vf/usecase1/setup/1-start_components.rcps
diff --git a/recipes/spp_vf/usecase1/setup/2-add_ports_path1.rcps b/recipes/spp_vf/usecase1/setup/2-add_ports_path1.rcps
new file mode 100644
index 0000000..bfb59ba
--- /dev/null
+++ b/recipes/spp_vf/usecase1/setup/2-add_ports_path1.rcps
@@ -0,0 +1,20 @@
+# classifier1
+sec 1;port add phy:0 rx classifier1
+sec 1;port add ring:0 tx classifier1
+sec 1;port add ring:1 tx classifier1
+# forwarder1
+sec 1;port add ring:0 rx forwarder1
+sec 1;port add vhost:0 tx forwarder1
+# forwarder2
+sec 1;port add ring:1 rx forwarder2
+sec 1;port add vhost:2 tx forwarder2
+# forwarder3
+sec 1;port add vhost:0 rx forwarder3
+sec 1;port add ring:2 tx forwarder3
+# forwarder4
+sec 1;port add vhost:2 rx forwarder4
+sec 1;port add ring:3 tx forwarder4
+# merger1
+sec 1;port add ring:2 rx merger1
+sec 1;port add ring:3 rx merger1
+sec 1;port add phy:0 tx merger1
diff --git a/recipes/spp_vf/usecase1/3-reg_mac_path1.config b/recipes/spp_vf/usecase1/setup/3-reg_mac_path1.rcps
similarity index 100%
rename from recipes/spp_vf/usecase1/3-reg_mac_path1.config
rename to recipes/spp_vf/usecase1/setup/3-reg_mac_path1.rcps
diff --git a/recipes/spp_vf/usecase1/4-start_components_path2.config b/recipes/spp_vf/usecase1/setup/4-start_components.rcps
similarity index 100%
rename from recipes/spp_vf/usecase1/4-start_components_path2.config
rename to recipes/spp_vf/usecase1/setup/4-start_components.rcps
diff --git a/recipes/spp_vf/usecase1/setup/5-add_ports_path2.rcps b/recipes/spp_vf/usecase1/setup/5-add_ports_path2.rcps
new file mode 100644
index 0000000..d5334a5
--- /dev/null
+++ b/recipes/spp_vf/usecase1/setup/5-add_ports_path2.rcps
@@ -0,0 +1,20 @@
+# classifier2
+sec 1;port add phy:1 rx classifier2
+sec 1;port add ring:4 tx classifier2
+sec 1;port add ring:5 tx classifier2
+# forwarder5
+sec 1;port add ring:4 rx forwarder5
+sec 1;port add vhost:1 tx forwarder5
+# forwarder6
+sec 1;port add ring:5 rx forwarder6
+sec 1;port add vhost:3 tx forwarder6
+# forwarder7
+sec 1;port add vhost:1 rx forwarder7
+sec 1;port add ring:6 tx forwarder7
+# forwarder8
+sec 1;port add vhost:3 rx forwarder8
+sec 1;port add ring:7 tx forwarder8
+# merger2
+sec 1;port add ring:6 rx merger2
+sec 1;port add ring:7 rx merger2
+sec 1;port add phy:1 tx merger2
diff --git a/recipes/spp_vf/usecase1/6-reg_mac_path2.config b/recipes/spp_vf/usecase1/setup/6-reg_mac_path2.rcps
similarity index 100%
rename from recipes/spp_vf/usecase1/6-reg_mac_path2.config
rename to recipes/spp_vf/usecase1/setup/6-reg_mac_path2.rcps
diff --git a/recipes/spp_vf/usecase1/setup/7-flush.rcps b/recipes/spp_vf/usecase1/setup/7-flush.rcps
new file mode 100644
index 0000000..9ea2237
--- /dev/null
+++ b/recipes/spp_vf/usecase1/setup/7-flush.rcps
@@ -0,0 +1 @@
+sec 1;flush
diff --git a/recipes/spp_vf/usecase1/shutdown/1-del_mac_path1.rcps b/recipes/spp_vf/usecase1/shutdown/1-del_mac_path1.rcps
new file mode 100644
index 0000000..e642ada
--- /dev/null
+++ b/recipes/spp_vf/usecase1/shutdown/1-del_mac_path1.rcps
@@ -0,0 +1,3 @@
+# Delete MAC address for path1
+sec 1;classifier_table del mac 51:54:00:12:34:56 ring:0
+sec 1;classifier_table del mac 51:54:00:12:34:58 ring:1
diff --git a/recipes/spp_vf/usecase1/shutdown/2-del_ports_path1.rcps b/recipes/spp_vf/usecase1/shutdown/2-del_ports_path1.rcps
new file mode 100644
index 0000000..eea5b9e
--- /dev/null
+++ b/recipes/spp_vf/usecase1/shutdown/2-del_ports_path1.rcps
@@ -0,0 +1,20 @@
+# classifier1
+sec 1;port del phy:0 rx classifier1
+sec 1;port del ring:0 tx classifier1
+sec 1;port del ring:1 tx classifier1
+# forwarder1
+sec 1;port del ring:0 rx forwarder1
+sec 1;port del vhost:0 tx forwarder1
+# forwarder2
+sec 1;port del ring:1 rx forwarder2
+sec 1;port del vhost:2 tx forwarder2
+# forwarder3
+sec 1;port del vhost:0 rx forwarder3
+sec 1;port del ring:2 tx forwarder3
+# forwarder4
+sec 1;port del vhost:2 rx forwarder4
+sec 1;port del ring:3 tx forwarder4
+# merger1
+sec 1;port del ring:2 rx merger1
+sec 1;port del ring:3 rx merger1
+sec 1;port del phy:0 tx merger1
diff --git a/recipes/spp_vf/usecase1/shutdown/3-stop_components.rcps b/recipes/spp_vf/usecase1/shutdown/3-stop_components.rcps
new file mode 100644
index 0000000..c29c740
--- /dev/null
+++ b/recipes/spp_vf/usecase1/shutdown/3-stop_components.rcps
@@ -0,0 +1,7 @@
+# Stop component for path1
+sec 1;component stop classifier1
+sec 1;component stop forwarder1
+sec 1;component stop forwarder2
+sec 1;component stop forwarder3
+sec 1;component stop forwarder4
+sec 1;component stop merger1
diff --git a/recipes/spp_vf/usecase1/shutdown/4-del_mac_path2.rcps b/recipes/spp_vf/usecase1/shutdown/4-del_mac_path2.rcps
new file mode 100644
index 0000000..030a9c7
--- /dev/null
+++ b/recipes/spp_vf/usecase1/shutdown/4-del_mac_path2.rcps
@@ -0,0 +1,3 @@
+# Delete MAC address for path2
+sec 1;classifier_table del mac 51:54:00:12:34:57 ring:4
+sec 1;classifier_table del mac 51:54:00:12:34:59 ring:5
diff --git a/recipes/spp_vf/usecase1/shutdown/5-del_ports_path2.rcps b/recipes/spp_vf/usecase1/shutdown/5-del_ports_path2.rcps
new file mode 100644
index 0000000..0d0a235
--- /dev/null
+++ b/recipes/spp_vf/usecase1/shutdown/5-del_ports_path2.rcps
@@ -0,0 +1,20 @@
+# classifier2
+sec 1;port del phy:1 rx classifier2
+sec 1;port del ring:4 tx classifier2
+sec 1;port del ring:5 tx classifier2
+# forwarder5
+sec 1;port del ring:4 rx forwarder5
+sec 1;port del vhost:1 tx forwarder5
+# forwarder6
+sec 1;port del ring:5 rx forwarder6
+sec 1;port del vhost:3 tx forwarder6
+# forwarder7
+sec 1;port del vhost:1 rx forwarder7
+sec 1;port del ring:6 tx forwarder7
+# forwarder8
+sec 1;port del vhost:3 tx forwarder8
+sec 1;port del ring:7 rx forwarder8
+# merger2
+sec 1;port del ring:6 rx merger2
+sec 1;port del ring:7 rx merger2
+sec 1;port del phy:1 tx merger2
diff --git a/recipes/spp_vf/usecase1/shutdown/6-stop_components.rcps b/recipes/spp_vf/usecase1/shutdown/6-stop_components.rcps
new file mode 100644
index 0000000..535f02b
--- /dev/null
+++ b/recipes/spp_vf/usecase1/shutdown/6-stop_components.rcps
@@ -0,0 +1,7 @@
+# Stop component to spp_vf
+sec 1;component stop classifier2
+sec 1;component stop forwarder5
+sec 1;component stop forwarder6
+sec 1;component stop forwarder7
+sec 1;component stop forwarder8
+sec 1;component stop merger2
diff --git a/recipes/spp_vf/usecase1/shutdown/7-flush.rcps b/recipes/spp_vf/usecase1/shutdown/7-flush.rcps
new file mode 100644
index 0000000..9ea2237
--- /dev/null
+++ b/recipes/spp_vf/usecase1/shutdown/7-flush.rcps
@@ -0,0 +1 @@
+sec 1;flush
diff --git a/recipes/sppc/l2fwd.config b/recipes/sppc/samples/l2fwd.rcps
similarity index 100%
rename from recipes/sppc/l2fwd.config
rename to recipes/sppc/samples/l2fwd.rcps
diff --git a/recipes/sppc/load_balancer.config b/recipes/sppc/samples/load_balancer.rcps
similarity index 100%
rename from recipes/sppc/load_balancer.config
rename to recipes/sppc/samples/load_balancer.rcps
-- 
2.17.1

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

* Re: [spp] [PATCH 0/3] Introduce recipes as config
  2018-06-13  2:44 [spp] [PATCH 0/3] Introduce recipes as config ogawa.yasufumi
                   ` (2 preceding siblings ...)
  2018-06-13  2:44 ` [spp] [PATCH 3/3] recipes: update SPP_VF usecases ogawa.yasufumi
@ 2018-08-15 15:19 ` Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2018-08-15 15:19 UTC (permalink / raw)
  To: ogawa.yasufumi, spp

On 6/13/2018 3:44 AM, ogawa.yasufumi@lab.ntt.co.jp wrote:
> From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
> 
> Hi,
> 
> SPP's network configuration is able to be restored with 'playback'
> command. This command is useful especially if the network has a lot
> of ports and paths.
> 
> Config files are included in 'docs/samples/command' and named as
> '*.config'. However, it is not a good habit because path is not
> appropriate in meaning and the extension '*config' is ambiguous.
> 
> I would like to introduce 'recipe' which is used for describing network
> configuration instead of 'config' file. As '*.config', the contents of
> recipe file is a set of SPP commands. So, you do not need to change
> existing config files, but simply rename it for usign as recipe.
> 
> Recipe files will be included in 'recipes' directory under the project
> root. Recipe will be named as '*.rcps' it stands for recipe scripts
> for SPP. Although you can use any of extension such as '*.txt' or
> '*.conf' as long as it is included in 'recipes' directory because it is
> just a text file actually, but it is better to use 'rcps' to be
> explicit.
> 
> Recipe is loaded with 'playback' command to restore the network
> configuration. This is an example.
> 
>     spp > playback recipes/spp/usecase/dual_bidir.rcps
> 
> 
> Yasufumi Ogawa (3):
>   recipes: add recipes directory
>   recipes: update SPP usecases
>   recipes: update SPP_VF usecases

Series applied, thanks.

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

end of thread, other threads:[~2018-08-15 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13  2:44 [spp] [PATCH 0/3] Introduce recipes as config ogawa.yasufumi
2018-06-13  2:44 ` [spp] [PATCH 1/3] recipes: add recipes directory ogawa.yasufumi
2018-06-13  2:44 ` [spp] [PATCH 2/3] recipes: update SPP usecases ogawa.yasufumi
2018-06-13  2:44 ` [spp] [PATCH 3/3] recipes: update SPP_VF usecases ogawa.yasufumi
2018-08-15 15:19 ` [spp] [PATCH 0/3] Introduce recipes as config Ferruh Yigit

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