Index: /branches/rel_avx_2_7_2/.reviewboardrc
===================================================================
--- /branches/rel_avx_2_7_2/.reviewboardrc	(revision 0)
+++ /branches/rel_avx_2_7_2/.reviewboardrc	(working copy)
@@ -0,0 +1,3 @@
+REVIEWBOARD_URL = "http://192.168.100.19/"
+REPOSITORY = "AVX2"
+REPOSITORY_TYPE = "svn"
Index: /branches/rel_avx_2_7_2/lib/avxpci/avxpci/utils.py
===================================================================
--- /branches/rel_avx_2_7_2/lib/avxpci/avxpci/utils.py	(revision 8852)
+++ /branches/rel_avx_2_7_2/lib/avxpci/avxpci/utils.py	(working copy)
@@ -426,9 +426,9 @@
 
     if _get_model() == "5900" or _get_model() == "7900" or _get_model() == "9900":
         pfs = (
-                mgmt + pf40Gn1 + pf40Gn2 +
-                pf25Gn1 + pf25Gn2 + pfn1 + pfn2 + 
-                pfGn1 + pfGn2 + pf100Gn1 + pf100Gn2
+                mgmt + 
+                pf100Gn1 + pf40Gn1 + pf25Gn1 + pfGn1 + pfn1 +
+                pf100Gn2 + pf40Gn2 + pf25Gn2 + pfGn2 + pfn2
             )
 
     return pfs
Index: /branches/rel_avx_2_7_2/lib/avxpci/get_port.py
===================================================================
--- /branches/rel_avx_2_7_2/lib/avxpci/get_port.py	(revision 8852)
+++ /branches/rel_avx_2_7_2/lib/avxpci/get_port.py	(working copy)
@@ -1,3 +1,4 @@
+import argparse
 import os
 import json
 from avxpci.utils import get_pf
@@ -42,7 +43,34 @@
         return onboard + ports + ssls
     return ports + onboard + ssls
 
+# extend the original script
+# if we have no parameter, return as old script.
+# elif we have "portx" as parameter, return linux interface name.
+def main():
+    ports = get_port()
+    
+    # Create the parser
+    parser = argparse.ArgumentParser(description="AVX port mapping script with command-line options.")
+
+    # Add command-line options
+    parser.add_argument("-p", "--port", type=str, help="Name of Array Port")
+
+    # Parse the command-line arguments
+    args = parser.parse_args()
+
+    # Handle the parsed arguments
+    if args.port:
+        try:
+            port_index = int(args.port[4:])
+            print ports[port_index]["sys_name"]
+            return ports[port_index]["sys_name"]
+        except:
+            return None
+
+    # if no arguments are provided, return original outuput: portmapping in json format.
+    if not any(vars(args).values()):
+        print json.dumps(ports, ensure_ascii=True, indent=2, separators=(',', ': '))
+
 
 if __name__ == '__main__':
-    ports = get_port()
-    print json.dumps(ports, ensure_ascii=True, indent=2, separators=(',', ': '))
+    main()
Index: /branches/rel_avx_2_7_2/scripts/get_ovs_ports.sh
===================================================================
--- /branches/rel_avx_2_7_2/scripts/get_ovs_ports.sh	(revision 0)
+++ /branches/rel_avx_2_7_2/scripts/get_ovs_ports.sh	(working copy)
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+# Function to display ports of a specific bridge
+display_ports() {
+    local bridge=$1
+    echo "Bridge: $bridge"
+    
+    # Get a list of all ports in the bridge
+    ports=$(ovs-vsctl list-ports $bridge)
+    
+    for port in $ports; do
+        # Check if the port is a bonded interface (i.e., has no associated interfaces in OVS DB)
+        if ovs-vsctl get port $port | grep -q Interface; then
+            continue
+        fi
+        
+        # Get the interface type
+        iface_type=$(ovs-vsctl get interface $port type)
+        
+        # Check if the interface type is empty or "system"
+        if [ -z "$iface_type" ] || [ "$iface_type" == "system" ]; then
+            echo "  Physical Port: $port"
+        fi
+    done
+    
+    echo ""
+}
+
+# Check if ovs-vsctl is installed
+if ! command -v ovs-vsctl &> /dev/null
+then
+    echo "ovs-vsctl could not be found. Please install Open vSwitch."
+    exit 1
+fi
+
+# Function to display help message
+display_help() {
+    echo "Usage: $0 <bridge_name|all>"
+}
+
+# Check if a bridge name or "all" is provided
+if [ $# -ne 1 ]; then
+    display_help
+    exit 1
+fi
+
+bridge_option=$1
+
+# Handle the "all" option or specific bridge name
+if [ "$bridge_option" == "all" ]; then
+    # Get a list of all OVS bridges
+    bridges=$(ovs-vsctl list-br)
+
+    if [ -z "$bridges" ]; then
+        echo "No OVS bridges found."
+        exit 0
+    fi
+
+    # Iterate over each bridge and find physical ports
+    for bridge in $bridges; do
+        display_ports $bridge
+    done
+else
+    # Display ports for the specific bridge
+    if ovs-vsctl br-exists $bridge_option; then
+        display_ports $bridge_option
+    else
+        echo "Bridge $bridge_option does not exist."
+        exit 1
+    fi
+fi
Index: /branches/rel_avx_2_7_2/src/generator/commands.pm
===================================================================
--- /branches/rel_avx_2_7_2/src/generator/commands.pm	(revision 8852)
+++ /branches/rel_avx_2_7_2/src/generator/commands.pm	(working copy)
@@ -5171,6 +5171,16 @@
 		function_args => [],
     },
     {
+        obj_type => "ITEM",
+        name => "status",
+        menu => "root_show_switch",
+        help_string  => "Display the status of virtual switches.",
+        cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL|CMD_KILLABLE",
+        user_level => "CLI_LEVEL_USER",
+        function_name => "switch_show_status",
+		function_args => [],
+    },
+    {
         obj_type => "MENU",
         name => "dhcp",
         parent_menu => ".",
Index: /branches/rel_avx_2_7_2/src/library/avxnet/avx_bridge.c
===================================================================
--- /branches/rel_avx_2_7_2/src/library/avxnet/avx_bridge.c	(revision 8852)
+++ /branches/rel_avx_2_7_2/src/library/avxnet/avx_bridge.c	(working copy)
@@ -33,6 +33,7 @@
 
 enum show_type{
    SHOW_BR,
+   SHOW_LINK_STATUS,
    SHOW_INTER,
    SHOW_VA,
    SHOW_STP,
@@ -2061,6 +2062,7 @@
     return 0;
 }
 static int switch_show_one(const char *bridge, enum show_type stype, bridge_type_t bridge_type, char** _res){
+    printf("Li-Debug: switch_show_one()\n");
     xmlDocPtr doc = NULL;
     xmlNodePtr current_node = NULL;
     xmlNodePtr child_node = NULL;
@@ -2092,6 +2094,10 @@
                 current_node = current_node->next;
                 continue;
             }
+            va_log_error("Li-Debug outside while loop for swich name. br_name: %s.\n", (char*)br_name);
+            if (stype == SHOW_LINK_STATUS) {
+                tmplen += sprintf(res + tmplen, "switch name %s:\n", (char*)br_name);
+            }
             if (bridge_type != OVS_ALL) {
                 xmlChar *br_type = xmlGetProp(current_node, BAD_CAST "type");
                 if (br_type) {
@@ -2115,8 +2121,77 @@
                 }
                 xmlNodePtr child = current_node->xmlChildrenNode;
                 while (child != NULL) {
+                    va_log_error("Li-Debug: inner while loop for switch config, stype: %d.\n", (int)stype);
                     switch (stype) {
+                        case SHOW_LINK_STATUS:
+                            va_log_error("Li-Debug: In SHOW_LINK_STATUS\n");
+                            //1. Read link status from pyhsical interface
+                            if (!xmlStrcmp(child->name, BAD_CAST "interface")) {
+                                child_node = child->children;
+                                while (child_node) {
+                                    xmlChar *if_name = xmlGetProp(child_node, BAD_CAST "name");
+                                    if (if_name) {
+                                        va_log_error("Li-Debug: if_name: %s\n", (char*)if_name);
+                                        tmplen += sprintf(res + tmplen, "  %s:\n", (char*)if_name);
+                                        char cmd[1024];
+                                        char link_result[1024] = {0};
+                                        char speed_result[1024] = {0};
+                                        snprintf(cmd, sizeof(cmd), "ethtool `python /ca/bin/get_port.py -p %s` | grep Link", (char*)if_name);
+                                        if (wrap_system(cmd, link_result) == 0) {
+                                            str_strip(link_result);
+                                            tmplen += sprintf(res + tmplen, "%s\n", link_result);
+                                        }
+                                        snprintf(cmd, sizeof(cmd), "ethtool `python /ca/bin/get_port.py -p %s` | grep Speed", (char*)if_name);
+                                        if (wrap_system(cmd, speed_result) == 0) {
+                                            str_strip(speed_result);
+                                            tmplen += sprintf(res + tmplen, "%s\n", speed_result);
+                                        }
+                                        xmlFree(if_name);
+                                    }
+                                    child_node = child_node->next;
+                                }
+                            }
+                            //2. Read link status from Bond interface
+                            if (!xmlStrcmp(child->name, BAD_CAST "bonds")) {
+                                xmlNodePtr bond_node = child->children;
+                                while (bond_node) {
+                                    if (!xmlStrcmp(bond_node->name, BAD_CAST "bond")) {
+                                        xmlChar* bond_name = xmlGetProp(bond_node, BAD_CAST "name");
+                                        if (bond_name) {
+                                            tmplen += sprintf(res + tmplen, "  %s:\n", (char*)bond_name);
+                                            xmlNodePtr iface_node = bond_node->children;
+                                            while (iface_node) {
+                                                if (!xmlStrcmp(iface_node->name, BAD_CAST "iface")) {
+                                                    xmlChar* iface_name = xmlGetProp(iface_node, BAD_CAST "name");
+                                                    if (iface_name) {
+                                                        tmplen += sprintf(res + tmplen, "  %s:\n", (char*)iface_name);
+                                                        char cmd[1024];
+                                                        char link_result[1024] = {0};
+                                                        char speed_result[1024] = {0};
+                                                        snprintf(cmd, sizeof(cmd), "ethtool `python /ca/bin/get_port.py -p %s` | grep Link", (char*)iface_name);
+                                                        if (wrap_system(cmd, link_result) == 0) {
+                                                            str_strip(link_result);
+                                                            tmplen += sprintf(res + tmplen, "%s\n", link_result);
+                                                        }
+                                                        snprintf(cmd, sizeof(cmd), "ethtool `python /ca/bin/get_port.py -p %s` | grep Speed", (char*)iface_name);
+                                                        if (wrap_system(cmd, speed_result) == 0) {
+                                                            str_strip(speed_result);
+                                                            tmplen += sprintf(res + tmplen, "%s\n", speed_result);
+                                                        }
+                                                        xmlFree(iface_name);
+                                                    }
+                                                }
+                                                iface_node = iface_node->next;
+                                            }
+                                            xmlFree(bond_name);
+                                        }
+                                    }
+                                    bond_node = bond_node->next;
+                                }
+                            }
+                            break;
                         case SHOW_INTER:
+                            va_log_error("Li-Debug: In SHOW_INTER\n");
                             if (!xmlStrcmp(child->name, BAD_CAST "interface")) {
                                 child_node = child->children;
                                 while (child_node) {
@@ -2131,6 +2206,7 @@
                             }
                             break;
                         case SHOW_VA:
+                            va_log_error("Li-Debug: In SHOW_VA\n");
                             if (!xmlStrcmp(child->name, BAD_CAST "va")) {
                                 child_node = child->children;
                                 while (child_node) {
@@ -2167,6 +2243,7 @@
                             }
                             break;
                         case SHOW_STP:
+                            va_log_error("Li-Debug: In SHOW_STP\n");
                             if (!xmlStrcmp(child->name, BAD_CAST "stp")) {
                                 xmlChar* stp_status = xmlGetProp(child, BAD_CAST "status");
                                 xmlChar* stp_priority = xmlGetProp(child, BAD_CAST "priority");
@@ -2181,6 +2258,7 @@
                             }
                             break;
                         case SHOW_MIRROR:
+                            va_log_error("Li-Debug: In SHOW_MIRROR\n");
                             if (!xmlStrcmp(child->name, BAD_CAST "mirror")) {
                                 child_node = child->children;
                                 xmlChar* sport_name = NULL;
@@ -2214,6 +2292,7 @@
                             }
                             break;
                         case SHOW_BOND:
+                            va_log_error("Li-Debug: In SHOW_BOND\n");
                             if (!xmlStrcmp(child->name, BAD_CAST "bonds")) {
                                 xmlNodePtr bond_node = child->children;
                                 while (bond_node) {
@@ -2257,6 +2336,28 @@
                                 }
                             }
                             break;
+                        // case SHOW_LINK_STATUS:
+                            // //init avxpci module
+                            // if (!xmlStrcmp(child->name, BAD_CAST "interface")) {
+                            //     child_node = child->children;
+                            //     while (child_node) {
+                            //         xmlChar *if_name = xmlGetProp(child_node, BAD_CAST "name");
+                            //         if (if_name) {
+                            //             char cmd[1024];
+                            //             char str_buff[1024] = {0};
+                            //             snprintf(cmd, sizeof(cmd), "ethtool `python /ca/bin/get_port.py -p %s` | egrep 'Link|Speed'", (char*)if_name);
+                            //             if (wrap_system(cmd, str_buff) == 0) {
+                            //                 str_strip(str_buff);
+                            //                 tmplen += sprintf(res + tmplen, "OVS Bridge %s:\n %s\n", (char*)br_name, str_buff);
+                            //             }
+                            //             xmlFree(if_name);
+                            //         }
+                            //         child_node = child_node->next;
+                            //     }
+                            // }
+                            // //clean up
+
+                            // break;
                         case SHOW_NOTHING:
                         default:
                             break;
@@ -2426,6 +2527,10 @@
         return strcmp(bridge, "all") == 0 ?
         switch_show_one(bridge, SHOW_MIRROR, OVS_ALL, &res) : -1;
     }
+    if (strcmp(type, "status") == 0) {
+        return strcmp(bridge, "all") == 0 ?
+        switch_show_one(bridge, SHOW_LINK_STATUS, OVS_ALL, &res) : -1;
+    }
     if (strlen(type) != 0) {
         return -1;
     }
Index: /branches/rel_avx_2_7_2/src/library/avxvainst/va_xmlrpc.c
===================================================================
--- /branches/rel_avx_2_7_2/src/library/avxvainst/va_xmlrpc.c	(revision 8852)
+++ /branches/rel_avx_2_7_2/src/library/avxvainst/va_xmlrpc.c	(working copy)
@@ -1244,6 +1244,12 @@
     return switch_show_rpc("all", "mirror");
 }
 
+int
+switch_show_status() 
+{
+    return switch_show_rpc("all", "status");
+}
+
 int switch_tune_on_off_rpc(const char* mode)
 {
     int ret = -1;
