* [PATCH 0/4] au1000_eth platform device/driver conversion
From: Florian Fainelli @ 2009-07-28 21:00 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Manuel Lauss, David Miller, linux-mips, netdev
Hi Ralf, David, Manuel,
The following patches convert the AMD Alchemy au1000_eth driver
to become a platform device/driver. The patches are splitted that way:
PATCH 1: set up the infrastructure in the board code to register au1000_eth as
as platform device.
PATCH 2: convert au1000_eth to become a real platform driver
PATCH 3: add infrastructure to pass PHY informations to the au1000_eth driver
PATCH 4: use those platform_data PHY informations in the au1000_eth driver
The result is a driver which is equally functionnal with no platform-related ifdefs
aiming towards easier integration of the upcoming Alchemy 1300 SoC. The conversion
was made in two times to ease code review as the driver was a real ifdef mess prior
to these changes.
David, on top of this series I send driver cleanups.
Thanks !
--
Best regards, Florian Fainelli
Email: florian@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
-------------------------------
^ permalink raw reply
* Re: [PATCH v2 2/2] IPVS: use pr_err and friends instead of IP_VS_ERR and friends
From: Joe Perches @ 2009-07-28 20:56 UTC (permalink / raw)
To: Hannes Eder; +Cc: lvs-devel, netdev, linux-kernel, Jan Engelhardt
In-Reply-To: <20090728203554.7654.29628.stgit@jazzy.zrh.corp.google.com>
On Tue, 2009-07-28 at 22:35 +0200, Hannes Eder wrote:
> Since pr_err and friends is used instead of printk there is not point
> in keeping IP_VS_ERR and friends.
> + pr_err("Schedule: port zero only supported "
> + "in persistent services, "
> + "check your ipvs configuration\n");
You might consider ignoring the checkpatch 80 char limit here
and consolidate the message into a single string.
It helps when grepping.
> @@ -377,8 +377,8 @@ static int ip_vs_svc_hash(struct ip_vs_service *svc)
> static int ip_vs_svc_unhash(struct ip_vs_service *svc)
> {
> if (!(svc->flags & IP_VS_SVC_F_HASHED)) {
> - IP_VS_ERR("ip_vs_svc_unhash(): request for unhash flagged, "
> - "called from %p\n", __builtin_return_address(0));
> + pr_err("ip_vs_svc_unhash(): request for unhash flagged, "
> + "called from %p\n", __builtin_return_address(0));
Maybe use something like:
"%s(): <foo> called from %pf",
__func__, __builtin_return_address(0)
^ permalink raw reply
* [PATCH v2 2/2] IPVS: use pr_err and friends instead of IP_VS_ERR and friends
From: Hannes Eder @ 2009-07-28 20:35 UTC (permalink / raw)
To: lvs-devel, netdev; +Cc: Joe Perches, linux-kernel, Jan Engelhardt
In-Reply-To: <20090728203414.7654.73236.stgit@jazzy.zrh.corp.google.com>
Since pr_err and friends is used instead of printk there is not point
in keeping IP_VS_ERR and friends.
Signed-off-by: Hannes Eder <heder@google.com>
include/net/ip_vs.h | 3 --
net/netfilter/ipvs/ip_vs_conn.c | 12 ++++----
net/netfilter/ipvs/ip_vs_core.c | 22 +++++++--------
net/netfilter/ipvs/ip_vs_ctl.c | 56 +++++++++++++++++++-------------------
net/netfilter/ipvs/ip_vs_dh.c | 2 +
net/netfilter/ipvs/ip_vs_ftp.c | 4 +--
net/netfilter/ipvs/ip_vs_lblc.c | 4 +--
net/netfilter/ipvs/ip_vs_lblcr.c | 6 ++--
net/netfilter/ipvs/ip_vs_proto.c | 2 +
net/netfilter/ipvs/ip_vs_sched.c | 36 ++++++++++++------------
net/netfilter/ipvs/ip_vs_sh.c | 2 +
net/netfilter/ipvs/ip_vs_sync.c | 46 ++++++++++++++++---------------
net/netfilter/ipvs/ip_vs_wrr.c | 2 +
13 files changed, 97 insertions(+), 100 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index b0bd782..582ac56 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -150,9 +150,6 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
#endif
#define IP_VS_BUG() BUG()
-#define IP_VS_ERR(msg...) pr_err(msg)
-#define IP_VS_INFO(msg...) pr_info(msg)
-#define IP_VS_WARNING(msg...) pr_warning(msg)
#define IP_VS_ERR_RL(msg...) \
do { \
if (net_ratelimit()) \
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index e613745..6d9b855 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -154,8 +154,8 @@ static inline int ip_vs_conn_hash(struct ip_vs_conn *cp)
atomic_inc(&cp->refcnt);
ret = 1;
} else {
- IP_VS_ERR("ip_vs_conn_hash(): request for already hashed, "
- "called from %p\n", __builtin_return_address(0));
+ pr_err("ip_vs_conn_hash(): request for already hashed, "
+ "called from %p\n", __builtin_return_address(0));
ret = 0;
}
@@ -1087,10 +1087,10 @@ int __init ip_vs_conn_init(void)
return -ENOMEM;
}
- IP_VS_INFO("Connection hash table configured "
- "(size=%d, memory=%ldKbytes)\n",
- IP_VS_CONN_TAB_SIZE,
- (long)(IP_VS_CONN_TAB_SIZE*sizeof(struct list_head))/1024);
+ pr_info("Connection hash table configured "
+ "(size=%d, memory=%ldKbytes)\n",
+ IP_VS_CONN_TAB_SIZE,
+ (long)(IP_VS_CONN_TAB_SIZE*sizeof(struct list_head))/1024);
IP_VS_DBG(0, "Each connection entry needs %Zd bytes at least\n",
sizeof(struct ip_vs_conn));
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 6811dca..ad29e41 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -391,9 +391,9 @@ ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
*/
if (!svc->fwmark && pptr[1] != svc->port) {
if (!svc->port)
- IP_VS_ERR("Schedule: port zero only supported "
- "in persistent services, "
- "check your ipvs configuration\n");
+ pr_err("Schedule: port zero only supported "
+ "in persistent services, "
+ "check your ipvs configuration\n");
return NULL;
}
@@ -667,8 +667,8 @@ static int handle_response_icmp(int af, struct sk_buff *skb,
unsigned int verdict = NF_DROP;
if (IP_VS_FWD_METHOD(cp) != 0) {
- IP_VS_ERR("shouldn't reach here, because the box is on the "
- "half connection in the tun/dr module.\n");
+ pr_err("shouldn't reach here, because the box is on the "
+ "half connection in the tun/dr module.\n");
}
/* Ensure the checksum is correct */
@@ -1490,7 +1490,7 @@ static int __init ip_vs_init(void)
ret = ip_vs_control_init();
if (ret < 0) {
- IP_VS_ERR("can't setup control.\n");
+ pr_err("can't setup control.\n");
goto cleanup_estimator;
}
@@ -1498,23 +1498,23 @@ static int __init ip_vs_init(void)
ret = ip_vs_app_init();
if (ret < 0) {
- IP_VS_ERR("can't setup application helper.\n");
+ pr_err("can't setup application helper.\n");
goto cleanup_protocol;
}
ret = ip_vs_conn_init();
if (ret < 0) {
- IP_VS_ERR("can't setup connection table.\n");
+ pr_err("can't setup connection table.\n");
goto cleanup_app;
}
ret = nf_register_hooks(ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
if (ret < 0) {
- IP_VS_ERR("can't register hooks.\n");
+ pr_err("can't register hooks.\n");
goto cleanup_conn;
}
- IP_VS_INFO("ipvs loaded.\n");
+ pr_info("ipvs loaded.\n");
return ret;
cleanup_conn:
@@ -1537,7 +1537,7 @@ static void __exit ip_vs_cleanup(void)
ip_vs_protocol_cleanup();
ip_vs_control_cleanup();
ip_vs_estimator_cleanup();
- IP_VS_INFO("ipvs unloaded.\n");
+ pr_info("ipvs unloaded.\n");
}
module_init(ip_vs_init);
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 83a7ab6..965adc9 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -343,8 +343,8 @@ static int ip_vs_svc_hash(struct ip_vs_service *svc)
unsigned hash;
if (svc->flags & IP_VS_SVC_F_HASHED) {
- IP_VS_ERR("ip_vs_svc_hash(): request for already hashed, "
- "called from %p\n", __builtin_return_address(0));
+ pr_err("ip_vs_svc_hash(): request for already hashed, "
+ "called from %p\n", __builtin_return_address(0));
return 0;
}
@@ -377,8 +377,8 @@ static int ip_vs_svc_hash(struct ip_vs_service *svc)
static int ip_vs_svc_unhash(struct ip_vs_service *svc)
{
if (!(svc->flags & IP_VS_SVC_F_HASHED)) {
- IP_VS_ERR("ip_vs_svc_unhash(): request for unhash flagged, "
- "called from %p\n", __builtin_return_address(0));
+ pr_err("ip_vs_svc_unhash(): request for unhash flagged, "
+ "called from %p\n", __builtin_return_address(0));
return 0;
}
@@ -844,7 +844,7 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest,
dest = kzalloc(sizeof(struct ip_vs_dest), GFP_ATOMIC);
if (dest == NULL) {
- IP_VS_ERR("ip_vs_new_dest: kmalloc failed.\n");
+ pr_err("ip_vs_new_dest: kmalloc failed.\n");
return -ENOMEM;
}
@@ -888,13 +888,13 @@ ip_vs_add_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest)
EnterFunction(2);
if (udest->weight < 0) {
- IP_VS_ERR("ip_vs_add_dest(): server weight less than zero\n");
+ pr_err("ip_vs_add_dest(): server weight less than zero\n");
return -ERANGE;
}
if (udest->l_threshold > udest->u_threshold) {
- IP_VS_ERR("ip_vs_add_dest(): lower threshold is higher than "
- "upper threshold\n");
+ pr_err("ip_vs_add_dest(): lower threshold is higher than "
+ "upper threshold\n");
return -ERANGE;
}
@@ -1000,13 +1000,13 @@ ip_vs_edit_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest)
EnterFunction(2);
if (udest->weight < 0) {
- IP_VS_ERR("ip_vs_edit_dest(): server weight less than zero\n");
+ pr_err("ip_vs_edit_dest(): server weight less than zero\n");
return -ERANGE;
}
if (udest->l_threshold > udest->u_threshold) {
- IP_VS_ERR("ip_vs_edit_dest(): lower threshold is higher than "
- "upper threshold\n");
+ pr_err("ip_vs_edit_dest(): lower threshold is higher than "
+ "upper threshold\n");
return -ERANGE;
}
@@ -1164,8 +1164,8 @@ ip_vs_add_service(struct ip_vs_service_user_kern *u,
/* Lookup the scheduler by 'u->sched_name' */
sched = ip_vs_scheduler_get(u->sched_name);
if (sched == NULL) {
- IP_VS_INFO("Scheduler module ip_vs_%s not found\n",
- u->sched_name);
+ pr_info("Scheduler module ip_vs_%s not found\n",
+ u->sched_name);
ret = -ENOENT;
goto out_mod_dec;
}
@@ -1262,8 +1262,8 @@ ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user_kern *u)
*/
sched = ip_vs_scheduler_get(u->sched_name);
if (sched == NULL) {
- IP_VS_INFO("Scheduler module ip_vs_%s not found\n",
- u->sched_name);
+ pr_info("Scheduler module ip_vs_%s not found\n",
+ u->sched_name);
return -ENOENT;
}
old_sched = sched;
@@ -2094,8 +2094,8 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
return -EPERM;
if (len != set_arglen[SET_CMDID(cmd)]) {
- IP_VS_ERR("set_ctl: len %u != %u\n",
- len, set_arglen[SET_CMDID(cmd)]);
+ pr_err("set_ctl: len %u != %u\n",
+ len, set_arglen[SET_CMDID(cmd)]);
return -EINVAL;
}
@@ -2146,9 +2146,9 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
/* Check for valid protocol: TCP or UDP, even for fwmark!=0 */
if (usvc.protocol != IPPROTO_TCP && usvc.protocol != IPPROTO_UDP) {
- IP_VS_ERR("set_ctl: invalid protocol: %d %pI4:%d %s\n",
- usvc.protocol, &usvc.addr.ip,
- ntohs(usvc.port), usvc.sched_name);
+ pr_err("set_ctl: invalid protocol: %d %pI4:%d %s\n",
+ usvc.protocol, &usvc.addr.ip,
+ ntohs(usvc.port), usvc.sched_name);
ret = -EFAULT;
goto out_unlock;
}
@@ -2373,8 +2373,8 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
return -EPERM;
if (*len < get_arglen[GET_CMDID(cmd)]) {
- IP_VS_ERR("get_ctl: len %u < %u\n",
- *len, get_arglen[GET_CMDID(cmd)]);
+ pr_err("get_ctl: len %u < %u\n",
+ *len, get_arglen[GET_CMDID(cmd)]);
return -EINVAL;
}
@@ -2419,7 +2419,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
size = sizeof(*get) +
sizeof(struct ip_vs_service_entry) * get->num_services;
if (*len != size) {
- IP_VS_ERR("length: %u != %u\n", *len, size);
+ pr_err("length: %u != %u\n", *len, size);
ret = -EINVAL;
goto out;
}
@@ -2459,7 +2459,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
size = sizeof(*get) +
sizeof(struct ip_vs_dest_entry) * get->num_dests;
if (*len != size) {
- IP_VS_ERR("length: %u != %u\n", *len, size);
+ pr_err("length: %u != %u\n", *len, size);
ret = -EINVAL;
goto out;
}
@@ -3187,7 +3187,7 @@ static int ip_vs_genl_get_cmd(struct sk_buff *skb, struct genl_info *info)
else if (cmd == IPVS_CMD_GET_CONFIG)
reply_cmd = IPVS_CMD_SET_CONFIG;
else {
- IP_VS_ERR("unknown Generic Netlink command\n");
+ pr_err("unknown Generic Netlink command\n");
return -EINVAL;
}
@@ -3252,7 +3252,7 @@ static int ip_vs_genl_get_cmd(struct sk_buff *skb, struct genl_info *info)
goto out;
nla_put_failure:
- IP_VS_ERR("not enough space in Netlink message\n");
+ pr_err("not enough space in Netlink message\n");
ret = -EMSGSIZE;
out_err:
@@ -3397,13 +3397,13 @@ int __init ip_vs_control_init(void)
ret = nf_register_sockopt(&ip_vs_sockopts);
if (ret) {
- IP_VS_ERR("cannot register sockopt.\n");
+ pr_err("cannot register sockopt.\n");
return ret;
}
ret = ip_vs_genl_register();
if (ret) {
- IP_VS_ERR("cannot register Generic Netlink interface.\n");
+ pr_err("cannot register Generic Netlink interface.\n");
nf_unregister_sockopt(&ip_vs_sockopts);
return ret;
}
diff --git a/net/netfilter/ipvs/ip_vs_dh.c b/net/netfilter/ipvs/ip_vs_dh.c
index d0c0594..3510b8a 100644
--- a/net/netfilter/ipvs/ip_vs_dh.c
+++ b/net/netfilter/ipvs/ip_vs_dh.c
@@ -150,7 +150,7 @@ static int ip_vs_dh_init_svc(struct ip_vs_service *svc)
tbl = kmalloc(sizeof(struct ip_vs_dh_bucket)*IP_VS_DH_TAB_SIZE,
GFP_ATOMIC);
if (tbl == NULL) {
- IP_VS_ERR("ip_vs_dh_init_svc(): no memory\n");
+ pr_err("ip_vs_dh_init_svc(): no memory\n");
return -ENOMEM;
}
svc->sched_data = tbl;
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index 9c16a3f..33e2c79 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -385,8 +385,8 @@ static int __init ip_vs_ftp_init(void)
ret = register_ip_vs_app_inc(app, app->protocol, ports[i]);
if (ret)
break;
- IP_VS_INFO("%s: loaded support on port[%d] = %d\n",
- app->name, i, ports[i]);
+ pr_info("%s: loaded support on port[%d] = %d\n",
+ app->name, i, ports[i]);
}
if (ret)
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index 66f625b..930eda7 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -205,7 +205,7 @@ ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr,
if (!en) {
en = kmalloc(sizeof(*en), GFP_ATOMIC);
if (!en) {
- IP_VS_ERR("ip_vs_lblc_new(): no memory\n");
+ pr_err("ip_vs_lblc_new(): no memory\n");
return NULL;
}
@@ -338,7 +338,7 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc)
*/
tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC);
if (tbl == NULL) {
- IP_VS_ERR("ip_vs_lblc_init_svc(): no memory\n");
+ pr_err("ip_vs_lblc_init_svc(): no memory\n");
return -ENOMEM;
}
svc->sched_data = tbl;
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index 63cca2b..4b3e7f6 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -111,7 +111,7 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
e = kmalloc(sizeof(*e), GFP_ATOMIC);
if (e == NULL) {
- IP_VS_ERR("ip_vs_dest_set_insert(): no memory\n");
+ pr_err("ip_vs_dest_set_insert(): no memory\n");
return NULL;
}
@@ -380,7 +380,7 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr,
if (!en) {
en = kmalloc(sizeof(*en), GFP_ATOMIC);
if (!en) {
- IP_VS_ERR("ip_vs_lblcr_new(): no memory\n");
+ pr_err("ip_vs_lblcr_new(): no memory\n");
return NULL;
}
@@ -514,7 +514,7 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
*/
tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC);
if (tbl == NULL) {
- IP_VS_ERR("ip_vs_lblcr_init_svc(): no memory\n");
+ pr_err("ip_vs_lblcr_init_svc(): no memory\n");
return -ENOMEM;
}
svc->sched_data = tbl;
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index a95bc40..85c8892 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -262,7 +262,7 @@ int __init ip_vs_protocol_init(void)
#ifdef CONFIG_IP_VS_PROTO_ESP
REGISTER_PROTOCOL(&ip_vs_protocol_esp);
#endif
- IP_VS_INFO("Registered protocols (%s)\n", &protocols[2]);
+ pr_info("Registered protocols (%s)\n", &protocols[2]);
return 0;
}
diff --git a/net/netfilter/ipvs/ip_vs_sched.c b/net/netfilter/ipvs/ip_vs_sched.c
index 87bc5ea..727e412 100644
--- a/net/netfilter/ipvs/ip_vs_sched.c
+++ b/net/netfilter/ipvs/ip_vs_sched.c
@@ -47,11 +47,11 @@ int ip_vs_bind_scheduler(struct ip_vs_service *svc,
int ret;
if (svc == NULL) {
- IP_VS_ERR("ip_vs_bind_scheduler(): svc arg NULL\n");
+ pr_err("ip_vs_bind_scheduler(): svc arg NULL\n");
return -EINVAL;
}
if (scheduler == NULL) {
- IP_VS_ERR("ip_vs_bind_scheduler(): scheduler arg NULL\n");
+ pr_err("ip_vs_bind_scheduler(): scheduler arg NULL\n");
return -EINVAL;
}
@@ -60,7 +60,7 @@ int ip_vs_bind_scheduler(struct ip_vs_service *svc,
if (scheduler->init_service) {
ret = scheduler->init_service(svc);
if (ret) {
- IP_VS_ERR("ip_vs_bind_scheduler(): init error\n");
+ pr_err("ip_vs_bind_scheduler(): init error\n");
return ret;
}
}
@@ -77,19 +77,19 @@ int ip_vs_unbind_scheduler(struct ip_vs_service *svc)
struct ip_vs_scheduler *sched;
if (svc == NULL) {
- IP_VS_ERR("ip_vs_unbind_scheduler(): svc arg NULL\n");
+ pr_err("ip_vs_unbind_scheduler(): svc arg NULL\n");
return -EINVAL;
}
sched = svc->scheduler;
if (sched == NULL) {
- IP_VS_ERR("ip_vs_unbind_scheduler(): svc isn't bound\n");
+ pr_err("ip_vs_unbind_scheduler(): svc isn't bound\n");
return -EINVAL;
}
if (sched->done_service) {
if (sched->done_service(svc) != 0) {
- IP_VS_ERR("ip_vs_unbind_scheduler(): done error\n");
+ pr_err("ip_vs_unbind_scheduler(): done error\n");
return -EINVAL;
}
}
@@ -173,12 +173,12 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
struct ip_vs_scheduler *sched;
if (!scheduler) {
- IP_VS_ERR("register_ip_vs_scheduler(): NULL arg\n");
+ pr_err("register_ip_vs_scheduler(): NULL arg\n");
return -EINVAL;
}
if (!scheduler->name) {
- IP_VS_ERR("register_ip_vs_scheduler(): NULL scheduler_name\n");
+ pr_err("register_ip_vs_scheduler(): NULL scheduler_name\n");
return -EINVAL;
}
@@ -190,8 +190,8 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
if (!list_empty(&scheduler->n_list)) {
write_unlock_bh(&__ip_vs_sched_lock);
ip_vs_use_count_dec();
- IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler "
- "already linked\n", scheduler->name);
+ pr_err("register_ip_vs_scheduler(): [%s] scheduler "
+ "already linked\n", scheduler->name);
return -EINVAL;
}
@@ -203,9 +203,9 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
if (strcmp(scheduler->name, sched->name) == 0) {
write_unlock_bh(&__ip_vs_sched_lock);
ip_vs_use_count_dec();
- IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler "
- "already existed in the system\n",
- scheduler->name);
+ pr_err("register_ip_vs_scheduler(): [%s] scheduler "
+ "already existed in the system\n",
+ scheduler->name);
return -EINVAL;
}
}
@@ -215,7 +215,7 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
list_add(&scheduler->n_list, &ip_vs_schedulers);
write_unlock_bh(&__ip_vs_sched_lock);
- IP_VS_INFO("[%s] scheduler registered.\n", scheduler->name);
+ pr_info("[%s] scheduler registered.\n", scheduler->name);
return 0;
}
@@ -227,15 +227,15 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
{
if (!scheduler) {
- IP_VS_ERR( "unregister_ip_vs_scheduler(): NULL arg\n");
+ pr_err("unregister_ip_vs_scheduler(): NULL arg\n");
return -EINVAL;
}
write_lock_bh(&__ip_vs_sched_lock);
if (list_empty(&scheduler->n_list)) {
write_unlock_bh(&__ip_vs_sched_lock);
- IP_VS_ERR("unregister_ip_vs_scheduler(): [%s] scheduler "
- "is not in the list. failed\n", scheduler->name);
+ pr_err("unregister_ip_vs_scheduler(): [%s] scheduler "
+ "is not in the list. failed\n", scheduler->name);
return -EINVAL;
}
@@ -248,7 +248,7 @@ int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
/* decrease the module use count */
ip_vs_use_count_dec();
- IP_VS_INFO("[%s] scheduler unregistered.\n", scheduler->name);
+ pr_info("[%s] scheduler unregistered.\n", scheduler->name);
return 0;
}
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c
index fb4d2d2..f7c7ffa 100644
--- a/net/netfilter/ipvs/ip_vs_sh.c
+++ b/net/netfilter/ipvs/ip_vs_sh.c
@@ -147,7 +147,7 @@ static int ip_vs_sh_init_svc(struct ip_vs_service *svc)
tbl = kmalloc(sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE,
GFP_ATOMIC);
if (tbl == NULL) {
- IP_VS_ERR("ip_vs_sh_init_svc(): no memory\n");
+ pr_err("ip_vs_sh_init_svc(): no memory\n");
return -ENOMEM;
}
svc->sched_data = tbl;
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index cc04c99..018af17 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -246,7 +246,7 @@ void ip_vs_sync_conn(struct ip_vs_conn *cp)
if (!curr_sb) {
if (!(curr_sb=ip_vs_sync_buff_create())) {
spin_unlock(&curr_sb_lock);
- IP_VS_ERR("ip_vs_sync_buff_create failed.\n");
+ pr_err("ip_vs_sync_buff_create failed.\n");
return;
}
}
@@ -412,7 +412,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
if (dest)
atomic_dec(&dest->refcnt);
if (!cp) {
- IP_VS_ERR("ip_vs_conn_new failed\n");
+ pr_err("ip_vs_conn_new failed\n");
return;
}
} else if (!cp->dest) {
@@ -580,8 +580,8 @@ static int bind_mcastif_addr(struct socket *sock, char *ifname)
addr = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE);
if (!addr)
- IP_VS_ERR("You probably need to specify IP address on "
- "multicast interface.\n");
+ pr_err("You probably need to specify IP address on "
+ "multicast interface.\n");
IP_VS_DBG(7, "binding socket with (%s) %pI4\n",
ifname, &addr);
@@ -605,13 +605,13 @@ static struct socket * make_send_sock(void)
/* First create a socket */
result = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock);
if (result < 0) {
- IP_VS_ERR("Error during creation of socket; terminating\n");
+ pr_err("Error during creation of socket; terminating\n");
return ERR_PTR(result);
}
result = set_mcast_if(sock->sk, ip_vs_master_mcast_ifn);
if (result < 0) {
- IP_VS_ERR("Error setting outbound mcast interface\n");
+ pr_err("Error setting outbound mcast interface\n");
goto error;
}
@@ -620,14 +620,14 @@ static struct socket * make_send_sock(void)
result = bind_mcastif_addr(sock, ip_vs_master_mcast_ifn);
if (result < 0) {
- IP_VS_ERR("Error binding address of the mcast interface\n");
+ pr_err("Error binding address of the mcast interface\n");
goto error;
}
result = sock->ops->connect(sock, (struct sockaddr *) &mcast_addr,
sizeof(struct sockaddr), 0);
if (result < 0) {
- IP_VS_ERR("Error connecting to the multicast addr\n");
+ pr_err("Error connecting to the multicast addr\n");
goto error;
}
@@ -650,7 +650,7 @@ static struct socket * make_receive_sock(void)
/* First create a socket */
result = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock);
if (result < 0) {
- IP_VS_ERR("Error during creation of socket; terminating\n");
+ pr_err("Error during creation of socket; terminating\n");
return ERR_PTR(result);
}
@@ -660,7 +660,7 @@ static struct socket * make_receive_sock(void)
result = sock->ops->bind(sock, (struct sockaddr *) &mcast_addr,
sizeof(struct sockaddr));
if (result < 0) {
- IP_VS_ERR("Error binding to the multicast addr\n");
+ pr_err("Error binding to the multicast addr\n");
goto error;
}
@@ -669,7 +669,7 @@ static struct socket * make_receive_sock(void)
(struct in_addr *) &mcast_addr.sin_addr,
ip_vs_backup_mcast_ifn);
if (result < 0) {
- IP_VS_ERR("Error joining to the multicast group\n");
+ pr_err("Error joining to the multicast group\n");
goto error;
}
@@ -709,7 +709,7 @@ ip_vs_send_sync_msg(struct socket *sock, struct ip_vs_sync_mesg *msg)
msg->size = htons(msg->size);
if (ip_vs_send_async(sock, (char *)msg, msize) != msize)
- IP_VS_ERR("ip_vs_send_async error\n");
+ pr_err("ip_vs_send_async error\n");
}
static int
@@ -740,9 +740,9 @@ static int sync_thread_master(void *data)
struct ip_vs_sync_thread_data *tinfo = data;
struct ip_vs_sync_buff *sb;
- IP_VS_INFO("sync thread started: state = MASTER, mcast_ifn = %s, "
- "syncid = %d\n",
- ip_vs_master_mcast_ifn, ip_vs_master_syncid);
+ pr_info("sync thread started: state = MASTER, mcast_ifn = %s, "
+ "syncid = %d\n",
+ ip_vs_master_mcast_ifn, ip_vs_master_syncid);
while (!kthread_should_stop()) {
while ((sb = sb_dequeue())) {
@@ -783,9 +783,9 @@ static int sync_thread_backup(void *data)
struct ip_vs_sync_thread_data *tinfo = data;
int len;
- IP_VS_INFO("sync thread started: state = BACKUP, mcast_ifn = %s, "
- "syncid = %d\n",
- ip_vs_backup_mcast_ifn, ip_vs_backup_syncid);
+ pr_info("sync thread started: state = BACKUP, mcast_ifn = %s, "
+ "syncid = %d\n",
+ ip_vs_backup_mcast_ifn, ip_vs_backup_syncid);
while (!kthread_should_stop()) {
wait_event_interruptible(*tinfo->sock->sk->sk_sleep,
@@ -797,7 +797,7 @@ static int sync_thread_backup(void *data)
len = ip_vs_receive(tinfo->sock, tinfo->buf,
sync_recv_mesg_maxlen);
if (len <= 0) {
- IP_VS_ERR("receiving message error\n");
+ pr_err("receiving message error\n");
break;
}
@@ -910,8 +910,8 @@ int stop_sync_thread(int state)
if (!sync_master_thread)
return -ESRCH;
- IP_VS_INFO("stopping master sync thread %d ...\n",
- task_pid_nr(sync_master_thread));
+ pr_info("stopping master sync thread %d ...\n",
+ task_pid_nr(sync_master_thread));
/*
* The lock synchronizes with sb_queue_tail(), so that we don't
@@ -928,8 +928,8 @@ int stop_sync_thread(int state)
if (!sync_backup_thread)
return -ESRCH;
- IP_VS_INFO("stopping backup sync thread %d ...\n",
- task_pid_nr(sync_backup_thread));
+ pr_info("stopping backup sync thread %d ...\n",
+ task_pid_nr(sync_backup_thread));
ip_vs_sync_state &= ~IP_VS_STATE_BACKUP;
kthread_stop(sync_backup_thread);
diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c
index c39ebb6..86772f2 100644
--- a/net/netfilter/ipvs/ip_vs_wrr.c
+++ b/net/netfilter/ipvs/ip_vs_wrr.c
@@ -97,7 +97,7 @@ static int ip_vs_wrr_init_svc(struct ip_vs_service *svc)
*/
mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_ATOMIC);
if (mark == NULL) {
- IP_VS_ERR("ip_vs_wrr_init_svc(): no memory\n");
+ pr_err("ip_vs_wrr_init_svc(): no memory\n");
return -ENOMEM;
}
mark->cl = &svc->destinations;
^ permalink raw reply related
* [PATCH v2 1/2] IPVS: use pr_fmt
From: Hannes Eder @ 2009-07-28 20:35 UTC (permalink / raw)
To: lvs-devel, netdev; +Cc: Joe Perches, linux-kernel, Jan Engelhardt
In-Reply-To: <20090728203414.7654.73236.stgit@jazzy.zrh.corp.google.com>
While being at it cleanup whitespace.
Signed-off-by: Hannes Eder <heder@google.com>
include/net/ip_vs.h | 119 ++++++++++++++++---------------
net/netfilter/ipvs/ip_vs_app.c | 3 +
net/netfilter/ipvs/ip_vs_conn.c | 3 +
net/netfilter/ipvs/ip_vs_core.c | 3 +
net/netfilter/ipvs/ip_vs_ctl.c | 3 +
net/netfilter/ipvs/ip_vs_dh.c | 3 +
net/netfilter/ipvs/ip_vs_est.c | 4 +
net/netfilter/ipvs/ip_vs_ftp.c | 3 +
net/netfilter/ipvs/ip_vs_lblc.c | 3 +
net/netfilter/ipvs/ip_vs_lblcr.c | 3 +
net/netfilter/ipvs/ip_vs_lc.c | 3 +
net/netfilter/ipvs/ip_vs_nq.c | 3 +
net/netfilter/ipvs/ip_vs_proto.c | 7 +-
net/netfilter/ipvs/ip_vs_proto_ah_esp.c | 7 +-
net/netfilter/ipvs/ip_vs_proto_tcp.c | 3 +
net/netfilter/ipvs/ip_vs_proto_udp.c | 3 +
net/netfilter/ipvs/ip_vs_rr.c | 3 +
net/netfilter/ipvs/ip_vs_sched.c | 3 +
net/netfilter/ipvs/ip_vs_sed.c | 3 +
net/netfilter/ipvs/ip_vs_sh.c | 3 +
net/netfilter/ipvs/ip_vs_sync.c | 3 +
net/netfilter/ipvs/ip_vs_wlc.c | 3 +
net/netfilter/ipvs/ip_vs_wrr.c | 3 +
net/netfilter/ipvs/ip_vs_xmit.c | 3 +
24 files changed, 134 insertions(+), 63 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index e01cc2d..b0bd782 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -99,47 +99,47 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
return &buf[*idx - len];
}
-#define IP_VS_DBG_BUF(level, msg...) \
- do { \
- char ip_vs_dbg_buf[160]; \
- int ip_vs_dbg_idx = 0; \
- if (level <= ip_vs_get_debug_level()) \
- printk(KERN_DEBUG "IPVS: " msg); \
- } while (0)
-#define IP_VS_ERR_BUF(msg...) \
- do { \
- char ip_vs_dbg_buf[160]; \
- int ip_vs_dbg_idx = 0; \
- printk(KERN_ERR "IPVS: " msg); \
- } while (0)
+#define IP_VS_DBG_BUF(level, msg, ...) \
+ do { \
+ char ip_vs_dbg_buf[160]; \
+ int ip_vs_dbg_idx = 0; \
+ if (level <= ip_vs_get_debug_level()) \
+ printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
+ } while (0)
+#define IP_VS_ERR_BUF(msg...) \
+ do { \
+ char ip_vs_dbg_buf[160]; \
+ int ip_vs_dbg_idx = 0; \
+ pr_err(msg); \
+ } while (0)
/* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */
-#define IP_VS_DBG_ADDR(af, addr) \
- ip_vs_dbg_addr(af, ip_vs_dbg_buf, \
- sizeof(ip_vs_dbg_buf), addr, \
- &ip_vs_dbg_idx)
-
-#define IP_VS_DBG(level, msg...) \
- do { \
- if (level <= ip_vs_get_debug_level()) \
- printk(KERN_DEBUG "IPVS: " msg); \
- } while (0)
-#define IP_VS_DBG_RL(msg...) \
- do { \
- if (net_ratelimit()) \
- printk(KERN_DEBUG "IPVS: " msg); \
- } while (0)
-#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \
- do { \
- if (level <= ip_vs_get_debug_level()) \
- pp->debug_packet(pp, skb, ofs, msg); \
- } while (0)
-#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \
- do { \
- if (level <= ip_vs_get_debug_level() && \
- net_ratelimit()) \
- pp->debug_packet(pp, skb, ofs, msg); \
- } while (0)
+#define IP_VS_DBG_ADDR(af, addr) \
+ ip_vs_dbg_addr(af, ip_vs_dbg_buf, \
+ sizeof(ip_vs_dbg_buf), addr, \
+ &ip_vs_dbg_idx)
+
+#define IP_VS_DBG(level, msg, ...) \
+ do { \
+ if (level <= ip_vs_get_debug_level()) \
+ printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
+ } while (0)
+#define IP_VS_DBG_RL(msg, ...) \
+ do { \
+ if (net_ratelimit()) \
+ printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
+ } while (0)
+#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \
+ do { \
+ if (level <= ip_vs_get_debug_level()) \
+ pp->debug_packet(pp, skb, ofs, msg); \
+ } while (0)
+#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \
+ do { \
+ if (level <= ip_vs_get_debug_level() && \
+ net_ratelimit()) \
+ pp->debug_packet(pp, skb, ofs, msg); \
+ } while (0)
#else /* NO DEBUGGING at ALL */
#define IP_VS_DBG_BUF(level, msg...) do {} while (0)
#define IP_VS_ERR_BUF(msg...) do {} while (0)
@@ -150,29 +150,30 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
#endif
#define IP_VS_BUG() BUG()
-#define IP_VS_ERR(msg...) printk(KERN_ERR "IPVS: " msg)
-#define IP_VS_INFO(msg...) printk(KERN_INFO "IPVS: " msg)
-#define IP_VS_WARNING(msg...) \
- printk(KERN_WARNING "IPVS: " msg)
-#define IP_VS_ERR_RL(msg...) \
- do { \
- if (net_ratelimit()) \
- printk(KERN_ERR "IPVS: " msg); \
- } while (0)
+#define IP_VS_ERR(msg...) pr_err(msg)
+#define IP_VS_INFO(msg...) pr_info(msg)
+#define IP_VS_WARNING(msg...) pr_warning(msg)
+#define IP_VS_ERR_RL(msg...) \
+ do { \
+ if (net_ratelimit()) \
+ pr_err(msg); \
+ } while (0)
#ifdef CONFIG_IP_VS_DEBUG
#define EnterFunction(level) \
- do { \
- if (level <= ip_vs_get_debug_level()) \
- printk(KERN_DEBUG "Enter: %s, %s line %i\n", \
- __func__, __FILE__, __LINE__); \
- } while (0)
-#define LeaveFunction(level) \
- do { \
- if (level <= ip_vs_get_debug_level()) \
- printk(KERN_DEBUG "Leave: %s, %s line %i\n", \
- __func__, __FILE__, __LINE__); \
- } while (0)
+ do { \
+ if (level <= ip_vs_get_debug_level()) \
+ printk(KERN_DEBUG \
+ pr_fmt("Enter: %s, %s line %i\n"), \
+ __func__, __FILE__, __LINE__); \
+ } while (0)
+#define LeaveFunction(level) \
+ do { \
+ if (level <= ip_vs_get_debug_level()) \
+ printk(KERN_DEBUG \
+ pr_fmt("Leave: %s, %s line %i\n"), \
+ __func__, __FILE__, __LINE__); \
+ } while (0)
#else
#define EnterFunction(level) do {} while (0)
#define LeaveFunction(level) do {} while (0)
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index 201b8ea..c1781f8 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -18,6 +18,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 928af1c..e613745 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -22,6 +22,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/net.h>
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 8dddb17..6811dca 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -24,6 +24,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ip.h>
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index beaf129..83a7ab6 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -18,6 +18,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
diff --git a/net/netfilter/ipvs/ip_vs_dh.c b/net/netfilter/ipvs/ip_vs_dh.c
index a9dac74..d0c0594 100644
--- a/net/netfilter/ipvs/ip_vs_dh.c
+++ b/net/netfilter/ipvs/ip_vs_dh.c
@@ -35,6 +35,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/ip.h>
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c
index 2eb2860..702b53c 100644
--- a/net/netfilter/ipvs/ip_vs_est.c
+++ b/net/netfilter/ipvs/ip_vs_est.c
@@ -11,6 +11,10 @@
* Changes:
*
*/
+
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/kernel.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index 428edbf..9c16a3f 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -22,6 +22,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index 537a7a1..66f625b 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -39,6 +39,9 @@
* me to write this module.
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/ip.h>
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index c8f8687..63cca2b 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -37,6 +37,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/ip.h>
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_lc.c b/net/netfilter/ipvs/ip_vs_lc.c
index d0dadc8..4ecd5e1 100644
--- a/net/netfilter/ipvs/ip_vs_lc.c
+++ b/net/netfilter/ipvs/ip_vs_lc.c
@@ -14,6 +14,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_nq.c b/net/netfilter/ipvs/ip_vs_nq.c
index 694952d..2224478 100644
--- a/net/netfilter/ipvs/ip_vs_nq.c
+++ b/net/netfilter/ipvs/ip_vs_nq.c
@@ -31,6 +31,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index a01520e..a95bc40 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -13,6 +13,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
@@ -181,7 +184,7 @@ ip_vs_tcpudp_debug_packet_v4(struct ip_vs_protocol *pp,
&ih->daddr, ntohs(pptr[1]));
}
- printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf);
+ pr_debug("%s: %s\n", msg, buf);
}
#ifdef CONFIG_IP_VS_IPV6
@@ -215,7 +218,7 @@ ip_vs_tcpudp_debug_packet_v6(struct ip_vs_protocol *pp,
&ih->daddr, ntohs(pptr[1]));
}
- printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf);
+ pr_debug("%s: %s\n", msg, buf);
}
#endif
diff --git a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
index 79f56c1..c30b43c 100644
--- a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
@@ -10,6 +10,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/module.h>
@@ -138,7 +141,7 @@ ah_esp_debug_packet_v4(struct ip_vs_protocol *pp, const struct sk_buff *skb,
sprintf(buf, "%s %pI4->%pI4",
pp->name, &ih->saddr, &ih->daddr);
- printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf);
+ pr_debug("%s: %s\n", msg, buf);
}
#ifdef CONFIG_IP_VS_IPV6
@@ -156,7 +159,7 @@ ah_esp_debug_packet_v6(struct ip_vs_protocol *pp, const struct sk_buff *skb,
sprintf(buf, "%s %pI6->%pI6",
pp->name, &ih->saddr, &ih->daddr);
- printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf);
+ pr_debug("%s: %s\n", msg, buf);
}
#endif
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c
index 8cba418..c36c80d 100644
--- a/net/netfilter/ipvs/ip_vs_proto_tcp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c
@@ -13,6 +13,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/kernel.h>
#include <linux/ip.h>
#include <linux/tcp.h> /* for tcphdr */
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c
index d2930a7..96ebe40 100644
--- a/net/netfilter/ipvs/ip_vs_proto_udp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_udp.c
@@ -13,6 +13,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_rr.c b/net/netfilter/ipvs/ip_vs_rr.c
index 2d16ab7..b01007e 100644
--- a/net/netfilter/ipvs/ip_vs_rr.c
+++ b/net/netfilter/ipvs/ip_vs_rr.c
@@ -19,6 +19,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_sched.c b/net/netfilter/ipvs/ip_vs_sched.c
index a46ad9e..87bc5ea 100644
--- a/net/netfilter/ipvs/ip_vs_sched.c
+++ b/net/netfilter/ipvs/ip_vs_sched.c
@@ -17,6 +17,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
diff --git a/net/netfilter/ipvs/ip_vs_sed.c b/net/netfilter/ipvs/ip_vs_sed.c
index 20e4657..4f745dd 100644
--- a/net/netfilter/ipvs/ip_vs_sed.c
+++ b/net/netfilter/ipvs/ip_vs_sed.c
@@ -35,6 +35,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c
index 75709eb..fb4d2d2 100644
--- a/net/netfilter/ipvs/ip_vs_sh.c
+++ b/net/netfilter/ipvs/ip_vs_sh.c
@@ -32,6 +32,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/ip.h>
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 5c48378..cc04c99 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -17,6 +17,9 @@
* Justin Ossevoort : Fix endian problem on sync message size.
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/inetdevice.h>
diff --git a/net/netfilter/ipvs/ip_vs_wlc.c b/net/netfilter/ipvs/ip_vs_wlc.c
index 8e94256..bbddfdb 100644
--- a/net/netfilter/ipvs/ip_vs_wlc.c
+++ b/net/netfilter/ipvs/ip_vs_wlc.c
@@ -19,6 +19,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c
index f7d74ef..c39ebb6 100644
--- a/net/netfilter/ipvs/ip_vs_wrr.c
+++ b/net/netfilter/ipvs/ip_vs_wrr.c
@@ -18,6 +18,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/net.h>
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 425ab14..e5e0025 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -13,6 +13,9 @@
*
*/
+#define KMSG_COMPONENT "IPVS"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
#include <linux/kernel.h>
#include <linux/tcp.h> /* for tcphdr */
#include <net/ip.h>
^ permalink raw reply related
* [PATCH v2 0/2] IPVS: make use of pr_fmt and friends
From: Hannes Eder @ 2009-07-28 20:35 UTC (permalink / raw)
To: lvs-devel, netdev; +Cc: Joe Perches, linux-kernel, Jan Engelhardt
The following series makes use of pr_fmt and friends instead of printk.
v2: use printk instead of pr_debug
Hannes Eder (2):
IPVS: use pr_err and friends instead of IP_VS_ERR and friends
IPVS: use pr_fmt
include/net/ip_vs.h | 116 +++++++++++++++----------------
net/netfilter/ipvs/ip_vs_app.c | 3 +
net/netfilter/ipvs/ip_vs_conn.c | 15 ++--
net/netfilter/ipvs/ip_vs_core.c | 25 ++++---
net/netfilter/ipvs/ip_vs_ctl.c | 59 ++++++++--------
net/netfilter/ipvs/ip_vs_dh.c | 5 +
net/netfilter/ipvs/ip_vs_est.c | 4 +
net/netfilter/ipvs/ip_vs_ftp.c | 7 +-
net/netfilter/ipvs/ip_vs_lblc.c | 7 +-
net/netfilter/ipvs/ip_vs_lblcr.c | 9 ++
net/netfilter/ipvs/ip_vs_lc.c | 3 +
net/netfilter/ipvs/ip_vs_nq.c | 3 +
net/netfilter/ipvs/ip_vs_proto.c | 9 ++
net/netfilter/ipvs/ip_vs_proto_ah_esp.c | 7 +-
net/netfilter/ipvs/ip_vs_proto_tcp.c | 3 +
net/netfilter/ipvs/ip_vs_proto_udp.c | 3 +
net/netfilter/ipvs/ip_vs_rr.c | 3 +
net/netfilter/ipvs/ip_vs_sched.c | 39 ++++++----
net/netfilter/ipvs/ip_vs_sed.c | 3 +
net/netfilter/ipvs/ip_vs_sh.c | 5 +
net/netfilter/ipvs/ip_vs_sync.c | 49 +++++++------
net/netfilter/ipvs/ip_vs_wlc.c | 3 +
net/netfilter/ipvs/ip_vs_wrr.c | 5 +
net/netfilter/ipvs/ip_vs_xmit.c | 3 +
24 files changed, 228 insertions(+), 160 deletions(-)
^ permalink raw reply
* Re: [PATCH 5/5] c/r: Add AF_UNIX support (v6)
From: Dan Smith @ 2009-07-28 20:34 UTC (permalink / raw)
To: Oren Laadan; +Cc: containers, Alexey Dobriyan, netdev
In-Reply-To: <4A6F2D62.9040005@librato.com>
OL> obj_sock_users() is only required for objects that are to be
OL> tested for leaks in full container checkpoint. I don't think it's
OL> needed, because the relation sock <-> file is 1-to-1. (If it
OL> were, then you would also need to collect sockets).
Okay, that also answers the question posed by John in the other
thread.
OL> (Actually, I will remove checkpoint_bad and restore_bad and modify
OL> checkpoint_obj() and restore_obj() to fail if the respective
OL> method is NULL).
Okay, should I expect that to show up in v17-dev soon?
OL> Nit: I already got confused a few times because of the similar
OL> names. Perhaps change CKPT_HDR_SOCKET_BUFFERS to
OL> CKPT_HDR_SOCKET_QUEUE (and adjust the header name accordingly).
Agreed. I remember writing that and remarking to myself how
ridiculous of a name it was, but never went back to change it.
OL> Unless/until we decide otherwise, let's keep all ckpt_hdr_xxx
OL> definitions in a single place -- checkpoint_hdr.h
That's how I initially had it, but Serge asked for it to be moved into
the network headers. Serge?
OL> Unless you intend to use the struct name 'ckpt_socket' elsewhere,
OL> can we get rid of it (leaving only 'struct {') ?
Yep.
OL> Can you use fill_name() from checkpoint/file.c ?
Yeah, looks like it.
OL> This direct call to ->getname skips security checks through
OL> getsockname(). You may want to refactor sys_getsockname() similar
OL> to sys_bind().
Okay.
>> + if ((h->sock.userlocks & SOCK_SNDBUF_LOCK) &&
>> + ((h->sock.sndbuf < SOCK_MIN_SNDBUF) ||
>> + (h->sock.sndbuf > sysctl_wmem_max)))
>> + return -EINVAL;
OL> At least for afunix, if the user did not explicitly set the
OL> sndbuf, then userlocks won't have SOCK_SNDBUF_LOCK set.
OL> Also, if userlocks in the image doesn't have SOCK_SNDBUF_LOCK,
OL> then the sndbuf value isn't checked ?
I think I was thinking that I only needed to verify the buffer value
if the user claimed to have set it (as if it would be ignored
otherwise), but that doesn't seem right. So, I think the proper
thing to do here is always check it (i.e., remove the first check of
the lock).
OL> What about verifying sock.flags itself ?
OL> In doing that, some options may assume/require some state --
OL> - SOCK_USE_WRITE_QUEUE only used in ipv4/ipv6/sctp
OL> - SOCK_DESTROY only used in some protocols
OL> Perhaps sanitize sock.flags per protocol ?
Hmm, okay.
OL> Many of these direct copy into the socket and sock effectively
OL> bypass security checks that take place in {get,set}sockopt(),
OL> either explicitly (e.g. sk_sndtimeo) or implicitly (e.g.
OL> SOCK_LINGER in sock.flags, reflecting SO_LINGER option).
OL> This applies both to checkpoint (potentially bypassing permission
OL> of the checkpointer to view this data) and restart (bypassing
OL> permissions of user to set these values).
OL> The alternative is to use socksetopt/sockgetopt for those values
OL> that should be subject to security checks.
Yeah, I suppose so. I've resisted that thus far because it will make
the sync operation so much harder to read, but I suppose it's
unavoidable.
OL> There should also be per-protocol consistency checks. E.g. afunix
OL> cannot be in socket.state == SS_{DIS,}CONNECTING
I suppose so, but I don't see anything in af_unix.c that seems to care :)
OL> Better yet: -ENOSYS ?
Okay.
>> + ret = kernel_sendmsg(sock->sk_socket, &msg, &kvec, 1, len);
OL> Is it possible to avoid the extra copy using splice() instead ?
It's possible, but it will require some refactoring to get access to
all the right pointers. I'd propose we push that optimization out
until after we've got these patches integrated into the c/r tree.
OL> SOCK_DEAD in sk->flags may also pose a problem. (Do we at all
OL> need to checkpoint and/or restore SOCK_DEAD ?!)
Is there any reasonable way we could arrive at a SOCK_DEAD socket via
a valid descriptor?
OL> Hmm... this test is quite hidden here - maybe a fat comment with a
OL> reference to why it's here and what it is doing ?
Sure.
>> + else {
>> + ckpt_debug("Buffer total %u exceeds limit %u\n",
>> + h->total_bytes, *bufsize);
>> + ret = -EINVAL;
>> + goto out;
>> + }
>> + }
>> +
>> + for (i = 0; i < h->skb_count; i++) {
>> + ret = sock_read_buffer(ctx, sock);
>> + ckpt_debug("read buffer %i: %i\n", i, ret);
>> + if (ret < 0)
>> + break;
>> +
>> + total += ret;
>> + if (total > h->total_bytes) {
OL> What if 'total' overflows (for CAP_NET_ADMIN) ? perhaps:
OL> if (total > h->total_bytes || total < ret) {
Actually, I've changed this locally to require fewer variables and
special cases. Let me know when I re-post if you don't think it's a
better way to handle this.
OL> Does the following bypass security checks for sys_connect() ?
I don't think so. We're basically replicating sys_socketpair() here,
which does not do a security check, presumably because all you're
doing is hooking two sockets together that both belong to you. That's
not to say that we're as safe as that limited operation, but I don't
think it's totally clear. Perhaps someone more confident will
comment.
>> + /* Prime the socket's buffer limit with the maximum */
>> + peer->sk_userlocks |= SOCK_SNDBUF_LOCK;
>> + peer->sk_sndbuf = sysctl_wmem_max;
OL> I suppose this meant to be temporary ?
Right, it will be overridden when we synchronize the socket
properties. I'll strengthen the comment.
OL> It is indeed a good idea to make it generic for all sockets, but I
OL> suspect the way sock_read_buffers() works will only be suitable
OL> for afunix, and perhaps for in-container inet4/6 (by
OL> "in-container" I mean that both sides of the connection are in the
OL> checkpoint image).
Yeah, I meant to put a comment in the commit log about this. As I
mentioned before, I was hoping to put most of the effort into the UNIX
patch and move forward with that as we iterate on the INET patch.
Thus, this was part of the buffer restore re-swizzle that clearly
won't work for INET. In the meantime I've been working on the INET
patch and splitting it up while retaining the necessary behavioral
changes made here. In my next posting these should look better.
OL> Hmm... does the code below work well with dgram sockets who
OL> received data from the peer, and then the peer died (before
OL> checkpoint) ?
I'm not sure that I've replicated that exact scenario in my tests.
However, when we're restoring socket A with outstanding incoming
buffers, we restore them via B. If B is not in a reasonable state, I
put it back into connected state to appease the sendmsg function and
restore it when complete. See the "unshutdown" comment.
>> +static struct file *sock_alloc_attach_fd(struct socket *socket)
OL> Nit: I think this name is misleading - sock_attach_fd() itself is
OL> already and should have been sock_attach_file() IMHO - so perhaps
OL> s/fd/file here ?
The name was chosen to reflect the fact that we're allocating a socket
and then calling sock_attach_fd() on it. If you think it's less
misleading to be inconsistent with the other call, I'll change it, but
I wouldn't really agree... :)
Thanks!
--
Dan Smith
IBM Linux Technology Center
email: danms@us.ibm.com
^ permalink raw reply
* Re: [RFC] [PATCH] Don't run __qdisc_run() on a stopped TX queue
From: David Miller @ 2009-07-28 20:02 UTC (permalink / raw)
To: herbert; +Cc: jarkao2, krkumar2, netdev
In-Reply-To: <20090728084451.GA26299@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 28 Jul 2009 16:44:51 +0800
> Well the fact that as it stands the only true multiqueue qdisc
> is the default is a mere coincidence. There is no fundamental
> reason why non-default qdiscs cannot be made multiqueue aware,
> well, for some of them anyway.
>
> For example, sfq can naturally be enhanced as a multiqueue qdisc
> just like the default qdisc.
>
> So I don't think we want to prejudice what a future non-default
> qdisc may support.
The idea is that it cannot be done anywhere we currently
limits, decisions, etc. are all done with "device" scope.
And I think SFQ even falls into that category.
You would need a special SFQ that makes sure to break down traffic
identically to how the TX queue selection divides traffic, and even
then I'm not even so sure how implementable that is.
^ permalink raw reply
* Re: [RFC] [PATCH] Don't run __qdisc_run() on a stopped TX queue
From: David Miller @ 2009-07-28 19:59 UTC (permalink / raw)
To: herbert; +Cc: krkumar2, jarkao2, netdev
In-Reply-To: <20090728071247.GA25611@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 28 Jul 2009 15:12:47 +0800
> However, in that case you'll now have two locks bouncing around
> instead of one and my guess would be that the cache overhead
> would offset any gain that is made from the parallel processing.
The premise is that there'd be only one. The qdisc lock.
If the traffic is distributed, flow wise, the driver XMIT
lock would spread due to multiqueue.
^ permalink raw reply
* [Resent][PATCH 1/1] inet6: functions shadow global variable
From: Gerrit Renker @ 2009-07-28 19:48 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1248028721-24244-3-git-send-email-gerrit@erg.abdn.ac.uk>
There was no further response on the RFC, I am resending it as a fix.
>>>>>>>>>>>>>>>>>>>>>>>>> Patch v1 (resent) <<<<<<<<<<<<<<<<<<<<<<<<
inet6: local functions shadow global pointer
This renames away a variable clash:
* ipv6_table[] is declared as a static global table;
* ipv6_sysctl_net_init() uses ipv6_table to refer/destroy dynamic memory;
* ipv6_sysctl_net_exit() also uses ipv6_table for the same purpose;
* both the two last functions call kfree() on ipv6_table.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
net/ipv6/sysctl_net_ipv6.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -40,7 +40,7 @@ static ctl_table ipv6_table_template[] =
{ .ctl_name = 0 }
};
-static ctl_table ipv6_table[] = {
+static ctl_table ipv6_rotable[] = {
{
.ctl_name = NET_IPV6_MLD_MAX_MSF,
.procname = "mld_max_msf",
@@ -130,7 +130,7 @@ int ipv6_sysctl_register(void)
{
int err = -ENOMEM;
- ip6_header = register_net_sysctl_rotable(net_ipv6_ctl_path, ipv6_table);
+ ip6_header = register_net_sysctl_rotable(net_ipv6_ctl_path, ipv6_rotable);
if (ip6_header == NULL)
goto out;
^ permalink raw reply
* Re: [PATCH V2] CAN: Add Flexcan CAN controller driver
From: Wolfgang Grandegger @ 2009-07-28 19:41 UTC (permalink / raw)
To: Sascha Hauer; +Cc: Oliver Hartkopp, Socketcan-core, Linux Netdev List
In-Reply-To: <20090728145354.GX2714@pengutronix.de>
Sascha Hauer wrote:
> On Tue, Jul 28, 2009 at 04:48:34PM +0200, Oliver Hartkopp wrote:
>> Sascha Hauer wrote:
>>> On Tue, Jul 28, 2009 at 04:12:10PM +0200, Oliver Hartkopp wrote:
>>>> Oliver Hartkopp wrote:
>>>>> Sascha Hauer wrote:
>>>>>>>> +
>>>>>>>> + if (frame->can_id & CAN_RTR_FLAG)
>>>>>>>> + dlc |= MB_CNT_RTR;
>>>>>>>> +
>>>>>>>> + writel(dlc, ®s->cantxfg[TX_BUF_ID].can_dlc);
>>>>>>>> + writel(can_id, ®s->cantxfg[TX_BUF_ID].can_id);
>>>> Are you sure, that this is correct?
>>> Yes, I am sure, at least on my hardware.
>> I looked into the writel() macro which does a cpu_to_le32() to the value -
>> sorry that i did not check this before ...
>>
>>>> Indeed i wonder, if it would make sense to skip the entire struct flexcan_mb
>>>> approach and fiddle byte-by-byte inside the registers ...
>>> You'll have to to 32 bit accesses to get it right on little and big
>>> endian.
>>>
>>> what we can do is:
>>>
>>> writel(can_data[0] << 24 | can_data[1] << 16 | can_data[2] << 8 | can_data[3],
>>> msg_buf + 0x8);
>> This looks easier to understand and makes things clear, when you look into the
>> specification.
>
> Ok, I'll change it like this.
OK, even if I do not really share Oliver's concerns. The second write
could be suppressed if dlc <= 4.
Wolfgang.
^ permalink raw reply
* Re: [PATCH NEXT] netxen: fix CONFIG_INET=n build
From: Randy Dunlap @ 2009-07-28 19:23 UTC (permalink / raw)
To: Dhananjay Phadke; +Cc: davem, netdev, linux-kernel, linux-next
In-Reply-To: <1248808203-9578-1-git-send-email-dhananjay@netxen.com>
On Tue, 28 Jul 2009 12:10:03 -0700 Dhananjay Phadke wrote:
> Wrap dest IP hashing code with #ifdef CONFIG_INET,
> this feature makes no sense without INET, but other
> driver can still work.
>
> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Thanks.
> ---
> drivers/net/netxen/netxen_nic_main.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
> index 2bbefa6..40549a0 100644
> --- a/drivers/net/netxen/netxen_nic_main.c
> +++ b/drivers/net/netxen/netxen_nic_main.c
> @@ -1875,6 +1875,8 @@ static void netxen_nic_poll_controller(struct net_device *netdev)
> }
> #endif
>
> +#ifdef CONFIG_INET
> +
> #define is_netxen_netdev(dev) (dev->netdev_ops == &netxen_netdev_ops)
>
> static int
> @@ -1993,6 +1995,7 @@ static struct notifier_block netxen_netdev_cb = {
> static struct notifier_block netxen_inetaddr_cb = {
> .notifier_call = netxen_inetaddr_event,
> };
> +#endif
>
> static struct pci_driver netxen_driver = {
> .name = netxen_nic_driver_name,
> @@ -2012,8 +2015,10 @@ static int __init netxen_init_module(void)
> if ((netxen_workq = create_singlethread_workqueue("netxen")) == NULL)
> return -ENOMEM;
>
> +#ifdef CONFIG_INET
> register_netdevice_notifier(&netxen_netdev_cb);
> register_inetaddr_notifier(&netxen_inetaddr_cb);
> +#endif
>
> return pci_register_driver(&netxen_driver);
> }
> @@ -2024,8 +2029,10 @@ static void __exit netxen_exit_module(void)
> {
> pci_unregister_driver(&netxen_driver);
>
> +#ifdef CONFIG_INET
> unregister_inetaddr_notifier(&netxen_inetaddr_cb);
> unregister_netdevice_notifier(&netxen_netdev_cb);
> +#endif
> destroy_workqueue(netxen_workq);
> }
>
> --
> 1.6.0.2
>
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
^ permalink raw reply
* [PATCH NEXT] netxen: fix CONFIG_INET=n build
From: Dhananjay Phadke @ 2009-07-28 19:10 UTC (permalink / raw)
To: davem; +Cc: netdev, randy.dunlap, linux-kernel, linux-next
Wrap dest IP hashing code with #ifdef CONFIG_INET,
this feature makes no sense without INET, but other
driver can still work.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic_main.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 2bbefa6..40549a0 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1875,6 +1875,8 @@ static void netxen_nic_poll_controller(struct net_device *netdev)
}
#endif
+#ifdef CONFIG_INET
+
#define is_netxen_netdev(dev) (dev->netdev_ops == &netxen_netdev_ops)
static int
@@ -1993,6 +1995,7 @@ static struct notifier_block netxen_netdev_cb = {
static struct notifier_block netxen_inetaddr_cb = {
.notifier_call = netxen_inetaddr_event,
};
+#endif
static struct pci_driver netxen_driver = {
.name = netxen_nic_driver_name,
@@ -2012,8 +2015,10 @@ static int __init netxen_init_module(void)
if ((netxen_workq = create_singlethread_workqueue("netxen")) == NULL)
return -ENOMEM;
+#ifdef CONFIG_INET
register_netdevice_notifier(&netxen_netdev_cb);
register_inetaddr_notifier(&netxen_inetaddr_cb);
+#endif
return pci_register_driver(&netxen_driver);
}
@@ -2024,8 +2029,10 @@ static void __exit netxen_exit_module(void)
{
pci_unregister_driver(&netxen_driver);
+#ifdef CONFIG_INET
unregister_inetaddr_notifier(&netxen_inetaddr_cb);
unregister_netdevice_notifier(&netxen_netdev_cb);
+#endif
destroy_workqueue(netxen_workq);
}
--
1.6.0.2
^ permalink raw reply related
* Re: [stable] netfilter -stable 00/08: netfilter -stable fixes
From: Greg KH @ 2009-07-28 19:04 UTC (permalink / raw)
To: Patrick McHardy; +Cc: stable, netdev, netfilter-devel
In-Reply-To: <20090723141523.19029.89290.sendpatchset@x2.localnet>
On Thu, Jul 23, 2009 at 04:15:24PM +0200, Patrick McHardy wrote:
> Following are couple of netfilter fixes for -stable, fixing
All queued up, thanks.
greg k-h
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Add networking wireless drivers section
From: Joe Perches @ 2009-07-28 18:48 UTC (permalink / raw)
To: David Miller
Cc: linville, julia, netdev, linux-kernel, kernel-janitors,
linux-wireless
In-Reply-To: <20090728.113353.08715297.davem@davemloft.net>
On Tue, 2009-07-28 at 11:33 -0700, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Tue, 28 Jul 2009 11:06:37 -0700
>
> > On Tue, 2009-07-28 at 10:30 -0700, David Miller wrote:
> >> Wireless patches need to be CC:'d to linux-wireless so that
> >> John Linville can notice and pick them up
> >
> > Signed-off-by: Joe Perches <joe@perches.com>
>
> Why not just create a plain "WIRELESS" umbrella entry
> that contains all of drivers/net/wireless, net/mac80211,
> and net/wireless?
Whatever works for John I suppose.
John, do you have a preference?
I was trying to avoid the "S: Maintained" label
and was copying the form of this section:
NETWORKING DRIVERS
L: netdev@vger.kernel.org
W: http://www.linuxfoundation.org/en/Net
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
S: Odd Fixes
F: drivers/net/
^ permalink raw reply
* Re: [PATCH] pppoe: fix race at init time
From: Cyrill Gorcunov @ 2009-07-28 18:48 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S. Miller, Pavel Emelyanov, Igor M Podlesny, Andrew Morton,
netdev
In-Reply-To: <4A6F397D.6010606@gmail.com>
[Eric Dumazet - Tue, Jul 28, 2009 at 07:46:37PM +0200]
...
| So Igor still has a panic... lets try a third patch then :)
|
| [PATCH] pppoe: fix race at init time
|
| I believe we have a race in ppoe_init() :
|
| As soon as dev_add_pack(&pppoes_ptype); and/or dev_add_pack(&pppoed_ptype);
| are called, we can receive packets while nets not yet fully ready
| (ie : pppoe_init_net() not yet called)
|
| This means we should be prepared to get a NULL pointer
| from net_generic(net, pppoe_net_id) call.
|
| We miss this NULL check in get_item() and possibly crash if this nets
| has no struct pppoe_net attached yet. Other subroutines
| are safe.
Hmm. It seems the problem is not in pppoe_init_net since it's
called *before* dev_add_pack via register_pernet_gen_device
(which is protected by a global net mutex). Or I miss something?
(sorry guys I have quite a limited internet connection this week)
-- Cyrill
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Add networking wireless drivers section
From: David Miller @ 2009-07-28 18:34 UTC (permalink / raw)
To: joe
Cc: randy.dunlap, linville, julia, netdev, linux-kernel,
kernel-janitors, linux-wireless
In-Reply-To: <1248805627.18284.11.camel@Joe-Laptop.home>
From: Joe Perches <joe@perches.com>
Date: Tue, 28 Jul 2009 11:27:07 -0700
> On Tue, 2009-07-28 at 11:15 -0700, Randy Dunlap wrote:
>> On Tue, 28 Jul 2009 11:06:37 -0700 Joe Perches wrote:
>> > On Tue, 2009-07-28 at 10:30 -0700, David Miller wrote:
>> > > Wireless patches need to be CC:'d to linux-wireless so that
>> > > John Linville can notice and pick them up
>> > Signed-off-by: Joe Perches <joe@perches.com>
>> > diff --git a/MAINTAINERS b/MAINTAINERS
>> > index ebc2691..0574aad 100644
>> > --- a/MAINTAINERS
>> > +++ b/MAINTAINERS
>> > @@ -4186,6 +4186,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
>> > S: Odd Fixes
>> > F: drivers/net/
>> >
>> > +NETWORKING WIRELESS DRIVERS
>> > +L: linux-wireless@vger.kernel.org
>> > +T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
>> > +S: Odd Fixes
>> > +F: drivers/net/wireless/
>> > +
>>
>> Already have this:
>>
>> NETWORKING [WIRELESS]
>> P: John W. Linville
>> M: linville@tuxdriver.com
>> L: linux-wireless@vger.kernel.org
>> T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
>> S: Maintained
>> F: net/wireless/
>> F: include/net/ieee80211*
>> F: include/linux/wireless.h
>
> That section does not include drivers/net/wireless/
So just add it.
> I believe John Linville isn't maintaining all the
> wireless drivers, he's acting as a gatekeeper in
> a similar role as DavidM for drivers/net/.
It still needs to hit his inbox and linux-wireless
regardless.
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Add networking wireless drivers section
From: David Miller @ 2009-07-28 18:33 UTC (permalink / raw)
To: joe; +Cc: linville, julia, netdev, linux-kernel, kernel-janitors,
linux-wireless
In-Reply-To: <1248804397.18284.5.camel@Joe-Laptop.home>
From: Joe Perches <joe@perches.com>
Date: Tue, 28 Jul 2009 11:06:37 -0700
> On Tue, 2009-07-28 at 10:30 -0700, David Miller wrote:
>> Wireless patches need to be CC:'d to linux-wireless so that
>> John Linville can notice and pick them up
>
> Signed-off-by: Joe Perches <joe@perches.com>
Why not just create a plain "WIRELESS" umbrella entry
that contains all of drivers/net/wireless, net/mac80211,
and net/wireless?
^ permalink raw reply
* Re: [PATCH -next] netxen: fix build when CONFIG_INET=n
From: Randy Dunlap @ 2009-07-28 18:32 UTC (permalink / raw)
To: Dhananjay Phadke
Cc: Stephen Rothwell, davem@davemloft.net, linux-next@vger.kernel.org,
LKML, netdev
In-Reply-To: <7608421F3572AB4292BB2532AE89D5658187610C1C@AVEXMB1.qlogic.org>
On Tue, 28 Jul 2009 11:25:19 -0700 Dhananjay Phadke wrote:
> Thanks Randy for catching, I didn't run CONFIG_INET=n build.
>
> I think, better option is to wrap code in netxen_nic_main.c with CONFIG_INET check,
> since it's not a mandatory feature.
OK, I'll leave that to you then.
> -Dhananjay
> ________________________________________
> From: Randy Dunlap [randy.dunlap@oracle.com]
> Sent: Tuesday, July 28, 2009 11:21 AM
> To: Stephen Rothwell; davem@davemloft.net
> Cc: linux-next@vger.kernel.org; LKML; netdev; Dhananjay Phadke
> Subject: [PATCH -next] netxen: fix build when CONFIG_INET=n
>
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Fix netxen build errors when CONFIG_INET=n:
>
> netxen_nic_main.c:(.text+0x1abb8a): undefined reference to `in_dev_finish_destroy'
> netxen_nic_main.c:(.init.text+0xd86e): undefined reference to `register_inetaddr_notifier'
> netxen_nic_main.c:(.exit.text+0x1b70): undefined reference to `unregister_inetaddr_notifier'
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> Cc: Dhananjay Phadke <dhananjay@netxen.com>
> ---
> drivers/net/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20090728.orig/drivers/net/Kconfig
> +++ linux-next-20090728/drivers/net/Kconfig
> @@ -2666,7 +2666,7 @@ config MYRI10GE_DCA
>
> config NETXEN_NIC
> tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC"
> - depends on PCI
> + depends on PCI && INET
> help
> This enables the support for NetXen's Gigabit Ethernet card.
>
>
>
>
> ---
> ~Randy
> LPC 2009, Sept. 23-25, Portland, Oregon
> http://linuxplumbersconf.org/2009/
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Add networking wireless drivers section
From: Joe Perches @ 2009-07-28 18:27 UTC (permalink / raw)
To: Randy Dunlap
Cc: David Miller, John W. Linville, julia, netdev, linux-kernel,
kernel-janitors, linux-wireless
In-Reply-To: <20090728111552.528a2c9a.randy.dunlap@oracle.com>
On Tue, 2009-07-28 at 11:15 -0700, Randy Dunlap wrote:
> On Tue, 28 Jul 2009 11:06:37 -0700 Joe Perches wrote:
> > On Tue, 2009-07-28 at 10:30 -0700, David Miller wrote:
> > > Wireless patches need to be CC:'d to linux-wireless so that
> > > John Linville can notice and pick them up
> > Signed-off-by: Joe Perches <joe@perches.com>
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index ebc2691..0574aad 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -4186,6 +4186,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
> > S: Odd Fixes
> > F: drivers/net/
> >
> > +NETWORKING WIRELESS DRIVERS
> > +L: linux-wireless@vger.kernel.org
> > +T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
> > +S: Odd Fixes
> > +F: drivers/net/wireless/
> > +
>
> Already have this:
>
> NETWORKING [WIRELESS]
> P: John W. Linville
> M: linville@tuxdriver.com
> L: linux-wireless@vger.kernel.org
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
> S: Maintained
> F: net/wireless/
> F: include/net/ieee80211*
> F: include/linux/wireless.h
That section does not include drivers/net/wireless/
I believe John Linville isn't maintaining all the
wireless drivers, he's acting as a gatekeeper in
a similar role as DavidM for drivers/net/.
The patch above means scripts/get_maintainer.pl can
use the linux-wireless@vger list email address for
any change in driver/net/wireless/
^ permalink raw reply
* RE: [PATCH -next] netxen: fix build when CONFIG_INET=n
From: Dhananjay Phadke @ 2009-07-28 18:25 UTC (permalink / raw)
To: Randy Dunlap, Stephen Rothwell, davem@davemloft.net
Cc: linux-next@vger.kernel.org, LKML, netdev
In-Reply-To: <20090728112103.81f229d6.randy.dunlap@oracle.com>
Thanks Randy for catching, I didn't run CONFIG_INET=n build.
I think, better option is to wrap code in netxen_nic_main.c with CONFIG_INET check,
since it's not a mandatory feature.
-Dhananjay
________________________________________
From: Randy Dunlap [randy.dunlap@oracle.com]
Sent: Tuesday, July 28, 2009 11:21 AM
To: Stephen Rothwell; davem@davemloft.net
Cc: linux-next@vger.kernel.org; LKML; netdev; Dhananjay Phadke
Subject: [PATCH -next] netxen: fix build when CONFIG_INET=n
From: Randy Dunlap <randy.dunlap@oracle.com>
Fix netxen build errors when CONFIG_INET=n:
netxen_nic_main.c:(.text+0x1abb8a): undefined reference to `in_dev_finish_destroy'
netxen_nic_main.c:(.init.text+0xd86e): undefined reference to `register_inetaddr_notifier'
netxen_nic_main.c:(.exit.text+0x1b70): undefined reference to `unregister_inetaddr_notifier'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-next-20090728.orig/drivers/net/Kconfig
+++ linux-next-20090728/drivers/net/Kconfig
@@ -2666,7 +2666,7 @@ config MYRI10GE_DCA
config NETXEN_NIC
tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC"
- depends on PCI
+ depends on PCI && INET
help
This enables the support for NetXen's Gigabit Ethernet card.
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
^ permalink raw reply
* [PATCH -next] netxen: fix build when CONFIG_INET=n
From: Randy Dunlap @ 2009-07-28 18:21 UTC (permalink / raw)
To: Stephen Rothwell, davem; +Cc: linux-next, LKML, netdev, Dhananjay Phadke
In-Reply-To: <20090728174224.647cc3ba.sfr@canb.auug.org.au>
From: Randy Dunlap <randy.dunlap@oracle.com>
Fix netxen build errors when CONFIG_INET=n:
netxen_nic_main.c:(.text+0x1abb8a): undefined reference to `in_dev_finish_destroy'
netxen_nic_main.c:(.init.text+0xd86e): undefined reference to `register_inetaddr_notifier'
netxen_nic_main.c:(.exit.text+0x1b70): undefined reference to `unregister_inetaddr_notifier'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-next-20090728.orig/drivers/net/Kconfig
+++ linux-next-20090728/drivers/net/Kconfig
@@ -2666,7 +2666,7 @@ config MYRI10GE_DCA
config NETXEN_NIC
tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC"
- depends on PCI
+ depends on PCI && INET
help
This enables the support for NetXen's Gigabit Ethernet card.
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Add networking wireless drivers section
From: Randy Dunlap @ 2009-07-28 18:15 UTC (permalink / raw)
To: Joe Perches
Cc: David Miller, John W. Linville, julia-dAYI7NvHqcQ,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1248804397.18284.5.camel-AkRN8/LKpobuYGix6ZUp1Q@public.gmane.org>
On Tue, 28 Jul 2009 11:06:37 -0700 Joe Perches wrote:
> On Tue, 2009-07-28 at 10:30 -0700, David Miller wrote:
> > Wireless patches need to be CC:'d to linux-wireless so that
> > John Linville can notice and pick them up
>
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ebc2691..0574aad 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4186,6 +4186,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
> S: Odd Fixes
> F: drivers/net/
>
> +NETWORKING WIRELESS DRIVERS
> +L: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
> +S: Odd Fixes
> +F: drivers/net/wireless/
> +
Already have this:
NETWORKING [WIRELESS]
P: John W. Linville
M: linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org
L: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
S: Maintained
F: net/wireless/
F: include/net/ieee80211*
F: include/linux/wireless.h
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] MAINTAINERS: Add networking wireless drivers section
From: Joe Perches @ 2009-07-28 18:06 UTC (permalink / raw)
To: David Miller, John W. Linville
Cc: julia, netdev, linux-kernel, kernel-janitors, linux-wireless
In-Reply-To: <20090728.103044.179053537.davem@davemloft.net>
On Tue, 2009-07-28 at 10:30 -0700, David Miller wrote:
> Wireless patches need to be CC:'d to linux-wireless so that
> John Linville can notice and pick them up
Signed-off-by: Joe Perches <joe@perches.com>
diff --git a/MAINTAINERS b/MAINTAINERS
index ebc2691..0574aad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4186,6 +4186,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
S: Odd Fixes
F: drivers/net/
+NETWORKING WIRELESS DRIVERS
+L: linux-wireless@vger.kernel.org
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
+S: Odd Fixes
+F: drivers/net/wireless/
+
NETXEN (1/10) GbE SUPPORT
P: Dhananjay Phadke
M: dhananjay@netxen.com
^ permalink raw reply related
* Re: [PATCH 5/9] drivers/net/wireless: correct error-handling code
From: John W. Linville @ 2009-07-28 17:52 UTC (permalink / raw)
To: David Miller; +Cc: julia, netdev, linux-kernel, kernel-janitors, linux-wireless
In-Reply-To: <20090728.103044.179053537.davem@davemloft.net>
On Tue, Jul 28, 2009 at 10:30:44AM -0700, David Miller wrote:
> From: Julia Lawall <julia@diku.dk>
> Date: Tue, 28 Jul 2009 17:54:24 +0200 (CEST)
>
> Wireless patches need to be CC:'d to linux-wireless so that
> John Linville can notice and pick them up. Added...
Thanks...FWIW, I've got a nearly identical patch from Dan Carpenter
queued already.
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
¡Viva Honduras Libre!
^ permalink raw reply
* [PATCH] pppoe: fix race at init time
From: Eric Dumazet @ 2009-07-28 17:46 UTC (permalink / raw)
To: David S. Miller
Cc: Pavel Emelyanov, Igor M Podlesny, Andrew Morton, netdev,
Cyrill Gorcunov
In-Reply-To: <4A6F017B.4060909@gmail.com>
Eric Dumazet a écrit :
> Eric Dumazet a écrit :
>> Seems drivers/net/pppol2tp.c is a suspect...
>>
>> It uses register_pernet_gen_device() from pppol2tp_init()
>> but doesnt call unregister_pernet_gen_device()
>
> OK patch seems really easy...
>
> This bug was added in commit 4e9fb8016a351b5b9da7fea32bcfdbc9d836e421
> net: pppol2tp - introduce net-namespace functionality
>
> So this is a stable candidate I guess ?
>
> Thank you
So Igor still has a panic... lets try a third patch then :)
[PATCH] pppoe: fix race at init time
I believe we have a race in ppoe_init() :
As soon as dev_add_pack(&pppoes_ptype); and/or dev_add_pack(&pppoed_ptype);
are called, we can receive packets while nets not yet fully ready
(ie : pppoe_init_net() not yet called)
This means we should be prepared to get a NULL pointer
from net_generic(net, pppoe_net_id) call.
We miss this NULL check in get_item() and possibly crash if this nets
has no struct pppoe_net attached yet. Other subroutines
are safe.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index f0031f1..e50af8c 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -237,14 +237,15 @@ static struct pppox_sock *__delete_item(struct pppoe_net *pn, __be16 sid,
static inline struct pppox_sock *get_item(struct pppoe_net *pn, __be16 sid,
unsigned char *addr, int ifindex)
{
- struct pppox_sock *po;
-
- read_lock_bh(&pn->hash_lock);
- po = __get_item(pn, sid, addr, ifindex);
- if (po)
- sock_hold(sk_pppox(po));
- read_unlock_bh(&pn->hash_lock);
-
+ struct pppox_sock *po = NULL;
+
+ if (pn) {
+ read_lock_bh(&pn->hash_lock);
+ po = __get_item(pn, sid, addr, ifindex);
+ if (po)
+ sock_hold(sk_pppox(po));
+ read_unlock_bh(&pn->hash_lock);
+ }
return po;
}
^ permalink raw reply related
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