Browse Source

qcacld-3.0: add ini option to enable orphan Tx packets

Add INI config option to enable orphaning of Tx packets.
Default is to disable orphaning.

Change-Id: Ib855d7ebf56fd3def1a2674091a188e8ecd729f2
CRs-Fixed: 2064079
Manjunathappa Prakash 7 years ago
parent
commit
dab74fa881

+ 21 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -10296,6 +10296,26 @@ enum hdd_external_acs_freq_band {
 #define CFG_SAP_MAX_MCS_FOR_TX_DATA_MAX     (383)
 #define CFG_SAP_MAX_MCS_FOR_TX_DATA_DEFAULT (0)
 
+/*
+ * <ini>
+ * gEnableTxOrphan- Enable/Disable orphaning of Tx packets
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable/disable orphaning of Tx packets.
+ *
+ * Related: None
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_TX_ORPHAN_ENABLE_NAME    "gEnableTxOrphan"
+#define CFG_TX_ORPHAN_ENABLE_DEFAULT (0)
+#define CFG_TX_ORPHAN_ENABLE_MIN     (0)
+#define CFG_TX_ORPHAN_ENABLE_MAX     (1)
+
 /*
  * Type declarations
  */
@@ -11022,6 +11042,7 @@ struct hdd_config {
 	bool ani_enabled;
 	bool qcn_ie_support;
 	bool reg_offload_enabled;
+	bool tx_orphan_enable;
 	uint32_t timer_multiplier;
 	uint8_t fils_max_chan_guard_time;
 	uint8_t scan_backoff_multiplier;

+ 7 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -4419,6 +4419,13 @@ struct reg_table_entry g_registry_table[] = {
 		CFG_SAP_MAX_MCS_FOR_TX_DATA_DEFAULT,
 		CFG_SAP_MAX_MCS_FOR_TX_DATA_MIN,
 		CFG_SAP_MAX_MCS_FOR_TX_DATA_MAX),
+
+	REG_VARIABLE(CFG_TX_ORPHAN_ENABLE_NAME, WLAN_PARAM_Integer,
+		struct hdd_config, tx_orphan_enable,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_TX_ORPHAN_ENABLE_DEFAULT,
+		CFG_TX_ORPHAN_ENABLE_MIN,
+		CFG_TX_ORPHAN_ENABLE_MAX),
 };
 
 

+ 3 - 2
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -219,9 +219,10 @@ static inline struct sk_buff *hdd_skb_orphan(hdd_adapter_t *pAdapter,
 		struct sk_buff *skb) {
 
 	struct sk_buff *nskb;
-	nskb = skb_unshare(skb, GFP_ATOMIC);
+	hdd_context_t *hdd_ctx = pAdapter->pHddCtx;
 
-	if (nskb == skb) {
+	nskb = skb_unshare(skb, GFP_ATOMIC);
+	if (unlikely(hdd_ctx->config->tx_orphan_enable) && (nskb == skb)) {
 		/*
 		 * For UDP packets we want to orphan the packet to allow the app
 		 * to send more packets. The flow would ultimately be controlled

+ 3 - 2
core/hdd/src/wlan_hdd_tx_rx.c

@@ -290,9 +290,10 @@ static inline struct sk_buff *hdd_skb_orphan(hdd_adapter_t *pAdapter,
 		struct sk_buff *skb) {
 
 	struct sk_buff *nskb;
-	nskb = skb_unshare(skb, GFP_ATOMIC);
+	hdd_context_t *hdd_ctx = pAdapter->pHddCtx;
 
-	if (nskb == skb) {
+	nskb = skb_unshare(skb, GFP_ATOMIC);
+	if (unlikely(hdd_ctx->config->tx_orphan_enable) && (nskb == skb)) {
 		/*
 		 * For UDP packets we want to orphan the packet to allow the app
 		 * to send more packets. The flow would ultimately be controlled