Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a4d2fe1 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

drivers: rmnet_perf: Fix SSR cleanup of structs



When SSR occurs rmnet_mhi0 is torn down and the check perf makes
on the netdev to make sure that rmnet_mhi0 is registered with
rmnet is not valid if rmnet has processed the unregister event
before rmnet_perf.This change adds priority to rmnet_perf so that
it processes events before the main driver.

Previously rmnet_perf was not cleaning up as a result of that and
had a memleak when it would come back up. This fixes it so that perf
cleans up all of the remaining flows in rmnet_perf hashatable.

Change-Id: Ifd10a2ca586c33bf0d4fe479d54a41f8f46b720b
Acked-by: default avatarRaul Martinez <mraul@qti.qualcomm.com>
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent bc79c266
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -125,6 +125,9 @@ rmnet_perf_config_free_resources(struct rmnet_perf *perf)
	 */
	rmnet_perf_core_free_held_skbs();

	/* Clean up any remaining nodes in the flow table before freeing */
	rmnet_perf_free_hash_table();

	/* Since we allocated in one chunk, we will also free in one chunk */
	kfree(perf);

@@ -427,6 +430,7 @@ static int rmnet_perf_config_notify_cb(struct notifier_block *nb,

static struct notifier_block rmnet_perf_dev_notifier __read_mostly = {
	.notifier_call = rmnet_perf_config_notify_cb,
	.priority = 1,
};

int __init rmnet_perf_init(void)
+12 −0
Original line number Diff line number Diff line
@@ -709,6 +709,18 @@ void rmnet_perf_opt_insert_pkt_in_flow(
	if (pkt_info->trans_proto == IPPROTO_TCP)
		flow_node->next_seq += payload_len;
}
void
rmnet_perf_free_hash_table()
{
	int i;
	struct rmnet_perf_opt_flow_node *flow_node;
	struct hlist_node *tmp;

	hash_for_each_safe(rmnet_perf_opt_fht, i, tmp, flow_node, list) {
		hash_del(&flow_node->list);
	}

}

/* rmnet_perf_opt_ingress() - Core business logic of optimization framework
 * @pkt_info: characteristics of the current packet
+1 −0
Original line number Diff line number Diff line
@@ -107,5 +107,6 @@ void rmnet_perf_opt_insert_pkt_in_flow(
			struct rmnet_perf_opt_flow_node *flow_node,
			struct rmnet_perf_pkt_info *pkt_info);
bool rmnet_perf_opt_ingress(struct rmnet_perf_pkt_info *pkt_info);
void rmnet_perf_free_hash_table(void);

#endif /* _RMNET_PERF_OPT_H_ */