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

Commit 891da266 authored by Justin Tee's avatar Justin Tee Committed by Gerrit - the friendly Code Review server
Browse files

net: Kernel changes for Generic Software Bridge(GSB)



Changes are made to let GSB intercept network packets and consume them
when possible. The goal is to bridge the packets directly to backhaul
without letting packet do a round trip through the network stack.

Acked-by: default avatarGajendra Singh <gajendra@qti.qualcomm.com>
Change-Id: Ib364a82e883de7ea642bdd1d85c44eef1f54a086
Signed-off-by: default avatarAman Gupta <amangupt@codeaurora.org>
parent 9628d8d9
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -4348,6 +4348,10 @@ static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
#endif /* CONFIG_NETFILTER_INGRESS */
#endif /* CONFIG_NETFILTER_INGRESS */
	return 0;
	return 0;
}
}

int (*gsb_nw_stack_recv)(struct sk_buff *skb) __rcu __read_mostly;
EXPORT_SYMBOL(gsb_nw_stack_recv);

int (*embms_tm_multicast_recv)(struct sk_buff *skb) __rcu __read_mostly;
int (*embms_tm_multicast_recv)(struct sk_buff *skb) __rcu __read_mostly;
EXPORT_SYMBOL(embms_tm_multicast_recv);
EXPORT_SYMBOL(embms_tm_multicast_recv);


@@ -4363,6 +4367,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc)
	bool deliver_exact = false;
	bool deliver_exact = false;
	int ret = NET_RX_DROP;
	int ret = NET_RX_DROP;
	__be16 type;
	__be16 type;
	int (*gsb_ns_recv)(struct sk_buff *skb);
	int (*embms_recv)(struct sk_buff *skb);
	int (*embms_recv)(struct sk_buff *skb);
	int (*fast_recv)(struct sk_buff *skb, struct packet_type *pt_temp);
	int (*fast_recv)(struct sk_buff *skb, struct packet_type *pt_temp);


@@ -4426,6 +4431,14 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc)
		embms_recv(skb);
		embms_recv(skb);


skip_classify:
skip_classify:
	gsb_ns_recv = rcu_dereference(gsb_nw_stack_recv);
	if (gsb_ns_recv) {
		if (gsb_ns_recv(skb)) {
			ret = NET_RX_SUCCESS;
			goto out;
		}
	}

	fast_recv = rcu_dereference(athrs_fast_nat_recv);
	fast_recv = rcu_dereference(athrs_fast_nat_recv);
	if (fast_recv) {
	if (fast_recv) {
		if (fast_recv(skb, pt_prev)) {
		if (fast_recv(skb, pt_prev)) {