Index: /branches/rel_avx_2_7_2/Makefile
===================================================================
--- /branches/rel_avx_2_7_2/Makefile	(revision 8826)
+++ /branches/rel_avx_2_7_2/Makefile	(working copy)
@@ -62,6 +62,9 @@
 dpdkpack: changeserverip
 	./scripts/avxbuildutils.py -o buildpack -p dpdk
 
+qatpack: changeserverip
+	./scripts/avxbuildutils.py -o buildpack -p qat
+
 avxpack: avx_cli-1.0.tar.gz avx-driver-monitor-1.0.1.tar.gz avxagentd-1.0.tar.gz changeserverip
 	cp /etc/resolv.conf centos72/etc/
 	./scripts/avxbuildutils.py -o buildpack -p avxsvn
Index: /branches/rel_avx_2_7_2/lib/avxpci/avxpci.h
===================================================================
--- /branches/rel_avx_2_7_2/lib/avxpci/avxpci.h	(revision 8826)
+++ /branches/rel_avx_2_7_2/lib/avxpci/avxpci.h	(working copy)
@@ -49,6 +49,7 @@
     NITROX_DRV,     //CaN5
     SWCSM36,        //Sansec 16VF
     FM_CPC_DRV,     //Fisherman
+    QAT_C62X,       //QAT 8960,8970
     UNKNOWN_DRV,
 } pci_driver_t;
 
Index: /branches/rel_avx_2_7_2/lib/avxpci/avxpci.c
===================================================================
--- /branches/rel_avx_2_7_2/lib/avxpci/avxpci.c	(revision 8826)
+++ /branches/rel_avx_2_7_2/lib/avxpci/avxpci.c	(working copy)
@@ -140,5 +140,7 @@
         return FM_CPC_DRV;
     if (!strcmp("swcsm36", str_driver))
         return SWCSM36;
+    if (!strcmp("qat_c62x", str_driver))
+        return QAT_C62X;
     return UNKNOWN_DRV;
 }
Index: /branches/rel_avx_2_7_2/lib/avxpci/avxpci/pf.py
===================================================================
--- /branches/rel_avx_2_7_2/lib/avxpci/avxpci/pf.py	(revision 8826)
+++ /branches/rel_avx_2_7_2/lib/avxpci/avxpci/pf.py	(working copy)
@@ -17,6 +17,7 @@
     ('swcsm36', ('SanSec', 2, 1)),
     ('FM_CPC_DRV', ('FisherMan', 2, 0)),
     ('igb', ('Intel', 0, 1)),
+    ('qat_c62x', ('Intel', 2, 1)),
 ])
 
 def get_model():
Index: /branches/rel_avx_2_7_2/scripts/avxapps_startup.sh
===================================================================
--- /branches/rel_avx_2_7_2/scripts/avxapps_startup.sh	(revision 8826)
+++ /branches/rel_avx_2_7_2/scripts/avxapps_startup.sh	(working copy)
@@ -200,6 +200,37 @@
 insmod swcsm36.ko VFnum=16
 popd
 
+# Install and start QAT
+INTEL_VENDORID="8086"
+C62X_DEVICE_NUMBER="37c8"
+numC62xDevicesP=$(lspci -n | egrep -c "$INTEL_VENDORID:$C62X_DEVICE_NUMBER")
+if [ $numC62xDevicesP -ne 0 ]; then
+    echo "set QAT_c62x"
+    pushd /usr/share/qat
+    chmod 777 *
+    rm -rf /etc/init.d/qat_service
+    cp -rf qat_service /etc/init.d/qat_service
+    rm -rf /usr/local/bin/adf_ctl
+    cp -rf adf_ctl /usr/local/bin/adf_ctl
+    rm -rf /lib64/libusdm_drv_s.so
+    rm -rf /lib64/libqat_s.so
+    ln -s libusdm_drv_s.so /lib64/libusdm_drv_s.so
+    ln -s libqat_s.so /lib64/libqat_s.so
+    rmmod qat_c62xvf
+    rmmod qat_c62x
+    rmmod qat_api
+    rmmod usdm_drv
+    rmmod intel_qat
+    modprobe uio
+    insmod intel_qat.ko
+    insmod usdm_drv.ko
+    insmod qat_c62x.ko
+    insmod qat_c62xvf.ko
+    insmod qat_api.ko
+    service qat_service start
+    popd
+fi
+
 pushd /ca/bin/fm
 ./install.sh
 
Index: /branches/rel_avx_2_7_2/scripts/avxbuildutils.py
===================================================================
--- /branches/rel_avx_2_7_2/scripts/avxbuildutils.py	(revision 8826)
+++ /branches/rel_avx_2_7_2/scripts/avxbuildutils.py	(working copy)
@@ -30,7 +30,7 @@
 LOG_FILE = "/var/log/avxrepocreate.log"
 
 AVX_TMP_ENV = "/tmp/buildenv/"
-AVX_RPMS_LIST = ['kernel', 'qemu-kvm', 'libvirt', 'plymouth', 'openssh', 'util-linux', 'httpd', 'openssl', 'i40e', 'openvswitch', 'dnsmasq', 'net-snmp', 'openldap']
+AVX_RPMS_LIST = ['kernel', 'qemu-kvm', 'libvirt', 'plymouth', 'openssh', 'util-linux', 'httpd', 'openssl', 'i40e', 'openvswitch', 'dnsmasq', 'net-snmp', 'openldap', 'qat']
 AVX_RPMS_ARCH = ['x86_64']
 
 CURRENT_DIR = os.getcwd()
Index: /branches/rel_avx_2_7_2/scripts/buildenv.ks
===================================================================
--- /branches/rel_avx_2_7_2/scripts/buildenv.ks	(revision 8826)
+++ /branches/rel_avx_2_7_2/scripts/buildenv.ks	(working copy)
@@ -176,4 +176,8 @@
 perl-HTML-Parser
 autogen-libopts-devel
 lksctp-tools-devel
+gcc
+gcc-c++
+yasm
+boost-devel
 %end
Index: /branches/rel_avx_2_7_2/src/backend/sys_cmd.c
===================================================================
--- /branches/rel_avx_2_7_2/src/backend/sys_cmd.c	(revision 8826)
+++ /branches/rel_avx_2_7_2/src/backend/sys_cmd.c	(working copy)
@@ -162,6 +162,10 @@
 #define DEFAULT_ALIVE_CHECK_COUNT "3"
 #define VAR_RUN "/var/run/"
 
+#define QAT_PCI_DRIVER_PATH "/sys/bus/pci/drivers/c6xx/" 
+#define QAT_DH8960_SUBSYSTEM_DEVICE "0x0001"
+#define QAT_DH8970_SUBSYSTEM_DEVICE "0x0002"
+
 enum {
 	SSHD_CONFIG_IP,
 	SSHD_CONFIG_IPV6,
@@ -354,6 +358,8 @@
 #define CAVIUM_NULL_CARD   0
 #define CAVIUM_CNN3_CARD   1
 #define CAVIUM_CNN5_CARD   2
+#define QAT_DH8960_CARD    3
+#define QAT_DH8970_CARD    4
 
 #define FTP_FILE_BUFF_LEN        8192
 
@@ -1063,12 +1069,55 @@
     return CAVIUM_NULL_CARD;
 }
 
+static int get_qat_hardware_type_cnt(int *num) {
+    DIR *dir;
+    struct dirent *ent;
+    int type = 0;
+
+    if(dir = opendir(QAT_PCI_DRIVER_PATH)) 
+    {
+        while ((ent = readdir(dir)) != NULL) 
+        {
+            if (ent->d_type == DT_LNK) 
+            {
+                char filename[256];
+                snprintf(filename, sizeof(filename), "%s%s/subsystem_device", QAT_PCI_DRIVER_PATH, ent->d_name);
+
+                FILE *fp = fopen(filename, "r");
+                if (fp != NULL) 
+                {
+                    char buffer[256];
+                    if(fgets(buffer, sizeof(buffer), fp) != NULL) 
+                    {
+                        if(strstr(buffer, QAT_DH8960_SUBSYSTEM_DEVICE))
+                        {
+                            (*num)++;
+                            type = QAT_DH8960_CARD;
+                        }
+                        else if(strstr(buffer, QAT_DH8970_SUBSYSTEM_DEVICE))
+                        {
+                        	(*num)++;
+                        	type = QAT_DH8970_CARD;
+                        }
+                    }
+                    fclose(fp);
+                }
+            }
+        }
+        closedir(dir);
+    }
+
+    /* one qat card has three endpoints */ 
+    *num /= 3;
+    return type;
+}
+
 static int
 show_ssl_hardware(void)
 {
     char *type = NULL;
     int model_idx = PROPERTY_AVX_MODEL_IDX;
-    int ssl_type = -1; // -1: None; 0: N3; 1: N5
+    int ssl_type = -1; // -1: None; 0: N3; 1: N5; 3: DH8960; 4: DH8970
     int ssl_count = 0;
     int sdf_count = 0;
     int sfm_count = 0;
@@ -1085,6 +1134,13 @@
         if (access("/dev/nitrox_v-1", F_OK) == 0) {
             ssl_count++;
         }
+    } else if (access(QAT_PCI_DRIVER_PATH, F_OK) == 0) {
+    	ssl_type = get_qat_hardware_type_cnt(&ssl_count);
+    	if (ssl_type == QAT_DH8960_CARD) {
+    		type = "60Q";
+    	} else {
+    		type = "70Q";
+    	}
     }
 
     sdf_count = get_sanwei_count();
@@ -3220,6 +3276,8 @@
                 printf("      ae_core:\t%d%%\n", ae_usage);
                 printf("      se_core:\t%d%%\n", se_usage);
                 ++n5_idx;
+            } else if (QAT_C62X == anport[i].driver) {
+                printf("ssl%d support, vf num is %d.\n", cnt + 1, anport[i].vf_num);
             } else{
                 printf("ssl%d\tNot support\n\n", cnt + 1);
             }
Index: /branches/rel_avx_2_7_2/src/library/avxvainst/va_instance.c
===================================================================
--- /branches/rel_avx_2_7_2/src/library/avxvainst/va_instance.c	(revision 8826)
+++ /branches/rel_avx_2_7_2/src/library/avxvainst/va_instance.c	(working copy)
@@ -1683,6 +1683,17 @@
                             (ssl_arg->ret_pci_arr + i)->bus,
                             (ssl_arg->ret_pci_arr + i)->slot,
                             (ssl_arg->ret_pci_arr + i)->func);
+        } else if (QAT_C62X == ssl_arg->ssl_driver) {
+            va_log_debug("The SSL card is QAT");
+            if (hyper_type == 0) {
+                strcpy((config->va_ssls + i)->bus, (ssl_arg->ret_pci_arr + i)->bus);
+                strcpy((config->va_ssls + i)->slot, (ssl_arg->ret_pci_arr + i)->slot);
+                strcpy((config->va_ssls + i)->func, (ssl_arg->ret_pci_arr + i)->func);
+            }
+            va_log_debug("SSL ID : %d bus: %s slot: %s  func: %s", i,
+                (ssl_arg->ret_pci_arr + i)->bus,
+                (ssl_arg->ret_pci_arr + i)->slot,
+                (ssl_arg->ret_pci_arr + i)->func);
         }
     }
 
@@ -3528,7 +3539,7 @@
     }
     pci_driver_t ssl_driver = get_ssl_driver_by_id(ssl_idx);
     //regard any other ssl as shared
-    if (NITROX_DRV != ssl_driver && PKP_DRV != ssl_driver) {
+    if (NITROX_DRV != ssl_driver && PKP_DRV != ssl_driver && QAT_C62X != ssl_driver) {
         is_shared = 1;
     }
 
Index: /branches/rel_avx_2_7_2/update/avxsystem.ks
===================================================================
--- /branches/rel_avx_2_7_2/update/avxsystem.ks	(revision 8826)
+++ /branches/rel_avx_2_7_2/update/avxsystem.ks	(working copy)
@@ -508,6 +508,8 @@
 lighttpd-fastcgi.x86_64
 ice-1.11.17.1-1.x86_64
 intel_auxiliary-1.0.1-1.x86_64
+qat-4.15.0-0.x86_64
+bc-1.06.95-13.el7.x86_64
 %end
 
 %post --nochroot --interpreter ../tools/image-minimizer
