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

Commit 09c75704 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller
Browse files

xfrm: remove flow cache



After rcu conversions performance degradation in forward tests isn't that
noticeable anymore.

See next patch for some numbers.

A followup patcg could then also remove genid from the policies
as we do not cache bundles anymore.

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bd45c539
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -218,40 +218,6 @@ static inline unsigned int flow_key_size(u16 family)
	return 0;
}

#define FLOW_DIR_IN	0
#define FLOW_DIR_OUT	1
#define FLOW_DIR_FWD	2

struct net;
struct sock;
struct flow_cache_ops;

struct flow_cache_object {
	const struct flow_cache_ops *ops;
};

struct flow_cache_ops {
	struct flow_cache_object *(*get)(struct flow_cache_object *);
	int (*check)(struct flow_cache_object *);
	void (*delete)(struct flow_cache_object *);
};

typedef struct flow_cache_object *(*flow_resolve_t)(
		struct net *net, const struct flowi *key, u16 family,
		u8 dir, struct flow_cache_object *oldobj, void *ctx);

struct flow_cache_object *flow_cache_lookup(struct net *net,
					    const struct flowi *key, u16 family,
					    u8 dir, flow_resolve_t resolver,
					    void *ctx);
int flow_cache_init(struct net *net);
void flow_cache_fini(struct net *net);
void flow_cache_hp_init(void);

void flow_cache_flush(struct net *net);
void flow_cache_flush_deferred(struct net *net);
extern atomic_t flow_cache_genid;

__u32 __get_hash_from_flowi6(const struct flowi6 *fl6, struct flow_keys *keys);

static inline __u32 get_hash_from_flowi6(const struct flowi6 *fl6)

include/net/flowcache.h

deleted100644 → 0
+0 −25
Original line number Diff line number Diff line
#ifndef _NET_FLOWCACHE_H
#define _NET_FLOWCACHE_H

#include <linux/interrupt.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/notifier.h>

struct flow_cache_percpu {
	struct hlist_head		*hash_table;
	unsigned int			hash_count;
	u32				hash_rnd;
	int				hash_rnd_recalc;
	struct tasklet_struct		flush_tasklet;
};

struct flow_cache {
	u32				hash_shift;
	struct flow_cache_percpu __percpu *percpu;
	struct hlist_node		node;
	unsigned int			low_watermark;
	unsigned int			high_watermark;
	struct timer_list		rnd_timer;
};
#endif	/* _NET_FLOWCACHE_H */
+0 −11
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
#include <linux/workqueue.h>
#include <linux/xfrm.h>
#include <net/dst_ops.h>
#include <net/flowcache.h>

struct ctl_table_header;

@@ -73,16 +72,6 @@ struct netns_xfrm {
	spinlock_t xfrm_state_lock;
	spinlock_t xfrm_policy_lock;
	struct mutex xfrm_cfg_mutex;

	/* flow cache part */
	struct flow_cache	flow_cache_global;
	atomic_t		flow_cache_genid;
	struct list_head	flow_cache_gc_list;
	atomic_t		flow_cache_gc_count;
	spinlock_t		flow_cache_gc_lock;
	struct work_struct	flow_cache_gc_work;
	struct work_struct	flow_cache_flush_work;
	struct mutex		flow_flush_sem;
};

#endif
+0 −8
Original line number Diff line number Diff line
@@ -563,7 +563,6 @@ struct xfrm_policy {
	refcount_t		refcnt;
	struct timer_list	timer;

	struct flow_cache_object flo;
	atomic_t		genid;
	u32			priority;
	u32			index;
@@ -978,7 +977,6 @@ struct xfrm_dst {
		struct rt6_info		rt6;
	} u;
	struct dst_entry *route;
	struct flow_cache_object flo;
	struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
	int num_pols, num_xfrms;
	u32 xfrm_genid;
@@ -1226,9 +1224,6 @@ static inline void xfrm_sk_free_policy(struct sock *sk)
	}
}

void xfrm_garbage_collect(struct net *net);
void xfrm_garbage_collect_deferred(struct net *net);

#else

static inline void xfrm_sk_free_policy(struct sock *sk) {}
@@ -1263,9 +1258,6 @@ static inline int xfrm6_policy_check_reverse(struct sock *sk, int dir,
{
	return 1;
}
static inline void xfrm_garbage_collect(struct net *net)
{
}
#endif

static __inline__
+0 −1
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
			neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
			sock_diag.o dev_ioctl.o tso.o sock_reuseport.o

obj-$(CONFIG_XFRM) += flow.o
obj-y += net-sysfs.o
obj-$(CONFIG_PROC_FS) += net-procfs.o
obj-$(CONFIG_NET_PKTGEN) += pktgen.o
Loading