* Re: [PATCH 3/7 net-2.6.25] [IPV4]: Prohibit assignment of 0.0.0.0 as interface address.
From: Daniel Lezcano @ 2008-01-25 14:01 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: davem, netdev, devel, containers
In-Reply-To: <1201269123-20378-3-git-send-email-den@openvz.org>
Denis V. Lunev wrote:
> I could hardly imagine why sombady needs to assign 0.0.0.0 as an interface
> address or interface destination address. The kernel will behave in a strage
> way in several places if this is possible, as ifa_local != 0 is considered
> as initialized/non-initialized state of the ifa.
AFAICS, we should be able to set at an interface address to 0.0.0.0, in
order to remove an IP address from an interface and keep this one up.
I see two trivial cases:
* remove the ipv4 on an interface but continue to use it through ipv6
* move ipv4 address from the interface to an attached bridge
^ permalink raw reply
* [PATCH net-2.6.25] [XFRM]: Speed up xfrm_policy and xfrm_state walking
From: Timo Teräs @ 2008-01-25 14:10 UTC (permalink / raw)
To: netdev
Change xfrm_policy and xfrm_state walking algorithm from O(n^2) to O(n).
This is achieved adding the entries to one more list which is used
solely for walking the entries.
This also fixes some races where the dump can have duplicate or missing
entries when the SPD/SADB is modified during an ongoing dump.
Dumping SADB with 20000 entries using "time ip xfrm state" the sys
time dropped from 1.012s to 0.080s.
Signed-off-by: Timo Teras <timo.teras@iki.fi>
---
include/linux/xfrm.h | 3 +-
include/net/xfrm.h | 52 ++++++++++++++++++++++++++++++-
net/key/af_key.c | 22 +++++++++++--
net/xfrm/xfrm_policy.c | 79 ++++++++++++++++++++++++++++--------------------
net/xfrm/xfrm_state.c | 53 ++++++++++++++++++++++----------
net/xfrm/xfrm_user.c | 71 ++++++++++++++++++++++++++-----------------
6 files changed, 195 insertions(+), 85 deletions(-)
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 9b5b00c..60e7395 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -106,7 +106,8 @@ enum
{
XFRM_POLICY_TYPE_MAIN = 0,
XFRM_POLICY_TYPE_SUB = 1,
- XFRM_POLICY_TYPE_MAX = 2
+ XFRM_POLICY_TYPE_MAX = 2,
+ XFRM_POLICY_TYPE_ANY = 255
};
enum
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 5ebb9ba..a6a6adf 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -121,6 +121,7 @@ extern struct mutex xfrm_cfg_mutex;
struct xfrm_state
{
/* Note: bydst is re-used during gc */
+ struct list_head all;
struct hlist_node bydst;
struct hlist_node bysrc;
struct hlist_node byspi;
@@ -423,6 +424,7 @@ struct xfrm_tmpl
struct xfrm_policy
{
struct xfrm_policy *next;
+ struct list_head bytype;
struct hlist_node bydst;
struct hlist_node byidx;
@@ -1151,6 +1153,18 @@ struct xfrm6_tunnel {
int priority;
};
+struct xfrm_state_walk {
+ u8 proto;
+ struct xfrm_state *state;
+ int count;
+};
+
+struct xfrm_policy_walk {
+ u8 type, cur_type;
+ struct xfrm_policy *policy;
+ int count;
+};
+
extern void xfrm_init(void);
extern void xfrm4_init(void);
extern void xfrm_state_init(void);
@@ -1175,7 +1189,23 @@ static inline void xfrm6_fini(void)
extern int xfrm_proc_init(void);
#endif
-extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *);
+static inline void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto)
+{
+ walk->proto = proto;
+ walk->state = NULL;
+ walk->count = 0;
+}
+
+static inline void xfrm_state_walk_done(struct xfrm_state_walk *walk)
+{
+ if (walk->state != NULL) {
+ xfrm_state_put(walk->state);
+ walk->state = NULL;
+ }
+}
+
+extern int xfrm_state_walk(struct xfrm_state_walk *walk,
+ int (*func)(struct xfrm_state *, int, void*), void *);
extern struct xfrm_state *xfrm_state_alloc(void);
extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
struct flowi *fl, struct xfrm_tmpl *tmpl,
@@ -1297,7 +1327,25 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
#endif
struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp);
-extern int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int, void*), void *);
+
+static inline void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type)
+{
+ walk->cur_type = XFRM_POLICY_TYPE_MAIN;
+ walk->type = type;
+ walk->policy = NULL;
+ walk->count = 0;
+}
+
+static inline void xfrm_policy_walk_done(struct xfrm_policy_walk *walk)
+{
+ if (walk->policy != NULL) {
+ xfrm_pol_put(walk->policy);
+ walk->policy = NULL;
+ }
+}
+
+extern int xfrm_policy_walk(struct xfrm_policy_walk *walk,
+ int (*func)(struct xfrm_policy *, int, int, void*), void *);
int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
struct xfrm_selector *sel,
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 16b72b5..d24bb9c 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1742,12 +1742,18 @@ static int pfkey_dump(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr
{
u8 proto;
struct pfkey_dump_data data = { .skb = skb, .hdr = hdr, .sk = sk };
+ struct xfrm_state_walk walk;
+ int rc;
proto = pfkey_satype2proto(hdr->sadb_msg_satype);
if (proto == 0)
return -EINVAL;
- return xfrm_state_walk(proto, dump_sa, &data);
+ xfrm_state_walk_init(&walk, proto);
+ rc = xfrm_state_walk(&walk, dump_sa, &data);
+ xfrm_state_walk_done(&walk);
+
+ return rc;
}
static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs)
@@ -1780,6 +1786,7 @@ static int check_reqid(struct xfrm_policy *xp, int dir, int count, void *ptr)
static u32 gen_reqid(void)
{
+ struct xfrm_policy_walk walk;
u32 start;
static u32 reqid = IPSEC_MANUAL_REQID_MAX;
@@ -1788,9 +1795,10 @@ static u32 gen_reqid(void)
++reqid;
if (reqid == 0)
reqid = IPSEC_MANUAL_REQID_MAX+1;
- if (xfrm_policy_walk(XFRM_POLICY_TYPE_MAIN, check_reqid,
- (void*)&reqid) != -EEXIST)
+ xfrm_policy_walk_init(&walk, XFRM_POLICY_TYPE_MAIN);
+ if (xfrm_policy_walk(&walk, check_reqid, (void*)&reqid) != -EEXIST)
return reqid;
+ xfrm_policy_walk_done(&walk);
} while (reqid != start);
return 0;
}
@@ -2664,8 +2672,14 @@ static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr)
static int pfkey_spddump(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs)
{
struct pfkey_dump_data data = { .skb = skb, .hdr = hdr, .sk = sk };
+ struct xfrm_policy_walk walk;
+ int rc;
+
+ xfrm_policy_walk_init(&walk, XFRM_POLICY_TYPE_MAIN);
+ rc = xfrm_policy_walk(&walk, dump_sp, &data);
+ xfrm_policy_walk_done(&walk);
- return xfrm_policy_walk(XFRM_POLICY_TYPE_MAIN, dump_sp, &data);
+ return rc;
}
static int key_notify_policy_flush(struct km_event *c)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 47219f9..0966bd9 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -46,6 +46,7 @@ EXPORT_SYMBOL(xfrm_cfg_mutex);
static DEFINE_RWLOCK(xfrm_policy_lock);
+static struct list_head xfrm_policy_bytype[XFRM_POLICY_TYPE_MAX];
unsigned int xfrm_policy_count[XFRM_POLICY_MAX*2];
EXPORT_SYMBOL(xfrm_policy_count);
@@ -208,6 +209,7 @@ struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp)
policy = kzalloc(sizeof(struct xfrm_policy), gfp);
if (policy) {
+ INIT_LIST_HEAD(&policy->bytype);
INIT_HLIST_NODE(&policy->bydst);
INIT_HLIST_NODE(&policy->byidx);
rwlock_init(&policy->lock);
@@ -230,6 +232,10 @@ void xfrm_policy_destroy(struct xfrm_policy *policy)
if (del_timer(&policy->timer))
BUG();
+ write_lock_bh(&xfrm_policy_lock);
+ list_del(&policy->bytype);
+ write_unlock_bh(&xfrm_policy_lock);
+
security_xfrm_policy_free(policy);
kfree(policy);
}
@@ -568,6 +574,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
policy->curlft.use_time = 0;
if (!mod_timer(&policy->timer, jiffies + HZ))
xfrm_pol_hold(policy);
+ list_add_tail(&policy->bytype, &xfrm_policy_bytype[policy->type]);
write_unlock_bh(&xfrm_policy_lock);
if (delpol)
@@ -806,57 +813,60 @@ out:
}
EXPORT_SYMBOL(xfrm_policy_flush);
-int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int, void*),
+int xfrm_policy_walk(struct xfrm_policy_walk *walk,
+ int (*func)(struct xfrm_policy *, int, int, void*),
void *data)
{
- struct xfrm_policy *pol, *last = NULL;
- struct hlist_node *entry;
- int dir, last_dir = 0, count, error;
+ struct xfrm_policy *old, *pol, *last = NULL;
+ int error = 0;
+
+ if (walk->type >= XFRM_POLICY_TYPE_MAX &&
+ walk->type != XFRM_POLICY_TYPE_ANY)
+ return -EINVAL;
+ if (walk->policy == NULL && walk->count != 0)
+ return 0;
+
+ old = pol = walk->policy;
+ walk->policy = NULL;
read_lock_bh(&xfrm_policy_lock);
- count = 0;
- for (dir = 0; dir < 2*XFRM_POLICY_MAX; dir++) {
- struct hlist_head *table = xfrm_policy_bydst[dir].table;
- int i;
+ for (; walk->cur_type < XFRM_POLICY_TYPE_MAX; walk->cur_type++) {
+ if (walk->type != walk->cur_type &&
+ walk->type != XFRM_POLICY_TYPE_ANY)
+ continue;
- hlist_for_each_entry(pol, entry,
- &xfrm_policy_inexact[dir], bydst) {
- if (pol->type != type)
+ if (pol == NULL) {
+ pol = list_first_entry(&xfrm_policy_bytype[walk->cur_type],
+ struct xfrm_policy, bytype);
+ }
+ list_for_each_entry_from(pol, &xfrm_policy_bytype[walk->cur_type], bytype) {
+ if (pol->dead)
continue;
if (last) {
- error = func(last, last_dir % XFRM_POLICY_MAX,
- count, data);
- if (error)
+ error = func(last, xfrm_policy_id2dir(last->index),
+ walk->count, data);
+ if (error) {
+ xfrm_pol_hold(last);
+ walk->policy = last;
goto out;
- }
- last = pol;
- last_dir = dir;
- count++;
- }
- for (i = xfrm_policy_bydst[dir].hmask; i >= 0; i--) {
- hlist_for_each_entry(pol, entry, table + i, bydst) {
- if (pol->type != type)
- continue;
- if (last) {
- error = func(last, last_dir % XFRM_POLICY_MAX,
- count, data);
- if (error)
- goto out;
}
- last = pol;
- last_dir = dir;
- count++;
}
+ last = pol;
+ walk->count++;
}
+ pol = NULL;
}
- if (count == 0) {
+ if (walk->count == 0) {
error = -ENOENT;
goto out;
}
- error = func(last, last_dir % XFRM_POLICY_MAX, 0, data);
+ if (last)
+ error = func(last, xfrm_policy_id2dir(last->index), 0, data);
out:
read_unlock_bh(&xfrm_policy_lock);
+ if (old != NULL)
+ xfrm_pol_put(old);
return error;
}
EXPORT_SYMBOL(xfrm_policy_walk);
@@ -2349,6 +2359,9 @@ static void __init xfrm_policy_init(void)
panic("XFRM: failed to allocate bydst hash\n");
}
+ for (dir = 0; dir < XFRM_POLICY_TYPE_MAX; dir++)
+ INIT_LIST_HEAD(&xfrm_policy_bytype[dir]);
+
INIT_WORK(&xfrm_policy_gc_work, xfrm_policy_gc_task);
register_netdevice_notifier(&xfrm_dev_notifier);
}
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 3003503..e0a1533 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -50,6 +50,7 @@ static DEFINE_SPINLOCK(xfrm_state_lock);
* Main use is finding SA after policy selected tunnel or transport mode.
* Also, it can be used by ah/esp icmp error handler to find offending SA.
*/
+static LIST_HEAD(xfrm_state_all);
static struct hlist_head *xfrm_state_bydst __read_mostly;
static struct hlist_head *xfrm_state_bysrc __read_mostly;
static struct hlist_head *xfrm_state_byspi __read_mostly;
@@ -510,6 +511,7 @@ struct xfrm_state *xfrm_state_alloc(void)
if (x) {
atomic_set(&x->refcnt, 1);
atomic_set(&x->tunnel_users, 0);
+ INIT_LIST_HEAD(&x->all);
INIT_HLIST_NODE(&x->bydst);
INIT_HLIST_NODE(&x->bysrc);
INIT_HLIST_NODE(&x->byspi);
@@ -533,6 +535,10 @@ void __xfrm_state_destroy(struct xfrm_state *x)
{
BUG_TRAP(x->km.state == XFRM_STATE_DEAD);
+ spin_lock_bh(&xfrm_state_lock);
+ list_del(&x->all);
+ spin_unlock_bh(&xfrm_state_lock);
+
spin_lock_bh(&xfrm_state_gc_lock);
hlist_add_head(&x->bydst, &xfrm_state_gc_list);
spin_unlock_bh(&xfrm_state_gc_lock);
@@ -909,6 +915,8 @@ static void __xfrm_state_insert(struct xfrm_state *x)
x->genid = ++xfrm_state_genid;
+ list_add_tail(&x->all, &xfrm_state_all);
+
h = xfrm_dst_hash(&x->id.daddr, &x->props.saddr,
x->props.reqid, x->props.family);
hlist_add_head(&x->bydst, xfrm_state_bydst+h);
@@ -1518,36 +1526,47 @@ unlock:
}
EXPORT_SYMBOL(xfrm_alloc_spi);
-int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*),
+int xfrm_state_walk(struct xfrm_state_walk *walk,
+ int (*func)(struct xfrm_state *, int, void*),
void *data)
{
- int i;
- struct xfrm_state *x, *last = NULL;
- struct hlist_node *entry;
- int count = 0;
+ struct xfrm_state *old, *x, *last = NULL;
int err = 0;
+ if (walk->state == NULL && walk->count != 0)
+ return 0;
+
+ old = x = walk->state;
+ walk->state = NULL;
spin_lock_bh(&xfrm_state_lock);
- for (i = 0; i <= xfrm_state_hmask; i++) {
- hlist_for_each_entry(x, entry, xfrm_state_bydst+i, bydst) {
- if (!xfrm_id_proto_match(x->id.proto, proto))
- continue;
- if (last) {
- err = func(last, count, data);
- if (err)
- goto out;
+ if (x == NULL)
+ x = list_first_entry(&xfrm_state_all, struct xfrm_state, all);
+ list_for_each_entry_from(x, &xfrm_state_all, all) {
+ if (x->km.state == XFRM_STATE_DEAD)
+ continue;
+ if (!xfrm_id_proto_match(x->id.proto, walk->proto))
+ continue;
+ if (last) {
+ err = func(last, walk->count, data);
+ if (err) {
+ xfrm_state_hold(last);
+ walk->state = last;
+ goto out;
}
- last = x;
- count++;
}
+ last = x;
+ walk->count++;
}
- if (count == 0) {
+ if (walk->count == 0) {
err = -ENOENT;
goto out;
}
- err = func(last, 0, data);
+ if (last)
+ err = func(last, 0, data);
out:
spin_unlock_bh(&xfrm_state_lock);
+ if (old != NULL)
+ xfrm_state_put(old);
return err;
}
EXPORT_SYMBOL(xfrm_state_walk);
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index e0ccdf2..e50f740 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -472,8 +472,6 @@ struct xfrm_dump_info {
struct sk_buff *out_skb;
u32 nlmsg_seq;
u16 nlmsg_flags;
- int start_idx;
- int this_idx;
};
static int copy_sec_ctx(struct xfrm_sec_ctx *s, struct sk_buff *skb)
@@ -538,9 +536,6 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr)
struct nlmsghdr *nlh;
int err;
- if (sp->this_idx < sp->start_idx)
- goto out;
-
nlh = nlmsg_put(skb, NETLINK_CB(in_skb).pid, sp->nlmsg_seq,
XFRM_MSG_NEWSA, sizeof(*p), sp->nlmsg_flags);
if (nlh == NULL)
@@ -553,8 +548,6 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr)
goto nla_put_failure;
nlmsg_end(skb, nlh);
-out:
- sp->this_idx++;
return 0;
nla_put_failure:
@@ -562,18 +555,32 @@ nla_put_failure:
return err;
}
+static int xfrm_dump_sa_done(struct netlink_callback *cb)
+{
+ struct xfrm_state_walk *walk = (struct xfrm_state_walk *) &cb->args[1];
+ xfrm_state_walk_done(walk);
+ return 0;
+}
+
static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb)
{
+ struct xfrm_state_walk *walk = (struct xfrm_state_walk *) &cb->args[1];
struct xfrm_dump_info info;
+ BUILD_BUG_ON(sizeof(struct xfrm_state_walk) >
+ sizeof(cb->args) - sizeof(cb->args[0]));
+
info.in_skb = cb->skb;
info.out_skb = skb;
info.nlmsg_seq = cb->nlh->nlmsg_seq;
info.nlmsg_flags = NLM_F_MULTI;
- info.this_idx = 0;
- info.start_idx = cb->args[0];
- (void) xfrm_state_walk(0, dump_one_state, &info);
- cb->args[0] = info.this_idx;
+
+ if (!cb->args[0]) {
+ cb->args[0] = 1;
+ xfrm_state_walk_init(walk, 0);
+ }
+
+ (void) xfrm_state_walk(walk, dump_one_state, &info);
return skb->len;
}
@@ -592,7 +599,6 @@ static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb,
info.out_skb = skb;
info.nlmsg_seq = seq;
info.nlmsg_flags = 0;
- info.this_idx = info.start_idx = 0;
if (dump_one_state(x, 0, &info)) {
kfree_skb(skb);
@@ -1169,9 +1175,6 @@ static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr
struct sk_buff *skb = sp->out_skb;
struct nlmsghdr *nlh;
- if (sp->this_idx < sp->start_idx)
- goto out;
-
nlh = nlmsg_put(skb, NETLINK_CB(in_skb).pid, sp->nlmsg_seq,
XFRM_MSG_NEWPOLICY, sizeof(*p), sp->nlmsg_flags);
if (nlh == NULL)
@@ -1187,8 +1190,6 @@ static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr
goto nlmsg_failure;
nlmsg_end(skb, nlh);
-out:
- sp->this_idx++;
return 0;
nlmsg_failure:
@@ -1196,21 +1197,33 @@ nlmsg_failure:
return -EMSGSIZE;
}
+static int xfrm_dump_policy_done(struct netlink_callback *cb)
+{
+ struct xfrm_policy_walk *walk = (struct xfrm_policy_walk *) &cb->args[1];
+
+ xfrm_policy_walk_done(walk);
+ return 0;
+}
+
static int xfrm_dump_policy(struct sk_buff *skb, struct netlink_callback *cb)
{
+ struct xfrm_policy_walk *walk = (struct xfrm_policy_walk *) &cb->args[1];
struct xfrm_dump_info info;
+ BUILD_BUG_ON(sizeof(struct xfrm_policy_walk) >
+ sizeof(cb->args) - sizeof(cb->args[0]));
+
info.in_skb = cb->skb;
info.out_skb = skb;
info.nlmsg_seq = cb->nlh->nlmsg_seq;
info.nlmsg_flags = NLM_F_MULTI;
- info.this_idx = 0;
- info.start_idx = cb->args[0];
- (void) xfrm_policy_walk(XFRM_POLICY_TYPE_MAIN, dump_one_policy, &info);
-#ifdef CONFIG_XFRM_SUB_POLICY
- (void) xfrm_policy_walk(XFRM_POLICY_TYPE_SUB, dump_one_policy, &info);
-#endif
- cb->args[0] = info.this_idx;
+
+ if (!cb->args[0]) {
+ cb->args[0] = 1;
+ xfrm_policy_walk_init(walk, XFRM_POLICY_TYPE_ANY);
+ }
+
+ (void) xfrm_policy_walk(walk, dump_one_policy, &info);
return skb->len;
}
@@ -1230,7 +1243,6 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb,
info.out_skb = skb;
info.nlmsg_seq = seq;
info.nlmsg_flags = 0;
- info.this_idx = info.start_idx = 0;
if (dump_one_policy(xp, dir, 0, &info) < 0) {
kfree_skb(skb);
@@ -1827,15 +1839,18 @@ static const struct nla_policy xfrma_policy[XFRMA_MAX+1] = {
static struct xfrm_link {
int (*doit)(struct sk_buff *, struct nlmsghdr *, struct nlattr **);
int (*dump)(struct sk_buff *, struct netlink_callback *);
+ int (*done)(struct netlink_callback *);
} xfrm_dispatch[XFRM_NR_MSGTYPES] = {
[XFRM_MSG_NEWSA - XFRM_MSG_BASE] = { .doit = xfrm_add_sa },
[XFRM_MSG_DELSA - XFRM_MSG_BASE] = { .doit = xfrm_del_sa },
[XFRM_MSG_GETSA - XFRM_MSG_BASE] = { .doit = xfrm_get_sa,
- .dump = xfrm_dump_sa },
+ .dump = xfrm_dump_sa,
+ .done = xfrm_dump_sa_done },
[XFRM_MSG_NEWPOLICY - XFRM_MSG_BASE] = { .doit = xfrm_add_policy },
[XFRM_MSG_DELPOLICY - XFRM_MSG_BASE] = { .doit = xfrm_get_policy },
[XFRM_MSG_GETPOLICY - XFRM_MSG_BASE] = { .doit = xfrm_get_policy,
- .dump = xfrm_dump_policy },
+ .dump = xfrm_dump_policy,
+ .done = xfrm_dump_policy_done },
[XFRM_MSG_ALLOCSPI - XFRM_MSG_BASE] = { .doit = xfrm_alloc_userspi },
[XFRM_MSG_ACQUIRE - XFRM_MSG_BASE] = { .doit = xfrm_add_acquire },
[XFRM_MSG_EXPIRE - XFRM_MSG_BASE] = { .doit = xfrm_add_sa_expire },
@@ -1874,7 +1889,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
if (link->dump == NULL)
return -EINVAL;
- return netlink_dump_start(xfrm_nl, skb, nlh, link->dump, NULL);
+ return netlink_dump_start(xfrm_nl, skb, nlh, link->dump, link->done);
}
err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, XFRMA_MAX,
--
1.5.2.5
^ permalink raw reply related
* Re: Slow OOM in netif_RX function
From: Arnaldo Carvalho de Melo @ 2008-01-25 14:12 UTC (permalink / raw)
To: Andi Kleen; +Cc: Ivan H. Dichev, netdev
In-Reply-To: <p73tzl282ij.fsf@bingen.suse.de>
Em Fri, Jan 25, 2008 at 02:21:08PM +0100, Andi Kleen escreveu:
> "Ivan H. Dichev" <idichev@obs.bg> writes:
> >
> > What could happen if I put different Lan card in every slot?
> > In ex. to-private -> 3com
> > to-inet -> VIA
> > to-dmz -> rtl8139
> > And then to look which RX function is consuming the memory.
> > (boomerang_rx, rtl8139_rx, ... etc)
>
> The problem is unlikely to be in the driver (these are both
> well tested ones) but more likely your complicated iptables setup somehow
> triggers a skb leak.
>
> There are unfortunately no shrink wrapped debug mechanisms in the kernel
> for leaks like this (ok you could enable CONFIG_NETFILTER_DEBUG
> and see if it prints something interesting, but that's a long shot).
>
> If you wanted to write a custom debugging patch I would do something like this:
>
> - Add two new integer fields to struct sk_buff: a time stamp and a integer field
> - Fill the time stamp with jiffies in alloc_skb and clear the integer field
> - In __kfree_skb clear the time stamp
> - For all the ipt target modules in net/ipv4/netfilter/*.c you use change their
> ->target functions to put an unique value into the integer field you added.
> - Do the same for the pkt_to_tuple functions for all conntrack modules
>
> Then when you observe the leak take a crash dump using kdump on the router
> and then use crash to dump all the slab objects for the sk_head_cache.
> Then look for any that have an old time stamp and check what value they
> have in the integer field. Then the netfilter function who set that unique value
> likely triggered the leak somehow.
I wrote some systemtap scripts that do parts of what you suggest, and at
least for the timestamp there was no need to add a new field to struct
sk_buff, I just reuse skb->timestamp, as it is only used when we use a
packet sniffer. Here it is for reference, but it needs some tapsets I
wrote, so I'll publish this git repo in git.kernel.org, perhaps it can
be useful in this case as a starting point. Find another unused field
(hint: I know that at least 4 bytes on 64 bits is present as a hole) and
you're done, no need to rebuild the kernel :)
http://git.kernel.org/?p=linux/kernel/git/acme/nettaps.git
- Arnaldo
#!/usr/bin/stap
global stats_latency
global stats_bufsize
probe new_packet = kernel.function("__alloc_skb").return
{
skb = $return
}
probe tcp_in = kernel.function("tcp_v4_rcv")
{
skb = $skb
sport = skb_tcphdr_sport(skb)
dport = skb_tcphdr_dport(skb)
saddr = skb_iphdr_saddr(skb)
daddr = skb_iphdr_daddr(skb)
len = $skb->len
timestamp = skb_tstamp(skb)
}
probe tcp_out = kernel.function("tcp_transmit_skb")
{
sk = $sk
len = $skb->len
timestamp = skb_tstamp($skb)
sport = inet_sk_sport(sk)
dport = inet_sk_dport(sk)
saddr = inet_sk_saddr(sk)
daddr = inet_sk_daddr(sk)
}
probe ip_in = kernel.function("ip_rcv")
{
skb = $skb
saddr = skb_iphdr_saddr(skb)
daddr = skb_iphdr_daddr(skb)
protocol = skb_iphdr_protocol(skb)
len = $skb->len
timestamp = skb_tstamp(skb)
}
probe ip_out = kernel.function("ip_queue_xmit")
{
sk = $skb->sk
len = $skb->len
protocol = sk_protocol(sk)
timestamp = skb_tstamp($skb)
sport = inet_sk_sport(sk)
dport = inet_sk_dport(sk)
saddr = inet_sk_saddr(sk)
daddr = inet_sk_daddr(sk)
}
probe dev_out = kernel.function("dev_hard_start_xmit")
{
skb = $skb
sk = $skb->sk
len = $skb->len
timestamp = skb_tstamp(skb)
if (sk) {
protocol = sk_protocol(sk)
sport = inet_sk_sport(sk)
dport = inet_sk_dport(sk)
saddr = inet_sk_saddr(sk)
daddr = inet_sk_daddr(sk)
}
}
probe dev_in = kernel.function("netif_rx"), kernel.function("netif_receive_skb")
{
skb = $skb
}
probe user_in = kernel.function("skb_copy_datagram_iovec"),
kernel.function("skb_copy_and_csum_datagram")
{
skb = $skb
sk = $skb->sk
len = len
timestamp = skb_tstamp(skb)
protocol = 0
if (sk) {
protocol = sk_protocol(sk)
dport = inet_sk_dport(sk)
sport = inet_sk_sport(sk)
saddr = inet_sk_saddr(sk)
daddr = inet_sk_daddr(sk)
}
}
probe new_packet
{
if (skb)
skb_take_tstamp(skb)
}
probe dev_in
{
if (skb)
skb_take_tstamp(skb)
}
function add_sample(table_id, saddr, sport, daddr, dport, timestamp, len)
{
/* We're only interested in loopback
if (daddr != 0x100007f)
return 0 */
delay = gettimeofday_ns() - timestamp
if (delay < 0) {
printf("delay < 0! timestamp=%d\n", timestamp)
return 0
}
stats_latency[table_id, saddr, sport, daddr, dport] <<< delay
stats_bufsize[table_id, saddr, sport, daddr, dport] <<< len
}
probe dev_out
{
if (protocol == IPPROTO_TCP)
add_sample("dev_out", saddr, sport, daddr, dport, timestamp, len)
}
probe tcp_out
{
add_sample("tcp_out", saddr, sport, daddr, dport, timestamp, len)
}
probe ip_in
{
if (protocol == IPPROTO_TCP) {
sport = skb_iphdr_tcp_sport(skb)
dport = skb_iphdr_tcp_dport(skb)
add_sample("ip_in", daddr, dport, saddr, sport, timestamp, len)
}
}
probe ip_out
{
if (protocol == IPPROTO_TCP)
add_sample("ip_out", daddr, dport, saddr, sport, timestamp, len)
}
probe tcp_in
{
add_sample("tcp_in", daddr, dport, saddr, sport, timestamp, len)
}
probe user_in
{
if (protocol == IPPROTO_TCP)
add_sample("user_in", saddr, sport, daddr, dport, timestamp, len)
}
probe end
{
printf("%8s %15.15s %5s %15s %5s %23s %18s\n",
"", "", "", "", "", "latency(ns)", "buffer size")
printf("%8.8s %15.15s %5s %15.15s %5s %8s %7s %9s %5s %5s %5s\n",
"entry", "local address", "port", "remote address", "port",
"avg", "min", "max", "avg", "min", "max")
foreach ([table_id-, saddr, sport, daddr, dport] in stats_latency) {
printf("%-8.8s %15.15s %5d %15.15s %5d %8d %7d %9d %5d %5d %5d\n",
table_id, inet_sk_ntop(saddr), sport, inet_sk_ntop(daddr), dport,
@avg(stats_latency[table_id, saddr, sport, daddr, dport]),
@min(stats_latency[table_id, saddr, sport, daddr, dport]),
@max(stats_latency[table_id, saddr, sport, daddr, dport]),
@avg(stats_bufsize[table_id, saddr, sport, daddr, dport]),
@min(stats_bufsize[table_id, saddr, sport, daddr, dport]),
@max(stats_bufsize[table_id, saddr, sport, daddr, dport]))
}
}
^ permalink raw reply
* Re: [PATCH 3/7 net-2.6.25] [IPV4]: Prohibit assignment of 0.0.0.0 as interface address.
From: Denis V. Lunev @ 2008-01-25 14:13 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: Denis V. Lunev, davem, netdev, devel, containers
In-Reply-To: <4799EBBE.6080706@fr.ibm.com>
Daniel Lezcano wrote:
> Denis V. Lunev wrote:
>> I could hardly imagine why sombady needs to assign 0.0.0.0 as an
>> interface
>> address or interface destination address. The kernel will behave in a
>> strage
>> way in several places if this is possible, as ifa_local != 0 is
>> considered
>> as initialized/non-initialized state of the ifa.
>
> AFAICS, we should be able to set at an interface address to 0.0.0.0, in
> order to remove an IP address from an interface and keep this one up.
> I see two trivial cases:
> * remove the ipv4 on an interface but continue to use it through ipv6
> * move ipv4 address from the interface to an attached bridge
For this case there is an IOCTL/netlink "remove IP address".
^ permalink raw reply
* [PATCH for-2.6.25] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
From: Jochen Friedrich @ 2008-01-25 14:31 UTC (permalink / raw)
To: Vitaly Bordug
Cc: Garzik, Jeff, Kumar Gala, Scott Wood, netdev@vger.kernel.org,
Kernel, Linux, linuxppc-dev list
Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also
rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the
includes accordingly.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
arch/powerpc/platforms/8xx/ep88xc.c | 1 +
arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 +-
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 2 +-
arch/powerpc/sysdev/Makefile | 4 ++--
arch/powerpc/sysdev/{commproc.c => cpm1.c} | 4 ++--
arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} | 3 +--
arch/powerpc/sysdev/micropatch.c | 2 +-
arch/ppc/8260_io/enet.c | 2 +-
arch/ppc/8xx_io/commproc.c | 2 +-
arch/ppc/8xx_io/enet.c | 6 +++---
arch/ppc/8xx_io/fec.c | 2 +-
arch/ppc/8xx_io/micropatch.c | 2 +-
arch/ppc/boot/simple/iic.c | 2 +-
arch/ppc/boot/simple/m8xx_tty.c | 2 +-
arch/ppc/kernel/ppc_ksyms.c | 2 +-
arch/ppc/platforms/mpc866ads_setup.c | 2 +-
arch/ppc/platforms/mpc885ads_setup.c | 2 +-
arch/ppc/syslib/mpc8xx_devices.c | 2 +-
arch/ppc/xmon/start_8xx.c | 2 +-
drivers/net/fec_8xx/fec_8xx-netta.c | 2 +-
drivers/net/fec_8xx/fec_main.c | 2 +-
drivers/net/fec_8xx/fec_mii.c | 2 +-
drivers/net/fs_enet/fs_enet.h | 2 +-
drivers/net/fs_enet/mac-fec.c | 2 +-
drivers/net/fs_enet/mac-scc.c | 2 +-
drivers/serial/cpm_uart/cpm_uart_cpm1.h | 2 +-
include/asm-powerpc/{commproc.h => cpm1.h} | 8 ++++----
include/asm-ppc/{commproc.h => cpm1.h} | 8 ++++----
28 files changed, 38 insertions(+), 38 deletions(-)
rename arch/powerpc/sysdev/{commproc.c => cpm1.c} (99%)
rename arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} (99%)
rename include/asm-powerpc/{commproc.h => cpm1.h} (99%)
rename include/asm-ppc/{commproc.h => cpm1.h} (99%)
diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
index 4897eda..a8dffa0 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -16,6 +16,7 @@
#include <asm/io.h>
#include <asm/udbg.h>
#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include "mpc8xx.h"
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index c0dda53..c028a5b 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -22,7 +22,7 @@
#include <asm/system.h>
#include <asm/time.h>
#include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include <asm/fs_pd.h>
#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 3be115e..6e7ded0 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -36,7 +36,7 @@
#include <asm/time.h>
#include <asm/mpc8xx.h>
#include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include <asm/fs_pd.h>
#include <asm/udbg.h>
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index f17e7b8..928d75b 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -36,8 +36,8 @@ endif
# Temporary hack until we have migrated to asm-powerpc
ifeq ($(ARCH),powerpc)
obj-$(CONFIG_CPM) += cpm_common.o
-obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
+obj-$(CONFIG_CPM2) += cpm2.o cpm2_pic.o
obj-$(CONFIG_PPC_DCR) += dcr.o
-obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o
+obj-$(CONFIG_8xx) += mpc8xx_pic.o cpm1.o
obj-$(CONFIG_UCODE_PATCH) += micropatch.o
endif
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/cpm1.c
similarity index 99%
rename from arch/powerpc/sysdev/commproc.c
rename to arch/powerpc/sysdev/cpm1.c
index ef82587..df8bd2b 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -33,7 +33,7 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include <asm/io.h>
#include <asm/tlbflush.h>
#include <asm/rheap.h>
@@ -290,7 +290,7 @@ cpm_setbrg(uint brg, uint rate)
out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN);
else
out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
- CPM_BRG_EN | CPM_BRG_DIV16);
+ CPM_BRG_EN | CPM_BRG_DIV16);
}
#ifndef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2.c
similarity index 99%
rename from arch/powerpc/sysdev/cpm2_common.c
rename to arch/powerpc/sysdev/cpm2.c
index f7188e2..7be7112 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -153,8 +153,7 @@ cpm2_fastbrg(uint brg, uint rate, int div16)
if (brg < 4) {
bp = cpm2_map_size(im_brgc1, 16);
- }
- else {
+ } else {
bp = cpm2_map_size(im_brgc5, 16);
brg -= 4;
}
diff --git a/arch/powerpc/sysdev/micropatch.c b/arch/powerpc/sysdev/micropatch.c
index 712b10a..d8d6028 100644
--- a/arch/powerpc/sysdev/micropatch.c
+++ b/arch/powerpc/sysdev/micropatch.c
@@ -16,7 +16,7 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
/*
* I2C/SPI relocation patch arrays.
diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c
index 615b658..3ea4db2 100644
--- a/arch/ppc/8260_io/enet.c
+++ b/arch/ppc/8260_io/enet.c
@@ -10,7 +10,7 @@
* This version of the driver is somewhat selectable for the different
* processor/board combinations. It works for the boards I know about
* now, and should be easily modified to include others. Some of the
- * configuration information is contained in <asm/commproc.h> and the
+ * configuration information is contained in <asm/cpm1.h> and the
* remainder is here.
*
* Buffer descriptors are kept in the CPM dual port RAM, and the frame
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 3f93af8..9d656de 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -34,7 +34,7 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include <asm/io.h>
#include <asm/tlbflush.h>
#include <asm/rheap.h>
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index eace3bc..c6d047a 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -8,7 +8,7 @@
* This version of the driver is somewhat selectable for the different
* processor/board combinations. It works for the boards I know about
* now, and should be easily modified to include others. Some of the
- * configuration information is contained in <asm/commproc.h> and the
+ * configuration information is contained in <asm/cpm1.h> and the
* remainder is here.
*
* Buffer descriptors are kept in the CPM dual port RAM, and the frame
@@ -43,7 +43,7 @@
#include <asm/pgtable.h>
#include <asm/mpc8xx.h>
#include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include <asm/cacheflush.h>
/*
@@ -80,7 +80,7 @@
* programming documents for details unique to your board.
*
* For the TQM8xx(L) modules, there is no control register interface.
- * All functions are directly controlled using I/O pins. See <asm/commproc.h>.
+ * All functions are directly controlled using I/O pins. See <asm/cpm1.h>.
*/
/* The transmitter timeout
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c
index 0288279..11b0aa6 100644
--- a/arch/ppc/8xx_io/fec.c
+++ b/arch/ppc/8xx_io/fec.c
@@ -53,7 +53,7 @@
#include <asm/mpc8xx.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#ifdef CONFIG_USE_MDIO
/* Forward declarations of some structures to support different PHYs
diff --git a/arch/ppc/8xx_io/micropatch.c b/arch/ppc/8xx_io/micropatch.c
index cfad46b..9a5d95d 100644
--- a/arch/ppc/8xx_io/micropatch.c
+++ b/arch/ppc/8xx_io/micropatch.c
@@ -16,7 +16,7 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
/*
* I2C/SPI relocation patch arrays.
diff --git a/arch/ppc/boot/simple/iic.c b/arch/ppc/boot/simple/iic.c
index e4efd83..5e91489 100644
--- a/arch/ppc/boot/simple/iic.c
+++ b/arch/ppc/boot/simple/iic.c
@@ -5,7 +5,7 @@
#include <linux/types.h>
#include <asm/uaccess.h>
#include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
/* IIC functions.
diff --git a/arch/ppc/boot/simple/m8xx_tty.c b/arch/ppc/boot/simple/m8xx_tty.c
index ea615d8..f28924e 100644
--- a/arch/ppc/boot/simple/m8xx_tty.c
+++ b/arch/ppc/boot/simple/m8xx_tty.c
@@ -11,7 +11,7 @@
#include <linux/types.h>
#include <asm/uaccess.h>
#include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#ifdef CONFIG_MBX
#define MBX_CSR1 ((volatile u_char *)0xfa100000)
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 22494ec..0d53dc3 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -45,7 +45,7 @@
#include <asm/dcr.h>
#ifdef CONFIG_8xx
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#endif
extern void transfer_to_handler(void);
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c
index bf72204..62370f4 100644
--- a/arch/ppc/platforms/mpc866ads_setup.c
+++ b/arch/ppc/platforms/mpc866ads_setup.c
@@ -32,7 +32,7 @@
#include <asm/time.h>
#include <asm/ppcboot.h>
#include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include <asm/ppc_sys.h>
#include <asm/mpc8xx.h>
diff --git a/arch/ppc/platforms/mpc885ads_setup.c b/arch/ppc/platforms/mpc885ads_setup.c
index 87deaef..ba06cc0 100644
--- a/arch/ppc/platforms/mpc885ads_setup.c
+++ b/arch/ppc/platforms/mpc885ads_setup.c
@@ -31,7 +31,7 @@
#include <asm/time.h>
#include <asm/ppcboot.h>
#include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include <asm/ppc_sys.h>
extern unsigned char __res[];
diff --git a/arch/ppc/syslib/mpc8xx_devices.c b/arch/ppc/syslib/mpc8xx_devices.c
index c05ac87..80804ee 100644
--- a/arch/ppc/syslib/mpc8xx_devices.c
+++ b/arch/ppc/syslib/mpc8xx_devices.c
@@ -16,7 +16,7 @@
#include <linux/device.h>
#include <linux/serial_8250.h>
#include <linux/mii.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include <asm/mpc8xx.h>
#include <asm/irq.h>
#include <asm/ppc_sys.h>
diff --git a/arch/ppc/xmon/start_8xx.c b/arch/ppc/xmon/start_8xx.c
index a48bd59..3097406 100644
--- a/arch/ppc/xmon/start_8xx.c
+++ b/arch/ppc/xmon/start_8xx.c
@@ -14,7 +14,7 @@
#include <linux/kernel.h>
#include <asm/8xx_immap.h>
#include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
extern void xmon_printf(const char *fmt, ...);
extern int xmon_8xx_write(char *str, int nb);
diff --git a/drivers/net/fec_8xx/fec_8xx-netta.c b/drivers/net/fec_8xx/fec_8xx-netta.c
index e492eb8..79deee2 100644
--- a/drivers/net/fec_8xx/fec_8xx-netta.c
+++ b/drivers/net/fec_8xx/fec_8xx-netta.c
@@ -26,7 +26,7 @@
#include <asm/mpc8xx.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include "fec_8xx.h"
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c
index ab9637a..ca8d2e8 100644
--- a/drivers/net/fec_8xx/fec_main.c
+++ b/drivers/net/fec_8xx/fec_main.c
@@ -35,7 +35,7 @@
#include <asm/mpc8xx.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#include "fec_8xx.h"
diff --git a/drivers/net/fec_8xx/fec_mii.c b/drivers/net/fec_8xx/fec_mii.c
index e8e10a0..3b6ca29 100644
--- a/drivers/net/fec_8xx/fec_mii.c
+++ b/drivers/net/fec_8xx/fec_mii.c
@@ -34,7 +34,7 @@
#include <asm/mpc8xx.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
/*************************************************/
diff --git a/drivers/net/fs_enet/fs_enet.h b/drivers/net/fs_enet/fs_enet.h
index c675e29..e05389c 100644
--- a/drivers/net/fs_enet/fs_enet.h
+++ b/drivers/net/fs_enet/fs_enet.h
@@ -12,7 +12,7 @@
#include <asm/fs_pd.h>
#ifdef CONFIG_CPM1
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
struct fec_info {
fec_t __iomem *fecp;
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index c1fee48..8a311d1 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -40,7 +40,7 @@
#include <asm/8xx_immap.h>
#include <asm/pgtable.h>
#include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#endif
#ifdef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index fe3d8a6..d7ca319 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -40,7 +40,7 @@
#include <asm/8xx_immap.h>
#include <asm/pgtable.h>
#include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
#endif
#ifdef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
index 9b5465f..ddf46d3 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
@@ -10,7 +10,7 @@
#ifndef CPM_UART_CPM1_H
#define CPM_UART_CPM1_H
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
/* defines for IRQs */
#ifndef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/cpm1.h
similarity index 99%
rename from include/asm-powerpc/commproc.h
rename to include/asm-powerpc/cpm1.h
index ec87b8f..901a00b 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/cpm1.h
@@ -14,8 +14,8 @@
* IDMA1 space. The remaining DP RAM is available for buffer descriptors
* or other use.
*/
-#ifndef __CPM_8XX__
-#define __CPM_8XX__
+#ifndef __CPM1__
+#define __CPM1__
#include <asm/8xx_immap.h>
#include <asm/ptrace.h>
@@ -82,7 +82,7 @@ extern int cpm_dpfree(unsigned long offset);
extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
extern void cpm_dpdump(void);
extern void *cpm_dpram_addr(unsigned long offset);
-extern uint cpm_dpram_phys(u8* addr);
+extern uint cpm_dpram_phys(u8 *addr);
#endif
extern void cpm_setbrg(uint brg, uint rate);
@@ -747,4 +747,4 @@ enum cpm_clk {
int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode);
-#endif /* __CPM_8XX__ */
+#endif /* __CPM1__ */
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/cpm1.h
similarity index 99%
rename from include/asm-ppc/commproc.h
rename to include/asm-ppc/cpm1.h
index 5418d6d..03035ac 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/cpm1.h
@@ -14,8 +14,8 @@
* IDMA1 space. The remaining DP RAM is available for buffer descriptors
* or other use.
*/
-#ifndef __CPM_8XX__
-#define __CPM_8XX__
+#ifndef __CPM1__
+#define __CPM1__
#include <asm/8xx_immap.h>
#include <asm/ptrace.h>
@@ -72,7 +72,7 @@ extern int cpm_dpfree(unsigned long offset);
extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
extern void cpm_dpdump(void);
extern void *cpm_dpram_addr(unsigned long offset);
-extern uint cpm_dpram_phys(u8* addr);
+extern uint cpm_dpram_phys(u8 *addr);
extern void cpm_setbrg(uint brg, uint rate);
extern void cpm_load_patch(volatile immap_t *immr);
@@ -685,4 +685,4 @@ typedef struct risc_timer_pram {
extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id);
extern void cpm_free_handler(int vec);
-#endif /* __CPM_8XX__ */
+#endif /* __CPM1__ */
--
1.5.3.8
^ permalink raw reply related
* [PATCH] [NET]: Remove PowerPC code from fec.c
From: Jochen Friedrich @ 2008-01-25 14:33 UTC (permalink / raw)
To: Garzik, Jeff
Cc: linux-m68k, Kernel, Linux, linuxppc-dev list, Geert Uytterhoeven,
netdev@vger.kernel.org, Scott Wood
fec.c is only used on M68k Coldfire CPUs. Remove leftover
PowerPC code from this driver.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
drivers/net/fec.c | 136 +---------------------------------------------------
1 files changed, 3 insertions(+), 133 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 0fbf1bb..0499cbb 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -23,6 +23,9 @@
*
* Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
* Copyright (c) 2004-2006 Macq Electronique SA.
+ *
+ * This driver is now only used on ColdFire processors. Remove conditional
+ * Powerpc code.
*/
#include <linux/module.h>
@@ -49,17 +52,9 @@
#include <asm/pgtable.h>
#include <asm/cacheflush.h>
-#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \
- defined(CONFIG_M5272) || defined(CONFIG_M528x) || \
- defined(CONFIG_M520x) || defined(CONFIG_M532x)
#include <asm/coldfire.h>
#include <asm/mcfsim.h>
#include "fec.h"
-#else
-#include <asm/8xx_immap.h>
-#include <asm/mpc8xx.h>
-#include "commproc.h"
-#endif
#if defined(CONFIG_FEC2)
#define FEC_MAX_PORTS 2
@@ -1223,14 +1218,9 @@ static phy_info_t const * const phy_info[] = {
/* ------------------------------------------------------------------------- */
#if !defined(CONFIG_M532x)
-#ifdef CONFIG_RPXCLASSIC
-static void
-mii_link_interrupt(void *dev_id);
-#else
static irqreturn_t
mii_link_interrupt(int irq, void * dev_id);
#endif
-#endif
#if defined(CONFIG_M5272)
/*
@@ -1800,121 +1790,6 @@ static void __inline__ fec_uncache(unsigned long addr)
/* ------------------------------------------------------------------------- */
-#else
-
-/*
- * Code specific to the MPC860T setup.
- */
-static void __inline__ fec_request_intrs(struct net_device *dev)
-{
- volatile immap_t *immap;
-
- immap = (immap_t *)IMAP_ADDR; /* pointer to internal registers */
-
- if (request_8xxirq(FEC_INTERRUPT, fec_enet_interrupt, 0, "fec", dev) != 0)
- panic("Could not allocate FEC IRQ!");
-
-#ifdef CONFIG_RPXCLASSIC
- /* Make Port C, bit 15 an input that causes interrupts.
- */
- immap->im_ioport.iop_pcpar &= ~0x0001;
- immap->im_ioport.iop_pcdir &= ~0x0001;
- immap->im_ioport.iop_pcso &= ~0x0001;
- immap->im_ioport.iop_pcint |= 0x0001;
- cpm_install_handler(CPMVEC_PIO_PC15, mii_link_interrupt, dev);
-
- /* Make LEDS reflect Link status.
- */
- *((uint *) RPX_CSR_ADDR) &= ~BCSR2_FETHLEDMODE;
-#endif
-#ifdef CONFIG_FADS
- if (request_8xxirq(SIU_IRQ2, mii_link_interrupt, 0, "mii", dev) != 0)
- panic("Could not allocate MII IRQ!");
-#endif
-}
-
-static void __inline__ fec_get_mac(struct net_device *dev)
-{
- bd_t *bd;
-
- bd = (bd_t *)__res;
- memcpy(dev->dev_addr, bd->bi_enetaddr, ETH_ALEN);
-
-#ifdef CONFIG_RPXCLASSIC
- /* The Embedded Planet boards have only one MAC address in
- * the EEPROM, but can have two Ethernet ports. For the
- * FEC port, we create another address by setting one of
- * the address bits above something that would have (up to
- * now) been allocated.
- */
- dev->dev_adrd[3] |= 0x80;
-#endif
-}
-
-static void __inline__ fec_set_mii(struct net_device *dev, struct fec_enet_private *fep)
-{
- extern uint _get_IMMR(void);
- volatile immap_t *immap;
- volatile fec_t *fecp;
-
- fecp = fep->hwp;
- immap = (immap_t *)IMAP_ADDR; /* pointer to internal registers */
-
- /* Configure all of port D for MII.
- */
- immap->im_ioport.iop_pdpar = 0x1fff;
-
- /* Bits moved from Rev. D onward.
- */
- if ((_get_IMMR() & 0xffff) < 0x0501)
- immap->im_ioport.iop_pddir = 0x1c58; /* Pre rev. D */
- else
- immap->im_ioport.iop_pddir = 0x1fff; /* Rev. D and later */
-
- /* Set MII speed to 2.5 MHz
- */
- fecp->fec_mii_speed = fep->phy_speed =
- ((bd->bi_busfreq * 1000000) / 2500000) & 0x7e;
-}
-
-static void __inline__ fec_enable_phy_intr(void)
-{
- volatile fec_t *fecp;
-
- fecp = fep->hwp;
-
- /* Enable MII command finished interrupt
- */
- fecp->fec_ivec = (FEC_INTERRUPT/2) << 29;
-}
-
-static void __inline__ fec_disable_phy_intr(void)
-{
-}
-
-static void __inline__ fec_phy_ack_intr(void)
-{
-}
-
-static void __inline__ fec_localhw_setup(void)
-{
- volatile fec_t *fecp;
-
- fecp = fep->hwp;
- fecp->fec_r_hash = PKT_MAXBUF_SIZE;
- /* Enable big endian and don't care about SDMA FC.
- */
- fecp->fec_fun_code = 0x78000000;
-}
-
-static void __inline__ fec_uncache(unsigned long addr)
-{
- pte_t *pte;
- pte = va_to_pte(mem_addr);
- pte_val(*pte) |= _PAGE_NO_CACHE;
- flush_tlb_page(init_mm.mmap, mem_addr);
-}
-
#endif
/* ------------------------------------------------------------------------- */
@@ -2126,13 +2001,8 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
/* This interrupt occurs when the PHY detects a link change.
*/
-#ifdef CONFIG_RPXCLASSIC
-static void
-mii_link_interrupt(void *dev_id)
-#else
static irqreturn_t
mii_link_interrupt(int irq, void * dev_id)
-#endif
{
struct net_device *dev = dev_id;
struct fec_enet_private *fep = netdev_priv(dev);
--
1.5.3.8
^ permalink raw reply related
* Re: [PATCH 3/7 net-2.6.25] [IPV4]: Prohibit assignment of 0.0.0.0 as interface address.
From: Daniel Lezcano @ 2008-01-25 14:37 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: Denis V. Lunev, davem, netdev, devel, containers
In-Reply-To: <4799EE8C.60407@sw.ru>
Denis V. Lunev wrote:
> Daniel Lezcano wrote:
>> Denis V. Lunev wrote:
>>> I could hardly imagine why sombady needs to assign 0.0.0.0 as an
>>> interface
>>> address or interface destination address. The kernel will behave in a
>>> strage
>>> way in several places if this is possible, as ifa_local != 0 is
>>> considered
>>> as initialized/non-initialized state of the ifa.
>> AFAICS, we should be able to set at an interface address to 0.0.0.0, in
>> order to remove an IP address from an interface and keep this one up.
>> I see two trivial cases:
>> * remove the ipv4 on an interface but continue to use it through ipv6
>> * move ipv4 address from the interface to an attached bridge
>
> For this case there is an IOCTL/netlink "remove IP address".
That's right. But there are people relying on 0.0.0.0 to remove IP
addresses, especially in the bridge scripts.
^ permalink raw reply
* Re: [PATCH] [NET]: Remove PowerPC code from fec.c
From: Geert Uytterhoeven @ 2008-01-25 14:46 UTC (permalink / raw)
To: Jochen Friedrich
Cc: Garzik, Jeff, Vitaly Bordug, Scott Wood, Kumar Gala,
Kernel, Linux, netdev@vger.kernel.org, linuxppc-dev list,
linux-m68k, Greg Ungerer, uClinux list
In-Reply-To: <4799F349.9090102@scram.de>
On Fri, 25 Jan 2008, Jochen Friedrich wrote:
> fec.c is only used on M68k Coldfire CPUs. Remove leftover
> PowerPC code from this driver.
As per MAINTAINERS, m68knommu is handled by:
UCLINUX (AND M68KNOMMU)
P: Greg Ungerer
M: gerg@uclinux.org
L: uclinux-dev@uclinux.org (subscribers-only)
I already forwarded a copy of your email to Greg.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH 3/7 net-2.6.25] [IPV4]: Prohibit assignment of 0.0.0.0 as interface address.
From: Daniel Lezcano @ 2008-01-25 14:48 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: Denis V. Lunev, davem, netdev, devel, containers
In-Reply-To: <4799EE8C.60407@sw.ru>
Denis V. Lunev wrote:
> Daniel Lezcano wrote:
>> Denis V. Lunev wrote:
>>> I could hardly imagine why sombady needs to assign 0.0.0.0 as an
>>> interface
>>> address or interface destination address. The kernel will behave in a
>>> strage
>>> way in several places if this is possible, as ifa_local != 0 is
>>> considered
>>> as initialized/non-initialized state of the ifa.
>> AFAICS, we should be able to set at an interface address to 0.0.0.0, in
>> order to remove an IP address from an interface and keep this one up.
>> I see two trivial cases:
>> * remove the ipv4 on an interface but continue to use it through ipv6
>> * move ipv4 address from the interface to an attached bridge
>
> For this case there is an IOCTL/netlink "remove IP address".
And I forgot to mention the general broadcast.
This is need for the dhcp protocol. If you are not able to set your
interface to 0.0.0.0, you will be not able to send a 255.255.255.255
broadcast message to have your IP address.
^ permalink raw reply
* Re: [PATCH 3/7 net-2.6.25] [IPV4]: Prohibit assignment of 0.0.0.0 as interface address.
From: Denis V. Lunev @ 2008-01-25 15:12 UTC (permalink / raw)
To: Daniel Lezcano, davem; +Cc: Denis V. Lunev, netdev, devel, containers
In-Reply-To: <4799F6A5.7040703@fr.ibm.com>
Daniel Lezcano wrote:
> Denis V. Lunev wrote:
>> Daniel Lezcano wrote:
>>> Denis V. Lunev wrote:
>>>> I could hardly imagine why sombady needs to assign 0.0.0.0 as an
>>>> interface
>>>> address or interface destination address. The kernel will behave in a
>>>> strage
>>>> way in several places if this is possible, as ifa_local != 0 is
>>>> considered
>>>> as initialized/non-initialized state of the ifa.
>>> AFAICS, we should be able to set at an interface address to 0.0.0.0, in
>>> order to remove an IP address from an interface and keep this one up.
>>> I see two trivial cases:
>>> * remove the ipv4 on an interface but continue to use it through ipv6
>>> * move ipv4 address from the interface to an attached bridge
>>
>> For this case there is an IOCTL/netlink "remove IP address".
>
> And I forgot to mention the general broadcast.
> This is need for the dhcp protocol. If you are not able to set your
> interface to 0.0.0.0, you will be not able to send a 255.255.255.255
> broadcast message to have your IP address.
>
OK. Dave, pls disregard this patch. I suspect that others in the set
should not intersect with this one.
To summarize the discussion:
there is the only reason for this assignment: old IOCTL interface does
not have a way to remove IP address except this, though netlink has a
method for it that's why I am a little bit confused :)
This is handled in the __inet_insert_ifa: ifa is just removed there and,
correctly, ifa with 0.0.0.0 address can't exists in the kernel.
Sorry :)
^ permalink raw reply
* Re: [PATCH 3/7 net-2.6.25] [IPV4]: Prohibit assignment of 0.0.0.0 as interface address.
From: Daniel Lezcano @ 2008-01-25 15:12 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: davem, Denis V. Lunev, netdev, devel, containers
In-Reply-To: <4799FC69.9030809@sw.ru>
Denis V. Lunev wrote:
> Daniel Lezcano wrote:
>> Denis V. Lunev wrote:
>>> Daniel Lezcano wrote:
>>>> Denis V. Lunev wrote:
>>>>> I could hardly imagine why sombady needs to assign 0.0.0.0 as an
>>>>> interface
>>>>> address or interface destination address. The kernel will behave in a
>>>>> strage
>>>>> way in several places if this is possible, as ifa_local != 0 is
>>>>> considered
>>>>> as initialized/non-initialized state of the ifa.
>>>> AFAICS, we should be able to set at an interface address to 0.0.0.0, in
>>>> order to remove an IP address from an interface and keep this one up.
>>>> I see two trivial cases:
>>>> * remove the ipv4 on an interface but continue to use it through ipv6
>>>> * move ipv4 address from the interface to an attached bridge
>>> For this case there is an IOCTL/netlink "remove IP address".
>> And I forgot to mention the general broadcast.
>> This is need for the dhcp protocol. If you are not able to set your
>> interface to 0.0.0.0, you will be not able to send a 255.255.255.255
>> broadcast message to have your IP address.
>>
>
> OK. Dave, pls disregard this patch. I suspect that others in the set
> should not intersect with this one.
>
> To summarize the discussion:
> there is the only reason for this assignment: old IOCTL interface does
> not have a way to remove IP address except this, though netlink has a
> method for it that's why I am a little bit confused :)
>
> This is handled in the __inet_insert_ifa: ifa is just removed there and,
> correctly, ifa with 0.0.0.0 address can't exists in the kernel.
Yes, my last statement is false.
^ permalink raw reply
* Re: [PATCH] [NET]: Remove PowerPC code from fec.c
From: Frans Pop @ 2008-01-25 15:50 UTC (permalink / raw)
To: Jochen Friedrich
Cc: galak, geert, gerg, jgarzik, linux-kernel, linux-m68k,
linuxppc-dev, netdev, scottwood, vitb
In-Reply-To: <4799F349.9090102@scram.de>
Jochen Friedrich wrote:
> +++ b/drivers/net/fec.c
> @@ -23,6 +23,9 @@
> *
> * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
> * Copyright (c) 2004-2006 Macq Electronique SA.
> + *
> + * This driver is now only used on ColdFire processors. Remove conditional
> + * Powerpc code.
> */
This comment makes sense for a changelog, but IMO it makes no sense at all
to add it to the file.
Cheers,
FJP
^ permalink raw reply
* Re: [PATCH for-2.6.25] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
From: Kumar Gala @ 2008-01-25 15:56 UTC (permalink / raw)
To: Jochen Friedrich
Cc: Vitaly Bordug, Garzik, Jeff, Scott Wood, netdev@vger.kernel.org,
Kernel, Linux, linuxppc-dev list
In-Reply-To: <4799F2CE.309@scram.de>
On Fri, 25 Jan 2008, Jochen Friedrich wrote:
> Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also
> rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the
> includes accordingly.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---
> arch/powerpc/platforms/8xx/ep88xc.c | 1 +
> arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 +-
> arch/powerpc/platforms/8xx/mpc885ads_setup.c | 2 +-
> arch/powerpc/sysdev/Makefile | 4 ++--
> arch/powerpc/sysdev/{commproc.c => cpm1.c} | 4 ++--
> arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} | 3 +--
> arch/powerpc/sysdev/micropatch.c | 2 +-
> arch/ppc/8260_io/enet.c | 2 +-
> arch/ppc/8xx_io/commproc.c | 2 +-
> arch/ppc/8xx_io/enet.c | 6 +++---
> arch/ppc/8xx_io/fec.c | 2 +-
> arch/ppc/8xx_io/micropatch.c | 2 +-
> arch/ppc/boot/simple/iic.c | 2 +-
> arch/ppc/boot/simple/m8xx_tty.c | 2 +-
> arch/ppc/kernel/ppc_ksyms.c | 2 +-
> arch/ppc/platforms/mpc866ads_setup.c | 2 +-
> arch/ppc/platforms/mpc885ads_setup.c | 2 +-
> arch/ppc/syslib/mpc8xx_devices.c | 2 +-
> arch/ppc/xmon/start_8xx.c | 2 +-
> drivers/net/fec_8xx/fec_8xx-netta.c | 2 +-
> drivers/net/fec_8xx/fec_main.c | 2 +-
> drivers/net/fec_8xx/fec_mii.c | 2 +-
> drivers/net/fs_enet/fs_enet.h | 2 +-
> drivers/net/fs_enet/mac-fec.c | 2 +-
> drivers/net/fs_enet/mac-scc.c | 2 +-
> drivers/serial/cpm_uart/cpm_uart_cpm1.h | 2 +-
> include/asm-powerpc/{commproc.h => cpm1.h} | 8 ++++----
> include/asm-ppc/{commproc.h => cpm1.h} | 8 ++++----
> 28 files changed, 38 insertions(+), 38 deletions(-)
> rename arch/powerpc/sysdev/{commproc.c => cpm1.c} (99%)
> rename arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} (99%)
> rename include/asm-powerpc/{commproc.h => cpm1.h} (99%)
> rename include/asm-ppc/{commproc.h => cpm1.h} (99%)
>
applied.
- k
^ permalink raw reply
* Re: [PATCH] [NET]: Remove PowerPC code from fec.c
From: Jochen Friedrich @ 2008-01-25 16:04 UTC (permalink / raw)
To: Frans Pop
Cc: galak, geert, gerg, jgarzik, linux-kernel, linux-m68k,
linuxppc-dev, netdev, scottwood, vitb
In-Reply-To: <E1JIQpQ-0006Xj-RR@faramir.fjphome.nl>
Hi Frans,
> Jochen Friedrich wrote:
>> +++ b/drivers/net/fec.c
>> @@ -23,6 +23,9 @@
>> *
>> * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
>> * Copyright (c) 2004-2006 Macq Electronique SA.
>> + *
>> + * This driver is now only used on ColdFire processors. Remove conditional
>> + * Powerpc code.
>> */
>
> This comment makes sense for a changelog, but IMO it makes no sense at all
> to add it to the file.
I just added it to clarify this code is now only used on m68knommu (Coldfire).
The comments on top are mailny about MPC860T CPUs (PowerPC), however the driver is no
longer used for these CPUs.
Maybe the wording should be changed to:
This driver is now only used on ColdFire (m68knommu) processors. Conditional
PowerPC code has been removed.
Thanks,
Jochen
^ permalink raw reply
* ipcomp regression in 2.6.24?
From: Beschorner Daniel @ 2008-01-25 15:57 UTC (permalink / raw)
To: netdev
With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data
flows in both directions, but no data comes out of the tunnel.
Needed to disable ipcomp.
Daniel
^ permalink raw reply
* Re: [PATCH] fib_trie: rescan if key is lost during dump
From: Stephen Hemminger @ 2008-01-25 16:13 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: David Miller, kaber, netdev
In-Reply-To: <20080125082300.GA2257@ff.dom.local>
On Fri, 25 Jan 2008 09:23:00 +0100
Jarek Poplawski <jarkao2@gmail.com> wrote:
> On 24-01-2008 22:51, Stephen Hemminger wrote:
> > Normally during a dump the key of the last dumped entry is used for
> > continuation, but since lock is dropped it might be lost. In that case
> > fallback to the old counter based N^2 behaviour. This means the dump will end up
> > skipping some routes which matches what FIB_HASH does.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> ...
> > @@ -1918,35 +1931,37 @@ static int fn_trie_dump(struct fib_table
> > struct leaf *l;
> > struct trie *t = (struct trie *) tb->tb_data;
> > t_key key = cb->args[2];
> > + int count = cb->args[3];
> >
> > rcu_read_lock();
>
> Sorry, but I lost the point: is rtnl held or not held here at the moment?
> If held, how this rcu_read_lock can help? Maybe some additional comment
> in the code?
>
> Thanks,
> Jarek P.
There are two different issues, (therefore two different patches).
1. How to handle multipart resume when the key was deleted during the
period the lock was dropped.
That is what this patch addresses.
2. RCU is unnecessary here because of use of RTNL. I am going to defer
on this till after #1. That patch is much less important.
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply
* Re: [PATCH] TCP:Fix a bug in strategy_allowed_congestion_control
From: Stephen Hemminger @ 2008-01-25 16:25 UTC (permalink / raw)
To: shanwei; +Cc: davem, netdev, Sam Jansen
In-Reply-To: <47998B55.1030305@cn.fujitsu.com>
On Fri, 25 Jan 2008 15:10:13 +0800
shanwei <shanwei@cn.fujitsu.com> wrote:
> hi all:
>
> In strategy_allowed_congestion_control of the 2.6.24 kernel,
> when sysctl_string return 1 on success,it should call
> tcp_set_allowed_congestion_control to set the allowed congestion
> control.But, it don't.
> the sysctl_string return 1 on success, otherwise return negative,
> never return 0.The patch fix the problem.
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
>
> diff -Nuarp linux-2.6.24/net/ipv4/sysctl_net_ipv4.c linux-2.6.24-new/net/ipv4/sysctl_net_ipv4.c
> --- linux-2.6.24/net/ipv4/sysctl_net_ipv4.c 2008-01-25 06:58:37.000000000 +0800
> +++ linux-2.6.24-new/net/ipv4/sysctl_net_ipv4.c 2008-01-25 12:23:20.000000000 +0800
> @@ -248,7 +248,7 @@ static int strategy_allowed_congestion_c
>
> tcp_get_available_congestion_control(tbl.data, tbl.maxlen);
> ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen);
> - if (ret == 0 && newval && newlen)
> + if (ret == 1 && newval && newlen)
> ret = tcp_set_allowed_congestion_control(tbl.data);
> kfree(tbl.data);
>
>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
This parallels previous fix by Sam Jansen.
^ permalink raw reply
* Re: [patch net-2.6.25][IPV4][FIB] fix fib_proc compilation error
From: Stephen Hemminger @ 2008-01-25 16:30 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: netdev
In-Reply-To: <4799E489.90008@fr.ibm.com>
EBOGUSWHITESPACE
> +static inline void fib_proc_exit(struct net *net)
> +{
> + return ;
> +}
> #endif
Whole patch is unnecessary, since the fib_proc_init is gone in the tree
going into 2.6.25
^ permalink raw reply
* Re: [PATCH] [NET]: Remove PowerPC code from fec.c
From: Frans Pop @ 2008-01-25 16:31 UTC (permalink / raw)
To: Jochen Friedrich
Cc: galak, geert, gerg, jgarzik, linux-kernel, linux-m68k,
linuxppc-dev, netdev, scottwood, vitb
In-Reply-To: <479A087F.5010305@scram.de>
On Friday 25 January 2008, Jochen Friedrich wrote:
> > Jochen Friedrich wrote:
> >> +++ b/drivers/net/fec.c
> >> @@ -23,6 +23,9 @@
> >> *
> >> * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
> >> * Copyright (c) 2004-2006 Macq Electronique SA.
> >> + *
> >> + * This driver is now only used on ColdFire processors. Remove conditional
> >> + * Powerpc code.
> >> */
> >
> > This comment makes sense for a changelog, but IMO it makes no sense at
> > all to add it to the file.
>
> I just added it to clarify this code is now only used on m68knommu
> (Coldfire). The comments on top are mailny about MPC860T CPUs (PowerPC),
> however the driver is no longer used for these CPUs.
>
> Maybe the wording should be changed to:
>
> This driver is now only used on ColdFire (m68knommu) processors.
> Conditional PowerPC code has been removed.
Yes, that certainly makes more sense, although IMHO the second sentence is
still somewhat redundant. (My problem was mainly with the second sentence.
I should have made that more clear, sorry.)
^ permalink raw reply
* Re: [patch net-2.6.25][IPV4][FIB] fix fib_proc compilation error
From: Stephen Hemminger @ 2008-01-25 16:32 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: netdev
In-Reply-To: <4799E489.90008@fr.ibm.com>
Nevermind, Patch looks fine for 2.6.25, it wasn't needed for 2.6.24
Sorry, need more coffee...
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply
* Re: [PATCH 3/7 net-2.6.25] [IPV4]: Prohibit assignment of 0.0.0.0 as interface address.
From: Stephen Hemminger @ 2008-01-25 16:34 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: netdev
In-Reply-To: <1201269123-20378-3-git-send-email-den@openvz.org>
On Fri, 25 Jan 2008 16:51:59 +0300
"Denis V. Lunev" <den@openvz.org> wrote:
> I could hardly imagine why sombady needs to assign 0.0.0.0 as an interface
> address or interface destination address. The kernel will behave in a strage
> way in several places if this is possible, as ifa_local != 0 is considered
> as initialized/non-initialized state of the ifa.
>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
>
This is used as a way to bring device up in lots of existing documentation.
So please don't change.
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply
* Re: [Bugme-new] [Bug 9811] New: Loopback address to eth0 interface changes scope permanently
From: Bjørn Mork @ 2008-01-25 16:34 UTC (permalink / raw)
To: netdev; +Cc: bugme-daemon
In-Reply-To: <20080125025016.f6b08754.akpm@linux-foundation.org>
>> Latest working kernel version: none
>> Earliest failing kernel version: 2.6.18 (verified, but most likely "any")
Looks like this was introduced in 2.1.68, which makes it a 10 year old
bug :-)
http://www.linuxhq.com/kernel/v2.1/68/net/ipv4/devinet.c
Bjørn
--
You sound like a real wimp
^ permalink raw reply
* Re: [PATCH 1/5] netns netfilter: per-netns ip6tables
From: Alexey Dobriyan @ 2008-01-25 16:39 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netdev, netfilter-devel, devel
In-Reply-To: <4798CBF1.205@trash.net>
On Thu, Jan 24, 2008 at 06:33:37PM +0100, Patrick McHardy wrote:
> Alexey Dobriyan wrote:
> >* Propagate netns from userspace down to xt_find_table_lock()
> >* Register ip6 tables in netns (modules still use init_net)
> >
> >Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
> >---
> >
> > include/linux/netfilter_ipv6/ip6_tables.h | 3 +
> > net/ipv6/netfilter/ip6_tables.c | 50
> > +++++++++++++++---------------
> > net/ipv6/netfilter/ip6table_filter.c | 2 -
> > net/ipv6/netfilter/ip6table_mangle.c | 2 -
> > net/ipv6/netfilter/ip6table_raw.c | 2 -
> > 5 files changed, 31 insertions(+), 28 deletions(-)
>
> This adds checkpatch warnings:
>
> WARNING: line over 80 characters
> #96: FILE: net/ipv6/netfilter/ip6_tables.c:1361:
> +do_add_counters(struct net *net, void __user *user, unsigned int len,
> int compat)
>
> WARNING: line over 80 characters
> #229: FILE: net/ipv6/netfilter/ip6table_filter.c:135:
> + packet_filter = ip6t_register_table(&init_net, &__packet_filter,
> &initial_table.repl);
>
> WARNING: line over 80 characters
> #242: FILE: net/ipv6/netfilter/ip6table_mangle.c:167:
> + packet_mangler = ip6t_register_table(&init_net,
> &__packet_mangler, &initial_table.repl);
>
> WARNING: line over 80 characters
> #255: FILE: net/ipv6/netfilter/ip6table_raw.c:80:
> + packet_raw = ip6t_register_table(&init_net, &__packet_raw,
> &initial_table.repl);
>
> ERROR: Missing Signed-off-by: line(s)
Well, SOB line definitely was present.
> total: 1 errors, 4 warnings, 214 lines checked
>
> I'll fix them up, lets hope that it doesn't cause clashes
> with the following patches.
OK. It was quantum coding style violation. :-)
^ permalink raw reply
* Re: [PATCH] SCTP: Fix kernel panic while received AUTH chunk while enabled auth
From: Vlad Yasevich @ 2008-01-25 16:41 UTC (permalink / raw)
To: Wei Yongjun; +Cc: netdev, lksctp-developers
In-Reply-To: <4794C51B.8040904@cn.fujitsu.com>
Sorry for the delay. Was on vacation without net access.
Wei Yongjun wrote:
>
>
> This patch fix this probleam to treat AUTH chunk as unknow chunk if peer
> has initialized with no auth capable.
>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
>
> --- a/net/sctp/sm_statefuns.c 2008-01-21 00:03:25.000000000 -0500
> +++ b/net/sctp/sm_statefuns.c 2008-01-21 05:14:08.000000000 -0500
> @@ -3785,6 +3785,10 @@ sctp_disposition_t sctp_sf_eat_auth(cons
> struct sctp_chunk *err_chunk;
> sctp_ierror_t error;
>
> + /* Make sure that the peer has AUTH capable */
> + if (!asoc->peer.auth_capable)
> + return sctp_sf_unk_chunk(ep, asoc, type, arg, commands);
> +
> if (!sctp_vtag_verify(chunk, asoc)) {
> sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
> SCTP_NULL());
>
>
>
^ permalink raw reply
* [PATCH 1/3] netns netfilter: semi-rewrite of /proc/net/foo_tables_*
From: Alexey Dobriyan @ 2008-01-25 16:43 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netdev, netfilter-devel, devel
Argh, there are many small but still wrong things with /proc/net/*_tables_*
so I decided to do overhaul simultaneously making it more suitable for
per-netns /proc/net/*_tables_* implementation.
Fix
a) xt_get_idx() duplicating now standard seq_list_start/seq_list_next
iterators
b) tables/matches/targets list was chosen again and again on every ->next
c) multiple useless "af >= NPROTO" checks -- we simple don't supply invalid
AFs there and registration function should BUG_ON instead.
Regardless, the one in ->next() is the most useless -- ->next doesn't
run at all if ->start fails.
d) Don't use mutex_lock_interruptible() -- it can fail and ->stop is
executed even if ->start failed, so unlock without lock is possible.
As side effect, streamline code by splitting xt_tgt_ops into xt_target_ops,
xt_matches_ops, xt_tables_ops.
xt_tables_ops hooks will be changed by per-netns code. Code of
xt_matches_ops, xt_target_ops is identical except the list chosen for
iterating, but I think consolidating code for two files not worth it
given "<< 16" hacks needed for it.
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---
net/netfilter/x_tables.c | 224 ++++++++++++++++++++++++++++++-----------------
1 file changed, 145 insertions(+), 79 deletions(-)
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -726,124 +726,190 @@ void *xt_unregister_table(struct xt_table *table)
EXPORT_SYMBOL_GPL(xt_unregister_table);
#ifdef CONFIG_PROC_FS
-static struct list_head *xt_get_idx(struct list_head *list, struct seq_file *seq, loff_t pos)
+static void *xt_table_seq_start(struct seq_file *seq, loff_t *pos)
{
- struct list_head *head = list->next;
+ struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
+ u_int16_t af = (unsigned long)pde->data;
- if (!head || list_empty(list))
- return NULL;
+ mutex_lock(&xt[af].mutex);
+ return seq_list_start(&init_net.xt.tables[af], *pos);
+}
- while (pos && (head = head->next)) {
- if (head == list)
- return NULL;
- pos--;
- }
- return pos ? NULL : head;
-}
-
-static struct list_head *type2list(u_int16_t af, u_int16_t type)
-{
- struct list_head *list;
-
- switch (type) {
- case TARGET:
- list = &xt[af].target;
- break;
- case MATCH:
- list = &xt[af].match;
- break;
- case TABLE:
- list = &init_net.xt.tables[af];
- break;
- default:
- list = NULL;
- break;
- }
+static void *xt_table_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
+ u_int16_t af = (unsigned long)pde->data;
- return list;
+ return seq_list_next(v, &init_net.xt.tables[af], pos);
}
-static void *xt_tgt_seq_start(struct seq_file *seq, loff_t *pos)
+static void xt_table_seq_stop(struct seq_file *seq, void *v)
{
- struct proc_dir_entry *pde = (struct proc_dir_entry *) seq->private;
- u_int16_t af = (unsigned long)pde->data & 0xffff;
- u_int16_t type = (unsigned long)pde->data >> 16;
- struct list_head *list;
+ struct proc_dir_entry *pde = seq->private;
+ u_int16_t af = (unsigned long)pde->data;
- if (af >= NPROTO)
- return NULL;
+ mutex_unlock(&xt[af].mutex);
+}
- list = type2list(af, type);
- if (!list)
- return NULL;
+static int xt_table_seq_show(struct seq_file *seq, void *v)
+{
+ struct xt_table *table = list_entry(v, struct xt_table, list);
- if (mutex_lock_interruptible(&xt[af].mutex) != 0)
- return NULL;
+ if (strlen(table->name))
+ return seq_printf(seq, "%s\n", table->name);
+ else
+ return 0;
+}
+
+static const struct seq_operations xt_table_seq_ops = {
+ .start = xt_table_seq_start,
+ .next = xt_table_seq_next,
+ .stop = xt_table_seq_stop,
+ .show = xt_table_seq_show,
+};
+
+static int xt_table_open(struct inode *inode, struct file *file)
+{
+ int ret;
+
+ ret = seq_open(file, &xt_table_seq_ops);
+ if (!ret) {
+ struct seq_file *seq = file->private_data;
- return xt_get_idx(list, seq, *pos);
+ seq->private = PDE(inode);
+ }
+ return ret;
}
-static void *xt_tgt_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+static const struct file_operations xt_table_ops = {
+ .owner = THIS_MODULE,
+ .open = xt_table_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
+static void *xt_match_seq_start(struct seq_file *seq, loff_t *pos)
{
- struct proc_dir_entry *pde = seq->private;
- u_int16_t af = (unsigned long)pde->data & 0xffff;
- u_int16_t type = (unsigned long)pde->data >> 16;
- struct list_head *list;
+ struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
+ u_int16_t af = (unsigned long)pde->data;
- if (af >= NPROTO)
- return NULL;
+ mutex_lock(&xt[af].mutex);
+ return seq_list_start(&xt[af].match, *pos);
+}
- list = type2list(af, type);
- if (!list)
- return NULL;
+static void *xt_match_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
+ u_int16_t af = (unsigned long)pde->data;
- (*pos)++;
- return xt_get_idx(list, seq, *pos);
+ return seq_list_next(v, &xt[af].match, pos);
}
-static void xt_tgt_seq_stop(struct seq_file *seq, void *v)
+static void xt_match_seq_stop(struct seq_file *seq, void *v)
{
struct proc_dir_entry *pde = seq->private;
- u_int16_t af = (unsigned long)pde->data & 0xffff;
+ u_int16_t af = (unsigned long)pde->data;
mutex_unlock(&xt[af].mutex);
}
-static int xt_name_seq_show(struct seq_file *seq, void *v)
+static int xt_match_seq_show(struct seq_file *seq, void *v)
{
- char *name = (char *)v + sizeof(struct list_head);
+ struct xt_match *match = list_entry(v, struct xt_match, list);
- if (strlen(name))
- return seq_printf(seq, "%s\n", name);
+ if (strlen(match->name))
+ return seq_printf(seq, "%s\n", match->name);
else
return 0;
}
-static const struct seq_operations xt_tgt_seq_ops = {
- .start = xt_tgt_seq_start,
- .next = xt_tgt_seq_next,
- .stop = xt_tgt_seq_stop,
- .show = xt_name_seq_show,
+static const struct seq_operations xt_match_seq_ops = {
+ .start = xt_match_seq_start,
+ .next = xt_match_seq_next,
+ .stop = xt_match_seq_stop,
+ .show = xt_match_seq_show,
};
-static int xt_tgt_open(struct inode *inode, struct file *file)
+static int xt_match_open(struct inode *inode, struct file *file)
{
int ret;
- ret = seq_open(file, &xt_tgt_seq_ops);
+ ret = seq_open(file, &xt_match_seq_ops);
if (!ret) {
struct seq_file *seq = file->private_data;
- struct proc_dir_entry *pde = PDE(inode);
- seq->private = pde;
+ seq->private = PDE(inode);
}
+ return ret;
+}
+
+static const struct file_operations xt_match_ops = {
+ .owner = THIS_MODULE,
+ .open = xt_match_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
+static void *xt_target_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
+ u_int16_t af = (unsigned long)pde->data;
+
+ mutex_lock(&xt[af].mutex);
+ return seq_list_start(&xt[af].target, *pos);
+}
+
+static void *xt_target_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
+ u_int16_t af = (unsigned long)pde->data;
+
+ return seq_list_next(v, &xt[af].target, pos);
+}
+
+static void xt_target_seq_stop(struct seq_file *seq, void *v)
+{
+ struct proc_dir_entry *pde = seq->private;
+ u_int16_t af = (unsigned long)pde->data;
+
+ mutex_unlock(&xt[af].mutex);
+}
+
+static int xt_target_seq_show(struct seq_file *seq, void *v)
+{
+ struct xt_target *target = list_entry(v, struct xt_target, list);
+
+ if (strlen(target->name))
+ return seq_printf(seq, "%s\n", target->name);
+ else
+ return 0;
+}
+
+static const struct seq_operations xt_target_seq_ops = {
+ .start = xt_target_seq_start,
+ .next = xt_target_seq_next,
+ .stop = xt_target_seq_stop,
+ .show = xt_target_seq_show,
+};
+
+static int xt_target_open(struct inode *inode, struct file *file)
+{
+ int ret;
+ ret = seq_open(file, &xt_target_seq_ops);
+ if (!ret) {
+ struct seq_file *seq = file->private_data;
+
+ seq->private = PDE(inode);
+ }
return ret;
}
-static const struct file_operations xt_file_ops = {
+static const struct file_operations xt_target_ops = {
.owner = THIS_MODULE,
- .open = xt_tgt_open,
+ .open = xt_target_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
@@ -869,25 +935,25 @@ int xt_proto_init(int af)
#ifdef CONFIG_PROC_FS
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_TABLES, sizeof(buf));
- proc = proc_net_fops_create(&init_net, buf, 0440, &xt_file_ops);
+ proc = proc_net_fops_create(&init_net, buf, 0440, &xt_table_ops);
if (!proc)
goto out;
- proc->data = (void *) ((unsigned long) af | (TABLE << 16));
+ proc->data = (void *)(unsigned long)af;
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_MATCHES, sizeof(buf));
- proc = proc_net_fops_create(&init_net, buf, 0440, &xt_file_ops);
+ proc = proc_net_fops_create(&init_net, buf, 0440, &xt_match_ops);
if (!proc)
goto out_remove_tables;
- proc->data = (void *) ((unsigned long) af | (MATCH << 16));
+ proc->data = (void *)(unsigned long)af;
strlcpy(buf, xt_prefix[af], sizeof(buf));
strlcat(buf, FORMAT_TARGETS, sizeof(buf));
- proc = proc_net_fops_create(&init_net, buf, 0440, &xt_file_ops);
+ proc = proc_net_fops_create(&init_net, buf, 0440, &xt_target_ops);
if (!proc)
goto out_remove_matches;
- proc->data = (void *) ((unsigned long) af | (TARGET << 16));
+ proc->data = (void *)(unsigned long)af;
#endif
return 0;
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox