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

Commit 5b72559c 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 4fc723f7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -811,6 +811,10 @@ struct sk_buff {

	__u8			ipvs_property:1;
	__u8			inner_protocol_type:1;

#ifdef CONFIG_ENABLE_SFE
	__u8			fast_forwarded:1;
#endif
	__u8			remcsum_offload:1;
#ifdef CONFIG_NET_SWITCHDEV
	__u8			offload_fwd_mark:1;
+4 −0
Original line number Diff line number Diff line
@@ -112,6 +112,10 @@ struct nf_conn {
	unsigned long nattype_entry;
#endif

#ifdef CONFIG_ENABLE_SFE
	void *sfe_entry;
#endif

	/* Storage reserved for other modules, must be the last member */
	union nf_conntrack_proto proto;
};
+6 −0
Original line number Diff line number Diff line
@@ -43,11 +43,17 @@ void nf_conntrack_cleanup_end(void);

bool nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
			const struct nf_conntrack_tuple *orig);

extern bool (*nattype_refresh_timer)
			(unsigned long nattype,
			unsigned long timeout_value)
			__rcu __read_mostly;


#ifdef CONFIG_ENABLE_SFE
extern void (*delete_sfe_entry)(struct nf_conn *ct);
#endif

/* Find a connection corresponding to a tuple. */
struct nf_conntrack_tuple_hash *
nf_conntrack_find_get(struct net *net,
+18 −0
Original line number Diff line number Diff line
@@ -4730,6 +4730,11 @@ void process_embms_receive_skb(struct sk_buff *skb)
		embms_recv(skb);
}

#ifdef CONFIG_ENABLE_SFE
int (*athrs_fast_nat_recv)(struct sk_buff *skb) __rcu __read_mostly;
EXPORT_SYMBOL(athrs_fast_nat_recv);
#endif

static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
				    struct packet_type **ppt_prev)
{
@@ -4740,6 +4745,9 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
	bool deliver_exact = false;
	int ret = NET_RX_DROP;
	__be16 type;
#ifdef CONFIG_ENABLE_SFE
	int (*fast_recv)(struct sk_buff *skb);
#endif

	net_timestamp_check(!netdev_tstamp_prequeue, skb);

@@ -4813,6 +4821,16 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
	process_embms_receive_skb(skb);

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

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

+16 −0
Original line number Diff line number Diff line
@@ -598,10 +598,18 @@ static void destroy_gre_conntrack(struct nf_conn *ct)
#endif
}

#ifdef CONFIG_ENABLE_SFE
void (*delete_sfe_entry)(struct nf_conn *ct) __rcu __read_mostly;
EXPORT_SYMBOL(delete_sfe_entry);
#endif

static void
destroy_conntrack(struct nf_conntrack *nfct)
{
	struct nf_conn *ct = (struct nf_conn *)nfct;
#ifdef CONFIG_ENABLE_SFE
	void (*delete_entry)(struct nf_conn *ct);
#endif

	pr_debug("destroy_conntrack(%p)\n", ct);
	WARN_ON(atomic_read(&nfct->use) != 0);
@@ -614,6 +622,14 @@ destroy_conntrack(struct nf_conntrack *nfct)
	if (unlikely(nf_ct_protonum(ct) == IPPROTO_GRE))
		destroy_gre_conntrack(ct);

#ifdef CONFIG_ENABLE_SFE
	if (ct->sfe_entry) {
		delete_entry = rcu_dereference(delete_sfe_entry);
		if (delete_entry)
			delete_entry(ct);
	}
#endif

	local_bh_disable();
	/* Expectations will have been removed in clean_from_lists,
	 * except TFTP can create an expectation on the first packet,