[PATCH] fix atl1 braino
Spot the bug... Signed-off-by: Al Viro <[EMAIL PROTECTED]> --- diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c index 08b2d78..e28707a 100644 --- a/drivers/net/atl1/atl1_hw.c +++ b/drivers/net/atl1/atl1_hw.c @@ -357,7 +357,7 @@ void atl1_hash_set(struct atl1_hw *hw, u32 hash_value) */ hash_reg = (hash_value >> 31) & 0x1; hash_bit = (hash_value >> 26) & 0x1F; - mta = ioread32((hw + REG_RX_HASH_TABLE) + (hash_reg << 2)); + mta = ioread32((hw->hw_addr + REG_RX_HASH_TABLE) + (hash_reg << 2)); mta |= (1 << hash_bit); iowrite32(mta, (hw->hw_addr + REG_RX_HASH_TABLE) + (hash_reg << 2)); } - 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][NET][BRIDGE] br_if: oops in port_carrier_check
On Mon, Feb 12, 2007 at 09:47:38AM -0800, Stephen Hemminger wrote: > On Mon, 12 Feb 2007 11:28:48 +0100 > Jarek Poplawski <[EMAIL PROTECTED]> wrote: > > > Here is my patch proposal for testing. > > If it doesn't work - forget about it. > > (Prepared with 2.6.20-git6 but could > > be applied to 2.6.20 also.) > > > > Jarek P. > > > > > > dev_hold/dev_put added to prevent dev kfree > > during port_carrier_check runnig, while dev > > and port are removed. > > No, holding the reference just stops the kfree, it doesn't > stop the device from being removed from the port. But I wrote above it is only to prevent the kfree. >p = dev->br_port; >if (!p) >goto done; >br = p->br; Then p is NULL here and we goto done. Sorry, but the first version was wrong (incomplete). Below I attach a new proposal. Signed-off-by: Jarek Poplawski <[EMAIL PROTECTED]> --- diff -Nurp linux-2.6.20-git7-/net/bridge/br_if.c linux-2.6.20-git7/net/bridge/br_if.c --- linux-2.6.20-git7-/net/bridge/br_if.c 2007-02-12 20:27:49.0 +0100 +++ linux-2.6.20-git7/net/bridge/br_if.c2007-02-12 20:53:27.0 +0100 @@ -108,6 +108,7 @@ static void port_carrier_check(struct wo spin_unlock_bh(&br->lock); } done: + dev_put(dev); rtnl_unlock(); } @@ -161,7 +162,8 @@ static void del_nbp(struct net_bridge_po dev_set_promiscuity(dev, -1); - cancel_delayed_work(&p->carrier_check); + if (cancel_delayed_work(&p->carrier_check)) + dev_put(dev); spin_lock_bh(&br->lock); br_stp_disable_port(p); @@ -444,7 +446,9 @@ int br_add_if(struct net_bridge *br, str spin_lock_bh(&br->lock); br_stp_recalculate_bridge_id(br); br_features_recompute(br); - schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); + if (schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE)) + dev_hold(dev); + spin_unlock_bh(&br->lock); dev_set_mtu(br->dev, br_min_mtu(br)); diff -Nurp linux-2.6.20-git7-/net/bridge/br_notify.c linux-2.6.20-git7/net/bridge/br_notify.c --- linux-2.6.20-git7-/net/bridge/br_notify.c 2007-02-12 20:27:49.0 +0100 +++ linux-2.6.20-git7/net/bridge/br_notify.c2007-02-12 20:50:50.0 +0100 @@ -56,7 +56,9 @@ static int br_device_event(struct notifi case NETDEV_CHANGE: if (br->dev->flags & IFF_UP) - schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); + if (schedule_delayed_work(&p->carrier_check, + BR_PORT_DEBOUNCE)) + dev_hold(dev); break; case NETDEV_FEAT_CHANGE: - 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
[git patches] gianfar sysfs driver fix
Please pull from 'gfar' branch of master.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git gfar (will try this as a git pull request, see if that works better :) to receive the following updates: drivers/net/gianfar_sysfs.c | 108 ++-- 1 file changed, 55 insertions(+), 53 deletions(-) Kumar Gala (1): Convert network devices to use struct device instead of class_device diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c index 9dd387f..6e2166a 100644 --- a/drivers/net/gianfar_sysfs.c +++ b/drivers/net/gianfar_sysfs.c @@ -39,13 +39,15 @@ #include "gianfar.h" #define GFAR_ATTR(_name) \ -static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \ -static ssize_t gfar_set_##_name(struct class_device *cdev, \ +static ssize_t gfar_show_##_name(struct device *dev, \ +struct device_attribute *attr, char *buf); \ +static ssize_t gfar_set_##_name(struct device *dev, \ + struct device_attribute *attr, \ const char *buf, size_t count); \ -static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name) +static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name) #define GFAR_CREATE_FILE(_dev, _name) \ - class_device_create_file(&_dev->class_dev, &class_device_attr_##_name) + device_create_file(&_dev->dev, &dev_attr_##_name) GFAR_ATTR(bd_stash); GFAR_ATTR(rx_stash_size); @@ -54,29 +56,28 @@ GFAR_ATTR(fifo_threshold); GFAR_ATTR(fifo_starve); GFAR_ATTR(fifo_starve_off); -#define to_net_dev(cd) container_of(cd, struct net_device, class_dev) - -static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf) +static ssize_t gfar_show_bd_stash(struct device *dev, + struct device_attribute *attr, char *buf) { - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); + struct gfar_private *priv = netdev_priv(to_net_dev(dev)); - return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off"); + return sprintf(buf, "%s\n", priv->bd_stash_en ? "on" : "off"); } -static ssize_t gfar_set_bd_stash(struct class_device *cdev, - const char *buf, size_t count) +static ssize_t gfar_set_bd_stash(struct device *dev, +struct device_attribute *attr, +const char *buf, size_t count) { - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); + struct gfar_private *priv = netdev_priv(to_net_dev(dev)); int new_setting = 0; u32 temp; unsigned long flags; /* Find out the new setting */ - if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1)) + if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) new_setting = 1; - else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1)) + else if (!strncmp("off", buf, count - 1) +|| !strncmp("0", buf, count - 1)) new_setting = 0; else return count; @@ -100,19 +101,19 @@ static ssize_t gfar_set_bd_stash(struct class_device *cdev, return count; } -static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf) +static ssize_t gfar_show_rx_stash_size(struct device *dev, + struct device_attribute *attr, char *buf) { - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); + struct gfar_private *priv = netdev_priv(to_net_dev(dev)); return sprintf(buf, "%d\n", priv->rx_stash_size); } -static ssize_t gfar_set_rx_stash_size(struct class_device *cdev, - const char *buf, size_t count) +static ssize_t gfar_set_rx_stash_size(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); + struct gfar_private *priv = netdev_priv(to_net_dev(dev)); unsigned int length = simple_strtoul(buf, NULL, 0); u32 temp; unsigned long flags; @@ -146,21 +147,21 @@ static ssize_t gfar_set_rx_stash_size(struct class_device *cdev, return count; } - /* Stashing will only be enabled when rx_stash_size != 0 */ -static ssize_t gfar_show_rx_stash_index(struct class_device *cdev, char *buf) +static ssize_t gfar_show_rx_stash_index(struct device *dev, + struct device_attribute *attr, + char *buf) { - struct net_device *dev = to_net_dev(cdev); - struct gfar_private *priv = netdev_priv(dev); + struct gfar_private *priv = netdev_priv(to_net_dev(dev)); return sprintf(buf, "%d\n", priv->rx_stash_index); } -sta
Re: [take35 0/10] kevent: Generic event handling mechanism.
On Mon, Feb 12, 2007 at 09:13:35AM -0800, Andrew Morton ([EMAIL PROTECTED]) wrote: > > On Mon, 12 Feb 2007 13:35:10 +0300 Evgeniy Polyakov <[EMAIL PROTECTED]> > > wrote: > > Andrew, do you consider kevent for inclusion or declining? > > I haven't had time to think about it in the past month or two, sorry. > > However we might as well get it back in there for review-and-test - please > send a new patchset once 2.6.21-rc1 is released and copy me on it? Ok, I will. You are always in copy for kevent patchsets. -- 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
Re: [take35 0/10] kevent: Generic event handling mechanism.
On Mon, Feb 12, 2007 at 06:59:17AM -0800, Ulrich Drepper ([EMAIL PROTECTED]) wrote: > Evgeniy Polyakov wrote: > > I think that mean that everybody is happy with APi, design and set of > > features. > > No comment means that I still have not been able to test anything since > regardless of what version I tried, it failed to build. I think if you would provide error message you saw, I fixed that in a couple of moments, doesn't it? I will send new patchset next week when rc1 will be out and your feedback is greatly appreciated. > -- > ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ > -- 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
Re: [XFRM]: Fix IPv4 tunnel mode decapsulation with IPV6=n
Thanks for this bug fix Patrick, applied. - 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.6.20.y & net-2.6] [IPV6] HASHTABLES: Use appropriate seed for caluculating ehash index.
From: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> Date: Tue, 13 Feb 2007 09:48:41 +0900 (JST) > Tetsuo Handa <[EMAIL PROTECTED]> told me that connect(2) with TCPv6 > socket almost always took a few minutes to return when we did not have any > ports available in the range of net.ipv4.ip_local_port_range. > > The reason was that we used incorrect seed for calculating index of > hash when we check established sockets in __inet6_check_established(). > > Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> Thank you for this bug fix, applied. Here is my signoff for -stable. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> - 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.20-git8 fails compile -- net/built-in.o __ipv6_addr_type
From: Neil Brown <[EMAIL PROTECTED]> Date: Tue, 13 Feb 2007 13:52:26 +1100 > On Monday February 12, [EMAIL PROTECTED] wrote: > > Quoting YOSHIFUJIHideaki/=?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= > > > In article <[EMAIL PROTECTED]> (at Mon, 12 Feb 2007 18:12:16 -0800), > > Andrew Morton <[EMAIL PROTECTED]> says: > > > > > > > > On Mon, 12 Feb 2007 20:10:13 -0500 (EST) Pete Clements <[EMAIL > > PROTECTED]> wrote: > > > > > 2.6.20-git8 fails compile: > > > > > > > > > > CHK include/linux/compile.h > > > > > UPD include/linux/compile.h > > > > > CC init/version.o > > > > > LD init/built-in.o > > > > > LD .tmp_vmlinux1 > > > > > net/built-in.o: In function `svc_udp_recvfrom': > > > > > svcsock.c:(.text+0x61be4): undefined reference to `__ipv6_addr_type' > > > > > make: *** [.tmp_vmlinux1] Error 1 > > > > > > > Hmmm. > > > CONFIG_IPV6=m > combined with > > CONFIG_SUNRPC=y > > is a combination that isn't going to work at the moment > > Options? > > - Move __ipv6_addr_type to lib/ ?? > Might not work for modules. > - Disallow that combination in the .config. > .. a bit harsh. > - Only include IPv6 support in SUNRPC is a module or IPV6 is built-in > A bit of a kludge.. > > Chuck? Any ideas? Make the proper dependencies, so that SUNRPC is only possibly built modular is IPV6 is modular, that's the correct way to do this. - 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.20-git8 fails compile -- net/built-in.o __ipv6_addr_type
From: Andrew Morton <[EMAIL PROTECTED]> Date: Mon, 12 Feb 2007 18:12:16 -0800 > > On Mon, 12 Feb 2007 20:10:13 -0500 (EST) Pete Clements <[EMAIL PROTECTED]> > > wrote: > > 2.6.20-git8 fails compile: > > > > CHK include/linux/compile.h > > UPD include/linux/compile.h > > CC init/version.o > > LD init/built-in.o > > LD .tmp_vmlinux1 > > net/built-in.o: In function `svc_udp_recvfrom': > > svcsock.c:(.text+0x61be4): undefined reference to `__ipv6_addr_type' > > make: *** [.tmp_vmlinux1] Error 1 > > > > Please send the .config. Not necessary, the bug is obvious, see my other reply to this report. - 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/5] r8169: more alignment for the 0x8168
Francois Romieu wrote: > Two thirds of packets are lost because of misalignment. Users of > Asus laptop did apparently not notice it. > > Reported on Gigabyte GA-945GM-S2. > > Fix for http://bugzilla.kernel.org/show_bug.cgi?id=7517 > > Signed-off-by: Francois Romieu <[EMAIL PROTECTED]> > --- > drivers/net/r8169.c |4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c > index 0b57050..2379d83 100644 > --- a/drivers/net/r8169.c > +++ b/drivers/net/r8169.c > @@ -2018,7 +2018,7 @@ static int rtl8169_alloc_rx_skb(struct p > if (!skb) > goto err_out; > > - skb_reserve(skb, align); > + skb_reserve(skb, (align - 1) & (u32)skb->data); > *sk_buff = skb; > > mapping = pci_map_single(pdev, skb->data, rx_buf_sz, > @@ -2486,7 +2486,7 @@ static inline int rtl8169_try_rx_copy(st > > skb = dev_alloc_skb(pkt_size + align); > if (skb) { > - skb_reserve(skb, align); > + skb_reserve(skb, (align - 1) & (u32)skb->data); > eth_copy_and_sum(skb, sk_buff[0]->data, pkt_size, 0); > *sk_buff = skb; > rtl8169_mark_to_asic(desc, rx_buf_sz); This patch caused a drop in throughput from 178 Mbits/sec to 135 Mbits/sec on an Intel XScale IXP465. It seems like there is some confusion about what the align parameter here means. It was originally an offset from an aligned address so that the IP header aligned, and this patch changes it to the alignment of the ethernet header. But align is still set to NET_IP_ALIGN for some chips. - 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.20-git8 fails compile -- net/built-in.o __ipv6_addr_type
Patched, compiles. -- Pete Clements Quoting YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= > > Ah, this is because of new ipv6 support in sunrpc code. > Enable it if it is statically compiled. > > Alternatively, we could > - export __ipv6_addr_type in new net/ipv6/addrconf_core.c > or > - introduce tiny inline for chcking if the address is link-local. > > Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> > > diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c > index 63ae947..27dcb31 100644 > --- a/net/sunrpc/svcsock.c > +++ b/net/sunrpc/svcsock.c > @@ -107,12 +107,12 @@ static inline void svc_reclassify_socket > sock_lock_init_class_and_name(sk, "slock-AF_INET-NFSD", > &svc_slock_key[0], "sk_lock-AF_INET-NFSD", &svc_key[0]); > break; > - > +#ifdef CONFIG_IPV6 > case AF_INET6: > sock_lock_init_class_and_name(sk, "slock-AF_INET6-NFSD", > &svc_slock_key[1], "sk_lock-AF_INET6-NFSD", &svc_key[1]); > break; > - > +#endif > default: > BUG(); > } > @@ -131,7 +131,7 @@ static char *__svc_print_addr(struct soc > NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), > htons(((struct sockaddr_in *) addr)->sin_port)); > break; > -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) > +#if defined(CONFIG_IPV6) > case AF_INET6: > snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", > NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), > @@ -449,7 +449,7 @@ svc_wake_up(struct svc_serv *serv) > > union svc_pktinfo_u { > struct in_pktinfo pkti; > -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) > +#if defined(CONFIG_IPV6) > struct in6_pktinfo pkti6; > #endif > }; > @@ -467,7 +467,7 @@ static void svc_set_cmsg_data(struct svc > cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); > } > break; > -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) > +#if defined(CONFIG_IPV6) > case AF_INET6: { > struct in6_pktinfo *pki = CMSG_DATA(cmh); > > @@ -737,7 +737,7 @@ static void svc_udp_get_sender_address(s > rqstp->rq_daddr.addr.s_addr = skb->nh.iph->daddr; > } > break; > -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) > +#if defined(CONFIG_IPV6) > case AF_INET6: { > /* this is derived from net/ipv6/udp.c:udpv6_recvmesg */ > struct sockaddr_in6 *sin6 = svc_addr_in6(rqstp); > @@ -977,7 +977,7 @@ static inline int svc_port_is_privileged > case AF_INET: > return ntohs(((struct sockaddr_in *)sin)->sin_port) > < PROT_SOCK; > -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) > +#if defined(CONFIG_IPV6) > case AF_INET6: > return ntohs(((struct sockaddr_in6 *)sin)->sin6_port) > < PROT_SOCK; > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c > index 49cabff..877b52b 100644 > --- a/net/sunrpc/xprtsock.c > +++ b/net/sunrpc/xprtsock.c > @@ -1187,11 +1187,12 @@ static inline void xs_reclassify_socket( > &xs_slock_key[0], "sk_lock-AF_INET-NFS", &xs_key[0]); > break; > > +#ifdef CONFIG_IPV6 > case AF_INET6: > sock_lock_init_class_and_name(sk, "slock-AF_INET6-NFS", > &xs_slock_key[1], "sk_lock-AF_INET6-NFS", &xs_key[1]); > break; > - > +#endif > default: > BUG(); > } > > > -- > YOSHIFUJI Hideaki @ USAGI Project <[EMAIL PROTECTED]> > GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA > - 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.20-git8 fails compile -- net/built-in.o __ipv6_addr_type
In article <[EMAIL PROTECTED]> (at Mon, 12 Feb 2007 21:35:59 -0500 (EST)), Pete Clements <[EMAIL PROTECTED]> says: > Quoting YOSHIFUJIHideaki/=?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= > > In article <[EMAIL PROTECTED]> (at Mon, 12 Feb 2007 18:12:16 -0800), > Andrew Morton <[EMAIL PROTECTED]> says: > > > > > > On Mon, 12 Feb 2007 20:10:13 -0500 (EST) Pete Clements <[EMAIL > PROTECTED]> wrote: > > > > 2.6.20-git8 fails compile: > > > > > > > > CHK include/linux/compile.h > > > > UPD include/linux/compile.h > > > > CC init/version.o > > > > LD init/built-in.o > > > > LD .tmp_vmlinux1 > > > > net/built-in.o: In function `svc_udp_recvfrom': > > > > svcsock.c:(.text+0x61be4): undefined reference to `__ipv6_addr_type' > > > > make: *** [.tmp_vmlinux1] Error 1 > > > > > > > > > > Please send the .config. > > > > and, the gcc version... > > > > --yoshfuji > > - > > git 7 compiled just fine. Ah, this is because of new ipv6 support in sunrpc code. Enable it if it is statically compiled. Alternatively, we could - export __ipv6_addr_type in new net/ipv6/addrconf_core.c or - introduce tiny inline for chcking if the address is link-local. Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 63ae947..27dcb31 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -107,12 +107,12 @@ static inline void svc_reclassify_socket sock_lock_init_class_and_name(sk, "slock-AF_INET-NFSD", &svc_slock_key[0], "sk_lock-AF_INET-NFSD", &svc_key[0]); break; - +#ifdef CONFIG_IPV6 case AF_INET6: sock_lock_init_class_and_name(sk, "slock-AF_INET6-NFSD", &svc_slock_key[1], "sk_lock-AF_INET6-NFSD", &svc_key[1]); break; - +#endif default: BUG(); } @@ -131,7 +131,7 @@ static char *__svc_print_addr(struct soc NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), htons(((struct sockaddr_in *) addr)->sin_port)); break; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +#if defined(CONFIG_IPV6) case AF_INET6: snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), @@ -449,7 +449,7 @@ svc_wake_up(struct svc_serv *serv) union svc_pktinfo_u { struct in_pktinfo pkti; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +#if defined(CONFIG_IPV6) struct in6_pktinfo pkti6; #endif }; @@ -467,7 +467,7 @@ static void svc_set_cmsg_data(struct svc cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); } break; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +#if defined(CONFIG_IPV6) case AF_INET6: { struct in6_pktinfo *pki = CMSG_DATA(cmh); @@ -737,7 +737,7 @@ static void svc_udp_get_sender_address(s rqstp->rq_daddr.addr.s_addr = skb->nh.iph->daddr; } break; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +#if defined(CONFIG_IPV6) case AF_INET6: { /* this is derived from net/ipv6/udp.c:udpv6_recvmesg */ struct sockaddr_in6 *sin6 = svc_addr_in6(rqstp); @@ -977,7 +977,7 @@ static inline int svc_port_is_privileged case AF_INET: return ntohs(((struct sockaddr_in *)sin)->sin_port) < PROT_SOCK; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +#if defined(CONFIG_IPV6) case AF_INET6: return ntohs(((struct sockaddr_in6 *)sin)->sin6_port) < PROT_SOCK; diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 49cabff..877b52b 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1187,11 +1187,12 @@ static inline void xs_reclassify_socket( &xs_slock_key[0], "sk_lock-AF_INET-NFS", &xs_key[0]); break; +#ifdef CONFIG_IPV6 case AF_INET6: sock_lock_init_class_and_name(sk, "slock-AF_INET6-NFS", &xs_slock_key[1], "sk_lock-AF_INET6-NFS", &xs_key[1]); break; - +#endif default: BUG(); } -- YOSHIFUJI Hideaki @ USAGI Project <[EMAIL PROTECTED]> GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA - 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.20-git8 fails compile -- net/built-in.o __ipv6_addr_type
On Monday February 12, [EMAIL PROTECTED] wrote: > Quoting YOSHIFUJIHideaki/=?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= > > In article <[EMAIL PROTECTED]> (at Mon, 12 Feb 2007 18:12:16 -0800), > Andrew Morton <[EMAIL PROTECTED]> says: > > > > > > On Mon, 12 Feb 2007 20:10:13 -0500 (EST) Pete Clements <[EMAIL > PROTECTED]> wrote: > > > > 2.6.20-git8 fails compile: > > > > > > > > CHK include/linux/compile.h > > > > UPD include/linux/compile.h > > > > CC init/version.o > > > > LD init/built-in.o > > > > LD .tmp_vmlinux1 > > > > net/built-in.o: In function `svc_udp_recvfrom': > > > > svcsock.c:(.text+0x61be4): undefined reference to `__ipv6_addr_type' > > > > make: *** [.tmp_vmlinux1] Error 1 > > > > Hmmm. > CONFIG_IPV6=m combined with > CONFIG_SUNRPC=y is a combination that isn't going to work at the moment Options? - Move __ipv6_addr_type to lib/ ?? Might not work for modules. - Disallow that combination in the .config. .. a bit harsh. - Only include IPv6 support in SUNRPC is a module or IPV6 is built-in A bit of a kludge.. Chuck? Any ideas? NeilBrown - 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.20-git8 fails compile -- net/built-in.o __ipv6_addr_type
Quoting YOSHIFUJIHideaki/=?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= > In article <[EMAIL PROTECTED]> (at Mon, 12 Feb 2007 18:12:16 -0800), Andrew Morton <[EMAIL PROTECTED]> says: > > > > On Mon, 12 Feb 2007 20:10:13 -0500 (EST) Pete Clements <[EMAIL PROTECTED]> wrote: > > > 2.6.20-git8 fails compile: > > > > > > CHK include/linux/compile.h > > > UPD include/linux/compile.h > > > CC init/version.o > > > LD init/built-in.o > > > LD .tmp_vmlinux1 > > > net/built-in.o: In function `svc_udp_recvfrom': > > > svcsock.c:(.text+0x61be4): undefined reference to `__ipv6_addr_type' > > > make: *** [.tmp_vmlinux1] Error 1 > > > > > > > Please send the .config. > > and, the gcc version... > > --yoshfuji > - git 7 compiled just fine. gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) Config: CONFIG_X86_32=y CONFIG_GENERIC_TIME=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_X86=y CONFIG_MMU=y CONFIG_ZONE_DMA=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DMI=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_EXPERIMENTAL=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_SYSCTL=y CONFIG_UID16=y CONFIG_SYSCTL_SYSCALL=y CONFIG_KALLSYMS=y CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y CONFIG_SLAB=y CONFIG_VM_EVENT_COUNTERS=y CONFIG_RT_MUTEXES=y CONFIG_BASE_SMALL=0 CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y CONFIG_BLOCK=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y CONFIG_DEFAULT_AS=y CONFIG_DEFAULT_IOSCHED="anticipatory" CONFIG_SMP=y CONFIG_X86_PC=y CONFIG_MPENTIUMIII=y CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=5 CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_CMPXCHG64=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_TSC=y CONFIG_NR_CPUS=2 CONFIG_PREEMPT_NONE=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_VM86=y CONFIG_HIGHMEM4G=y CONFIG_PAGE_OFFSET=0xC000 CONFIG_HIGHMEM=y CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_POPULATES_NODE_MAP=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y CONFIG_SPARSEMEM_STATIC=y CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_ZONE_DMA_FLAG=1 CONFIG_MTRR=y CONFIG_IRQBALANCE=y CONFIG_HZ_1000=y CONFIG_HZ=1000 CONFIG_PHYSICAL_START=0x10 CONFIG_PHYSICAL_ALIGN=0x10 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_PM=y CONFIG_PCI=y CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_ISA_DMA_API=y CONFIG_ISA=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y CONFIG_NET=y CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y CONFIG_INET=y CONFIG_IP_FIB_HASH=y CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y CONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" CONFIG_IPV6=m CONFIG_NETFILTER=y CONFIG_NF_CONNTRACK_ENABLED=m CONFIG_NF_CONNTRACK_SUPPORT=y CONFIG_NF_CONNTRACK=m CONFIG_NF_CT_ACCT=y CONFIG_NF_CONNTRACK_MARK=y CONFIG_NF_CONNTRACK_EVENTS=y CONFIG_NF_CT_PROTO_GRE=m CONFIG_NF_CT_PROTO_SCTP=m CONFIG_NF_CONNTRACK_AMANDA=m CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_H323=m CONFIG_NF_CONNTRACK_IRC=m CONFIG_NF_CONNTRACK_NETBIOS_NS=m CONFIG_NF_CONNTRACK_PPTP=m CONFIG_NF_CONNTRACK_SANE=m CONFIG_NF_CONNTRACK_SIP=m CONFIG_NF_CONNTRACK_TFTP=m CONFIG_NETFILTER_XTABLES=m CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m CONFIG_NETFILTER_XT_TARGET_CONNMARK=m CONFIG_NETFILTER_XT_TARGET_DSCP=m CONFIG_NETFILTER_XT_TARGET_MARK=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m CONFIG_NETFILTER_XT_TARGET_NFLOG=m CONFIG_NETFILTER_XT_TARGET_NOTRACK=m CONFIG_NETFILTER_XT_TARGET_TCPMSS=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m CONFIG_NETFILTER_XT_MATCH_DCCP=m CONFIG_NETFILTER_XT_MATCH_DSCP=m CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HELPER=m CONFIG_NETFILTER_XT_MATCH_LENGTH=m CONFIG_NETFILTER_XT_MATCH_LIMIT=m CONFIG_NETFILTER_XT_MATCH_MAC=m CONFIG_NETFILTER_XT_MATCH_MARK=m CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m CONFIG_NETFILTER_XT_MATCH_QUOTA=m CONFIG_NETFILTER_XT_MATCH_REALM=m CONFIG_NETFILTER_XT_MATCH_SCTP=m CONFIG_NETFILTER_XT_MATCH_STATE=m CONFIG_NETFILTER_XT_MATCH_STATISTIC=m CONFIG_NETFILTER_XT_MATCH_STRING=m CONFIG_NETFILTER_XT_MATCH_TCPMSS=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m CONFIG_NF_CONNTRACK_IPV4=m CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MAT
Re: 2.6.20-git8 fails compile -- net/built-in.o __ipv6_addr_type
In article <[EMAIL PROTECTED]> (at Mon, 12 Feb 2007 18:12:16 -0800), Andrew Morton <[EMAIL PROTECTED]> says: > > On Mon, 12 Feb 2007 20:10:13 -0500 (EST) Pete Clements <[EMAIL PROTECTED]> > > wrote: > > 2.6.20-git8 fails compile: > > > > CHK include/linux/compile.h > > UPD include/linux/compile.h > > CC init/version.o > > LD init/built-in.o > > LD .tmp_vmlinux1 > > net/built-in.o: In function `svc_udp_recvfrom': > > svcsock.c:(.text+0x61be4): undefined reference to `__ipv6_addr_type' > > make: *** [.tmp_vmlinux1] Error 1 > > > > Please send the .config. and, the gcc version... --yoshfuji - 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.20-git8 fails compile -- net/built-in.o __ipv6_addr_type
> On Mon, 12 Feb 2007 20:10:13 -0500 (EST) Pete Clements <[EMAIL PROTECTED]> > wrote: > 2.6.20-git8 fails compile: > > CHK include/linux/compile.h > UPD include/linux/compile.h > CC init/version.o > LD init/built-in.o > LD .tmp_vmlinux1 > net/built-in.o: In function `svc_udp_recvfrom': > svcsock.c:(.text+0x61be4): undefined reference to `__ipv6_addr_type' > make: *** [.tmp_vmlinux1] Error 1 > Please send the .config. - 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] RFC: Broadcom PHY forcing fix
On Jan 26, 2007, at 08:36, Maciej W. Rozycki wrote: Kumar, I've got a BCM5461 that requires this fix to be able to force the speeds on the PHY. Not sure if its needed on the other variants or not. The problem is the genphy_config_aneg resets the PHY when forcing the speed and once we reset the BCM5461 it doesn't remember any of its settings. I recall seeing a similar problem before and having checked with the IEEE spec I believe it's the generic code that is incorrect. Following is my fix to address this problem. Please try and see if it works for you. I am waiting for 2.6.20 to happen before I recheck my list of patches related to the BCM1250 MAC and the PHY library and (re)submit whatever is still relevant. This patch is one of candidates. I'm sifting through patches, and rediscovered this one waiting around. I'm mostly happy with it, but I have a few questions... Maciej patch-mips-2.6.18-20060920-phy-forcing-1 diff -up --recursive --new-file linux-mips-2.6.18-20060920.macro/ drivers/net/phy/phy.c linux-mips-2.6.18-20060920/drivers/net/phy/phy.c --- linux-mips-2.6.18-20060920.macro/drivers/net/phy/phy.c 2006-08-05 04:58:46.0 + +++ linux-mips-2.6.18-20060920/drivers/net/phy/phy.c 2006-09-25 03:03:45.0 + @@ -713,6 +713,8 @@ static void phy_timer(unsigned long data } else { phydev->state = PHY_NOLINK; netif_carrier_off(phydev->attached_dev); + phydev->link_timeout = + PHY_NOLINK_TIMEOUT; What's the purpose of a NOLINK timeout? What problem is this solving? I'd prefer not to constantly restart AN every 3 seconds when the link is actually down. Do we need the autoneg code to wait a few seconds before it considers a link state of 0 valid? diff -up --recursive --new-file linux-mips-2.6.18-20060920.macro/ drivers/net/phy/phy_device.c linux-mips-2.6.18-20060920/drivers/net/ phy/phy_device.c --- linux-mips-2.6.18-20060920.macro/drivers/net/phy/phy_device.c 2006-09-20 20:50:26.0 + +++ linux-mips-2.6.18-20060920/drivers/net/phy/phy_device.c 2006-09-25 01:51:34.0 + @@ -325,10 +325,18 @@ EXPORT_SYMBOL(genphy_config_advert); * Please see phy_sanitize_settings() */ int genphy_setup_forced(struct phy_device *phydev) { - int ctl = BMCR_RESET; + int ctl; phydev->pause = phydev->asym_pause = 0; + ctl = phy_read(phydev, MII_BMCR); + + ctl &= ~(BMCR_ANENABLE | BMCR_ANRESTART); + + ctl &= ~(BMCR_ISOLATE); + + ctl &= ~(BMCR_SPEED1000 | BMCR_SPEED100 | BMCR_FULLDPLX); + This is fine, but I'm wondering if it's really necessary to go through all this effort just to preserve the values of RESET, LOOPBACK, POWER, and collision test. I agree, in principle, it's probably more robust, though. But can we perhaps make a constant like: #define BMCR_FORCE_MASK (all the bits we want to keep) And then use that? Or do it all in one line? It just feels a little clunky to me this way (Just my own sense of code aesthetics). Andy - 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 2.6.16.y] [IPV6] HASHTABLES: Use appropriate seed for caluculating ehash index.
Tetsuo Handa <[EMAIL PROTECTED]> told me that connect(2) with TCPv6 socket almost always took a few minutes to return when we did not have any ports available in the range of net.ipv4.ip_local_port_range. The reason was that we used incorrect seed for calculating index of hash when we check established sockets in __inet6_check_established(). Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> --- net/ipv6/inet6_hashtables.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c index bb8ffb8..47e7951 100644 --- a/net/ipv6/inet6_hashtables.c +++ b/net/ipv6/inet6_hashtables.c @@ -93,7 +93,7 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row, const struct in6_addr *saddr = &np->daddr; const int dif = sk->sk_bound_dev_if; const u32 ports = INET_COMBINED_PORTS(inet->dport, lport); - const unsigned int hash = inet6_ehashfn(daddr, inet->num, saddr, + const unsigned int hash = inet6_ehashfn(daddr, lport, saddr, inet->dport); struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); struct sock *sk2; -- 1.4.4.1.g562ce -- YOSHIFUJI Hideaki @ USAGI Project <[EMAIL PROTECTED]> GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA - 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 2.6.20.y & net-2.6] [IPV6] HASHTABLES: Use appropriate seed for caluculating ehash index.
Tetsuo Handa <[EMAIL PROTECTED]> told me that connect(2) with TCPv6 socket almost always took a few minutes to return when we did not have any ports available in the range of net.ipv4.ip_local_port_range. The reason was that we used incorrect seed for calculating index of hash when we check established sockets in __inet6_check_established(). Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> --- net/ipv6/inet6_hashtables.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c index 30b16da..ae6b0e7 100644 --- a/net/ipv6/inet6_hashtables.c +++ b/net/ipv6/inet6_hashtables.c @@ -172,7 +172,7 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row, const struct in6_addr *saddr = &np->daddr; const int dif = sk->sk_bound_dev_if; const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport); - const unsigned int hash = inet6_ehashfn(daddr, inet->num, saddr, + const unsigned int hash = inet6_ehashfn(daddr, lport, saddr, inet->dport); struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); struct sock *sk2; -- 1.4.4.1.g562ce -- YOSHIFUJI Hideaki @ USAGI Project <[EMAIL PROTECTED]> GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA - 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/4] spidernet: support for Celleb
On Mon, 2007-02-12 at 17:49 -0600, Linas Vepstas wrote: > On Wed, Feb 07, 2007 at 05:49:50PM +0900, Ishizaki Kou wrote: > > This is a revised spidernet patch set based on > > netdev-2.6.git#upstream. > > Tested this series of patches together with Jen's "version 3" patch, > it worked for me. Code looks reasonable. Thus > > Acked-by: Linas Vepstas <[EMAIL PROTECTED]> > > I'm somewhat unclear as to whethr I should be doing > > Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> If the patch wasn't actually handled and passed-on by you or modified by you, then no. Acked-by is the way to go. Acked-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> too while at it. 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
[XFRM]: Fix IPv4 tunnel mode decapsulation with IPV6=n
[XFRM]: Fix IPv4 tunnel mode decapsulation with IPV6=n Add missing break when CONFIG_IPV6=n. Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]> --- commit 651521586d5f08c5d6d7198ceef1555b93135b6a tree 5ee1183f4bc1f49f467b5bdcfebf1c5181bffcd7 parent 6ec183b20c4a1c0eafd541444ae11f8e5779d153 author Patrick McHardy <[EMAIL PROTECTED]> Tue, 13 Feb 2007 01:14:35 +0100 committer Patrick McHardy <[EMAIL PROTECTED]> Tue, 13 Feb 2007 01:14:35 +0100 net/ipv4/xfrm4_mode_tunnel.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c index e54c549..e1cab33 100644 --- a/net/ipv4/xfrm4_mode_tunnel.c +++ b/net/ipv4/xfrm4_mode_tunnel.c @@ -95,6 +95,7 @@ static int xfrm4_tunnel_input(struct xfr switch(iph->protocol){ case IPPROTO_IPIP: + break; #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) case IPPROTO_IPV6: break;
Re: [PATCH 0/4] spidernet: support for Celleb
On Wed, Feb 07, 2007 at 05:49:50PM +0900, Ishizaki Kou wrote: > This is a revised spidernet patch set based on > netdev-2.6.git#upstream. Tested this series of patches together with Jen's "version 3" patch, it worked for me. Code looks reasonable. Thus Acked-by: Linas Vepstas <[EMAIL PROTECTED]> I'm somewhat unclear as to whethr I should be doing Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> instead. --linas - 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] [XFRM] AUDIT: Fix audit buffer leakage in error path.
In article <[EMAIL PROTECTED]> (at Mon, 12 Feb 2007 15:23:17 -0800 (PST)), David Miller <[EMAIL PROTECTED]> says: > From: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> > Date: Tue, 13 Feb 2007 00:34:29 +0900 (JST) > > > Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> > > Oh yes. I noticed this too while working with Joy Latten's OOPS fix > for this function. > > Event types other than those 4 mentioned in the switch() statement are > illegal and should never be passed in. It is probably better to BUG() > on this situation rather than try to handle the log buffer leakage. Okay, I agree and I withdraw my patch. --yoshfuji - 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] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection
In article <[EMAIL PROTECTED]> (at Thu, 8 Feb 2007 08:07:15 -0500), Neil Horman <[EMAIL PROTECTED]> says: > > I still have a question. Now, who will install the kernel route for > > the incoming packet? Can we get packet for our unicast address during > > optimistic DAD period? > > > Not sure what you're getting at here. RFC 4429 makes no distinction between > optimistic and non-optimistic packets for recevied frames, so routes for > received packets will be added by the same code that does it currently (which > I > admittedly haven't looked into to closely). Packets received for our unicast > address (even if it is optimistic) are handled just as any other packet is > (same > as it is for TENTATIVE addresses, as I understand it). I think it is clear. In tentative state, we do not receive any packet. After finishind DAD process, we install kernel route for that address in net/ipv6/addrconf.c:__ipv6_ifa_notify(), and we start receiving packet for that address. On the other hand, optimistic addresses are like in deprecated state. So, we should be able to receive frames for those addresses. --yoshfuji - 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] spidernet: move medium variable into card struct
On Mon, Feb 12, 2007 at 09:37:15PM +0100, Jens Osterkamp wrote: > This moves the medium variable into the spidernet card structure. > It renames the GMII_ variables to BCM54XX specific ones. > > Signed-off-by: Jens Osterkamp <[EMAIL PROTECTED]> Boot-tested the patch, it works for me Acked-by: Linas Vepstas <[EMAIL PROTECTED]> - 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] [v3] spidernet : add improved phy support
Tested the patch, it works for me. Thus I'll attach a pre-emptive Acked-by: Linas Vepstas <[EMAIL PROTECTED]> However, some quibbbles, which I think would be nice to see fixed: On Mon, Feb 12, 2007 at 09:35:34PM +0100, Jens Osterkamp wrote: > > Index: linux-2.6.20/drivers/net/sungem_phy.c > === > --- linux-2.6.20.orig/drivers/net/sungem_phy.c > +++ linux-2.6.20/drivers/net/sungem_phy.c > > +#define BCM5421_MODE_MASK(1 << 5) Customary practice is to have these in the heder file ... > + mode = (phy_reg & BCM5421_MODE_MASK) >> 5; > + > + if ( mode == BCM54XX_COPPER) All this shifting makes the code hard to read and hard to verify for correctness. Part of the problem seems to be that you are trying to re-cycle the BCM5421_COPPER and BCM5461_COPPER which are in different locations. It would have been clearer to simply have #define BCM5421_MODE_MASK (1 << 5) #define BCM5421_COPPER 0 if (phy_reg & BCM5421_MODE_MASK == BCM5421_COPPER) > + if ( (phy_reg & 0x0080) >> 7) There is no need for the shift. The if statement is just as true (or false) with or without the shift. > +#define BCM5461_FIBER_LINK (1 << 2) > +#define BCM5461_MODE_MASK(3 << 1) > + > + mode = (phy_reg & BCM5461_MODE_MASK ) >> 1; More confusing shifting > +enum { > + BCM54XX_COPPER, > + BCM54XX_FIBER, > + BCM54XX_GBIC, > + BCM54XX_SGMII, Things that are being used for bitmak tests should probably not be declared in an enum. For me, at least, there's a cognitive dissonance in doing things this way. -- linas - 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] [XFRM] AUDIT: Fix audit buffer leakage in error path.
From: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> Date: Tue, 13 Feb 2007 00:34:29 +0900 (JST) > Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> Oh yes. I noticed this too while working with Joy Latten's OOPS fix for this function. Event types other than those 4 mentioned in the switch() statement are illegal and should never be passed in. It is probably better to BUG() on this situation rather than try to handle the log buffer leakage. - 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
[ANNOUNCE] sk-drivers mailing list
I have created a list for discussing issues and announcing test versions of the skge and sky2 drivers. There are many people with problems and several vendors are using the hardware as well, therefore I want to be able to make sure everyone can see the information without having to be distracted by lkml or netdev mail. http://lists.osdl.org/mailman/listinfo/sk-drivers Mailing address is [EMAIL PROTECTED] (the list host server hasn't moved to linux-foundation.org yet). Don't worry, the changes will still show up one netdev. -- Stephen Hemminger <[EMAIL PROTECTED]> - 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] 2.6.20 Oopses in xfrm_audit_log
> On Mon, 12 Feb 2007 14:49:38 -0800 (PST) David Miller <[EMAIL PROTECTED]> > wrote: > Andrew, we're already discussing a fix for this in another > thread today: Yeah, I noticed. Vitimised again by those darn MUA vendors and/or users who bust their In-Reply-To/References headers :( - 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/3] tcp: remove experimental variants from default list
From: Baruch Even <[EMAIL PROTECTED]> Date: Tue, 13 Feb 2007 00:12:41 +0200 > The problem is that you actually put a mostly untested algorithm as the > default for everyone to use. The BIC example is important, it was the > default algorithm for a long while and had implementation bugs that no > one cared for. And if our TCP Reno implementation had some bugs, what should we change the default to? This is just idiotic logic. These kinds of comments are just wanking, and lead to nowhere, so please kill the noise. If we have bugs in a particular algorithm, we should just fix them. > As to the reasoning that the new algorithms are supposed to act like > Reno, that needs to be verified as well, it's not evident from the > code itself. If you're not convinced and are intrested enough, then you should go verify whether it is in fact true. This is how things work. If you find that it isn't true, great then we'll know about it and have an opportunity to fix the bug. - 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] 2.6.20 Oopses in xfrm_audit_log
Andrew, we're already discussing a fix for this in another thread today: commit 13fcfbb0675bf87da694f55dec11cada489a205c Author: David S. Miller <[EMAIL PROTECTED]> Date: Mon Feb 12 13:53:54 2007 -0800 [XFRM]: Fix OOPSes in xfrm_audit_log(). Make sure that this function is called correctly, and add BUG() checking to ensure the arguments are sane. Based upon a patch by Joy Latten. Signed-off-by: David S. Miller <[EMAIL PROTECTED]> diff --git a/net/key/af_key.c b/net/key/af_key.c index f3a026f..1c58204 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -2297,16 +2297,17 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg &sel, tmp.security, 1); security_xfrm_policy_free(&tmp); - xfrm_audit_log(audit_get_loginuid(current->audit_context), 0, - AUDIT_MAC_IPSEC_DELSPD, (xp) ? 1 : 0, xp, NULL); - if (xp == NULL) return -ENOENT; - err = 0; + err = security_xfrm_policy_delete(xp); - if ((err = security_xfrm_policy_delete(xp))) + xfrm_audit_log(audit_get_loginuid(current->audit_context), 0, + AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); + + if (err) goto out; + c.seq = hdr->sadb_msg_seq; c.pid = hdr->sadb_msg_pid; c.event = XFRM_MSG_DELPOLICY; diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index a24f385..c394b41 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1997,9 +1997,14 @@ void xfrm_audit_log(uid_t auid, u32 sid, int type, int result, if (audit_enabled == 0) return; + BUG_ON((type == AUDIT_MAC_IPSEC_ADDSA || + type == AUDIT_MAC_IPSEC_DELSA) && !x); + BUG_ON((type == AUDIT_MAC_IPSEC_ADDSPD || + type == AUDIT_MAC_IPSEC_DELSPD) && !xp); + audit_buf = audit_log_start(current->audit_context, GFP_ATOMIC, type); if (audit_buf == NULL) - return; + return; switch(type) { case AUDIT_MAC_IPSEC_ADDSA: diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index d55436d..2567453 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1273,10 +1273,6 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security, delete); security_xfrm_policy_free(&tmp); } - if (delete) - xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, - AUDIT_MAC_IPSEC_DELSPD, (xp) ? 1 : 0, xp, NULL); - if (xp == NULL) return -ENOENT; @@ -1292,8 +1288,14 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, MSG_DONTWAIT); } } else { - if ((err = security_xfrm_policy_delete(xp)) != 0) + err = security_xfrm_policy_delete(xp); + + xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, + AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); + + if (err != 0) goto out; + c.data.byid = p->index; c.event = nlh->nlmsg_type; c.seq = nlh->nlmsg_seq; - 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/1] NetXen: Fix to get the driver working after sparse changes
On Mon, Feb 12, 2007 at 04:33:38AM -0800, Amit S. Kale wrote: > Signed-off-by: Amit S. Kale <[EMAIL PROTECTED]> ACK. My apologies - that pile of brainos had been introduced when I'd been fixing the set_bit() abuses in there (a bunch of places had been casting address of u32 to unsigned long * and then using set_bit() to modify it). FWIW, it had nothing to do with sparse - just enough RTFS to spot the original bug and not enough of RTFPatch to spot the introduced breakage. Sorry. - 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: [BUG] 2.6.20 Oopses in xfrm_audit_log
Begin forwarded message: Date: Mon, 12 Feb 2007 15:16:04 +0100 From: Charles-Edouard Ruault <[EMAIL PROTECTED]> To: linux-kernel@vger.kernel.org, linux-net@vger.kernel.org Subject: [BUG] 2.6.20 Oopses in xfrm_audit_log Hi All, i upgraded to vanilla kernel 2.6.20 and while i was using strongswan 2.8.2 to setup an IPSEC VPN i got the following kernel Ooops. I had successfully established the same tunnel a few times, but key renegotiation caused a problem ( both ends did not renegotiate at the same time so the tunnel was frozen ), i decided to kill the tunnel and start a new one ( using ipsec auto --down tunnel & ipsec auto --up tunnel ), while i was doing so, i got the oops. BUG: unable to handle kernel NULL pointer dereference at virtual address 0188 printing eip: c02fb85c *pde = Oops: [#1] PREEMPT Modules linked in: xfrm4_mode_tunnel usblp deflate zlib_deflate twofish twofish_common serpent blowfish des cbc ecb blkcipher xcbc sha256 sha1 crypto_null xfrm4_tunnel tunnel4 ipcomp esp4 ah4 af_key autofs4 asb100 hwmon_vid hidp rfcomm l2cap bluetooth sunrpc nf_conntrack_netbios_ns ipt_LOG xt_limit xt_mark xt_state xt_tcpudp iptable_filter ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 xt_MARK iptable_mangle ip_tables x_tables binfmt_misc sd_mod ipv6 sg hfsplus video button ac lp parport_pc parport floppy nvram usb_storage scsi_mod libusual usbhid hid ehci_hcd snd_via82xx snd_ac97_codec ac97_bus ohci1394 snd_seq_dummy uhci_hcd ieee1394 snd_seq_oss snd_seq_midi_event snd_seq snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc snd_mpu401_uart snd_rawmidi snd_seq_device snd via_agp agpgart i2c_viapro soundcore eepro100 i2c_core b44 pcspkr mii shpchp usbcore dm_mod CPU:0 EIP:0060:[]Not tainted VLI EFLAGS: 00010246 (2.6.20 #1) EIP is at xfrm_audit_log+0x4cc/0x580 eax: ecb71061 ebx: c039d160 ecx: edx: 0021 esi: 01f4 edi: 0255 ebp: esp: e8cd5a18 ds: 007b es: 007b ss: 0068 Process pluto (pid: 27486, ti=e8cd4000 task=d3557070 task.ti=e8cd4000) Stack: c17d2ea0 c0354bf1 e183f9c0 0003 c03ac59c e1399800 0001 0003 f8d0a450 0001 0286 e8cd5a6c c011506b 0286 f73cb8c0 0246 c17d2ea0 f73cb8c0 f8d03c67 Call Trace: [] __wake_up+0x4b/0x80 [] pfkey_broadcast+0x137/0x1b0 [af_key] [] pfkey_send_policy_notify+0xef/0x1a0 [af_key] [] local_bh_enable+0x2e/0xa0 [] xfrm_get_policy+0x2b7/0x2f0 [] xfrm_get_policy+0x0/0x2f0 [] xfrm_user_rcv_msg+0x102/0x1b0 [] xfrm_user_rcv_msg+0x0/0x1b0 [] netlink_run_queue+0x82/0x120 [] xfrm_netlink_rcv+0x28/0x40 [] netlink_data_ready+0x12/0x50 [] netlink_sendskb+0x21/0x40 [] netlink_sendmsg+0x230/0x310 [] sock_aio_write+0x11d/0x130 [] avc_has_perm+0x5a/0x70 [] do_sync_write+0xd5/0x120 [] autoremove_wake_function+0x0/0x50 [] vfs_write+0x177/0x180 [] sys_write+0x41/0x70 [] syscall_call+0x7/0xb === Code: 8b 44 24 70 c1 e2 08 c1 e8 08 09 c2 0f b7 c2 89 44 24 08 8b 44 24 48 89 04 24 e8 10 eb e3 ff e9 bc fc ff ff 8b 8c 24 c0 00 00 00 <8b> 91 88 01 00 00 0f b7 99 82 00 00 00 85 d2 0f 85 64 fc ff ff EIP: [] xfrm_audit_log+0x4cc/0x580 SS:ESP 0068:e8cd5a18 I'm running a vanilla 2.6.20 kernel on a Fedora Core 5 box on an athlon processor: cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 8 model name : AMD Athlon(TM) XP 2400+ stepping: 1 cpu MHz : 2000.256 cache size : 256 KB fdiv_bug: no hlt_bug : no f00f_bug: no coma_bug: no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow ts bogomips: 4003.78 clflush size: 32 uname -a Linux machine 2.6.20 #1 PREEMPT Sat Feb 10 13:48:56 CET 2007 i686 athlon i386 GNU/Linux Please CC me in follow ups since i do not subscribe to the list. Thanks -- Charles-Edouard Ruault GPG key Id E4D2B80C - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ - 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/3] tcp: remove experimental variants from default list
* David Miller <[EMAIL PROTECTED]> [070212 22:21]: > From: Baruch Even <[EMAIL PROTECTED]> > Date: Mon, 12 Feb 2007 21:11:01 +0200 > > > Since no one really agrees on the relative merits and problems of the > > different algorithms and since the users themselves dont know, dont care > > and have no clue on what should be the correct behaviour to report bugs > > (see the old bic bugs, the htcp bugs, the recent sack bugs) I would > > suggest to avoid making the whole internet a guinea pig and get back to > > reno. If someone really needs to push high BDP flows he should test it > > himself and choose what works for his kernel at the time. > > > > For myself and anyone who asks me I recommend to set the default to > > reno. For the few who really need high speed flows, they should test > > kernel and protocol combination. > > We have "high BDP flows" even going from between the east and the west > coast of the United States. > > This doesn't even begin to touch upon extremely well connected > coutries like South Korea and what happens when people there try to > access sites in Europe or the US. > > Good high BDP flow handling is necessary now and for everyday usage of > the internet, it's not some obscure thing only researchers in fancy > labs need. > > This also isn't the internet of 15 years ago where IETF members can > spend 4 or 5 years masterbating over new ideas before deploying them. > I know that's what conservative folks want, but it isn't going to > happen. The problem is that you actually put a mostly untested algorithm as the default for everyone to use. The BIC example is important, it was the default algorithm for a long while and had implementation bugs that no one cared for. The behaviour of cubic wasn't properly verified as the algorithm in the linux kernel is not the one that was actually proposed and you intend to make it the default without sufficient testing, that seems to me to be quite unreasonable. As to the reasoning that the new algorithms are supposed to act like Reno, that needs to be verified as well, it's not evident from the code itself. Baruch - 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][RESPIN] gianfar: Convert network devices to use struct device instead of class_device
On Feb 9, 2007, at 15:33, Kumar Gala wrote: Convert network devices to use struct device instead of class_device. Greg missed this one in his cleanup path. Signed-off-by: Kumar Gala <[EMAIL PROTECTED]> Acked-by: Andy Fleming <[EMAIL PROTECTED]> Jeff, please get this into 2.6.21. The current tree doesn't build without it! Andy - 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] gianfar: don't duplicate gfar_error()
It was hardly necessary to repeat most of the code from gfar_error() in gfar_interrupt(), especially having some inconsistencies between the two. So, make the gfar_interrupt() just call gfar_error(), and not acknowledge the interrupts itself as gfar_{receive/transmit/error}() do it anyway. While at it, also clarify/cleanup debug messages in gfar_error()... Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]> --- The patch survived netperf stressing on MPC8540ADS realtime kernel. :-) drivers/net/gianfar.c | 85 -- 1 files changed, 15 insertions(+), 70 deletions(-) Index: linux-2.6/drivers/net/gianfar.c === --- linux-2.6.orig/drivers/net/gianfar.c +++ linux-2.6/drivers/net/gianfar.c @@ -10,6 +10,7 @@ * Maintainer: Kumar Gala * * Copyright (c) 2002-2006 Freescale Semiconductor, Inc. + * Copyright (c) 2007 MontaVista Software, Inc. * * 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 @@ -1613,71 +1614,17 @@ static irqreturn_t gfar_interrupt(int ir /* Save ievent for future reference */ u32 events = gfar_read(&priv->regs->ievent); - /* Clear IEVENT */ - gfar_write(&priv->regs->ievent, events); - /* Check for reception */ - if ((events & IEVENT_RXF0) || (events & IEVENT_RXB0)) + if (events & IEVENT_RX_MASK) gfar_receive(irq, dev_id); /* Check for transmit completion */ - if ((events & IEVENT_TXF) || (events & IEVENT_TXB)) + if (events & IEVENT_TX_MASK) gfar_transmit(irq, dev_id); - /* Update error statistics */ - if (events & IEVENT_TXE) { - priv->stats.tx_errors++; - - if (events & IEVENT_LC) - priv->stats.tx_window_errors++; - if (events & IEVENT_CRL) - priv->stats.tx_aborted_errors++; - if (events & IEVENT_XFUN) { - if (netif_msg_tx_err(priv)) - printk(KERN_WARNING "%s: tx underrun. dropped packet\n", dev->name); - priv->stats.tx_dropped++; - priv->extra_stats.tx_underrun++; - - /* Reactivate the Tx Queues */ - gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT); - } - } - if (events & IEVENT_BSY) { - priv->stats.rx_errors++; - priv->extra_stats.rx_bsy++; - - gfar_receive(irq, dev_id); - -#ifndef CONFIG_GFAR_NAPI - /* Clear the halt bit in RSTAT */ - gfar_write(&priv->regs->rstat, RSTAT_CLEAR_RHALT); -#endif - - if (netif_msg_rx_err(priv)) - printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n", - dev->name, - gfar_read(&priv->regs->rstat)); - } - if (events & IEVENT_BABR) { - priv->stats.rx_errors++; - priv->extra_stats.rx_babr++; - - if (netif_msg_rx_err(priv)) - printk(KERN_DEBUG "%s: babbling error\n", dev->name); - } - if (events & IEVENT_EBERR) { - priv->extra_stats.eberr++; - if (netif_msg_rx_err(priv)) - printk(KERN_DEBUG "%s: EBERR\n", dev->name); - } - if ((events & IEVENT_RXC) && (netif_msg_rx_err(priv))) - printk(KERN_DEBUG "%s: control frame\n", dev->name); - - if (events & IEVENT_BABT) { - priv->extra_stats.tx_babt++; - if (netif_msg_rx_err(priv)) - printk(KERN_DEBUG "%s: babt error\n", dev->name); - } + /* Check for errors */ + if (events & IEVENT_ERR_MASK) + gfar_error(irq, dev_id, regs); return IRQ_HANDLED; } @@ -1939,7 +1886,7 @@ static irqreturn_t gfar_error(int irq, v /* Hmm... */ if (netif_msg_rx_err(priv) || netif_msg_tx_err(priv)) printk(KERN_DEBUG "%s: error interrupt (ievent=0x%08x imask=0x%08x)\n", - dev->name, events, gfar_read(&priv->regs->imask)); + dev->name, events, gfar_read(&priv->regs->imask)); /* Update the error counters */ if (events & IEVENT_TXE) { @@ -1951,8 +1898,8 @@ static irqreturn_t gfar_error(int irq, v priv->stats.tx_aborted_errors++; if (events & IEVENT_XFUN) { if (netif_msg_tx_err(priv)) - printk(KERN_DEBUG "%s: underrun. packet dropped.\n", - dev->name); + printk(KERN_DEBUG "%s: TX FIFO underrun, " + "packet dropped.
[PATCH] sundance: add IFF_RUNNING support
Patch to add IFF_RUNNING support for sundance. I copied the basic code for this from the forcedeth driver, and I've tested it using the ifplugstatus command from the ifplugd package. This is very handy if you use Quagga or keepalived. Signed-off-by: Leigh Brown <[EMAIL PROTECTED]> diff -urN a/drivers/net/sundance.c b/drivers/net/sundance.c --- a/drivers/net/sundance.c2007-02-11 11:29:19.0 + +++ b/drivers/net/sundance.c2007-02-12 19:48:36.0 + @@ -23,8 +23,8 @@ */ #define DRV_NAME "sundance" -#define DRV_VERSION"1.2" -#define DRV_RELDATE"11-Sep-2006" +#define DRV_VERSION"1.3" +#define DRV_RELDATE"12-Feb-2007" /* The user-configurable values. @@ -831,6 +831,7 @@ /* Fix DFE-580TX packet drop issue */ if (np->pci_rev_id >= 0x14) iowrite8(0x01, ioaddr + DebugCtrl1); + netif_carrier_off(dev); netif_start_queue(dev); spin_lock_irqsave(&np->lock, flags); @@ -1429,6 +1430,13 @@ iowrite16(ioread16(ioaddr + MACCtrl0) | EnbFlowCtrl, ioaddr + MACCtrl0); } + if (mii_link_ok(&np->mii_if)) { + if (!netif_carrier_ok(dev)) + netif_carrier_on(dev); + } else { + if (netif_carrier_ok(dev)) + netif_carrier_off(dev); + } } if (intr_status & StatsMax) { get_stats(dev); - 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] [v3] spidernet : add improved phy support
> +static int bcm5461_enable_fiber(struct mii_phy* phy, int autoneg) > +{ > + /* select fiber mode, enable 1000 base-X registers */ > + phy_write(phy, MII_NCONFIG, 0xfc0b); > + > + if (autoneg) { > + /* enable fiber with no autonegotiation */ > + phy_write(phy, MII_ADVERTISE, 0x01e0); > + phy_write(phy, MII_BMCR, 0x1140); > + } else { > + /* enable fiber with autonegotiation */ > + phy_write(phy, MII_BMCR, 0x0140); > + } > + > + phy->autoneg = autoneg; > + > + return 0; > +} Something is backward... either the code or the comments... Also, I dislike the autoneg bits without using any constants. Why not use the normal setup_aneg() ? I think what is needed is a set_link_mode or something like that that takes (fiber/copper) as an argument (or better, use the proper names as documented by the chip). Doesn't matter to much right now, if the code works. Have you had a chance to check you don't break G5s with 5421 sungem ? If yes, then the patch is good to go for now but we should revisit and/or try to merge that with the generic PHY layer at one point. 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 1/3] tcp: cleanup of htcp (resend)
From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Mon, 12 Feb 2007 13:28:22 -0800 > Minor non-invasive cleanups: > * white space around operators and line wrapping > * use const > * use __read_mostly > > Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> Applied, thanks Stephen. - 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 1/3] tcp: cleanup of htcp (resend)
Minor non-invasive cleanups: * white space around operators and line wrapping * use const * use __read_mostly Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> --- net/ipv4/tcp_htcp.c | 65 +--- 1 file changed, 37 insertions(+), 28 deletions(-) --- tcp.orig/net/ipv4/tcp_htcp.c2007-02-12 12:32:55.0 -0800 +++ tcp/net/ipv4/tcp_htcp.c 2007-02-12 12:46:48.0 -0800 @@ -10,22 +10,23 @@ #include #include -#define ALPHA_BASE (1<<7) /* 1.0 with shift << 7 */ -#define BETA_MIN (1<<6) /* 0.5 with shift << 7 */ +#define ALPHA_BASE (1<<7) /* 1.0 with shift << 7 */ +#define BETA_MIN (1<<6) /* 0.5 with shift << 7 */ #define BETA_MAX 102 /* 0.8 with shift << 7 */ -static int use_rtt_scaling = 1; +static int use_rtt_scaling __read_mostly = 1; module_param(use_rtt_scaling, int, 0644); MODULE_PARM_DESC(use_rtt_scaling, "turn on/off RTT scaling"); -static int use_bandwidth_switch = 1; +static int use_bandwidth_switch __read_mostly = 1; module_param(use_bandwidth_switch, int, 0644); MODULE_PARM_DESC(use_bandwidth_switch, "turn on/off bandwidth switcher"); struct htcp { u32 alpha; /* Fixed point arith, << 7 */ u8 beta; /* Fixed point arith, << 7 */ - u8 modeswitch; /* Delay modeswitch until we had at least one congestion event */ + u8 modeswitch; /* Delay modeswitch + until we had at least one congestion event */ u16 pkts_acked; u32 packetcount; u32 minRTT; @@ -44,14 +45,14 @@ u32 lasttime; }; -static inline u32 htcp_cong_time(struct htcp *ca) +static inline u32 htcp_cong_time(const struct htcp *ca) { return jiffies - ca->last_cong; } -static inline u32 htcp_ccount(struct htcp *ca) +static inline u32 htcp_ccount(const struct htcp *ca) { - return htcp_cong_time(ca)/ca->minRTT; + return htcp_cong_time(ca) / ca->minRTT; } static inline void htcp_reset(struct htcp *ca) @@ -67,10 +68,12 @@ { const struct tcp_sock *tp = tcp_sk(sk); struct htcp *ca = inet_csk_ca(sk); + ca->last_cong = ca->undo_last_cong; ca->maxRTT = ca->undo_maxRTT; ca->old_maxB = ca->undo_old_maxB; - return max(tp->snd_cwnd, (tp->snd_ssthresh<<7)/ca->beta); + + return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta); } static inline void measure_rtt(struct sock *sk) @@ -78,17 +81,19 @@ const struct inet_connection_sock *icsk = inet_csk(sk); const struct tcp_sock *tp = tcp_sk(sk); struct htcp *ca = inet_csk_ca(sk); - u32 srtt = tp->srtt>>3; + u32 srtt = tp->srtt >> 3; /* keep track of minimum RTT seen so far, minRTT is zero at first */ if (ca->minRTT > srtt || !ca->minRTT) ca->minRTT = srtt; /* max RTT */ - if (icsk->icsk_ca_state == TCP_CA_Open && tp->snd_ssthresh < 0x && htcp_ccount(ca) > 3) { + if (icsk->icsk_ca_state == TCP_CA_Open + && tp->snd_ssthresh < 0x && htcp_ccount(ca) > 3) { if (ca->maxRTT < ca->minRTT) ca->maxRTT = ca->minRTT; - if (ca->maxRTT < srtt && srtt <= ca->maxRTT+msecs_to_jiffies(20)) + if (ca->maxRTT < srtt + && srtt <= ca->maxRTT + msecs_to_jiffies(20)) ca->maxRTT = srtt; } } @@ -116,15 +121,16 @@ ca->packetcount += pkts_acked; - if (ca->packetcount >= tp->snd_cwnd - (ca->alpha>>7? : 1) - && now - ca->lasttime >= ca->minRTT - && ca->minRTT > 0) { - __u32 cur_Bi = ca->packetcount*HZ/(now - ca->lasttime); + if (ca->packetcount >= tp->snd_cwnd - (ca->alpha >> 7 ? : 1) + && now - ca->lasttime >= ca->minRTT + && ca->minRTT > 0) { + __u32 cur_Bi = ca->packetcount * HZ / (now - ca->lasttime); + if (htcp_ccount(ca) <= 3) { /* just after backoff */ ca->minB = ca->maxB = ca->Bi = cur_Bi; } else { - ca->Bi = (3*ca->Bi + cur_Bi)/4; + ca->Bi = (3 * ca->Bi + cur_Bi) / 4; if (ca->Bi > ca->maxB) ca->maxB = ca->Bi; if (ca->minB > ca->maxB) @@ -142,7 +148,7 @@ u32 old_maxB = ca->old_maxB; ca->old_maxB = ca->maxB; - if (!between(5*maxB, 4*old_maxB, 6*old_maxB)) { + if (!between(5 * maxB, 4 * old_maxB, 6 * old_maxB)) { ca->beta = BETA_MIN; ca->modeswitch = 0; return; @@ -150,7 +156,7 @@ } if (ca->modeswitch && minRTT > msecs_to_jiffies(10) && maxRTT) { - ca->beta = (minRTT<<7)/ma
Re: [PATCH] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection
> > New patch attached with these fixes included > > Ping? Any further thoughts here? My (allbeit limited) testing seems to be going fairly well so far... Neil > Thanks & Regards > Neil > > Signed-off-by: Neil Horman <[EMAIL PROTECTED]> > > > include/linux/if_addr.h |1 > include/linux/ipv6.h|4 ++ > include/linux/sysctl.h |1 > include/net/addrconf.h |4 +- > net/ipv6/Kconfig| 10 + > net/ipv6/addrconf.c | 90 > > net/ipv6/ip6_output.c | 35 ++ > net/ipv6/mcast.c|4 +- > net/ipv6/ndisc.c| 84 > 9 files changed, 192 insertions(+), 41 deletions(-) > > > > > diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h > index d557e4c..43f3bed 100644 > --- a/include/linux/if_addr.h > +++ b/include/linux/if_addr.h > @@ -39,6 +39,7 @@ enum > #define IFA_F_TEMPORARY IFA_F_SECONDARY > > #define IFA_F_NODAD 0x02 > +#define IFA_F_OPTIMISTIC 0x04 > #define IFA_F_HOMEADDRESS 0x10 > #define IFA_F_DEPRECATED 0x20 > #define IFA_F_TENTATIVE 0x40 > diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h > index f824113..bf93c1b 100644 > --- a/include/linux/ipv6.h > +++ b/include/linux/ipv6.h > @@ -177,6 +177,9 @@ struct ipv6_devconf { > #endif > #endif > __s32 proxy_ndp; > +#ifdef CONFIG_IPV6_OPTIMISTIC_DAD > + __s32 optimistic_dad; > +#endif > void*sysctl; > }; > > @@ -205,6 +208,7 @@ enum { > DEVCONF_RTR_PROBE_INTERVAL, > DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, > DEVCONF_PROXY_NDP, > + DEVCONF_OPTIMISTIC_DAD, > DEVCONF_MAX > }; > > diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h > index 81480e6..972a33a 100644 > --- a/include/linux/sysctl.h > +++ b/include/linux/sysctl.h > @@ -570,6 +570,7 @@ enum { > NET_IPV6_RTR_PROBE_INTERVAL=21, > NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, > NET_IPV6_PROXY_NDP=23, > + NET_IPV6_OPTIMISTIC_DAD=24, > __NET_IPV6_MAX > }; > > diff --git a/include/net/addrconf.h b/include/net/addrconf.h > index 88df8fc..d248a19 100644 > --- a/include/net/addrconf.h > +++ b/include/net/addrconf.h > @@ -73,7 +73,9 @@ extern int ipv6_get_saddr(struct dst_entry > *dst, > extern int ipv6_dev_get_saddr(struct net_device *dev, > struct in6_addr *daddr, > struct in6_addr *saddr); > -extern int ipv6_get_lladdr(struct net_device *dev, struct > in6_addr *); > +extern int ipv6_get_lladdr(struct net_device *dev, > + struct in6_addr *, > + unsigned char banned_flags); > extern int ipv6_rcv_saddr_equal(const struct sock *sk, > const struct sock *sk2); > extern void addrconf_join_solict(struct net_device *dev, > diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig > index deb4101..822d3eb 100644 > --- a/net/ipv6/Kconfig > +++ b/net/ipv6/Kconfig > @@ -57,6 +57,16 @@ config IPV6_ROUTE_INFO > > If unsure, say N. > > +config IPV6_OPTIMISTIC_DAD > + bool "IPv6: Enable RFC 4429 Optimistic DAD (EXPERIMENTAL)" > + depends on IPV6 && EXPERIMENTAL > + ---help--- > + This is experimental support for optimistic Duplicate > + Address Detection. It allows for autoconfigured addresses > + to be used more quickly. > + > + If unsure, say N. > + > config INET6_AH > tristate "IPv6: AH transformation" > depends on IPV6 > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c > index e385469..c884eeb 100644 > --- a/net/ipv6/addrconf.c > +++ b/net/ipv6/addrconf.c > @@ -594,6 +594,16 @@ ipv6_add_addr(struct inet6_dev *idev, const struct > in6_addr *addr, int pfxlen, > > ifa->rt = rt; > > + /* > + * part one of RFC 4429, section 3.3 > + * We should not configure an address as > + * optimistic if we do not yet know the link > + * layer address of our nexhop router > + */ > + > + if (rt->rt6i_nexthop == NULL) > + ifa->flags &= ~IFA_F_OPTIMISTIC; > + > ifa->idev = idev; > in6_dev_hold(idev); > /* For caller */ > @@ -770,6 +780,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, > struct inet6_ifaddr *i > int tmp_plen; > int ret = 0; > int max_addresses; > + u32 addr_flags; > > write_lock(&idev->lock); > if (ift) { > @@ -827,10 +838,17 @@ retry: > spin_unlock_bh(&ifp->lock); > > write_unlock(&idev->lock); > + > + addr_flags = IFA_F_TEMPORARY; > + /* set in addrconf_prefix_rcv() */ > + if (ifp->flags & IFA_F_OPTIMISTIC) > +
Re: [patch 2/3] tcp: use read mostly for CUBIC parameters
From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Mon, 12 Feb 2007 08:03:19 -0800 > These module parameters should be in the read mostly area > to avoid cache pollution. > > Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> Applied, thanks Stephen. - 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] 2.6.20 Oopses in xfrm_audit_log
Alexey Dobriyan wrote: > [removing l-k from CC, and switching to netdev] > > Please, send your .config. > Is it reproducible? > > On Mon, Feb 12, 2007 at 03:16:04PM +0100, Charles-Edouard Ruault wrote: > >> i upgraded to vanilla kernel 2.6.20 and while i was using strongswan >> 2.8.2 to setup an IPSEC VPN i got the following kernel Ooops. >> I had successfully established the same tunnel a few times, but key >> renegotiation caused a problem ( both ends did not renegotiate at the >> same time so the tunnel was frozen ), i decided to kill the tunnel and >> start a new one ( using ipsec auto --down tunnel & ipsec auto --up >> tunnel ), while i was doing so, i got the oops. >> >> BUG: unable to handle kernel NULL pointer dereference at virtual address >> 0188 >> printing eip: >> c02fb85c >> *pde = >> Oops: [#1] >> PREEMPT >> Modules linked in: xfrm4_mode_tunnel usblp deflate zlib_deflate twofish >> twofish_common serpent blowfish des cbc ecb blkcipher xcbc sha256 sha1 >> crypto_null xfrm4_tunnel tunnel4 ipcomp esp4 ah4 af_key autofs4 asb100 >> hwmon_vid hidp rfcomm l2cap bluetooth sunrpc nf_conntrack_netbios_ns >> ipt_LOG xt_limit xt_mark xt_state xt_tcpudp iptable_filter >> ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 xt_MARK >> iptable_mangle ip_tables x_tables binfmt_misc sd_mod ipv6 sg hfsplus >> video button ac lp parport_pc parport floppy nvram usb_storage scsi_mod >> libusual usbhid hid ehci_hcd snd_via82xx snd_ac97_codec ac97_bus >> ohci1394 snd_seq_dummy uhci_hcd ieee1394 snd_seq_oss snd_seq_midi_event >> snd_seq snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc >> snd_mpu401_uart snd_rawmidi snd_seq_device snd via_agp agpgart >> i2c_viapro soundcore eepro100 i2c_core b44 pcspkr mii shpchp usbcore dm_mod >> CPU:0 >> EIP:0060:[]Not tainted VLI >> EFLAGS: 00010246 (2.6.20 #1) >> EIP is at xfrm_audit_log+0x4cc/0x580 >> eax: ecb71061 ebx: c039d160 ecx: edx: 0021 >> esi: 01f4 edi: 0255 ebp: esp: e8cd5a18 >> ds: 007b es: 007b ss: 0068 >> Process pluto (pid: 27486, ti=e8cd4000 task=d3557070 task.ti=e8cd4000) >> Stack: c17d2ea0 c0354bf1 e183f9c0 0003 c03ac59c e1399800 0001 >> 0003 >> f8d0a450 0001 0286 e8cd5a6c c011506b >> 0286 >> f73cb8c0 0246 c17d2ea0 f73cb8c0 f8d03c67 >> >> Call Trace: >> [] __wake_up+0x4b/0x80 >> [] pfkey_broadcast+0x137/0x1b0 [af_key] >> [] pfkey_send_policy_notify+0xef/0x1a0 [af_key] >> [] local_bh_enable+0x2e/0xa0 >> [] xfrm_get_policy+0x2b7/0x2f0 >> [] xfrm_get_policy+0x0/0x2f0 >> [] xfrm_user_rcv_msg+0x102/0x1b0 >> [] xfrm_user_rcv_msg+0x0/0x1b0 >> [] netlink_run_queue+0x82/0x120 >> [] xfrm_netlink_rcv+0x28/0x40 >> [] netlink_data_ready+0x12/0x50 >> [] netlink_sendskb+0x21/0x40 >> [] netlink_sendmsg+0x230/0x310 >> [] sock_aio_write+0x11d/0x130 >> [] avc_has_perm+0x5a/0x70 >> [] do_sync_write+0xd5/0x120 >> [] autoremove_wake_function+0x0/0x50 >> [] vfs_write+0x177/0x180 >> [] sys_write+0x41/0x70 >> [] syscall_call+0x7/0xb >> === >> Code: 8b 44 24 70 c1 e2 08 c1 e8 08 09 c2 0f b7 c2 89 44 24 08 8b 44 24 >> 48 89 04 24 e8 10 eb e3 ff e9 bc fc ff ff 8b 8c 24 c0 00 00 00 <8b> 91 >> 88 01 00 00 0f b7 99 82 00 00 00 85 d2 0f 85 64 fc ff ff >> EIP: [] xfrm_audit_log+0x4cc/0x580 SS:ESP 0068:e8cd5a18 >> >> I'm running a vanilla 2.6.20 kernel on a Fedora Core 5 box on an athlon >> processor: >> cat /proc/cpuinfo >> processor : 0 >> vendor_id : AuthenticAMD >> cpu family : 6 >> model : 8 >> model name : AMD Athlon(TM) XP 2400+ >> stepping: 1 >> cpu MHz : 2000.256 >> cache size : 256 KB >> fdiv_bug: no >> hlt_bug : no >> f00f_bug: no >> coma_bug: no >> fpu : yes >> fpu_exception : yes >> cpuid level : 1 >> wp : yes >> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge >> mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow ts >> bogomips: 4003.78 >> clflush size: 32 >> >> uname -a >> Linux machine 2.6.20 #1 PREEMPT Sat Feb 10 13:48:56 CET 2007 i686 athlon >> i386 GNU/Linux >> >> Please CC me in follow ups since i do not subscribe to the list. >> > > here's my config.gz attached. I don't know if it's reproducible, i have not had the time to reboot & try again yet I just applied the patch that Joy sent. I'm trying with the patched kernel and let the list know if it happens again. -- Charles-Edouard Ruault PGP Key ID E4D2B80C config.gz Description: GNU Zip compressed data
Re: [patch 1/3] tcp: cleanup of htcp
From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Mon, 12 Feb 2007 08:03:18 -0800 > Minor non-invasive cleanups: > * white space around operators and line wrapping > * use const > * use __read_mostly > > Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> Yoshifuji fixed all the whitespace issues in the entire net/ subtree the other day using an automated script, so you'll need to re-patch this against Linus's current tree as it doesn't apply cleanly. 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/3] tcp: remove experimental variants from default list
On 2/13/07, David Miller <[EMAIL PROTECTED]> wrote: This is not the internet of 15 years ago, please wake up everyone. We cannot sit on eggs for 5 years to make sure they hatch perfectly like was previously possible. OK. I get the point. I am more conservative by nature and more of an academic. Now there's been some explanation I'm happier for the change to go ahead. I just think changes like this that affect the Internet should be discussed a little. Now it's been discussed a little I feel better. Ian -- Web: http://wand.net.nz/~iam4 Blog: http://iansblog.jandi.co.nz WAND Network Research Group - 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: netfilter tables config problem
On Mon, 12 Feb 2007 21:30:02 +0100 Patrick McHardy wrote: > David Miller wrote: > > From: Randy Dunlap <[EMAIL PROTECTED]> > > Date: Fri, 22 Dec 2006 18:33:12 -0800 > > > > I'm pretty sure we fixed that one already. Randy do you have some > > objection to testing 2.6.20-final when discoving such bugs? :-) > > > Sorry for the confusion, we had an 8 months backlog of non-subscriber > posted mails and I released them all today. You can probably ignore > all mails on netfilter-devel you received today, I'll go over them > to look for anything important. > > The hashlimit problem is fixed in 2.6.20 :) Ack, yes, it builds cleanly now. and thanks for the explanation. --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - 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/3] tcp: remove experimental variants from default list
From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Mon, 12 Feb 2007 12:37:13 -0800 > My patches weren't reactionary. Going to pure old Reno is reactionary. > It was more looking at the state of the code on the flight back > and cleaning house. Others were/are reactionary. Ok. The only patch I have a real problem with is the DEFAULT_* removals, the choices are frankly arbitrary. Vegas is buggy, that's nice, why don't we simply fix the bugs in our implementation? Westwood is very conservative, frankly, and I therefore see no reason it cannot be offered as a default either. HTCP doesn't do anything earth shattering either. I think the whole suite of algorithms in that list are reasonable. And even re-reading your patch, you're messing with the DEFAULT_* setting for the case where the user selected TCP_CONG_ADVANCED. I think TCP_CONG_ADVANCED implies an intention by the user, and if he wants to choose one of those listed as a default why should we stop them? The distributions take the default we recommend, and that's all that matters for wide deployment. > I push the problem back in their court: "Why do you not have a process > that causes consensus?" IETF has done nothing to create any incentive > for long term cooperation. Yep, this is a good point. > Do I need to dig out the "Why Reno sucks" graphs? Hehe :-) - 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/4] spidernet: support for Celleb
On Wednesday 07 February 2007, Ishizaki Kou wrote: > This is a revised spidernet patch set based on > netdev-2.6.git#upstream. > > This patch set is merged Jens-san's spidernet patch and works on > Toshiba Cell reference set (aka Celleb). > It requires Jens-san's phy patch > (http://ozlabs.org/pipermail/linuxppc-dev/2007-February/030987.html). > > Ignore our previos patch set, and try this patch set on Cell Blade, > please (sorry for asking a lot). Ishizaki-san, this patchset works fine for me on the blade now together with my now corrected sungem update patch and the patch that moves the medium variable into the card structure. If it also work fine for you I think the patches are finally ready to go in... Jens - 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/3] tcp: remove experimental variants from default list
On Mon, 12 Feb 2007 12:32:40 -0800 (PST) David Miller <[EMAIL PROTECTED]> wrote: > From: "Ian McDonald" <[EMAIL PROTECTED]> > Date: Tue, 13 Feb 2007 09:13:52 +1300 > > > Unless of course the papers you saw at PFLDNET showed that Cubic was a > > really good choice and you want to point us to those papers. > > I heavily dislike all of these "reactionary" patches from Stephen > after he attended PFDLNET. > > If he never went there, none of these patches would have been > proposed. He went to the sermon and he became converted :-) My patches weren't reactionary. Going to pure old Reno is reactionary. It was more looking at the state of the code on the flight back and cleaning house. Others were/are reactionary. > We want people to play with this stuff, and they can experiment > regardless of whatever options or even code we put into the kernel. > Every user can muck with the congestion control on their computer > however they want, and THAT'S GOOD! > > Sure we indirectly recommend to distribution vendors what to use > by default by the Kconfig defaults we put into the vanilla tree, > and that's fine too. > > Even after reading all of the papers, I still think CUBIC or even BIC > by default is not all that controbersal or radical thing to use by > default. > > I'm sorry if the researchers and IETF folks don't like this. Too bad, > get over it. I push the problem back in their court: "Why do you not have a process that causes consensus?" IETF has done nothing to create any incentive for long term cooperation. > If you use RENO you're stupid, since performance is going to stink for > absolutely normal connections. Fact: high BDP pipes are everywhere, > even grandma has one. So just taking out the best solution we have > for that problem currently because it's not perfect is not the answer. > Do I need to dig out the "Why Reno sucks" graphs? -- Stephen Hemminger <[EMAIL PROTECTED]> - 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] spidernet: move medium variable into card struct
This moves the medium variable into the spidernet card structure. It renames the GMII_ variables to BCM54XX specific ones. Signed-off-by: Jens Osterkamp <[EMAIL PROTECTED]> --- Index: linux-2.6.20/drivers/net/spider_net.c === --- linux-2.6.20.orig/drivers/net/spider_net.c +++ linux-2.6.20/drivers/net/spider_net.c @@ -1912,26 +1912,26 @@ static void spider_net_link_phy(unsigned pr_info("%s: link is down trying to bring it up\n", card->netdev->name); - switch (phy->medium) { - case GMII_COPPER: + switch (card->medium) { + case BCM54XX_COPPER: /* enable fiber with autonegotiation first */ if (phy->def->ops->enable_fiber) phy->def->ops->enable_fiber(phy, 1); - phy->medium = GMII_FIBER; + card->medium = BCM54XX_FIBER; break; - case GMII_FIBER: + case BCM54XX_FIBER: /* fiber didn't come up, try to disable fiber autoneg */ if (phy->def->ops->enable_fiber) phy->def->ops->enable_fiber(phy, 0); - phy->medium = GMII_UNKNOWN; + card->medium = BCM54XX_UNKNOWN; break; - case GMII_UNKNOWN: + case BCM54XX_UNKNOWN: /* copper, fiber with and without failed, * retry from beginning */ spider_net_setup_aneg(card); - phy->medium = GMII_COPPER; + card->medium = BCM54XX_COPPER; break; } Index: linux-2.6.20/drivers/net/spider_net.h === --- linux-2.6.20.orig/drivers/net/spider_net.h +++ linux-2.6.20/drivers/net/spider_net.h @@ -444,6 +444,8 @@ struct spider_net_card { struct pci_dev *pdev; struct mii_phy phy; + int medium; + void __iomem *regs; struct spider_net_descr_chain tx_chain; - 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: netfilter tables config problem
From: Patrick McHardy <[EMAIL PROTECTED]> Date: Mon, 12 Feb 2007 21:30:02 +0100 > David Miller wrote: > > From: Randy Dunlap <[EMAIL PROTECTED]> > > Date: Fri, 22 Dec 2006 18:33:12 -0800 > > > > I'm pretty sure we fixed that one already. Randy do you have some > > objection to testing 2.6.20-final when discoving such bugs? :-) > > > Sorry for the confusion, we had an 8 months backlog of non-subscriber > posted mails and I released them all today. You can probably ignore > all mails on netfilter-devel you received today, I'll go over them > to look for anything important. > > The hashlimit problem is fixed in 2.6.20 :) You know, I noticed the January dates in the postings only after replying to a few of them. Thanks for explaining :-) - 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] [v3] spidernet : add improved phy support
This version moves the medium variable to the card specific structure and changes the GMII_* to BCM54XX_* #defines. This patch adds improved version of enable_fiber for both the 5421 and the 5461 phy. It is now possible to specify with these wether you want autonegotiation or not. This is needed for bladecenter switches where some expect autonegotiation and some dont seem to like this at all. Depending on this flag it sets phy->autoneg accordingly for the fiber mode. More importantly it implements proper read_link and poll_link functions for both phys which can handle both copper and fiber mode by determining the medium first and then branching to the required functions. For fiber they all work fine, for copper they are not tested but return the result of the genmii_* function anyway which is supposed to work. The patch moves the genmii_* functions around to avoid foreward declarations. Signed-off-by: Jens Osterkamp <[EMAIL PROTECTED]> Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]> Index: linux-2.6.20/drivers/net/sungem_phy.c === --- linux-2.6.20.orig/drivers/net/sungem_phy.c +++ linux-2.6.20/drivers/net/sungem_phy.c @@ -311,6 +311,107 @@ static int bcm5411_init(struct mii_phy* return 0; } +static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise) +{ + u16 ctl, adv; + + phy->autoneg = 1; + phy->speed = SPEED_10; + phy->duplex = DUPLEX_HALF; + phy->pause = 0; + phy->advertising = advertise; + + /* Setup standard advertise */ + adv = phy_read(phy, MII_ADVERTISE); + adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4); + if (advertise & ADVERTISED_10baseT_Half) + adv |= ADVERTISE_10HALF; + if (advertise & ADVERTISED_10baseT_Full) + adv |= ADVERTISE_10FULL; + if (advertise & ADVERTISED_100baseT_Half) + adv |= ADVERTISE_100HALF; + if (advertise & ADVERTISED_100baseT_Full) + adv |= ADVERTISE_100FULL; + phy_write(phy, MII_ADVERTISE, adv); + + /* Start/Restart aneg */ + ctl = phy_read(phy, MII_BMCR); + ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); + phy_write(phy, MII_BMCR, ctl); + + return 0; +} + +static int genmii_setup_forced(struct mii_phy *phy, int speed, int fd) +{ + u16 ctl; + + phy->autoneg = 0; + phy->speed = speed; + phy->duplex = fd; + phy->pause = 0; + + ctl = phy_read(phy, MII_BMCR); + ctl &= ~(BMCR_FULLDPLX|BMCR_SPEED100|BMCR_ANENABLE); + + /* First reset the PHY */ + phy_write(phy, MII_BMCR, ctl | BMCR_RESET); + + /* Select speed & duplex */ + switch(speed) { + case SPEED_10: + break; + case SPEED_100: + ctl |= BMCR_SPEED100; + break; + case SPEED_1000: + default: + return -EINVAL; + } + if (fd == DUPLEX_FULL) + ctl |= BMCR_FULLDPLX; + phy_write(phy, MII_BMCR, ctl); + + return 0; +} + +static int genmii_poll_link(struct mii_phy *phy) +{ + u16 status; + + (void)phy_read(phy, MII_BMSR); + status = phy_read(phy, MII_BMSR); + if ((status & BMSR_LSTATUS) == 0) + return 0; + if (phy->autoneg && !(status & BMSR_ANEGCOMPLETE)) + return 0; + return 1; +} + +static int genmii_read_link(struct mii_phy *phy) +{ + u16 lpa; + + if (phy->autoneg) { + lpa = phy_read(phy, MII_LPA); + + if (lpa & (LPA_10FULL | LPA_100FULL)) + phy->duplex = DUPLEX_FULL; + else + phy->duplex = DUPLEX_HALF; + if (lpa & (LPA_100FULL | LPA_100HALF)) + phy->speed = SPEED_100; + else + phy->speed = SPEED_10; + phy->pause = 0; + } + /* On non-aneg, we assume what we put in BMCR is the speed, +* though magic-aneg shouldn't prevent this case from occurring +*/ + +return 0; +} + static int generic_suspend(struct mii_phy* phy) { phy_write(phy, MII_BMCR, BMCR_PDOWN); @@ -365,30 +466,6 @@ static int bcm5421_init(struct mii_phy* return 0; } -static int bcm5421_enable_fiber(struct mii_phy* phy) -{ - /* enable fiber mode */ - phy_write(phy, MII_NCONFIG, 0x9020); - /* LEDs active in both modes, autosense prio = fiber */ - phy_write(phy, MII_NCONFIG, 0x945f); - - /* switch off fibre autoneg */ - phy_write(phy, MII_NCONFIG, 0xfc01); - phy_write(phy, 0x0b, 0x0004); - - return 0; -} - -static int bcm5461_enable_fiber(struct mii_phy* phy) -{ - phy_write(phy, MII_NCONFIG, 0xfc0c); - phy_write(phy, MII_BMCR, 0x4140); - phy_write(phy, MII_NCONFIG, 0xfc0b); - phy_write(phy, MII_BMCR, 0x0140); - - return 0; -} - static int bcm54xx_setup_aneg(struct mii_phy *ph
Re: [patch 3/3] tcp: remove experimental variants from default list
From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Mon, 12 Feb 2007 12:26:34 -0800 > No magic paper. But the impression from multiple talks is that Cubic > is still doing fine. Also for non high speed flows, it really doesn't matter > because all the loss based congestion controls behave the same. This last point is important. Either it's high BDP and it uses the new stuff (and we WANT it to) or it's not high BDP and it USES RENO! That's why Baruch's email is totally illogical. If people don't have high BDP, these algorithms such as CUBIC and BIC change nothing compared to Reno, they purposely behave precisely the same. - 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/3] tcp: remove experimental variants from default list
From: "Ian McDonald" <[EMAIL PROTECTED]> Date: Tue, 13 Feb 2007 09:13:52 +1300 > Unless of course the papers you saw at PFLDNET showed that Cubic was a > really good choice and you want to point us to those papers. I heavily dislike all of these "reactionary" patches from Stephen after he attended PFDLNET. If he never went there, none of these patches would have been proposed. He went to the sermon and he became converted :-) We want people to play with this stuff, and they can experiment regardless of whatever options or even code we put into the kernel. Every user can muck with the congestion control on their computer however they want, and THAT'S GOOD! Sure we indirectly recommend to distribution vendors what to use by default by the Kconfig defaults we put into the vanilla tree, and that's fine too. Even after reading all of the papers, I still think CUBIC or even BIC by default is not all that controbersal or radical thing to use by default. I'm sorry if the researchers and IETF folks don't like this. Too bad, get over it. If you use RENO you're stupid, since performance is going to stink for absolutely normal connections. Fact: high BDP pipes are everywhere, even grandma has one. So just taking out the best solution we have for that problem currently because it's not perfect is not the answer. This is not the internet of 15 years ago, please wake up everyone. We cannot sit on eggs for 5 years to make sure they hatch perfectly like was previously possible. I think the best thing we ever did was create the congestion control algorithm abstraction and add a bunch of reasonable algorithms, and then on top of that try to use something modern by default. - 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: netfilter tables config problem
David Miller wrote: > From: Randy Dunlap <[EMAIL PROTECTED]> > Date: Fri, 22 Dec 2006 18:33:12 -0800 > > I'm pretty sure we fixed that one already. Randy do you have some > objection to testing 2.6.20-final when discoving such bugs? :-) Sorry for the confusion, we had an 8 months backlog of non-subscriber posted mails and I released them all today. You can probably ignore all mails on netfilter-devel you received today, I'll go over them to look for anything important. The hashlimit problem is fixed in 2.6.20 :) - 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/3] tcp: remove experimental variants from default list
On Tue, 13 Feb 2007 09:13:52 +1300 "Ian McDonald" <[EMAIL PROTECTED]> wrote: > On 2/13/07, Baruch Even <[EMAIL PROTECTED]> wrote: > > * Stephen Hemminger <[EMAIL PROTECTED]> [070212 18:04]: > > > The TCP Vegas implementation is buggy, and BIC is too agressive > > > so they should not be in the default list. Westwood is okay, but > > > not well tested. > > > > Since no one really agrees on the relative merits and problems of the > > different algorithms and since the users themselves dont know, dont care > > and have no clue on what should be the correct behaviour to report bugs > > (see the old bic bugs, the htcp bugs, the recent sack bugs) I would > > suggest to avoid making the whole internet a guinea pig and get back to > > reno. If someone really needs to push high BDP flows he should test it > > himself and choose what works for his kernel at the time. > > > > For myself and anyone who asks me I recommend to set the default to > > reno. For the few who really need high speed flows, they should test > > kernel and protocol combination. > > > > Baruch > > I agree wholeheartedly with Baruch. If we are going to remove BIC as > default we should go back to Reno as Cubic is even less tested in > production use than BIC. > > Unless of course the papers you saw at PFLDNET showed that Cubic was a > really good choice and you want to point us to those papers. No magic paper. But the impression from multiple talks is that Cubic is still doing fine. Also for non high speed flows, it really doesn't matter because all the loss based congestion controls behave the same. -- Stephen Hemminger <[EMAIL PROTECTED]> - 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: Fw: PROBLEM: xt_state compiles without errors but cannot be loaded
Andrew Morton wrote: > > Begin forwarded message: > > Date: Fri, 9 Feb 2007 16:00:50 -0800 (PST) > From: "Administrative Services" <[EMAIL PROTECTED]> > To: linux-kernel@vger.kernel.org > Subject: PROBLEM: xt_state compiles without errors but cannot be loaded > > > [1.] module: xt_state compiles without errors but cannot be loaded > > [2.] Here's what shows up in /var/log/messages: > > kernel: xt_state: Unknown symbol nf_conntrack_untracked > > kernel: xt_state: Unknown symbol nf_ct_l3proto_module_put > > kernel: xt_state: disagrees about version of symbol xt_unregister_matches > > kernel: xt_state: Unknown symbol xt_unregister_matches > > kernel: xt_state: Unknown symbol nf_ct_l3proto_try_module_get > > kernel: xt_state: disagrees about version of symbol xt_register_matches > > kernel: xt_state: Unknown symbol xt_register_matches > > > [8.1.] apf 0.9.6 (modified to use xt_state), and insmod insmod doesn't resolve dependencies, try using modprobe. - 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: netfilter tables config problem
From: Randy Dunlap <[EMAIL PROTECTED]> Date: Fri, 22 Dec 2006 18:33:12 -0800 > > (on 2.6.20-rc1-git8) > > It's possible to have > CONFIG_NETFILTER_XTABLES=y > and > CONFIG_IP6_NF_MATCH_IPV6HEADER=m, > > which causes this build error: > net/built-in.o: In function `hashlimit_match': > xt_hashlimit.c:(.text+0x1c887): undefined reference to `ipv6_find_hdr' > make: *** [.tmp_vmlinux1] Error 1 > > Clean build if I set > CONFIG_IP6_NF_MATCH_IPV6HEADER=y. > > .config (for i386) attached. I'm pretty sure we fixed that one already. Randy do you have some objection to testing 2.6.20-final when discoving such bugs? :-) - 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/3] tcp: remove experimental variants from default list
From: Baruch Even <[EMAIL PROTECTED]> Date: Mon, 12 Feb 2007 21:11:01 +0200 > Since no one really agrees on the relative merits and problems of the > different algorithms and since the users themselves dont know, dont care > and have no clue on what should be the correct behaviour to report bugs > (see the old bic bugs, the htcp bugs, the recent sack bugs) I would > suggest to avoid making the whole internet a guinea pig and get back to > reno. If someone really needs to push high BDP flows he should test it > himself and choose what works for his kernel at the time. > > For myself and anyone who asks me I recommend to set the default to > reno. For the few who really need high speed flows, they should test > kernel and protocol combination. We have "high BDP flows" even going from between the east and the west coast of the United States. This doesn't even begin to touch upon extremely well connected coutries like South Korea and what happens when people there try to access sites in Europe or the US. Good high BDP flow handling is necessary now and for everyday usage of the internet, it's not some obscure thing only researchers in fancy labs need. This also isn't the internet of 15 years ago where IETF members can spend 4 or 5 years masterbating over new ideas before deploying them. I know that's what conservative folks want, but it isn't going to happen. - 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/3] tcp: remove experimental variants from default list
On 2/13/07, Baruch Even <[EMAIL PROTECTED]> wrote: * Stephen Hemminger <[EMAIL PROTECTED]> [070212 18:04]: > The TCP Vegas implementation is buggy, and BIC is too agressive > so they should not be in the default list. Westwood is okay, but > not well tested. Since no one really agrees on the relative merits and problems of the different algorithms and since the users themselves dont know, dont care and have no clue on what should be the correct behaviour to report bugs (see the old bic bugs, the htcp bugs, the recent sack bugs) I would suggest to avoid making the whole internet a guinea pig and get back to reno. If someone really needs to push high BDP flows he should test it himself and choose what works for his kernel at the time. For myself and anyone who asks me I recommend to set the default to reno. For the few who really need high speed flows, they should test kernel and protocol combination. Baruch I agree wholeheartedly with Baruch. If we are going to remove BIC as default we should go back to Reno as Cubic is even less tested in production use than BIC. Unless of course the papers you saw at PFLDNET showed that Cubic was a really good choice and you want to point us to those papers. Ian -- Web: http://wand.net.nz/~iam4 Blog: http://iansblog.jandi.co.nz WAND Network Research Group - 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: PROBLEM: xt_state compiles without errors but cannot be loaded
Begin forwarded message: Date: Fri, 9 Feb 2007 16:00:50 -0800 (PST) From: "Administrative Services" <[EMAIL PROTECTED]> To: linux-kernel@vger.kernel.org Subject: PROBLEM: xt_state compiles without errors but cannot be loaded [1.] module: xt_state compiles without errors but cannot be loaded [2.] Here's what shows up in /var/log/messages: kernel: xt_state: Unknown symbol nf_conntrack_untracked kernel: xt_state: Unknown symbol nf_ct_l3proto_module_put kernel: xt_state: disagrees about version of symbol xt_unregister_matches kernel: xt_state: Unknown symbol xt_unregister_matches kernel: xt_state: Unknown symbol nf_ct_l3proto_try_module_get kernel: xt_state: disagrees about version of symbol xt_register_matches kernel: xt_state: Unknown symbol xt_register_matches [3.] modules, netfilter: [4.] 2.6.20: [5.] 2.6.19.2 possibly 2.6.9.3: [7.] try loading module using insmod [8.] CentOS 4.4 [8.1.] apf 0.9.6 (modified to use xt_state), and insmod - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ - 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: [ANNOUNCE] d80211 based driver for Intel PRO/Wireless 3945ABG
Hesse, Christian wrote: On Saturday 10 February 2007 14:23, Hesse, Christian wrote: On Friday 09 February 2007 22:12, James Ketrenos wrote: We are pleased to announce the availability of a new driver for the Intel PRO/Wireless 3945ABG Network Connection adapter. ... Oh, I forgot one note: "make patch_kernel" is terribly broken. Any chance to get this fixed soon? I've put up a new version of iwlwifi (0.0.6) with significant changes to the patch_kernel scripts as well as including Pavel's patch to KSRC. I performed some build testing with 2.6.18 and wireless-dev @ commit f66e5aaa88c1c0a7ee6c6427d6535ed8afd35427 (Jan 8). http://intellinuxwireless.org/?n=downloads Let me know if it is still breaking. Thanks, James - 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/3] tcp: remove experimental variants from default list
* Stephen Hemminger <[EMAIL PROTECTED]> [070212 18:04]: > The TCP Vegas implementation is buggy, and BIC is too agressive > so they should not be in the default list. Westwood is okay, but > not well tested. Since no one really agrees on the relative merits and problems of the different algorithms and since the users themselves dont know, dont care and have no clue on what should be the correct behaviour to report bugs (see the old bic bugs, the htcp bugs, the recent sack bugs) I would suggest to avoid making the whole internet a guinea pig and get back to reno. If someone really needs to push high BDP flows he should test it himself and choose what works for his kernel at the time. For myself and anyone who asks me I recommend to set the default to reno. For the few who really need high speed flows, they should test kernel and protocol combination. Baruch - 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] 2.6.20 Oopses in xfrm_audit_log
[removing l-k from CC, and switching to netdev] Please, send your .config. Is it reproducible? On Mon, Feb 12, 2007 at 03:16:04PM +0100, Charles-Edouard Ruault wrote: > i upgraded to vanilla kernel 2.6.20 and while i was using strongswan > 2.8.2 to setup an IPSEC VPN i got the following kernel Ooops. > I had successfully established the same tunnel a few times, but key > renegotiation caused a problem ( both ends did not renegotiate at the > same time so the tunnel was frozen ), i decided to kill the tunnel and > start a new one ( using ipsec auto --down tunnel & ipsec auto --up > tunnel ), while i was doing so, i got the oops. > > BUG: unable to handle kernel NULL pointer dereference at virtual address > 0188 > printing eip: > c02fb85c > *pde = > Oops: [#1] > PREEMPT > Modules linked in: xfrm4_mode_tunnel usblp deflate zlib_deflate twofish > twofish_common serpent blowfish des cbc ecb blkcipher xcbc sha256 sha1 > crypto_null xfrm4_tunnel tunnel4 ipcomp esp4 ah4 af_key autofs4 asb100 > hwmon_vid hidp rfcomm l2cap bluetooth sunrpc nf_conntrack_netbios_ns > ipt_LOG xt_limit xt_mark xt_state xt_tcpudp iptable_filter > ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 xt_MARK > iptable_mangle ip_tables x_tables binfmt_misc sd_mod ipv6 sg hfsplus > video button ac lp parport_pc parport floppy nvram usb_storage scsi_mod > libusual usbhid hid ehci_hcd snd_via82xx snd_ac97_codec ac97_bus > ohci1394 snd_seq_dummy uhci_hcd ieee1394 snd_seq_oss snd_seq_midi_event > snd_seq snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc > snd_mpu401_uart snd_rawmidi snd_seq_device snd via_agp agpgart > i2c_viapro soundcore eepro100 i2c_core b44 pcspkr mii shpchp usbcore dm_mod > CPU:0 > EIP:0060:[]Not tainted VLI > EFLAGS: 00010246 (2.6.20 #1) > EIP is at xfrm_audit_log+0x4cc/0x580 > eax: ecb71061 ebx: c039d160 ecx: edx: 0021 > esi: 01f4 edi: 0255 ebp: esp: e8cd5a18 > ds: 007b es: 007b ss: 0068 > Process pluto (pid: 27486, ti=e8cd4000 task=d3557070 task.ti=e8cd4000) > Stack: c17d2ea0 c0354bf1 e183f9c0 0003 c03ac59c e1399800 0001 > 0003 > f8d0a450 0001 0286 e8cd5a6c c011506b > 0286 > f73cb8c0 0246 c17d2ea0 f73cb8c0 f8d03c67 > > Call Trace: > [] __wake_up+0x4b/0x80 > [] pfkey_broadcast+0x137/0x1b0 [af_key] > [] pfkey_send_policy_notify+0xef/0x1a0 [af_key] > [] local_bh_enable+0x2e/0xa0 > [] xfrm_get_policy+0x2b7/0x2f0 > [] xfrm_get_policy+0x0/0x2f0 > [] xfrm_user_rcv_msg+0x102/0x1b0 > [] xfrm_user_rcv_msg+0x0/0x1b0 > [] netlink_run_queue+0x82/0x120 > [] xfrm_netlink_rcv+0x28/0x40 > [] netlink_data_ready+0x12/0x50 > [] netlink_sendskb+0x21/0x40 > [] netlink_sendmsg+0x230/0x310 > [] sock_aio_write+0x11d/0x130 > [] avc_has_perm+0x5a/0x70 > [] do_sync_write+0xd5/0x120 > [] autoremove_wake_function+0x0/0x50 > [] vfs_write+0x177/0x180 > [] sys_write+0x41/0x70 > [] syscall_call+0x7/0xb > === > Code: 8b 44 24 70 c1 e2 08 c1 e8 08 09 c2 0f b7 c2 89 44 24 08 8b 44 24 > 48 89 04 24 e8 10 eb e3 ff e9 bc fc ff ff 8b 8c 24 c0 00 00 00 <8b> 91 > 88 01 00 00 0f b7 99 82 00 00 00 85 d2 0f 85 64 fc ff ff > EIP: [] xfrm_audit_log+0x4cc/0x580 SS:ESP 0068:e8cd5a18 > > I'm running a vanilla 2.6.20 kernel on a Fedora Core 5 box on an athlon > processor: > cat /proc/cpuinfo > processor : 0 > vendor_id : AuthenticAMD > cpu family : 6 > model : 8 > model name : AMD Athlon(TM) XP 2400+ > stepping: 1 > cpu MHz : 2000.256 > cache size : 256 KB > fdiv_bug: no > hlt_bug : no > f00f_bug: no > coma_bug: no > fpu : yes > fpu_exception : yes > cpuid level : 1 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge > mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow ts > bogomips: 4003.78 > clflush size: 32 > > uname -a > Linux machine 2.6.20 #1 PREEMPT Sat Feb 10 13:48:56 CET 2007 i686 athlon > i386 GNU/Linux > > Please CC me in follow ups since i do not subscribe to the list. - 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][NET][BRIDGE] br_if: oops in port_carrier_check
On Mon, 12 Feb 2007 11:28:48 +0100 Jarek Poplawski <[EMAIL PROTECTED]> wrote: > Here is my patch proposal for testing. > If it doesn't work - forget about it. > (Prepared with 2.6.20-git6 but could > be applied to 2.6.20 also.) > > Jarek P. > > > dev_hold/dev_put added to prevent dev kfree > during port_carrier_check runnig, while dev > and port are removed. No, holding the reference just stops the kfree, it doesn't stop the device from being removed from the port. - 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: [Bugme-new] [Bug 7952] New: slattach only works every other time
On Mon, 12 Feb 2007 09:36:09 +0100 Jarek Poplawski <[EMAIL PROTECTED]> wrote: > On 06-02-2007 22:57, Andrew Morton wrote: > ... > > First time slattach is run to set up a SLIP line all is ok. > > If slattach process is then killed and restarted it fails with message: > > SLIP_set_disc(1): File exists > > Problem still occurs in 2.6.20rc6 kernel > > > > dmesg shows: > > object_add failed for sl0 with -EEXIST, don't try to register things > > with the same name in the same directory. > > [] kobject_add+0x147/0x16d > > [] class_device_add+0x9d/0x3b3 > > [] register_netdevice+0x21a/0x2d0 > > [] slip_open+0x3a1/0x4e2 [slip] > > [] tty_ioctl+0x922/0xbac > ... > > Steps to reproduce: > > (requires a serial port but nothing needs to be attached to it): > > # slattach -L -vd -p slip -s 115200 /dev/ttyS0 > ... > > slip started on /dev/ttyS0 interface sl0 > > > > Above is OK, now kill process with CTRL-C > > > > slattach: tty_set_speed: 0 > > # slattach -L -vd -p slip -s 115200 /dev/ttyS0 > ... > > SLIP_set_disc(1): File exists > ... > > I believe this is called by this changeset : > > http://www2.kernel.org/git/?p=linux/kernel/git/stable/linux-2.6.17.y.git;a=commit;h=b17a7c179dd3ce7d04373fddf660eda21efc9db9 > > I think Martin is probably right here. > > It would be useful to check if time has anything to do > with this and wait longer (e.g. >= 1 min.) before the > second slattach. > > Anyway, even if there is some other reason, the above > trace shows (IMHO) some inconsistency in register/ > unregister_netdevice: if class_device_add is reached > it means the name is valid (so was unregistered) and > EEXIST from netdev_register_sysfs is wrong about the > state of this device. So maybe there should be some > warning plus some delayed action instead of register > cancelled? > > Regards, > Jarek P. The problem is that the code in sl_alloc() tries to clear out an net device by calling unregister_netdevice(), the device won't actually disappear until after rtnl_unlock. This whole idea of searching for unused devices is racy crap and needs to go. - 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: [take35 0/10] kevent: Generic event handling mechanism.
> On Mon, 12 Feb 2007 13:35:10 +0300 Evgeniy Polyakov <[EMAIL PROTECTED]> wrote: > Andrew, do you consider kevent for inclusion or declining? I haven't had time to think about it in the past month or two, sorry. However we might as well get it back in there for review-and-test - please send a new patchset once 2.6.21-rc1 is released and copy me on it? - 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: [ipw3945-devel] [ANNOUNCE] d80211 based driver for Intel PRO/Wireless 3945ABG
Hesse, Christian wrote: On Saturday 10 February 2007 14:23, Hesse, Christian wrote: On Friday 09 February 2007 22:12, James Ketrenos wrote: We are pleased to announce the availability of a new driver for the Intel PRO/Wireless 3945ABG Network Connection adapter. Wow, great news on this rainy saturday! ;-) The driver works perfectly, I'm writing this mail via wireless link. However there are two things to note: The driver generates two network devices. The second one is for promicious mode? Is there any chance to disable the interface? ifrename renamed the wrong one to wlan0 and I had to tell my system to use eth1 for the wireless connection. Second problem is that I can't unload the module. I get the message "FATAL: Module iwlwifi is in use." even if both interfaces are down. Oh, I forgot one note: "make patch_kernel" is terribly broken. Any chance to get this fixed soon? confirmed on my box it resulted in deleting all kernel modules. (had to reinstall the kernel) (make modules in /lib/modules/`uname -r`/build after make patch_kernel) this was on fc6 x86_64 - 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 1/3] tcp: cleanup of htcp
Minor non-invasive cleanups: * white space around operators and line wrapping * use const * use __read_mostly Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> --- net/ipv4/tcp_htcp.c | 69 +--- 1 file changed, 39 insertions(+), 30 deletions(-) --- tcp.orig/net/ipv4/tcp_htcp.c2007-02-09 20:23:35.0 -0800 +++ tcp/net/ipv4/tcp_htcp.c 2007-02-12 07:25:56.0 -0800 @@ -10,22 +10,23 @@ #include #include -#define ALPHA_BASE (1<<7) /* 1.0 with shift << 7 */ -#define BETA_MIN (1<<6) /* 0.5 with shift << 7 */ +#define ALPHA_BASE (1<<7) /* 1.0 with shift << 7 */ +#define BETA_MIN (1<<6) /* 0.5 with shift << 7 */ #define BETA_MAX 102 /* 0.8 with shift << 7 */ -static int use_rtt_scaling = 1; +static int use_rtt_scaling __read_mostly = 1; module_param(use_rtt_scaling, int, 0644); MODULE_PARM_DESC(use_rtt_scaling, "turn on/off RTT scaling"); -static int use_bandwidth_switch = 1; +static int use_bandwidth_switch __read_mostly = 1; module_param(use_bandwidth_switch, int, 0644); MODULE_PARM_DESC(use_bandwidth_switch, "turn on/off bandwidth switcher"); struct htcp { u32 alpha; /* Fixed point arith, << 7 */ u8 beta; /* Fixed point arith, << 7 */ - u8 modeswitch; /* Delay modeswitch until we had at least one congestion event */ + u8 modeswitch; /* Delay modeswitch + until we had at least one congestion event */ u16 pkts_acked; u32 packetcount; u32 minRTT; @@ -44,14 +45,14 @@ u32 lasttime; }; -static inline u32 htcp_cong_time(struct htcp *ca) +static inline u32 htcp_cong_time(const struct htcp *ca) { return jiffies - ca->last_cong; } -static inline u32 htcp_ccount(struct htcp *ca) +static inline u32 htcp_ccount(const struct htcp *ca) { - return htcp_cong_time(ca)/ca->minRTT; + return htcp_cong_time(ca) / ca->minRTT; } static inline void htcp_reset(struct htcp *ca) @@ -67,10 +68,12 @@ { const struct tcp_sock *tp = tcp_sk(sk); struct htcp *ca = inet_csk_ca(sk); + ca->last_cong = ca->undo_last_cong; ca->maxRTT = ca->undo_maxRTT; ca->old_maxB = ca->undo_old_maxB; - return max(tp->snd_cwnd, (tp->snd_ssthresh<<7)/ca->beta); + + return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta); } static inline void measure_rtt(struct sock *sk) @@ -78,17 +81,19 @@ const struct inet_connection_sock *icsk = inet_csk(sk); const struct tcp_sock *tp = tcp_sk(sk); struct htcp *ca = inet_csk_ca(sk); - u32 srtt = tp->srtt>>3; + u32 srtt = tp->srtt >> 3; /* keep track of minimum RTT seen so far, minRTT is zero at first */ if (ca->minRTT > srtt || !ca->minRTT) ca->minRTT = srtt; /* max RTT */ - if (icsk->icsk_ca_state == TCP_CA_Open && tp->snd_ssthresh < 0x && htcp_ccount(ca) > 3) { + if (icsk->icsk_ca_state == TCP_CA_Open + && tp->snd_ssthresh < 0x && htcp_ccount(ca) > 3) { if (ca->maxRTT < ca->minRTT) ca->maxRTT = ca->minRTT; - if (ca->maxRTT < srtt && srtt <= ca->maxRTT+msecs_to_jiffies(20)) + if (ca->maxRTT < srtt + && srtt <= ca->maxRTT + msecs_to_jiffies(20)) ca->maxRTT = srtt; } } @@ -116,15 +121,16 @@ ca->packetcount += pkts_acked; - if (ca->packetcount >= tp->snd_cwnd - (ca->alpha>>7? : 1) - && now - ca->lasttime >= ca->minRTT - && ca->minRTT > 0) { - __u32 cur_Bi = ca->packetcount*HZ/(now - ca->lasttime); + if (ca->packetcount >= tp->snd_cwnd - (ca->alpha >> 7 ? : 1) + && now - ca->lasttime >= ca->minRTT + && ca->minRTT > 0) { + __u32 cur_Bi = ca->packetcount * HZ / (now - ca->lasttime); + if (htcp_ccount(ca) <= 3) { /* just after backoff */ ca->minB = ca->maxB = ca->Bi = cur_Bi; } else { - ca->Bi = (3*ca->Bi + cur_Bi)/4; + ca->Bi = (3 * ca->Bi + cur_Bi) / 4; if (ca->Bi > ca->maxB) ca->maxB = ca->Bi; if (ca->minB > ca->maxB) @@ -142,7 +148,7 @@ u32 old_maxB = ca->old_maxB; ca->old_maxB = ca->maxB; - if (!between(5*maxB, 4*old_maxB, 6*old_maxB)) { + if (!between(5 * maxB, 4 * old_maxB, 6 * old_maxB)) { ca->beta = BETA_MIN; ca->modeswitch = 0; return; @@ -150,7 +156,7 @@ } if (ca->modeswitch && minRTT > msecs_to_jiffies(10) && maxRTT) { - ca->beta = (minRTT<<7)/ma
[patch 3/3] tcp: remove experimental variants from default list
The TCP Vegas implementation is buggy, and BIC is too agressive so they should not be in the default list. Westwood is okay, but not well tested. Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> --- net/ipv4/Kconfig | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) --- tcp.orig/net/ipv4/Kconfig 2007-02-12 07:58:28.0 -0800 +++ tcp/net/ipv4/Kconfig2007-02-12 08:00:22.0 -0800 @@ -581,21 +581,12 @@ Select the TCP congestion control that will be used by default for all connections. - config DEFAULT_BIC - bool "Bic" if TCP_CONG_BIC=y - config DEFAULT_CUBIC bool "Cubic" if TCP_CONG_CUBIC=y config DEFAULT_HTCP bool "Htcp" if TCP_CONG_HTCP=y - config DEFAULT_VEGAS - bool "Vegas" if TCP_CONG_VEGAS=y - - config DEFAULT_WESTWOOD - bool "Westwood" if TCP_CONG_WESTWOOD=y - config DEFAULT_RENO bool "Reno" @@ -603,6 +594,7 @@ endif +# This sets the default value for those who do not choose advanced menu config TCP_CONG_CUBIC tristate depends on !TCP_CONG_ADVANCED -- - 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 0/3] TCP trivial patches
Minor changes for 2.6.21 -- - 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 2/3] tcp: use read mostly for CUBIC parameters
These module parameters should be in the read mostly area to avoid cache pollution. Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> --- net/ipv4/tcp_cubic.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) --- tcp.orig/net/ipv4/tcp_cubic.c 2007-02-12 07:28:55.0 -0800 +++ tcp/net/ipv4/tcp_cubic.c2007-02-12 07:32:33.0 -0800 @@ -26,16 +26,16 @@ */ #defineBICTCP_HZ 10 /* BIC HZ 2^10 = 1024 */ -static int fast_convergence = 1; -static int max_increment = 16; -static int beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ -static int initial_ssthresh = 100; -static int bic_scale = 41; -static int tcp_friendliness = 1; - -static u32 cube_rtt_scale; -static u32 beta_scale; -static u64 cube_factor; +static int fast_convergence __read_mostly = 1; +static int max_increment __read_mostly = 16; +static int beta __read_mostly = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ +static int initial_ssthresh __read_mostly = 100; +static int bic_scale __read_mostly = 41; +static int tcp_friendliness __read_mostly = 1; + +static u32 cube_rtt_scale __read_mostly; +static u32 beta_scale __read_mostly; +static u64 cube_factor __read_mostly; /* Note parameters that are used for precomputing scale factors are read-only */ module_param(fast_convergence, int, 0644); -- - 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] [XFRM] AUDIT: Fix audit buffer leakage in error path.
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]> diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index b7e537f..af85ac9 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1999,7 +1999,7 @@ void xfrm_audit_log(uid_t auid, u32 sid, int type, int result, audit_buf = audit_log_start(current->audit_context, GFP_ATOMIC, type); if (audit_buf == NULL) - return; + return; switch(type) { case AUDIT_MAC_IPSEC_ADDSA: @@ -2015,7 +2015,7 @@ void xfrm_audit_log(uid_t auid, u32 sid, int type, int result, audit_log_format(audit_buf, "SPD delete: auid=%u", auid); break; default: - return; + goto out; } if (sid != 0 && @@ -2085,6 +2085,7 @@ void xfrm_audit_log(uid_t auid, u32 sid, int type, int result, "ESP" : "IPCOMP")); audit_log_format(audit_buf, " res=%u", result); +out: audit_log_end(audit_buf); } -- YOSHIFUJI Hideaki @ USAGI Project <[EMAIL PROTECTED]> GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA - 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: [take35 0/10] kevent: Generic event handling mechanism.
Evgeniy Polyakov wrote: > I think that mean that everybody is happy with APi, design and set of > features. No comment means that I still have not been able to test anything since regardless of what version I tried, it failed to build. -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ signature.asc Description: OpenPGP digital signature
Re: Missing csum_fold() in ip6t_HL.c ?
In article <[EMAIL PROTECTED]> (at Mon, 12 Feb 2007 15:52:13 +0100), Patrick McHardy <[EMAIL PROTECTED]> says: > This already is taken care of. I noticed our listmaster didn't > approve any held messages for a couple of month and am currently > going through the backlog (Alexey's mail is quite old). Argh, okay. Thanks. --yoshfuji - 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: Missing csum_fold() in ip6t_HL.c ?
In article <[EMAIL PROTECTED]> (at Fri, 15 Sep 2006 14:37:56 +0400), Alexey Dobriyan <[EMAIL PROTECTED]> says: > It looks like "diffs" array is write-only. It also looks like ipv4 > occurences use some csum_fold() trickery. Was is forgotten here? Should > "diffs" be removed? Since we do not have checksum in IPv6 header, we do not need to adjust checksum when we touch hoplimit. So, just removing it should be safe. --yoshfuji - 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: [take36 10/10] kevent: Kevent based generic AIO.
On Mon, Feb 12, 2007 at 01:12:57PM +, Alan ([EMAIL PROTECTED]) wrote: > > I'm sure others would want them then for their favourite system call combo > > too. If they were really useful it might make more sense to have a batch() > > system call that works for arbitary calls, but I'm not convinced yet > > it's even needed. It would be certainly ugly. > > batch() would possibly make a lot of sense in terms of the fibril/thread > based removal for the need for all the AIO stuff, just to provide a > natural way to group and order sequences of synchronous operations into > asynchronous groups. > > I am extremely sceptical about the need for aio_sendfile_path since with > sendfile/sendpath hacking around there didn't seem to be much gain. > > I'm even more sceptical of the header buffer stuff as while other OS's do > that as a hack to make TCP packetising work we simply fixed the root > problem with TCP_CORK Well, that does not matter that much - that syscall is an example of how kevent AIO state machine works - it trivially allows to have async open/send/sendfile/close like aio_senfile_path. I would remove header too (it was not there in the first release, added on request), but the whole idea of async open/send/close seems natural for web-like workloads, when user should not even care about proper state machine. Having batch() mode would be good too - with kevent state machine it is quite trivially: req = kaio_add_call(NULL, first_call) kaio_append_call(req, second_call); kaio_append_call(req, third_call); ... kaio_schedule_req(req); Yes, state machine handling requires additional code, but when it ends up in faster processing implementation complexities deserve its price. > Alan -- 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
Re: [take36 10/10] kevent: Kevent based generic AIO.
> I'm sure others would want them then for their favourite system call combo > too. If they were really useful it might make more sense to have a batch() > system call that works for arbitary calls, but I'm not convinced yet > it's even needed. It would be certainly ugly. batch() would possibly make a lot of sense in terms of the fibril/thread based removal for the need for all the AIO stuff, just to provide a natural way to group and order sequences of synchronous operations into asynchronous groups. I am extremely sceptical about the need for aio_sendfile_path since with sendfile/sendpath hacking around there didn't seem to be much gain. I'm even more sceptical of the header buffer stuff as while other OS's do that as a hack to make TCP packetising work we simply fixed the root problem with TCP_CORK Alan - 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] dm9000: do not kfree() netdevice
The DM9000 network driver is calling kfree() on an netdev causing the system to oops if the probe fails. The right thing to do is call free_netdev(). Thanks to Russell King for spotting this. Signed-off-by: Ben Dooks <[EMAIL PROTECTED]> diff -urpN -X ../dontdiff linux-2.6.20/drivers/net/dm9000.c linux-2.6.20-dmfix/drivers/net/dm9000.c --- linux-2.6.20/drivers/net/dm9000.c 2007-02-04 18:44:54.0 + +++ linux-2.6.20-dmfix/drivers/net/dm9000.c 2007-02-12 12:01:22.0 + @@ -601,7 +601,7 @@ dm9000_probe(struct platform_device *pde printk("%s: not found (%d).\n", CARDNAME, ret); dm9000_release_board(pdev, db); - kfree(ndev); + free_netdev(ndev); return ret; } @@ -1194,7 +1194,7 @@ dm9000_drv_remove(struct platform_device unregister_netdev(ndev); dm9000_release_board(pdev, (board_info_t *) ndev->priv); - kfree(ndev);/* free device structure */ + free_netdev(ndev); /* free device structure */ PRINTK1("clean_module() exit\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
[PATCH 1/1] NetXen: Fix to get the driver working after sparse changes
Signed-off-by: Amit S. Kale <[EMAIL PROTECTED]> --- netxen_nic.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index e021a30..2807ef4 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h @@ -252,7 +252,7 @@ typedef u32 netxen_ctx_msg; #define netxen_set_msg_ctxid(config_word, val) \ ((config_word) &= ~(0x3ff<<18), (config_word) |= (val & 0x3ff) << 18) #define netxen_set_msg_opcode(config_word, val)\ - ((config_word) &= ~(0xf<<24), (config_word) |= (val & 0xf) << 24) + ((config_word) &= ~(0xf<<28), (config_word) |= (val & 0xf) << 28) struct netxen_rcv_context { __le64 rcv_ring_addr; @@ -303,14 +303,14 @@ struct netxen_ring_ctx { (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f)) #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \ - (cmd_desc)->flags_opcode |= cpu_to_le16((val) & (0x3f<<7))) + (cmd_desc)->flags_opcode |= cpu_to_le16(((val & 0x3f)<<7))) #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \ (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff)) #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ - ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \ - (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 24)) + ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff00), \ + (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 8)) #define netxen_get_cmd_desc_opcode(cmd_desc) \ ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F) - 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: [take36 10/10] kevent: Kevent based generic AIO.
On Mon, Feb 12, 2007 at 02:08:10PM +0100, Andi Kleen ([EMAIL PROTECTED]) wrote: > Evgeniy Polyakov <[EMAIL PROTECTED]> writes: > > > > aio_sendfile_path() is essentially aio_sendfile(), except that it takes > > source filename as parameter, has a pointer to private header > > and its size (which allows to send header and file's content in one syscall > > instead of three (open, send, sendfile) and returns opened file descriptor. > > Are you sure this is a useful optimization? Do you have numbers vs > open+aio_sendfile+close? > > Compared to the cost of sending a complete file three system calls should be > quite in the noise. > And Linux system calls are not that expensive (few hundred cycles normally) > > Adding such compound system calls would be a worrying precedent because > I'm sure others would want them then for their favourite system call combo > too. If they were really useful it might make more sense to have a batch() > system call that works for arbitary calls, but I'm not convinced yet > it's even needed. It would be certainly ugly. Yes, that call ends up about 10MB/sec faster for 100 1mb file transfers over 1gbit network (78 MB/s vs 66-72 MB/s over 1 Gb network, sendfile sending server is one-way AMD Athlong 64 3500+), but indeed, it can be the case that async IO sending was main speed factor. I added header by request from Suparna Bhattacharya - my main position is the same about syscall overhead, but I do not that care. > -Andi -- 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
Re: [take36 10/10] kevent: Kevent based generic AIO.
Evgeniy Polyakov <[EMAIL PROTECTED]> writes: > > aio_sendfile_path() is essentially aio_sendfile(), except that it takes > source filename as parameter, has a pointer to private header > and its size (which allows to send header and file's content in one syscall > instead of three (open, send, sendfile) and returns opened file descriptor. Are you sure this is a useful optimization? Do you have numbers vs open+aio_sendfile+close? Compared to the cost of sending a complete file three system calls should be quite in the noise. And Linux system calls are not that expensive (few hundred cycles normally) Adding such compound system calls would be a worrying precedent because I'm sure others would want them then for their favourite system call combo too. If they were really useful it might make more sense to have a batch() system call that works for arbitary calls, but I'm not convinced yet it's even needed. It would be certainly ugly. -Andi - 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/5] Add PCBC crypto template support
David Miller <[EMAIL PROTECTED]> wrote: > > Thanks. However, I'll continue to include the patches in my set until they > > reach Linus's tree. > > They are in Linus's tree. Yay! - 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
[take36 5/10] kevent: Timer notifications.
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
[take36 8/10] kevent: Kevent posix timer notifications.
Kevent posix timer notifications. Simple extension 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 5fe87de..5ec805e 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 to
[take36 4/10] kevent: Socket notifications.
Socket notifications. This patch includes socket send/recv/accept notifications. Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]> diff --git a/fs/inode.c b/fs/inode.c index bf21dc6..82817b1 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 = NULL; 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 03684e7..d840399 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -49,6 +49,7 @@ #include /* struct sk_buff */ #include #include +#include #include @@ -451,6 +452,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; @@ -478,6 +494,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 cd8fa0c..7344d61 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -864,6 +864,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..d1a2701 --- /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)->ops->poll(SOCKET_I(inode)->file, SOCKET_I(inode), NULL); + + if ((events & (POLLIN | POLLRDNORM)) && (k->event.event & (KEVENT_SOCKET_RECV | KEVENT_SOCKET_ACCEPT))) + return 1; + if ((events & (POLLOUT | POL
[take36 9/10] kevent: Private userspace notifications.
Private userspace notifications. Allows to register notifications of any private userspace events over kevent. Events can be marked as ready using kevent_ctl(KEVENT_READY) command. Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]> diff --git a/kernel/kevent/kevent_unotify.c b/kernel/kevent/kevent_unotify.c new file mode 100644 index 000..618c09c --- /dev/null +++ b/kernel/kevent/kevent_unotify.c @@ -0,0 +1,62 @@ +/* + * 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 + +static int kevent_unotify_callback(struct kevent *k) +{ + return 1; +} + +int kevent_unotify_enqueue(struct kevent *k) +{ + int err; + + err = kevent_storage_enqueue(&k->user->st, k); + if (err) + goto err_out_exit; + + if (k->event.req_flags & KEVENT_REQ_ALWAYS_QUEUE) + kevent_requeue(k); + + return 0; + +err_out_exit: + return err; +} + +int kevent_unotify_dequeue(struct kevent *k) +{ + kevent_storage_dequeue(k->st, k); + return 0; +} + +static int __init kevent_init_unotify(void) +{ + struct kevent_callbacks sc = { + .callback = &kevent_unotify_callback, + .enqueue = &kevent_unotify_enqueue, + .dequeue = &kevent_unotify_dequeue, + .flags = 0, + }; + + return kevent_add_callbacks(&sc, KEVENT_UNOTIFY); +} +module_init(kevent_init_unotify); - 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
[take36 10/10] kevent: Kevent based generic AIO.
Kevent based generic AIO. This patch only implements network AIO, which is _COMPLETELY_ impossible and broken in _ANY_ micro-thread design. For details and test consider following link: http://tservice.net.ru/~s0mbre/blog/2007/02/10#2007_02_10 Designing AIO without network in mind can only be result of heavy hang-over. Kevent AIO is implemented as state machine. There is a patch which implements async open/send_header/sendfile/close. aio_sendfile()/aio_sendfile_path() contains of two major parts: AIO state machine and page processing code. The former is just a small subsystem, which allows to queue callback for theirs invocation in process' context on behalf of pool of kernel threads. It allows to queue caches of callbacks to the local thread or to any other specified. Each cache of callbacks is processed until there are callbacks in it, callbacks can requeue themselfs into the same cache. Real work is being done in page processing code - code which populates pages into VFS cache and then sends pages to the destination socket via ->sendpage(). Unlike previous aio_sendfile() implementation, new one does not require low-level filesystem specific callbacks (->get_block()) at all, instead I extended struct address_space_operations to contain new member called ->aio_readpages(), which is exactly the same as ->readpage() (read: mpage_readpages()) except different BIO allocation and sumbission routines. I changed mpage_readpages() to provide mpage_alloc() and mpage_bio_submit() to the new function called __mpage_readpages(), which is exactly old mpage_readpages() with provided callback invocation instead of usage for old functions. mpage_readpages_aio() provides kevent specific callbacks, which calls old functions, but with different destructor callbacks, which are essentially the same, except that they reschedule AIO processing. aio_sendfile_path() is essentially aio_sendfile(), except that it takes source filename as parameter, has a pointer to private header and its size (which allows to send header and file's content in one syscall instead of three (open, send, sendfile) and returns opened file descriptor. Benchmark of the 100 1MB files transfer (files are in VFS already) using sync sendfile() against aio_sendfile_path() shows about 10MB/sec performance win (78 MB/s vs 66-72 MB/s over 1 Gb network, sendfile sending server is one-way AMD Athlong 64 3500+) for aio_sendfile_path(). AIO state machine is a base for network AIO (which becomes quite trivial), but I will not start implementation until roadback of kevent as a whole and AIO implementation become more clear. Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]> diff --git a/fs/bio.c b/fs/bio.c index 7618bcb..291e7e8 100644 --- a/fs/bio.c +++ b/fs/bio.c @@ -120,7 +120,7 @@ void bio_free(struct bio *bio, struct bio_set *bio_set) /* * default destructor for a bio allocated with bio_alloc_bioset() */ -static void bio_fs_destructor(struct bio *bio) +void bio_fs_destructor(struct bio *bio) { bio_free(bio, fs_bio_set); } diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index beaf25f..f08c957 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -1650,6 +1650,13 @@ ext3_readpages(struct file *file, struct address_space *mapping, return mpage_readpages(mapping, pages, nr_pages, ext3_get_block); } +static int +ext3_readpages_aio(struct file *file, struct address_space *mapping, + struct list_head *pages, unsigned nr_pages, void *priv) +{ + return mpage_readpages_aio(mapping, pages, nr_pages, ext3_get_block, priv); +} + static void ext3_invalidatepage(struct page *page, unsigned long offset) { journal_t *journal = EXT3_JOURNAL(page->mapping->host); @@ -1768,6 +1775,7 @@ static int ext3_journalled_set_page_dirty(struct page *page) } static const struct address_space_operations ext3_ordered_aops = { + .aio_readpages = ext3_readpages_aio, .readpage = ext3_readpage, .readpages = ext3_readpages, .writepage = ext3_ordered_writepage, diff --git a/fs/mpage.c b/fs/mpage.c index 692a3e5..e5ba44b 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -102,7 +102,7 @@ static struct bio *mpage_bio_submit(int rw, struct bio *bio) static struct bio * mpage_alloc(struct block_device *bdev, sector_t first_sector, int nr_vecs, - gfp_t gfp_flags) + gfp_t gfp_flags, void *priv) { struct bio *bio; @@ -116,6 +116,7 @@ mpage_alloc(struct block_device *bdev, if (bio) { bio->bi_bdev = bdev; bio->bi_sector = first_sector; + bio->bi_private = priv; } return bio; } @@ -175,7 +176,10 @@ map_buffer_to_page(struct page *page, struct buffer_head *bh, int page_block) static struct bio * do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages, sector_t *last_block_in_bio, struct buffer_head *map_bh, -
[take36 7/10] kevent: Signal notifications.
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 4463735..e7372f2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -82,6 +82,7 @@ struct sched_param { #include #include #include +#include #include #include @@ -1048,6 +1049,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 #ifdef CONFIG_FAULT_INJECTION int make_it_fail; #endif diff --git a/kernel/fork.c b/kernel/fork.c index fc723e5..fd7c749 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -118,6 +119,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); @@ -1126,6 +1130,10 @@ static struct task_struct *copy_process(unsigned long clone_flags, if (retval) goto bad_fork_cleanup_namespaces; +#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 5630255..f12ebc0 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -23,6 +23,7 @@ #include #include
[take36 1/10] kevent: Description.
Description. diff --git a/Documentation/kevent.txt b/Documentation/kevent.txt new file mode 100644 index 000..d6e126f --- /dev/null +++ b/Documentation/kevent.txt @@ -0,0 +1,271 @@ +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
[take36 3/10] kevent: poll/select() notifications.
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 4c17a18..46f458c 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 1410e53..24f605c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -280,6 +280,7 @@ extern int dir_notify_enable; #include #include #include +#include #include #include @@ -408,6 +409,8 @@ struct address_space_operations { int (*readpages)(struct file *filp, struct address_space *mapping, struct list_head *pages, unsigned nr_pages); + int (*aio_readpages)(struct file *filp, struct address_space *mapping, + struct list_head *pages, unsigned nr_pages, void *priv); /* * ext3 requires that a successful prepare_write() call be followed @@ -579,6 +582,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 */ @@ -738,6 +745,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..58129fa --- /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 struct kmem_cache *kevent_poll_container_cache; +static struct kmem_cache *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_fu
[take36 6/10] kevent: Pipe notifications.
Pipe notifications. diff --git a/fs/pipe.c b/fs/pipe.c index 68090e8..0c75bf1 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -313,6 +314,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); } @@ -322,6 +324,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); } @@ -484,6 +487,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; @@ -495,6 +499,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); } @@ -590,6 +595,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) +{ +
Re: [take35 0/10] kevent: Generic event handling mechanism.
On Mon, Feb 05, 2007 at 05:23:36PM +0300, Evgeniy Polyakov ([EMAIL PROTECTED]) wrote: > On Thu, Feb 01, 2007 at 01:12:30PM +0300, Evgeniy Polyakov ([EMAIL > PROTECTED]) wrote: > > > > 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. > > > > P.S. If you want to be removed from Cc: list just drop me a mail. > > > > Changes from 'take34' patchset: > > * Ported to the 2.6.20-rc7 (9be5b038b1c9d1927c367bf91683458e10d5d4eb) tree. > > Is there some progress? > Some things to be implemented, described or discussed? I think that mean that everybody is happy with APi, design and set of features. Andrew, do you consider kevent for inclusion or declining? -- 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
[PATCH][NET][BRIDGE] br_if: oops in port_carrier_check
Here is my patch proposal for testing. If it doesn't work - forget about it. (Prepared with 2.6.20-git6 but could be applied to 2.6.20 also.) Jarek P. dev_hold/dev_put added to prevent dev kfree during port_carrier_check runnig, while dev and port are removed. Submitted and tested by: Pascal Terjan <[EMAIL PROTECTED]> Signed-off-by: Jarek Poplawski <[EMAIL PROTECTED]> --- diff -Nurp linux-2.6.20-git6-/net/bridge/br_if.c linux-2.6.20-git6/net/bridge/br_if.c --- linux-2.6.20-git6-/net/bridge/br_if.c 2007-02-12 10:20:14.0 +0100 +++ linux-2.6.20-git6/net/bridge/br_if.c2007-02-12 10:36:58.0 +0100 @@ -108,6 +108,7 @@ static void port_carrier_check(struct wo spin_unlock_bh(&br->lock); } done: + dev_put(dev); rtnl_unlock(); } @@ -161,7 +162,8 @@ static void del_nbp(struct net_bridge_po dev_set_promiscuity(dev, -1); - cancel_delayed_work(&p->carrier_check); + if (cancel_delayed_work(&p->carrier_check)) + dev_put(dev); spin_lock_bh(&br->lock); br_stp_disable_port(p); @@ -444,7 +446,9 @@ int br_add_if(struct net_bridge *br, str spin_lock_bh(&br->lock); br_stp_recalculate_bridge_id(br); br_features_recompute(br); - schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); + if (schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE)) + dev_hold(dev); + spin_unlock_bh(&br->lock); dev_set_mtu(br->dev, br_min_mtu(br)); - 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: NetXen driver name
On Monday 12 February 2007 13:59, Al Viro wrote: > On Mon, Feb 12, 2007 at 09:12:56AM +0100, Andi Kleen wrote: > > On Monday 12 February 2007 09:03, Amit Kale wrote: > > > The already released kernel contains a broken driver. It broke due to > > > some code rearrangement changes someone submitted to fix sparse > > > warnings. > > s/sparse warnings/breakage on big-endian boxen/, actually. This stuff > was sent to netdev tree and sat there for a while. Pity if some breakage > occured and went unnoticed; could you give more details? We were in middle of other changes last week. Here it is. This is FYI only. We'll send a set of patches with this change as well as some other in a short time. diff -Narup not_working/netxen/netxen_nic.h got_working/netxen/netxen_nic.h --- not_working/netxen/netxen_nic.h 2007-02-08 23:20:34.468721000 -0800 +++ got_working/netxen/netxen_nic.h 2007-02-08 23:19:44.526769000 -0800 @@ -252,7 +252,7 @@ typedef u32 netxen_ctx_msg; #define netxen_set_msg_ctxid(config_word, val) \ ((config_word) &= ~(0x3ff<<18), (config_word) |= (val & 0x3ff) << 18) #define netxen_set_msg_opcode(config_word, val)\ - ((config_word) &= ~(0xf<<24), (config_word) |= (val & 0xf) << 24) + ((config_word) &= ~(0xf<<28), (config_word) |= (val & 0xf) << 28) struct netxen_rcv_context { __le64 rcv_ring_addr; @@ -309,8 +309,8 @@ struct netxen_ring_ctx { ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \ (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff)) #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ - ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \ - (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 24)) + ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \ + (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 8)) #define netxen_get_cmd_desc_opcode(cmd_desc) \ ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F) - 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: NetXen driver name
The already released kernel contains a broken driver. It broke due to some code rearrangement changes someone submitted to fix sparse warnings. -Amit On Thursday 08 February 2007 23:45, Andi Kleen wrote: > Amit Kale <[EMAIL PROTECTED]> writes: > > Hi, > > > > NetXen ethernet driver present in 2.6.20 has name "netxen_nic". The > > product itself is refered to as "nx_nic". To make it inline with the > > product, would it be a good idea to change the name of the driver to > > "nx_nic"? > > When it's already in a released kernel it's a little late to rename the > module. You would cause upgrade pain to users who have hardcoded the module > name. > > -Andi - 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: NetXen driver name
On Monday 12 February 2007 09:28, Amit Kale wrote: > On Monday 12 February 2007 13:42, Andi Kleen wrote: > > On Monday 12 February 2007 09:03, Amit Kale wrote: > > > The already released kernel contains a broken driver. It broke due to > > > some code rearrangement changes someone submitted to fix sparse warnings. > > > > You mean it doesn't compile? > > It compiles, but doesn't work if tried on real hardware. > We'll send a fix for the same in a few hours. But didn't the driver make it into distributions with the old name? That could be another compat issue (such things easily make unhappy users and you probably wouldn't like that) But ok then a rename is probably still possible. You have to ask Jeff of course. -Andi - 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: Fw: [Bugme-new] [Bug 7952] New: slattach only works every other time
On 06-02-2007 22:57, Andrew Morton wrote: ... > First time slattach is run to set up a SLIP line all is ok. > If slattach process is then killed and restarted it fails with message: > SLIP_set_disc(1): File exists > Problem still occurs in 2.6.20rc6 kernel > > dmesg shows: > object_add failed for sl0 with -EEXIST, don't try to register things > with the same name in the same directory. > [] kobject_add+0x147/0x16d > [] class_device_add+0x9d/0x3b3 > [] register_netdevice+0x21a/0x2d0 > [] slip_open+0x3a1/0x4e2 [slip] > [] tty_ioctl+0x922/0xbac ... > Steps to reproduce: > (requires a serial port but nothing needs to be attached to it): > # slattach -L -vd -p slip -s 115200 /dev/ttyS0 ... > slip started on /dev/ttyS0 interface sl0 > > Above is OK, now kill process with CTRL-C > > slattach: tty_set_speed: 0 > # slattach -L -vd -p slip -s 115200 /dev/ttyS0 ... > SLIP_set_disc(1): File exists ... > I believe this is called by this changeset : > http://www2.kernel.org/git/?p=linux/kernel/git/stable/linux-2.6.17.y.git;a=commit;h=b17a7c179dd3ce7d04373fddf660eda21efc9db9 I think Martin is probably right here. It would be useful to check if time has anything to do with this and wait longer (e.g. >= 1 min.) before the second slattach. Anyway, even if there is some other reason, the above trace shows (IMHO) some inconsistency in register/ unregister_netdevice: if class_device_add is reached it means the name is valid (so was unregistered) and EEXIST from netdev_register_sysfs is wrong about the state of this device. So maybe there should be some warning plus some delayed action instead of register cancelled? Regards, Jarek P. - 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: NetXen driver name
On Mon, Feb 12, 2007 at 09:12:56AM +0100, Andi Kleen wrote: > On Monday 12 February 2007 09:03, Amit Kale wrote: > > The already released kernel contains a broken driver. It broke due to some > > code rearrangement changes someone submitted to fix sparse warnings. s/sparse warnings/breakage on big-endian boxen/, actually. This stuff was sent to netdev tree and sat there for a while. Pity if some breakage occured and went unnoticed; could you give more details? > You mean it doesn't compile? - 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: NetXen driver name
Sending it again from correct smtp server. On Monday 12 February 2007 13:42, Andi Kleen wrote: > On Monday 12 February 2007 09:03, Amit Kale wrote: > > The already released kernel contains a broken driver. It broke due to > > some code rearrangement changes someone submitted to fix sparse warnings. > > You mean it doesn't compile? It compiles, but doesn't work if tried on real hardware. We'll send a fix for the same in a few hours. -Amit > > -Andi - 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