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

Commit def8b4fa authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller
Browse files

net: reduce structures when XFRM=n



ifdef out
* struct sk_buff::sp		(pointer)
* struct dst_entry::xfrm	(pointer)
* struct sock::sk_policy	(2 pointers)

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b057efd4
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -269,8 +269,9 @@ struct sk_buff {
		struct  dst_entry	*dst;
		struct  rtable		*rtable;
	};
#ifdef CONFIG_XFRM
	struct	sec_path	*sp;

#endif
	/*
	 * This is the control buffer. It is free to use for every
	 * layer. Please put your private variables there. If you
@@ -1864,6 +1865,18 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu
	to->queue_mapping = from->queue_mapping;
}

#ifdef CONFIG_XFRM
static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
{
	return skb->sp;
}
#else
static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
{
	return NULL;
}
#endif

static inline int skb_is_gso(const struct sk_buff *skb)
{
	return skb_shinfo(skb)->gso_size;
+2 −1
Original line number Diff line number Diff line
@@ -59,8 +59,9 @@ struct dst_entry

	struct neighbour	*neighbour;
	struct hh_cache		*hh;
#ifdef CONFIG_XFRM
	struct xfrm_state	*xfrm;

#endif
	int			(*input)(struct sk_buff*);
	int			(*output)(struct sk_buff*);

+2 −0
Original line number Diff line number Diff line
@@ -229,7 +229,9 @@ struct sock {
	} sk_backlog;
	wait_queue_head_t	*sk_sleep;
	struct dst_entry	*sk_dst_cache;
#ifdef CONFIG_XFRM
	struct xfrm_policy	*sk_policy[2];
#endif
	rwlock_t		sk_dst_lock;
	atomic_t		sk_rmem_alloc;
	atomic_t		sk_wmem_alloc;
+4 −0
Original line number Diff line number Diff line
@@ -882,6 +882,7 @@ struct xfrm_dst
	u32 path_cookie;
};

#ifdef CONFIG_XFRM
static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
{
	dst_release(xdst->route);
@@ -894,6 +895,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
	xdst->partner = NULL;
#endif
}
#endif

extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);

@@ -1536,9 +1538,11 @@ static inline void xfrm_states_delete(struct xfrm_state **states, int n)
}
#endif

#ifdef CONFIG_XFRM
static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb)
{
	return skb->sp->xvec[skb->sp->len - 1];
}
#endif

#endif	/* _NET_XFRM_H */
+1 −1
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
	new->network_header	= old->network_header;
	new->mac_header		= old->mac_header;
	new->dst		= dst_clone(old->dst);
#ifdef CONFIG_INET
#ifdef CONFIG_XFRM
	new->sp			= secpath_get(old->sp);
#endif
	memcpy(new->cb, old->cb, sizeof(old->cb));
Loading