Merge "[qca-nss-drv] Add GRE Tunnel Inner Exception"
diff --git a/exports/arch/nss_fsm9010.h b/exports/arch/nss_fsm9010.h
index 847e84f..d7f57c6 100644
--- a/exports/arch/nss_fsm9010.h
+++ b/exports/arch/nss_fsm9010.h
@@ -22,16 +22,16 @@
 #define __NSS_FSM9010_H
 
 /**
- * @addtogroup nss_arch_macros
+ * @addtogroup nss_arch_macros_fsm9010
  * @{
  */
 
-#define NSS_MAX_NUM_PRI 1		/**< Maximum number of priority queues in NSS for the FSM9010 chipset. */
-#define NSS_HOST_CORES 4		/**< Number of host cores for the FSM9010 chipset. */
+#define NSS_MAX_NUM_PRI 1		/**< Maximum number of priority queues in NSS. */
+#define NSS_HOST_CORES 4		/**< Number of host cores. */
 
-#define NSS_N2H_RING_COUNT 3		/**< Number of N2H rings for the FSM9010 chipset. */
-#define NSS_H2N_RING_COUNT 4		/**< Number of H2N rings for the FSM9010 chipset. */
-#define NSS_RING_SIZE	128		/**< Ring size for the FSM9010 chipset. */
+#define NSS_N2H_RING_COUNT 3		/**< Number of N2H rings. */
+#define NSS_H2N_RING_COUNT 4		/**< Number of H2N rings. */
+#define NSS_RING_SIZE	128		/**< Ring size. */
 
 /**
  * @}
diff --git a/exports/arch/nss_ipq40xx.h b/exports/arch/nss_ipq40xx.h
index 5b47ac7..671ef38 100644
--- a/exports/arch/nss_ipq40xx.h
+++ b/exports/arch/nss_ipq40xx.h
@@ -22,16 +22,16 @@
 #define __NSS_IPQ40XX_H
 
 /**
- * @addtogroup nss_arch_macros
+ * @addtogroup nss_arch_macros_ipq40xx
  * @{
  */
 
-#define NSS_MAX_NUM_PRI 1		/**< Maximum number of priority queues in NSS for the IPQ40xx chipsets. */
-#define NSS_HOST_CORES 4		/**< Number of host cores for the IPQ40xx chipsets. */
+#define NSS_MAX_NUM_PRI 1		/**< Maximum number of priority queues in NSS. */
+#define NSS_HOST_CORES 4		/**< Number of host cores. */
 
-#define NSS_N2H_RING_COUNT 0		/**< Number of N2H rings for the IPQ40xx chipsets. */
-#define NSS_H2N_RING_COUNT 0		/**< Number of H2N rings for the IPQ40xx chipsets. */
-#define NSS_RING_SIZE	128		/**< Ring size for the IPQ40xx chipsets. */
+#define NSS_N2H_RING_COUNT 0		/**< Number of N2H rings. */
+#define NSS_H2N_RING_COUNT 0		/**< Number of H2N rings. */
+#define NSS_RING_SIZE	128		/**< Ring size. */
 
 /**
  * @}
diff --git a/exports/arch/nss_ipq806x.h b/exports/arch/nss_ipq806x.h
index ca0409d..4519ffb 100644
--- a/exports/arch/nss_ipq806x.h
+++ b/exports/arch/nss_ipq806x.h
@@ -22,16 +22,16 @@
 #define __NSS_IPQ806X_H
 
 /**
- * @addtogroup nss_arch_macros
+ * @addtogroup nss_arch_macros_ipq806x
  * @{
  */
 
-#define NSS_MAX_NUM_PRI 4		/**< Maximum number of priority queues in NSS for the IPQ806x chipsets. */
-#define NSS_HOST_CORES 2		/**< Number of host cores for the IPQ806x chipsets. */
+#define NSS_MAX_NUM_PRI 4		/**< Maximum number of priority queues in NSS. */
+#define NSS_HOST_CORES 2		/**< Number of host cores. */
 
-#define NSS_N2H_RING_COUNT 3		/**< Number of N2H rings for the IPQ806x chipsets. */
-#define NSS_H2N_RING_COUNT 4		/**< Number of H2N rings for the IPQ806x chipsets. */
-#define NSS_RING_SIZE	128		/**< Ring size for the IPQ806x chipsets. */
+#define NSS_N2H_RING_COUNT 3		/**< Number of N2H rings. */
+#define NSS_H2N_RING_COUNT 4		/**< Number of H2N rings. */
+#define NSS_RING_SIZE	128		/**< Ring size. */
 
 /**
  * @}
diff --git a/exports/arch/nss_ipq807x.h b/exports/arch/nss_ipq807x.h
index 9ed8330..88be9ee 100644
--- a/exports/arch/nss_ipq807x.h
+++ b/exports/arch/nss_ipq807x.h
@@ -22,17 +22,17 @@
 #define __NSS_IPQ807X_H
 
 /**
- * @addtogroup nss_arch_macros
+ * @addtogroup nss_arch_macros_ipq807x
  * @{
  */
 
-#define NSS_MAX_NUM_PRI 4		/**< Maximum number of priority queues in NSS for the IPQ807x chipsets. */
-#define NSS_HOST_CORES 4		/**< Number of host cores for the IPQ807x chipsets. */
-#define NSS_PPE_SUPPORTED		/**< PPE supported flag for the IPQ807x chipsets. */
+#define NSS_MAX_NUM_PRI 4		/**< Maximum number of priority queues in NSS. */
+#define NSS_HOST_CORES 4		/**< Number of host cores. */
+#define NSS_PPE_SUPPORTED		/**< PPE supported flag. */
 
-#define NSS_N2H_RING_COUNT 5		/**< Number of N2H rings for the IPQ807x chipsets. */
-#define NSS_H2N_RING_COUNT 11		/**< Number of H2N rings for the IPQ807x chipsets. */
-#define NSS_RING_SIZE	128		/**< Ring size for the IPQ807x chipsets. */
+#define NSS_N2H_RING_COUNT 5		/**< Number of N2H rings. */
+#define NSS_H2N_RING_COUNT 11		/**< Number of H2N rings. */
+#define NSS_RING_SIZE	128		/**< Ring size. */
 
 /**
  * @}
diff --git a/exports/arch/nss_ipq807x_64.h b/exports/arch/nss_ipq807x_64.h
index 7921a00..c505c5a 100644
--- a/exports/arch/nss_ipq807x_64.h
+++ b/exports/arch/nss_ipq807x_64.h
@@ -22,17 +22,17 @@
 #define __NSS_IPQ807x_64_H
 
 /**
- * @addtogroup nss_arch_macros
+ * @addtogroup nss_arch_macros_ipq807x_64
  * @{
  */
 
-#define NSS_MAX_NUM_PRI 4		/**< Maximum number of priority queues in NSS for the IPQ807x 64-bit chipsets. */
-#define NSS_HOST_CORES 4		/**< Number of host cores for the IPQ807x 64-bit chipsets. */
-#define NSS_PPE_SUPPORTED		/**< PPE supported flag for the IPQ807x 64-bit chipsets. */
+#define NSS_MAX_NUM_PRI 4		/**< Maximum number of priority queues in NSS. */
+#define NSS_HOST_CORES 4		/**< Number of host cores. */
+#define NSS_PPE_SUPPORTED		/**< PPE supported flag. */
 
-#define NSS_N2H_RING_COUNT 5		/**< Number of N2H rings for the IPQ807x 64-bit chipsets. */
-#define NSS_H2N_RING_COUNT 11		/**< Number of H2N rings for the IPQ807x 64-bit chipsets. */
-#define NSS_RING_SIZE	128		/**< Ring size for the IPQ807x 64-bit chipsets. */
+#define NSS_N2H_RING_COUNT 5		/**< Number of N2H rings. */
+#define NSS_H2N_RING_COUNT 11		/**< Number of H2N rings. */
+#define NSS_RING_SIZE	128		/**< Ring size. */
 
 /**
  * @}
diff --git a/exports/nss_gre.h b/exports/nss_gre.h
index d12af1d..9ff8de8 100644
--- a/exports/nss_gre.h
+++ b/exports/nss_gre.h
@@ -1,6 +1,6 @@
 /*
  **************************************************************************
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * above copyright notice and this permission notice appear in all copies.
@@ -307,11 +307,11 @@
  * nss_gre_msg_callback_t \n
  * net_device
  *
- * @param[in] if_num		     NSS interface number.
- * @param[in] nss_gre_data_callback  Callback for the data.
- * @param[in] msg_callback	     Callback for the message.
- * @param[in] netdev		     Pointer to the associated network device.
- * @param[in] features		     Socket buffer types supported by this interface.
+ * @param[in] if_num         NSS interface number.
+ * @param[in] gre_callback   Callback for the data.
+ * @param[in] msg_callback   Callback for the message.
+ * @param[in] netdev         Pointer to the associated network device.
+ * @param[in] features       Socket buffer types supported by this interface.
  *
  * @return
  * Pointer to the NSS core context.
diff --git a/exports/nss_l2tpv2.h b/exports/nss_l2tpv2.h
index 008d146..6e45b80 100644
--- a/exports/nss_l2tpv2.h
+++ b/exports/nss_l2tpv2.h
@@ -1,6 +1,6 @@
 /*
  **************************************************************************
- * Copyright (c) 2015, 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015, 2017-2018, The Linux Foundation. All rights reserved.
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * above copyright notice and this permission notice appear in all copies.
@@ -199,8 +199,8 @@
  * nss_unregister_l2tpv2_if
  *	Deregisters the L2TPV2 tunnel interface from the NSS.
  *
- * @param[in] if_num  NSS interface number
-. *
+ * @param[in] if_num  NSS interface number.
+ *
  * @return
  * None.
  *
diff --git a/exports/nss_ppe.h b/exports/nss_ppe.h
index 8bb6274..5be460e 100644
--- a/exports/nss_ppe.h
+++ b/exports/nss_ppe.h
@@ -39,7 +39,7 @@
  * nss_ppe_message_types
  *	Message types for Packet Processing Engine (PPE) requests and responses.
  *
- * Note: PPE messages are added as short term approach, expect all
+ * Note: PPE messages are added as short term approach; expect all
  * messages below to be deprecated for more integrated approach.
  */
 enum nss_ppe_message_types {
@@ -263,7 +263,7 @@
  * @return
  * None.
  */
-void nss_ppe_msg_init(struct nss_ppe_msg *ncm, uint16_t if_num, uint32_t type,  uint32_t len, void *cb, void *app_data);
+void nss_ppe_msg_init(struct nss_ppe_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data);
 
 /**
  * nss_ppe_get_context
@@ -278,7 +278,7 @@
  * nss_ppe_tx_l2_exception_msg
  *      Sends the PPE a message to enable/disable L2 exceptions.
  *
- * @param[in] if_num  Interface number of the PPE.
+ * @param[in] if_num            Interface number of the PPE.
  * @param[in] exception_enable  Enable/disable flag.
  *
  * @return
@@ -290,9 +290,9 @@
  * nss_ppe_tx_ipsec_config_msg
  *      Sends the PPE a message to configure inline IPsec port.
  *
- * @param[in] if_num        Static IPsec interface number.
- * @param[in] vsi_num       Default VSI number associated with inline IPsec port.
- * @param[in] mtu           Default MTU of static inline IPsec port.
+ * @param[in] nss_ifnum  Static IPsec interface number.
+ * @param[in] vsi_num    Default VSI number associated with inline IPsec port.
+ * @param[in] mtu        Default MTU of static inline IPsec port.
  *
  * @return
  * Status of the Tx operation.
@@ -315,7 +315,7 @@
  * nss_ppe_tx_ipsec_add_intf_msg
  *      Sends the PPE a message to attach a dynamic interface number to IPsec port.
  *
- * @param[in] if_num  Dynamic IPsec/DTLS interface number.
+ * @param[in] nss_ifnum  Dynamic IPsec/DTLS interface number.
  *
  * @return
  * Status of the Tx operation.
@@ -326,7 +326,7 @@
  * nss_ppe_tx_ipsec_del_intf_msg
  *      Sends the PPE a message to detach a dynamic interface number to IPsec port.
  *
- * @param[in] if_num  Dynamic IPsec/DTLS interface number.
+ * @param[in] nss_ifnum  Dynamic IPsec/DTLS interface number.
  *
  * @return
  * Status of the Tx operation.
diff --git a/exports/nss_tunipip6.h b/exports/nss_tunipip6.h
index 3c19c4b..2aed088 100644
--- a/exports/nss_tunipip6.h
+++ b/exports/nss_tunipip6.h
@@ -1,6 +1,6 @@
 /*
  **************************************************************************
- * Copyright (c) 2014, 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved.
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * above copyright notice and this permission notice appear in all copies.
@@ -162,7 +162,7 @@
  *	Deregisters the TUNIPIP6 interface from the NSS.
  *
  * @param[in] if_num  NSS interface number.
-. *
+ *
  * @return
  * None.
  */
diff --git a/exports/nss_wifi_vdev.h b/exports/nss_wifi_vdev.h
index ea91d6e..2e6fa6c 100644
--- a/exports/nss_wifi_vdev.h
+++ b/exports/nss_wifi_vdev.h
@@ -107,6 +107,14 @@
 	NSS_WIFI_VDEV_CHDRUPD_FAIL,
 	NSS_WIFI_VDEV_ME_DENY_GRP_MAX_RCHD,
 	NSS_WIFI_VDEV_EINV_NEXT_HOP,
+	NSS_WIFI_VDEV_EINV_DSCP_TID_MAP_ID,
+	NSS_WIFI_VDEV_EINV_TID_VALUE,
+	NSS_WIFI_VDEV_EINV_EXTAP_TABLE,
+	NSS_WIFI_VDEV_EXTAP_ENTRY_UPDATE_FAIL,
+	NSS_WIFI_VDEV_QWRAP_PSTA_ADD_FAIL,
+	NSS_WIFI_VDEV_QWRAP_PSTA_DEL_FAIL,
+	NSS_WIFI_VDEV_QWRAP_ISOLATION_EN_FAIL,
+	NSS_WIFI_VDEV_QWRAP_ALLOC_FAIL,
 	NSS_WIFI_VDEV_EINV_MAX_CFG
 };
 
diff --git a/exports/nss_wifili_if.h b/exports/nss_wifili_if.h
index 3086711..0cd27a5 100644
--- a/exports/nss_wifili_if.h
+++ b/exports/nss_wifili_if.h
@@ -144,67 +144,79 @@
 enum nss_wifili_error_types {
 	NSS_WIFILI_EMSG_NONE,
 			/**< No error. */
+	NSS_WIFILI_EMSG_INIT_FAIL_IMPROPER_STATE,
+			/**< Device initialization failure due to improper state of device. */
 	NSS_WIFILI_EMSG_RINGS_INIT_FAIL,
 			/**< Device ring initialization failure. */
 	NSS_WIFILI_EMSG_PDEV_INIT_IMPROPER_STATE_FAIL,
 			/**< Radio initialization failure due to improper state of device. */
 	NSS_WIFILI_EMSG_PDEV_INIT_INVALID_RADIOID_FAIL,
 			/**< Radio initialization failed due to invalid radio ID. */
+	NSS_WIFILI_EMSG_PDEV_TX_IRQ_ALLOC_FAIL,
+			/**< IRQ line allocation for radio transmission failed. */
 	NSS_WIFILI_EMSG_PDEV_RESET_INVALID_RADIOID_FAIL,
 			/**< Radio reset failed due to invalid radio ID. */
+	NSS_WIFILI_EMSG_PDEV_RESET_PDEV_NULL_FAIL,
+			/**< Radio reset failed due to null physical device. */
+	NSS_WIFILI_EMSG_PDEV_RESET_IMPROPER_STATE_FAIL,
+			/**< Radio reset failed due to improper state of pdev. */
 	NSS_WIFILI_EMSG_START_IMPROPER_STATE_FAIL,
-			/**< Device start failure due to improper state. */
+			/**< Device start fail due to improper state */
 	NSS_WIFILI_EMSG_PEER_CREATE_FAIL,
-			/**< Peer creation failure. */
+			/**< Peer creation failed. */
 	NSS_WIFILI_EMSG_PEER_DELETE_FAIL,
-			/**< Peer delete failure. */
+			/**< Peer deletion failed. */
 	NSS_WIFILI_EMSG_HASHMEM_INIT_FAIL,
-			/**< Peer hash memory initialization failure. */
+			/**< Peer hash memory allocation failed. */
 	NSS_WIFILI_EMSG_PEER_FREELIST_APPEND_FAIL,
-			/**< Peer freelist append failure. */
+			/**< Appending peer to freelist failed. */
 	NSS_WIFILI_EMSG_PEER_CREATE_INVALID_VDEVID_FAIL,
-			/**< Peer creation failure due to invalid vdev ID. */
+			/**< Peer creation failure due to invalid virtual device ID. */
 	NSS_WIFILI_EMSG_PEER_CREATE_INVALID_PEER_ID_FAIL,
 			/**< Peer creation failure due to invalid peer ID. */
 	NSS_WIFILI_EMSG_PEER_CREATE_VDEV_NULL_FAIL,
-			/**< Peer creation failure due to null vdev. */
+			/**< Peer creation failure due to null virtual device. */
 	NSS_WIFILI_EMSG_PEER_CREATE_PDEV_NULL_FAIL,
-			/**< Peer creation failure due to null peer. */
+			/**< Peer creation failure due to null physical device. */
 	NSS_WIFILI_EMSG_PEER_CREATE_ALLOC_FAIL,
 			/**< Peer creation failure due to memory allocation failure. */
 	NSS_WIFILI_EMSG_PEER_DELETE_VAPID_INVALID_FAIL,
-			/**< Peer delete failure due to invalid vdev_ID. */
+			/**< Peer deletion failure due to invalid virtual device ID. */
 	NSS_WIFILI_EMSG_PEER_DELETE_INVALID_PEERID_FAIL,
-			/**< Peer delete failure due to invalid peer ID. */
+			/**< Peer deletion failed due to invalid peer ID. */
 	NSS_WIFILI_EMSG_PEER_DELETE_VDEV_NULL_FAIL,
-			/**< Peer delete failure due to null vdev. */
+			/**< Peer deletion failure due to null virtual device. */
 	NSS_WIFILI_EMSG_PEER_DELETE_PDEV_NULL_FAIL,
-			/**< Peer creation failure due to null vdev. */
+			/**< Peer deletion failure due to null physical device. */
 	NSS_WIFILI_EMSG_PEER_DELETE_PEER_NULL_FAIL,
-			/**< Peer creation failure due to null peer. */
+			/**< Peer deletion failure due to null peer. */
 	NSS_WIFILI_EMSG_PEER_DELETE_PEER_CORRUPTED_FAIL,
 			/**< Peer creation failure due to corrupted peer. */
+	NSS_WIFILI_EMSG_PEER_DUPLICATE_AST_INDEX_PEER_ID_FAIL,
+			/**< AST index provided is duplicate. */
 	NSS_WIFILI_EMSG_GROUP0_TIMER_ALLOC_FAIL,
 			/**< Timer allocation failure. */
 	NSS_WIFILI_EMSG_INSUFFICIENT_WT_FAIL,
 			/**< Insufficient worker thread error. */
 	NSS_WIFILI_EMSG_INVALID_NUM_TCL_RING_FAIL,
-			/**< Invlalid number of Transmit Classifier ring provided in initialization message. */
+			/**< Invalid number of Transmit Classifier rings provided in initialization message. */
 	NSS_WIFILI_EMSG_INVALID_NUM_REO_DST_RING_FAIL,
 			/**< Invalid number of reorder destination ring in initialization message. */
 	NSS_WIFILI_EMSG_HAL_SRNG_SOC_ALLOC_FAIL,
 			/**< Srng SoC memory allocation failure. */
-	NSS_WIFILI_EMSG_HAL_TCL_SRNG_ALLOC_FAIL,
+	NSS_WIFILI_EMSG_HAL_SRNG_INVALID_RING_INFO_FAIL,
+			/**< Device ring information is invalid. */
+	NSS_WIFILI_EMSG_HAL_SRNG_TCL_ALLOC_FAIL,
 			/**< Transmit Classifier srng ring allocation failure. */
-	NSS_WIFILI_EMSG_HAL_TXCOMP_SRNG_ALLOC_FAIL,
+	NSS_WIFILI_EMSG_HAL_SRNG_TXCOMP_ALLOC_FAIL,
 			/**< Txcomp srng ring allocation failure. */
-	NSS_WIFILI_EMSG_HAL_REODST_SRNG_ALLOC_FAIL,
+	NSS_WIFILI_EMSG_HAL_SRNG_REODST_ALLOC_FAIL,
 			/**< Reorder destination srng ring allocation failure. */
-	NSS_WIFILI_EMSG_HAL_REOREINJECT_SRNG_ALLOC_FAIL,
+	NSS_WIFILI_EMSG_HAL_SRNG_REOREINJECT_ALLOC_FAIL,
 			/**< Reorder reinject srng ring allocation failure. */
-	NSS_WIFILI_EMSG_HAL_RXRELEASE_SRNG_ALLOC_FAIL,
+	NSS_WIFILI_EMSG_HAL_SRNG_RXRELEASE_ALLOC_FAIL,
 			/**< Rx release srng ring allocation failure. */
-	NSS_WIFILI_EMSG_HAL_RXEXCP_SRNG_ALLOC_FAIL,
+	NSS_WIFILI_EMSG_HAL_SRNG_RXEXCP_ALLOC_FAIL,
 			/**< Rx exception srng ring allocation failure. */
 	NSS_WIFILI_EMSG_HAL_TX_MEMALLOC_FAIL,
 			/**< Tx HAL (hardware abstraction layer) srng ring allocation failure. */
@@ -246,12 +258,16 @@
 			 /**< Invalid peer id passed in WDS messages. */
 	NSS_WIFILI_EMSG_WDS_DUPLICATE_AST_INDEX_PEER_ID_FAIL,
 			/**< AST entry index is already filled. */
+	NSS_WIFILI_EMSG_INVALID_RADIO_CMD,
+			/**< Radio command is invalid. */
+	NSS_WIFILI_EMSG_INVALID_RADIO_IFNUM,
+			/**< Radio interface number is invalid. */
 	NSS_WIFILI_EMSG_PEER_SECURITY_PEER_NULL_FAIL,
 			/**< Security message failed as peer is null for a peer ID. */
 	NSS_WIFILI_EMSG_PEER_SECURITY_PEER_CORRUPTED_FAIL,
 			/**< Security message failed as peer is corrupted. */
 	NSS_WIFILI_EMSG_RADIO_INVALID_BUF_CFG,
-            /**< Buffer configuration message failed as invalid range value is provided. */
+			/**< Buffer configuration message failed as invalid range value is provided. */
 	NSS_WIFILI_EMSG_UNKNOWN
 			/**< Unknown error message. */
 };
@@ -683,7 +699,7 @@
  *	Tx peer statistics.
  */
 struct nss_wifili_tx_ctrl_stats {
-	uint32_t ofdma; 		/**< Number of Orthogonal frequency-division multiple
+	uint32_t ofdma; 		/**< Number of orthogonal frequency-division multiple
 					  access packets. */
 	uint32_t non_amsdu_cnt; 	/**< Number of MSDUs with no MSDU level aggregation. */
 	uint32_t amsdu_cnt;		/**< Number of MSDUs part of AMSDU. */
diff --git a/nss_core.c b/nss_core.c
index 7687d3c..6667516 100644
--- a/nss_core.c
+++ b/nss_core.c
@@ -585,7 +585,8 @@
  */
 static inline void nss_core_handle_virt_if_pkt(struct nss_ctx_instance *nss_ctx,
 						unsigned int interface_num,
-						struct sk_buff *nbuf)
+						struct sk_buff *nbuf,
+						uint16_t qid)
 {
 	struct nss_top_instance *nss_top = nss_ctx->nss_top;
 	struct nss_subsystem_dataplane_register *subsys_dp_reg = &nss_ctx->subsys_dp_register[interface_num];
@@ -593,6 +594,8 @@
 
 	uint32_t xmit_ret;
 
+	uint16_t queue_offset = qid - NSS_IF_N2H_DATA_QUEUE_0;
+
 	NSS_PKT_STATS_INCREMENT(nss_ctx, &nss_top->stats_drv[NSS_STATS_DRV_RX_VIRTUAL]);
 
 	/*
@@ -636,6 +639,10 @@
 		return;
 	}
 
+	if (queue_offset < ndev->real_num_tx_queues) {
+		skb_set_queue_mapping(nbuf, queue_offset);
+	}
+
 	/*
 	 * Send the packet to virtual interface
 	 * NOTE: Invoking this will BYPASS any assigned QDisc - this is OKAY
@@ -802,7 +809,7 @@
 		nss_core_handle_bounced_pkt(nss_ctx, reg, nbuf);
 		break;
 	case N2H_BUFFER_PACKET_VIRTUAL:
-		nss_core_handle_virt_if_pkt(nss_ctx, interface_num, nbuf);
+		nss_core_handle_virt_if_pkt(nss_ctx, interface_num, nbuf, qid);
 		break;
 
 	case N2H_BUFFER_PACKET:
@@ -2806,8 +2813,8 @@
 	}
 
 	if (nss_cmn_get_msg_len(ncm) > size) {
-		nss_warning("%p: interface: %d type: %d message length %d is invalid for\n",
-					nss_ctx, ncm->interface, ncm->type, nss_cmn_get_msg_len(ncm));
+		nss_warning("%p: interface: %d type: %d message length %d is invalid, size = %d\n",
+					nss_ctx, ncm->interface, ncm->type, nss_cmn_get_msg_len(ncm), size);
 		return NSS_TX_FAILURE_TOO_LARGE;
 	}
 
diff --git a/nss_hal/ipq807x/nss_hal_pvt.c b/nss_hal/ipq807x/nss_hal_pvt.c
index 389c5a5..d9521ec 100644
--- a/nss_hal/ipq807x/nss_hal_pvt.c
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
@@ -1,6 +1,6 @@
 /*
  **************************************************************************
- * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * above copyright notice and this permission notice appear in all copies.
@@ -70,11 +70,26 @@
 #define TURBO_VOLTAGE 2
 
 /*
+ * Core reset part 1
+ */
+#define NSS_CORE_GCC_RESET_1 0x00000020
+
+/*
+ * Core reset part 2
+ */
+#define NSS_CORE_GCC_RESET_2 0x00000017
+
+/*
  * Voltage regulator
  */
 struct regulator *npu_reg;
 
 /*
+ * GCC reset
+ */
+void __iomem *nss_misc_reset;
+
+/*
  * Purpose of each interrupt index: This should match the order defined in the NSS firmware
  */
 enum nss_hal_n2h_intr_purpose {
@@ -280,6 +295,27 @@
  */
 static int __nss_hal_core_reset(struct platform_device *nss_dev, void __iomem *map, uint32_t addr, uint32_t clk_src)
 {
+	uint32_t value;
+
+	/*
+	 * De-assert reset for first set
+	 */
+	value = nss_read_32(nss_misc_reset, 0x0);
+	value &= ~(NSS_CORE_GCC_RESET_1 << (nss_dev->id << 3));
+	nss_write_32(nss_misc_reset, 0x0, value);
+
+	/*
+	 * Minimum 10 - 20 cycles delay is required after
+	 * de-asserting UBI reset clamp
+	 */
+	usleep_range(10, 20);
+
+	/*
+	 * De-assert reset for second set
+	 */
+	value &= ~(NSS_CORE_GCC_RESET_2 << (nss_dev->id << 3));
+	nss_write_32(nss_misc_reset, 0x0, value);
+
 	/*
 	 * Apply ubi32 core reset
 	 */
@@ -358,7 +394,6 @@
 {
 	struct device_node *cmn = NULL;
 	struct resource res_nss_misc_reset;
-	void __iomem *nss_misc_reset;
 
 	if (nss_hal_clock_set_and_enable(&nss_dev->dev, NSS_NOC_CLK, 461500000)) {
 		return -EFAULT;
@@ -434,11 +469,6 @@
 		return -EFAULT;
 	}
 
-	/*
-	 * Release UBI reset from GCC
-	 */
-	nss_write_32(nss_misc_reset, 0x0, 0x0);
-
 	nss_top_main.nss_hal_common_init_done = true;
 	nss_info("nss_hal_common_reset Done\n");
 	return 0;
diff --git a/nss_profiler.c b/nss_profiler.c
index 0ab421b..f0fb428 100644
--- a/nss_profiler.c
+++ b/nss_profiler.c
@@ -82,12 +82,18 @@
 	struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)ctx;
 	struct nss_profiler_msg *npm;
 	struct nss_profiler_data_msg *pdm = (struct nss_profiler_data_msg *)buf;
-	struct nss_cmn_msg *ncm;
 	nss_tx_status_t ret;
 
 	nss_trace("%p: Profiler If Tx, buf=%p", nss_ctx, buf);
 
-	if (NSS_NBUF_PAYLOAD_SIZE < (len + sizeof(npm))) {
+	if (sizeof(npm->payload) < len) {
+		nss_warning("%p: (%u)Bad message length(%u)", nss_ctx, NSS_PROFILER_INTERFACE, len);
+		return NSS_TX_FAILURE_TOO_LARGE;
+	}
+
+	if (NSS_NBUF_PAYLOAD_SIZE < (len + sizeof(npm->cm))) {
+		nss_warning("%p: (%u)Message length(%u) is larger than payload size (%u)",
+			nss_ctx, NSS_PROFILER_INTERFACE, (uint32_t)(len + sizeof(npm->cm)), NSS_NBUF_PAYLOAD_SIZE);
 		return NSS_TX_FAILURE_TOO_LARGE;
 	}
 
@@ -97,12 +103,11 @@
 		return NSS_TX_FAILURE;
 	}
 
-	ncm = &npm->cm;
 	memcpy(&npm->payload, pdm, len);
-	nss_profiler_msg_init(npm, NSS_PROFILER_INTERFACE, pdm->hd_magic & 0xFF, sizeof(npm),
+	nss_profiler_msg_init(npm, NSS_PROFILER_INTERFACE, pdm->hd_magic & 0xFF, len,
 				cb, app_data);
 
-	ret = nss_core_send_cmd(nss_ctx, npm, sizeof(*npm), NSS_NBUF_PAYLOAD_SIZE);
+	ret = nss_core_send_cmd(nss_ctx, npm, sizeof(npm->cm) + len, NSS_NBUF_PAYLOAD_SIZE);
 	kfree(npm);
 	return ret;
 }