Browse Source

core: Add new hooks

Add new ingress and egress hooks to be used by rmnet modules.

CRs-Fixed: 3012130
Change-Id: I934a3933d4ea89ba1c4f5ef2f2589baf66c2d225
Signed-off-by: Subash Abhinov Kasiviswanathan <[email protected]>
Subash Abhinov Kasiviswanathan 3 years ago
parent
commit
63d665bf04
2 changed files with 12 additions and 3 deletions
  1. 1 1
      core/rmnet_handlers.c
  2. 11 2
      core/rmnet_vnd.c

+ 1 - 1
core/rmnet_handlers.c

@@ -1,4 +1,5 @@
 /* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -114,7 +115,6 @@ rmnet_deliver_skb(struct sk_buff *skb, struct rmnet_port *port)
 
 	trace_rmnet_low(RMNET_MODULE, RMNET_DLVR_SKB, 0xDEF, 0xDEF,
 			0xDEF, 0xDEF, (void *)skb, NULL);
-	skb_reset_transport_header(skb);
 	skb_reset_network_header(skb);
 	rmnet_vnd_rx_fixup(skb->dev, skb->len);
 

+ 11 - 2
core/rmnet_vnd.c

@@ -1,5 +1,5 @@
 /* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -39,10 +39,13 @@
 #include "rmnet_trace.h"
 
 typedef void (*rmnet_perf_tether_egress_hook_t)(struct sk_buff *skb);
-
 rmnet_perf_tether_egress_hook_t rmnet_perf_tether_egress_hook __rcu __read_mostly;
 EXPORT_SYMBOL(rmnet_perf_tether_egress_hook);
 
+typedef void (*rmnet_perf_egress_hook1_t)(struct sk_buff *skb);
+rmnet_perf_egress_hook1_t rmnet_perf_egress_hook1 __rcu __read_mostly;
+EXPORT_SYMBOL(rmnet_perf_egress_hook1);
+
 /* RX/TX Fixup */
 
 void rmnet_vnd_rx_fixup(struct net_device *dev, u32 skb_len)
@@ -262,6 +265,12 @@ static u16 rmnet_vnd_select_queue(struct net_device *dev,
 	u64 boost_period = 0;
 	int boost_trigger = 0;
 	int txq = 0;
+	rmnet_perf_egress_hook1_t rmnet_perf_egress1;
+
+	rmnet_perf_egress1 = rcu_dereference(rmnet_perf_egress_hook1);
+	if (rmnet_perf_egress1) {
+		rmnet_perf_egress1(skb);
+	}
 
 	if (trace_print_icmp_tx_enabled()) {
 		char saddr[INET6_ADDRSTRLEN], daddr[INET6_ADDRSTRLEN];