Adding support for DPDK datapath_type and port_types. 41/14641/5
authorSharad Mishra <sharad.d.mishra@intel.com>
Fri, 30 Jan 2015 18:03:21 +0000 (10:03 -0800)
committerFlavio Fernandes <ffernand@redhat.com>
Fri, 6 Feb 2015 13:35:44 +0000 (13:35 +0000)
This patch creates yang models to support datapath and port types.
datapath-port-types.yang is a general purpose datapath and port types model.
dpdk.yang is an extension to add dpdk specific ports and datapath_types.

Change-Id: Iffbf04631a5546cdc1b8f73bafc53ff5ca65d7f1
Signed-off-by: Sharad Mishra <sharad.d.mishra@intel.com>
southbound/southbound-api/src/main/yang/datapath-port-types.yang [new file with mode: 0644]
southbound/southbound-api/src/main/yang/dpdk.yang [new file with mode: 0644]

diff --git a/southbound/southbound-api/src/main/yang/datapath-port-types.yang b/southbound/southbound-api/src/main/yang/datapath-port-types.yang
new file mode 100644 (file)
index 0000000..95f6fb3
--- /dev/null
@@ -0,0 +1,66 @@
+module datapath-port-types {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:example";
+    prefix "datapathport";
+
+    import network-topology {prefix "topo"; revision-date "2013-10-21"; }
+    import yang-ext { prefix "ext"; }
+    import ietf-inet-types { prefix inet; }
+
+    revision "2015-01-28" {
+        description "Initial revision of base datapath & port types which would be used by DPDK, among others";
+    }
+
+    identity datapath-type-base {
+        description "datapath type supported by switch";
+    }
+
+    identity port-type-base {
+        description "port type supported by switch";
+    }
+
+    identity datapath-type-netdev {
+        description "Generic netdev datapath type";
+        base datapath-type-base;
+    }
+
+   identity datapath-type-linux {
+        description "Datapath type for linux";
+        base datapath-type-base;
+    }
+
+   grouping port-type-attributes {
+        description "Common leaf for expressing port-type";
+        leaf port-type {
+                type identityref {
+                        base port-type-base;
+                }
+        }
+   }
+
+   grouping datapath-type-attributes {
+        description "Common leaf for expressing datapath-type";
+        leaf datapath-type {
+                type identityref {
+                        base datapath-type-base;
+                }
+        }
+   }
+
+   augment "/topo:network-topology/topo:topology/topo:node" {
+        description "Augment topology node with a list of supported-port-types";
+        ext:augment-identifier "supported-ports";
+        list supported-port-types-entry {
+                uses port-type-attributes;
+        }
+   }
+
+   augment "/topo:network-topology/topo:topology/topo:node" {
+        description "Augment topology node with a list of supported-datapath-types";
+        ext:augment-identifier "supported-datapaths";
+        list supported-datapath-types-entry {
+                uses datapath-type-attributes;
+        }
+   }
+
+}
diff --git a/southbound/southbound-api/src/main/yang/dpdk.yang b/southbound/southbound-api/src/main/yang/dpdk.yang
new file mode 100644 (file)
index 0000000..f052d97
--- /dev/null
@@ -0,0 +1,75 @@
+module dpdk {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:example";
+    prefix "dpdk";
+
+    import network-topology {prefix "topo"; revision-date "2013-10-21"; }
+    import yang-ext { prefix "ext"; }
+    import ietf-inet-types { prefix inet; }
+    import datapath-port-types {prefix datapathport;}
+
+    revision "2015-01-26" {
+        description "Initial revision of dpdk model";
+    }
+
+    identity dpdk-port-type-base {
+        description "Base identity for all dpdk-port-types";
+    }
+
+    identity dpdk-datapath-type-base {
+        description "Datapath type for DPDK";
+    }
+
+    identity datapath-type-dpdk-netdev {
+        description "Datapath type for DPDK netdev";
+        base dpdk-datapath-type-base;
+    }
+
+    identity port-type-dpdk {
+        description "DPDK port type dpdk"; //CHECK IF THIS IS NEEDED.
+        base dpdk-port-type-base;
+    }
+
+    identity port-type-dpdkr {
+        description "DPDK port type dpdkr";
+        base dpdk-port-type-base;
+    }
+
+    identity port-type-dpdkvhost {
+        description "DPDK port type dpdkvhost";
+        base dpdk-port-type-base;
+    }
+
+    grouping dpdk-port-type-attributes {
+        description "Common leaf for dpdk port types";
+        leaf dpdk-port-type {
+           type identityref {
+              base dpdk-port-type-base;
+           }
+        }
+     }
+
+    grouping datapath-port-locator {
+        description "switch datapath and port descriptor";
+        leaf datapath {
+           type identityref {
+             base dpdk-datapath-type-base;
+           }
+        }
+        leaf port {
+           type identityref {
+             base dpdk-port-type-base;
+           }
+        }
+    }
+
+    augment "/topo:network-topology/topo:topology/topo:node" {
+           description "Augment topology with a list of supported dpdk-port-types";
+           ext:augment-identifier "supported-datapath-port-parameters";
+           list dpdk-port-type-entry {
+                 uses dpdk-port-type-attributes;
+          }
+     }
+
+
+}