[spp] [PATCH v2 5/5] cli: support pipe PMD

Itsuro Oda oda at valinux.co.jp
Wed Feb 26 08:06:10 CET 2020


This patch adds add pipe command to the primary.
Infomation about pipe is added to the output of status command
of the primary too.

Signed-off-by: Itsuro Oda <oda at valinux.co.jp>
---
 src/cli/commands/pri.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/cli/commands/pri.py b/src/cli/commands/pri.py
index dbe56d5..6fc7f00 100644
--- a/src/cli/commands/pri.py
+++ b/src/cli/commands/pri.py
@@ -229,6 +229,12 @@ class SppPrimary(object):
                     else:
                         print('    - {} -> {}'.format(port, dst))
 
+            if ('pipes' in json_obj):
+                print('  - pipes:')
+                for pipe in json_obj['pipes']:
+                    print('    - pipe:{} ring:{} ring:{}'.format(pipe['id'],
+                        pipe['rx'], pipe['tx']))
+
             if ('phy_ports' in json_obj) or ('ring_ports' in json_obj):
                 print('- stats')
 
@@ -798,6 +804,10 @@ class SppPrimary(object):
             print("'%s' is already added." % params[0])
         else:
             req_params = {'action': 'add', 'port': params[0]}
+            if len(params) == 3:
+                # add pipe:X ring:A ring:B
+                req_params['rx'] = params[1]
+                req_params['tx'] = params[2]
 
             res = self.spp_ctl_cli.put('primary/ports', req_params)
             if res is not None:
-- 
2.17.1



More information about the spp mailing list