[qca-ssdk]: add now new API for bm/qm module

Change-Id: Ib3d5e80c41cfb8620cac5900a48bc8236e85d7af
Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
diff --git a/include/adpt/adpt.h b/include/adpt/adpt.h
index dde99dd..baec437 100755
--- a/include/adpt/adpt.h
+++ b/include/adpt/adpt.h
@@ -427,6 +427,10 @@
 		a_uint32_t dev_id,
 		a_uint32_t del_mode,
 		fal_flow_entry_t *flow_entry);
+typedef sw_error_t (*adpt_flow_entry_next_func)(
+		a_uint32_t dev_id,
+		a_uint32_t next_mode,
+		fal_flow_entry_t *flow_entry);
 typedef sw_error_t (*adpt_flow_status_get_func)(
 		a_uint32_t dev_id, a_bool_t *enable);
 typedef sw_error_t (*adpt_flow_ctrl_set_func)(
@@ -574,6 +578,10 @@
 		a_uint32_t dev_id, a_uint32_t queue_id, a_bool_t enable);
 typedef sw_error_t (*adpt_qm_enqueue_ctrl_get_func)(
 		a_uint32_t dev_id, a_uint32_t queue_id, a_bool_t *enable);
+typedef sw_error_t (*adpt_qm_port_source_profile_set_func)(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t src_profile);
+typedef sw_error_t (*adpt_qm_port_source_profile_get_func)(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t *src_profile);
 
 
 /*portvlan module begin*/
@@ -815,6 +823,8 @@
 typedef sw_error_t (*adpt_port_tdm_ctrl_set_func)(a_uint32_t dev_id, fal_port_tdm_ctrl_t *ctrl);
 typedef sw_error_t (*adpt_port_tdm_tick_cfg_set_func)(a_uint32_t dev_id, a_uint32_t tick_index,
 			fal_port_tdm_tick_cfg_t *cfg);
+typedef sw_error_t (*adpt_bm_port_counter_get_func)(a_uint32_t dev_id, fal_port_t port,
+			fal_bm_port_counter_t *counter);
 
 //policer
 typedef sw_error_t (*adpt_acl_policer_counter_get_func)(a_uint32_t dev_id, a_uint32_t index,
@@ -1050,6 +1060,7 @@
 	adpt_flow_host_add_func adpt_flow_host_add;
 	adpt_flow_entry_get_func adpt_flow_entry_get;
 	adpt_flow_entry_del_func adpt_flow_entry_del;
+	adpt_flow_entry_next_func adpt_flow_entry_next;
 	adpt_flow_status_get_func adpt_flow_status_get;
 	adpt_flow_ctrl_set_func adpt_flow_ctrl_set;
 	adpt_flow_age_timer_get_func adpt_flow_age_timer_get;
@@ -1063,7 +1074,7 @@
 	adpt_flow_global_cfg_set_func adpt_flow_global_cfg_set;
 
 	/* qm */
-	a_uint32_t adpt_qm_func_bitmap;
+	a_uint32_t adpt_qm_func_bitmap[2];
 	adpt_ucast_hash_map_set_func adpt_ucast_hash_map_set;
 	adpt_ac_dynamic_threshold_get_func adpt_ac_dynamic_threshold_get;
 	adpt_ucast_queue_base_profile_get_func adpt_ucast_queue_base_profile_get;
@@ -1095,6 +1106,8 @@
 	adpt_queue_counter_ctrl_set_func adpt_queue_counter_ctrl_set;
 	adpt_qm_enqueue_ctrl_set_func adpt_qm_enqueue_ctrl_set;
 	adpt_qm_enqueue_ctrl_get_func adpt_qm_enqueue_ctrl_get;
+	adpt_qm_port_source_profile_set_func adpt_qm_port_source_profile_set;
+	adpt_qm_port_source_profile_get_func adpt_qm_port_source_profile_get;
 
 	/*portvlan module begin*/
 	a_uint32_t adpt_portvlan_func_bitmap[2];
@@ -1237,6 +1250,7 @@
 	adpt_port_bm_ctrl_set_func adpt_port_bm_ctrl_set;
 	adpt_port_tdm_ctrl_set_func adpt_port_tdm_ctrl_set;
 	adpt_port_tdm_tick_cfg_set_func adpt_port_tdm_tick_cfg_set;
+	adpt_bm_port_counter_get_func adpt_bm_port_counter_get;
 
 	//shaper
 	a_uint32_t adpt_shaper_func_bitmap;
diff --git a/include/api/api_desc.h b/include/api/api_desc.h
index acdf6f7..88f318c 100755
--- a/include/api/api_desc.h
+++ b/include/api/api_desc.h
@@ -2992,6 +2992,11 @@
     SW_PARAM_DEF(SW_API_FLOW_GLOBAL_CFG_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),  \
     SW_PARAM_DEF(SW_API_FLOW_GLOBAL_CFG_SET, SW_FLOW_GLOBAL, sizeof(fal_flow_global_cfg_t), SW_PARAM_PTR|SW_PARAM_IN, "Flowglobal"),
 
+#define SW_API_FLOWENTRY_NEXT_DESC \
+    SW_PARAM_DEF(SW_API_FLOWENTRY_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),  \
+    SW_PARAM_DEF(SW_API_FLOWENTRY_NEXT, SW_UINT32, 4, SW_PARAM_IN, "Next mode"),  \
+    SW_PARAM_DEF(SW_API_FLOWENTRY_NEXT, SW_FLOW_ENTRY, sizeof(fal_flow_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Flowentry"),
+
 #define SW_API_NAT_ADD_DESC \
     SW_PARAM_DEF(SW_API_NAT_ADD, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"),   \
     SW_PARAM_DEF(SW_API_NAT_ADD, SW_NATENTRY, sizeof(fal_nat_entry_t), SW_PARAM_PTR|SW_PARAM_IN|SW_PARAM_OUT, "Natentry"),
@@ -3481,6 +3486,16 @@
     SW_PARAM_DEF(SW_API_QM_ENQUEUE_CTRL_GET, SW_UINT32, 4, SW_PARAM_IN, "queue ID"), \
     SW_PARAM_DEF(SW_API_QM_ENQUEUE_CTRL_GET, SW_ENABLE, sizeof(a_bool_t), SW_PARAM_PTR|SW_PARAM_OUT, "enqueue en"),
 
+#define SW_API_QM_SOURCE_PROFILE_SET_DESC \
+    SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
+    SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \
+    SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Source profile"),
+
+#define SW_API_QM_SOURCE_PROFILE_GET_DESC \
+    SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
+    SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \
+    SW_PARAM_DEF(SW_API_QM_SOURCE_PROFILE_GET, SW_UINT32, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Source profile"),
+
 #define SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET_DESC \
     SW_PARAM_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
     SW_PARAM_DEF(SW_API_MGMTCTRL_ETHTYPE_PROFILE_SET, SW_UINT32, 4, SW_PARAM_IN, "Profile ID"), \
@@ -3597,6 +3612,10 @@
     SW_PARAM_DEF(SW_API_BM_DYNAMIC_THRESH_GET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \
     SW_PARAM_DEF(SW_API_BM_DYNAMIC_THRESH_GET, SW_BMDTHRESH, sizeof(fal_bm_dynamic_cfg_t), SW_PARAM_PTR|SW_PARAM_OUT, "dynamic thresh"),
 
+#define SW_API_BM_PORT_COUNTER_GET_DESC \
+    SW_PARAM_DEF(SW_API_BM_PORT_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
+    SW_PARAM_DEF(SW_API_BM_PORT_COUNTER_GET, SW_UINT32, 4, SW_PARAM_IN, "port id"), \
+    SW_PARAM_DEF(SW_API_BM_PORT_COUNTER_GET, SW_BMPORTCNT, sizeof(fal_bm_port_counter_t), SW_PARAM_PTR|SW_PARAM_OUT, "port counter"),
 
 #define SW_API_PORT_SHAPER_TIMESLOT_SET_DESC \
     SW_PARAM_DEF(SW_API_PORT_SHAPER_TIMESLOT_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
diff --git a/include/api/sw_api.h b/include/api/sw_api.h
index 3e18068..978f363 100755
--- a/include/api/sw_api.h
+++ b/include/api/sw_api.h
@@ -193,6 +193,7 @@
 	SW_QUEUEBMP,
 	SW_BMSTHRESH,
 	SW_BMDTHRESH,
+	SW_BMPORTCNT,
 	SW_PORT_SHAPER_TOKEN_CONFIG,
 	SW_SHAPER_TOKEN_CONFIG,
 	SW_PORT_SHAPER_CONFIG,
diff --git a/include/api/sw_ioctl.h b/include/api/sw_ioctl.h
index be0e4b8..087a617 100755
--- a/include/api/sw_ioctl.h
+++ b/include/api/sw_ioctl.h
@@ -760,6 +760,8 @@
 #define SW_API_QUEUE_CNT_CLEANUP         (28 + SW_API_QM_OFFSET)
 #define SW_API_QM_ENQUEUE_CTRL_SET         (29 + SW_API_QM_OFFSET)
 #define SW_API_QM_ENQUEUE_CTRL_GET         (30 + SW_API_QM_OFFSET)
+#define SW_API_QM_SOURCE_PROFILE_SET         (31 + SW_API_QM_OFFSET)
+#define SW_API_QM_SOURCE_PROFILE_GET         (32 + SW_API_QM_OFFSET)
 
 /* flow */
 #define SW_API_FLOW_OFFSET            2200
@@ -774,6 +776,7 @@
 #define SW_API_FLOW_ENTRY_GET         (8  + SW_API_FLOW_OFFSET)
 #define SW_API_FLOW_GLOBAL_CFG_GET         (9  + SW_API_FLOW_OFFSET)
 #define SW_API_FLOW_GLOBAL_CFG_SET         (10  + SW_API_FLOW_OFFSET)
+#define SW_API_FLOWENTRY_NEXT         (11  + SW_API_FLOW_OFFSET)
 
 #define SW_API_FLOW_HOST_ADD         (20  + SW_API_FLOW_OFFSET)
 #define SW_API_FLOW_HOST_DEL         (21  + SW_API_FLOW_OFFSET)
@@ -854,6 +857,7 @@
 #define SW_API_BM_STATIC_THRESH_GET         (9  + SW_API_BM_OFFSET)
 #define SW_API_BM_DYNAMIC_THRESH_SET         (10  + SW_API_BM_OFFSET)
 #define SW_API_BM_DYNAMIC_THRESH_GET         (11  + SW_API_BM_OFFSET)
+#define SW_API_BM_PORT_COUNTER_GET         (12  + SW_API_BM_OFFSET)
 
     /*debug*/
 #define SW_API_DEBUG_OFFSET        10000
diff --git a/include/fal/fal_api.h b/include/fal/fal_api.h
index af44ee5..70524f0 100755
--- a/include/fal/fal_api.h
+++ b/include/fal/fal_api.h
@@ -1394,7 +1394,8 @@
     SW_API_DEF(SW_API_FLOW_GLOBAL_CFG_SET, fal_flow_global_cfg_set), \
     SW_API_DEF(SW_API_FLOW_HOST_ADD, fal_flow_host_add), \
     SW_API_DEF(SW_API_FLOW_HOST_GET, fal_flow_host_get), \
-    SW_API_DEF(SW_API_FLOW_HOST_DEL, fal_flow_host_del),
+    SW_API_DEF(SW_API_FLOW_HOST_DEL, fal_flow_host_del), \
+    SW_API_DEF(SW_API_FLOWENTRY_NEXT, fal_flow_entry_next),
 
 #define FLOW_API_PARAM \
     SW_API_DESC(SW_API_FLOW_STATUS_SET) \
@@ -1410,7 +1411,8 @@
     SW_API_DESC(SW_API_FLOW_GLOBAL_CFG_SET) \
     SW_API_DESC(SW_API_FLOW_HOST_ADD) \
     SW_API_DESC(SW_API_FLOW_HOST_GET) \
-    SW_API_DESC(SW_API_FLOW_HOST_DEL)
+    SW_API_DESC(SW_API_FLOW_HOST_DEL) \
+    SW_API_DESC(SW_API_FLOWENTRY_NEXT)
 #else
 #define FLOW_API
 #define FLOW_API_PARAM
@@ -1630,7 +1632,9 @@
     SW_API_DEF(SW_API_QUEUE_CNT_GET, fal_queue_counter_get), \
     SW_API_DEF(SW_API_QUEUE_CNT_CLEANUP, fal_queue_counter_cleanup), \
     SW_API_DEF(SW_API_QM_ENQUEUE_CTRL_SET, fal_qm_enqueue_ctrl_set), \
-    SW_API_DEF(SW_API_QM_ENQUEUE_CTRL_GET, fal_qm_enqueue_ctrl_get),
+    SW_API_DEF(SW_API_QM_ENQUEUE_CTRL_GET, fal_qm_enqueue_ctrl_get), \
+    SW_API_DEF(SW_API_QM_SOURCE_PROFILE_SET, fal_qm_port_source_profile_set), \
+    SW_API_DEF(SW_API_QM_SOURCE_PROFILE_GET, fal_qm_port_source_profile_get),
 
 #define QM_API_PARAM \
     SW_API_DESC(SW_API_UCAST_QUEUE_BASE_PROFILE_SET) \
@@ -1663,7 +1667,9 @@
     SW_API_DESC(SW_API_QUEUE_CNT_GET) \
     SW_API_DESC(SW_API_QUEUE_CNT_CLEANUP) \
     SW_API_DESC(SW_API_QM_ENQUEUE_CTRL_SET) \
-    SW_API_DESC(SW_API_QM_ENQUEUE_CTRL_GET)
+    SW_API_DESC(SW_API_QM_ENQUEUE_CTRL_GET) \
+    SW_API_DESC(SW_API_QM_SOURCE_PROFILE_SET) \
+    SW_API_DESC(SW_API_QM_SOURCE_PROFILE_GET)
 
 #else
 #define QM_API
@@ -1726,7 +1732,8 @@
     SW_API_DEF(SW_API_BM_STATIC_THRESH_SET, fal_bm_port_static_thresh_set), \
     SW_API_DEF(SW_API_BM_STATIC_THRESH_GET, fal_bm_port_static_thresh_get), \
     SW_API_DEF(SW_API_BM_DYNAMIC_THRESH_SET, fal_bm_port_dynamic_thresh_set), \
-    SW_API_DEF(SW_API_BM_DYNAMIC_THRESH_GET, fal_bm_port_dynamic_thresh_get),
+    SW_API_DEF(SW_API_BM_DYNAMIC_THRESH_GET, fal_bm_port_dynamic_thresh_get), \
+    SW_API_DEF(SW_API_BM_PORT_COUNTER_GET, fal_bm_port_counter_get),
 
 #define BM_API_PARAM \
     SW_API_DESC(SW_API_BM_CTRL_SET) \
@@ -1740,7 +1747,8 @@
     SW_API_DESC(SW_API_BM_STATIC_THRESH_SET) \
     SW_API_DESC(SW_API_BM_STATIC_THRESH_GET) \
     SW_API_DESC(SW_API_BM_DYNAMIC_THRESH_SET) \
-    SW_API_DESC(SW_API_BM_DYNAMIC_THRESH_GET)
+    SW_API_DESC(SW_API_BM_DYNAMIC_THRESH_GET) \
+    SW_API_DESC(SW_API_BM_PORT_COUNTER_GET)
 
 #else
 #define BM_API
diff --git a/include/fal/fal_bm.h b/include/fal/fal_bm.h
index 6f1c32d..67646d5 100755
--- a/include/fal/fal_bm.h
+++ b/include/fal/fal_bm.h
@@ -48,6 +48,16 @@
 	a_uint32_t depth;
 } fal_port_tdm_ctrl_t;
 
+typedef struct
+{
+	a_uint64_t drop_byte_counter; /*drop byte due to overload*/
+	a_uint32_t drop_packet_counter; /*drop packet due to overload*/
+	a_uint64_t fc_drop_byte_counter; /*drop byte due to fc*/
+	a_uint32_t fc_drop_packet_counter; /*drop packet due to fc*/
+	a_uint32_t used_counter; /*total used buffer counter for the port*/
+	a_uint32_t react_counter; /*react used buffer counter for the port*/
+} fal_bm_port_counter_t;
+
 #define FAL_PORT_TDB_DIR_INGRESS	0
 #define FAL_PORT_TDB_DIR_EGRESS	1
 typedef struct
@@ -72,6 +82,7 @@
 	FUNC_PORT_BM_CTRL_SET,
 	FUNC_PORT_TDM_CTRL_SET,
 	FUNC_PORT_TDM_TICK_CFG_SET,
+	FUNC_BM_PORT_COUNTER_GET,
 };
 
 sw_error_t
@@ -120,6 +131,10 @@
 fal_bm_port_dynamic_thresh_get(a_uint32_t dev_id, fal_port_t port,
 			fal_bm_dynamic_cfg_t *cfg);
 
+sw_error_t
+fal_bm_port_counter_get(a_uint32_t dev_id, fal_port_t port,
+		fal_bm_port_counter_t *counter);
+
 
 #ifdef __cplusplus
 }
diff --git a/include/fal/fal_flow.h b/include/fal/fal_flow.h
index df484e7..752100b 100755
--- a/include/fal/fal_flow.h
+++ b/include/fal/fal_flow.h
@@ -147,6 +147,7 @@
 	FUNC_FLOW_ENTRY_ADD,
 	FUNC_FLOW_GLOBAL_CFG_GET,
 	FUNC_FLOW_GLOBAL_CFG_SET,
+	FUNC_FLOW_ENTRY_NEXT
 };
 
 sw_error_t
@@ -194,6 +195,12 @@
 		fal_flow_entry_t *flow_entry);
 
 sw_error_t
+fal_flow_entry_next(
+		a_uint32_t dev_id,
+		a_uint32_t next_mode,
+		fal_flow_entry_t *flow_entry);
+
+sw_error_t
 fal_flow_host_add(
 		a_uint32_t dev_id,
 		a_uint32_t add_mode,
diff --git a/include/fal/fal_qm.h b/include/fal/fal_qm.h
index df8a5d4..727b52c 100755
--- a/include/fal/fal_qm.h
+++ b/include/fal/fal_qm.h
@@ -123,6 +123,8 @@
 	FUNC_QUEUE_COUNTER_CTRL_SET,
 	FUNC_QM_ENQUEUE_CTRL_GET,
 	FUNC_QM_ENQUEUE_CTRL_SET,
+	FUNC_QM_PORT_SRCPROFILE_GET,
+	FUNC_QM_PORT_SRCPROFILE_SET,
 };
 
 sw_error_t
@@ -297,6 +299,19 @@
 sw_error_t
 fal_qm_enqueue_ctrl_get(a_uint32_t dev_id, a_uint32_t queue_id, a_bool_t *enable);
 
+sw_error_t
+fal_qm_port_source_profile_set(
+		a_uint32_t dev_id,
+		fal_port_t port,
+		a_uint32_t src_profile);
+
+sw_error_t
+fal_qm_port_source_profile_get(
+		a_uint32_t dev_id,
+		fal_port_t port,
+		a_uint32_t *src_profile);
+
+
 
 #ifdef __cplusplus
 }
diff --git a/include/hsl/hppe/hppe_portctrl.h b/include/hsl/hppe/hppe_portctrl.h
index efb8cf1..3475735 100755
--- a/include/hsl/hppe/hppe_portctrl.h
+++ b/include/hsl/hppe/hppe_portctrl.h
@@ -229,6 +229,18 @@
 		union tdm_cfg_u *value);
 
 sw_error_t
+hppe_drop_stat_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		union drop_stat_u *value);
+
+sw_error_t
+hppe_drop_stat_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		union drop_stat_u *value);
+
+sw_error_t
 hppe_mac_enable_txmac_en_get(
 		a_uint32_t dev_id,
 		a_uint32_t index,
@@ -1097,5 +1109,29 @@
 		a_uint32_t index,
 		a_uint32_t value);
 
+sw_error_t
+hppe_drop_stat_bytes_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint64_t *value);
+
+sw_error_t
+hppe_drop_stat_bytes_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint64_t value);
+
+sw_error_t
+hppe_drop_stat_pkts_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+hppe_drop_stat_pkts_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
 #endif
 
diff --git a/include/hsl/hppe/hppe_portctrl_reg.h b/include/hsl/hppe/hppe_portctrl_reg.h
index 5229e3e..d0e37e1 100755
--- a/include/hsl/hppe/hppe_portctrl_reg.h
+++ b/include/hsl/hppe/hppe_portctrl_reg.h
@@ -744,4 +744,34 @@
 	struct tdm_cfg bf;
 };
 
+/*[table] DROP_STAT*/
+#define DROP_STAT
+#define DROP_STAT_ADDRESS 0x3000
+#define DROP_STAT_NUM     30
+#define DROP_STAT_INC     0x10
+#define DROP_STAT_TYPE    REG_TYPE_RW
+#define DROP_STAT_DEFAULT 0x0
+	/*[field] PKTS*/
+	#define DROP_STAT_PKTS
+	#define DROP_STAT_PKTS_OFFSET  0
+	#define DROP_STAT_PKTS_LEN     32
+	#define DROP_STAT_PKTS_DEFAULT 0x0
+	/*[field] BYTES*/
+	#define DROP_STAT_BYTES
+	#define DROP_STAT_BYTES_OFFSET  32
+	#define DROP_STAT_BYTES_LEN     40
+	#define DROP_STAT_BYTES_DEFAULT 0x0
+
+struct drop_stat {
+	a_uint32_t  pkts:32;
+	a_uint32_t  bytes_0:32;
+	a_uint32_t  bytes_1:8;
+	a_uint32_t  _reserved0:24;
+};
+
+union drop_stat_u {
+	a_uint32_t val[3];
+	struct drop_stat bf;
+};
+
 #endif
diff --git a/src/adpt/adpt.c b/src/adpt/adpt.c
index d3b1976..1832997 100755
--- a/src/adpt/adpt.c
+++ b/src/adpt/adpt.c
@@ -132,7 +132,8 @@
 	} else if (module == FAL_MODULE_FLOW) {
 		p_adpt_api->adpt_flow_func_bitmap = func_ctrl->bitmap[0];
 	} else if (module == FAL_MODULE_QM) {
-		p_adpt_api->adpt_qm_func_bitmap = func_ctrl->bitmap[0];
+		p_adpt_api->adpt_qm_func_bitmap[0] = func_ctrl->bitmap[0];
+		p_adpt_api->adpt_qm_func_bitmap[1] = func_ctrl->bitmap[1];
 	} else if (module == FAL_MODULE_QOS) {
 		p_adpt_api->adpt_qos_func_bitmap = func_ctrl->bitmap[0];
 	} else if (module == FAL_MODULE_BM) {
@@ -204,7 +205,8 @@
 	} else if (module == FAL_MODULE_FLOW) {
 		func_ctrl->bitmap[0] = p_adpt_api->adpt_flow_func_bitmap;
 	} else if (module == FAL_MODULE_QM) {
-		func_ctrl->bitmap[0] = p_adpt_api->adpt_qm_func_bitmap;
+		func_ctrl->bitmap[0] = p_adpt_api->adpt_qm_func_bitmap[0];
+		func_ctrl->bitmap[1] = p_adpt_api->adpt_qm_func_bitmap[1];
 	} else if (module == FAL_MODULE_QOS) {
 		func_ctrl->bitmap[0] = p_adpt_api->adpt_qos_func_bitmap;
 	} else if (module == FAL_MODULE_BM) {
@@ -307,7 +309,8 @@
 			rv = adpt_hppe_module_func_register(dev_id, FAL_MODULE_FLOW);
 			SW_RTN_ON_ERROR(rv);
 
-			g_adpt_api[dev_id]->adpt_qm_func_bitmap = 0xffffffff;
+			g_adpt_api[dev_id]->adpt_qm_func_bitmap[0] = 0xffffffff;
+			g_adpt_api[dev_id]->adpt_qm_func_bitmap[1] = 0xffffffff;
 			rv = adpt_hppe_module_func_register(dev_id, FAL_MODULE_QM);
 			SW_RTN_ON_ERROR(rv);
 
@@ -430,7 +433,8 @@
 			rv = adpt_hppe_module_func_register(dev_id, FAL_MODULE_FLOW);
 			SW_RTN_ON_ERROR(rv);
 
-			g_adpt_api[dev_id]->adpt_qm_func_bitmap = 0;
+			g_adpt_api[dev_id]->adpt_qm_func_bitmap[0] = 0;
+			g_adpt_api[dev_id]->adpt_qm_func_bitmap[1] = 0;
 			adpt_hppe_qm_func_bitmap_init(dev_id);
 			rv = adpt_hppe_module_func_register(dev_id, FAL_MODULE_QM);
 			SW_RTN_ON_ERROR(rv);
diff --git a/src/adpt/hppe/adpt_hppe_bm.c b/src/adpt/hppe/adpt_hppe_bm.c
index ee7fb37..36110c9 100755
--- a/src/adpt/hppe/adpt_hppe_bm.c
+++ b/src/adpt/hppe/adpt_hppe_bm.c
@@ -303,6 +303,45 @@
 	return hppe_tdm_cfg_set(dev_id, tick_index, &tdm_cfg);
 }
 
+sw_error_t
+adpt_hppe_bm_port_counter_get(a_uint32_t dev_id, fal_port_t port,
+			fal_bm_port_counter_t *counter)
+{
+	sw_error_t rv = SW_OK;
+	union port_cnt_u port_cnt;
+	union port_reacted_cnt_u reacted_cnt;
+	union drop_stat_u drop_stat;
+	a_uint32_t index = FAL_PORT_ID_VALUE(port);
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(counter);
+	memset(&port_cnt, 0, sizeof(port_cnt));
+	memset(&reacted_cnt, 0, sizeof(reacted_cnt));
+
+	rv = hppe_port_cnt_get(dev_id, index, &port_cnt);
+	if( rv != SW_OK )
+		return rv;
+	counter->used_counter = port_cnt.bf.port_cnt;
+
+	rv = hppe_port_reacted_cnt_get(dev_id, index, &reacted_cnt);
+	if( rv != SW_OK )
+		return rv;
+	counter->react_counter = reacted_cnt.bf.port_reacted_cnt;
+
+	rv = hppe_drop_stat_get(dev_id, index, &drop_stat);
+	if( rv != SW_OK )
+		return rv;
+	counter->drop_byte_counter = drop_stat.bf.bytes_0 | ((a_uint64_t)drop_stat.bf.bytes_1 << 32);
+	counter->drop_packet_counter = drop_stat.bf.pkts;
+	rv = hppe_drop_stat_get(dev_id, index + 15, &drop_stat);
+	if( rv != SW_OK )
+		return rv;
+	counter->fc_drop_byte_counter = drop_stat.bf.bytes_0 | ((a_uint64_t)drop_stat.bf.bytes_1 << 32);
+	counter->fc_drop_packet_counter = drop_stat.bf.pkts;
+
+	return SW_OK;
+}
+
 void adpt_hppe_bm_func_bitmap_init(a_uint32_t dev_id)
 {
 	adpt_api_t *p_adpt_api = NULL;
@@ -325,7 +364,8 @@
 						(1 << FUNC_BM_PORT_DYNAMIC_THRESH_SET) |
 						(1 << FUNC_PORT_BM_CTRL_SET) |
 						(1 << FUNC_PORT_TDM_CTRL_SET) |
-						(1 << FUNC_PORT_TDM_TICK_CFG_SET));
+						(1 << FUNC_PORT_TDM_TICK_CFG_SET) |
+						(1 << FUNC_BM_PORT_COUNTER_GET));
 	return;
 }
 
@@ -348,6 +388,7 @@
 	p_adpt_api->adpt_port_bm_ctrl_set = NULL;
 	p_adpt_api->adpt_port_tdm_ctrl_set = NULL;
 	p_adpt_api->adpt_port_tdm_tick_cfg_set = NULL;
+	p_adpt_api->adpt_bm_port_counter_get = NULL;
 
 	return;
 }
@@ -392,6 +433,8 @@
 		p_adpt_api->adpt_port_tdm_ctrl_set = adpt_hppe_port_tdm_ctrl_set;
 	if (p_adpt_api->adpt_bm_func_bitmap & (1 << FUNC_PORT_TDM_TICK_CFG_SET))
 		p_adpt_api->adpt_port_tdm_tick_cfg_set = adpt_hppe_port_tdm_tick_cfg_set;
+	if (p_adpt_api->adpt_bm_func_bitmap & (1 << FUNC_BM_PORT_COUNTER_GET))
+		p_adpt_api->adpt_bm_port_counter_get = adpt_hppe_bm_port_counter_get;
 
 	return SW_OK;
 }
diff --git a/src/adpt/hppe/adpt_hppe_flow.c b/src/adpt/hppe/adpt_hppe_flow.c
index 5983ec0..811c317 100755
--- a/src/adpt/hppe/adpt_hppe_flow.c
+++ b/src/adpt/hppe/adpt_hppe_flow.c
@@ -1059,6 +1059,46 @@
 }
 
 sw_error_t
+adpt_hppe_flow_entry_next(
+		a_uint32_t dev_id,
+		a_uint32_t next_mode,
+		fal_flow_entry_t *flow_entry)
+{
+	a_uint32_t i = 0, step = 0;
+	sw_error_t rv = SW_OK;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(flow_entry);
+
+	if (FAL_NEXT_ENTRY_FIRST_ID == flow_entry->entry_id)
+		i = 0;
+
+	if (next_mode == FAL_FLOW_IP4_3TUPLE_ADDR ||
+		next_mode == FAL_FLOW_IP4_5TUPLE_ADDR) {
+		if (FAL_NEXT_ENTRY_FIRST_ID != flow_entry->entry_id)
+			i = flow_entry->entry_id + 1;
+		step = 1;
+	} else if (next_mode == FAL_FLOW_IP6_5TUPLE_ADDR ||
+		 next_mode == FAL_FLOW_IP6_3TUPLE_ADDR) {
+		if (FAL_NEXT_ENTRY_FIRST_ID != flow_entry->entry_id)
+			i = (flow_entry->entry_id & ~1) + 2;
+		step = 2;
+	}
+	for (; i < IN_FLOW_TBL_MAX_ENTRY;) {
+		flow_entry->entry_type = next_mode;
+		flow_entry->entry_id = i;
+		rv = adpt_hppe_flow_entry_get(dev_id, 1, flow_entry);
+		if (!rv) {
+			return rv;
+		}
+		i += step;
+	}
+
+	return SW_FAIL;
+
+}
+
+sw_error_t
 adpt_hppe_flow_entry_del(
 		a_uint32_t dev_id,
 		a_uint32_t del_mode,
@@ -1689,6 +1729,7 @@
 	p_adpt_api->adpt_flow_entry_add = NULL;
 	p_adpt_api->adpt_flow_global_cfg_get = NULL;
 	p_adpt_api->adpt_flow_global_cfg_set = NULL;
+	p_adpt_api->adpt_flow_entry_next = NULL;
 
 	return;
 }
@@ -1732,6 +1773,8 @@
 		p_adpt_api->adpt_flow_global_cfg_get = adpt_hppe_flow_global_cfg_get;
 	if (p_adpt_api->adpt_flow_func_bitmap & (1 << FUNC_FLOW_GLOBAL_CFG_SET))
 		p_adpt_api->adpt_flow_global_cfg_set = adpt_hppe_flow_global_cfg_set;
+	if (p_adpt_api->adpt_flow_func_bitmap & (1 << FUNC_FLOW_ENTRY_NEXT))
+		p_adpt_api->adpt_flow_entry_next = adpt_hppe_flow_entry_next;
 
 	return SW_OK;
 }
diff --git a/src/adpt/hppe/adpt_hppe_qm.c b/src/adpt/hppe/adpt_hppe_qm.c
index 0b08670..e396c4f 100755
--- a/src/adpt/hppe/adpt_hppe_qm.c
+++ b/src/adpt/hppe/adpt_hppe_qm.c
@@ -25,6 +25,8 @@
 #include "hppe_qos.h"
 #include "hppe_portvlan_reg.h"
 #include "hppe_portvlan.h"
+#include "hppe_portctrl_reg.h"
+#include "hppe_portctrl.h"
 #include "adpt.h"
 
 #define SERVICE_CODE_QUEUE_OFFSET   2048
@@ -1058,6 +1060,36 @@
 	return SW_OK;
 }
 
+sw_error_t
+adpt_hppe_qm_port_source_profile_set(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t src_profile)
+{
+	union mru_mtu_ctrl_tbl_u mru_mtu_ctrl_tbl;
+	a_uint32_t index = FAL_PORT_ID_VALUE(port);
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	memset(&mru_mtu_ctrl_tbl, 0, sizeof(mru_mtu_ctrl_tbl));
+
+
+	return hppe_mru_mtu_ctrl_tbl_src_profile_set(dev_id, index,
+				src_profile);
+}
+
+sw_error_t
+adpt_hppe_qm_port_source_profile_get(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t *src_profile)
+{
+	union mru_mtu_ctrl_tbl_u mru_mtu_ctrl_tbl;
+	a_uint32_t index = FAL_PORT_ID_VALUE(port);
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(src_profile);
+	memset(&mru_mtu_ctrl_tbl, 0, sizeof(mru_mtu_ctrl_tbl));
+
+	return hppe_mru_mtu_ctrl_tbl_src_profile_get(dev_id, index,
+				src_profile);
+}
+
 void adpt_hppe_qm_func_bitmap_init(a_uint32_t dev_id)
 {
 	adpt_api_t *p_adpt_api = NULL;
@@ -1067,7 +1099,7 @@
 	if(p_adpt_api == NULL)
 		return;
 
-	p_adpt_api->adpt_qm_func_bitmap = ((1 << FUNC_UCAST_HASH_MAP_SET) |
+	p_adpt_api->adpt_qm_func_bitmap[0] = ((1 << FUNC_UCAST_HASH_MAP_SET) |
 						(1 << FUNC_AC_DYNAMIC_THRESHOLD_GET) |
 						(1 << FUNC_UCAST_QUEUE_BASE_PROFILE_GET) |
 						(1 << FUNC_PORT_MCAST_PRIORITY_CLASS_GET) |
@@ -1097,7 +1129,9 @@
 						(1 << FUNC_QUEUE_COUNTER_CTRL_GET) |
 						(1 << FUNC_QUEUE_COUNTER_CTRL_SET) |
 						(1 << FUNC_QM_ENQUEUE_CTRL_GET) |
-						(1 << FUNC_QM_ENQUEUE_CTRL_SET));
+						(1 << FUNC_QM_ENQUEUE_CTRL_SET) |
+						(1 << FUNC_QM_PORT_SRCPROFILE_GET));
+	p_adpt_api->adpt_qm_func_bitmap[1] = 1 << (FUNC_QM_PORT_SRCPROFILE_SET % 32);
 	return;
 }
 
@@ -1137,6 +1171,8 @@
 	p_adpt_api->adpt_queue_counter_ctrl_set = NULL;
 	p_adpt_api->adpt_qm_enqueue_ctrl_set = NULL;
 	p_adpt_api->adpt_qm_enqueue_ctrl_get = NULL;
+	p_adpt_api->adpt_qm_port_source_profile_get = NULL;
+	p_adpt_api->adpt_qm_port_source_profile_set = NULL;
 
 	return;
 }
@@ -1152,68 +1188,72 @@
 
 	adpt_hppe_qm_func_unregister(dev_id, p_adpt_api);
 
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_UCAST_HASH_MAP_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_UCAST_HASH_MAP_SET))
 		p_adpt_api->adpt_ucast_hash_map_set = adpt_hppe_ucast_hash_map_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_DYNAMIC_THRESHOLD_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_DYNAMIC_THRESHOLD_GET))
 		p_adpt_api->adpt_ac_dynamic_threshold_get = adpt_hppe_ac_dynamic_threshold_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_UCAST_QUEUE_BASE_PROFILE_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_UCAST_QUEUE_BASE_PROFILE_GET))
 		p_adpt_api->adpt_ucast_queue_base_profile_get = adpt_hppe_ucast_queue_base_profile_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_PORT_MCAST_PRIORITY_CLASS_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_PORT_MCAST_PRIORITY_CLASS_GET))
 		p_adpt_api->adpt_port_mcast_priority_class_get = adpt_hppe_port_mcast_priority_class_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_DYNAMIC_THRESHOLD_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_DYNAMIC_THRESHOLD_SET))
 		p_adpt_api->adpt_ac_dynamic_threshold_set = adpt_hppe_ac_dynamic_threshold_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_PREALLOC_BUFFER_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_PREALLOC_BUFFER_SET))
 		p_adpt_api->adpt_ac_prealloc_buffer_set = adpt_hppe_ac_prealloc_buffer_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_UCAST_DEFAULT_HASH_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_UCAST_DEFAULT_HASH_GET))
 		p_adpt_api->adpt_ucast_default_hash_get = adpt_hppe_ucast_default_hash_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_UCAST_DEFAULT_HASH_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_UCAST_DEFAULT_HASH_SET))
 		p_adpt_api->adpt_ucast_default_hash_set = adpt_hppe_ucast_default_hash_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_QUEUE_GROUP_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_QUEUE_GROUP_GET))
 		p_adpt_api->adpt_ac_queue_group_get = adpt_hppe_ac_queue_group_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_CTRL_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_CTRL_GET))
 		p_adpt_api->adpt_ac_ctrl_get = adpt_hppe_ac_ctrl_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_PREALLOC_BUFFER_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_PREALLOC_BUFFER_GET))
 		p_adpt_api->adpt_ac_prealloc_buffer_get = adpt_hppe_ac_prealloc_buffer_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_PORT_MCAST_PRIORITY_CLASS_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_PORT_MCAST_PRIORITY_CLASS_SET))
 		p_adpt_api->adpt_port_mcast_priority_class_set = adpt_hppe_port_mcast_priority_class_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_UCAST_HASH_MAP_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_UCAST_HASH_MAP_GET))
 		p_adpt_api->adpt_ucast_hash_map_get = adpt_hppe_ucast_hash_map_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_STATIC_THRESHOLD_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_STATIC_THRESHOLD_SET))
 		p_adpt_api->adpt_ac_static_threshold_set = adpt_hppe_ac_static_threshold_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_QUEUE_GROUP_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_QUEUE_GROUP_SET))
 		p_adpt_api->adpt_ac_queue_group_set = adpt_hppe_ac_queue_group_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_GROUP_BUFFER_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_GROUP_BUFFER_GET))
 		p_adpt_api->adpt_ac_group_buffer_get = adpt_hppe_ac_group_buffer_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_MCAST_CPU_CODE_CLASS_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_MCAST_CPU_CODE_CLASS_GET))
 		p_adpt_api->adpt_mcast_cpu_code_class_get = adpt_hppe_mcast_cpu_code_class_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_CTRL_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_CTRL_SET))
 		p_adpt_api->adpt_ac_ctrl_set = adpt_hppe_ac_ctrl_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_UCAST_PRIORITY_CLASS_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_UCAST_PRIORITY_CLASS_GET))
 		p_adpt_api->adpt_ucast_priority_class_get = adpt_hppe_ucast_priority_class_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_QUEUE_FLUSH))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QUEUE_FLUSH))
 		p_adpt_api->adpt_queue_flush = adpt_hppe_queue_flush;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_MCAST_CPU_CODE_CLASS_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_MCAST_CPU_CODE_CLASS_SET))
 		p_adpt_api->adpt_mcast_cpu_code_class_set = adpt_hppe_mcast_cpu_code_class_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_UCAST_PRIORITY_CLASS_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_UCAST_PRIORITY_CLASS_SET))
 		p_adpt_api->adpt_ucast_priority_class_set = adpt_hppe_ucast_priority_class_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_STATIC_THRESHOLD_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_STATIC_THRESHOLD_GET))
 		p_adpt_api->adpt_ac_static_threshold_get = adpt_hppe_ac_static_threshold_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_UCAST_QUEUE_BASE_PROFILE_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_UCAST_QUEUE_BASE_PROFILE_SET))
 		p_adpt_api->adpt_ucast_queue_base_profile_set = adpt_hppe_ucast_queue_base_profile_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_AC_GROUP_BUFFER_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_AC_GROUP_BUFFER_SET))
 		p_adpt_api->adpt_ac_group_buffer_set = adpt_hppe_ac_group_buffer_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_QUEUE_COUNTER_CLEANUP))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QUEUE_COUNTER_CLEANUP))
 		p_adpt_api->adpt_queue_counter_cleanup = adpt_hppe_queue_counter_cleanup;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_QUEUE_COUNTER_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QUEUE_COUNTER_GET))
 		p_adpt_api->adpt_queue_counter_get = adpt_hppe_queue_counter_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_QUEUE_COUNTER_CTRL_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QUEUE_COUNTER_CTRL_GET))
 		p_adpt_api->adpt_queue_counter_ctrl_get = adpt_hppe_queue_counter_ctrl_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_QUEUE_COUNTER_CTRL_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QUEUE_COUNTER_CTRL_SET))
 		p_adpt_api->adpt_queue_counter_ctrl_set = adpt_hppe_queue_counter_ctrl_set;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_QM_ENQUEUE_CTRL_GET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QM_ENQUEUE_CTRL_GET))
 		p_adpt_api->adpt_qm_enqueue_ctrl_get = adpt_hppe_qm_enqueue_ctrl_get;
-	if (p_adpt_api->adpt_qm_func_bitmap & (1 << FUNC_QM_ENQUEUE_CTRL_SET))
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QM_ENQUEUE_CTRL_SET))
 		p_adpt_api->adpt_qm_enqueue_ctrl_set = adpt_hppe_qm_enqueue_ctrl_set;
+	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QM_PORT_SRCPROFILE_GET))
+		p_adpt_api->adpt_qm_port_source_profile_get = adpt_hppe_qm_port_source_profile_get;
+	if (p_adpt_api->adpt_qm_func_bitmap[1] & (1 << (FUNC_QM_PORT_SRCPROFILE_SET % 32)))
+		p_adpt_api->adpt_qm_port_source_profile_set = adpt_hppe_qm_port_source_profile_set;
 
 
 	return SW_OK;
diff --git a/src/fal/fal_bm.c b/src/fal/fal_bm.c
index bae2ce6..9c88f80 100755
--- a/src/fal/fal_bm.c
+++ b/src/fal/fal_bm.c
@@ -200,6 +200,22 @@
 	rv = p_api->adpt_port_bm_ctrl_set(dev_id, port, enable);
 	return rv;
 }
+
+sw_error_t
+_fal_bm_port_counter_get(a_uint32_t dev_id, fal_port_t port,
+			fal_bm_port_counter_t *counter)
+{
+	adpt_api_t *p_api;
+	sw_error_t rv = SW_OK;
+
+	SW_RTN_ON_NULL(p_api = adpt_api_ptr_get(dev_id));
+
+	if (NULL == p_api->adpt_bm_port_counter_get)
+		return SW_NOT_SUPPORTED;
+
+	rv = p_api->adpt_bm_port_counter_get(dev_id, port, counter);
+	return rv;
+}
 /*insert flag for inner fal, don't remove it*/
 
 sw_error_t
@@ -333,6 +349,18 @@
 	return rv;
 }
 
+sw_error_t
+fal_bm_port_counter_get(a_uint32_t dev_id, fal_port_t port,
+			fal_bm_port_counter_t *counter)
+{
+	sw_error_t rv = SW_OK;
+
+	FAL_API_LOCK;
+	rv = _fal_bm_port_counter_get(dev_id, port, counter);
+	FAL_API_UNLOCK;
+	return rv;
+}
+
 EXPORT_SYMBOL(fal_port_bm_ctrl_set);
 
 EXPORT_SYMBOL(fal_port_bm_ctrl_get);
@@ -357,4 +385,6 @@
 
 EXPORT_SYMBOL(fal_bm_port_dynamic_thresh_get);
 
+EXPORT_SYMBOL(fal_bm_port_counter_get);
+
 /*insert flag for outter fal, don't remove it*/
diff --git a/src/fal/fal_flow.c b/src/fal/fal_flow.c
index 7e3282d..36f23e5 100755
--- a/src/fal/fal_flow.c
+++ b/src/fal/fal_flow.c
@@ -74,6 +74,23 @@
 	return rv;
 }
 sw_error_t
+_fal_flow_entry_next(
+		a_uint32_t dev_id,
+		a_uint32_t next_mode,
+		fal_flow_entry_t *flow_entry)
+{
+	adpt_api_t *p_api;
+	sw_error_t rv = SW_OK;
+
+	SW_RTN_ON_NULL(p_api = adpt_api_ptr_get(dev_id));
+
+	if (NULL == p_api->adpt_flow_entry_next)
+		return SW_NOT_SUPPORTED;
+
+	rv = p_api->adpt_flow_entry_next(dev_id, next_mode, flow_entry);
+	return rv;
+}
+sw_error_t
 _fal_flow_status_get(a_uint32_t dev_id, a_bool_t *enable)
 {
 	adpt_api_t *p_api;
@@ -292,6 +309,19 @@
 	return rv;
 }
 sw_error_t
+fal_flow_entry_next(
+		a_uint32_t dev_id,
+		a_uint32_t next_mode,
+		fal_flow_entry_t *flow_entry)
+{
+	sw_error_t rv = SW_OK;
+
+	FAL_API_LOCK;
+	rv = _fal_flow_entry_next(dev_id, next_mode, flow_entry);
+	FAL_API_UNLOCK;
+	return rv;
+}
+sw_error_t
 fal_flow_status_get(a_uint32_t dev_id, a_bool_t *enable)
 {
 	sw_error_t rv = SW_OK;
diff --git a/src/fal/fal_qm.c b/src/fal/fal_qm.c
index 18cf22d..87af6a2 100755
--- a/src/fal/fal_qm.c
+++ b/src/fal/fal_qm.c
@@ -545,6 +545,35 @@
 	return rv;
 }
 
+sw_error_t
+_fal_qm_port_source_profile_set(a_uint32_t dev_id, fal_port_t port, a_uint32_t src_profile)
+{
+	adpt_api_t *p_api;
+	sw_error_t rv = SW_OK;
+
+	SW_RTN_ON_NULL(p_api = adpt_api_ptr_get(dev_id));
+
+	if (NULL == p_api->adpt_qm_port_source_profile_set)
+		return SW_NOT_SUPPORTED;
+
+	rv = p_api->adpt_qm_port_source_profile_set(dev_id, port, src_profile);
+	return rv;
+}
+sw_error_t
+_fal_qm_port_source_profile_get(a_uint32_t dev_id, fal_port_t port, a_uint32_t *src_profile)
+{
+	adpt_api_t *p_api;
+	sw_error_t rv = SW_OK;
+
+	SW_RTN_ON_NULL(p_api = adpt_api_ptr_get(dev_id));
+
+	if (NULL == p_api->adpt_qm_port_source_profile_get)
+		return SW_NOT_SUPPORTED;
+
+	rv = p_api->adpt_qm_port_source_profile_get(dev_id, port, src_profile);
+	return rv;
+}
+
 /*insert flag for inner fal, don't remove it*/
 
 sw_error_t
@@ -946,6 +975,31 @@
 	return rv;
 }
 
+sw_error_t
+fal_qm_port_source_profile_set(a_uint32_t dev_id, fal_port_t port, a_uint32_t src_profile)
+{
+	sw_error_t rv = SW_OK;
+
+	FAL_API_LOCK;
+	rv = _fal_qm_port_source_profile_set(dev_id, port, src_profile);
+	FAL_API_UNLOCK;
+	return rv;
+}
+sw_error_t
+fal_qm_port_source_profile_get(a_uint32_t dev_id, fal_port_t port, a_uint32_t *src_profile)
+{
+	sw_error_t rv = SW_OK;
+
+	FAL_API_LOCK;
+	rv = _fal_qm_port_source_profile_get(dev_id, port, src_profile);
+	FAL_API_UNLOCK;
+	return rv;
+}
+
+EXPORT_SYMBOL(fal_qm_port_source_profile_set);
+
+EXPORT_SYMBOL(fal_qm_port_source_profile_get);
+
 EXPORT_SYMBOL(fal_qm_enqueue_ctrl_set);
 
 EXPORT_SYMBOL(fal_qm_enqueue_ctrl_get);
diff --git a/src/hsl/hppe/hppe_portctrl.c b/src/hsl/hppe/hppe_portctrl.c
index 08cbabc..f66e3db 100755
--- a/src/hsl/hppe/hppe_portctrl.c
+++ b/src/hsl/hppe/hppe_portctrl.c
@@ -462,6 +462,34 @@
 }
 
 sw_error_t
+hppe_drop_stat_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		union drop_stat_u *value)
+{
+	return hppe_reg_tbl_get(
+				dev_id,
+				NSS_PRX_CSR_BASE_ADDR + DROP_STAT_ADDRESS + \
+				index * DROP_STAT_INC,
+				value->val,
+				3);
+}
+
+sw_error_t
+hppe_drop_stat_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		union drop_stat_u *value)
+{
+	return hppe_reg_tbl_set(
+				dev_id,
+				NSS_PRX_CSR_BASE_ADDR + DROP_STAT_ADDRESS + \
+				index * DROP_STAT_INC,
+				value->val,
+				3);
+}
+
+sw_error_t
 hppe_mac_enable_txmac_en_get(
 		a_uint32_t dev_id,
 		a_uint32_t index,
@@ -2283,6 +2311,37 @@
 }
 
 sw_error_t
+hppe_mru_mtu_ctrl_tbl_src_profile_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union mru_mtu_ctrl_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = hppe_mru_mtu_ctrl_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.src_profile;
+	return ret;
+}
+
+sw_error_t
+hppe_mru_mtu_ctrl_tbl_src_profile_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union mru_mtu_ctrl_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = hppe_mru_mtu_ctrl_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.src_profile = value;
+	ret = hppe_mru_mtu_ctrl_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
 hppe_mc_mtu_ctrl_tbl_mtu_cmd_get(
 		a_uint32_t dev_id,
 		a_uint32_t index,
@@ -2644,3 +2703,67 @@
 	ret = hppe_port_in_forward_set(dev_id, index, &reg_val);
 	return ret;
 }
+
+sw_error_t
+hppe_drop_stat_bytes_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint64_t *value)
+{
+	union drop_stat_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = hppe_drop_stat_get(dev_id, index, &reg_val);
+	*value = (a_uint64_t)reg_val.bf.bytes_1 << 32 | \
+		reg_val.bf.bytes_0;
+	return ret;
+}
+
+sw_error_t
+hppe_drop_stat_bytes_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint64_t value)
+{
+	union drop_stat_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = hppe_drop_stat_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.bytes_1 = value >> 32;
+	reg_val.bf.bytes_0 = value & (((a_uint64_t)1<<32)-1);
+	ret = hppe_drop_stat_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+hppe_drop_stat_pkts_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union drop_stat_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = hppe_drop_stat_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.pkts;
+	return ret;
+}
+
+sw_error_t
+hppe_drop_stat_pkts_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union drop_stat_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = hppe_drop_stat_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.pkts = value;
+	ret = hppe_drop_stat_set(dev_id, index, &reg_val);
+	return ret;
+}
\ No newline at end of file
diff --git a/src/ref/ref_uci.c b/src/ref/ref_uci.c
index 90e8e1c..f5f6c6c 100755
--- a/src/ref/ref_uci.c
+++ b/src/ref/ref_uci.c
@@ -9447,6 +9447,35 @@
 	return rv;
 }
 
+static int
+parse_qm_srcprofile(struct switch_val *val)
+{
+	struct switch_ext *switch_ext_p, *ext_value_p;
+	int rv = 0;
+
+	switch_ext_p = val->value.ext_val;
+	while (switch_ext_p) {
+		ext_value_p = switch_ext_p;
+
+		if (!strcmp(ext_value_p->option_name, "name")) {
+			switch_ext_p = switch_ext_p->next;
+			continue;
+		} else if (!strcmp(ext_value_p->option_name, "port_id")) {
+			val_ptr[0] = (char*)ext_value_p->option_value;
+		} else if (!strcmp(ext_value_p->option_name, "sourceprofile")) {
+			val_ptr[1] = (char*)ext_value_p->option_value;
+		}  else {
+			rv = -1;
+			break;
+		}
+
+		parameter_length++;
+		switch_ext_p = switch_ext_p->next;
+	}
+
+	return rv;
+}
+
 #endif
 
 #ifdef IN_SERVCODE
@@ -10983,7 +11012,9 @@
 		rv = parse_qm_cnt(val);
 	} else if (!strcmp(command_name, "Enqueue")) {
 		rv = parse_qm_enqueue(val);
-	} 
+	} else if (!strcmp(command_name, "Srcprofile")) {
+		rv = parse_qm_srcprofile(val);
+	}
 
 	return rv;
 }
diff --git a/src/shell_lib/shell_config.c b/src/shell_lib/shell_config.c
index 74517b8..0d01422 100755
--- a/src/shell_lib/shell_config.c
+++ b/src/shell_lib/shell_config.c
@@ -1229,6 +1229,7 @@
     {"cnt", "cleanup", SW_API_QUEUE_CNT_CLEANUP, NULL},
     {"cnt", "set", SW_API_QUEUE_CNT_CLEANUP, NULL},
     {"enqueue", "set", SW_API_QM_ENQUEUE_CTRL_SET, NULL},
+    {"srcprofile", "set", SW_API_QM_SOURCE_PROFILE_SET, NULL},
     {NULL, NULL, (int)NULL, NULL},/*end of desc*/
 
 };