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

Commit 4589189d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: Changes to support Shortcut Forward Engine"

parents d6e5b2d8 9c84341c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -738,7 +738,11 @@ struct sk_buff {
#endif
	__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
@@ -120,6 +120,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
@@ -50,6 +50,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 −0
Original line number Diff line number Diff line
@@ -4103,6 +4103,9 @@ static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
	return 0;
}

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;
@@ -4111,6 +4114,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc)
	bool deliver_exact = false;
	int ret = NET_RX_DROP;
	__be16 type;
	int (*fast_recv)(struct sk_buff *skb);

	net_timestamp_check(!netdev_tstamp_prequeue, skb);

@@ -4170,6 +4174,14 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc)
			goto out;
	}
#endif
	fast_recv = rcu_dereference(athrs_fast_nat_recv);
	if (fast_recv) {
		if (fast_recv(skb)) {
			ret = NET_RX_SUCCESS;
			goto out;
		}
	}

#ifdef CONFIG_NET_CLS_ACT
	skb->tc_verd = 0;
ncls:
+15 −0
Original line number Diff line number Diff line
@@ -381,11 +381,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;
	struct nf_conntrack_l4proto *l4proto;
	void (*delete_entry)(struct nf_conn *ct);

	pr_debug("destroy_conntrack(%pK)\n", ct);
	NF_CT_ASSERT(atomic_read(&nfct->use) == 0);
@@ -394,6 +398,17 @@ 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);
	}

	/* To make sure we don't get any weird locking issues here:
	 * destroy_conntrack() MUST NOT be called with a write lock
	 * to nf_conntrack_lock!!! -HW
	 */
	rcu_read_lock();
	l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct));
	if (l4proto->destroy)