Skip to content

Commit

Permalink
xfrm: remove flow cache
Browse files Browse the repository at this point in the history
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: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Jul 18, 2017
1 parent bd45c53 commit 09c7570
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 734 deletions.
34 changes: 0 additions & 34 deletions include/net/flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 0 additions & 25 deletions include/net/flowcache.h

This file was deleted.

11 changes: 0 additions & 11 deletions include/net/netns/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
8 changes: 0 additions & 8 deletions include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {}
Expand Down Expand Up @@ -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__
Expand Down
1 change: 0 additions & 1 deletion net/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 09c7570

Please sign in to comment.