Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236612
b: refs/heads/master
c: 6e67e58
h: refs/heads/master
v: v3
  • Loading branch information
Hans Schillstrom authored and Simon Horman committed Jan 13, 2011
1 parent a0f6363 commit dc41a39
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 84 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b17fc9963f837ef1acfe36e193108fb16ed58647
refs/heads/master: 6e67e586e7289c144d5a189d6e0fa7141d025746
53 changes: 42 additions & 11 deletions trunk/include/net/ip_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ extern struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net,
unsigned short proto);

struct ip_vs_conn_param {
struct net *net;
const union nf_inet_addr *caddr;
const union nf_inet_addr *vaddr;
__be16 cport;
Expand All @@ -494,17 +495,19 @@ struct ip_vs_conn_param {
*/
struct ip_vs_conn {
struct list_head c_list; /* hashed list heads */

#ifdef CONFIG_NET_NS
struct net *net; /* Name space */
#endif
/* Protocol, addresses and port numbers */
u16 af; /* address family */
union nf_inet_addr caddr; /* client address */
union nf_inet_addr vaddr; /* virtual address */
union nf_inet_addr daddr; /* destination address */
volatile __u32 flags; /* status flags */
__u32 fwmark; /* Fire wall mark from skb */
__be16 cport;
__be16 vport;
__be16 dport;
u16 af; /* address family */
__be16 cport;
__be16 vport;
__be16 dport;
__u32 fwmark; /* Fire wall mark from skb */
union nf_inet_addr caddr; /* client address */
union nf_inet_addr vaddr; /* virtual address */
union nf_inet_addr daddr; /* destination address */
volatile __u32 flags; /* status flags */
__u16 protocol; /* Which protocol (TCP/UDP) */

/* counter and timer */
Expand Down Expand Up @@ -547,6 +550,33 @@ struct ip_vs_conn {
__u8 pe_data_len;
};

/*
* To save some memory in conn table when name space is disabled.
*/
static inline struct net *ip_vs_conn_net(const struct ip_vs_conn *cp)
{
#ifdef CONFIG_NET_NS
return cp->net;
#else
return &init_net;
#endif
}
static inline void ip_vs_conn_net_set(struct ip_vs_conn *cp, struct net *net)
{
#ifdef CONFIG_NET_NS
cp->net = net;
#endif
}

static inline int ip_vs_conn_net_eq(const struct ip_vs_conn *cp,
struct net *net)
{
#ifdef CONFIG_NET_NS
return cp->net == net;
#else
return 1;
#endif
}

/*
* Extended internal versions of struct ip_vs_service_user and
Expand Down Expand Up @@ -796,13 +826,14 @@ enum {
IP_VS_DIR_LAST,
};

static inline void ip_vs_conn_fill_param(int af, int protocol,
static inline void ip_vs_conn_fill_param(struct net *net, int af, int protocol,
const union nf_inet_addr *caddr,
__be16 cport,
const union nf_inet_addr *vaddr,
__be16 vport,
struct ip_vs_conn_param *p)
{
p->net = net;
p->af = af;
p->protocol = protocol;
p->caddr = caddr;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/net/netns/ip_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ struct netns_ipvs {
struct ip_vs_cpu_stats __percpu *cpustats; /* Stats per cpu */
seqcount_t *ustats_seq; /* u64 read retry */

/* ip_vs_conn */
atomic_t conn_count; /* connection counter */
/* ip_vs_lblc */
int sysctl_lblc_expiration;
struct ctl_table_header *lblc_ctl_header;
Expand Down
Loading

0 comments on commit dc41a39

Please sign in to comment.