Przeglądaj źródła

qcacld-3.0: Inspect TCP TX ACK packet for ILP

Support TX TCP ACK inspection for HW based ILP feature.
use skb->priority bits(24~31) as temporary flag to mark TCP
ACK between hdd_wmm_select_queue() and hdd_hard_start_xmit(),
then mark TCP ACK in skb->cb if hdd_hard_start_xmit() detect
skb->priority for TCP ACK is marked, clean skb->priority upper
8 bits as well.

Change-Id: I9c8a7ff2fd1f8a50a86b68fab3760b86f598fca2
CRs-Fixed: 3368301
Jinwei Chen 2 lat temu
rodzic
commit
9d3e0bb6dc
2 zmienionych plików z 70 dodań i 3 usunięć
  1. 32 2
      core/hdd/src/wlan_hdd_wmm.c
  2. 38 1
      os_if/dp/src/os_if_dp_txrx.c

+ 32 - 2
core/hdd/src/wlan_hdd_wmm.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 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
@@ -2169,6 +2169,36 @@ uint16_t hdd_get_queue_index(uint16_t up, bool is_critical)
 }
 #endif
 
+#ifdef DP_TX_PACKET_INSPECT_FOR_ILP
+/**
+ * hdd_update_pkt_priority_with_inspection() - update TX packets priority
+ * @skb: network buffer
+ * @up: user priority
+ *
+ * Update TX packets priority, if some special TX packets like TCP ack,
+ * reuse skb->priority upper 8 bits(bit24 ~ 31) to mark them.
+ *
+ * Return: None
+ */
+static inline
+void hdd_update_pkt_priority_with_inspection(struct sk_buff *skb,
+					     enum sme_qos_wmmuptype up)
+{
+	skb->priority = up;
+
+	if (qdf_unlikely(qdf_nbuf_is_ipv4_v6_pure_tcp_ack(skb)))
+		qdf_nbuf_set_priority_pkt_type(
+				skb, QDF_NBUF_PRIORITY_PKT_TCP_ACK);
+}
+#else
+static inline
+void hdd_update_pkt_priority_with_inspection(struct sk_buff *skb,
+					     enum sme_qos_wmmuptype up)
+{
+	skb->priority = up;
+}
+#endif
+
 static uint16_t __hdd_wmm_select_queue(struct net_device *dev,
 				       struct sk_buff *skb)
 {
@@ -2187,7 +2217,7 @@ static uint16_t __hdd_wmm_select_queue(struct net_device *dev,
 	/* Get the user priority from IP header */
 	hdd_wmm_classify_pkt(adapter, skb, &up, &is_critical);
 
-	skb->priority = up;
+	hdd_update_pkt_priority_with_inspection(skb, up);
 
 	index = hdd_get_queue_index(skb->priority, is_critical);
 

+ 38 - 1
os_if/dp/src/os_if_dp_txrx.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 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
@@ -106,6 +106,39 @@ static void osif_dp_mark_critical_pkt(struct sk_buff *skb)
 	QDF_NBUF_CB_TX_EXTRA_IS_CRITICAL(skb) = true;
 }
 
+#ifdef DP_TX_PACKET_INSPECT_FOR_ILP
+/**
+ * osif_dp_mark_pkt_type_by_priority() - mark packet type to skb->cb
+ *                                       by type from priority of skb
+ * @skb: network buffer
+ *
+ * Return: true - packet type marked, false - not marked
+ */
+static inline
+bool osif_dp_mark_pkt_type_by_priority(struct sk_buff *skb)
+{
+	bool type_marked = false;
+	uint32_t pkt_type =
+		qdf_nbuf_get_priority_pkt_type(skb);
+
+	if (qdf_unlikely(pkt_type == QDF_NBUF_PRIORITY_PKT_TCP_ACK)) {
+		QDF_NBUF_CB_GET_PACKET_TYPE(skb) =
+					QDF_NBUF_CB_PACKET_TYPE_TCP_ACK;
+		type_marked = true;
+	}
+	/* cleanup the packet type in priority */
+	qdf_nbuf_remove_priority_pkt_type(skb);
+
+	return type_marked;
+}
+#else
+static inline
+bool osif_dp_mark_pkt_type_by_priority(struct sk_buff *skb)
+{
+	return false;
+}
+#endif
+
 /**
  * osif_dp_mark_non_critical_pkt() - Identify and mark non-critical packets
  * @skb: skb ptr
@@ -114,6 +147,10 @@ static void osif_dp_mark_critical_pkt(struct sk_buff *skb)
  */
 static void osif_dp_mark_non_critical_pkt(struct sk_buff *skb)
 {
+	/* check if packet type is marked from skb->priority already */
+	if (osif_dp_mark_pkt_type_by_priority(skb))
+		return;
+
 	if (qdf_nbuf_is_icmp_pkt(skb))
 		QDF_NBUF_CB_GET_PACKET_TYPE(skb) =
 				QDF_NBUF_CB_PACKET_TYPE_ICMP;