From eae11e83a7103b4702555fd6f6eaee7daaa410fe Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Sun, 1 Nov 2020 22:54:00 +0530 Subject: [PATCH] qcacld-3.0: Skip FISA aggregation for IPSec packets Currently IPSec packets encapsulated in UDP packets are aggregated via FISA. This is leading to unwanted behvaior of certain special packets (hearbeat etc) being aggregated along with other normal packets of a flow, thereby leading to use-case disruption. Fix this by not aggregating IPSec packets. Change-Id: Ieada556e7e3ef67d2c7a8e8ba4d7197c7660be0c CRs-Fixed: 2783629 --- core/dp/txrx3.0/dp_fisa_rx.c | 22 ++++++++++++++++++++++ core/dp/txrx3.0/dp_fisa_rx.h | 3 +++ 2 files changed, 25 insertions(+) diff --git a/core/dp/txrx3.0/dp_fisa_rx.c b/core/dp/txrx3.0/dp_fisa_rx.c index 889cfe135fa6..8c198697c8c6 100644 --- a/core/dp/txrx3.0/dp_fisa_rx.c +++ b/core/dp/txrx3.0/dp_fisa_rx.c @@ -145,6 +145,18 @@ static void print_flow_tuple(struct cdp_rx_flow_tuple_info *flow_tuple) dp_info("l4_protocol 0x%x", flow_tuple->l4_protocol); } +static bool +dp_fisa_is_ipsec_connection(struct cdp_rx_flow_tuple_info *flow_tuple_info) +{ + if (flow_tuple_info->dest_port == IPSEC_PORT || + flow_tuple_info->dest_port == IPSEC_NAT_PORT || + flow_tuple_info->src_port == IPSEC_PORT || + flow_tuple_info->src_port == IPSEC_NAT_PORT) + return true; + + return false; +} + /** * get_flow_tuple_from_nbuf() - Get the flow tuple from msdu * @hal_soc_hdl: Handle to hal soc @@ -188,6 +200,11 @@ get_flow_tuple_from_nbuf(hal_soc_handle_t hal_soc_hdl, flow_tuple_info->dest_port = qdf_ntohs(tcph->dest); flow_tuple_info->src_port = qdf_ntohs(tcph->source); + if (dp_fisa_is_ipsec_connection(flow_tuple_info)) + flow_tuple_info->is_exception = 1; + else + flow_tuple_info->is_exception = 0; + flow_tuple_info->l4_protocol = iph->protocol; dp_fisa_debug("l4_protocol %d", flow_tuple_info->l4_protocol); @@ -1723,6 +1740,11 @@ QDF_STATUS dp_fisa_rx(struct dp_soc *soc, struct dp_vdev *vdev, fisa_flow = dp_rx_get_fisa_flow(dp_fisa_rx_hdl, vdev, head_nbuf); + /* Do not FISA aggregate IPSec packets */ + if (fisa_flow && + fisa_flow->rx_flow_tuple_info.is_exception) + goto pull_nbuf; + /* Fragmented skb do not handle via fisa * get that flow and deliver that flow to rx_thread */ diff --git a/core/dp/txrx3.0/dp_fisa_rx.h b/core/dp/txrx3.0/dp_fisa_rx.h index dc60d7868f59..cda4471a5b7c 100644 --- a/core/dp/txrx3.0/dp_fisa_rx.h +++ b/core/dp/txrx3.0/dp_fisa_rx.h @@ -38,6 +38,9 @@ #define FISA_FLOW_MAX_CUMULATIVE_IP_LEN \ (FISA_MAX_SINGLE_CUMULATIVE_IP_LEN * FISA_FLOW_MAX_AGGR_COUNT) +#define IPSEC_PORT 500 +#define IPSEC_NAT_PORT 4500 + struct dp_fisa_rx_fst_update_elem { /* Do not add new entries here */ qdf_list_node_t node;