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

Commit 768608d5 authored by Mohammed Javid's avatar Mohammed Javid Committed by Gerrit - the friendly Code Review server
Browse files

net: Changes to support Shortcut Forward Engine



Shortcut forward Engine (SFE) is a software packet accelerator
which works on packet tuple entires (SFE entry) based on
conntrack information.

net:core has changes to invoke SFE module during packet traversal.
net:netfilter has changes to remove SFE Entries when conntrack is
deleted or expires. Also has changes to avoid tcp window check for
incoming packets.

Change-Id: I1622677e472870f8100c72221d9b1fab7fa768be
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
parent 582df5da
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -769,7 +769,11 @@ struct sk_buff {
	__u8			ipvs_property:1;

	__u8			inner_protocol_type:1;
	__u8			fast_forwarded:1;
	__u8			remcsum_offload:1;

	 /*4 or 6 bit hole */

#ifdef CONFIG_NET_SWITCHDEV
	__u8			offload_fwd_mark:1;
#endif
+2 −0
Original line number Diff line number Diff line
@@ -96,6 +96,8 @@ struct nf_conn {
	/* Extensions */
	struct nf_ct_ext *ext;

	void *sfe_entry;

	/* Storage reserved for other modules, must be the last member */
	union nf_conntrack_proto proto;
};
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ bool nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
			const struct nf_conntrack_tuple *orig,
			const struct nf_conntrack_l3proto *l3proto,
			const struct nf_conntrack_l4proto *l4proto);
extern void (*delete_sfe_entry)(struct nf_conn *ct);

/* Find a connection corresponding to a tuple. */
struct nf_conntrack_tuple_hash *
+12 −1
Original line number Diff line number Diff line
@@ -4326,10 +4326,12 @@ static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
#endif /* CONFIG_NETFILTER_INGRESS */
	return 0;
}

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

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

static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc)
{
	struct packet_type *ptype, *pt_prev;
@@ -4339,6 +4341,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc)
	int ret = NET_RX_DROP;
	__be16 type;
	int (*embms_recv)(struct sk_buff *skb);
	int (*fast_recv)(struct sk_buff *skb);

	net_timestamp_check(!netdev_tstamp_prequeue, skb);

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

skip_classify:
	fast_recv = rcu_dereference(athrs_fast_nat_recv);
	if (fast_recv) {
		if (fast_recv(skb)) {
			ret = NET_RX_SUCCESS;
			goto out;
		}
	}

	if (pfmemalloc && !skb_pfmemalloc_protocol(skb))
		goto drop;

+11 −0
Original line number Diff line number Diff line
@@ -406,11 +406,15 @@ void nf_ct_tmpl_free(struct nf_conn *tmpl)
}
EXPORT_SYMBOL_GPL(nf_ct_tmpl_free);

void (*delete_sfe_entry)(struct nf_conn *ct) __rcu __read_mostly;
EXPORT_SYMBOL(delete_sfe_entry);

static void
destroy_conntrack(struct nf_conntrack *nfct)
{
	struct nf_conn *ct = (struct nf_conn *)nfct;
	const struct nf_conntrack_l4proto *l4proto;
	void (*delete_entry)(struct nf_conn *ct);

	pr_debug("destroy_conntrack(%pK)\n", ct);
	WARN_ON(atomic_read(&nfct->use) != 0);
@@ -419,6 +423,13 @@ destroy_conntrack(struct nf_conntrack *nfct)
		nf_ct_tmpl_free(ct);
		return;
	}

	if (ct->sfe_entry) {
		delete_entry = rcu_dereference(delete_sfe_entry);
		if (delete_entry)
			delete_entry(ct);
	}

	l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct));
	if (l4proto->destroy)
		l4proto->destroy(ct);