Re: [ANN] Acrypto asynchronous crypto layer 2.6.19 release.

2006-12-17 Thread Andreas Jellinghaus

Does acrypto still have the same size restrictions
I ran into with the last release?

Thanks, Andreas
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re:[PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-17 Thread Li Yewang
Herbert Xu <[EMAIL PROTECTED]> wrote:

> 
> Since rate_last can also be zero if jiffies == 0 (OK that's
> extremely unlikely but I'm feeling picky today :), how about
> checking rate_tokens instead? The value of rate_last can only
> be relevant if rate_tokens is non-zero.
> 
> BTW, please also check the other spots where rate_last/rate_token
> is used.  They might need a similar fix.
> 
> Cheers,

Mr Herbert Xu

According to your advice, I have made another patch for the redirect
bug.

I have also checked other spots where rate_last/rate_tokens is used.
Those places need not be fixed.

Following is my patch:

signed-off-by: Li Yewang<[EMAIL PROTECTED]>

--- linux-2.6.19.1/net/ipv4/route.c 2006-12-12 03:32:54.0
+0800
+++ linux-2.6.19.1/net/ipv4/route.org.c 2006-11-29 16:14:34.592058480
+0800
@@ -1327,7 +1327,8 @@ void ip_rt_send_redirect(struct sk_buff
/* Check for load limit; set rate_last to the latest sent
 * redirect.
 */
-   if (time_after(jiffies,
+   if (rt->u.dst.rate_tokens == 0 ||
+time_after(jiffies,
   (rt->u.dst.rate_last +
(ip_rt_redirect_load << rt-
>u.dst.rate_tokens {
icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt-
>rt_gateway);



-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-17 Thread Herbert Xu
On Wed, Nov 29, 2006 at 04:51:31PM +0800, Li Yewang wrote:
> 
> I have also checked other spots where rate_last/rate_tokens is used.
> Those places need not be fixed.

Thanks.

> Following is my patch:
> 
> signed-off-by: Li Yewang<[EMAIL PROTECTED]>

Looks good to me.  You should cc David Miller <[EMAIL PROTECTED]>
for patch submissions.  Please also include a full description each
time you submit the patch.

> --- linux-2.6.19.1/net/ipv4/route.c 2006-12-12 03:32:54.0
> +0800
> +++ linux-2.6.19.1/net/ipv4/route.org.c 2006-11-29 16:14:34.592058480
> +0800
> @@ -1327,7 +1327,8 @@ void ip_rt_send_redirect(struct sk_buff
> /* Check for load limit; set rate_last to the latest sent
>  * redirect.
>  */
> -   if (time_after(jiffies,
> +   if (rt->u.dst.rate_tokens == 0 ||
> +time_after(jiffies,
>(rt->u.dst.rate_last +
> (ip_rt_redirect_load << rt-
> >u.dst.rate_tokens {
> icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt-
> >rt_gateway);

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] drivers/atm/he.c: remove ancient version string

2006-12-17 Thread Adrian Bunk
On Sun, Dec 17, 2006 at 05:11:59PM -0800, David Miller wrote:
> From: Alexey Dobriyan <[EMAIL PROTECTED]>
> Date: Sun, 17 Dec 2006 15:56:22 +0300
> 
> > From: Andi Drebes <[EMAIL PROTECTED]>
> > 
> >textdata bss dec hex filename
> >   20015 480  28   20523502b drivers/atm/he.o
> >   19997 480  28   205055019 drivers/atm/he.o
> > 
> > Signed-off-by: Andi Drebes <[EMAIL PROTECTED]>
> > Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
> 
> As Adrian said, this CVS string is totally useless.
> 
> That being said, it should be replaced with an
> appropriate piece of versioning information, like
> the ones we use via MODULE_VERSION() in other drivers.

Which versioning information?

There does not seem to be any versioning information that is 
getting updated.

There are some truly exceptional cases where maintainers are using and 
updating version strings, but in all other cases there's simply nothing 
that's worth being printed.

> I'll be happy to apply a patch which gets rid of the
> CVS references, and replaces it with something useful.

Patch below.

> Thanks.

cu
Adrian


<--  snip  -->


This patch removes the ancient version string.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

 drivers/atm/he.c |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

--- linux-2.6.20-rc1-mm1/drivers/atm/he.c.old   2006-12-18 05:35:19.0 
+0100
+++ linux-2.6.20-rc1-mm1/drivers/atm/he.c   2006-12-18 05:39:40.0 
+0100
@@ -1,5 +1,3 @@
-/* $Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $ */
-
 /*
 
   he.c
@@ -99,10 +97,6 @@
 #define HPRINTK(fmt,args...)   do { } while (0)
 #endif /* HE_DEBUG */
 
-/* version definition */
-
-static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
-
 /* declarations */
 
 static int he_open(struct atm_vcc *vcc);
@@ -366,7 +360,7 @@ he_init_one(struct pci_dev *pci_dev, con
struct he_dev *he_dev = NULL;
int err = 0;
 
-   printk(KERN_INFO "he: %s\n", version);
+   printk(KERN_INFO "ATM he driver\n");
 
if (pci_enable_device(pci_dev))
return -EIO;
@@ -2933,7 +2927,7 @@ he_proc_read(struct atm_dev *dev, loff_t
 
left = *pos;
if (!left--)
-   return sprintf(page, "%s\n", version);
+   return sprintf(page, "ATM he driver\n");
 
if (!left--)
return sprintf(page, "%s%s\n\n",

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] net/irda/: proper prototypes

2006-12-17 Thread Adrian Bunk
This patch adds proper prototypes for some functions in
include/net/irda/irda.h

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

 include/net/irda/irda.h |   15 +++
 net/irda/irmod.c|   13 -
 2 files changed, 15 insertions(+), 13 deletions(-)

--- linux-2.6.20-rc1-mm1/include/net/irda/irda.h.old2006-12-18 
02:49:02.0 +0100
+++ linux-2.6.20-rc1-mm1/include/net/irda/irda.h2006-12-18 
02:58:02.0 +0100
@@ -113,4 +113,19 @@
 #define IAS_IRCOMM_ID 0x2343
 #define IAS_IRLPT_ID  0x9876
 
+struct net_device;
+struct packet_type;
+
+void irda_proc_register(void);
+void irda_proc_unregister(void);
+
+int irda_sysctl_register(void);
+void irda_sysctl_unregister(void);
+
+int irsock_init(void);
+void irsock_cleanup(void);
+
+int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
+struct packet_type *ptype, struct net_device *orig_dev);
+
 #endif /* NET_IRDA_H */
--- linux-2.6.20-rc1-mm1/net/irda/irmod.c.old   2006-12-18 02:52:18.0 
+0100
+++ linux-2.6.20-rc1-mm1/net/irda/irmod.c   2006-12-18 02:53:59.0 
+0100
@@ -42,19 +42,6 @@
 #include /* irttp_init */
 #include   /* irda_device_init */
 
-/* irproc.c */
-extern void irda_proc_register(void);
-extern void irda_proc_unregister(void);
-/* irsysctl.c */
-extern int  irda_sysctl_register(void);
-extern void irda_sysctl_unregister(void);
-/* af_irda.c */
-extern int  irsock_init(void);
-extern void irsock_cleanup(void);
-/* irlap_frame.c */
-extern int  irlap_driver_rcv(struct sk_buff *, struct net_device *, 
-struct packet_type *, struct net_device *);
-
 /*
  * Module parameters
  */

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [IPVS] replace if .. goto with while

2006-12-17 Thread Horms
I guess that this code used to be more complex, but replacing
the goto with a while seems to make things a bit more readable.
Or in other words, two fairly gratuitous goto are removed.

On a related note, I wonder if there should be a limit to how
many times it tries.

Signed-Off-By: Simon Horman <[EMAIL PROTECTED]>

Index: linux-2.6/net/ipv4/ipvs/ip_vs_sync.c
===
--- linux-2.6.orig/net/ipv4/ipvs/ip_vs_sync.c   2006-11-29 09:50:37.0 
+0900
+++ linux-2.6/net/ipv4/ipvs/ip_vs_sync.c2006-11-29 10:03:11.0 
+0900
@@ -822,12 +822,10 @@
 
/* fork the sync thread here, then the parent process of the
   sync thread is the init process after this thread exits. */
-  repeat:
-   if ((pid = kernel_thread(sync_thread, startup, 0)) < 0) {
+   while ((pid = kernel_thread(sync_thread, startup, 0)) < 0) {
IP_VS_ERR("could not create sync_thread due to %d... "
  "retrying.\n", pid);
msleep_interruptible(1000);
-   goto repeat;
}
 
return 0;
@@ -856,12 +854,10 @@
ip_vs_backup_syncid = syncid;
}
 
-  repeat:
-   if ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0) {
+   while ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0) {
IP_VS_ERR("could not create fork_sync_thread due to %d... "
  "retrying.\n", pid);
msleep_interruptible(1000);
-   goto repeat;
}
 
wait_for_completion(&startup);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [IPVS] transparent proxying

2006-12-17 Thread Horms
On Wed, Nov 29, 2006 at 11:46:22PM +0900, Horms wrote:
> On Wed, Nov 29, 2006 at 03:15:23PM +0100, Thomas Graf wrote:

[split]

> > This patch seems to be based on an old tree, I've renamed nfmark
> > to mark in net-2.6.20. The term fwmark and nfmark shouldn't be
> > used anymore.
> 
> Sorry, I based this patch on Linus's tree. I'll port it to net-2.6.20.

This took too long for me to get around to :(
Am I correct in thinking I just need to replace fwmark with mark?
If so, the updated version is below.

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/

[IPVS] transparent proxying

Patch from home_king <[EMAIL PROTECTED]> to allow a web cluseter using
transparent proxying. It works by simply grabing packets that have the
fwmark set and have not already been processed by ipvs (ip_vs_out) and
throwing them into ip_vs_in.

See: http://archive.linuxvirtualserver.org/html/lvs-users/2006-11/msg00261.html

Normally LVS packets are processed by ip_vs_in fron on the INPUT chain,
and packets that are processed in this way never show up on the FORWARD
chain, so they won't hit this rule.

This patch seems like a good precursor to moving LVS permanantly to
the FORWARD chain. As I'm struggling to think how it could break things.

Reformated to use tabs for indentation (instead of 4 spaces)
Reformated to be < 80 columns wide
Updated fwmark to mark

Cc: Jinhua Luo <[EMAIL PROTECTED]>
Signed-off-by: Simon Horman <[EMAIL PROTECTED]>
Index: net-2.6/net/ipv4/ipvs/ip_vs_core.c
===
--- net-2.6.orig/net/ipv4/ipvs/ip_vs_core.c 2006-12-18 11:46:10.0 
+0900
+++ net-2.6/net/ipv4/ipvs/ip_vs_core.c  2006-12-18 12:13:32.0 +0900
@@ -23,7 +23,9 @@
  * Changes:
  * Paul `Rusty' Russellproperly handle non-linear skbs
  * Harald Weltedon't use nfcache
- *
+ * Jinhua Luo  redirect packets with fwmark on
+ * NF_IP_FORWARD chain to ip_vs_in(),
+ * mainly for transparent cache cluster
  */
 
 #include 
@@ -1070,6 +1072,26 @@
return ip_vs_in_icmp(pskb, &r, hooknum);
 }
 
+/*
+ * This is hooked into the NF_IP_FORWARD. It catches
+ * packets that have not already been handled by ipvs (out)
+ * and have a fwmark set. This is to allow transparent proxying
+ * of fwmark virtual services.
+ *
+ * It will not process packets that are handled by ipvs (in)
+ * as they never traverse the NF_IP_FORWARD.
+ */
+static unsigned int
+ip_vs_forward_with_fwmark(unsigned int hooknum, struct sk_buff **pskb,
+ const struct net_device *in,
+ const struct net_device *out,
+ int (*okfn)(struct sk_buff *))
+{
+   if ((*pskb)->ipvs_property || ! (*pskb)->mark)
+   return NF_ACCEPT;
+
+   return ip_vs_in(hooknum, pskb, in, out, okfn);
+}
 
 /* After packet filtering, forward packet through VS/DR, VS/TUN,
or VS/NAT(change destination), so that filtering rules can be
@@ -1082,6 +1104,16 @@
.priority   = 100,
 };
 
+/* Allow transparent proxying by fishing packets
+ * out of the forward chain. */
+static struct nf_hook_ops ip_vs_forward_with_fwmark_ops = {
+   .hook   = ip_vs_forward_with_fwmark,
+   .owner  = THIS_MODULE,
+   .pf = PF_INET,
+   .hooknum= NF_IP_FORWARD,
+   .priority   = 101,
+};
+
 /* After packet filtering, change source only for VS/NAT */
 static struct nf_hook_ops ip_vs_out_ops = {
.hook   = ip_vs_out,
@@ -1160,9 +1192,17 @@
goto cleanup_postroutingops;
}
 
+   ret = nf_register_hook(&ip_vs_forward_with_fwmark_ops);
+   if (ret < 0) {
+   IP_VS_ERR("can't register forward_with_fwmark hook.\n");
+   goto cleanup_forwardicmpops;
+   }
+
IP_VS_INFO("ipvs loaded.\n");
return ret;
 
+  cleanup_forwardicmpops:
+   nf_unregister_hook(&ip_vs_forward_icmp_ops);
   cleanup_postroutingops:
nf_unregister_hook(&ip_vs_post_routing_ops);
   cleanup_outops:
@@ -1182,6 +1222,7 @@
 
 static void __exit ip_vs_cleanup(void)
 {
+   nf_unregister_hook(&ip_vs_forward_with_fwmark_ops);
nf_unregister_hook(&ip_vs_forward_icmp_ops);
nf_unregister_hook(&ip_vs_post_routing_ops);
nf_unregister_hook(&ip_vs_out_ops);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-17 Thread Herbert Xu
On Wed, Nov 29, 2006 at 04:08:45PM +0800, Li Yewang wrote:
> 
> --- linux-2.6.19/net/ipv4/route.c.org 2006-12-05 10:47:02.402147160
> +0800
> +++ linux-2.6.19/net/ipv4/route.c 2006-12-05 10:48:26.339386760 +0800
> @@ -1327,7 +1327,8 @@ void ip_rt_send_redirect(struct sk_buff 
>   /* Check for load limit; set rate_last to the latest sent
>* redirect.
>*/
> - if (time_after(jiffies,
> + if (rt->u.dst.rate_last == 0 ||
> + time_after(jiffies,
>   (rt->u.dst.rate_last +
> (ip_rt_redirect_load << rt->u.dst.rate_tokens {
>icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt->rt_gateway);

Since rate_last can also be zero if jiffies == 0 (OK that's
extremely unlikely but I'm feeling picky today :), how about
checking rate_tokens instead? The value of rate_last can only
be relevant if rate_tokens is non-zero.

BTW, please also check the other spots where rate_last/rate_token
is used.  They might need a similar fix.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG KERNEL 2.6.20-rc1] ftp: get or put stops during file-transfer

2006-12-17 Thread Adrian Bunk
On Sun, Dec 17, 2006 at 11:23:11PM +0900, Komuro wrote:
> On Sun, 17 Dec 2006 04:02:22 +
> Al Viro <[EMAIL PROTECTED]> wrote:
> 
> > On Sun, Dec 17, 2006 at 09:27:52PM +0900, Komuro wrote:
> > > 
> > > Hello,
> > > 
> > > On kernel 2.6.20-rc1, ftp (get or put) stops
> > > during file-transfer.
> > > 
> > > Client: ftp-0.17-33.fc6  (192.168.1.1)
> > > Server: vsftpd-2.0.5-8   (192.168.1.3)
> > > 
> > > This problem does _not_ happen on kernel-2.6.19.
> > > is it caused by network-subsystem change on 2.6.20-rc1??
> > 
> > Do you have NAT between you and server?
> 
> No. I don't have NAT between the client and the server.
> Actually, the client and the sever is located in same room.
> 
> client -- 100MbpsHub -- server.

What network cards are in the client and the server?

Are there any error messages your client gives or in the log files?

> Thanks!
> 
> Best Regards
> Komuro

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch sungem] improved locking

2006-12-17 Thread Benjamin Herrenschmidt

> Thanks for testing this stuff.
> 
> I'll take a look at the pause-enabling issue in the sungem
> drive then work on integrating Eric's patch.

Ok, thanks.

> Probably we'll need to put this in post-2.6.20 as the merge
> window is closed.

Yup, no hurry there.

Ben.


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch sungem] improved locking

2006-12-17 Thread David Miller
From: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Date: Fri, 15 Dec 2006 11:59:06 +1100

> Patched driver's been running fine for a couple of days & nights with
> constant beating... just those RX MAC fifo overflows every now and then
> (though they cause no data corruption and no big hit on the driver perfs
> neither). I suppose still worth investigating when I have a bit of time,
> I must have done something stupid with the pause settings.
> 
> In the meantime, Eric's patch is all good.

Thanks for testing this stuff.

I'll take a look at the pause-enabling issue in the sungem
drive then work on integrating Eric's patch.

Probably we'll need to put this in post-2.6.20 as the merge
window is closed.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] A bugfix patchset for NetLabel

2006-12-17 Thread David Miller
From: James Morris <[EMAIL PROTECTED]>
Date: Fri, 15 Dec 2006 20:19:56 -0500 (EST)

> On Fri, 15 Dec 2006, [EMAIL PROTECTED] wrote:
> 
> > This patch set fixes two bugs that were found recently when adding new 
> > CIPSOv4
> > DOI definitions.  These patches are pretty small and have been tested by a 
> > few
> > different people on several different platforms.
> 
> Applied to git://git.infradead.org/~jmorris/selinux-2.6#fixes

James, let me know when you want me to pull some stuff in.

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Deadlock in MD5 Signature support

2006-12-17 Thread David Miller
From: "Leigh Brown" <[EMAIL PROTECTED]>
Date: Sun, 17 Dec 2006 18:13:06 - (GMT)

> It was all going so well, and then it deadlocked.  What can be done
> about this?

Thanks for the trace, I'll take a look Leigh.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [TCP]: Trivial fix to message in tcp_v4_inbound_md5_hash

2006-12-17 Thread David Miller
From: "Leigh Brown" <[EMAIL PROTECTED]>
Date: Sun, 17 Dec 2006 18:04:15 - (GMT)

> The message logged in tcp_v4_inbound_md5_hash when the hash was expected
> but not found was reversed.
> 
> Signed-off-by: Leigh Brown <[EMAIL PROTECTED]>

Also applied, thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [TCP]: Fix oops caused by tcp_v4_md5_do_del

2006-12-17 Thread David Miller
From: "Leigh Brown" <[EMAIL PROTECTED]>
Date: Sun, 17 Dec 2006 13:44:45 - (GMT)

> md5sig_info.alloced4 must be set to zero when freeing keys4, otherwise
> it will not be alloc'd again when another key is added to the same
> socket by tcp_v4_md5_do_add.
> 
> Signed-off-by: Leigh Brown <[EMAIL PROTECTED]>

Applied, thanks for fixing this Leigh.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] he: tiny space savings

2006-12-17 Thread David Miller
From: Alexey Dobriyan <[EMAIL PROTECTED]>
Date: Sun, 17 Dec 2006 15:56:22 +0300

> From: Andi Drebes <[EMAIL PROTECTED]>
> 
>textdata bss dec hex filename
>   20015 480  28   20523502b drivers/atm/he.o
>   19997 480  28   205055019 drivers/atm/he.o
> 
> Signed-off-by: Andi Drebes <[EMAIL PROTECTED]>
> Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>

As Adrian said, this CVS string is totally useless.

That being said, it should be replaced with an
appropriate piece of versioning information, like
the ones we use via MODULE_VERSION() in other drivers.

I'll be happy to apply a patch which gets rid of the
CVS references, and replaces it with something useful.

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [1/1] connector: fix compilation breakage introduced recently.

2006-12-17 Thread David Miller
From: Evgeniy Polyakov <[EMAIL PROTECTED]>
Date: Sun, 17 Dec 2006 14:29:46 +0300

> Linus has changed work queue structure and has not tested it with
> connector compiled in, his changes break the build.
> 
> Attached patch fixes compilation error.
> 
> Patch is against commit 99f5e9718185f07458ae70c2282c2153a2256c91.
> 
> Thanks to Toralf Förster for pointing this out.
> 
> Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]>

Applied, thanks Evgeniy.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4][TG3]: Update version and reldate.

2006-12-17 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Fri, 15 Dec 2006 22:49:06 -0800

> [TG3]: Update version and reldate.
> 
> Update version to 3.71.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

Applied, thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4][TG3]: Power down/up 5906 PHY correctly.

2006-12-17 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Fri, 15 Dec 2006 22:48:54 -0800

> [TG3]: Power down/up 5906 PHY correctly.
> 
> The 5906 PHY requires a special register bit to power down and up the
> PHY.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

Patch applied, thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4][TG3]: Assign tp->link_config.orig_* values.

2006-12-17 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Fri, 15 Dec 2006 22:48:22 -0800

> [TG3]: Assign tp->link_config.orig_* values.
> 
> tp->link_config.orig_* values must be assigned during
> tg3_set_settings() because these values will be used to setup the
> link speed during tg3_open().  Without these assignments, the link
> speed settings will be all messed by if tg3_set_settings() is called
> when the device is down.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

Good catch, patch applied, thanks Michael.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4][TG3]: Fix race condition when calling register_netdev().

2006-12-17 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Fri, 15 Dec 2006 22:48:43 -0800

> [TG3]: Fix race condition when calling register_netdev().
> 
> Hot-plug scripts can call tg3_open() as soon as register_netdev() is
> called in tg3_init_one().  We need to call pci_set_drvdata() before
> register_netdev(), and netif_carrier_off() needs to be moved to
> tg3_open() to avoid race conditions.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

Another excellent catch, patch applied, thanks Michael.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6 patch] net/sctp/: make 2 functions static

2006-12-17 Thread Sridhar Samudrala

Adrian Bunk wrote:

This patch makes the following needlessly global functions static:
- ipv6.c: sctp_inet6addr_event()
- protocol.c: sctp_inetaddr_event()

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

  

Acked-by: Sridhar Samudrala <[EMAIL PROTECTED]>

Thanks
Sridhar

---

 include/net/sctp/sctp.h |2 --
 net/sctp/ipv6.c |4 ++--
 net/sctp/protocol.c |4 ++--
 3 files changed, 4 insertions(+), 6 deletions(-)

--- linux-2.6.20-rc1-mm1/net/sctp/ipv6.c.old2006-12-16 01:05:15.0 
+0100
+++ linux-2.6.20-rc1-mm1/net/sctp/ipv6.c2006-12-16 01:05:40.0 
+0100
@@ -79,8 +79,8 @@
 #include 

 /* Event handler for inet6 address addition/deletion events.  */
-int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
-void *ptr)
+static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
+   void *ptr)
 {
struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
struct sctp_sockaddr_entry *addr;
--- linux-2.6.20-rc1-mm1/include/net/sctp/sctp.h.old2006-12-16 
01:05:47.0 +0100
+++ linux-2.6.20-rc1-mm1/include/net/sctp/sctp.h2006-12-16 
01:05:53.0 +0100
@@ -128,8 +128,6 @@
 int flags);
 extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
 extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
-int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
-void *ptr);

 /*
  * sctp/socket.c
--- linux-2.6.20-rc1-mm1/net/sctp/protocol.c.old2006-12-16 
01:05:59.0 +0100
+++ linux-2.6.20-rc1-mm1/net/sctp/protocol.c2006-12-16 01:06:07.0 
+0100
@@ -601,8 +601,8 @@
 }

 /* Event handler for inet address addition/deletion events.  */
-int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
-void *ptr)
+static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
+  void *ptr)
 {
struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
struct sctp_sockaddr_entry *addr;

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  



-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] r8169: use the broken_parity_status field in pci_dev

2006-12-17 Thread Lennert Buytenhek
On Mon, Dec 18, 2006 at 12:04:19AM +0100, Francois Romieu wrote:

> The former option is removed and platform code can now specify the
> expected behavior.

Thanks a lot.

FYI, I submitted this patch for the n2100 side:


Index: linux-2.6.19/arch/arm/mach-iop32x/n2100.c
===
--- linux-2.6.19.orig/arch/arm/mach-iop32x/n2100.c
+++ linux-2.6.19/arch/arm/mach-iop32x/n2100.c
@@ -123,9 +123,26 @@ static struct hw_pci n2100_pci __initdat
 
 static int __init n2100_pci_init(void)
 {
-   if (machine_is_n2100())
+   if (machine_is_n2100()) {
+   int i;
+
pci_common_init(&n2100_pci);
 
+   /*
+* Both r8169 chips on the n2100 exhibit PCI parity
+* problems.  Set the ->broken_parity_status flag for
+* both ports so that the r8169 driver knows it should
+* ignore error interrupts.
+*/
+   for (i = 1; i <= 2; i++) {
+   struct pci_dev *dev;
+
+   dev = pci_get_bus_and_slot(0, PCI_DEVFN(i, 0));
+   if (dev != NULL)
+   dev->broken_parity_status = 1;
+   }
+   }
+
return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] r8169: use the broken_parity_status field in pci_dev

2006-12-17 Thread Francois Romieu
The former option is removed and platform code can now specify the
expected behavior.

Signed-off-by: Lennert Buytenhek <[EMAIL PROTECTED]>
Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>
---
 drivers/net/r8169.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index f83b41d..1489100 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -225,7 +225,6 @@ MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl
 
 static int rx_copybreak = 200;
 static int use_dac;
-static int ignore_parity_err;
 static struct {
u32 msg_enable;
 } debug = { -1 };
@@ -471,8 +470,6 @@ module_param(use_dac, int, 0);
 MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
 module_param_named(debug, debug.msg_enable, int, 0);
 MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");
-module_param_named(ignore_parity_err, ignore_parity_err, bool, 0);
-MODULE_PARM_DESC(ignore_parity_err, "Ignore PCI parity error as target. 
Default: false");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(RTL8169_VERSION);
 
@@ -2388,7 +2385,7 @@ static void rtl8169_pcierr_interrupt(str
 *
 * Feel free to adjust to your needs.
 */
-   if (ignore_parity_err)
+   if (pdev->broken_parity_status)
pci_cmd &= ~PCI_COMMAND_PARITY;
else
pci_cmd |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY;
-- 
1.4.2.3
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] netpoll: drivers must not enable IRQ unconditionally in their NAPI handler

2006-12-17 Thread Francois Romieu
net/core/netpoll.c::netpoll_send_skb() calls the poll handler when
it is available. As netconsole can be used from almost any context,
IRQ must not be enabled blindly in the NAPI handler of a driver which
supports netpoll.

b57bd06655a028aba7b92e1c19c2093e7fcfb341 fixed the issue for the
8139too.c driver.

Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>
---
 drivers/net/8139cp.c|6 --
 drivers/net/b44.c   |6 --
 drivers/net/forcedeth.c |   11 +++
 drivers/net/skge.c  |5 +++--
 4 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 458dd9f..e2cb19b 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -617,13 +617,15 @@ rx_next:
 * this round of polling
 */
if (rx_work) {
+   unsigned long flags;
+
if (cpr16(IntrStatus) & cp_rx_intr_mask)
goto rx_status_loop;
 
-   local_irq_disable();
+   local_irq_save(flags);
cpw16_f(IntrMask, cp_intr_mask);
__netif_rx_complete(dev);
-   local_irq_enable();
+   local_irq_restore(flags);
 
return 0;   /* done */
}
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 474a4e3..5eb2ec6 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -879,12 +879,14 @@ static int b44_poll(struct net_device *n
}
 
if (bp->istat & ISTAT_ERRORS) {
-   spin_lock_irq(&bp->lock);
+   unsigned long flags;
+
+   spin_lock_irqsave(&bp->lock, flags);
b44_halt(bp);
b44_init_rings(bp);
b44_init_hw(bp, 1);
netif_wake_queue(bp->dev);
-   spin_unlock_irq(&bp->lock);
+   spin_unlock_irqrestore(&bp->lock, flags);
done = 1;
}
 
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 439f413..820f8c7 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -2576,14 +2576,15 @@ static int nv_napi_poll(struct net_devic
int pkts, limit = min(*budget, dev->quota);
struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev);
+   unsigned long flags;
 
pkts = nv_rx_process(dev, limit);
 
if (nv_alloc_rx(dev)) {
-   spin_lock_irq(&np->lock);
+   spin_lock_irqsave(&np->lock, flags);
if (!np->in_shutdown)
mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
-   spin_unlock_irq(&np->lock);
+   spin_unlock_irqrestore(&np->lock, flags);
}
 
if (pkts < limit) {
@@ -2591,13 +2592,15 @@ static int nv_napi_poll(struct net_devic
netif_rx_complete(dev);
 
/* re-enable receive interrupts */
-   spin_lock_irq(&np->lock);
+   spin_lock_irqsave(&np->lock, flags);
+
np->irqmask |= NVREG_IRQ_RX_ALL;
if (np->msi_flags & NV_MSI_X_ENABLED)
writel(NVREG_IRQ_RX_ALL, base + NvRegIrqMask);
else
writel(np->irqmask, base + NvRegIrqMask);
-   spin_unlock_irq(&np->lock);
+
+   spin_unlock_irqrestore(&np->lock, flags);
return 0;
} else {
/* used up our quantum, so reschedule */
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 8a39376..deedfd5 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2920,6 +2920,7 @@ static int skge_poll(struct net_device *
struct skge_hw *hw = skge->hw;
struct skge_ring *ring = &skge->rx_ring;
struct skge_element *e;
+   unsigned long flags;
int to_do = min(dev->quota, *budget);
int work_done = 0;
 
@@ -2957,12 +2958,12 @@ static int skge_poll(struct net_device *
if (work_done >=  to_do)
return 1; /* not done */
 
-   spin_lock_irq(&hw->hw_lock);
+   spin_lock_irqsave(&hw->hw_lock, flags);
__netif_rx_complete(dev);
hw->intr_mask |= irqmask[skge->port];
skge_write32(hw, B0_IMSK, hw->intr_mask);
skge_read32(hw, B0_IMSK);
-   spin_unlock_irq(&hw->hw_lock);
+   spin_unlock_irqrestore(&hw->hw_lock, flags);
 
return 0;
 }
-- 
1.4.4.1

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [KJ] [PATCH] he: tiny space savings

2006-12-17 Thread Adrian Bunk
On Sun, Dec 17, 2006 at 11:02:55PM +0300, Alexey Dobriyan wrote:
> On Sun, Dec 17, 2006 at 07:28:06PM +0100, Adrian Bunk wrote:
> > On Sun, Dec 17, 2006 at 03:56:22PM +0300, Alexey Dobriyan wrote:
> > > From: Andi Drebes <[EMAIL PROTECTED]>
> > >textdata bss dec hex filename
> > >   20015 480  28   20523502b drivers/atm/he.o
> > >   19997 480  28   205055019 drivers/atm/he.o
> > >
> > > Signed-off-by: Andi Drebes <[EMAIL PROTECTED]>
> > > Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
> > > ---
> > >
> > >  drivers/atm/he.c |2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > --- a/drivers/atm/he.c
> > > +++ b/drivers/atm/he.c
> > > @@ -101,7 +101,7 @@ #endif /* HE_DEBUG */
> > >
> > >  /* version definition */
> > >
> > > -static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
> > > +static const char version[] = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas 
> > > Exp $";
> > >...
> >
> > Can't we kill this ancient and outdated version string instead?
> 
> "version" is involved in he_proc_read(). I think, no.

You don;t have to omit this line, but printing a more than 3 years old 
CVS tag is silly (I can't believe anyone is parsing the CVS version).

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [KJ] [PATCH] he: tiny space savings

2006-12-17 Thread Alexey Dobriyan
On Sun, Dec 17, 2006 at 07:28:06PM +0100, Adrian Bunk wrote:
> On Sun, Dec 17, 2006 at 03:56:22PM +0300, Alexey Dobriyan wrote:
> > From: Andi Drebes <[EMAIL PROTECTED]>
> >textdata bss dec hex filename
> >   20015 480  28   20523502b drivers/atm/he.o
> >   19997 480  28   205055019 drivers/atm/he.o
> >
> > Signed-off-by: Andi Drebes <[EMAIL PROTECTED]>
> > Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
> > ---
> >
> >  drivers/atm/he.c |2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > --- a/drivers/atm/he.c
> > +++ b/drivers/atm/he.c
> > @@ -101,7 +101,7 @@ #endif /* HE_DEBUG */
> >
> >  /* version definition */
> >
> > -static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
> > +static const char version[] = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas 
> > Exp $";
> >...
>
> Can't we kill this ancient and outdated version string instead?

"version" is involved in he_proc_read(). I think, no.

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Bringing acx-d80211 up to date (was: [Acx100-devel] Ping)

2006-12-17 Thread Carlos Martín Nieto
On dom, 2006-12-17 at 17:09 +0100, Matthias Steppuhn wrote:
> Hi all,
> 
> Bernat Tallaferro wrote a wakeup call ;-)
> 
> I'd suggest everyone still in the mood to contribute to issue his ping - or
> are we already fading away ?

 I think we faded away some time ago.

 I have however recently picked up the latest acx-d80211 tarball and am
preparing it for an eventual inclusion in the wireless-dev tree, so
hopefully development will pick up again.

 I'm going to release this tarball on my mirror and in the next few days
I'll apply my modularisation patch. This tarball has removed quite some
code and I have applied some patches from the wireless-2.6 branch.

(I've CC'd netdev, as we're supposed to have migrated there the
discussion some time ago. Also, sf.net doesn't like my mail server.)

> 
> 
> BT> I was thinking of updating the acx wiki 

That'd be nice.

   cmn
-- 
Carlos Martín Nieto|   http://www.cmartin.tk
Hobbyist programmer|



signature.asc
Description: This is a digitally signed message part


Re: [KJ] [PATCH] he: tiny space savings

2006-12-17 Thread Adrian Bunk
On Sun, Dec 17, 2006 at 03:56:22PM +0300, Alexey Dobriyan wrote:
> From: Andi Drebes <[EMAIL PROTECTED]>
> 
>textdata bss dec hex filename
>   20015 480  28   20523502b drivers/atm/he.o
>   19997 480  28   205055019 drivers/atm/he.o
> 
> Signed-off-by: Andi Drebes <[EMAIL PROTECTED]>
> Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
> ---
> 
>  drivers/atm/he.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/atm/he.c
> +++ b/drivers/atm/he.c
> @@ -101,7 +101,7 @@ #endif /* HE_DEBUG */
>  
>  /* version definition */
>  
> -static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
> +static const char version[] = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp 
> $";
>...

Can't we kill this ancient and outdated version string instead?

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Deadlock in MD5 Signature support

2006-12-17 Thread Leigh Brown
It was all going so well, and then it deadlocked.  What can be done
about this?

SysRq : Show Regs

Pid: 2330, comm:  torture
EIP: 0060:[] CPU: 0
EIP is at _spin_lock+0x5/0xf
 EFLAGS: 0282Not tainted  (2.6.19.1 #2)
EAX: c03187e4 EBX:  ECX: fa01a8c0 EDX: c52f81e0
ESI: df983240 EDI: c51f6800 EBP: dfc44a20 DS: 007b ES: 007b
CR0: 8005003b CR2: 08124008 CR3: 1ff72a80 CR4: 06f0
 [] __tcp_get_md5sig_pool+0xd/0x3f
 [] tcp_v4_do_calc_md5_hash+0x20/0x1a7
 [] __activate_task+0x1c/0x29
 [] try_to_wake_up+0x27a/0x285
 [] tcp_v4_inbound_md5_hash+0xe1/0x1b2
 [] tcp_v4_do_rcv+0xd/0xd3
 [] tcp_v4_rcv+0x518/0x81b
 [] ip_local_deliver+0x17d/0x235
 [] ip_rcv+0x433/0x475
 [] __next_cpu+0x12/0x1f
 [] find_busiest_group+0x184/0x475
 [] netif_receive_skb+0x303/0x322
 [] tg3_rx+0x278/0x385 [tg3]
 [] tg3_poll+0xcb/0x17c [tg3]
 [] net_rx_action+0x98/0x198
 [] __do_softirq+0x5e/0xbd
 [] do_softirq+0x2e/0x32
 [] do_IRQ+0x82/0xa2
 [] common_interrupt+0x1a/0x20
 [] _spin_lock+0x3/0xf
 [] tcp_alloc_md5sig_pool+0xc/0xa2
 [] tcp_v4_md5_do_add+0x6a/0x11a
 [] tcp_v4_parse_md5_keys+0xeb/0xf8
 [] _spin_lock_bh+0x8/0x18
 [] do_tcp_setsockopt+0x2f1/0x314
 [] sock_common_setsockopt+0x1c/0x21
 [] sys_setsockopt+0x8d/0xac
 [] sys_socketcall+0x1e7/0x242
 [] sysenter_past_esp+0x56/0x79
 ===

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP]: Trivial fix to message in tcp_v4_inbound_md5_hash

2006-12-17 Thread Leigh Brown
The message logged in tcp_v4_inbound_md5_hash when the hash was expected
but not found was reversed.

Signed-off-by: Leigh Brown <[EMAIL PROTECTED]>

diff -uprN a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
--- a/net/ipv4/tcp_ipv4.c   2006-12-17 10:05:54.0 +
+++ b/net/ipv4/tcp_ipv4.c   2006-12-17 17:54:27.0 +
@@ -1187,7 +1187,7 @@ done_opts:
return 0;

if (hash_expected && !hash_location) {
-   LIMIT_NETDEBUG(KERN_INFO "MD5 Hash NOT expected but found "
+   LIMIT_NETDEBUG(KERN_INFO "MD5 Hash expected but NOT found "
   "(" NIPQUAD_FMT ", %d)->(" NIPQUAD_FMT ", %d)\n",
   NIPQUAD(iph->saddr), ntohs(th->source),
   NIPQUAD(iph->daddr), ntohs(th->dest));


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC] rfkill - Add support for input key to control wireless radio

2006-12-17 Thread Ivo van Doorn
This is the latest version of rfkill.
The changes since the version that was originally send are:

Spelling fixes (Thanks to Randy Dunlap)
THIS_MODULE is now a field in the rkfill_master (Suggested by Christoph Hellwig)

The open_count has been completely removed, decision making on which action 
should
be taken is now handled by the user_claim field, which can be set through sysfs.
The possible choice include
 1 - let rfkill handle everything without bothering the user
 2 - let rfkill handle everything but send a notification to the user
 3 - let rfkill send a notification only

The toggling of the keys is now type based, this means that if 1 key is being 
toggled
all keys of the same type will be toggled.

As optimization and clearly seperate the keys per type, the rfkill_type 
structure
now holds the list of the keys that belong to him. This has greatly reduced
the size of the rfkill_master structure.

sysfs will hold the following entries:

- The main folder: "rfkill"
- The main folder contains the type folders "wlan", "bluetooth" and "irda".
- Each type folder contains the files
- "claim" where the user claim can be read/written
- "status" The radio status of this type
- The folders for each key belonging to this type
- Each key folder contains the files
- "status" The status of this key
- "idev" The symlink to the input device entry in sysfs
- "dev" The symlink to the drivers device entry in sysfs

Signed-off-by Ivo van Doorn <[EMAIL PROTECTED]>

---

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index ba0e88c..e58c0bf 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -79,4 +79,20 @@ config HP_SDC_RTC
  Say Y here if you want to support the built-in real time clock
  of the HP SDC controller.
 
+config RFKILL
+   tristate "RF button support"
+   depends on SYSFS
+   help
+ If you say yes here, the rfkill driver will be built
+ which allows network devices to register their hardware
+ RF button which controls the radio state. This driver
+ will then create an input device for it.
+
+ When the input device is not used, the rfkill driver
+ will make sure that when the RF button is pressed the radio
+ is enabled or disabled accordingly. When the input device
+ has been opened by the user this radio control will be left
+ to the user, and rfkill will only send the RF button status
+ change to userspace.
+
 endif
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 415c491..e788a1b 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_INPUT_UINPUT)+= uinput.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)   += wistron_btns.o
 obj-$(CONFIG_HP_SDC_RTC)   += hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)  += ixp4xx-beeper.o
+obj-$(CONFIG_RFKILL)   += rfkill.o
diff --git a/drivers/input/misc/rfkill.c b/drivers/input/misc/rfkill.c
new file mode 100644
index 000..065ff56
--- /dev/null
+++ b/drivers/input/misc/rfkill.c
@@ -0,0 +1,986 @@
+/*
+   Copyright (C) 2006 Ivo van Doorn
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the
+   Free Software Foundation, Inc.,
+   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+MODULE_AUTHOR("Ivo van Doorn <[EMAIL PROTECTED]>");
+MODULE_VERSION("1.0");
+MODULE_DESCRIPTION("RF key support");
+MODULE_LICENSE("GPL");
+
+/*
+ * rfkill key structure.
+ */
+struct rfkill_key {
+   /*
+* For sysfs representation.
+*/
+   struct class_device *cdev;
+
+   /*
+* Pointer to rfkill structure
+* that was filled in by key driver.
+*/
+   struct rfkill *rfkill;
+
+   /*
+* Pointer to type structure
+* that this key belongs to.
+*/
+   struct rfkill_type *type;
+
+   /*
+* Current status of the key which controls the radio,
+* this value will change after the key state has changed
+* after polling, or the key driver has send the new state
+* manually.
+*/
+   int key_status;
+
+   /*
+* Input device for this 

Re: OOPS: 2.6.20-rc1 in ieee80211softmac_get_network_by_bssid_locked()

2006-12-17 Thread Larry Finger

Ben Collins wrote:

Kernel is 2.6.20-rc1, SMP, voluntary-preempt.

CC'd Martin, since he was the original reporter.

[  110.701863] ADDRCONF(NETDEV_UP): eth0: link is not ready
[  110.813273] Unable to handle kernel paging request for data at address 
0x
[  110.813291] Faulting instruction address: 0xf24124c4
[  110.813306] Oops: Kernel access of bad area, sig: 11 [#1]


Is this a vanilla 2.6.20-rc1, or does it have the patch listed below? This 
patch is needed to
complete the changes in work struct introduced with .20.

Larry
---

diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c 
b/net/ieee80211/softmac/ieee80211softmac_assoc.c

index eec1a1d..a824852 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -167,7 +167,7 @@ static void
 ieee80211softmac_assoc_notify_scan(struct net_device *dev, int event_type, 
void *context)
 {
struct ieee80211softmac_device *mac = ieee80211_priv(dev);
-   ieee80211softmac_assoc_work((void*)mac);
+   ieee80211softmac_assoc_work(&mac->associnfo.work.work);
 }

 static void
@@ -177,7 +177,7 @@ ieee80211softmac_assoc_notify_auth(struc

switch (event_type) {
case IEEE80211SOFTMAC_EVENT_AUTHENTICATED:
-   ieee80211softmac_assoc_work((void*)mac);
+   ieee80211softmac_assoc_work(&mac->associnfo.work.work);
break;
case IEEE80211SOFTMAC_EVENT_AUTH_FAILED:
case IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT:
From: Ulrich Kunitz <[EMAIL PROTECTED]>

The signature of work functions changed recently from a context
pointer to the work structure pointer. This caused a problem in
the ieee80211softmac code, because the ieee80211softmac_assox_work
function has  been called directly with a parameter explicitly
casted to (void*). This compiled correctly but resulted in a
softlock, because mutex_lock was called with the wrong memory
address. The patch fixes the problem. Another issue was a wrong
call of the schedule_work function. Softmac works again and this
fixes the problem I mentioned earlier in the zd1211rw rx tasklet
patch. The patch is against Linus' tree (commit af1713e0).

Signed-off-by: Ulrich Kunitz <[EMAIL PROTECTED]>
Acked-by: Michael Buesch <[EMAIL PROTECTED]>
Signed-off-by: Larry Finger <[EMAIL PROTECTED]>
---

John,

This patch should be pushed upstream to 2.6.20. At the moment, the work
struct changes have not yet propagated to wireless-2.6. When they do,
it will be needed there as well.

Larry

 net/ieee80211/softmac/ieee80211softmac_assoc.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c 
b/net/ieee80211/softmac/ieee80211softmac_assoc.c
index eec1a1d..a824852 100644
--- a/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -167,7 +167,7 @@ static void
 ieee80211softmac_assoc_notify_scan(struct net_device *dev, int event_type, 
void *context)
 {
struct ieee80211softmac_device *mac = ieee80211_priv(dev);
-   ieee80211softmac_assoc_work((void*)mac);
+   ieee80211softmac_assoc_work(&mac->associnfo.work.work);
 }
 
 static void
@@ -177,7 +177,7 @@ ieee80211softmac_assoc_notify_auth(struc
 
switch (event_type) {
case IEEE80211SOFTMAC_EVENT_AUTHENTICATED:
-   ieee80211softmac_assoc_work((void*)mac);
+   ieee80211softmac_assoc_work(&mac->associnfo.work.work);
break;
case IEEE80211SOFTMAC_EVENT_AUTH_FAILED:
case IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT:




Re: Bug#396185: sky2 freezes in 2.6.17-2-686. Maintainer confirms that it should be fixed in 2.6.19-git tree.

2006-12-17 Thread Evgeniy Polyakov
On Wed, Nov 29, 2006 at 08:29:48AM +0300, Evgeniy Polyakov ([EMAIL PROTECTED]) 
wrote:
> > > > > > > > > > Here is link to discussion:
> > > > > > > > > > http://marc.theaimsgroup.com/?l=linux-netdev&m=116227512815783&w=2
> > > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > can you try the linux-image 2.6.18, they are in unstable
> > > > > > > > > and the etch release images.
> > > > > 
> > > > > 2.6.18-1-686 kernel still allows to freeze sky2.
> > > > 
> > > > Fix didn't go in until 2.6.18.2
> > > 
> > > fix is in the 2.6.18-2-686 linux image, you'd better update
> > > your test box.
> > 
> > Just for clarification: there are at least two bugs described - one in
> > the above link, and this new one. The former could only be fixed by
> > reboot, the latter - by rmmod/modprobe sequence. The former had special
> > info in dmesg, the latter does not.
> > 
> > Hopefully they both are fixed in 2.6.18-2.
> > I will set it up as soon as time permits (it is my main desktop, which
> > is rarely turned off) and report if problem still persists.
> 
> Bug still exists in 2.6.18-2 (package version 5).
> Can be 'fixed' by rmmod/modprobe sequence though.
> Is not easily reproducible.

Bug with freeze also exists in 2.6.18-3 (package version 2.6.18-7) - no
messages in dmesg, no interrupts.
It is dual lan board with only one port being used.
rmmod/modprobe sequence brings NIC back to working mode.

-- 
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[take28-resend_2->0 7/8] kevent: Signal notifications.

2006-12-17 Thread Evgeniy Polyakov

Signal notifications.

This type of notifications allows to deliver signals through kevent queue.
One can find example application signal.c on project homepage.

If KEVENT_SIGNAL_NOMASK bit is set in raw_u64 id then signal will be
delivered only through queue, otherwise both delivery types are used - old
through update of mask of pending signals and through queue.

If signal is delivered only through kevent queue mask of pending signals
is not updated at all, which is equal to putting signal into blocked mask,
but with delivery of that signal through kevent queue.

Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]>


diff --git a/include/linux/sched.h b/include/linux/sched.h
index fc4a987..ef38a3c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -80,6 +80,7 @@ struct sched_param {
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1013,6 +1014,10 @@ struct task_struct {
 #ifdef CONFIG_TASK_DELAY_ACCT
struct task_delay_info *delays;
 #endif
+#ifdef CONFIG_KEVENT_SIGNAL
+   struct kevent_storage st;
+   u32 kevent_signals;
+#endif
 };
 
 static inline pid_t process_group(struct task_struct *tsk)
diff --git a/kernel/fork.c b/kernel/fork.c
index 1c999f3..e5b5b14 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -115,6 +116,9 @@ void __put_task_struct(struct task_struct *tsk)
WARN_ON(atomic_read(&tsk->usage));
WARN_ON(tsk == current);
 
+#ifdef CONFIG_KEVENT_SIGNAL
+   kevent_storage_fini(&tsk->st);
+#endif
security_task_free(tsk);
free_uid(tsk->user);
put_group_info(tsk->group_info);
@@ -1121,6 +1125,10 @@ static struct task_struct *copy_process(unsigned long 
clone_flags,
if (retval)
goto bad_fork_cleanup_namespace;
 
+#ifdef CONFIG_KEVENT_SIGNAL
+   kevent_storage_init(p, &p->st);
+#endif
+
p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : 
NULL;
/*
 * Clear TID on mm_release()?
diff --git a/kernel/kevent/kevent_signal.c b/kernel/kevent/kevent_signal.c
new file mode 100644
index 000..abe3972
--- /dev/null
+++ b/kernel/kevent/kevent_signal.c
@@ -0,0 +1,94 @@
+/*
+ * kevent_signal.c
+ * 
+ * 2006 Copyright (c) Evgeniy Polyakov <[EMAIL PROTECTED]>
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int kevent_signal_callback(struct kevent *k)
+{
+   struct task_struct *tsk = k->st->origin;
+   int sig = k->event.id.raw[0];
+   int ret = 0;
+
+   if (sig == tsk->kevent_signals)
+   ret = 1;
+
+   if (ret && (k->event.id.raw_u64 & KEVENT_SIGNAL_NOMASK))
+   tsk->kevent_signals |= 0x8000;
+
+   return ret;
+}
+
+int kevent_signal_enqueue(struct kevent *k)
+{
+   int err;
+
+   err = kevent_storage_enqueue(¤t->st, k);
+   if (err)
+   goto err_out_exit;
+
+   if (k->event.req_flags & KEVENT_REQ_ALWAYS_QUEUE) {
+   kevent_requeue(k);
+   err = 0;
+   } else {
+   err = k->callbacks.callback(k);
+   if (err)
+   goto err_out_dequeue;
+   }
+
+   return err;
+
+err_out_dequeue:
+   kevent_storage_dequeue(k->st, k);
+err_out_exit:
+   return err;
+}
+
+int kevent_signal_dequeue(struct kevent *k)
+{
+   kevent_storage_dequeue(k->st, k);
+   return 0;
+}
+
+int kevent_signal_notify(struct task_struct *tsk, int sig)
+{
+   tsk->kevent_signals = sig;
+   kevent_storage_ready(&tsk->st, NULL, KEVENT_SIGNAL_DELIVERY);
+   return (tsk->kevent_signals & 0x8000);
+}
+
+static int __init kevent_init_signal(void)
+{
+   struct kevent_callbacks sc = {
+   .callback = &kevent_signal_callback,
+   .enqueue = &kevent_signal_enqueue,
+   .dequeue = &kevent_signal_dequeue,
+   .flags = 0,
+   };
+
+   return kevent_add_callbacks(&sc, KEVENT_SIGNAL);
+}
+module_init(kevent_init_signal);
diff --git a/kernel/signal.c b/kernel/signal.c
index fb5da6d..d3d3594 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 

[take28-resend_2->0 3/8] kevent: poll/select() notifications.

2006-12-17 Thread Evgeniy Polyakov

poll/select() notifications.

This patch includes generic poll/select notifications.
kevent_poll works simialr to epoll and has the same issues (callback
is invoked not from internal state machine of the caller, but through
process awake, a lot of allocations and so on).

Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]>

diff --git a/fs/file_table.c b/fs/file_table.c
index bc35a40..0805547 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -119,6 +120,7 @@ struct file *get_empty_filp(void)
f->f_uid = tsk->fsuid;
f->f_gid = tsk->fsgid;
eventpoll_init_file(f);
+   kevent_init_file(f);
/* f->f_version: 0 */
return f;
 
@@ -164,6 +166,7 @@ void fastcall __fput(struct file *file)
 * in the file cleanup chain.
 */
eventpoll_release(file);
+   kevent_cleanup_file(file);
locks_remove_flock(file);
 
if (file->f_op && file->f_op->release)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5baf3a1..8bbf3a5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -276,6 +276,7 @@ extern int dir_notify_enable;
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -586,6 +587,10 @@ struct inode {
struct mutexinotify_mutex;  /* protects the watches list */
 #endif
 
+#if defined CONFIG_KEVENT_SOCKET || defined CONFIG_KEVENT_PIPE
+   struct kevent_storage   st;
+#endif
+
unsigned long   i_state;
unsigned long   dirtied_when;   /* jiffies of first dirtying */
 
@@ -739,6 +744,9 @@ struct file {
struct list_headf_ep_links;
spinlock_t  f_ep_lock;
 #endif /* #ifdef CONFIG_EPOLL */
+#ifdef CONFIG_KEVENT_POLL
+   struct kevent_storage   st;
+#endif
struct address_space*f_mapping;
 };
 extern spinlock_t files_lock;
diff --git a/kernel/kevent/kevent_poll.c b/kernel/kevent/kevent_poll.c
new file mode 100644
index 000..7ccf7da
--- /dev/null
+++ b/kernel/kevent/kevent_poll.c
@@ -0,0 +1,234 @@
+/*
+ * 2006 Copyright (c) Evgeniy Polyakov <[EMAIL PROTECTED]>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static kmem_cache_t *kevent_poll_container_cache;
+static kmem_cache_t *kevent_poll_priv_cache;
+
+struct kevent_poll_ctl
+{
+   struct poll_table_structpt;
+   struct kevent   *k;
+};
+
+struct kevent_poll_wait_container
+{
+   struct list_headcontainer_entry;
+   wait_queue_head_t   *whead;
+   wait_queue_twait;
+   struct kevent   *k;
+};
+
+struct kevent_poll_private
+{
+   struct list_headcontainer_list;
+   spinlock_t  container_lock;
+};
+
+static int kevent_poll_enqueue(struct kevent *k);
+static int kevent_poll_dequeue(struct kevent *k);
+static int kevent_poll_callback(struct kevent *k);
+
+static int kevent_poll_wait_callback(wait_queue_t *wait,
+   unsigned mode, int sync, void *key)
+{
+   struct kevent_poll_wait_container *cont =
+   container_of(wait, struct kevent_poll_wait_container, wait);
+   struct kevent *k = cont->k;
+
+   kevent_storage_ready(k->st, NULL, KEVENT_MASK_ALL);
+   return 0;
+}
+
+static void kevent_poll_qproc(struct file *file, wait_queue_head_t *whead,
+   struct poll_table_struct *poll_table)
+{
+   struct kevent *k =
+   container_of(poll_table, struct kevent_poll_ctl, pt)->k;
+   struct kevent_poll_private *priv = k->priv;
+   struct kevent_poll_wait_container *cont;
+   unsigned long flags;
+
+   cont = kmem_cache_alloc(kevent_poll_container_cache, GFP_KERNEL);
+   if (!cont) {
+   kevent_break(k);
+   return;
+   }
+
+   cont->k = k;
+   init_waitqueue_func_entry(&cont->wait, kevent_poll_wait_callback);
+   cont->whead = whead;
+
+   spin_lock_irqsave(&priv->container_lock, flags);
+   list_add_tail(&cont->container_entry, &priv->container_list);
+   spin_unlock_irqrestore(&priv->container_lock, flags);
+
+   add_wait_queue(whead, &cont->wait);
+}
+
+static int kevent_poll_enqueue(struct kevent *k)
+{
+   struct file *file;
+   int err;
+   unsigned int revents;
+   uns

[take28-resend_2->0 4/8] kevent: Socket notifications.

2006-12-17 Thread Evgeniy Polyakov

Socket notifications.

This patch includes socket send/recv/accept notifications.
Using trivial web server based on kevent and this features
instead of epoll it's performance increased more than noticebly.
More details about various benchmarks and server itself 
(evserver_kevent.c) can be found on project's homepage.

Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]>

diff --git a/fs/inode.c b/fs/inode.c
index ada7643..2740617 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /*
@@ -164,12 +165,18 @@ static struct inode *alloc_inode(struct super_block *sb)
}
inode->i_private = 0;
inode->i_mapping = mapping;
+#if defined CONFIG_KEVENT_SOCKET || defined CONFIG_KEVENT_PIPE
+   kevent_storage_init(inode, &inode->st);
+#endif
}
return inode;
 }
 
 void destroy_inode(struct inode *inode) 
 {
+#if defined CONFIG_KEVENT_SOCKET || defined CONFIG_KEVENT_PIPE
+   kevent_storage_fini(&inode->st);
+#endif
BUG_ON(inode_has_buffers(inode));
security_inode_free(inode);
if (inode->i_sb->s_op->destroy_inode)
diff --git a/include/net/sock.h b/include/net/sock.h
index edd4d73..d48ded8 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -48,6 +48,7 @@
 #include 
 #include   /* struct sk_buff */
 #include 
+#include 
 
 #include 
 
@@ -450,6 +451,21 @@ static inline int sk_stream_memory_free(struct sock *sk)
 
 extern void sk_stream_rfree(struct sk_buff *skb);
 
+struct socket_alloc {
+   struct socket socket;
+   struct inode vfs_inode;
+};
+
+static inline struct socket *SOCKET_I(struct inode *inode)
+{
+   return &container_of(inode, struct socket_alloc, vfs_inode)->socket;
+}
+
+static inline struct inode *SOCK_INODE(struct socket *socket)
+{
+   return &container_of(socket, struct socket_alloc, socket)->vfs_inode;
+}
+
 static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk)
 {
skb->sk = sk;
@@ -477,6 +493,7 @@ static inline void sk_add_backlog(struct sock *sk, struct 
sk_buff *skb)
sk->sk_backlog.tail = skb;
}
skb->next = NULL;
+   kevent_socket_notify(sk, KEVENT_SOCKET_RECV);
 }
 
 #define sk_wait_event(__sk, __timeo, __condition)  \
@@ -679,21 +696,6 @@ static inline struct kiocb *siocb_to_kiocb(struct 
sock_iocb *si)
return si->kiocb;
 }
 
-struct socket_alloc {
-   struct socket socket;
-   struct inode vfs_inode;
-};
-
-static inline struct socket *SOCKET_I(struct inode *inode)
-{
-   return &container_of(inode, struct socket_alloc, vfs_inode)->socket;
-}
-
-static inline struct inode *SOCK_INODE(struct socket *socket)
-{
-   return &container_of(socket, struct socket_alloc, socket)->vfs_inode;
-}
-
 extern void __sk_stream_mem_reclaim(struct sock *sk);
 extern int sk_stream_mem_schedule(struct sock *sk, int size, int kind);
 
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 7a093d0..69f4ad2 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -857,6 +857,7 @@ static inline int tcp_prequeue(struct sock *sk, struct 
sk_buff *skb)
tp->ucopy.memory = 0;
} else if (skb_queue_len(&tp->ucopy.prequeue) == 1) {
wake_up_interruptible(sk->sk_sleep);
+   kevent_socket_notify(sk, 
KEVENT_SOCKET_RECV|KEVENT_SOCKET_SEND);
if (!inet_csk_ack_scheduled(sk))
inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
  (3 * TCP_RTO_MIN) / 4,
diff --git a/kernel/kevent/kevent_socket.c b/kernel/kevent/kevent_socket.c
new file mode 100644
index 000..1798092
--- /dev/null
+++ b/kernel/kevent/kevent_socket.c
@@ -0,0 +1,144 @@
+/*
+ * kevent_socket.c
+ * 
+ * 2006 Copyright (c) Evgeniy Polyakov <[EMAIL PROTECTED]>
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static int kevent_socket_callback(struct kevent *k)
+{
+   struct inode *inode = k->st->origin;
+   unsigned int events = SOCKET_I(inode)->o

[take28-resend_2->0 1/8] kevent: Description.

2006-12-17 Thread Evgeniy Polyakov

Description.


diff --git a/Documentation/kevent.txt b/Documentation/kevent.txt
new file mode 100644
index 000..2e03a3f
--- /dev/null
+++ b/Documentation/kevent.txt
@@ -0,0 +1,240 @@
+Description.
+
+int kevent_init(struct kevent_ring *ring, unsigned int ring_size, 
+   unsigned int flags);
+
+num - size of the ring buffer in events 
+ring - pointer to allocated ring buffer
+flags - various flags, see KEVENT_FLAGS_* definitions.
+
+Return value: kevent control file descriptor or negative error value.
+
+ struct kevent_ring
+ {
+   unsigned int ring_kidx, ring_over;
+   struct ukevent event[0];
+ }
+
+ring_kidx - index in the ring buffer where kernel will put new events 
+   when kevent_wait() or kevent_get_events() is called 
+ring_over - number of overflows of ring_uidx happend from the start.
+   Overflow counter is used to prevent situation when two threads 
+   are going to free the same events, but one of them was scheduled 
+   away for too long, so ring indexes were wrapped, so when that 
+   thread will be awakened, it will free not those events, which 
+   it suppose to free.
+
+Example userspace code (ring_buffer.c) can be found on project's homepage.
+
+Each kevent syscall can be so called cancellation point in glibc, i.e. when 
+thread has been cancelled in kevent syscall, thread can be safely removed 
+and no events will be lost, since each syscall (kevent_wait() or 
+kevent_get_events()) will copy event into special ring buffer, accessible 
+from other threads or even processes (if shared memory is used).
+
+When kevent is removed (not dequeued when it is ready, but just removed), 
+even if it was ready, it is not copied into ring buffer, since if it is 
+removed, no one cares about it (otherwise user would wait until it becomes 
+ready and got it through usual way using kevent_get_events() or kevent_wait()) 
+and thus no need to copy it to the ring buffer.
+
+---
+
+
+int kevent_ctl(int fd, unsigned int cmd, unsigned int num, struct ukevent 
*arg);
+
+fd - is the file descriptor referring to the kevent queue to manipulate. 
+It is created by opening "/dev/kevent" char device, which is created with 
+dynamic minor number and major number assigned for misc devices. 
+
+cmd - is the requested operation. It can be one of the following:
+KEVENT_CTL_ADD - add event notification 
+KEVENT_CTL_REMOVE - remove event notification 
+KEVENT_CTL_MODIFY - modify existing notification 
+KEVENT_CTL_READY - mark existing events as ready, if number of events is 
zero,
+   it just wakes up parked in syscall thread
+
+num - number of struct ukevent in the array pointed to by arg 
+arg - array of struct ukevent
+
+Return value: 
+ number of events processed or negative error value.
+
+When called, kevent_ctl will carry out the operation specified in the 
+cmd parameter.
+---
+
+ int kevent_get_events(int ctl_fd, unsigned int min_nr, unsigned int max_nr, 
+   struct timespec timeout, struct ukevent *buf, unsigned flags);
+
+ctl_fd - file descriptor referring to the kevent queue 
+min_nr - minimum number of completed events that kevent_get_events will block 
+waiting for 
+max_nr - number of struct ukevent in buf 
+timeout - time to wait before returning less than min_nr 
+ events. If this is -1, then wait forever. 
+buf - pointer to an array of struct ukevent. 
+flags - various flags, see KEVENT_FLAGS_* definitions.
+
+Return value:
+ number of events copied or negative error value.
+
+kevent_get_events will wait timeout milliseconds for at least min_nr completed 
+events, copying completed struct ukevents to buf and deleting any 
+KEVENT_REQ_ONESHOT event requests. In nonblocking mode it returns as many 
+events as possible, but not more than max_nr. In blocking mode it waits until 
+timeout or if at least min_nr events are ready.
+
+This function copies event into ring buffer if it was initialized, if ring 
buffer
+is full, KEVENT_RET_COPY_FAILED flag is set in ret_flags field.
+---
+
+ int kevent_wait(int ctl_fd, unsigned int num, unsigned int old_uidx, 
+   struct timespec timeout, unsigned int flags);
+
+ctl_fd - file descriptor referring to the kevent queue 
+num - number of processed kevents 
+old_uidx - the last index user is aware of
+timeout - time to wait until there is free space in kevent queue
+flags - various flags, see KEVENT_FLAGS_* definitions.
+
+Return value:
+ number of events copied into ring buffer or negative error value.
+
+This syscall waits until either timeout expires or at least one event becomes 
+ready. It also copies events into special ring buffer. If ring buffer is full,
+it waits until there are ready events and then return.
+If kevent is one-shot kevent it is remo

[take28-resend_2->0 6/8] kevent: Pipe notifications.

2006-12-17 Thread Evgeniy Polyakov

Pipe notifications.


diff --git a/fs/pipe.c b/fs/pipe.c
index f3b6f71..aeaee9c 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -312,6 +313,7 @@ redo:
break;
}
if (do_wakeup) {
+   kevent_pipe_notify(inode, KEVENT_SOCKET_SEND);
wake_up_interruptible_sync(&pipe->wait);
kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
}
@@ -321,6 +323,7 @@ redo:
 
/* Signal writers asynchronously that there is more room. */
if (do_wakeup) {
+   kevent_pipe_notify(inode, KEVENT_SOCKET_SEND);
wake_up_interruptible(&pipe->wait);
kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
}
@@ -490,6 +493,7 @@ redo2:
break;
}
if (do_wakeup) {
+   kevent_pipe_notify(inode, KEVENT_SOCKET_RECV);
wake_up_interruptible_sync(&pipe->wait);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
do_wakeup = 0;
@@ -501,6 +505,7 @@ redo2:
 out:
mutex_unlock(&inode->i_mutex);
if (do_wakeup) {
+   kevent_pipe_notify(inode, KEVENT_SOCKET_RECV);
wake_up_interruptible(&pipe->wait);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
}
@@ -605,6 +610,7 @@ pipe_release(struct inode *inode, int decr, int decw)
free_pipe_info(inode);
} else {
wake_up_interruptible(&pipe->wait);
+   kevent_pipe_notify(inode, 
KEVENT_SOCKET_SEND|KEVENT_SOCKET_RECV);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
}
diff --git a/kernel/kevent/kevent_pipe.c b/kernel/kevent/kevent_pipe.c
new file mode 100644
index 000..91dc1eb
--- /dev/null
+++ b/kernel/kevent/kevent_pipe.c
@@ -0,0 +1,123 @@
+/*
+ * kevent_pipe.c
+ * 
+ * 2006 Copyright (c) Evgeniy Polyakov <[EMAIL PROTECTED]>
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int kevent_pipe_callback(struct kevent *k)
+{
+   struct inode *inode = k->st->origin;
+   struct pipe_inode_info *pipe = inode->i_pipe;
+   int nrbufs = pipe->nrbufs;
+
+   if (k->event.event & KEVENT_SOCKET_RECV && nrbufs > 0) {
+   if (!pipe->writers)
+   return -1;
+   return 1;
+   }
+   
+   if (k->event.event & KEVENT_SOCKET_SEND && nrbufs < PIPE_BUFFERS) {
+   if (!pipe->readers)
+   return -1;
+   return 1;
+   }
+
+   return 0;
+}
+
+int kevent_pipe_enqueue(struct kevent *k)
+{
+   struct file *pipe;
+   int err = -EBADF;
+   struct inode *inode;
+
+   pipe = fget(k->event.id.raw[0]);
+   if (!pipe)
+   goto err_out_exit;
+
+   inode = igrab(pipe->f_dentry->d_inode);
+   if (!inode)
+   goto err_out_fput;
+
+   err = -EINVAL;
+   if (!S_ISFIFO(inode->i_mode))
+   goto err_out_iput;
+
+   err = kevent_storage_enqueue(&inode->st, k);
+   if (err)
+   goto err_out_iput;
+
+   if (k->event.req_flags & KEVENT_REQ_ALWAYS_QUEUE) {
+   kevent_requeue(k);
+   err = 0;
+   } else {
+   err = k->callbacks.callback(k);
+   if (err)
+   goto err_out_dequeue;
+   }
+
+   fput(pipe);
+
+   return err;
+
+err_out_dequeue:
+   kevent_storage_dequeue(k->st, k);
+err_out_iput:
+   iput(inode);
+err_out_fput:
+   fput(pipe);
+err_out_exit:
+   return err;
+}
+
+int kevent_pipe_dequeue(struct kevent *k)
+{
+   struct inode *inode = k->st->origin;
+
+   kevent_storage_dequeue(k->st, k);
+   iput(inode);
+
+   return 0;
+}
+
+void kevent_pipe_notify(struct inode *inode, u32 event)
+{
+   kevent_storage_ready(&inode->st, NULL, event);
+}
+
+static int __init kevent_init_pipe(void)
+{
+ 

[take28-resend_2->0 5/8] kevent: Timer notifications.

2006-12-17 Thread Evgeniy Polyakov

Timer notifications.

Timer notifications can be used for fine grained per-process time 
management, since interval timers are very inconvenient to use, 
and they are limited.

This subsystem uses high-resolution timers.
id.raw[0] is used as number of seconds
id.raw[1] is used as number of nanoseconds

Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]>

diff --git a/kernel/kevent/kevent_timer.c b/kernel/kevent/kevent_timer.c
new file mode 100644
index 000..c21a155
--- /dev/null
+++ b/kernel/kevent/kevent_timer.c
@@ -0,0 +1,114 @@
+/*
+ * 2006 Copyright (c) Evgeniy Polyakov <[EMAIL PROTECTED]>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct kevent_timer
+{
+   struct hrtimer  ktimer;
+   struct kevent_storage   ktimer_storage;
+   struct kevent   *ktimer_event;
+};
+
+static int kevent_timer_func(struct hrtimer *timer)
+{
+   struct kevent_timer *t = container_of(timer, struct kevent_timer, 
ktimer);
+   struct kevent *k = t->ktimer_event;
+
+   kevent_storage_ready(&t->ktimer_storage, NULL, KEVENT_MASK_ALL);
+   hrtimer_forward(timer, timer->base->softirq_time,
+   ktime_set(k->event.id.raw[0], k->event.id.raw[1]));
+   return HRTIMER_RESTART;
+}
+
+static struct lock_class_key kevent_timer_key;
+
+static int kevent_timer_enqueue(struct kevent *k)
+{
+   int err;
+   struct kevent_timer *t;
+
+   t = kmalloc(sizeof(struct kevent_timer), GFP_KERNEL);
+   if (!t)
+   return -ENOMEM;
+
+   hrtimer_init(&t->ktimer, CLOCK_MONOTONIC, HRTIMER_REL);
+   t->ktimer.expires = ktime_set(k->event.id.raw[0], k->event.id.raw[1]);
+   t->ktimer.function = kevent_timer_func;
+   t->ktimer_event = k;
+
+   err = kevent_storage_init(&t->ktimer, &t->ktimer_storage);
+   if (err)
+   goto err_out_free;
+   lockdep_set_class(&t->ktimer_storage.lock, &kevent_timer_key);
+
+   err = kevent_storage_enqueue(&t->ktimer_storage, k);
+   if (err)
+   goto err_out_st_fini;
+
+   hrtimer_start(&t->ktimer, t->ktimer.expires, HRTIMER_REL);
+
+   return 0;
+
+err_out_st_fini:
+   kevent_storage_fini(&t->ktimer_storage);
+err_out_free:
+   kfree(t);
+
+   return err;
+}
+
+static int kevent_timer_dequeue(struct kevent *k)
+{
+   struct kevent_storage *st = k->st;
+   struct kevent_timer *t = container_of(st, struct kevent_timer, 
ktimer_storage);
+
+   hrtimer_cancel(&t->ktimer);
+   kevent_storage_dequeue(st, k);
+   kfree(t);
+
+   return 0;
+}
+
+static int kevent_timer_callback(struct kevent *k)
+{
+   k->event.ret_data[0] = jiffies_to_msecs(jiffies);
+   return 1;
+}
+
+static int __init kevent_init_timer(void)
+{
+   struct kevent_callbacks tc = {
+   .callback = &kevent_timer_callback,
+   .enqueue = &kevent_timer_enqueue,
+   .dequeue = &kevent_timer_dequeue,
+   .flags = 0,
+   };
+
+   return kevent_add_callbacks(&tc, KEVENT_TIMER);
+}
+module_init(kevent_init_timer);
+

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[take28-resend_2->0 0/8] kevent: Generic event handling mechanism.

2006-12-17 Thread Evgeniy Polyakov

Generic event handling mechanism.

Kevent is a generic subsytem which allows to handle event notifications.
It supports both level and edge triggered events. It is similar to
poll/epoll in some cases, but it is more scalable, it is faster and
allows to work with essentially eny kind of events.

Events are provided into kernel through control syscall and can be read
back through ring buffer or using usual syscalls.
Kevent update (i.e. readiness switching) happens directly from internals
of the appropriate state machine of the underlying subsytem (like
network, filesystem, timer or any other).

Homepage:
http://tservice.net.ru/~s0mbre/old/?section=projects&item=kevent

Documentation page:
http://linux-net.osdl.org/index.php/Kevent

Consider for inclusion.

New benchmark, which can be a hoax though, can be found at 
http://tservice.net.ru/~s0mbre/blog/2006/11/30#2006_11_30
where kevent on amd64 with 1gb of ram can handle more than 7200 events per 
second with 8000 requests concurrency with 'ab' benchmark and lighttpd.
Although I tought it should not be published due to possible errors,
I decided to send it for review.

With this release I start 3 days resending timeout - i.e. each third day I 
will send either new version (if something new was requested and agreed to 
be implemented) or resending with back counter started from three. 
When back counter hits zero after three resending I consider there is no 
interest in subsystem and I will stop further sending.

Thanks for understanding and your time.

Changes from 'take27' patchset:
 * made kevent default yes in non embedded case.
 * added falgs to callback structures - currently used to check if kevent
can be requested from kernelspace only (posix timers) or 
userspace (all others)

Changes from 'take26' patchset:
 * made kevent visible in config only in case of embedded setup.
 * added comment about KEVENT_MAX number.
 * spell fix.

Changes from 'take25' patchset:
 * use timespec as timeout parameter.
 * added high-resolution timer to handle absolute timeouts.
 * added flags to waiting and initialization syscalls.
 * kevent_commit() has new_uidx parameter.
 * kevent_wait() has old_uidx parameter, which, if not equal to u->uidx,
results in immediate wakeup (usefull for the case when entries
are added asynchronously from kernel (not supported for now)).
 * added interface to mark any event as ready.
 * event POSIX timers support.
 * return -ENOSYS if there is no registered event type.
 * provided file descriptor must be checked for fifo type (spotted by Eric 
Dumazet).
 * signal notifications.
 * documentation update.
 * lighttpd patch updated (the latest benchmarks with lighttpd patch can be 
found in blog).

Changes from 'take24' patchset:
 * new (old (new)) ring buffer implementation with kernel and user indexes.
 * added initialization syscall instead of opening /dev/kevent
 * kevent_commit() syscall to commit ring buffer entries
 * changed KEVENT_REQ_WAKEUP_ONE flag to KEVENT_REQ_WAKEUP_ALL, kevent wakes
   only first thread always if that flag is not set
 * KEVENT_REQ_ALWAYS_QUEUE flag. If set, kevent will be queued into ready queue
   instead of copying back to userspace when kevent is ready immediately when
   it is added.
 * lighttpd patch (Hail! Although nothing really outstanding compared to epoll)

Changes from 'take23' patchset:
 * kevent PIPE notifications
 * KEVENT_REQ_LAST_CHECK flag, which allows to perform last check at dequeueing 
time
 * fixed poll/select notifications (were broken due to tree manipulations)
 * made Documentation/kevent.txt look nice in 80-col terminal
 * fix for copy_to_user() failure report for the first kevent (Andrew Morton)
 * minor function renames

Changes from 'take22' patchset:
 * new ring buffer implementation in process' memory
 * wakeup-one-thread flag
 * edge-triggered behaviour

Changes from 'take21' patchset:
 * minor cleanups (different return values, removed unneded variables, 
whitespaces and so on)
 * fixed bug in kevent removal in case when kevent being removed
   is the same as overflow_kevent (spotted by Eric Dumazet)

Changes from 'take20' patchset:
 * new ring buffer implementation
 * removed artificial limit on possible number of kevents

Changes from 'take19' patchset:
 * use __init instead of __devinit
 * removed 'default N' from config for user statistic
 * removed kevent_user_fini() since kevent can not be unloaded
 * use KERN_INFO for statistic output

Changes from 'take18' patchset:
 * use __init instead of __devinit
 * removed 'default N' from config for user statistic
 * removed kevent_user_fini() since kevent can not be unloaded
 * use KERN_INFO for statistic output

Changes from 'take17' patchset:
 * Use RB tree instead of hash table. 
At least for a web sever, frequency of addition/deletion of new kevent 
is comparable with number of search access, i.e. most of the time 
events 
are added, accesed only couple of times and then rem

[take28-resend_2->0 8/8] kevent: Kevent posix timer notifications.

2006-12-17 Thread Evgeniy Polyakov

Kevent posix timer notifications.

Simple extensions to POSIX timers which allows
to deliver notification of the timer expiration
through kevent queue.

Example application posix_timer.c can be found
in archive on project homepage.

Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]>


diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
index 8786e01..3768746 100644
--- a/include/asm-generic/siginfo.h
+++ b/include/asm-generic/siginfo.h
@@ -235,6 +235,7 @@ typedef struct siginfo {
 #define SIGEV_NONE 1   /* other notification: meaningless */
 #define SIGEV_THREAD   2   /* deliver via thread creation */
 #define SIGEV_THREAD_ID 4  /* deliver to thread */
+#define SIGEV_KEVENT   8   /* deliver through kevent queue */
 
 /*
  * This works because the alignment is ok on all current architectures
@@ -260,6 +261,8 @@ typedef struct sigevent {
void (*_function)(sigval_t);
void *_attribute;   /* really pthread_attr_t */
} _sigev_thread;
+
+   int kevent_fd;
} _sigev_un;
 } sigevent_t;
 
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index a7dd38f..4b9deb4 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -4,6 +4,7 @@
 #include 
 #include 
 #include 
+#include 
 
 union cpu_time_count {
cputime_t cpu;
@@ -49,6 +50,9 @@ struct k_itimer {
sigval_t it_sigev_value;/* value word of sigevent struct */
struct task_struct *it_process; /* process to send signal to */
struct sigqueue *sigq;  /* signal queue entry. */
+#ifdef CONFIG_KEVENT_TIMER
+   struct kevent_storage st;
+#endif
union {
struct {
struct hrtimer timer;
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index e5ebcc1..74270f8 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -48,6 +48,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 /*
  * Management arrays for POSIX timers.  Timers are kept in slab memory
@@ -224,6 +226,100 @@ static int posix_ktime_get_ts(clockid_t which_clock, 
struct timespec *tp)
return 0;
 }
 
+#ifdef CONFIG_KEVENT_TIMER
+static int posix_kevent_enqueue(struct kevent *k)
+{
+   /*
+* It is not ugly - there is no pointer in the id field union, 
+* but its size is 64bits, which is ok for any known pointer size.
+*/
+   struct k_itimer *tmr = (struct k_itimer *)(unsigned 
long)k->event.id.raw_u64;
+   return kevent_storage_enqueue(&tmr->st, k);
+}
+static int posix_kevent_dequeue(struct kevent *k)
+{
+   struct k_itimer *tmr = (struct k_itimer *)(unsigned 
long)k->event.id.raw_u64;
+   kevent_storage_dequeue(&tmr->st, k);
+   return 0;
+}
+static int posix_kevent_callback(struct kevent *k)
+{
+   return 1;
+}
+static int posix_kevent_init(void)
+{
+   struct kevent_callbacks tc = {
+   .callback = &posix_kevent_callback,
+   .enqueue = &posix_kevent_enqueue,
+   .dequeue = &posix_kevent_dequeue,
+   .flags = KEVENT_CALLBACKS_KERNELONLY};
+
+   return kevent_add_callbacks(&tc, KEVENT_POSIX_TIMER);
+}
+
+extern struct file_operations kevent_user_fops;
+
+static int posix_kevent_init_timer(struct k_itimer *tmr, int fd)
+{
+   struct ukevent uk;
+   struct file *file;
+   struct kevent_user *u;
+   int err;
+
+   file = fget(fd);
+   if (!file) {
+   err = -EBADF;
+   goto err_out;
+   }
+
+   if (file->f_op != &kevent_user_fops) {
+   err = -EINVAL;
+   goto err_out_fput;
+   }
+
+   u = file->private_data;
+
+   memset(&uk, 0, sizeof(struct ukevent));
+
+   uk.event = KEVENT_MASK_ALL;
+   uk.type = KEVENT_POSIX_TIMER;
+   uk.id.raw_u64 = (unsigned long)(tmr); /* Just cast to something unique 
*/
+   uk.req_flags = KEVENT_REQ_ONESHOT | KEVENT_REQ_ALWAYS_QUEUE;
+   uk.ptr = tmr->it_sigev_value.sival_ptr;
+
+   err = kevent_user_add_ukevent(&uk, u);
+   if (err)
+   goto err_out_fput;
+
+   fput(file);
+
+   return 0;
+
+err_out_fput:
+   fput(file);
+err_out:
+   return err;
+}
+
+static void posix_kevent_fini_timer(struct k_itimer *tmr)
+{
+   kevent_storage_fini(&tmr->st);
+}
+#else
+static int posix_kevent_init_timer(struct k_itimer *tmr, int fd)
+{
+   return -ENOSYS;
+}
+static int posix_kevent_init(void)
+{
+   return 0;
+}
+static void posix_kevent_fini_timer(struct k_itimer *tmr)
+{
+}
+#endif
+
+
 /*
  * Initialize everything, well, just everything in Posix clocks/timers ;)
  */
@@ -241,6 +337,11 @@ static __init int init_posix_timers(void)
register_posix_clock(CLOCK_REALTIME, &clock_realtime);
register_posix_clock(CLOCK_MONOTONIC, &clock_monotonic);
 
+   if (posix_kevent_init()) {
+   printk(KERN_ERR "Failed t

[TCP]: Fix oops caused by tcp_v4_md5_do_del

2006-12-17 Thread Leigh Brown
md5sig_info.alloced4 must be set to zero when freeing keys4, otherwise
it will not be alloc'd again when another key is added to the same
socket by tcp_v4_md5_do_add.

Signed-off-by: Leigh Brown <[EMAIL PROTECTED]>

diff -uprN a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
--- a/net/ipv4/tcp_ipv4.c   2006-12-17 09:51:21.0 +
+++ b/net/ipv4/tcp_ipv4.c   2006-12-17 10:05:54.0 +
@@ -929,6 +929,7 @@ int tcp_v4_md5_do_del(struct sock *sk, _
if (tp->md5sig_info->entries4 == 0) {
kfree(tp->md5sig_info->keys4);
tp->md5sig_info->keys4 = NULL;
+   tp->md5sig_info->alloced4 = 0;
} else if (tp->md5sig_info->entries4 != i) {
/* Need to do some manipulation */
memcpy(&tp->md5sig_info->keys4[i],

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] he: tiny space savings

2006-12-17 Thread Alexey Dobriyan
From: Andi Drebes <[EMAIL PROTECTED]>

   textdata bss dec hex filename
  20015 480  28   20523502b drivers/atm/he.o
  19997 480  28   205055019 drivers/atm/he.o

Signed-off-by: Andi Drebes <[EMAIL PROTECTED]>
Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
---

 drivers/atm/he.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -101,7 +101,7 @@ #endif /* HE_DEBUG */
 
 /* version definition */
 
-static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
+static const char version[] = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp 
$";
 
 /* declarations */
 

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[1/1] connector: fix compilation breakage introduced recently.

2006-12-17 Thread Evgeniy Polyakov
Linus has changed work queue structure and has not tested it with
connector compiled in, his changes break the build.

Attached patch fixes compilation error.

Patch is against commit 99f5e9718185f07458ae70c2282c2153a2256c91.

Thanks to Toralf Förster for pointing this out.

Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]>

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 5e7cd45..4cec1a8 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -135,8 +135,7 @@ static int cn_call_callback(struct cn_msg *msg, void 
(*destruct_data)(void *), v
spin_lock_bh(&dev->cbdev->queue_lock);
list_for_each_entry(__cbq, &dev->cbdev->queue_list, callback_entry) {
if (cn_cb_equal(&__cbq->id.id, &msg->id)) {
-   if (likely(!test_bit(WORK_STRUCT_PENDING,
-&__cbq->work.work.management) &&
+   if (likely(!work_pending(&__cbq->work.work) &&
__cbq->data.ddata == NULL)) {
__cbq->data.callback_priv = msg;
 


-- 
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fw: [Bugme-new] [Bug 7696] New: b44 driver doesn't work under heavy load

2006-12-17 Thread Andrew Morton


Begin forwarded message:

Date: Sun, 17 Dec 2006 02:20:59 -0800
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Bugme-new] [Bug 7696] New: b44 driver doesn't work under heavy load


http://bugzilla.kernel.org/show_bug.cgi?id=7696

   Summary: b44 driver doesn't work under heavy load
Kernel Version: 2.6.20_rc1
Status: NEW
  Severity: normal
 Owner: [EMAIL PROTECTED]
 Submitter: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]


First reported as a Gentoo bug[1] I also experience this problem. Under heavy
load (ie, downloading tarballs etc as opposed to browsing or irc) dmesg fills up
with these messages:

b44: eth0: Link is down.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.

Also, ssh sessions cut out with 'Connection reset by peer' error, and downloads
often fail at this point.

lspci -v output:01:09.0 Ethernet controller: Broadcom Corporation BCM4401
100Base-T (rev 01)
Subsystem: Dell Unknown device 8127
Flags: bus master, fast devsel, latency 64, IRQ 18
Memory at fe9fe000 (32-bit, non-prefetchable) [size=8K]
Expansion ROM at 2008 [disabled] [size=16K]
Capabilities: [40] Power Management version 2

I currently have the b44 driver compiled into my kernel. The earliest kernel
I've reproduce this with is 2.6.15, though I can go back further if necessary.
This is still reproducible with 2.6.20_rc1.

[1] http://bugs.gentoo.org/show_bug.cgi?id=147722

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html