From 930ac175fc8f37a5ceda8d61de6f6aa468fc4871 Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Tue, 10 May 2016 16:35:16 +0200 Subject: HONEYCOMB-36: vhost user interfaces CRUD support Change-Id: I1c16cf71fa450fe5079b4af8b1e24bdc921a6e82 Signed-off-by: Marek Gradzki Signed-off-by: Maros Marsalek --- v3po/api/src/main/yang/v3po.yang | 79 ++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 32 deletions(-) (limited to 'v3po/api/src/main/yang/v3po.yang') diff --git a/v3po/api/src/main/yang/v3po.yang b/v3po/api/src/main/yang/v3po.yang index 065ff6535..e346ae144 100644 --- a/v3po/api/src/main/yang/v3po.yang +++ b/v3po/api/src/main/yang/v3po.yang @@ -49,7 +49,7 @@ module v3po { identity vhost-user { base if:interface-type; } - + identity tap { base if:interface-type; } @@ -118,6 +118,37 @@ module v3po { } } + grouping vhost-user-interface-base-attributes { + leaf socket { + type string { + length 1..255; + } + } + leaf role { + type vhost-user-role; + default "server"; + } + } + + grouping vhost-user-interface-state-attributes { + leaf features { + type uint64; + config false; + } + leaf virtio-net-hdr-size { + type uint32; + config false; + } + leaf num-memory-regions { + type uint32; + config false; + } + leaf connect-error { + type string; + config false; + } + } + augment /if:interfaces/if:interface { ext:augment-identifier "vpp-interface-augmentation"; @@ -125,10 +156,8 @@ module v3po { // 1. The link between interface type and this augmentation is unclear // 2. Only this augmentation with combination of ifc type is trigger to do something for vpp, what if user only configures base interface stuff ? + We need to get leaves defined by ietf-interfaces when we are processing this augment - // TODO grouping container tap { when "../if:type = 'v3po:tap'"; - uses tap-interface-base-attributes; uses tap-interface-config-attributes; } @@ -154,17 +183,8 @@ module v3po { } container vhost-user { when "../if:type = 'v3po:vhost-user'"; - leaf socket { - type string { - length 1..255; - } - } - leaf role { - type vhost-user-role; - default "server"; - } - description - "vhost-user settings"; + uses vhost-user-interface-base-attributes; + description "vhost-user settings"; } container vxlan { // FIXME: this should be in an vxlan-specific extension @@ -280,7 +300,11 @@ module v3po { container tap { when "../if:type = 'v3po:tap'"; - uses tap-interface-base-attributes; + uses tap-interface-base-attributes { + refine tap-name { + config false; + } + } } container ethernet { @@ -300,24 +324,15 @@ module v3po { } container vhost-user { when "../if:type = 'v3po:vhost-user'"; - leaf socket { - type string; - } - leaf role { - type vhost-user-role; - } - leaf features { - type uint64; - } - leaf virtio-net-hdr-size { - type uint32; - } - leaf num-memory-regions { - type uint32; - } - leaf connect-error { - type string; + uses vhost-user-interface-base-attributes { + refine socket { + config false; + } + refine role { + config false; + } } + uses vhost-user-interface-state-attributes; } container vxlan { when "../if:type = 'v3po:vxlan-tunnel'"; -- cgit 1.2.3-korg