qcacld-3.0: Reduce the threshold of drop in the intra-bss forwarding path

In case of intra-bss forwarding, tx-path consumes all the tx descriptors
and pause netif queues. As a result, there would be some left for stack
triggered packets such as ARP packets which leads to ref STA disconnection.
To avoid this, reserved a pool of descriptors(OL_TX_NON_FWD_RESERVE = 100)
for high priority packets such as ARP/EAPOL etc and drop the packets
to be forwarded in host itself.

CRs-Fixed: 1095203
Change-Id: I7d473118ef3d986f79aa5b7a47286235d7adcab4
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index c7d9891..4cfa13c 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -48,6 +48,7 @@
 #include <linux/inetdevice.h>
 #include <linux/ip.h>
 #include <wlan_hdd_softap_tx_rx.h>
+#include <ol_txrx.h>
 #include <cdp_txrx_peer_ops.h>
 
 #include "cds_sched.h"
@@ -3221,6 +3222,14 @@
 	int ret = HDD_IPA_FORWARD_PKT_NONE;
 
 	if ((desc & FW_RX_DESC_FORWARD_M)) {
+		if (!ol_txrx_fwd_desc_thresh_check(
+			ol_txrx_get_vdev_from_vdev_id(adapter->sessionId))) {
+			/* Drop the packet*/
+			hdd_ipa->stats.num_tx_fwd_err++;
+			kfree_skb(skb);
+			ret = HDD_IPA_FORWARD_PKT_DISCARD;
+			return ret;
+		}
 		HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG,
 				"Forward packet to Tx (fw_desc=%d)", desc);
 		hdd_ipa->ipa_tx_forward++;