Skip to content

Commit 09c7570

Browse files
Florian Westphaldavem330
authored andcommitted
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: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bd45c53 commit 09c7570

File tree

13 files changed

+2
-734
lines changed

13 files changed

+2
-734
lines changed

include/net/flow.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -218,40 +218,6 @@ static inline unsigned int flow_key_size(u16 family)
218218
return 0;
219219
}
220220

221-
#define FLOW_DIR_IN 0
222-
#define FLOW_DIR_OUT 1
223-
#define FLOW_DIR_FWD 2
224-
225-
struct net;
226-
struct sock;
227-
struct flow_cache_ops;
228-
229-
struct flow_cache_object {
230-
const struct flow_cache_ops *ops;
231-
};
232-
233-
struct flow_cache_ops {
234-
struct flow_cache_object *(*get)(struct flow_cache_object *);
235-
int (*check)(struct flow_cache_object *);
236-
void (*delete)(struct flow_cache_object *);
237-
};
238-
239-
typedef struct flow_cache_object *(*flow_resolve_t)(
240-
struct net *net, const struct flowi *key, u16 family,
241-
u8 dir, struct flow_cache_object *oldobj, void *ctx);
242-
243-
struct flow_cache_object *flow_cache_lookup(struct net *net,
244-
const struct flowi *key, u16 family,
245-
u8 dir, flow_resolve_t resolver,
246-
void *ctx);
247-
int flow_cache_init(struct net *net);
248-
void flow_cache_fini(struct net *net);
249-
void flow_cache_hp_init(void);
250-
251-
void flow_cache_flush(struct net *net);
252-
void flow_cache_flush_deferred(struct net *net);
253-
extern atomic_t flow_cache_genid;
254-
255221
__u32 __get_hash_from_flowi6(const struct flowi6 *fl6, struct flow_keys *keys);
256222

257223
static inline __u32 get_hash_from_flowi6(const struct flowi6 *fl6)

include/net/flowcache.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

include/net/netns/xfrm.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <linux/workqueue.h>
77
#include <linux/xfrm.h>
88
#include <net/dst_ops.h>
9-
#include <net/flowcache.h>
109

1110
struct ctl_table_header;
1211

@@ -73,16 +72,6 @@ struct netns_xfrm {
7372
spinlock_t xfrm_state_lock;
7473
spinlock_t xfrm_policy_lock;
7574
struct mutex xfrm_cfg_mutex;
76-
77-
/* flow cache part */
78-
struct flow_cache flow_cache_global;
79-
atomic_t flow_cache_genid;
80-
struct list_head flow_cache_gc_list;
81-
atomic_t flow_cache_gc_count;
82-
spinlock_t flow_cache_gc_lock;
83-
struct work_struct flow_cache_gc_work;
84-
struct work_struct flow_cache_flush_work;
85-
struct mutex flow_flush_sem;
8675
};
8776

8877
#endif

include/net/xfrm.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ struct xfrm_policy {
563563
refcount_t refcnt;
564564
struct timer_list timer;
565565

566-
struct flow_cache_object flo;
567566
atomic_t genid;
568567
u32 priority;
569568
u32 index;
@@ -978,7 +977,6 @@ struct xfrm_dst {
978977
struct rt6_info rt6;
979978
} u;
980979
struct dst_entry *route;
981-
struct flow_cache_object flo;
982980
struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
983981
int num_pols, num_xfrms;
984982
u32 xfrm_genid;
@@ -1226,9 +1224,6 @@ static inline void xfrm_sk_free_policy(struct sock *sk)
12261224
}
12271225
}
12281226

1229-
void xfrm_garbage_collect(struct net *net);
1230-
void xfrm_garbage_collect_deferred(struct net *net);
1231-
12321227
#else
12331228

12341229
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,
12631258
{
12641259
return 1;
12651260
}
1266-
static inline void xfrm_garbage_collect(struct net *net)
1267-
{
1268-
}
12691261
#endif
12701262

12711263
static __inline__

net/core/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
1111
neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
1212
sock_diag.o dev_ioctl.o tso.o sock_reuseport.o
1313

14-
obj-$(CONFIG_XFRM) += flow.o
1514
obj-y += net-sysfs.o
1615
obj-$(CONFIG_PROC_FS) += net-procfs.o
1716
obj-$(CONFIG_NET_PKTGEN) += pktgen.o

0 commit comments

Comments
 (0)