Selaa lähdekoodia

qcacld-3.0: Bypass FISA aggregation for packets from DNS server

Currently FISA flows are added for packets received
from DNS server. The connection to DNS server are short
exchanges to resolve any URL, hence there is no need
to create FISA flows for such short lived flows.

Bypass FISA for packets from DNS server.

Change-Id: Ifd4f15f2c0b131148ccff7fd450d536ac029788d
CRs-Fixed: 3249810
Rakesh Pillai 2 vuotta sitten
vanhempi
sitoutus
8e45e437f0
2 muutettua tiedostoa jossa 26 lisäystä ja 8 poistoa
  1. 24 8
      core/dp/txrx3.0/dp_fisa_rx.c
  2. 2 0
      core/dp/txrx3.0/dp_fisa_rx.h

+ 24 - 8
core/dp/txrx3.0/dp_fisa_rx.c

@@ -180,6 +180,16 @@ void print_flow_tuple(struct cdp_rx_flow_tuple_info *flow_tuple, char *str,
 
 }
 
+static bool
+dp_rx_fisa_should_bypass(struct cdp_rx_flow_tuple_info *flow_tuple_info)
+{
+	if (flow_tuple_info->dest_port == DNS_SERVER_PORT ||
+	    flow_tuple_info->src_port == DNS_SERVER_PORT)
+		return true;
+
+	return false;
+}
+
 static bool
 dp_fisa_is_ipsec_connection(struct cdp_rx_flow_tuple_info *flow_tuple_info)
 {
@@ -243,6 +253,8 @@ get_flow_tuple_from_nbuf(struct dp_soc *soc,
 	else
 		flow_tuple_info->is_exception = 0;
 
+	flow_tuple_info->bypass_fisa = dp_rx_fisa_should_bypass(flow_tuple_info);
+
 	flow_tuple_info->l4_protocol = iph->protocol;
 	dp_fisa_debug("l4_protocol %d", flow_tuple_info->l4_protocol);
 
@@ -532,7 +544,17 @@ dp_rx_fisa_add_ft_entry(struct dp_vdev *vdev,
 	dp_fisa_debug("flow_hash 0x%x hashed_flow_idx 0x%x", flow_hash,
 		      hashed_flow_idx);
 	dp_fisa_debug("max_skid_length 0x%x", max_skid_length);
+
 	qdf_spin_lock_bh(&fisa_hdl->dp_rx_fst_lock);
+
+	if (!rx_flow_tuple_info.tuple_populated) {
+		get_flow_tuple_from_nbuf(fisa_hdl->soc_hdl,
+					 &rx_flow_tuple_info,
+					 nbuf, rx_tlv_hdr);
+		if (rx_flow_tuple_info.bypass_fisa)
+			return NULL;
+	}
+
 	do {
 		sw_ft_entry = &(((struct dp_fisa_rx_sw_ft *)
 					fisa_hdl->base)[hashed_flow_idx]);
@@ -542,10 +564,6 @@ dp_rx_fisa_add_ft_entry(struct dp_vdev *vdev,
 						      flow_hash, vdev,
 						      fisa_hdl->soc_hdl,
 						      hashed_flow_idx);
-			if (!rx_flow_tuple_info.tuple_populated)
-				get_flow_tuple_from_nbuf(fisa_hdl->soc_hdl,
-							 &rx_flow_tuple_info,
-							 nbuf, rx_tlv_hdr);
 
 			/* Add HW FT entry */
 			sw_ft_entry->hw_fse =
@@ -572,10 +590,6 @@ dp_rx_fisa_add_ft_entry(struct dp_vdev *vdev,
 			break;
 		}
 		/* else */
-		if (!rx_flow_tuple_info.tuple_populated)
-			get_flow_tuple_from_nbuf(fisa_hdl->soc_hdl,
-						 &rx_flow_tuple_info,
-						 nbuf, rx_tlv_hdr);
 
 		if (is_same_flow(&sw_ft_entry->rx_flow_tuple_info,
 				 &rx_flow_tuple_info)) {
@@ -1003,6 +1017,8 @@ dp_fisa_rx_queue_fst_update_work(struct dp_rx_fst *fisa_hdl, uint32_t flow_idx,
 
 	get_flow_tuple_from_nbuf(fisa_hdl->soc_hdl, &flow_tuple_info,
 				 nbuf, rx_tlv_hdr);
+	if (flow_tuple_info.bypass_fisa)
+		return NULL;
 
 	if (sw_ft_entry->is_populated && is_same_flow(
 			&sw_ft_entry->rx_flow_tuple_info, &flow_tuple_info))

+ 2 - 0
core/dp/txrx3.0/dp_fisa_rx.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
@@ -39,6 +40,7 @@
 
 #define IPSEC_PORT 500
 #define IPSEC_NAT_PORT 4500
+#define DNS_SERVER_PORT 53
 
 #define DP_FT_LOCK_MAX_RECORDS 32