Working MWC pod

Change-Id: Ib47580b408b2f058943a7e545418ef76c78c040a
diff --git a/fpcagent b/fpcagent
index 96360c2..569a11f 160000
--- a/fpcagent
+++ b/fpcagent
@@ -1 +1 @@
-Subproject commit 96360c291449d4ea4cff60a00bac618e027fa926
+Subproject commit 569a11f68a38a3543737d5325467b635683b424b
diff --git a/mwc-bpr-docker.sh b/mwc-bpr-docker.sh
index 395053f..9f997e2 100755
--- a/mwc-bpr-docker.sh
+++ b/mwc-bpr-docker.sh
@@ -9,4 +9,4 @@
 docker tag onos-fabric-mwc 10.128.13.3:5000/onosproject/onos:candidate
 docker push 10.128.13.3:5000/onosproject/onos:candidate
 
-# ssh head "cd /opt/onos_fabric/ && docker-compose down && docker-compose pull && docker-compose up -d"
+ssh head "cd /opt/onos_fabric/ && docker-compose down && docker-compose pull && docker-compose up -d"
diff --git a/mwc-provision-mlx-test.sh b/mwc-provision-mlx-test.sh
new file mode 100755
index 0000000..4cc4cf7
--- /dev/null
+++ b/mwc-provision-mlx-test.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+MWC_HEAD_IP="10.128.13.3"
+ENODEB_ADDR="119.0.0.10"
+UE_SUBNET="17.255.0.0/16"
+
+set -ex
+
+onos-netcfg ${MWC_HEAD_IP} ${ONOS_ROOT}/p4-pod-configs/mwc-pod/mwc-demo-mlx-test.json
+sleep 2
+onos-netcfg ${MWC_HEAD_IP} ${ONOS_ROOT}/p4-pod-configs/mwc-pod/hosts.json
+sleep 2
+onos-netcfg ${MWC_HEAD_IP} ${ONOS_ROOT}/p4-pod-configs/mwc-pod/tofino-leaf1-netcfg.json
+sleep 5
+onos-netcfg ${MWC_HEAD_IP} ${ONOS_ROOT}/p4-pod-configs/mwc-pod/tofino-leaf2-netcfg.json
+sleep 5
+onos-netcfg ${MWC_HEAD_IP} ${ONOS_ROOT}/p4-pod-configs/mwc-pod/mellanox-spine2.json
+sleep 5
+#onos-netcfg ${MWC_HEAD_IP} ${ONOS_ROOT}/p4-pod-configs/mwc-pod/cavium-spine1.json
+#sleep 5
+bash fpcagent/scripts/addP4DPN.sh ${MWC_HEAD_IP} device:tofino:leaf2
+sleep 2
+sshpass -p rocks -t onos@${MWC_HEAD_IP} "route-add ${UE_SUBNET} ${ENODEB_ADDR}"
+
diff --git a/mwc-provision.sh b/mwc-provision.sh
index 6e8fd0f..248d9b9 100755
--- a/mwc-provision.sh
+++ b/mwc-provision.sh
@@ -20,5 +20,5 @@
 sleep 5
 bash fpcagent/scripts/addP4DPN.sh ${MWC_HEAD_IP} device:tofino:leaf2
 sleep 2
-sshpass -p rocks -t onos@${MWC_HEAD_IP} "route-add ${UE_SUBNET} ${ENODEB_ADDR}"
+sshpass -p rocks ssh onos@${MWC_HEAD_IP} -p8101 -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" "route-add ${UE_SUBNET} ${ENODEB_ADDR}"
 
diff --git a/p4-pod-configs/mwc-pod/hosts.json b/p4-pod-configs/mwc-pod/hosts.json
index 012bee5..d75f0bb 100644
--- a/p4-pod-configs/mwc-pod/hosts.json
+++ b/p4-pod-configs/mwc-pod/hosts.json
@@ -48,6 +48,20 @@
         "ips": ["122.0.0.4"],
         "locations": ["device:tofino:leaf2/144"]
       }
+    },
+    "3c:fd:fe:a6:e7:09/None": {
+      "basic": {
+        "name": "vUE",
+        "ips": ["10.6.2.101"],
+        "locations": ["device:tofino:leaf2/152"]
+      }
+    },
+    "3c:fd:fe:a6:e7:08/None": {
+      "basic": {
+        "name": "vAppServer",
+        "ips": ["10.6.2.102"],
+        "locations": ["device:tofino:leaf2/160"]
+      }
     }
   }
 }
diff --git a/p4-pod-configs/mwc-pod/mellanox-spine2.json b/p4-pod-configs/mwc-pod/mellanox-spine2.json
index c96f1fd..bf03f41 100644
--- a/p4-pod-configs/mwc-pod/mellanox-spine2.json
+++ b/p4-pod-configs/mwc-pod/mellanox-spine2.json
@@ -13,19 +13,19 @@
         "piPipeconfId": "org.onosproject.pipelines.fabric"
       },
       "ports": {
-        "1/0": {
-          "name": "1/0",
+        "3/0": {
+          "name": "3/0",
           "speed": 100000,
           "enabled": true,
-          "number": 1,
+          "number": 3,
           "removed": false,
           "type": "copper"
         },
-        "2/0": {
-          "name": "2/0",
+        "4/0": {
+          "name": "4/0",
           "speed": 100000,
           "enabled": true,
-          "number": 2,
+          "number": 4,
           "removed": false,
           "type": "copper"
         }
diff --git a/p4-pod-configs/mwc-pod/mwc-demo-mlx-test.json b/p4-pod-configs/mwc-pod/mwc-demo-mlx-test.json
new file mode 100644
index 0000000..882ed68
--- /dev/null
+++ b/p4-pod-configs/mwc-pod/mwc-demo-mlx-test.json
@@ -0,0 +1,146 @@
+{
+  "devices": {
+    "device:tofino:leaf1": {
+      "segmentrouting": {
+        "name": "leaf1",
+        "ipv4NodeSid": 204,
+        "ipv4Loopback": "192.168.0.204",
+        "ipv6NodeSid": 214,
+        "ipv6Loopback": "2000::c0a8:0204",
+        "routerMac": "00:00:00:00:02:04",
+        "isEdgeRouter": true,
+        "adjacencySids": []
+      }
+    },
+    "device:tofino:leaf2": {
+      "segmentrouting": {
+        "name": "leaf2",
+        "ipv4NodeSid": 205,
+        "ipv4Loopback": "192.168.0.205",
+        "ipv6NodeSid": 215,
+        "ipv6Loopback": "2000::c0a8:0205",
+        "routerMac": "00:00:00:00:02:05",
+        "isEdgeRouter": true,
+        "adjacencySids": []
+      }
+    },
+    "device:cavium:spine1": {
+      "segmentrouting": {
+        "name": "spine1",
+        "ipv4NodeSid": 226,
+        "ipv4Loopback": "192.168.0.226",
+        "ipv6NodeSid": 236,
+        "ipv6Loopback": "2000::c0a8:0226",
+        "routerMac": "00:00:00:00:02:26",
+        "isEdgeRouter": false,
+        "adjacencySids": []
+      }
+    },
+    "device:mellanox:spine2": {
+      "segmentrouting": {
+        "name": "spine2",
+        "ipv4NodeSid": 227,
+        "ipv4Loopback": "192.168.0.227",
+        "ipv6NodeSid": 237,
+        "ipv6Loopback": "2000::c0a8:0227",
+        "routerMac": "00:00:00:00:02:27",
+        "isEdgeRouter": false,
+        "adjacencySids": []
+      }
+    }
+  },
+  "ports": {
+    "device:tofino:leaf1/144": {
+      "interfaces": [
+        {
+          "name": "leaf1-3/0-compute-1",
+          "ips": [
+            "10.6.1.254/24",
+            "118.0.0.254/24",
+            "119.0.0.254/24"
+          ],
+          "vlan-untagged": 10
+        }
+      ]
+    },
+    "device:tofino:leaf1/145": {
+      "interfaces": [
+        {
+          "name": "leaf1-3/1-mgmt25-enb",
+          "ips": [
+            "118.0.0.254/24",
+            "119.0.0.254/24"
+          ],
+          "vlan-untagged": 10
+        }
+      ]
+    },
+    "device:tofino:leaf1/146": {
+      "interfaces": [
+        {
+          "name": "leaf1-3/2--head-node(ProgRAN)",
+          "ips": [
+            "118.0.0.254/24"
+          ],
+          "vlan-untagged": 10
+        }
+      ]
+    },
+    "device:tofino:leaf2/144": {
+      "interfaces": [
+        {
+          "name": "leaf2-3/0-compute-2",
+          "ips": [
+            "10.6.2.254/24",
+            "122.0.0.254/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    },
+    "device:tofino:leaf2/145": {
+      "interfaces": [
+        {
+          "name": "leaf2-3/1-P4-DP",
+          "ips": [
+            "140.0.0.2/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    },
+    "device:tofino:leaf2/146": {
+      "interfaces": [
+        {
+          "name": "leaf2-3/2-------mgmt-27---ARM",
+          "ips": [
+            "150.0.0.254/24"
+          ],
+          "vlan-untagged": 150
+        }
+      ]
+    },
+    "device:tofino:leaf2/152": {
+      "interfaces": [
+        {
+          "name": "leaf2-COMP2-40G-1",
+          "ips": [
+            "10.6.2.254/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    },
+    "device:tofino:leaf2/160": {
+      "interfaces": [
+        {
+          "name": "leaf2-COMP2-40G-2",
+          "ips": [
+            "10.6.2.254/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    }
+  }
+}
diff --git a/p4-pod-configs/mwc-pod/mwc-demo.json b/p4-pod-configs/mwc-pod/mwc-demo.json
index 7b63d1e..ed06b4a 100644
--- a/p4-pod-configs/mwc-pod/mwc-demo.json
+++ b/p4-pod-configs/mwc-pod/mwc-demo.json
@@ -35,18 +35,6 @@
         "isEdgeRouter": false,
         "adjacencySids": []
       }
-    },
-    "device:mellanox:spine2": {
-      "segmentrouting": {
-        "name": "spine2",
-        "ipv4NodeSid": 227,
-        "ipv4Loopback": "192.168.0.227",
-        "ipv6NodeSid": 237,
-        "ipv6Loopback": "2000::c0a8:0227",
-        "routerMac": "00:00:00:00:02:27",
-        "isEdgeRouter": false,
-        "adjacencySids": []
-      }
     }
   },
   "ports": {
@@ -119,6 +107,28 @@
           "vlan-untagged": 150
         }
       ]
+    },
+    "device:tofino:leaf2/152": {
+      "interfaces": [
+        {
+          "name": "leaf2-COMP2-40G-1",
+          "ips": [
+            "10.6.2.254/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    },
+    "device:tofino:leaf2/160": {
+      "interfaces": [
+        {
+          "name": "leaf2-COMP2-40G-2",
+          "ips": [
+            "10.6.2.254/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
     }
   }
 }
diff --git a/p4-pod-configs/mwc-pod/mwc-demo.json.bak b/p4-pod-configs/mwc-pod/mwc-demo.json.bak
new file mode 100644
index 0000000..882ed68
--- /dev/null
+++ b/p4-pod-configs/mwc-pod/mwc-demo.json.bak
@@ -0,0 +1,146 @@
+{
+  "devices": {
+    "device:tofino:leaf1": {
+      "segmentrouting": {
+        "name": "leaf1",
+        "ipv4NodeSid": 204,
+        "ipv4Loopback": "192.168.0.204",
+        "ipv6NodeSid": 214,
+        "ipv6Loopback": "2000::c0a8:0204",
+        "routerMac": "00:00:00:00:02:04",
+        "isEdgeRouter": true,
+        "adjacencySids": []
+      }
+    },
+    "device:tofino:leaf2": {
+      "segmentrouting": {
+        "name": "leaf2",
+        "ipv4NodeSid": 205,
+        "ipv4Loopback": "192.168.0.205",
+        "ipv6NodeSid": 215,
+        "ipv6Loopback": "2000::c0a8:0205",
+        "routerMac": "00:00:00:00:02:05",
+        "isEdgeRouter": true,
+        "adjacencySids": []
+      }
+    },
+    "device:cavium:spine1": {
+      "segmentrouting": {
+        "name": "spine1",
+        "ipv4NodeSid": 226,
+        "ipv4Loopback": "192.168.0.226",
+        "ipv6NodeSid": 236,
+        "ipv6Loopback": "2000::c0a8:0226",
+        "routerMac": "00:00:00:00:02:26",
+        "isEdgeRouter": false,
+        "adjacencySids": []
+      }
+    },
+    "device:mellanox:spine2": {
+      "segmentrouting": {
+        "name": "spine2",
+        "ipv4NodeSid": 227,
+        "ipv4Loopback": "192.168.0.227",
+        "ipv6NodeSid": 237,
+        "ipv6Loopback": "2000::c0a8:0227",
+        "routerMac": "00:00:00:00:02:27",
+        "isEdgeRouter": false,
+        "adjacencySids": []
+      }
+    }
+  },
+  "ports": {
+    "device:tofino:leaf1/144": {
+      "interfaces": [
+        {
+          "name": "leaf1-3/0-compute-1",
+          "ips": [
+            "10.6.1.254/24",
+            "118.0.0.254/24",
+            "119.0.0.254/24"
+          ],
+          "vlan-untagged": 10
+        }
+      ]
+    },
+    "device:tofino:leaf1/145": {
+      "interfaces": [
+        {
+          "name": "leaf1-3/1-mgmt25-enb",
+          "ips": [
+            "118.0.0.254/24",
+            "119.0.0.254/24"
+          ],
+          "vlan-untagged": 10
+        }
+      ]
+    },
+    "device:tofino:leaf1/146": {
+      "interfaces": [
+        {
+          "name": "leaf1-3/2--head-node(ProgRAN)",
+          "ips": [
+            "118.0.0.254/24"
+          ],
+          "vlan-untagged": 10
+        }
+      ]
+    },
+    "device:tofino:leaf2/144": {
+      "interfaces": [
+        {
+          "name": "leaf2-3/0-compute-2",
+          "ips": [
+            "10.6.2.254/24",
+            "122.0.0.254/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    },
+    "device:tofino:leaf2/145": {
+      "interfaces": [
+        {
+          "name": "leaf2-3/1-P4-DP",
+          "ips": [
+            "140.0.0.2/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    },
+    "device:tofino:leaf2/146": {
+      "interfaces": [
+        {
+          "name": "leaf2-3/2-------mgmt-27---ARM",
+          "ips": [
+            "150.0.0.254/24"
+          ],
+          "vlan-untagged": 150
+        }
+      ]
+    },
+    "device:tofino:leaf2/152": {
+      "interfaces": [
+        {
+          "name": "leaf2-COMP2-40G-1",
+          "ips": [
+            "10.6.2.254/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    },
+    "device:tofino:leaf2/160": {
+      "interfaces": [
+        {
+          "name": "leaf2-COMP2-40G-2",
+          "ips": [
+            "10.6.2.254/24"
+          ],
+          "vlan-untagged": 20
+        }
+      ]
+    }
+  }
+}
diff --git a/p4-pod-configs/mwc-pod/tofino-leaf2-netcfg.json b/p4-pod-configs/mwc-pod/tofino-leaf2-netcfg.json
index 9c2cdce..d0c8607 100644
--- a/p4-pod-configs/mwc-pod/tofino-leaf2-netcfg.json
+++ b/p4-pod-configs/mwc-pod/tofino-leaf2-netcfg.json
@@ -1,7 +1,6 @@
 {
   "devices": {
     "device:tofino:leaf2": {
-      "chassisId": "000000000205",
       "generalprovider": {
         "p4runtime": {
           "ip": "10.128.13.222",
@@ -53,6 +52,28 @@
           "number": 146,
           "removed": false,
           "type": "copper"
+        },
+        "4/0": {
+          "name": "4/0",
+          "speed": 40000,
+          "enabled": true,
+          "number": 152,
+          "removed": false,
+          "type": "copper",
+          "annotations": {
+              "autoneg": "true"
+          }
+        },
+        "5/0": {
+          "name": "5/0",
+          "speed": 40000,
+          "enabled": true,
+          "number": 160,
+          "removed": false,
+          "type": "copper",
+          "annotations": {
+              "autoneg": "true"
+          }
         }
       },
       "basic": {
diff --git a/pingue.sh b/pingue.sh
new file mode 100755
index 0000000..09ed09e
--- /dev/null
+++ b/pingue.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+while :
+do
+
+for x in `sshpass -p rocks ssh onos-fabric log:display | egrep -o "17.255.255.[0-9]{3}" | uniq | tail -n 2`
+do
+  ping -c 1 $x
+done
+
+done