Index: /branches/rel_apv_10_7/usr/click/lib/libip/ipvers.c
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libip/ipvers.c	(revision 38279)
+++ /branches/rel_apv_10_7/usr/click/lib/libip/ipvers.c	(working copy)
@@ -197,6 +197,7 @@
 #define QAT_C6XX_CARD_COUNT     3
 #define QAT_DH895XCC_CARD_COUNT 1
 #define QAT_C6XX_CARD_TYPE      "c6xx"
+#define QAT_C6XXVF_CARD_TYPE    "c6xxvf"
 #define QAT_DH895XCC_CARD_TYPE  "dh895xcc"
 #define DEV_NAME_SIZE           17
 
@@ -876,7 +877,8 @@
 	char buf[SSL_CARD_STR_LEN];
 	int nitrox_count = 0;
 	char code[CODE_SIZE] = {0};
-	
+	char qat_dev_name[DEV_NAME_SIZE] = {0};
+
 #ifndef ARM64
 	len = sizeof(nitrox_v_count);
 	if (sysctlbyname("hw.n5crypto.nitrox_v_count", &nitrox_v_count,
@@ -897,6 +899,11 @@
 	                 &len, NULL, 0) != 0) {
 		return -3;
 	}
+
+	len = sizeof(qat_dev_name);
+	if (sysctlbyname("hw.qat.qat_dev_name", &qat_dev_name, &len, NULL, 0) != 0) {
+		return -3;
+	}
 #endif
 
 	sdf_len = sizeof(sdf_count);
@@ -944,7 +951,11 @@
 		}
 
 		if (qat_card_count > 0) {
-			printf("SSL HW:    %d * Intel QAT", qat_card_count/QAT_C6XX_CARD_COUNT);
+			if (strcmp(qat_dev_name, QAT_C6XX_CARD_TYPE) == 0) {
+				printf("SSL HW:    %d * Intel QAT", qat_card_count/QAT_C6XX_CARD_COUNT);
+			} else {
+				printf("SSL HW:    %d * Intel QAT", qat_card_count);
+			}
 		}
 
 		len = 0;
@@ -2087,11 +2098,13 @@
 		}
 
 		len = 0;
-		if (strcmp(qat_dev_name,  QAT_C6XX_CARD_TYPE) == 0) {
+		if (strcmp(qat_dev_name, QAT_C6XX_CARD_TYPE) == 0) {
 			bzero(qat_dev_name, sizeof(qat_dev_name));
 			if (!get_qat_c6xx_dev_name(qat_dev_name)) {
 				len += snprintf(buf, SSL_CARD_STR_LEN-len, "%dX%s,", qat_card_count/QAT_C6XX_CARD_COUNT, qat_dev_name);
 			}
+		} else if (strcmp(qat_dev_name,  QAT_C6XXVF_CARD_TYPE) == 0) {
+			len += snprintf(buf, SSL_CARD_STR_LEN-len, "%dX%s,", qat_card_count, QAT_8960_DEVNAME);
 		} else {
 			len += snprintf(buf, SSL_CARD_STR_LEN-len, "%dX%s,", qat_card_count/QAT_DH895XCC_CARD_COUNT, QAT_8950_DEVNAME);
 		}
Index: /branches/rel_apv_10_7/usr/click/lib/libqat/install_qat.sh
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libqat/install_qat.sh	(revision 38279)
+++ /branches/rel_apv_10_7/usr/click/lib/libqat/install_qat.sh	(working copy)
@@ -105,6 +105,21 @@
 			let reminder-=1
 		fi
 
+        # 0 instance perhaps occur some mistake, so at least 1
+        if [ $real_instance_num -eq 0 ]; then
+            let real_instance_num=1
+        fi
+
+        # instances number for each pf endpoint can't exceed 32, for each vf can't exceed 4
+        if (( $numC62xDevicesV != 0 && $real_instance_num > 4 )); then
+            let real_instance_num=4
+        fi
+
+        # instances number for each pf endpoint can't exceed 32, for each vf can't exceed 4
+        if (( $numC62xDevicesP != 0 && $real_instance_num > 32 )); then
+            let real_instance_num=32
+        fi
+
 		echo "[SSL]" >> $conf_name
 		echo "NumberCyInstances = $real_instance_num" >> $conf_name
 		echo "NumberDcInstances = 0" >> $conf_name
@@ -471,6 +486,9 @@
         do
             install -D -m 640 $ICP_BUILD_OUTPUT/c6xxvf_dev0.conf.vm /etc/c6xxvf_dev${dev}.conf
         done
+        if [ $numC62xDevicesV != 0 ]; then
+            Change_Config /etc/c6xxvf_dev $numC62xDevicesV
+        fi
         for (( dev=0; dev<$numD15xxDevicesV; dev++ ))
         do
             install -D -m 640 $ICP_BUILD_OUTPUT/d15xxvf_dev0.conf.vm /etc/d15xxvf_dev${dev}.conf
@@ -910,13 +928,13 @@
 					echo "Install qat in pf mode"
 				#fi
 			else    
-				#if [ $numDh895xDevicesV != 0 -o $numC62xDevicesV != 0 -o $numC3xxxDevicesV != 0 ];then
-				#	case="install-guest"
-				#else
+				if [ $numDh895xDevicesV != 0 -o $numC62xDevicesV != 0 -o $numC3xxxDevicesV != 0 ];then
+					case="install-guest"
+				else
 					# No qat device, just exit
 					echo "No qat device"
 					exit 0
-				#fi
+				fi
 			fi
 
 		    ;;
Index: /branches/rel_apv_10_7/usr/click/lib/libqat/qat/quickassist/build_system/build_files/qat_service
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libqat/qat/quickassist/build_system/build_files/qat_service	(revision 38279)
+++ /branches/rel_apv_10_7/usr/click/lib/libqat/qat/quickassist/build_system/build_files/qat_service	(working copy)
@@ -100,7 +100,7 @@
 exit 1
 }
 
-ADF_CTL=/usr/sbin/adf_ctl
+ADF_CTL=/usr/local/bin/adf_ctl
 
 # store the total number of each type of device
 numDh895xDevicesPF=$(lspci -n | egrep -c "$INTEL_VENDORID:$DH895_DEVICE_PCI_ID")
@@ -256,7 +256,7 @@
     fi
 
     # Show device status
-    /usr/sbin/adf_ctl $2 status
+    $ADF_CTL $2 status
             ;;
 
  Shutdown|shutdown)
@@ -269,7 +269,7 @@
     # inline module to be unloaded before bring down the qat driver
     modprobe -q -r ipsec_inline
 
-    /usr/sbin/adf_ctl down &>/dev/null
+    $ADF_CTL down &>/dev/null
     modprobe -q -r qat_api
     modprobe -q -r usdm_drv
     modprobe -q -r qat_dh895xccvf
@@ -293,15 +293,15 @@
         echo disable sriov
         disable_sriov $2
     fi
-    /usr/sbin/adf_ctl $2 down
+    $ADF_CTL $2 down
             ;;
 
  Restart|restart)
-    /usr/sbin/adf_ctl $2 restart
+    $ADF_CTL $2 restart
             ;;
 
  Status|status)
-    /usr/sbin/adf_ctl status
+    $ADF_CTL status
     if [ "$?" -ne 0 ]
     then
         echo "No devices found. Please start the driver using:"
Index: /branches/rel_apv_10_7/usr/click/lib/libqat/qat/quickassist/utilities/adf_ctl/conf_files/c6xxvf_dev0.conf.vm
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libqat/qat/quickassist/utilities/adf_ctl/conf_files/c6xxvf_dev0.conf.vm	(revision 38279)
+++ /branches/rel_apv_10_7/usr/click/lib/libqat/qat/quickassist/utilities/adf_ctl/conf_files/c6xxvf_dev0.conf.vm	(working copy)
@@ -59,13 +59,13 @@
 #  version: QAT.L.4.15.0-00011
 ################################################################
 [GENERAL]
-ServicesEnabled = cy;dc
+ServicesEnabled = cy
 
 ConfigVersion = 2
 
 #Default values for number of concurrent requests*/
 CyNumConcurrentSymRequests = 512
-CyNumConcurrentAsymRequests = 64
+CyNumConcurrentAsymRequests = 512
 
 #Statistics, valid values: 1,0
 statsGeneral = 1
@@ -79,43 +79,3 @@
 statsPrime = 1
 statsRsa = 1
 statsSym = 1
-
-##############################################
-# Kernel Instances Section
-##############################################
-[KERNEL]
-NumberCyInstances = 0
-NumberDcInstances = 0
-
-##############################################
-# User Process Instance Section
-##############################################
-[SSL]
-NumberCyInstances = 2
-NumberDcInstances = 2
-NumProcesses = 1
-LimitDevAccess = 0
-
-# Crypto - User instance #0
-Cy0Name = "SSL0"
-Cy0IsPolled = 1
-# List of core affinities
-Cy0CoreAffinity = 0
-
-# Crypto - User instance #1
-Cy1Name = "SSL1"
-Cy1IsPolled = 1
-# List of core affinities
-Cy1CoreAffinity = 1
-
-# Data Compression - User instance #0
-Dc0Name = "Dc0"
-Dc0IsPolled = 1
-# List of core affinities
-Dc0CoreAffinity = 0
-
-# Data Compression - User instance #1
-Dc1Name = "Dc1"
-Dc1IsPolled = 1
-# List of core affinities
-Dc1CoreAffinity = 1
Index: /branches/rel_apv_10_7/usr/click/tools/sysv_click
===================================================================
--- /branches/rel_apv_10_7/usr/click/tools/sysv_click	(revision 38279)
+++ /branches/rel_apv_10_7/usr/click/tools/sysv_click	(working copy)
@@ -52,9 +52,11 @@
 INTEL_VENDORID="8086"
 DH895_DEVICE_NUMBER="0435"
 C62X_DEVICE_NUMBER="37c8"
+C62X_DEVICE_NUMBER_VM="37c9"
 
 numDh895xDevicesP=$(lspci -n | egrep -c "$INTEL_VENDORID:$DH895_DEVICE_NUMBER")
 numC62xDevicesP=$(lspci -n | egrep -c "$INTEL_VENDORID:$C62X_DEVICE_NUMBER")
+numC62xDevicesV=$(lspci -n | egrep -c "$INTEL_VENDORID:$C62X_DEVICE_NUMBER_VM")
 
 is_vapv=`grep -E "^array_id=900000" /boot/loader.conf`
 
@@ -126,11 +128,11 @@
 		ln -s /ca/lib/libswsds.so /ca/lib/libsdf.so
 		ln -s /ca/lib/libswsds.so /ca/lib/libsdf_version.so
 
-                # Install and start QAT
-                if [ $numDh895xDevicesP -ne 0 -o $numC62xDevicesP -ne 0 ];then
-			echo "Installing QAT driver..."
-                        /ca/ssl/qat/install_qat.sh install >/dev/null 2>&1
-                fi
+        # Install and start QAT
+        if [ $numDh895xDevicesP -ne 0 -o $numC62xDevicesP -ne 0 -o $numC62xDevicesV -ne 0 ];then
+            echo "Installing QAT driver..."
+            /ca/ssl/qat/install_qat.sh install >/dev/null 2>&1
+        fi
 	fi
 	#remove guoxin kmod
 	remove_guoxin_ko=`lsmod |grep "ntl_crypto"`
@@ -1188,7 +1190,7 @@
 	
 	# Uninstall QAT
 	if [[ -z "${is_arm}" ]]; then	
-		if [ $numDh895xDevicesP -ne 0 -o $numC62xDevicesP -ne 0 ];then
+		if [ $numDh895xDevicesP -ne 0 -o $numC62xDevicesP -ne 0 -o $numC62xDevicesV -ne 0 ];then
 			echo "Uninstalling QAT driver..."
 			/ca/ssl/qat/install_qat.sh uninstall >/dev/null 2>&1
 		fi
Index: /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_input.c
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_input.c	(revision 38279)
+++ /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_input.c	(working copy)
@@ -1993,6 +1993,7 @@
 	int i,j;
 	int test_cpuid;
 	char atcp_name[8];
+	int array_id;
 
 	/* Synchronization lock */
 	atcp_sync_init();
@@ -2153,7 +2154,14 @@
 		click_callout_reset(&slb_rs_bandwidth_update_timer, hz, slb_rs_bandwidth_update_func, NULL);
 		
 		click_callout_init(&core_usage_callout);
-		click_callout_reset(&core_usage_callout, CORE_USAGE_CALCULATE_TIMEOUT, core_usage_calculate_timer, NULL);
+
+		getenv_int("array_id", &array_id);
+		if(array_id == 900000 && qat_card_count > 0) {
+			/* TODO: vAPV support QAT card utilization usage */
+		} else {
+			click_callout_reset(&core_usage_callout, CORE_USAGE_CALCULATE_TIMEOUT, core_usage_calculate_timer, NULL);
+		}
+
 		click_callout_init(&bandwidth_bucket_callout);
 		click_callout_reset(&bandwidth_bucket_callout, hz/BW_DELIVERY_TIMES, bandwidth_bucket_timer, NULL);
 		
