Răsfoiți Sursa

qcacmn: Use same reo hash key for all SOCs in MLO

In case Multi chip MLO configure same hash key for
all SOCs in MLO. This change is needed to avoid
same flow traffic distributed to multiple REOs.

Change-Id: Ib6cde4ae32e58ef2d45c02d640c133458f5bfac5
CRs-Fixed: 3201978
Chaithanya Garrepalli 3 ani în urmă
părinte
comite
8889b96325

+ 13 - 0
dp/wifi3.0/be/dp_be.c

@@ -532,6 +532,12 @@ static void dp_mlo_init_ptnr_list(struct dp_vdev *vdev)
 		    WLAN_MAX_MLO_CHIPS * WLAN_MAX_MLO_LINKS_PER_SOC,
 		    CDP_INVALID_VDEV_ID);
 }
+
+static void dp_get_rx_hash_key_be(struct dp_soc *soc,
+				  struct cdp_lro_hash_config *lro_hash)
+{
+	dp_mlo_get_rx_hash_key(soc, lro_hash);
+}
 #else
 static inline void
 dp_mlo_mcast_init(struct dp_soc *soc, struct dp_vdev *vdev)
@@ -546,6 +552,12 @@ dp_mlo_mcast_deinit(struct dp_soc *soc, struct dp_vdev *vdev)
 static void dp_mlo_init_ptnr_list(struct dp_vdev *vdev)
 {
 }
+
+static void dp_get_rx_hash_key_be(struct dp_soc *soc,
+				  struct cdp_lro_hash_config *lro_hash)
+{
+	dp_get_rx_hash_key_bytes(lro_hash);
+}
 #endif
 
 static QDF_STATUS dp_soc_attach_be(struct dp_soc *soc,
@@ -1834,4 +1846,5 @@ void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops)
 	arch_ops->txrx_print_peer_stats = dp_print_peer_txrx_stats_be;
 	arch_ops->dp_find_peer_by_destmac = dp_find_peer_by_destmac_be;
 	dp_init_near_full_arch_ops_be(arch_ops);
+	arch_ops->get_rx_hash_key = dp_get_rx_hash_key_be;
 }

+ 24 - 0
dp/wifi3.0/be/mlo/dp_mlo.c

@@ -48,6 +48,13 @@ dp_mlo_ctxt_attach_wifi3(struct cdp_ctrl_mlo_mgr *ctrl_ctxt)
 		return NULL;
 	}
 
+	qdf_get_random_bytes(mlo_ctxt->toeplitz_hash_ipv4,
+			     (sizeof(mlo_ctxt->toeplitz_hash_ipv4[0]) *
+			      LRO_IPV4_SEED_ARR_SZ));
+	qdf_get_random_bytes(mlo_ctxt->toeplitz_hash_ipv6,
+			     (sizeof(mlo_ctxt->toeplitz_hash_ipv6[0]) *
+			      LRO_IPV6_SEED_ARR_SZ));
+
 	qdf_spinlock_create(&mlo_ctxt->ml_soc_list_lock);
 	return dp_mlo_ctx_to_cdp(mlo_ctxt);
 }
@@ -516,6 +523,23 @@ dp_link_peer_hash_find_by_chip_id(struct dp_soc *soc,
 
 qdf_export_symbol(dp_link_peer_hash_find_by_chip_id);
 
+void dp_mlo_get_rx_hash_key(struct dp_soc *soc,
+			    struct cdp_lro_hash_config *lro_hash)
+{
+	struct dp_soc_be *be_soc = dp_get_be_soc_from_dp_soc(soc);
+	struct dp_mlo_ctxt *ml_ctxt = be_soc->ml_ctxt;
+
+	if (!be_soc->mlo_enabled || !ml_ctxt)
+		return dp_get_rx_hash_key_bytes(lro_hash);
+
+	qdf_mem_copy(lro_hash->toeplitz_hash_ipv4, ml_ctxt->toeplitz_hash_ipv4,
+		     (sizeof(lro_hash->toeplitz_hash_ipv4[0]) *
+		      LRO_IPV4_SEED_ARR_SZ));
+	qdf_mem_copy(lro_hash->toeplitz_hash_ipv6, ml_ctxt->toeplitz_hash_ipv6,
+		     (sizeof(lro_hash->toeplitz_hash_ipv6[0]) *
+		      LRO_IPV6_SEED_ARR_SZ));
+}
+
 struct dp_soc *
 dp_rx_replensih_soc_get(struct dp_soc *soc, uint8_t reo_ring_num)
 {

+ 10 - 0
dp/wifi3.0/be/mlo/dp_mlo.h

@@ -51,6 +51,8 @@ struct dp_mlo_ctxt {
 	} mld_peer_hash;
 
 	qdf_spinlock_t mld_peer_hash_lock;
+	uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
+	uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
 };
 
 /**
@@ -100,4 +102,12 @@ void dp_pdev_mlo_fill_params(struct dp_pdev *pdev,
 struct dp_soc*
 dp_mlo_get_soc_ref_by_chip_id(struct dp_mlo_ctxt *ml_ctxt, uint8_t chip_id);
 
+/**
+ * dp_mlo_get_rx_hash_key() - Get Rx hash key from MLO context
+ * @soc: DP SOC
+ * @lro_hash: Hash params
+ *
+ */
+void dp_mlo_get_rx_hash_key(struct dp_soc *soc,
+			    struct cdp_lro_hash_config *lro_hash);
 #endif /* __DP_MLO_H */

+ 11 - 0
dp/wifi3.0/dp_internal.h

@@ -3560,4 +3560,15 @@ static inline void dp_pdev_clear_tx_delay_stats(struct dp_soc *soc)
 {
 }
 #endif
+
+static inline void
+dp_get_rx_hash_key_bytes(struct cdp_lro_hash_config *lro_hash)
+{
+	qdf_get_random_bytes(lro_hash->toeplitz_hash_ipv4,
+			     (sizeof(lro_hash->toeplitz_hash_ipv4[0]) *
+			      LRO_IPV4_SEED_ARR_SZ));
+	qdf_get_random_bytes(lro_hash->toeplitz_hash_ipv6,
+			     (sizeof(lro_hash->toeplitz_hash_ipv6[0]) *
+			      LRO_IPV6_SEED_ARR_SZ));
+}
 #endif /* #ifndef _DP_INTERNAL_H_ */

+ 1 - 6
dp/wifi3.0/dp_main.c

@@ -4759,12 +4759,7 @@ static QDF_STATUS dp_lro_hash_setup(struct dp_soc *soc, struct dp_pdev *pdev)
 			 QDF_TCPHDR_ECE | QDF_TCPHDR_CWR;
 	}
 
-	qdf_get_random_bytes(lro_hash.toeplitz_hash_ipv4,
-			     (sizeof(lro_hash.toeplitz_hash_ipv4[0]) *
-			      LRO_IPV4_SEED_ARR_SZ));
-	qdf_get_random_bytes(lro_hash.toeplitz_hash_ipv6,
-			     (sizeof(lro_hash.toeplitz_hash_ipv6[0]) *
-			      LRO_IPV6_SEED_ARR_SZ));
+	soc->arch_ops.get_rx_hash_key(soc, &lro_hash);
 
 	qdf_assert(soc->cdp_soc.ol_ops->lro_hash_config);
 

+ 2 - 0
dp/wifi3.0/dp_types.h

@@ -1811,6 +1811,8 @@ struct dp_arch_ops {
 						   enum dp_mod_id mod_id,
 						   uint8_t vdev_id);
 #endif
+	void (*get_rx_hash_key)(struct dp_soc *soc,
+				struct cdp_lro_hash_config *lro_hash);
 	void (*txrx_print_peer_stats)(struct cdp_peer_stats *peer_stats,
 				      enum peer_stats_type stats_type);
 	/* Dp peer reorder queue setup */

+ 7 - 0
dp/wifi3.0/li/dp_li.c

@@ -569,6 +569,12 @@ static struct dp_peer *dp_find_peer_by_destmac_li(struct dp_soc *soc,
 	return peer;
 }
 
+static void dp_get_rx_hash_key_li(struct dp_soc *soc,
+				  struct cdp_lro_hash_config *lro_hash)
+{
+	dp_get_rx_hash_key_bytes(lro_hash);
+}
+
 void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops)
 {
 #ifndef QCA_HOST_MODE_WIFI_DISABLED
@@ -604,6 +610,7 @@ void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops)
 	arch_ops->txrx_vdev_detach = dp_vdev_detach_li;
 	arch_ops->txrx_peer_map_attach = dp_peer_map_attach_li;
 	arch_ops->txrx_peer_map_detach = dp_peer_map_detach_li;
+	arch_ops->get_rx_hash_key = dp_get_rx_hash_key_li;
 	arch_ops->dp_rx_desc_cookie_2_va =
 			dp_rx_desc_cookie_2_va_li;
 	arch_ops->dp_rx_intrabss_handle_nawds = dp_rx_intrabss_handle_nawds_li;