Re: [RFC, patch-2.6, RESEND] Controlling the auto-route setting behaviour of the kernel

2006-03-06 Thread Sven Anders
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Herbert Xu schrieb:
> Sven Anders <[EMAIL PROTECTED]> wrote:
>> This enables the user - as an example - to set all routes in the local table
>> automatically, but leave the main table untouched. (This is the special case 
>> I
>> needed.)
>> If you want you can disable it completly by writing 0 to
>> /proc/sys/net/ipv4/ip_autoroute.
> 
> This particular case is unnecessary.  Just add a route rule that points
> to a table other than main with a priority higher than main and you'll
> achieve the same thing.  No need to bloat the kernel.

Ok, my special case would work, but not the others.

But in general:
 Shouldn't the user have full control over what the kernel does?
 In my opinion the user should by able to turn off all special automatics the
 kernel may have.
 And a /proc entry to control the kernel isn't bloat in my eyes...

Regards
 Sven Anders

- --
 Sven Anders <[EMAIL PROTECTED]> () Ascii Ribbon Campaign
 /\ Support plain text e-mail
 ANDURAS service solutions AG
 Innstraße 71 - 94036 Passau - Germany
 Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEC/CM5lKZ7Feg4EcRAiuKAJoDiBA1gAlm4MBnyTKWc8/Bj7RhygCbBdxV
WV3tw3gbcvYjJorDWACecAg=
=8kMs
-END PGP SIGNATURE-
begin:vcard
fn:Sven Anders
n:Anders;Sven
org:ANDURAS AG;Research and Development
adr;quoted-printable:;;Innstra=C3=9Fe 71;Passau;Bavaria;94036;Germany
email;internet:[EMAIL PROTECTED]
title:Dipl. Inf.
tel;work:++49 (0)851 / 490 50 - 0
tel;fax:+49 (0)851 / 4 90 50 - 55
x-mozilla-html:FALSE
url:http://www.anduras.de
version:2.1
end:vcard



double kfree in gss_krb5_wrap

2006-03-06 Thread Dave Jones
We don't even NULL the pointer out, so we're freeing the same
object twice here.

Coverity #951

Signed-off-by: Dave Jones <[EMAIL PROTECTED]>

--- linux-2.6/net/sunrpc/auth_gss/gss_krb5_wrap.c~  2006-03-06 
04:18:50.0 -0500
+++ linux-2.6/net/sunrpc/auth_gss/gss_krb5_wrap.c   2006-03-06 
04:19:40.0 -0500
@@ -205,8 +205,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, i
BUG();
}
 
-   kfree(md5cksum.data);
-
/* XXX would probably be more efficient to compute checksum
 * and encrypt at the same time: */
if ((krb5_make_seq_num(kctx->seq, kctx->initiate ? 0 : 0xff,
@@ -221,7 +219,8 @@ gss_wrap_kerberos(struct gss_ctx *ctx, i
 
return ((kctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE);
 out_err:
-   if (md5cksum.data) kfree(md5cksum.data);
+   if (md5cksum.data)
+   kfree(md5cksum.data);
return GSS_S_FAILURE;
 }
 

-- 
http://www.codemonkey.org.uk
-
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


Another gss_krb5 double kfre

2006-03-06 Thread Dave Jones
Variation on a theme, with same result - double free of same object.

Coverity #950
Signed-off-by: Dave Jones <[EMAIL PROTECTED]>

--- linux-2.6/net/sunrpc/auth_gss/gss_krb5_seal.c~  2006-03-06 
04:23:05.0 -0500
+++ linux-2.6/net/sunrpc/auth_gss/gss_krb5_seal.c   2006-03-06 
04:23:59.0 -0500
@@ -133,12 +133,12 @@ gss_get_mic_kerberos(struct gss_ctx *gss
BUG();
}
 
-   kfree(md5cksum.data);
-
if ((krb5_make_seq_num(ctx->seq, ctx->initiate ? 0 : 0xff,
   ctx->seq_send, krb5_hdr + 16, krb5_hdr + 8)))
goto out_err;
 
+   kfree(md5cksum.data);
+
ctx->seq_send++;
 
return ((ctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE);


-- 
http://www.codemonkey.org.uk
-
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


spider_net versus sungem_phy

2006-03-06 Thread Andrew Morton
drivers/net/spider_net.c:421: multiple definition of `mii_phy_probe'
drivers/net/sungem_phy.o(.opd+0x160):drivers/net/sungem_phy.c:95: first defined 
here
-
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: GigE on PowerMac G5

2006-03-06 Thread Andreas Schwab
Benjamin Herrenschmidt <[EMAIL PROTECTED]> writes:

> On Sat, 2006-03-04 at 15:53 +0100, Andreas Schwab wrote:
>> I suppose the NIC in the PowerMac G5 can do GigE, yet when plugged into a
>> GB switch it is only willing to talk 100MB with it.  Any idea why?  Kernel
>> is 2.6.16-rc5-git2.
>
> Works for me... Must be a problem with auto-neg and your switch, or the
> cable Can you check how the switch is configured maybe ? You can
> also try forcing the link speed with ethtool.

It's not the cable, I have swapped it with another system where Gb is
working fine.  Neither it's the switch port, I have swapped it too.  I
can't force the speed with ethtool either.  Any other idea what to look
for?

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
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


SIOCGMIIPHY on 'eth2' failed: Operation not supported

2006-03-06 Thread Ozgur Karatas
hello,

ozgur:/lib/modules/2.6.12-1-386/kernel/drivers/net# uname -ar
Linux ozgur 2.6.12-1-386 #1 Tue Sep 27 12:41:08 JST 2005 i686 GNU/Linux
ozgur:/lib/modules/2.6.12-1-386/kernel/drivers/net#ls
3c501.koamd8111e.ko  dl2k.ko  forcedeth.ko  ne2.ko 
ppp_generic.ko  slip.ko tun.ko
3c503.koappletalkdummy.ko hamachi.kone2k-pci.ko
pppoe.kosmc9194.ko  typhoon.ko
3c505.koarcnet   e1000hamradio  ne3210.ko  
pppox.kosmc-mca.ko  via-rhine.ko
3c507.koat1700.koe100.ko  hp100.ko  ne.ko  
ppp_synctty.ko  smc-ultra32.ko  via-velocity.ko
3c509.koatp.ko   e2100.ko hp.ko netconsole.ko  
r8169.kosmc-ultra.kowan
3c515.kob44.ko   eepro100.ko  hp-plus.koni5010.ko  
rrunner.ko  starfire.ko wd.ko
3c523.kobnx2.ko  eepro.ko ibmlana.koni52.ko
s2io.ko sundance.ko wireless
3c527.kobonding  eexpress.ko  irda  ni65.ko
sb1000.ko   sungem.ko   yellowfin.ko
3c59x.kobsd_comp.ko  epic100.ko   ixgb  ns83820.ko 
seeq8005.ko sungem_phy.ko   znet.ko
8139cp.ko   cs89x0.koeql.ko   lance.ko  pcmcia 
shaper.ko   sunhme.ko
8139too.ko  de600.ko es3210.kolne390.ko pcnet32.ko 
sis900.ko   tg3.ko
82596.kode620.ko eth16i.kolp486e.ko plip.ko
sk98lin tlan.ko
8390.ko defxx.ko ewrk3.ko mii.koppp_async.koskfp  
 tokenring
ac3200.ko   depca.ko fealnx.konatsemi.koppp_deflate.ko 
slhc.ko tulip


ozgur:/lib/modules/2.6.12-1-386/kernel/drivers/net# mii-tool
eth0: negotiated 100baseTx-FD, link ok
eth1: negotiated 100baseTx-FD, link ok
SIOCGMIIPHY on 'eth2' failed: Operation not supported
ozgur:/lib/modules/2.6.12-1-386/kernel/drivers/net#

why SIOCGMIIPHY operation not supported?

> drivers/net/spider_net.c:421: multiple definition of `mii_phy_probe'
> drivers/net/sungem_phy.o(.opd+0x160):drivers/net/sungem_phy.c:95: first
> defined here
> -
> 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
>


-- 
Ozgur Karatas
CCNA
Network Enginner
ozgur (at) ozgurkaratas [dot] com
http://www.ozgurkaratas.com
--

-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread linux-os \(Dick Johnson\)

On Sun, 5 Mar 2006, Martin Michlmayr wrote:

> We have three independent reports about problems with de2104x involving
> interrupts.  Alan Stern suggested that it "sure looks as though the
> ethernet interface is generating an interrupt request before the
> de2104x driver has registered its interrupt handler".
>
> The three reports are:
> - de2104x does not work (non-fatal oops) when uhci_hcd is loaded
>   first.  http://lkml.org/lkml/2006/2/3/402  The problem does not
>   occur under 2.4 with the tulip module, so this is a regression.
> - fatal de2104x interrupt oops (without uhci_hcd).
>   http://lkml.org/lkml/2006/2/5/64
> - "kernel panic after the first transmission attempt times out"
>   Regression from 2.4.  http://bugs.debian.org/288821
>
> I have a system on which I can reproduce this bug 100%.  While I have
> no idea how to fix the issue, I can provide debugging information and
> test a fix.  However, I'm (temporarily) leaving the country in three
> weeks and won't have access to this PC for several months, so it would
> be great if someone could look into this soon.  Jeff?
>
>
> 1)
> eth0: enabling interface
> eth0: set link 10baseT auto
> eth0:mode 0x7ffc0040, sia 0x10c4,0xef01,0x,0x0008
> eth0:set mode 0x7ffc0040, set sia 0xef01,0x,0x8
> irq 10: nobody cared (try booting with the "irqpoll" option)
> [] __report_bad_irq+0x31/0x73
> [] note_interrupt+0x75/0x98
> [] __do_IRQ+0x67/0x91
> [] do_IRQ+0x19/0x24
> [] common_interrupt+0x1a/0x20
> [] __do_softirq+0x2c/0x7d
> [] do_softirq+0x22/0x26
> [] do_IRQ+0x1e/0x24
> [] common_interrupt+0x1a/0x20
> [] de_set_rx_mode+0xf/0x12 [de2104x]
> [] de_init_hw+0x6d/0x76 [de2104x]
> [] de_open+0x64/0xe4 [de2104x]
> [] dev_open+0x30/0x66
> [] dev_change_flags+0x4d/0xf0
> [] devinet_ioctl+0x224/0x4bd
> [] do_ioctl+0x21/0x50
> [] vfs_ioctl+0x152/0x161
> [] sys_ioctl+0x48/0x65
> [] syscall_call+0x7/0xb
> handlers:
> [] (usb_hcd_irq+0x0/0x56 [usbcore])
> Disabling IRQ #10
>
> 3)
> eth0:mode 0x7ffc0040, sia 0x10c4,0xef01,0x,0x0008
> eth0:set mode 0x7ffc0040, set sia 0xef01,0x,0x8
> [__report_bad_irq+42/144] __report_bad_irq+0x2a/0x90
> [note_interrupt+108/160] note_interrupt+0x6c/0xa0
> [do_IRQ+289/304] do_IRQ+0x121/0x130
> [common_interrupt+24/32] common_interrupt+0x18/0x20
> [__do_softirq+48/128] __do_softirq+0x30/0x80
> [acpi_irq+0/22] acpi_irq+0x0/0x16
> [do_softirq+38/48] do_softirq+0x26/0x30
> [do_IRQ+253/304] do_IRQ+0xfd/0x130
> [common_interrupt+24/32] common_interrupt+0x18/0x20
> [__crc_do_softirq+25311/208152] de_set_rx_mode+0x26/0x50 [de2104x]
> [__crc_do_softirq+28277/208152] de_init_hw+0x8c/0x90 [de2104x]
> [__crc_do_softirq+29105/208152] de_open+0x68/0x140 [de2104x]
> [profile_hook+45/75] profile_hook+0x2d/0x4b
> [dev_open+203/256] dev_open+0xcb/0x100
> [dev_mc_upload+36/80] dev_mc_upload+0x24/0x50
> [dev_change_flags+81/288] dev_change_flags+0x51/0x120
> [devinet_ioctl+582/1424] devinet_ioctl+0x246/0x590
> [inet_ioctl+94/160] inet_ioctl+0x5e/0xa0
> [sock_ioctl+249/688] sock_ioctl+0xf9/0x2b0
> [sys_ioctl+269/656] sys_ioctl+0x10d/0x290
> [syscall_call+7/11] syscall_call+0x7/0xb
> eth0: link up, media 10baseT auto
>
> --

> Martin Michlmayr
> http://www.cyrius.com/
> -

This started to happen in a lot of PCI drivers once it became
necessary to call pci_enable_device() in order to make the
returned IRQ values valid. This has been reported numerious
times and has not been fixed. Basically, in order to get
the correct value, one needs to disable the board in some
unspecified way so it is not possible for it to generate
an interrupt before enabling the board. With some devices
this may not be possible!

Cheers,
Dick Johnson
Penguin : Linux version 2.6.15.4 on an i686 machine (5589.47 BogoMips).
Warning : 98.36% of all statistics are fiction, book release in April.
_



The information transmitted in this message is confidential and may be 
privileged.  Any review, retransmission, dissemination, or other use of this 
information by persons or entities other than the intended recipient is 
prohibited.  If you are not the intended recipient, please notify Analogic 
Corporation immediately - by replying to this message or by sending an email to 
[EMAIL PROTECTED] - and destroy all copies of this information, including any 
attachments, without reading or disclosing them.

Thank you.
-
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: GigE on PowerMac G5

2006-03-06 Thread Benjamin Herrenschmidt
On Mon, 2006-03-06 at 11:40 +0100, Andreas Schwab wrote:
> Benjamin Herrenschmidt <[EMAIL PROTECTED]> writes:
> 
> > On Sat, 2006-03-04 at 15:53 +0100, Andreas Schwab wrote:
> >> I suppose the NIC in the PowerMac G5 can do GigE, yet when plugged into a
> >> GB switch it is only willing to talk 100MB with it.  Any idea why?  Kernel
> >> is 2.6.16-rc5-git2.
> >
> > Works for me... Must be a problem with auto-neg and your switch, or the
> > cable Can you check how the switch is configured maybe ? You can
> > also try forcing the link speed with ethtool.
> 
> It's not the cable, I have swapped it with another system where Gb is
> working fine.  Neither it's the switch port, I have swapped it too.  I
> can't force the speed with ethtool either.  Any other idea what to look
> for?

At this point, all I can say is... does it work in OS X ?

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 aevent related crash

2006-03-06 Thread Patrick McHardy
Fix a regression in net-2.6.17 from the aevent patches.

[XFRM]: Fix aevent related crash

When xfrm_user isn't loaded xfrm_nl is NULL, which makes IPsec crash because
xfrm_aevent_is_on passes the NULL pointer to netlink_has_listeners as socket.
A second problem is that the xfrm_nl pointer is not cleared when the socket
is releases at module unload time.

Protect references of xfrm_nl from outside of xfrm_user by RCU, check
that the socket is present in xfrm_aevent_is_on and set it to NULL
when unloading xfrm_user.

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>

---
commit bee4457e500cbbe3f6d8a5b200588f6b0afb6f93
tree f174724ffb83f8a9768257d2ac320710f008002b
parent 5134e9a6559778d2f3f8dcaf60a1009360e477a2
author Patrick McHardy <[EMAIL PROTECTED]> Mon, 06 Mar 2006 14:14:30 +0100
committer Patrick McHardy <[EMAIL PROTECTED]> Mon, 06 Mar 2006 14:14:30 +0100

 include/net/xfrm.h   |   10 +-
 net/xfrm/xfrm_user.c |   11 ---
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 156f52e..7dff185 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1000,7 +1000,15 @@ static inline int xfrm_policy_id2dir(u32
 
 static inline int xfrm_aevent_is_on(void)
 {
-   return netlink_has_listeners(xfrm_nl,XFRMNLGRP_AEVENTS);
+   struct sock *nlsk;
+   int ret = 0;
+
+   rcu_read_lock();
+   nlsk = rcu_dereference(xfrm_nl);
+   if (nlsk)
+   ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS);
+   rcu_read_unlock();
+   return ret;
 }
 
 static inline void xfrm_aevent_doreplay(struct xfrm_state *x)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index ca8ac61..7afe4b1 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1947,12 +1947,15 @@ static struct xfrm_mgr netlink_mgr = {
 
 static int __init xfrm_user_init(void)
 {
+   struct sock *nlsk;
+
printk(KERN_INFO "Initializing IPsec netlink socket\n");
 
-   xfrm_nl = netlink_kernel_create(NETLINK_XFRM, XFRMNLGRP_MAX,
-   xfrm_netlink_rcv, THIS_MODULE);
-   if (xfrm_nl == NULL)
+   nlsk = netlink_kernel_create(NETLINK_XFRM, XFRMNLGRP_MAX,
+xfrm_netlink_rcv, THIS_MODULE);
+   if (nlsk == NULL)
return -ENOMEM;
+   rcu_assign_pointer(xfrm_nl, nlsk);
 
xfrm_register_km(&netlink_mgr);
 
@@ -1962,6 +1965,8 @@ static int __init xfrm_user_init(void)
 static void __exit xfrm_user_exit(void)
 {
xfrm_unregister_km(&netlink_mgr);
+   rcu_assign_pointer(xfrm_nl, NULL);
+   synchronize_rcu();
sock_release(xfrm_nl->sk_socket);
 }
 


Re: [XFRM]: Fix aevent related crash

2006-03-06 Thread Patrick McHardy
Patrick McHardy wrote:
> Fix a regression in net-2.6.17 from the aevent patches.
> 
> Protect references of xfrm_nl from outside of xfrm_user by RCU, check
> that the socket is present in xfrm_aevent_is_on and set it to NULL
> when unloading xfrm_user.
> 
>  static void __exit xfrm_user_exit(void)
>  {
>   xfrm_unregister_km(&netlink_mgr);
> + rcu_assign_pointer(xfrm_nl, NULL);
> + synchronize_rcu();
>   sock_release(xfrm_nl->sk_socket);
>  }
>  

Sorry, thats just as broken as before. Better patch attached.
[XFRM]: Fix aevent related crash

When xfrm_user isn't loaded xfrm_nl is NULL, which makes IPsec crash because
xfrm_aevent_is_on passes the NULL pointer to netlink_has_listeners as socket.
A second problem is that the xfrm_nl pointer is not cleared when the socket
is releases at module unload time.

Protect references of xfrm_nl from outside of xfrm_user by RCU, check
that the socket is present in xfrm_aevent_is_on and set it to NULL
when unloading xfrm_user.

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>

---
commit 4b76213dc1378f874a64acd1c088d8e9a22759a1
tree d4fc2906ffcfa5afb0ad7f68bc861f0c1fb59cc8
parent 5134e9a6559778d2f3f8dcaf60a1009360e477a2
author Patrick McHardy <[EMAIL PROTECTED]> Mon, 06 Mar 2006 14:20:29 +0100
committer Patrick McHardy <[EMAIL PROTECTED]> Mon, 06 Mar 2006 14:20:29 +0100

 include/net/xfrm.h   |   10 +-
 net/xfrm/xfrm_user.c |   15 +++
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 156f52e..7dff185 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1000,7 +1000,15 @@ static inline int xfrm_policy_id2dir(u32
 
 static inline int xfrm_aevent_is_on(void)
 {
-   return netlink_has_listeners(xfrm_nl,XFRMNLGRP_AEVENTS);
+   struct sock *nlsk;
+   int ret = 0;
+
+   rcu_read_lock();
+   nlsk = rcu_dereference(xfrm_nl);
+   if (nlsk)
+   ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS);
+   rcu_read_unlock();
+   return ret;
 }
 
 static inline void xfrm_aevent_doreplay(struct xfrm_state *x)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index ca8ac61..25c2fcf 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1947,12 +1947,15 @@ static struct xfrm_mgr netlink_mgr = {
 
 static int __init xfrm_user_init(void)
 {
+   struct sock *nlsk;
+
printk(KERN_INFO "Initializing IPsec netlink socket\n");
 
-   xfrm_nl = netlink_kernel_create(NETLINK_XFRM, XFRMNLGRP_MAX,
-   xfrm_netlink_rcv, THIS_MODULE);
-   if (xfrm_nl == NULL)
+   nlsk = netlink_kernel_create(NETLINK_XFRM, XFRMNLGRP_MAX,
+xfrm_netlink_rcv, THIS_MODULE);
+   if (nlsk == NULL)
return -ENOMEM;
+   rcu_assign_pointer(xfrm_nl, nlsk);
 
xfrm_register_km(&netlink_mgr);
 
@@ -1961,8 +1964,12 @@ static int __init xfrm_user_init(void)
 
 static void __exit xfrm_user_exit(void)
 {
+   struct sock *nlsk = xfrm_nl;
+
xfrm_unregister_km(&netlink_mgr);
-   sock_release(xfrm_nl->sk_socket);
+   rcu_assign_pointer(xfrm_nl, NULL);
+   synchronize_rcu();
+   sock_release(nlsk->sk_socket);
 }
 
 module_init(xfrm_user_init);


Re: [XFRM]: Fix aevent related crash

2006-03-06 Thread jamal
On Mon, 2006-06-03 at 14:20 +0100, Patrick McHardy wrote:

> [XFRM]: Fix aevent related crash
> 
> When xfrm_user isn't loaded xfrm_nl is NULL, which makes IPsec crash because
> xfrm_aevent_is_on passes the NULL pointer to netlink_has_listeners as socket.

For the above wouldnt it be better to just have an
ifdef XFRM_USER then you call the current code
and in the case when it is not compiled to always return 0?
I guess the question is how much overhead does the rcu code add (since
this is done per packet)

The second one i think is ok since it is slow path.
cheers,
jamal


-
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 7/7] Generic netlink interface (delay accounting)

2006-03-06 Thread jamal
Hi Shailabh,
Apologies for taking a week to respond ..

On Mon, 2006-27-02 at 15:26 -0500, Shailabh Nagar wrote: 
> jamal wrote:

> Yes, the current intent is to allow multiple listeners to receive the 
> responses sent by the kernel.

Responses or events? There is a difference:
Response implies the program in user space requested (ex a GET) for that
information and is receiving such info.
Event implies the program in user space asked to be informed of changes
in the kernel. Example an exit would be considered an event. 
Events are received by virtue of registering to a multicast group.
[..] 
> Since this interface (taskstats) is currently designed for that 
> possibility, having multiple listeners, one for
> each "component" such as delay accounting, is the model we're using.
> We expect each component to have a pair of userspace programs, one for 
> sending commands and the other
> to "listen" to all replies + data generated on task exits. 

You need to have a sender of GETs essentially and a listener of events.
Those are two connections. The replies of a get from user1 will not be
sent to user2 as well - unless ... thats what you are trying to achieve;
the question is why?

> The listener 
> is expected to register/deregister interest through
> TASKSTATS_CMD_LISTEN and IGNORE.
> 

It is not necessary if you follow the model i described.

> >How does this correlate to TASKSTATS_CMD_LISTEN/IGNORE?
> >  
> >
> See above. Its mainly an optimization so that if no listener is present, 
> there's no need to generate the data.
> 

Also not necessary - There is a recent netlink addition to make sure
that events dont get sent if no listeners exist.
genetlink needs to be extended. For now assume such a thing exists.

> >>+

> Good point. Should check for users sending it as a cmd and treat it as a 
> noop. 

More like return an -EINVAL

> I'm just using
> this as a placeholder for data thats returned without being requested.
> 

So it is unconditional?

> Come to think of it, there's no real reason to have a genlmsghdr for 
> returned data, is there ?

All messages should be consistent whether they are sent from user
or kernel.

> Other than to copy the genlmsghdr that was sent so user can identify 
> which command was sent
> (and I'm doing that through the reply type, perhaps redundantly).
> 

yes, that is a useful trick. Just make sure they are reflected
correctly.

> Actually, the next iteration of the code will move to dynamically 
> generated ID. But yes, will need to check for that.
> 

Also if you can provide feedback whether the doc i sent was any use
and what wasnt clear etc.

> Thanks for the review.
> Couple of questions about general netlink:
> is it intended to remain a size that will always be aligned to the 
> NLMSG_ALIGNTO so that (NLMSG_DATA(nlhdr) + GENL_HDRLEN) can always 
> be used as a pointer to the genlmsghdr ?
> 

I am not sure i followed.
The whole message (nlhdr, genlhdr, optionalhdr, TLVs) has to be in 
the end 32 bit aligned.

> Adding some macros like genlmsg_data(nlh) would be handy (currently I 
> just define and use it locally).
> 

Send a patch.

cheers,
jamal

-
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 aevent related crash

2006-03-06 Thread Patrick McHardy
jamal wrote:
> On Mon, 2006-06-03 at 14:20 +0100, Patrick McHardy wrote:
> 
> 
>>[XFRM]: Fix aevent related crash
>>
>>When xfrm_user isn't loaded xfrm_nl is NULL, which makes IPsec crash because
>>xfrm_aevent_is_on passes the NULL pointer to netlink_has_listeners as socket.
> 
> 
> For the above wouldnt it be better to just have an
> ifdef XFRM_USER then you call the current code
> and in the case when it is not compiled to always return 0?
> I guess the question is how much overhead does the rcu code add (since
> this is done per packet)

xfrm_user can be a module, so an ifdef won't help. The rcu_dereference
doesn't cost anything except on alpha. We could reduce the overhead a
bit more by avoiding the rcu_read_lock/rcu_read_unlock, the code is
AFAICT only called from the xfrm output functions, which already have
preemption disabled in xfrm[46]_output. But I'm always a bit reluctant
to do things like that, it makes it harder to understand and is sure to
be forgotten when the surrounding code changes.
-
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 aevent related crash

2006-03-06 Thread jamal
On Mon, 2006-06-03 at 15:01 +0100, Patrick McHardy wrote:

> 
> xfrm_user can be a module, so an ifdef won't help. 

good point.

> The rcu_dereference
> doesn't cost anything except on alpha. We could reduce the overhead a
> bit more by avoiding the rcu_read_lock/rcu_read_unlock, the code is
> AFAICT only called from the xfrm output functions, which already have
> preemption disabled in xfrm[46]_output. But I'm always a bit reluctant
> to do things like that, it makes it harder to understand and is sure to
> be forgotten when the surrounding code changes.

My only concern is performance. If it is negligible then no issues.
In regards to the rcu_read_[un]lock perhaps an alternative is you
comment out the rcu_read_[un]lock and leave it in the code with some
explanation text to serve as a reminder for whoever makes future
changes? Again, if it is negligible then this is not needed (I do plan
to run some performance tests and could have used the opportunity to
check differences but that wont happen for another 2 weeks)

cheers,
jamal

-
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 aevent related crash

2006-03-06 Thread Patrick McHardy
jamal wrote:
> On Mon, 2006-06-03 at 15:01 +0100, Patrick McHardy wrote:
> 
>>The rcu_dereference
>>doesn't cost anything except on alpha. We could reduce the overhead a
>>bit more by avoiding the rcu_read_lock/rcu_read_unlock, the code is
>>AFAICT only called from the xfrm output functions, which already have
>>preemption disabled in xfrm[46]_output. But I'm always a bit reluctant
>>to do things like that, it makes it harder to understand and is sure to
>>be forgotten when the surrounding code changes.
> 
> 
> My only concern is performance. If it is negligible then no issues.
> In regards to the rcu_read_[un]lock perhaps an alternative is you
> comment out the rcu_read_[un]lock and leave it in the code with some
> explanation text to serve as a reminder for whoever makes future
> changes? Again, if it is negligible then this is not needed (I do plan
> to run some performance tests and could have used the opportunity to
> check differences but that wont happen for another 2 weeks)

Without CONFIG_PREEMPT the rcu_read_lock/unlock calls just vanish (which
is probably the common case for anyone careing about network
performance), with CONFIG_PREEMPT they evaluate to one addition and one
subtraction (I always thought preempt_enable/disable were atomic
operations, but apparently not). This is most likely negligible
compared to crypto operations.
-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread Martin Michlmayr
* Francois Romieu <[EMAIL PROTECTED]> [2006-03-05 19:59]:
> > I have a system on which I can reproduce this bug 100%.  While I have
> > no idea how to fix the issue, I can provide debugging information and
> > test a fix.

> (not compile-tested)

Thanks a lot for your quick response, Francois.  I can confirm that
this patch fixes the problem for me.

> -err_out_hw:
> - spin_lock_irqsave(&de->lock, flags);
> - de_stop_hw(de);
> - spin_unlock_irqrestore(&de->lock, flags);

flags is no longer used now, so we get a compilation warning.  Updated
patch below.  Francois, can you please submit it with a proper
changelog entry and your Signed-off-by.


From: Francois Romieu <[EMAIL PROTECTED]>
Signed-off-by: Martin Michlmayr <[EMAIL PROTECTED]>

--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -1362,7 +1362,6 @@ static int de_open (struct net_device *d
 {
struct de_private *de = dev->priv;
int rc;
-   unsigned long flags;
 
if (netif_msg_ifup(de))
printk(KERN_DEBUG "%s: enabling interface\n", dev->name);
@@ -1376,18 +1375,20 @@ static int de_open (struct net_device *d
return rc;
}
 
-   rc = de_init_hw(de);
-   if (rc) {
-   printk(KERN_ERR "%s: h/w init failure, err=%d\n",
-  dev->name, rc);
-   goto err_out_free;
-   }
+   dw32(IntrMask, 0);
 
rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
if (rc) {
printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
   dev->name, dev->irq, rc);
-   goto err_out_hw;
+   goto err_out_free;
+   }
+
+   rc = de_init_hw(de);
+   if (rc) {
+   printk(KERN_ERR "%s: h/w init failure, err=%d\n",
+  dev->name, rc);
+   goto err_out_free_irq;
}
 
netif_start_queue(dev);
@@ -1395,11 +1396,8 @@ static int de_open (struct net_device *d
 
return 0;
 
-err_out_hw:
-   spin_lock_irqsave(&de->lock, flags);
-   de_stop_hw(de);
-   spin_unlock_irqrestore(&de->lock, flags);
-
+err_out_free_irq:
+   free_irq(dev->irq, dev);
 err_out_free:
de_free_rings(de);
return rc;

-- 
Martin Michlmayr
http://www.cyrius.com/
-
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: SIOCGMIIPHY on 'eth2' failed: Operation not supported

2006-03-06 Thread Dan Williams
On Mon, 2006-03-06 at 13:14 +0200, Ozgur Karatas wrote:
> hello,
> 
> ozgur:/lib/modules/2.6.12-1-386/kernel/drivers/net# uname -ar
> Linux ozgur 2.6.12-1-386 #1 Tue Sep 27 12:41:08 JST 2005 i686 GNU/Linux
> ozgur:/lib/modules/2.6.12-1-386/kernel/drivers/net#ls
> 3c501.koamd8111e.ko  dl2k.ko  forcedeth.ko  ne2.ko 
> ppp_generic.ko  slip.ko tun.ko
> 3c503.koappletalkdummy.ko hamachi.kone2k-pci.ko
> pppoe.kosmc9194.ko  typhoon.ko
> 3c505.koarcnet   e1000hamradio  ne3210.ko  
> pppox.kosmc-mca.ko  via-rhine.ko
> 3c507.koat1700.koe100.ko  hp100.ko  ne.ko  
> ppp_synctty.ko  smc-ultra32.ko  via-velocity.ko
> 3c509.koatp.ko   e2100.ko hp.ko netconsole.ko  
> r8169.kosmc-ultra.kowan
> 3c515.kob44.ko   eepro100.ko  hp-plus.koni5010.ko  
> rrunner.ko  starfire.ko wd.ko
> 3c523.kobnx2.ko  eepro.ko ibmlana.koni52.ko
> s2io.ko sundance.ko wireless
> 3c527.kobonding  eexpress.ko  irda  ni65.ko
> sb1000.ko   sungem.ko   yellowfin.ko
> 3c59x.kobsd_comp.ko  epic100.ko   ixgb  ns83820.ko 
> seeq8005.ko sungem_phy.ko   znet.ko
> 8139cp.ko   cs89x0.koeql.ko   lance.ko  pcmcia 
> shaper.ko   sunhme.ko
> 8139too.ko  de600.ko es3210.kolne390.ko pcnet32.ko 
> sis900.ko   tg3.ko
> 82596.kode620.ko eth16i.kolp486e.ko plip.ko
> sk98lin tlan.ko
> 8390.ko defxx.ko ewrk3.ko mii.koppp_async.koskfp  
>  tokenring
> ac3200.ko   depca.ko fealnx.konatsemi.koppp_deflate.ko 
> slhc.ko tulip
> 
> 
> ozgur:/lib/modules/2.6.12-1-386/kernel/drivers/net# mii-tool
> eth0: negotiated 100baseTx-FD, link ok
> eth1: negotiated 100baseTx-FD, link ok
> SIOCGMIIPHY on 'eth2' failed: Operation not supported
> ozgur:/lib/modules/2.6.12-1-386/kernel/drivers/net#
> 
> why SIOCGMIIPHY operation not supported?


What kind of card is eth2? What driver is eth2 using?  Just listing the
modules you've got installed doesn't tell us which module is actually
used for eth2.

Not all cards support MII, since MII is fairly old and isn't really
applicable everywhere.  It's not really "standard", just happens to be
around on a lot of cards.  You would probably get better luck with
ethtool, which is the way of the future, and card/media independent.

What does this give you?

ethtool -i eth2

There's also just 'ethtool eth2' which is probably more what you want.

Dan


-
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


[RFC/PATCH 8/13] d80211: interface types changeable by SIOCSIWMODE

2006-03-06 Thread Jiri Benc
Allow type of interface to be set by SIOCSIWMODE. All of functions
responsible for adding/removing/initialization of interfaces were moved to
a new file ieee80211_iface.c. Function for removing interface was split into
two parts: one for deinitialization of the interface and one for
deallocation of the interface. That way, it is possible to change the type
of interface just by deinitializing and initializing it.

Also, remove set_mac_address callback to a driver, as it is not needed
anymore (drivers are notified about MAC addresses through add_interface
callback).

Please note, that although after this patch interfaces are fully independent
and driver can correctly control which combination is allowed, not all
multicast frames are received correctly by all respective interfaces. This
is addressed by subsequent patches.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/include/net/d80211.h
===
--- dscape.orig/include/net/d80211.h2006-03-06 14:10:22.0 +0100
+++ dscape/include/net/d80211.h 2006-03-06 14:10:41.0 +0100
@@ -534,9 +534,6 @@ struct ieee80211_hw {
/* Configuration of test parameters */
int (*test_param)(struct net_device *dev, int param, int value);
 
-   /* Change MAC address. addr is pointer to struct sockaddr. */
-   int (*set_mac_address)(struct net_device *dev, void *addr);
-
 /* For devices that generate their own beacons and probe response
  * or association responses this updates the state of privacy_invoked
  * returns 0 for success or an error number */
Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:10:22.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:16:21.0 +0100
@@ -1784,24 +1784,12 @@ static void ieee80211_tx_timeout(struct 
 
 static int ieee80211_set_mac_address(struct net_device *dev, void *addr)
 {
-   struct ieee80211_local *local = dev->priv;
struct sockaddr *a = addr;
-   struct list_head *ptr;
-   int res;
 
-   if (!local->hw->set_mac_address)
-   return -EOPNOTSUPP;
-
-   res = local->hw->set_mac_address(dev, addr);
-   if (res)
-   return res;
-
-   list_for_each(ptr, &local->sub_if_list) {
-   struct ieee80211_sub_if_data *sdata =
-   list_entry(ptr, struct ieee80211_sub_if_data, list);
-   memcpy(sdata->dev->dev_addr, a->sa_data, ETH_ALEN);
-   }
+   if (netif_running(dev))
+   return -EBUSY;
 
+   memcpy(dev->dev_addr, a->sa_data, ETH_ALEN);
return 0;
 }
 
@@ -1813,14 +1801,37 @@ static struct net_device_stats *ieee8021
return &(sdata->stats);
 }
 
+static inline int identical_mac_addr_allowed(int type1, int type2)
+{
+   return ((type1 == IEEE80211_SUB_IF_TYPE_AP &&
+type2 == IEEE80211_SUB_IF_TYPE_WDS) ||
+   (type1 == IEEE80211_SUB_IF_TYPE_WDS &&
+(type2 == IEEE80211_SUB_IF_TYPE_WDS ||
+ type2 == IEEE80211_SUB_IF_TYPE_AP)));
+}
 
 static int ieee80211_open(struct net_device *dev)
 {
-   struct ieee80211_sub_if_data *sdata;
+   struct ieee80211_sub_if_data *sdata, *nsdata;
struct ieee80211_local *local = dev->priv;
int res;
 
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+   list_for_each_entry(nsdata, &local->sub_if_list, list) {
+   struct net_device *ndev = nsdata->dev;
+
+   if (ndev != dev && ndev != local->mdev &&
+   ndev != local->wdev && ndev != local->apdev &&
+   netif_running(ndev) &&
+   memcmp(dev->dev_addr, ndev->dev_addr, ETH_ALEN) == 0 &&
+   !identical_mac_addr_allowed(sdata->type, nsdata->type)) {
+   return -ENOTUNIQ;
+   }
+   }
+   if (sdata->type == IEEE80211_SUB_IF_TYPE_WDS &&
+   memcmp(sdata->u.wds.remote_addr, "\0\0\0\0\0\0", ETH_ALEN) == 0)
+   return -ENOLINK;
+
if (local->hw->add_interface) {
struct ieee80211_if_conf conf;
 
@@ -1829,6 +1840,11 @@ static int ieee80211_open(struct net_dev
res = local->hw->add_interface(sdata->master, &conf);
if (res)
return res;
+   } else {
+   if (sdata->type != IEEE80211_SUB_IF_TYPE_STA)
+   return -EOPNOTSUPP;
+   if (local->open_count > 0)
+   return -ENOBUFS;
}
 
 if (local->open_count == 0) {
@@ -3779,128 +3795,6 @@ static ieee80211_tx_handler ieee80211_tx
 };
 
 
-static void ieee80211_if_sdata_init(struct ieee80211_sub_if_data *sdata)
-{
-   /* Default values for sub-interface parameters */
-   sdata->drop_unencrypted = 0;
-   sdata->eapol = 1;
-}
-
-
-static struct net

[RFC/PATCH 6/13] d80211: remove obsolete stuff

2006-03-06 Thread Jiri Benc
Because any number of interfaces may be added, bss_devs and sta_devs arrays
cannot be fixed-size arrays. We can make them linked lists, but they are
needed for optimalization only (and even that is questionable with
subsequent patches). Let's remove them; we will probably want something
similar later to speed up packet receiving, but let's not bother ourselves
now.

Also, ieee80211_addr_inc is removed. Choosing of MAC address of a new STA
should be matter of userspace. It's responsibility of the stack not to allow
two STAs with the same MAC address to be up - this feature is introduced in
one of subsequent patches.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/include/net/d80211.h
===
--- dscape.orig/include/net/d80211.h2006-03-06 14:10:18.0 +0100
+++ dscape/include/net/d80211.h 2006-03-06 14:10:22.0 +0100
@@ -277,9 +277,6 @@ struct ieee80211_conf {
 int antenna_def;
 int antenna_mode;
 
-   u8 bssid_mask[ETH_ALEN];/* ff:ff:ff:ff:ff:ff = 1 BSSID */
-   int bss_count;
-
int atheros_super_ag_compression;
int atheros_super_ag_fast_frame;
int atheros_super_ag_burst;
Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:10:18.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:10:22.0 +0100
@@ -1569,17 +1569,14 @@ struct sk_buff * ieee80211_beacon_get(st
u8 *b_head, *b_tail;
int bh_len, bt_len;
 
-   spin_lock_bh(&local->sub_if_lock);
-   if (bss_idx < 0 || bss_idx >= local->bss_dev_count)
-   bdev = NULL;
-   else {
-   bdev = local->bss_devs[bss_idx];
+   bdev = dev_get_by_index(bss_idx);
+   if (bdev) {
sdata = IEEE80211_DEV_TO_SUB_IF(bdev);
ap = &sdata->u.ap;
+   dev_put(bdev);
}
-   spin_unlock_bh(&local->sub_if_lock);
 
-   if (bdev == NULL || ap == NULL || ap->beacon_head == NULL) {
+   if (ap == NULL || ap->beacon_head == NULL) {
 #ifdef CONFIG_D80211_VERBOSE_DEBUG
if (net_ratelimit())
printk(KERN_DEBUG "no beacon data avail for idx=%d "
@@ -1646,19 +1643,15 @@ ieee80211_get_buffered_bc(struct net_dev
ieee80211_txrx_result res = TXRX_DROP;
struct net_device *bdev;
struct ieee80211_sub_if_data *sdata;
-   struct ieee80211_if_ap *bss;
+   struct ieee80211_if_ap *bss = NULL;
 
-   spin_lock_bh(&local->sub_if_lock);
-   if (bss_idx < 0 || bss_idx >= local->bss_dev_count) {
-   bdev = NULL;
-   bss = NULL;
-   } else {
-   bdev = local->bss_devs[bss_idx];
+   bdev = dev_get_by_index(bss_idx);
+   if (bdev) {
sdata = IEEE80211_DEV_TO_SUB_IF(bdev);
bss = &sdata->u.ap;
+   dev_put(bdev);
}
-   spin_unlock_bh(&local->sub_if_lock);
-   if (bdev == NULL || bss == NULL || bss->beacon_head == NULL)
+   if (bss == NULL || bss->beacon_head == NULL)
return NULL;
 
if (bss->dtim_count != 0)
@@ -1911,14 +1904,14 @@ ieee80211_get_wds_dev(struct ieee80211_l
 static struct net_device * ieee80211_own_bssid(struct ieee80211_local *local,
   u8 *addr)
 {
-   int i;
struct net_device *dev = NULL;
+   struct ieee80211_sub_if_data *sdata;
 
spin_lock_bh(&local->sub_if_lock);
-   for (i = 0; i < local->bss_dev_count; i++) {
-   if ((memcmp(local->bss_devs[i]->dev_addr, addr, ETH_ALEN) == 0)
-   ) {
-   dev = local->bss_devs[i];
+   list_for_each_entry(sdata, &local->sub_if_list, list) {
+   if (sdata->type == IEEE80211_SUB_IF_TYPE_AP &&
+   memcmp(addr, sdata->dev->dev_addr, ETH_ALEN) == 0) {
+   dev = sdata->dev;
break;
}
}
@@ -1934,31 +1927,9 @@ static struct net_device * ieee80211_sta
 {
struct list_head *ptr;
int multicast;
-   u8 *own_addr = local->mdev->dev_addr;
 
multicast = a1[0] & 0x01;
 
-   /* Try O(1) lookup for a common case of only one AP being used. */
-   if (own_addr[0] == a1[0] && own_addr[1] == a1[1] &&
-   own_addr[2] == a1[2]) {
-   int index = (((int) a1[3] << 16) | ((int) a1[4] << 8) | a1[5])
-   - (((int) own_addr[3] << 16) |
-  ((int) own_addr[4] << 8) | own_addr[5]);
-   if (index >= 0 && index < local->conf.bss_count &&
-   local->sta_devs[index]) {
-   struct net_device *dev = local->sta_devs[index];
-   struct ieee80211_sub_if_data *sdata;
-   sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- 

[RFC/PATCH 10/13] d80211: set_multicast_list

2006-03-06 Thread Jiri Benc
Add set_multicast_list callback. The version of set_multicast_list in
struct net_device cannot be used by a driver, because the driver is
interested in cumulative flags and cumulative multicast list from all
interfaces.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/include/net/d80211.h
===
--- dscape.orig/include/net/d80211.h2006-03-06 14:10:41.0 +0100
+++ dscape/include/net/d80211.h 2006-03-06 14:18:01.0 +0100
@@ -481,6 +481,13 @@ struct ieee80211_hw {
 * function to change hardware configuration, e.g., channel. */
int (*config)(struct net_device *dev, struct ieee80211_conf *conf);
 
+   /* ieee80211 drivers should use this and not the function in
+* net_device. dev->flags, dev->mc_count and dev->mc_list must not
+* be used; use passed parameters and ieee80211_get_mc_list_item
+* instead. */
+   void (*set_multicast_list)(struct net_device *dev,
+  unsigned short flags, int mc_count);
+
/* Set TIM bit handler. If the hardware/firmware takes care of beacon
 * generation, IEEE 802.11 code uses this function to tell the
 * low-level to set (or clear if set==0) TIM bit for the given aid. If
@@ -708,6 +715,13 @@ typedef enum {
 } Netif_Oper;
 int ieee80211_netif_oper(struct net_device *dev, Netif_Oper op);
 
+/* Iteration over items in multicast list of given device. To get the first
+ * item, pass NULL in prev and in *ptr. In subsequent calls, pass the value
+ * returned by previous call in prev. Don't alter *ptr during iteration.
+ * When there are no more items, NULL is returned. */
+struct dev_mc_list *ieee80211_get_mc_list_item(struct net_device *dev,
+  struct dev_mc_list *prev,
+  void **ptr);
 
 /*
  * Function to get hardware configuration information
Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:17:50.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:18:01.0 +0100
@@ -1793,6 +1793,75 @@ static int ieee80211_set_mac_address(str
return 0;
 }
 
+static void ieee80211_set_multicast_list(struct net_device *dev)
+{
+   struct ieee80211_local *local = dev->priv;
+struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+   unsigned short flags;
+
+   if (((dev->flags & IFF_ALLMULTI) != 0) ^ (sdata->allmulti != 0)) {
+   if (sdata->allmulti) {
+   sdata->allmulti = 0;
+   local->iff_allmultis--;
+   } else {
+   sdata->allmulti = 1;
+   local->iff_allmultis++;
+   }
+   }
+   if (((dev->flags & IFF_PROMISC) != 0) ^ (sdata->promisc != 0)) {
+   if (sdata->promisc) {
+   sdata->promisc = 0;
+   local->iff_promiscs--;
+   } else {
+   sdata->promisc = 1;
+   local->iff_promiscs++;
+   }
+   }
+   if (dev->mc_count != sdata->mc_count) {
+   local->mc_count = local->mc_count - sdata->mc_count +
+ dev->mc_count;
+   sdata->mc_count = dev->mc_count;
+   }
+   if (local->hw->set_multicast_list) {
+   flags = sdata->master->flags;
+   if (local->iff_allmultis)
+   flags |= IFF_ALLMULTI;
+   if (local->iff_promiscs)
+   flags |= IFF_PROMISC;
+   local->hw->set_multicast_list(sdata->master, flags,
+ local->mc_count);
+   }
+}
+
+struct dev_mc_list *ieee80211_get_mc_list_item(struct net_device *dev,
+  struct dev_mc_list *prev,
+  void **ptr)
+{
+   struct ieee80211_local *local = dev->priv;
+   struct ieee80211_sub_if_data *sdata = *ptr;
+   struct dev_mc_list *mc;
+
+   if (!prev) {
+   WARN_ON(sdata);
+   sdata = NULL;
+   }
+   if (!prev || !prev->next) {
+   if (sdata)
+   sdata = list_entry(sdata->list.next,
+  struct ieee80211_sub_if_data, list);
+   else
+   sdata = list_entry(local->sub_if_list.next,
+  struct ieee80211_sub_if_data, list);
+   if (&sdata->list != &local->sub_if_list)
+   mc = sdata->dev->mc_list;
+   else
+   mc = NULL;
+   } else
+   mc = prev->next;
+
+   *ptr = sdata;
+   return mc;
+}
 
 static struct net_device_stats *ieee80211

[RFC/PATCH 11/13] d80211: fix handling of received frames

2006-03-06 Thread Jiri Benc
Make sure that every frame reaches every interface it belongs to.
Previously, some packet (most notably multicast ones) were not delivered to
all interface they should be delivered to. This also allows monitor
interfaces to work easily, even together with regular interfaces.

On a typical setup (i.e. one or two interfaces only) this patch shouldn't
have significant impact on performance. However, on a setup with great
number of interfaces, things will probably slow down. This is not a problem
with design of this patch - things can be relatively easily sped up later.
See related comment in 'd80211: remove obsolete stuff' patch.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:18:01.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:18:06.0 +0100
@@ -1999,73 +1999,10 @@ static int header_parse_80211(struct sk_
return ETH_ALEN;
 }
 
-
-static struct net_device *
-ieee80211_get_wds_dev(struct ieee80211_local *local, u8 *addr)
-{
-   struct list_head *ptr;
-
-   list_for_each(ptr, &local->sub_if_list) {
-   struct ieee80211_sub_if_data *sdata =
-   list_entry(ptr, struct ieee80211_sub_if_data, list);
-   if (sdata->type == IEEE80211_SUB_IF_TYPE_WDS &&
-   memcmp(addr, sdata->u.wds.remote_addr, ETH_ALEN) == 0)
-   return sdata->dev;
-   }
-
-   return NULL;
-}
-
-
-static struct net_device * ieee80211_own_bssid(struct ieee80211_local *local,
-  u8 *addr)
+static inline int ieee80211_bssid_match(u8 *raddr, u8 *addr)
 {
-   struct net_device *dev = NULL;
-   struct ieee80211_sub_if_data *sdata;
-
-   spin_lock_bh(&local->sub_if_lock);
-   list_for_each_entry(sdata, &local->sub_if_list, list) {
-   if (sdata->type == IEEE80211_SUB_IF_TYPE_AP &&
-   memcmp(addr, sdata->dev->dev_addr, ETH_ALEN) == 0) {
-   dev = sdata->dev;
-   break;
-   }
-   }
-   spin_unlock_bh(&local->sub_if_lock);
-
-   return dev;
-}
-
-
-static struct net_device * ieee80211_sta_bssid(struct ieee80211_local *local,
-  u8 *addr, u8 *a1,
-  int *sta_multicast)
-{
-   struct list_head *ptr;
-   int multicast;
-
-   multicast = a1[0] & 0x01;
-
-   /* Could not find station interface, resort to O(n) lookup. */
-   list_for_each(ptr, &local->sub_if_list) {
-   struct ieee80211_sub_if_data *sdata =
-   list_entry(ptr, struct ieee80211_sub_if_data, list);
-   if (sdata->type != IEEE80211_SUB_IF_TYPE_STA &&
-   sdata->type != IEEE80211_SUB_IF_TYPE_IBSS)
-   continue;
-   if (!multicast &&
-   memcmp(a1, sdata->dev->dev_addr, ETH_ALEN) != 0)
-   continue;
-
-   if (memcmp(addr, sdata->u.sta.bssid, ETH_ALEN) == 0 ||
-   (memcmp(addr, "\xff\xff\xff\xff\xff\xff", ETH_ALEN) == 0 &&
-sdata->type == IEEE80211_SUB_IF_TYPE_IBSS)) {
-   *sta_multicast = multicast;
-   return sdata->dev;
-   }
-   }
-
-   return NULL;
+   return memcmp(raddr, addr, ETH_ALEN) == 0 ||
+  is_broadcast_ether_addr(raddr);
 }
 
 
@@ -2107,8 +2044,7 @@ ieee80211_rx_h_data(struct ieee80211_txr
memcpy(dst, hdr->addr3, ETH_ALEN);
memcpy(src, hdr->addr2, ETH_ALEN);
 
-   if (unlikely(sdata->type != IEEE80211_SUB_IF_TYPE_AP ||
-!ieee80211_own_bssid(local, hdr->addr1))) {
+   if (unlikely(sdata->type != IEEE80211_SUB_IF_TYPE_AP)) {
printk(KERN_DEBUG "%s: dropped ToDS frame (BSSID="
   MACSTR " SA=" MACSTR " DA=" MACSTR ")\n",
   dev->name, MAC2STR(hdr->addr1),
@@ -2121,8 +2057,7 @@ ieee80211_rx_h_data(struct ieee80211_txr
memcpy(dst, hdr->addr3, ETH_ALEN);
memcpy(src, hdr->addr4, ETH_ALEN);
 
-   dev = ieee80211_get_wds_dev(local, hdr->addr2);
-   if (!dev || memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) != 0) {
+   if (unlikely(sdata->type != IEEE80211_SUB_IF_TYPE_WDS)) {
printk(KERN_DEBUG "%s: dropped FromDS&ToDS frame (RA="
   MACSTR " TA=" MACSTR " DA=" MACSTR " SA="
   MACSTR ")\n",
@@ -2137,9 +2072,7 @@ ieee80211_rx_h_data(struct ieee80211_txr
memcpy(dst, hdr->addr1, ETH_ALEN);
memcpy(src, hdr->addr3, ETH_ALEN);
 
-   if (sdata->type != IEEE80211_SUB_IF_T

[RFC/PATCH 0/13] d80211: simplify userspace interface

2006-03-06 Thread Jiri Benc
This is a first series of patches for making d80211 to be more intelligible
for users. Changes are rather invasive - I tried to put them to smaller
patches, although only a few of these patches are usable standalone.

All these changes are made with keeping backward userspace compatibility in
mind. (This probably won't be 100 % achievable in case of AP and WDS mode,
but it can be solved with a new driver for hostapd. There should be no
incompatible changes to those modes yet.)

The main goal is to reduce the number of devices (network interfaces)
presented to userspace. This is not as easy as it seems to be. These patches
don't reduce devices yet, but they are the first step. At least, user is not
required to deal with more than one interface now.

What these patches do?
- You are no longer required to specify type of network interface you are
  adding. Just add a new device (by writing the name to the appropriate
  sysfs attribute) and set its mode by iwconfig.
- Ad-hoc mode is not treated specially now - just add a new network
  interface (or reuse one of previously added) and set it to ad-hoc mode by
  iwconfig.
- Network interfaces are fully independent now. You can add as many
  interfaces as you want, set their parameters (by iwconfig, etc.) and then
  UP them. If the combination of running interfaces you are trying to
  achieve is not allowed, you'll get an error. This way, you can e.g.
  configure several STA (managed) interfaces and, if the hardware supports
  it, put them all UP. Or, you can have an AP interface and a STA interface
  connected to another AP at the same time, etc.
- Master device goes up/down automatically.
- Promiscious mode for individual interfaces works now. This means you will
  receive all packets from your BSS.
- Introduce "soft" vs. "hard" monitor mode. You can have a monitor interface
  together with a regular interface even if the hardware doesn't support it.
  You won't receive any frames except the ones destined to you, of course.
  This is called a "soft monitor". When the monitor interface is the only
  one running, it will automatically switch to a "hard monitor" mode and you
  will receive everything.

Patches need to be applied on top of patches sent by Jouni Malinen few days
ago.

The whole series is also available as 'experimental' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/jbenc/dscape.git.

-- 
Jiri Benc
SUSE Labs
-
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


[RFC/PATCH 3/13] d80211: non-shared interface types

2006-03-06 Thread Jiri Benc
This patch removes "iwmode" variable (local->conf.mode) shared by all
interfaces. Instead, every interface has its own type (STA/IBSS/AP/WDS).

Please note, that
- Actual SIOCSIWMODE ioctl is disabled by this patch and is implemented by
  one of subsequent patches.
- There is no way to ask the driver if given combination of interfaces is
  possible. Again, it is implemented by one of subsequent patches.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:09:53.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:10:07.0 +0100
@@ -868,7 +868,7 @@ ieee80211_tx_h_check_assoc(struct ieee80
 
if (likely(tx->u.tx.unicast)) {
if (unlikely(!(sta_flags & WLAN_STA_ASSOC) &&
-tx->local->conf.mode != IW_MODE_ADHOC &&
+tx->sdata->type != IEEE80211_SUB_IF_TYPE_IBSS &&
 WLAN_FC_GET_TYPE(tx->fc) == WLAN_FC_TYPE_DATA)) {
 #ifdef CONFIG_D80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: dropped data frame to not "
@@ -882,7 +882,7 @@ ieee80211_tx_h_check_assoc(struct ieee80
if (unlikely(WLAN_FC_GET_TYPE(tx->fc) == WLAN_FC_TYPE_DATA &&
 tx->local->num_sta == 0 &&
 !tx->local->allow_broadcast_always &&
-tx->local->conf.mode != IW_MODE_ADHOC)) {
+tx->sdata->type != IEEE80211_SUB_IF_TYPE_IBSS)) {
/*
 * No associated STAs - no need to send multicast
 * frames.
@@ -1285,24 +1285,11 @@ static int ieee80211_subif_start_xmit(st
 
if (likely(sdata->type == IEEE80211_SUB_IF_TYPE_AP ||
   sdata->type == IEEE80211_SUB_IF_TYPE_VLAN)) {
-   if (local->conf.mode == IW_MODE_MASTER) {
-   fc |= WLAN_FC_FROMDS;
-   /* DA BSSID SA */
-   memcpy(hdr.addr1, skb->data, ETH_ALEN);
-   memcpy(hdr.addr2, dev->dev_addr, ETH_ALEN);
-   memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN);
-   } else if (local->conf.mode == IW_MODE_INFRA) {
-   fc |= WLAN_FC_TODS;
-   /* BSSID SA DA */
-   memcpy(hdr.addr1, local->bssid, ETH_ALEN);
-   memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
-   memcpy(hdr.addr3, skb->data, ETH_ALEN);
-   } else if (local->conf.mode == IW_MODE_ADHOC) {
-   /* DA SA BSSID */
-   memcpy(hdr.addr1, skb->data, ETH_ALEN);
-   memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
-   memcpy(hdr.addr3, local->bssid, ETH_ALEN);
-   }
+   fc |= WLAN_FC_FROMDS;
+   /* DA BSSID SA */
+   memcpy(hdr.addr1, skb->data, ETH_ALEN);
+   memcpy(hdr.addr2, dev->dev_addr, ETH_ALEN);
+   memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN);
 hdrlen = 24;
 } else if (sdata->type == IEEE80211_SUB_IF_TYPE_WDS) {
 fc |= WLAN_FC_FROMDS | WLAN_FC_TODS;
@@ -1313,18 +1300,17 @@ static int ieee80211_subif_start_xmit(st
 memcpy(hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN);
 hdrlen = 30;
 } else if (sdata->type == IEEE80211_SUB_IF_TYPE_STA) {
-   if (local->conf.mode == IW_MODE_INFRA) {
-   fc |= WLAN_FC_TODS;
-   /* BSSID SA DA */
-   memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN);
-   memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
-   memcpy(hdr.addr3, skb->data, ETH_ALEN);
-   } else {
-   /* DA SA BSSID */
-   memcpy(hdr.addr1, skb->data, ETH_ALEN);
-   memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
-   memcpy(hdr.addr3, sdata->u.sta.bssid, ETH_ALEN);
-   }
+   fc |= WLAN_FC_TODS;
+   /* BSSID SA DA */
+   memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN);
+   memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
+   memcpy(hdr.addr3, skb->data, ETH_ALEN);
+   hdrlen = 24;
+   } else if (sdata->type == IEEE80211_SUB_IF_TYPE_IBSS) {
+   /* DA SA BSSID */
+   memcpy(hdr.addr1, skb->data, ETH_ALEN);
+   memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
+   memcpy(hdr.addr3, sdata->u.sta.bssid, ETH_ALEN);
hdrlen = 24;
 } else {
 ret = 0;
@@ -1722,9 +1708,9 @@ int ieee80211_hw_config(struct net_devic
int i

[RFC/PATCH 12/13] d80211: fix monitor interfaces

2006-03-06 Thread Jiri Benc
This patch allows monitor interfaces to be set by SIOCSIWMODE and to receive
frames.

Also, "soft" and "hard" monitor modes are introduced.  

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/include/net/d80211.h
===
--- dscape.orig/include/net/d80211.h2006-03-06 14:18:01.0 +0100
+++ dscape/include/net/d80211.h 2006-03-06 14:18:10.0 +0100
@@ -430,6 +430,10 @@ struct ieee80211_hw {
 */
unsigned int device_strips_mic:1;
 
+   /* Device is capable of performing full monitor mode even during
+* normal operation. */
+   unsigned int monitor_during_oper:1;
+
/* 1 = low-level driver supports skb fraglist (NETIF_F_FRAGLIST), i.e.,
 * more than one skb per frame */
unsigned int fraglist;
@@ -465,7 +469,9 @@ struct ieee80211_hw {
 * more exactly, set UP). If the handler returns zero, the interface
 * is added. Driver should perform any initialization it needs prior
 * to returning zero. By returning non-zero, adding of the interface
-* is not permitted. The open() handler is called after
+* is not permitted. Unless monitor_during_oper is set, it is
+* guaranteed that monitor interfaces and normal interfaces are
+* mutually exclusive. The open() handler is called after
 * add_interface() if this is the first device added. At least one
 * of open() and add_interface() handler has to be non-NULL. If
 * add_interface() is NULL, one STA interface is permitted only. */
Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:18:06.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:18:10.0 +0100
@@ -1872,7 +1872,9 @@ static struct net_device_stats *ieee8021
 
 static inline int identical_mac_addr_allowed(int type1, int type2)
 {
-   return ((type1 == IEEE80211_SUB_IF_TYPE_AP &&
+   return (type1 == IEEE80211_SUB_IF_TYPE_MNTR ||
+   type2 == IEEE80211_SUB_IF_TYPE_MNTR ||
+   (type1 == IEEE80211_SUB_IF_TYPE_AP &&
 type2 == IEEE80211_SUB_IF_TYPE_WDS) ||
(type1 == IEEE80211_SUB_IF_TYPE_WDS &&
 (type2 == IEEE80211_SUB_IF_TYPE_WDS ||
@@ -1906,6 +1908,34 @@ static int ieee80211_master_stop(struct 
return 0;
 }
 
+/* Check if running monitor interfaces should go to a "soft monitor" mode
+ * and switch them if necessary. */
+static inline void ieee80211_start_soft_monitor(struct ieee80211_local *local)
+{
+   struct ieee80211_if_conf conf;
+
+   if (local->open_count && local->open_count == local->monitors &&
+   !local->hw->monitor_during_oper && local->hw->remove_interface) {
+   conf.type = IEEE80211_SUB_IF_TYPE_MNTR;
+   conf.mac_addr = NULL;
+   local->hw->remove_interface(local->mdev, &conf);
+   }
+}
+
+/* Check if running monitor interfaces should go to a "hard monitor" mode
+ * and switch them if necessary. */
+static void ieee80211_start_hard_monitor(struct ieee80211_local *local)
+{
+   struct ieee80211_if_conf conf;
+
+   if (local->open_count && local->open_count == local->monitors &&
+   !local->hw->monitor_during_oper && local->hw->add_interface) {
+   conf.type = IEEE80211_SUB_IF_TYPE_MNTR;
+   conf.mac_addr = NULL;
+   local->hw->add_interface(local->mdev, &conf);
+   }
+}
+
 static int ieee80211_open(struct net_device *dev)
 {
struct ieee80211_sub_if_data *sdata, *nsdata;
@@ -1929,12 +1959,24 @@ static int ieee80211_open(struct net_dev
memcmp(sdata->u.wds.remote_addr, "\0\0\0\0\0\0", ETH_ALEN) == 0)
return -ENOLINK;
 
+   if (sdata->type == IEEE80211_SUB_IF_TYPE_MNTR && local->open_count &&
+   !local->hw->monitor_during_oper) {
+   /* run the interface in a "soft monitor" mode */
+   local->monitors++;
+   local->open_count++;
+   return 0;
+   }
+   ieee80211_start_soft_monitor(local);
+
if (local->hw->add_interface) {
conf.type = sdata->type;
conf.mac_addr = dev->dev_addr;
res = local->hw->add_interface(sdata->master, &conf);
-   if (res)
+   if (res) {
+   if (sdata->type == IEEE80211_SUB_IF_TYPE_MNTR)
+   ieee80211_start_hard_monitor(local);
return res;
+   }
} else {
if (sdata->type != IEEE80211_SUB_IF_TYPE_STA)
return -EOPNOTSUPP;
@@ -1972,6 +2014,14 @@ static int ieee80211_stop(struct net_dev
 
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
+   if (sdata->type == IEEE80211_SUB_IF_TYPE_MNTR &&
+   local->open_count > 1 && !local->hw->m

[RFC/PATCH 2/13] d80211: add IBSS and monitor interface types

2006-03-06 Thread Jiri Benc
Add constants for IBSS and monitor interface types. These constants are used
in subsequent patches.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/net/d80211/ieee80211_i.h
===
--- dscape.orig/net/d80211/ieee80211_i.h2006-03-06 14:09:53.0 
+0100
+++ dscape/net/d80211/ieee80211_i.h 2006-03-06 14:10:01.0 +0100
@@ -259,6 +259,8 @@ struct ieee80211_if_sta {
 #define IEEE80211_SUB_IF_TYPE_AP   0x
 #define IEEE80211_SUB_IF_TYPE_MGMT 0x0001
 #define IEEE80211_SUB_IF_TYPE_STA  0x0002
+#define IEEE80211_SUB_IF_TYPE_IBSS 0x0003
+#define IEEE80211_SUB_IF_TYPE_MNTR 0x0004
 #define IEEE80211_SUB_IF_TYPE_WDS  0x5A580211
 #define IEEE80211_SUB_IF_TYPE_VLAN 0x00080211
 
-
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


[RFC/PATCH 7/13] d80211: remove adm_status

2006-03-06 Thread Jiri Benc
PRISM2_PARAM_ADM_STATUS is not used anywhere in kernel nor in userspace.
It just passes a value to the driver, so it's safe to remove it.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/net/d80211/hostapd_ioctl.h
===
--- dscape.orig/net/d80211/hostapd_ioctl.h  2006-03-06 14:10:22.0 
+0100
+++ dscape/net/d80211/hostapd_ioctl.h   2006-03-06 14:10:28.0 +0100
@@ -64,7 +64,6 @@ enum {
PRISM2_PARAM_TEST_MODE = 1007,
PRISM2_PARAM_NEXT_MODE = 1008,
PRISM2_PARAM_CLEAR_KEYS = 1009,
-   PRISM2_PARAM_ADM_STATUS = 1010,
PRISM2_PARAM_ANTENNA_SEL = 1011,
PRISM2_PARAM_CALIB_INT = 1012,
 PRISM2_PARAM_ANTENNA_MODE = 1013,
Index: dscape/net/d80211/ieee80211_ioctl.c
===
--- dscape.orig/net/d80211/ieee80211_ioctl.c2006-03-06 14:10:22.0 
+0100
+++ dscape/net/d80211/ieee80211_ioctl.c 2006-03-06 14:10:28.0 +0100
@@ -1165,15 +1165,6 @@ static int ieee80211_ioctl_set_regulator
 return 0;
 }
 
-
-static int ieee80211_ioctl_set_adm_status(struct net_device *dev,
- int val)
-{
-struct ieee80211_conf *conf = ieee80211_get_hw_conf(dev);
-conf->adm_status = val;
-return ieee80211_hw_config(dev);
-}
-
 static int
 ieee80211_ioctl_set_tx_queue_params(struct net_device *dev,
struct prism2_hostapd_param *param)
@@ -1580,7 +1571,6 @@ static int ieee80211_init_client(struct 
if (ieee80211_regdom == 0x40)
channel_range = ieee80211_mkk_channels;
ieee80211_unmask_channels(dev);
-   ieee80211_ioctl_set_adm_status(dev, 1);
return 0;
 }
 
@@ -2323,10 +2313,6 @@ static int ieee80211_ioctl_prism2_param(
ret = ieee80211_ioctl_clear_keys(dev);
break;
 
-   case PRISM2_PARAM_ADM_STATUS:
-ret = ieee80211_ioctl_set_adm_status(dev, value);
-   break;
-
case PRISM2_PARAM_ANTENNA_SEL:
local->conf.antenna_sel = value;
if (ieee80211_hw_config(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


[RFC/PATCH 4/13] d80211: remove local->bssid variable

2006-03-06 Thread Jiri Benc
BSSID shouldn't be common for all interfaces.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:10:07.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:10:15.0 +0100
@@ -2063,7 +2063,7 @@ ieee80211_rx_h_data(struct ieee80211_txr
memcpy(src, hdr->addr2, ETH_ALEN);
 
if (sdata->type != IEEE80211_SUB_IF_TYPE_IBSS ||
-   memcmp(hdr->addr3, local->bssid, ETH_ALEN) != 0) {
+   memcmp(hdr->addr3, sdata->u.sta.bssid, ETH_ALEN) != 0) {
if (net_ratelimit()) {
printk(KERN_DEBUG "%s: dropped IBSS frame (DA="
   MACSTR " SA=" MACSTR " BSSID=" MACSTR
@@ -2803,7 +2803,7 @@ ieee80211_rx_h_sta_process(struct ieee80
 * other STAs are using different BSSID. */
if (rx->sdata->type == IEEE80211_SUB_IF_TYPE_IBSS) {
u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len);
-   if (memcmp(bssid, rx->local->bssid, ETH_ALEN) == 0)
+   if (memcmp(bssid, rx->sdata->u.sta.bssid, ETH_ALEN) == 0)
sta->last_rx = jiffies;
} else
if (!MULTICAST_ADDR(hdr->addr1) ||
Index: dscape/net/d80211/ieee80211_i.h
===
--- dscape.orig/net/d80211/ieee80211_i.h2006-03-06 14:10:01.0 
+0100
+++ dscape/net/d80211/ieee80211_i.h 2006-03-06 14:10:15.0 +0100
@@ -433,7 +433,6 @@ struct ieee80211_local {
 u32 stat_time;
 struct timer_list stat_timer;
 
-   u8 bssid[ETH_ALEN]; /* BSSID for STA modes (Adhoc/Managed) */
 struct timer_list rate_limit_timer;
 u32 rate_limit;
 u32 rate_limit_burst;
Index: dscape/net/d80211/ieee80211_sta.c
===
--- dscape.orig/net/d80211/ieee80211_sta.c  2006-03-06 14:10:07.0 
+0100
+++ dscape/net/d80211/ieee80211_sta.c   2006-03-06 14:10:15.0 +0100
@@ -1365,7 +1365,7 @@ static void ieee80211_rx_bss_info(struct
((u64) pos[1] << 8) | ((u64) pos[0]);
 
if (sdata->type == IEEE80211_SUB_IF_TYPE_IBSS && beacon &&
-   memcmp(mgmt->bssid, local->bssid, ETH_ALEN) == 0) {
+   memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0) {
 #ifdef IEEE80211_IBSS_DEBUG
static unsigned long last_tsf_debug = 0;
u64 tsf;
@@ -1389,7 +1389,7 @@ static void ieee80211_rx_bss_info(struct
invalid = 1;
 
if (sdata->type == IEEE80211_SUB_IF_TYPE_IBSS && elems.supp_rates &&
-   memcmp(mgmt->bssid, local->bssid, ETH_ALEN) == 0 &&
+   memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0 &&
(sta = sta_info_get(local, mgmt->sa))) {
struct ieee80211_rate *rates;
size_t num_rates;
@@ -1990,7 +1990,6 @@ static int ieee80211_sta_join_ibss(struc
local->hw->reset_tsf(local->mdev);
}
memcpy(ifsta->bssid, bss->bssid, ETH_ALEN);
-   memcpy(local->bssid, bss->bssid, ETH_ALEN);
memcpy(local->conf.client_bssid, bss->bssid, ETH_ALEN);
 
local->conf.beacon_int = bss->beacon_int >= 10 ? bss->beacon_int : 10;
@@ -2344,7 +2343,6 @@ int ieee80211_sta_get_ssid(struct net_de
 
 int ieee80211_sta_set_bssid(struct net_device *dev, u8 *bssid)
 {
-   struct ieee80211_local *local = dev->priv;
struct ieee80211_sub_if_data *sdata;
struct ieee80211_if_sta *ifsta;
 
@@ -2352,8 +2350,6 @@ int ieee80211_sta_set_bssid(struct net_d
ifsta = &sdata->u.sta;
 
memcpy(ifsta->bssid, bssid, ETH_ALEN);
-   if (sdata->type == IEEE80211_SUB_IF_TYPE_IBSS)
-   memcpy(local->bssid, bssid, ETH_ALEN);
 
if (memcmp(bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0)
ifsta->bssid_set = 0;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH 13/13] d80211: fix AP interfaces

2006-03-06 Thread Jiri Benc
This allows interfaces of IEEE80211_SUB_IF_TYPE_MGMT type (wlan%dap
interfaces) to be put UP.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:18:10.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:18:51.0 +0100
@@ -1874,6 +1874,8 @@ static inline int identical_mac_addr_all
 {
return (type1 == IEEE80211_SUB_IF_TYPE_MNTR ||
type2 == IEEE80211_SUB_IF_TYPE_MNTR ||
+   type1 == IEEE80211_SUB_IF_TYPE_MGMT ||
+   type2 == IEEE80211_SUB_IF_TYPE_MGMT ||
(type1 == IEEE80211_SUB_IF_TYPE_AP &&
 type2 == IEEE80211_SUB_IF_TYPE_WDS) ||
(type1 == IEEE80211_SUB_IF_TYPE_WDS &&
-
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


[RFC/PATCH 9/13] d80211: master interface auto up/down

2006-03-06 Thread Jiri Benc
There is no reason to put master interface to UP/DOWN state manually.

Calling of hw->open and hw->stop callbacks logically belongs to
ieee80211_master_open and ieee80211_master_stop functions, but then we need
to refuse putting master interface to UP state when there is no other
interface running, and similarly, to refuse putting master interface DOWN
when there are other interfaces running. Because the second is not possible,
hw->open and hw->stop need to be called from ieee80211_open/ieee80211_stop.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:16:21.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:17:50.0 +0100
@@ -1810,10 +1810,38 @@ static inline int identical_mac_addr_all
  type2 == IEEE80211_SUB_IF_TYPE_AP)));
 }
 
+static int ieee80211_master_open(struct net_device *dev)
+{
+   struct ieee80211_local *local = dev->priv;
+   struct ieee80211_sub_if_data *sdata;
+   int res = -EOPNOTSUPP;
+
+   list_for_each_entry(sdata, &local->sub_if_list, list) {
+   if (sdata->dev != dev && netif_running(sdata->dev)) {
+   res = 0;
+   break;
+   }
+   }
+   return res;
+}
+
+static int ieee80211_master_stop(struct net_device *dev)
+{
+   struct ieee80211_local *local = dev->priv;
+   struct ieee80211_sub_if_data *sdata;
+
+   list_for_each_entry(sdata, &local->sub_if_list, list) {
+   if (sdata->dev != dev && netif_running(sdata->dev))
+   return -EOPNOTSUPP;
+   }
+   return 0;
+}
+
 static int ieee80211_open(struct net_device *dev)
 {
struct ieee80211_sub_if_data *sdata, *nsdata;
struct ieee80211_local *local = dev->priv;
+   struct ieee80211_if_conf conf;
int res;
 
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
@@ -1833,8 +1861,6 @@ static int ieee80211_open(struct net_dev
return -ENOLINK;
 
if (local->hw->add_interface) {
-   struct ieee80211_if_conf conf;
-
conf.type = sdata->type;
conf.mac_addr = dev->dev_addr;
res = local->hw->add_interface(sdata->master, &conf);
@@ -1848,10 +1874,18 @@ static int ieee80211_open(struct net_dev
}
 
 if (local->open_count == 0) {
-   if (local->hw->open) {
+   res = 0;
+   if (local->hw->open)
res = local->hw->open(sdata->master);
-   if (res)
-   return res;
+   if (res == 0) {
+   res = dev_open(sdata->master);
+   if (res && local->hw->stop)
+   local->hw->stop(sdata->master);
+   }
+   if (res) {
+   if (local->hw->remove_interface)
+   local->hw->remove_interface(dev, &conf);
+   return res;
}
ieee80211_init_scan(sdata->master);
}
@@ -1866,7 +1900,6 @@ static int ieee80211_stop(struct net_dev
 {
struct ieee80211_sub_if_data *sdata;
struct ieee80211_local *local = dev->priv;
-   int res;
 
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
@@ -1875,11 +1908,9 @@ static int ieee80211_stop(struct net_dev
local->open_count--;
 if (local->open_count == 0) {
ieee80211_stop_scan(sdata->master);
-   if (local->hw->stop) {
-   res = local->hw->stop(sdata->master);
-   if (res)
-   return res;
-   }
+   dev_close(sdata->master);
+   if (local->hw->stop)
+   local->hw->stop(sdata->master);
 }
if (local->hw->remove_interface) {
struct ieee80211_if_conf conf;
@@ -4013,8 +4044,8 @@ struct net_device *ieee80211_alloc_hw(si
mdev->change_mtu = ieee80211_change_mtu;
 mdev->tx_timeout = ieee80211_tx_timeout;
 mdev->get_stats = ieee80211_get_stats;
-mdev->open = ieee80211_open;
-   mdev->stop = ieee80211_stop;
+   mdev->open = ieee80211_master_open;
+   mdev->stop = ieee80211_master_stop;
mdev->type = ARPHRD_IEEE80211;
 mdev->hard_header_parse = header_parse_80211;
sprintf(mdev->name, "%s.11", dev->name);
-
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


[RFC/PATCH 1/13] d80211: allow WDS remote to by set by WE

2006-03-06 Thread Jiri Benc
Setting of address of WDS remote peer wasn't possible by a WE call. Remote
WDS peer can be understood as a remote AP and SIOCSIWAP/SIOCGIWAP are unused
in WDS mode, so let's use them.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 13:56:48.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:09:53.0 +0100
@@ -3944,25 +3944,11 @@ int ieee80211_if_add_wds(struct net_devi
 }
 
 
-int ieee80211_if_update_wds(struct net_device *dev, char *name,
-   struct ieee80211_if_wds *wds, int locked)
+int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr)
 {
-   struct net_device *wds_dev = NULL;
struct ieee80211_local *local = dev->priv;
-   struct ieee80211_sub_if_data *sdata = NULL;
+   struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct sta_info *sta;
-   struct list_head *ptr;
-
-   list_for_each(ptr, &local->sub_if_list) {
-   sdata = list_entry(ptr, struct ieee80211_sub_if_data, list);
-   if (strcmp(name, sdata->dev->name) == 0) {
-   wds_dev = sdata->dev;
-   break;
-   }
-   }
-
-   if (wds_dev == NULL || sdata->type != IEEE80211_SUB_IF_TYPE_WDS)
-   return -ENODEV;
 
/* Remove STA entry for the old peer */
sta = sta_info_get(local, sdata->u.wds.remote_addr);
@@ -3971,13 +3957,12 @@ int ieee80211_if_update_wds(struct net_d
sta_info_free(local, sta, 0);
} else {
printk(KERN_DEBUG "%s: could not find STA entry for WDS link "
-  "%s peer " MACSTR "\n",
-  dev->name, wds_dev->name,
-  MAC2STR(sdata->u.wds.remote_addr));
+  "peer " MACSTR "\n",
+  dev->name, MAC2STR(sdata->u.wds.remote_addr));
}
 
/* Update WDS link data */
-memcpy(&sdata->u.wds, wds, sizeof(struct ieee80211_if_wds));
+   memcpy(&sdata->u.wds.remote_addr, remote_addr, ETH_ALEN);
 
return 0;
 }
Index: dscape/net/d80211/ieee80211_ioctl.c
===
--- dscape.orig/net/d80211/ieee80211_ioctl.c2006-03-06 13:56:48.0 
+0100
+++ dscape/net/d80211/ieee80211_ioctl.c 2006-03-06 14:09:53.0 +0100
@@ -997,17 +997,27 @@ static int ieee80211_ioctl_update_if(str
 int left = param_len - ((u8 *) pos - (u8 *) param);
 
if (param->u.if_info.type == HOSTAP_IF_WDS) {
-   struct ieee80211_if_wds iwds;
struct hostapd_if_wds *wds =
(struct hostapd_if_wds *) param->u.if_info.data;
+   struct ieee80211_local *local = dev->priv;
+   struct net_device *wds_dev = NULL;
+   struct ieee80211_sub_if_data *sdata;
 
if (left < sizeof(struct ieee80211_if_wds))
return -EPROTO;
 
-   memcpy(iwds.remote_addr, wds->remote_addr, ETH_ALEN);
+   list_for_each_entry(sdata, &local->sub_if_list, list) {
+   if (strcmp(param->u.if_info.name,
+  sdata->dev->name) == 0) {
+   wds_dev = sdata->dev;
+   break;
+   }
+   }
 
-   return ieee80211_if_update_wds(dev, param->u.if_info.name,
-  &iwds, 1);
+   if (wds_dev == NULL || sdata->type != IEEE80211_SUB_IF_TYPE_WDS)
+   return -ENODEV;
+
+   return ieee80211_if_update_wds(wds_dev, wds->remote_addr);
} else {
return -EOPNOTSUPP;
}
@@ -1842,6 +1852,11 @@ static int ieee80211_ioctl_siwap(struct 
   "the low-level driver\n", dev->name);
}
return ieee80211_sta_set_bssid(dev, (u8 *) &ap_addr->sa_data);
+   } else if (sdata->type == IEEE80211_SUB_IF_TYPE_WDS) {
+   if (memcmp(sdata->u.wds.remote_addr, (u8 *) &ap_addr->sa_data,
+  ETH_ALEN) != 0)
+   return 0;
+   return ieee80211_if_update_wds(dev, (u8 *) &ap_addr->sa_data);
}
 
return -EOPNOTSUPP;
@@ -1859,6 +1874,10 @@ static int ieee80211_ioctl_giwap(struct 
ap_addr->sa_family = ARPHRD_ETHER;
memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN);
return 0;
+   } else if (sdata->type == IEEE80211_SUB_IF_TYPE_WDS) {
+   ap_addr->sa_family = ARPHRD_ETHER;
+   memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN);
+   return 0;
}
 
return -EOPNOTSUPP;
Index: dscape/net/d80211/ieee80211_i.

[RFC/PATCH 5/13] d80211: ask driver for allowed iface combinations

2006-03-06 Thread Jiri Benc
Not all combinations of interfaces (in fact, very few combination of
interfaces) are possible to be UP together. When an interface is going UP,
let's ask the driver if this is possible.

Please note that ieee80211_if_conf structure is not complete yet - new
fields will need to be added to allow drivers to decide.

Signed-off-by: Jiri Benc <[EMAIL PROTECTED]>

Index: dscape/include/net/d80211.h
===
--- dscape.orig/include/net/d80211.h2006-03-06 14:10:07.0 +0100
+++ dscape/include/net/d80211.h 2006-03-06 14:10:18.0 +0100
@@ -305,6 +305,18 @@ struct ieee80211_conf {
u8 pulse_inband_threshold;
 };
 
+#define IEEE80211_SUB_IF_TYPE_AP   0x
+#define IEEE80211_SUB_IF_TYPE_MGMT 0x0001
+#define IEEE80211_SUB_IF_TYPE_STA  0x0002
+#define IEEE80211_SUB_IF_TYPE_IBSS 0x0003
+#define IEEE80211_SUB_IF_TYPE_MNTR 0x0004
+#define IEEE80211_SUB_IF_TYPE_WDS  0x5A580211
+#define IEEE80211_SUB_IF_TYPE_VLAN 0x00080211
+
+struct ieee80211_if_conf {
+   int type;
+   void *mac_addr;
+};
 
 typedef enum { ALG_NONE, ALG_WEP, ALG_TKIP, ALG_CCMP, ALG_NULL }
 ieee80211_key_alg;
@@ -452,6 +464,22 @@ struct ieee80211_hw {
 * interrupts and beacon sending. */
int (*stop)(struct net_device *dev);
 
+   /* Handler for asking a driver if a new interface can be added (or,
+* more exactly, set UP). If the handler returns zero, the interface
+* is added. Driver should perform any initialization it needs prior
+* to returning zero. By returning non-zero, adding of the interface
+* is not permitted. The open() handler is called after
+* add_interface() if this is the first device added. At least one
+* of open() and add_interface() handler has to be non-NULL. If
+* add_interface() is NULL, one STA interface is permitted only. */
+   int (*add_interface)(struct net_device *dev,
+struct ieee80211_if_conf *conf);
+
+   /* Notify a driver that interface is going down. The stop() handler
+* is called prior to this if this is a last interface. */
+   void (*remove_interface)(struct net_device *dev,
+struct ieee80211_if_conf *conf);
+
/* Handler for configuration requests. IEEE 802.11 code calls this
 * function to change hardware configuration, e.g., channel. */
int (*config)(struct net_device *dev, struct ieee80211_conf *conf);
Index: dscape/net/d80211/ieee80211_i.h
===
--- dscape.orig/net/d80211/ieee80211_i.h2006-03-06 14:10:15.0 
+0100
+++ dscape/net/d80211/ieee80211_i.h 2006-03-06 14:10:18.0 +0100
@@ -256,14 +256,6 @@ struct ieee80211_if_sta {
 };
 
 
-#define IEEE80211_SUB_IF_TYPE_AP   0x
-#define IEEE80211_SUB_IF_TYPE_MGMT 0x0001
-#define IEEE80211_SUB_IF_TYPE_STA  0x0002
-#define IEEE80211_SUB_IF_TYPE_IBSS 0x0003
-#define IEEE80211_SUB_IF_TYPE_MNTR 0x0004
-#define IEEE80211_SUB_IF_TYPE_WDS  0x5A580211
-#define IEEE80211_SUB_IF_TYPE_VLAN 0x00080211
-
 struct ieee80211_sub_if_data {
 struct list_head list;
 unsigned int type;
Index: dscape/net/d80211/ieee80211.c
===
--- dscape.orig/net/d80211/ieee80211.c  2006-03-06 14:10:15.0 +0100
+++ dscape/net/d80211/ieee80211.c   2006-03-06 14:10:18.0 +0100
@@ -1828,11 +1828,22 @@ static int ieee80211_open(struct net_dev
int res;
 
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+   if (local->hw->add_interface) {
+   struct ieee80211_if_conf conf;
 
-if (local->open_count == 0) {
-   res = local->hw->open(sdata->master);
+   conf.type = sdata->type;
+   conf.mac_addr = dev->dev_addr;
+   res = local->hw->add_interface(sdata->master, &conf);
if (res)
return res;
+   }
+
+if (local->open_count == 0) {
+   if (local->hw->open) {
+   res = local->hw->open(sdata->master);
+   if (res)
+   return res;
+   }
ieee80211_init_scan(sdata->master);
}
 local->open_count++;
@@ -1855,10 +1866,19 @@ static int ieee80211_stop(struct net_dev
local->open_count--;
 if (local->open_count == 0) {
ieee80211_stop_scan(sdata->master);
-   res = local->hw->stop(sdata->master);
-   if (res)
-   return res;
+   if (local->hw->stop) {
+   res = local->hw->stop(sdata->master);
+   if (res)
+   return res;
+   }
 }
+   if (local->hw->remove_interface) {
+   struct ieee80211_if_conf conf;
+
+ 

[Xen-devel] Announce of our Xen project; Routing simulation with Einar (fwd)

2006-03-06 Thread James Morris
This looks potentially useful for network development.

-- Forwarded message --
Date: Mon, 06 Mar 2006 17:06:11 +0100
From: Rickard Borgmäster <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [Xen-devel] Announce of our Xen project; Routing simulation with
Einar

Hello all,

Some time before Christmas, a project was started. The task was to
enhance an existing LiveCD solution with User-mode Linux. A number of
requirements was stated, where the greatest challenge was to fit 10
virtual routers within an old no-name PC with only 256MB Ram. And the
solution must still be run from a LiveCD.

Thanks to Xen, the task was possible to complete.

-But, what does it do?

With this solution, students taking CCNA/CCNP level studies can have
their own router lab on a bootable CD. No need for expensive equipment.
The student can set up a virtual network of 10 routers or hosts, and
exercise BGP, OSPF, ISIS and RIP routing. The routing software is
Quagga, whose interface is very similar to Ciscos native CLI.

Feel free to download our first Release Candidate at the project website;

http://www.isk.kth.se/proj/qroutix/

Please note that the name "Qroutix" isn't ment for the final product.
We're currently phasing over to the new name, which will impact the URL
eventually. If the abobe link doesn't work, please try:

http://www.isk.kth.se/proj/einar/

Don't hesitate to mail me or Anders feedback if you like (or dislike)
our project.

Best regards
Rickard Borgmäster


___
Xen-devel mailing list
[EMAIL PROTECTED]
http://lists.xensource.com/xen-devel

-
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: choosing IPv4 or IPv6 when creating a listening socket

2006-03-06 Thread Chuck Lever

David Stevens wrote:

The correct way is to use "in6addr_any" (or IN6ADDR_ANY_INIT to initialize
an existing one).


the kernel's in6.h has "ifdef'd out" these, it looks like.
begin:vcard
fn:Chuck Lever
n:Lever;Charles
org:Network Appliance, Incorporated;Open Source NFS Client Development
adr:535 West William Street, Suite 3100;;Center for Information Technology Integration;Ann Arbor;MI;48103-4943;USA
email;internet:[EMAIL PROTECTED]
title:Member of Technical Staff
tel;work:+1 734 763 4415
tel;fax:+1 734 763 4434
tel;home:+1 734 668 1089
x-mozilla-html:FALSE
url:http://troy.citi.umich.edu/u/cel/
version:2.1
end:vcard



Re: [Patch 7/7] Generic netlink interface (delay accounting)

2006-03-06 Thread Shailabh Nagar

Jamal,

Pls keep lkml and lse-tech on cc since some of this affects the usage
of delay accounting.


jamal wrote:


Hi Shailabh,
Apologies for taking a week to respond ..

On Mon, 2006-27-02 at 15:26 -0500, Shailabh Nagar wrote: 
 


jamal wrote:
   



 

Yes, the current intent is to allow multiple listeners to receive the 
responses sent by the kernel.
   



Responses or events? There is a difference:
Response implies the program in user space requested (ex a GET) for that
information and is receiving such info.
Event implies the program in user space asked to be informed of changes
in the kernel. Example an exit would be considered an event. 
Events are received by virtue of registering to a multicast group.
[..] 
 

My design was to have the listener get both responses (what I call 
replies in the code)

as well as events (data sent on exit of pid)

Since this interface (taskstats) is currently designed for that 
possibility, having multiple listeners, one for

each "component" such as delay accounting, is the model we're using.
We expect each component to have a pair of userspace programs, one for 
sending commands and the other
to "listen" to all replies + data generated on task exits. 
   



You need to have a sender of GETs essentially and a listener of events.
Those are two connections. The replies of a get from user1 will not be
sent to user2 as well - unless ... thats what you are trying to achieve;
the question is why?
 

Yes, I was trying to have an asymmetric model where the userspace sender 
of GETs
doesn't receive the reply as a unicast. Rather the reply is sent by 
multicast (alongwith all the

event data).

Reason for this unintuitive design was to make it easier to process the 
returned data.


The expected usage of delay accounting is to periodically "sample" the 
delays for all
tasks (or tgids) in the system. Also, get the delays from exiting pids 
(lets forget how tgid exit

is handled for now...irrelevant to this discussion).

Using the above two pieces of data, userspace can aggregate the "delays" 
seen by any

grouping of tasks that it chooses to implement.

In this usage scenario, its more efficient to have one receiver get both 
response and event

data and process in a loop.

However, we could switch to the model you suggest and use a 
multithreaded send/receive

userspace utility.

The listener 
is expected to register/deregister interest through

TASKSTATS_CMD_LISTEN and IGNORE.

   



It is not necessary if you follow the model i described.

 


How does this correlate to TASKSTATS_CMD_LISTEN/IGNORE?


 

See above. Its mainly an optimization so that if no listener is present, 
there's no need to generate the data.


   



Also not necessary - There is a recent netlink addition to make sure
that events dont get sent if no listeners exist.
genetlink needs to be extended. For now assume such a thing exists.
 


Ok. Will this addition work for both unicast and multicast modes ?



 


+
   



 

Good point. Should check for users sending it as a cmd and treat it as a 
noop. 
   



More like return an -EINVAL
 


Will this be necessary ? Isn't genl_rcv_msg() going to return a -EOPNOTSUPP
automatically for us since we've not registered the command ?


 


I'm just using
this as a placeholder for data thats returned without being requested.

   



So it is unconditional?
 


Yes.

 

Come to think of it, there's no real reason to have a genlmsghdr for 
returned data, is there ?
   



All messages should be consistent whether they are sent from user
or kernel.
 


Ok. will retain genetlink header.

Other than to copy the genlmsghdr that was sent so user can identify 
which command was sent

(and I'm doing that through the reply type, perhaps redundantly).

   



yes, that is a useful trick. Just make sure they are reflected
correctly.

 

Actually, the next iteration of the code will move to dynamically 
generated ID. But yes, will need to check for that.


   



Also if you can provide feedback whether the doc i sent was any use
and what wasnt clear etc.
 


Will do.


Thanks for the review.
Couple of questions about general netlink:
is it intended to remain a size that will always be aligned to the 
NLMSG_ALIGNTO so that (NLMSG_DATA(nlhdr) + GENL_HDRLEN) can always 
be used as a pointer to the genlmsghdr ?


   



I am not sure i followed.
The whole message (nlhdr, genlhdr, optionalhdr, TLVs) has to be in 
the end 32 bit aligned.
 

Ok , so separate padding isn't needed to make the genlhdr, optionalhdr 
and TLV parts aligned

too.

Adding some macros like genlmsg_data(nlh) would be handy (currently I 
just define and use it locally).


   



Send a patch.
 


will do.


Thanks,
Shailabh


cheers,
jamal

 



-
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/8] Intel I/O Acceleration Technology (I/OAT)

2006-03-06 Thread Ingo Oeser
Evgeniy Polyakov wrote:
> On Sat, Mar 04, 2006 at 01:41:44PM -0800, David S. Miller ([EMAIL PROTECTED]) 
> wrote:
> > From: Jan Engelhardt <[EMAIL PROTECTED]>
> > Date: Sat, 4 Mar 2006 19:46:22 +0100 (MET)
> > 
> > > Does this buy the normal standard desktop user anything?
> > 
> > Absolutely, it optimizes end-node performance.
> 
> It really depends on how it is used.
> According to investigation made for kevent based FS AIO reading,
> get_user_pages() performange graph looks like sqrt() function

Hmm, so I should resurrect my user page table walker abstraction?

There I would hand each page to a "recording" function, which
can drop the page from the collection or coalesce it in the collector
if your scatter gather implementation allows it.

Regards

Ingo Oeser
-
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/9] sky2: warn on newer untested chips

2006-03-06 Thread Stephen Hemminger
The driver includes support for the lowcost version of Yukon-EC chipset.
Since this has never been explictly tested, add a disclaimer message
to get some feedback.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c2006-03-06 09:53:11.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-06 09:58:34.0 -0800
@@ -2204,6 +2204,12 @@
return -EOPNOTSUPP;
}
 
+   /* This chip is new and not tested yet */
+   if (hw->chip_id == CHIP_ID_EC_U) {
+   pr_info(PFX "%s: is a version of Yukon 2 chipset that has not 
been tested yet.\n");
+   pr_info("Please report success/failure to maintainer <[EMAIL 
PROTECTED]>\n");
+   }
+
/* disable ASF */
if (hw->chip_id <= CHIP_ID_YUKON_EC) {
sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET);

--

-
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 7/9] sky2: smarter irq handling

2006-03-06 Thread Stephen Hemminger
Redo the interupt handling of sky2 driver based on the IRQ mangement
documentation. All interrupts are handled by the device0 NAPI poll
routine.

Don't need to adjust interrupt mask in IRQ context, done only when
changing device under RTNL. Therefore don't need hwlock anymore.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c2006-03-06 09:59:12.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-06 09:59:13.0 -0800
@@ -77,7 +77,7 @@
 #define ETH_JUMBO_MTU  9000
 #define TX_WATCHDOG(5 * HZ)
 #define NAPI_WEIGHT64
-#define PHY_RETRIES1000
+#define PHY_RETRIES100
 
 static const u32 default_msg =
 NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK
@@ -142,7 +142,7 @@
for (i = 0; i < PHY_RETRIES; i++) {
if (!(gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY))
return 0;
-   udelay(1);
+   udelay(10);
}
 
printk(KERN_WARNING PFX "%s: phy write timeout\n", hw->dev[port]->name);
@@ -162,7 +162,7 @@
return 0;
}
 
-   udelay(1);
+   udelay(10);
}
 
return -ETIMEDOUT;
@@ -500,9 +500,9 @@
 /* Force a renegotiation */
 static void sky2_phy_reinit(struct sky2_port *sky2)
 {
-   down(&sky2->phy_sema);
+   spin_lock_bh(&sky2->phy_lock);
sky2_phy_init(sky2->hw, sky2->port);
-   up(&sky2->phy_sema);
+   spin_unlock_bh(&sky2->phy_lock);
 }
 
 static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
@@ -567,9 +567,9 @@
 
sky2_read16(hw, SK_REG(port, GMAC_IRQ_SRC));
 
-   down(&sky2->phy_sema);
+   spin_lock_bh(&sky2->phy_lock);
sky2_phy_init(hw, port);
-   up(&sky2->phy_sema);
+   spin_unlock_bh(&sky2->phy_lock);
 
/* MIB clear */
reg = gma_read16(hw, port, GM_PHY_ADDR);
@@ -856,9 +856,9 @@
case SIOCGMIIREG: {
u16 val = 0;
 
-   down(&sky2->phy_sema);
+   spin_lock_bh(&sky2->phy_lock);
err = __gm_phy_read(hw, sky2->port, data->reg_num & 0x1f, &val);
-   up(&sky2->phy_sema);
+   spin_unlock_bh(&sky2->phy_lock);
 
data->val_out = val;
break;
@@ -868,10 +868,10 @@
if (!capable(CAP_NET_ADMIN))
return -EPERM;
 
-   down(&sky2->phy_sema);
+   spin_lock_bh(&sky2->phy_lock);
err = gm_phy_write(hw, sky2->port, data->reg_num & 0x1f,
   data->val_in);
-   up(&sky2->phy_sema);
+   spin_unlock_bh(&sky2->phy_lock);
break;
}
return err;
@@ -983,7 +983,7 @@
struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port;
-   u32 ramsize, rxspace;
+   u32 ramsize, rxspace, imask;
int err = -ENOMEM;
 
if (netif_msg_ifup(sky2))
@@ -1048,10 +1048,10 @@
goto err_out;
 
/* Enable interrupts from phy/mac for port */
-   spin_lock_irq(&hw->hw_lock);
-   hw->intr_mask |= (port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2;
-   sky2_write32(hw, B0_IMSK, hw->intr_mask);
-   spin_unlock_irq(&hw->hw_lock);
+   imask = sky2_read32(hw, B0_IMSK);
+   imask |= (port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2;
+   sky2_write32(hw, B0_IMSK, imask);
+
return 0;
 
 err_out:
@@ -1343,6 +1343,7 @@
struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port;
u16 ctrl;
+   u32 imask;
 
/* Never really got started! */
if (!sky2->tx_le)
@@ -1354,14 +1355,6 @@
/* Stop more packets from being queued */
netif_stop_queue(dev);
 
-   /* Disable port IRQ */
-   spin_lock_irq(&hw->hw_lock);
-   hw->intr_mask &= ~((sky2->port == 0) ? Y2_IS_IRQ_PHY1 : Y2_IS_IRQ_PHY2);
-   sky2_write32(hw, B0_IMSK, hw->intr_mask);
-   spin_unlock_irq(&hw->hw_lock);
-
-   flush_scheduled_work();
-
sky2_phy_reset(hw, port);
 
/* Stop transmitter */
@@ -1405,6 +1398,11 @@
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
 
+   /* Disable port IRQ */
+   imask = sky2_read32(hw, B0_IMSK);
+   imask &= ~(sky2->port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2;
+   sky2_write32(hw, B0_IMSK, imask);
+
/* turn off LED's */
sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
 
@@ -1599,20 +1597,19 @@
return 0;
 }
 
-/*
- * Interrupt from PHY are handled outside of interrupt context
- * because accessing phy registers requires spin wait which might
- * cause excess interrupt latency.
- */
-static void sky2_phy_task(void *arg)
+/* Interrupt from PHY */
+static void sky2_phy_intr(struct sky2_hw *hw, unsigned port)
 {
-   struct sky2_port *s

[PATCH 4/9] sky2: not really random enough for entropy pool

2006-03-06 Thread Stephen Hemminger
Don't use sky2 to seed random pool beacause the network packet arrival time
will not be truly random due to NAPI and interrupt mitigation.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c2006-03-06 09:59:02.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-06 09:59:10.0 -0800
@@ -3177,8 +3177,7 @@
}
}
 
-   err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM,
- DRV_NAME, hw);
+   err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw);
if (err) {
printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
   pci_name(pdev), pdev->irq);

--

-
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 8/9] sky2: whitespace cleanups

2006-03-06 Thread Stephen Hemminger
Small whitespace fixes.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- sky2-1.0.orig/drivers/net/sky2.c2006-03-06 10:01:23.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-06 10:00:48.0 -0800
@@ -848,7 +848,7 @@
if (!netif_running(dev))
return -ENODEV; /* Phy still in reset */
 
-   switch(cmd) {
+   switch (cmd) {
case SIOCGMIIPHY:
data->phy_id = PHY_ADDR_MARV;
 
@@ -1263,7 +1263,7 @@
 
avail = tx_avail(sky2);
if (avail < TX_MIN_PENDING) {
-   le->ctrl |= FRC_STAT;
+   le->ctrl |= FRC_STAT;
if (avail <= MAX_SKB_TX_LE)
netif_stop_queue(dev);
}
@@ -1300,7 +1300,7 @@
struct tx_ring_info *re = sky2->tx_ring + put;
struct sk_buff *skb = re->skb;
 
-   nxt = re->idx;
+   nxt = re->idx;
BUG_ON(nxt >= TX_RING_SIZE);
prefetch(sky2->tx_ring + nxt);
 
@@ -1316,7 +1316,7 @@
struct tx_ring_info *fre;
fre = sky2->tx_ring + (put + i + 1) % TX_RING_SIZE;
pci_unmap_page(pdev, pci_unmap_addr(fre, mapaddr),
-  skb_shinfo(skb)->frags[i].size,
+  skb_shinfo(skb)->frags[i].size,
   PCI_DMA_TODEVICE);
}
 
@@ -2183,7 +2183,7 @@
sky2_write8(hw, B0_CTST, CS_MRST_CLR);
 
/* clear any PEX errors */
-   if (pci_find_capability(hw->pdev, PCI_CAP_ID_EXP)) 
+   if (pci_find_capability(hw->pdev, PCI_CAP_ID_EXP))
sky2_pci_write32(hw, PEX_UNC_ERR_STAT, 0xUL);
 
 
@@ -2951,7 +2951,7 @@
sky2->speed = -1;
sky2->advertising = sky2_supported_modes(hw);
 
-   /* Receive checksum disabled for Yukon XL
+   /* Receive checksum disabled for Yukon XL
 * because of observed problems with incorrect
 * values when multiple packets are received in one interrupt
 */

--

-
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/9] sky2: 1.0 series

2006-03-06 Thread Stephen Hemminger
These patches fix the observed hangs on sky2, and remove untested
and broken functionality. Please apply these for 2.6.16.

Message Signaled Interrupt and Wake On Lan will have to wait till
after 2.6.16.


-
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 9/9] sky2: version 1.0

2006-03-06 Thread Stephen Hemminger
Grown up enough for 1.0.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c2006-03-03 15:23:39.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-03 15:23:49.0 -0800
@@ -51,7 +51,7 @@
 #include "sky2.h"
 
 #define DRV_NAME   "sky2"
-#define DRV_VERSION"0.15"
+#define DRV_VERSION"1.0"
 #define PFXDRV_NAME " "
 
 /*

--

-
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 5/9] sky2: force Tx interrupt when ring near full

2006-03-06 Thread Stephen Hemminger
Force a transmit status interrupt if transmit ring gets nearly full.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- sky2-1.0.orig/drivers/net/sky2.c2006-03-06 09:59:10.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-06 09:59:11.0 -0800
@@ -70,7 +70,7 @@
 #define TX_RING_SIZE   512
 #define TX_DEF_PENDING (TX_RING_SIZE - 1)
 #define TX_MIN_PENDING 64
-#define MAX_SKB_TX_LE  (4 + 2*MAX_SKB_FRAGS)
+#define MAX_SKB_TX_LE  (4 + 
(sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS)
 
 #define STATUS_RING_SIZE   2048/* 2 ports * (TX + 2*RX) */
 #define STATUS_LE_BYTES(STATUS_RING_SIZE*sizeof(struct 
sky2_status_le))
@@ -1114,6 +1114,7 @@
struct sky2_tx_le *le = NULL;
struct tx_ring_info *re;
unsigned i, len;
+   int avail;
dma_addr_t mapping;
u32 addr64;
u16 mss;
@@ -1256,10 +1257,14 @@
re->idx = sky2->tx_prod;
le->ctrl |= EOP;
 
-   sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod);
+   avail = tx_avail(sky2);
+   if (avail < TX_MIN_PENDING) {
+   le->ctrl |= FRC_STAT;
+   if (avail <= MAX_SKB_TX_LE)
+   netif_stop_queue(dev);
+   }
 
-   if (tx_avail(sky2) <= MAX_SKB_TX_LE)
-   netif_stop_queue(dev);
+   sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod);
 
 out_unlock:
spin_unlock(&sky2->tx_lock);

--

-
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/9] sky2: remove support for old untested hardware

2006-03-06 Thread Stephen Hemminger
Remove support for Yukon EC revision 0 (A1) because it requires several 
workarounds
that have never been tested. This simplifies the code, and doesn't raise
false expectations.  I suspect this chip version was so buggy, it never
made it out into real systems.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c2006-03-03 10:38:23.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-03 10:39:21.0 -0800
@@ -61,10 +61,6 @@
  * a receive requires one (or two if using 64 bit dma).
  */
 
-#define is_ec_a1(hw) \
-   unlikely((hw)->chip_id == CHIP_ID_YUKON_EC && \
-(hw)->chip_rev == CHIP_REV_YU_EC_A1)
-
 #define RX_LE_SIZE 512
 #define RX_LE_BYTES(RX_LE_SIZE*sizeof(struct sky2_rx_le))
 #define RX_MAX_PENDING (RX_LE_SIZE/2 - 2)
@@ -725,37 +721,11 @@
return le;
 }
 
-/*
- * This is a workaround code taken from SysKonnect sk98lin driver
- * to deal with chip bug on Yukon EC rev 0 in the wraparound case.
- */
-static void sky2_put_idx(struct sky2_hw *hw, unsigned q,
-   u16 idx, u16 *last, u16 size)
+/* Update chip's next pointer */
+static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, u16 idx)
 {
wmb();
-   if (is_ec_a1(hw) && idx < *last) {
-   u16 hwget = sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_GET_IDX));
-
-   if (hwget == 0) {
-   /* Start prefetching again */
-   sky2_write8(hw, Y2_QADDR(q, PREF_UNIT_FIFO_WM), 0xe0);
-   goto setnew;
-   }
-
-   if (hwget == size - 1) {
-   /* set watermark to one list element */
-   sky2_write8(hw, Y2_QADDR(q, PREF_UNIT_FIFO_WM), 8);
-
-   /* set put index to first list element */
-   sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), 0);
-   } else  /* have hardware go to end of list */
-   sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX),
-size - 1);
-   } else {
-setnew:
-   sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx);
-   }
-   *last = idx;
+   sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx);
mmiowb();
 }
 
@@ -997,7 +967,6 @@
 
/* Tell chip about available buffers */
sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put);
-   sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX));
return 0;
 nomem:
sky2_rx_clean(sky2);
@@ -1287,8 +1256,7 @@
re->idx = sky2->tx_prod;
le->ctrl |= EOP;
 
-   sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod,
-&sky2->tx_last_put, TX_RING_SIZE);
+   sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod);
 
if (tx_avail(sky2) <= MAX_SKB_TX_LE)
netif_stop_queue(dev);
@@ -1832,8 +1800,7 @@
sky2_rx_add(sky2, re->mapaddr);
 
/* Tell receiver about new buffers. */
-   sky2_put_idx(sky2->hw, rxqaddr[sky2->port], sky2->rx_put,
-&sky2->rx_last_put, RX_LE_SIZE);
+   sky2_put_idx(sky2->hw, rxqaddr[sky2->port], sky2->rx_put);
 
return skb;
 
@@ -2227,6 +2194,16 @@
return -EOPNOTSUPP;
}
 
+   hw->chip_rev = (sky2_read8(hw, B2_MAC_CFG) & CFG_CHIP_R_MSK) >> 4;
+
+   /* This rev is really old, and requires untested workarounds */
+   if (hw->chip_id == CHIP_ID_YUKON_EC && hw->chip_rev == 
CHIP_REV_YU_EC_A1) {
+   printk(KERN_ERR PFX "%s: unsupported revision Yukon-%s (0x%x) 
rev %d\n",
+  pci_name(hw->pdev), yukon2_name[hw->chip_id - 
CHIP_ID_YUKON_XL],
+  hw->chip_id, hw->chip_rev);
+   return -EOPNOTSUPP;
+   }
+
/* disable ASF */
if (hw->chip_id <= CHIP_ID_YUKON_EC) {
sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET);
@@ -2260,7 +2237,6 @@
if (!(sky2_read8(hw, B2_Y2_CLK_GATE) & Y2_STATUS_LNK2_INAC))
++hw->ports;
}
-   hw->chip_rev = (sky2_read8(hw, B2_MAC_CFG) & CFG_CHIP_R_MSK) >> 4;
 
sky2_set_power_state(hw, PCI_D0);
 
@@ -2327,29 +2303,17 @@
sky2_write16(hw, STAT_LAST_IDX, STATUS_RING_SIZE - 1);
 
/* These status setup values are copied from SysKonnect's driver */
-   if (is_ec_a1(hw)) {
-   /* WA for dev. #4.3 */
-   sky2_write16(hw, STAT_TX_IDX_TH, 0xfff);/* Tx Threshold 
*/
-
-   /* set Status-FIFO watermark */
-   sky2_write8(hw, STAT_FIFO_WM, 0x21);/* WA for dev. #4.18 */
-
-   /* set Status-FIFO ISR watermark */
-   sky2_write8(hw, STAT_FIFO_ISR_WM, 0x07);/* WA for dev. 
#4.18 */
-   sky2_write32(hw, STAT_TX_TIMER_INI, sky2_us2clk(hw, 1));
-   } else {
-   sky2_write1

[PATCH 3/9] sky2: remove wake-on-lan until fixed

2006-03-06 Thread Stephen Hemminger
Remove wake on lan support for now. It doesn't work right, and I
don't have a machine with working suspend/resume to test or fix it.
It will be re-enabled later.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c2006-03-06 09:58:59.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-06 09:59:02.0 -0800
@@ -2765,38 +2765,6 @@
return err;
 }
 
-#ifdef CONFIG_PM
-static void sky2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
-{
-   struct sky2_port *sky2 = netdev_priv(dev);
-
-   wol->supported = WAKE_MAGIC;
-   wol->wolopts = sky2->wol ? WAKE_MAGIC : 0;
-}
-
-static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
-{
-   struct sky2_port *sky2 = netdev_priv(dev);
-   struct sky2_hw *hw = sky2->hw;
-
-   if (wol->wolopts != WAKE_MAGIC && wol->wolopts != 0)
-   return -EOPNOTSUPP;
-
-   sky2->wol = wol->wolopts == WAKE_MAGIC;
-
-   if (sky2->wol) {
-   memcpy_toio(hw->regs + WOL_MAC_ADDR, dev->dev_addr, ETH_ALEN);
-
-   sky2_write16(hw, WOL_CTRL_STAT,
-WOL_CTL_ENA_PME_ON_MAGIC_PKT |
-WOL_CTL_ENA_MAGIC_PKT_UNIT);
-   } else
-   sky2_write16(hw, WOL_CTRL_STAT, WOL_CTL_DEFAULT);
-
-   return 0;
-}
-#endif
-
 static int sky2_get_coalesce(struct net_device *dev,
 struct ethtool_coalesce *ecmd)
 {
@@ -2984,10 +2952,6 @@
.set_ringparam = sky2_set_ringparam,
.get_pauseparam = sky2_get_pauseparam,
.set_pauseparam = sky2_set_pauseparam,
-#ifdef CONFIG_PM
-   .get_wol = sky2_get_wol,
-   .set_wol = sky2_set_wol,
-#endif
.phys_id = sky2_phys_id,
.get_stats_count = sky2_get_stats_count,
.get_ethtool_stats = sky2_get_ethtool_stats,
--- sky2-1.0.orig/drivers/net/sky2.h2006-03-06 09:58:59.0 -0800
+++ sky2-1.0/drivers/net/sky2.h 2006-03-06 09:59:02.0 -0800
@@ -1863,7 +1863,6 @@
u8   rx_pause;
u8   tx_pause;
u8   rx_csum;
-   u8   wol;
 
struct net_device_stats net_stats;
 

--

-
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 6/9] sky2: don't choke on oversize frames

2006-03-06 Thread Stephen Hemminger
Turn on truncation to prevent getting choked by frames larger than expected.
Without this fix, driver hangs after receiving an oversize packet.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c2006-03-06 09:59:11.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-06 09:59:12.0 -0800
@@ -618,8 +618,8 @@
 
/* Configure Rx MAC FIFO */
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR);
-   sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T),
-GMF_RX_CTRL_DEF);
+   sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
+GMF_OPER_ON | GMF_RX_F_FL_ON);
 
/* Flush Rx MAC FIFO on any flow control or error */
sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR);
@@ -965,8 +965,12 @@
sky2_rx_add(sky2, re->mapaddr);
}
 
+   /* Truncate oversize frames */
+   sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 
8);
+   sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON);
+
/* Tell chip about available buffers */
-   sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put);
+   sky2_put_idx(hw, rxq, sky2->rx_put);
return 0;
 nomem:
sky2_rx_clean(sky2);
@@ -1680,10 +1684,12 @@
 
 
 #define roundup(x, y)   x)+((y)-1))/(y))*(y))
-/* Want receive buffer size to be multiple of 64 bits, and incl room for vlan 
*/
+/* Want receive buffer size to be multiple of 64 bits
+ * and incl room for vlan and truncation
+ */
 static inline unsigned sky2_buf_size(int mtu)
 {
-   return roundup(mtu + ETH_HLEN + 4, 8);
+   return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8;
 }
 
 static int sky2_change_mtu(struct net_device *dev, int new_mtu)
@@ -1766,7 +1772,7 @@
if (!(status & GMR_FS_RX_OK))
goto resubmit;
 
-   if ((status >> 16) != length || length > sky2->rx_bufsize)
+   if (length > sky2->netdev->mtu + ETH_HLEN)
goto oversize;
 
if (length < copybreak) {

--

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


Re: [RFC/PATCH 7/13] d80211: remove adm_status

2006-03-06 Thread Jouni Malinen
On Mon, Mar 06, 2006 at 04:44:27PM +0100, Jiri Benc wrote:

> PRISM2_PARAM_ADM_STATUS is not used anywhere in kernel nor in userspace.
> It just passes a value to the driver, so it's safe to remove it.

This is used to implement radio on/off without having to change other
parts of the configuration (e.g., set interfaces down). I would rather
not remove it unless there is an alternative way of doing this.

-- 
Jouni MalinenPGP id EFC895FA
-
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: double kfree in gss_krb5_wrap

2006-03-06 Thread Trond Myklebust
On Mon, 2006-03-06 at 04:22 -0500, Dave Jones wrote:
> We don't even NULL the pointer out, so we're freeing the same
> object twice here.
> 
> Coverity #951

I've forwarded this + the "another gss_krb5 double ..." on to Bruce...

Cheers,
  Trond

> Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
> 
> --- linux-2.6/net/sunrpc/auth_gss/gss_krb5_wrap.c~2006-03-06 
> 04:18:50.0 -0500
> +++ linux-2.6/net/sunrpc/auth_gss/gss_krb5_wrap.c 2006-03-06 
> 04:19:40.0 -0500
> @@ -205,8 +205,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, i
>   BUG();
>   }
>  
> - kfree(md5cksum.data);
> -
>   /* XXX would probably be more efficient to compute checksum
>* and encrypt at the same time: */
>   if ((krb5_make_seq_num(kctx->seq, kctx->initiate ? 0 : 0xff,
> @@ -221,7 +219,8 @@ gss_wrap_kerberos(struct gss_ctx *ctx, i
>  
>   return ((kctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE);
>  out_err:
> - if (md5cksum.data) kfree(md5cksum.data);
> + if (md5cksum.data)
> + kfree(md5cksum.data);
>   return GSS_S_FAILURE;
>  }
>  
> 
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/PATCH 6/13] d80211: remove obsolete stuff

2006-03-06 Thread Jouni Malinen
On Mon, Mar 06, 2006 at 04:44:26PM +0100, Jiri Benc wrote:

> Because any number of interfaces may be added, bss_devs and sta_devs arrays
> cannot be fixed-size arrays. We can make them linked lists, but they are
> needed for optimalization only (and even that is questionable with
> subsequent patches). Let's remove them; we will probably want something
> similar later to speed up packet receiving, but let's not bother ourselves
> now.

The reason for this optimization was in even high-end CPUs starting to
run out of resources when running one radio with 2007 "virtual STAs",
i.e., when testing AP capabilities.. In other words, unless some of your
other patches improved netdev lookup, more work is likely needed here to
allow such a test mode to be used.

With 2000 netdevs, there were other performance issues, at least with
Linux 2.4.x. If I remember correctly, it took close to half an hour to
just add and remove those netdevs.. ;-) Anyway, after the netdevs were
up, these optimizations were enough to keep CPU load reasonable in a
test case that sent data packets through all the STAs. I have not tested
this with 2.6 kernels, so the area of adding/deleting netdevs may have
already been improved.

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


Re: [RFC/PATCH 7/13] d80211: remove adm_status

2006-03-06 Thread Jiri Benc
On Mon, 6 Mar 2006 10:39:10 -0800, Jouni Malinen wrote:
> This is used to implement radio on/off without having to change other
> parts of the configuration (e.g., set interfaces down). I would rather
> not remove it unless there is an alternative way of doing this.

The problem with this flag is that it is set from
ieee80211_init_client() function, which is removed in next patch and it
isn't clear when it should be set to 1. By trying to figure this out, I
realized that it is completely unused.

Ok, it is probably useful. Let's rename it to something more obvious
(RADIO_ENABLED? ADM_RFKILL?). But I think it shouldn't be re-enabled by
the kernel automatically when station interface is added/brought up.
Does this sound reasonable?

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


Re: [RFC/PATCH 0/13] d80211: simplify userspace interface

2006-03-06 Thread Jouni Malinen
On Mon, Mar 06, 2006 at 04:44:20PM +0100, Jiri Benc wrote:

> This is a first series of patches for making d80211 to be more intelligible
> for users. Changes are rather invasive - I tried to put them to smaller
> patches, although only a few of these patches are usable standalone.

I'm at the IEEE 802.11 meeting for this week, so I'm unlikely to be able
to test any of these before next week. Anyway, I did go through the
patches quickly and in general, they looked quite good. I would like to
go through couple of tests with various combinations of different types
of interfaces to make sure that there are no corner cases that would
have problems with some of the changes.

As far as AP mode is concerned, I'm in process of getting something
useful merged into the open source hostapd repository, so that that mode
would be more easily available for others to test. Your changes seemed
to modify some of the used kernel-userspace commands for this area, but
I did not notice any major problems there either.

This patchset was marked "RFC". Are you hoping to get these merged in in
more or less their current state or do you have plans on modifying these
more before requesting them to be applied?

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


Re: [RFC/PATCH 7/13] d80211: remove adm_status

2006-03-06 Thread Jouni Malinen
On Mon, Mar 06, 2006 at 07:58:03PM +0100, Jiri Benc wrote:

> The problem with this flag is that it is set from
> ieee80211_init_client() function, which is removed in next patch and it
> isn't clear when it should be set to 1. By trying to figure this out, I
> realized that it is completely unused.
> 
> Ok, it is probably useful. Let's rename it to something more obvious
> (RADIO_ENABLED? ADM_RFKILL?). But I think it shouldn't be re-enabled by
> the kernel automatically when station interface is added/brought up.
> Does this sound reasonable?

I agree completely with renaming it. I did not implement that part and
haven't really ever liked the name.. ;-) Both of the proposed
alternatives sound acceptable.

Radio was enabled for station modes automatically to make it easier for
users. hostapd is taking care of that for AP modes, but for client mode,
there was no automatic mechanism. In other words, it may be useful to
enable the radio automatically in some cases (e.g., if
hostapd/wpa_supplicant is not doing this for the user).

-- 
Jouni MalinenPGP id EFC895FA
-
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


RFC: move SDP from AF_INET_SDP to IPPROTO_SDP

2006-03-06 Thread Michael S. Tsirkin
Hi!
I am working on implementing the Sockets Direct Protocol (SDP) for InfiniBand on
Linux. SDP uses the regular IPv4/IPv6 addresses and utilizes the IPv4/IPv6 layer
on top of InfiniBand for address resolution. However, all data is transferred by
means of an infiniband reliable connection.

Some existing SDP implementations posted on the openib.org subversion tree
create a new address family in a free slot, for this purpose.

Would it make sense to move SDP from using a separate address family to
a separate protocol under AF_INET and AF_INET6?
Something like IPPROTO_SDP?

The main advantages of this approach are
- IPv6 support will come more naturally and without further extending
  to a yet another address family
- We could use a protocol number > 255 to avoid conflicting
  with any IP based protocol.
  There are much more free protocol numbers that free family numbers
  (which only go up to 32 in linux for now).
- I could reuse more code for creating connections from af_inet.c

I also have a hunch this might make getaddrinfo and friends work better on sdp
selecting IPv4/IPv6 as appropriate but I'm not sure.

Comments? Are there disadvantages to this approach that someone can see?

Thanks,

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies
___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

- End forwarded message -

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


Re: [RFC/PATCH 6/13] d80211: remove obsolete stuff

2006-03-06 Thread Jiri Benc
On Mon, 6 Mar 2006 10:49:46 -0800, Jouni Malinen wrote:
> The reason for this optimization was in even high-end CPUs starting to
> run out of resources when running one radio with 2007 "virtual STAs",
> i.e., when testing AP capabilities.. In other words, unless some of your
> other patches improved netdev lookup, more work is likely needed here to
> allow such a test mode to be used.

Yes, I'm aware of that. But I'm afraid that hard-wired need for STA
interfaces to have incremental MAC addresses is not acceptable - and
this fact alone means degrading of performance in case of 2000+ STAs.

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


Re: [RFC/PATCH 7/13] d80211: remove adm_status

2006-03-06 Thread Jiri Benc
On Mon, 6 Mar 2006 11:00:11 -0800, Jouni Malinen wrote:
> I agree completely with renaming it. I did not implement that part and
> haven't really ever liked the name.. ;-) Both of the proposed
> alternatives sound acceptable.

Ok.

> Radio was enabled for station modes automatically to make it easier for
> users. hostapd is taking care of that for AP modes, but for client mode,
> there was no automatic mechanism. In other words, it may be useful to
> enable the radio automatically in some cases (e.g., if
> hostapd/wpa_supplicant is not doing this for the user).

AFAIK generally accepted conclusion is that a card shouldn't send or
receive anything until one of its interfaces is UP. So we can go with
RADIO_ENABLED set to 1 by default. If user disables it, he should now
what he is doing.

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


Re: [RFC/PATCH 0/13] d80211: simplify userspace interface

2006-03-06 Thread Jiri Benc
On Mon, 6 Mar 2006 10:56:21 -0800, Jouni Malinen wrote:
> I'm at the IEEE 802.11 meeting for this week, so I'm unlikely to be able
> to test any of these before next week. Anyway, I did go through the
> patches quickly and in general, they looked quite good. I would like to
> go through couple of tests with various combinations of different types
> of interfaces to make sure that there are no corner cases that would
> have problems with some of the changes.

Thanks!

> As far as AP mode is concerned, I'm in process of getting something
> useful merged into the open source hostapd repository, so that that mode
> would be more easily available for others to test. Your changes seemed
> to modify some of the used kernel-userspace commands for this area, but
> I did not notice any major problems there either.

I really think we should get rid of wlan%dap devices. This will be
possible when all of interfaces use native 802.11 frames; additional
information from kernel to hostapd can be passed via netlink. But this
will probably mean large changes to hostapd.

> This patchset was marked "RFC". Are you hoping to get these merged in in
> more or less their current state or do you have plans on modifying these
> more before requesting them to be applied?

I don't plan to modify them unless there is some fundamental problem in
them. But these changes are really invasive, so I wanted to hear other
people's opinions first (especially from DeviceScape people :-)).

Thanks,

-- 
Jiri Benc
SUSE Labs
-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread Martin Michlmayr
* Martin Michlmayr <[EMAIL PROTECTED]> [2006-03-06 14:35]:
> Thanks a lot for your quick response, Francois.  I can confirm that
> this patch fixes the problem for me.

There's another interrupt related bug in the driver, though.  I
sometimes get a kernel panic when rsycing several 100 megs of data
across the LAN.  A picture showing the call trace can be found at
http://www.cyrius.com/tmp/de2104x_panic.jpg

-- 
Martin Michlmayr
http://www.cyrius.com/
-
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 8/8] [I/OAT] TCP recv offload to I/OAT

2006-03-06 Thread Chris Leech
> #ifdef is not needed here (try not to put #ifdef in .c files.)  I think
> a few of your other usages of #ifdef in this file can also be removed
> with judicious use of inline functions in a .h file.

ACK on all the ifdef comments.  I may have gone a little ifdef crazy
making sure I could get to a zero impact state with these patches
applied but CONFIG_NET_DMA turned off.  I'll get these cleaned up.

- Chris
-
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 8/8] [I/OAT] TCP recv offload to I/OAT

2006-03-06 Thread Chris Leech
On 3/5/06, Andrew Morton <[EMAIL PROTECTED]> wrote:
> Chris Leech <[EMAIL PROTECTED]> wrote:
> >
> > +#ifdef CONFIG_NET_DMA
> >  +tp->ucopy.dma_chan = NULL;
> >  +if ((len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) && 
> > !sysctl_tcp_low_latency && __get_cpu_var(softnet_data.net_dma))
> >  +dma_lock_iovec_pages(msg->msg_iov, len, 
> > &tp->ucopy.locked_list);
> >  +#endif
>
> The __get_cpu_var() here will run smp_processor_id() from preemptible
> context.  You'll get a big warning if the correct debug options are set.
>
> The reason for this is that preemption could cause this code to hop between
> CPUs.

I've been playing with different models of where to select which DMA
channel to use in order to reduce cache thrash and lock contention in
the driver.  It's not a clean per-cpu issue because per I/O there are
potentially operations happening in both the process syscall and the
netrx softirq context.

Right now the code delays selection of a DMA channel until the first
offload copy is ready to go, so the __get_cpu_var() you point out is
just checking to see if any hardware exists for I/OAT at this point
before doing the page pinning.  Before anything is done with the
channel the per-cpu pointer is re-read safely with preemption disabled
and a reference count is incremented.

 - Chris
-
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/8] [I/OAT] DMA memcpy subsystem

2006-03-06 Thread Chris Leech
On 3/3/06, David S. Miller <[EMAIL PROTECTED]> wrote:
> > +static spinlock_t dma_list_lock;
>
> Please use DEFINE_SPINLOCK().
>
> > +static void dma_chan_free_rcu(struct rcu_head *rcu) {
>
> Newline before the brace please.
>
> > +static void dma_async_device_cleanup(struct kref *kref) {
>
> Newline before the brace please.
>
> > +struct dma_chan_percpu
> > +{
>
> Left brace on the same line as "struct dma_chan_percpu" please.
>
> > +struct dma_chan
> > +{
>
> Similarly.
>
> Otherwise this patch looks mostly ok.

Thanks Dave,

I'll apply these and other feedback and get updated patches generated.

- Chris
-
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] net driver fixes

2006-03-06 Thread Jeff Garzik

Please pull from 'upstream-fixes' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git

to receive the following updates:

 drivers/net/chelsio/espi.c |4 +---
 drivers/net/s2io.c |1 +
 2 files changed, 2 insertions(+), 3 deletions(-)

Eric Sesterhenn:
  chelsio: fix kmalloc failure in t1_espi_create

Jeff Garzik:
  s2io: set_multicast_list bug

diff --git a/drivers/net/chelsio/espi.c b/drivers/net/chelsio/espi.c
index 2306425..e824aca 100644
--- a/drivers/net/chelsio/espi.c
+++ b/drivers/net/chelsio/espi.c
@@ -296,9 +296,7 @@ void t1_espi_destroy(struct peespi *espi
 
 struct peespi *t1_espi_create(adapter_t *adapter)
 {
-   struct peespi *espi = kmalloc(sizeof(*espi), GFP_KERNEL);
-
-   memset(espi, 0, sizeof(*espi));
+   struct peespi *espi = kzalloc(sizeof(*espi), GFP_KERNEL);
 
if (espi)
espi->adapter = adapter;
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 49b597c..b7f00d6 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -4092,6 +4092,7 @@ static void s2io_set_multicast(struct ne
 i++, mclist = mclist->next) {
memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr,
   ETH_ALEN);
+   mac_addr = 0;
for (j = 0; j < ETH_ALEN; j++) {
mac_addr |= mclist->dmi_addr[j];
mac_addr <<= 8;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: RFC: move SDP from AF_INET_SDP to IPPROTO_SDP

2006-03-06 Thread David Stevens
I don't know any details about SDP, but if there are no differences at the
protocol layer, then neither the address family nor the protocol is
appropriate. If it's just an API change, the socket type is the right
selector. So, maybe SOCK_DIRECT to go along with SOCK_STREAM,
SOCK_DGRAM, etc.
+-DLS

-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread Francois Romieu
Martin Michlmayr <[EMAIL PROTECTED]> :
[...]
> There's another interrupt related bug in the driver, though.  I
> sometimes get a kernel panic when rsycing several 100 megs of data
> across the LAN.  A picture showing the call trace can be found at
> http://www.cyrius.com/tmp/de2104x_panic.jpg

Can you publish the .config ?

-- 
Ueimor
-
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/8] [I/OAT] DMA memcpy subsystem

2006-03-06 Thread Chris Leech
On 3/4/06, Benjamin LaHaise <[EMAIL PROTECTED]> wrote:
> On Fri, Mar 03, 2006 at 01:42:20PM -0800, Chris Leech wrote:
> > +void dma_async_device_unregister(struct dma_device* device)
> > +{
> ...
> > + kref_put(&device->refcount, dma_async_device_cleanup);
> > + wait_for_completion(&device->done);
> > +}
>
> This looks like a bug: device is dereferenced after it is potentially
> freed.

Actually, this is where the code is waiting to make sure it's safe to
free device.  The release function for the kref completes
device->done.  Each of the devices channels holds a reference to the
device.  When a device is unregistered it's channels are removed from
the clients, which hold a reference for each outstanding transaction. 
When all the outstanding transactions complete, the channels kref goes
to 0, and the reference to the device is dropped.  When the device
kref goes to 0 the completion is set, and it's now safe to free the
memory for the device and channel structures.

I have a writeup of the locking and reference counting that I'll
finish and add in as a big comment to the code.

-Chris
-
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: Discourage duplicate symbols in the kernel? [Was: Intel I/O Acc...]

2006-03-06 Thread Chris Leech
On 3/5/06, Andrew Morton <[EMAIL PROTECTED]> wrote:
> Sam Ravnborg <[EMAIL PROTECTED]> wrote:
> >
> > On Sun, Mar 05, 2006 at 12:09:33AM -0800, Andrew Morton wrote:
> >  > > +
> >  > > +static inline u8 read_reg8(struct cb_device *device, unsigned int 
> > offset)
> >  > > +{
> >  > > +return readb(device->reg_base + offset);
> >  > > +}
> >  >
> >  > These are fairly generic-sounding names.  In fact the as-yet-unmerged 
> > tiacx
> >  > wireless driver is already using these, privately to
> >  > drivers/net/wireless/tiacx/pci.c.
> >
> >  Do we in general discourage duplicate symbols even if they are static?
>
> Well, it's a bit irritating that it confuses ctags.  But in this case, one
> set is in a header file so the risk of collisions is much-increased.

They're in a header file that's specific to a single driver, so I
don't see where a conflict would occur.  But I didn't think about
ctags, and these can easily be prefixed so I'll go ahead and change
them.

- Chris
-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread Martin Michlmayr
* Francois Romieu <[EMAIL PROTECTED]> [2006-03-06 20:48]:
> > There's another interrupt related bug in the driver, though.  I
> > sometimes get a kernel panic when rsycing several 100 megs of data
> > across the LAN.  A picture showing the call trace can be found at
> > http://www.cyrius.com/tmp/de2104x_panic.jpg
> Can you publish the .config ?

http://www.cyrius.com/tmp/config-2.6.16-rc5-486

By the way, I'm getting the following messages in dmesg:

eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb00a
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb00a
eth0: tx err, status 0x7fffb00a
eth0: tx err, status 0x7fffb00a
eth0: tx err, status 0x7fffb002
eth0: tx err, status 0x7fffb032
eth0: tx err, status 0x7fffb002

-- 
Martin Michlmayr
http://www.cyrius.com/
-
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/6] IB: common handling for marshalling parameters to/from userspace

2006-03-06 Thread Sean Hefty

Provide common handling for marshalling data between userspace clients
and kernel mode Infiniband drivers.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>

---

diff -uprN -X linux-2.6.git/Documentation/dontdiff 
linux-2.6.git/drivers/infiniband/core/Makefile 
linux-2.6.ib/drivers/infiniband/core/Makefile
--- linux-2.6.git/drivers/infiniband/core/Makefile  2006-01-16 
10:25:27.0 -0800
+++ linux-2.6.ib/drivers/infiniband/core/Makefile   2006-01-16 
15:34:15.0 -0800
@@ -16,4 +16,5 @@ ib_umad-y :=  user_mad.o
 
 ib_ucm-y :=ucm.o
 
-ib_uverbs-y := uverbs_main.o uverbs_cmd.o uverbs_mem.o
+ib_uverbs-y := uverbs_main.o uverbs_cmd.o uverbs_mem.o \
+   uverbs_marshall.o
diff -uprN -X linux-2.6.git/Documentation/dontdiff 
linux-2.6.git/drivers/infiniband/core/ucm.c 
linux-2.6.ib/drivers/infiniband/core/ucm.c
--- linux-2.6.git/drivers/infiniband/core/ucm.c 2006-01-16 10:25:26.0 
-0800
+++ linux-2.6.ib/drivers/infiniband/core/ucm.c  2006-01-16 15:34:15.0 
-0800
@@ -30,7 +30,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: ucm.c 2594 2005-06-13 19:46:02Z libor $
+ * $Id: ucm.c 4311 2005-12-05 18:42:01Z sean.hefty $
  */
 #include 
 #include 
@@ -48,6 +48,7 @@
 
 #include 
 #include 
+#include 
 
 MODULE_AUTHOR("Libor Michalek");
 MODULE_DESCRIPTION("InfiniBand userspace Connection Manager access");
@@ -203,36 +204,6 @@ error:
return NULL;
 }
 
-static void ib_ucm_event_path_get(struct ib_ucm_path_rec *upath,
- struct ib_sa_path_rec  *kpath)
-{
-   if (!kpath || !upath)
-   return;
-
-   memcpy(upath->dgid, kpath->dgid.raw, sizeof *upath->dgid);
-   memcpy(upath->sgid, kpath->sgid.raw, sizeof *upath->sgid);
-
-   upath->dlid = kpath->dlid;
-   upath->slid = kpath->slid;
-   upath->raw_traffic  = kpath->raw_traffic;
-   upath->flow_label   = kpath->flow_label;
-   upath->hop_limit= kpath->hop_limit;
-   upath->traffic_class= kpath->traffic_class;
-   upath->reversible   = kpath->reversible;
-   upath->numb_path= kpath->numb_path;
-   upath->pkey = kpath->pkey;
-   upath->sl   = kpath->sl;
-   upath->mtu_selector = kpath->mtu_selector;
-   upath->mtu  = kpath->mtu;
-   upath->rate_selector= kpath->rate_selector;
-   upath->rate = kpath->rate;
-   upath->packet_life_time = kpath->packet_life_time;
-   upath->preference   = kpath->preference;
-
-   upath->packet_life_time_selector =
-   kpath->packet_life_time_selector;
-}
-
 static void ib_ucm_event_req_get(struct ib_ucm_req_event_resp *ureq,
 struct ib_cm_req_event_param *kreq)
 {
@@ -251,8 +222,10 @@ static void ib_ucm_event_req_get(struct 
ureq->srq= kreq->srq;
ureq->port   = kreq->port;
 
-   ib_ucm_event_path_get(&ureq->primary_path, kreq->primary_path);
-   ib_ucm_event_path_get(&ureq->alternate_path, kreq->alternate_path);
+   ib_copy_path_rec_to_user(&ureq->primary_path, kreq->primary_path);
+   if (kreq->alternate_path)
+   ib_copy_path_rec_to_user(&ureq->alternate_path,
+kreq->alternate_path);
 }
 
 static void ib_ucm_event_rep_get(struct ib_ucm_rep_event_resp *urep,
@@ -322,8 +295,8 @@ static int ib_ucm_event_process(struct i
info  = evt->param.rej_rcvd.ari;
break;
case IB_CM_LAP_RECEIVED:
-   ib_ucm_event_path_get(&uvt->resp.u.lap_resp.path,
- evt->param.lap_rcvd.alternate_path);
+   ib_copy_path_rec_to_user(&uvt->resp.u.lap_resp.path,
+evt->param.lap_rcvd.alternate_path);
uvt->data_len = IB_CM_LAP_PRIVATE_DATA_SIZE;
uvt->resp.present = IB_UCM_PRES_ALTERNATE;
break;
@@ -635,65 +608,11 @@ static ssize_t ib_ucm_attr_id(struct ib_
return result;
 }
 
-static void ib_ucm_copy_ah_attr(struct ib_ucm_ah_attr *dest_attr,
-   struct ib_ah_attr *src_attr)
-{
-   memcpy(dest_attr->grh_dgid, src_attr->grh.dgid.raw,
-  sizeof src_attr->grh.dgid);
-   dest_attr->grh_flow_label = src_attr->grh.flow_label;
-   dest_attr->grh_sgid_index = src_attr->grh.sgid_index;
-   dest_attr->grh_hop_limit = src_attr->grh.hop_limit;
-   dest_attr->grh_traffic_class = src_attr->grh.traffic_class;
-
-   dest_attr->dlid = src_attr->dlid;
-   dest_attr->sl = src_attr->sl;
-   dest_attr->src_path_bits = src_attr->src_path_bits;
-   dest_attr->static_rate = src_attr->static_rate;
-   dest_attr->is_global = (src_attr->ah_fl

[PATCH 2/6] IB: match connection requests based on private data

2006-03-06 Thread Sean Hefty
Extend matching connection requests to listens in the Infiniband CM to include
private data checks.

This allows applications to listen on the same service identifier, with private
data directing the request to the appropriate application.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>

---

diff -uprN -X linux-2.6.git/Documentation/dontdiff 
linux-2.6.git/drivers/infiniband/core/cm.c 
linux-2.6.ib/drivers/infiniband/core/cm.c
--- linux-2.6.git/drivers/infiniband/core/cm.c  2006-01-16 10:25:26.0 
-0800
+++ linux-2.6.ib/drivers/infiniband/core/cm.c   2006-01-16 16:03:35.0 
-0800
@@ -32,7 +32,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: cm.c 2821 2005-07-08 17:07:28Z sean.hefty $
+ * $Id: cm.c 4311 2005-12-05 18:42:01Z sean.hefty $
  */
 #include 
 #include 
@@ -130,6 +130,7 @@ struct cm_id_private {
/* todo: use alternate port on send failure */
struct cm_av av;
struct cm_av alt_av;
+   struct ib_cm_private_data_compare *compare_data;
 
void *private_data;
__be64 tid;
@@ -355,6 +356,40 @@ static struct cm_id_private * cm_acquire
return cm_id_priv;
 }
 
+static void cm_mask_compare_data(u8 *dst, u8 *src, u8 *mask)
+{
+   int i;
+
+   for (i = 0; i < IB_CM_PRIVATE_DATA_COMPARE_SIZE; i++)
+   dst[i] = src[i] & mask[i];
+}
+
+static int cm_compare_data(struct ib_cm_private_data_compare *src_data,
+  struct ib_cm_private_data_compare *dst_data)
+{
+   u8 src[IB_CM_PRIVATE_DATA_COMPARE_SIZE];
+   u8 dst[IB_CM_PRIVATE_DATA_COMPARE_SIZE];
+
+   if (!src_data || !dst_data)
+   return 0;
+   
+   cm_mask_compare_data(src, src_data->data, dst_data->mask);
+   cm_mask_compare_data(dst, dst_data->data, src_data->mask);
+   return memcmp(src, dst, IB_CM_PRIVATE_DATA_COMPARE_SIZE);
+}
+
+static int cm_compare_private_data(u8 *private_data,
+  struct ib_cm_private_data_compare *dst_data)
+{
+   u8 src[IB_CM_PRIVATE_DATA_COMPARE_SIZE];
+
+   if (!dst_data)
+   return 0;
+   
+   cm_mask_compare_data(src, private_data, dst_data->mask);
+   return memcmp(src, dst_data->data, IB_CM_PRIVATE_DATA_COMPARE_SIZE);
+}
+
 static struct cm_id_private * cm_insert_listen(struct cm_id_private 
*cm_id_priv)
 {
struct rb_node **link = &cm.listen_service_table.rb_node;
@@ -362,14 +397,18 @@ static struct cm_id_private * cm_insert_
struct cm_id_private *cur_cm_id_priv;
__be64 service_id = cm_id_priv->id.service_id;
__be64 service_mask = cm_id_priv->id.service_mask;
+   int data_cmp;
 
while (*link) {
parent = *link;
cur_cm_id_priv = rb_entry(parent, struct cm_id_private,
  service_node);
+   data_cmp = cm_compare_data(cm_id_priv->compare_data,
+  cur_cm_id_priv->compare_data);
if ((cur_cm_id_priv->id.service_mask & service_id) ==
(service_mask & cur_cm_id_priv->id.service_id) &&
-   (cm_id_priv->id.device == cur_cm_id_priv->id.device))
+   (cm_id_priv->id.device == cur_cm_id_priv->id.device) &&
+   !data_cmp)
return cur_cm_id_priv;
 
if (cm_id_priv->id.device < cur_cm_id_priv->id.device)
@@ -378,6 +417,10 @@ static struct cm_id_private * cm_insert_
link = &(*link)->rb_right;
else if (service_id < cur_cm_id_priv->id.service_id)
link = &(*link)->rb_left;
+   else if (service_id > cur_cm_id_priv->id.service_id)
+   link = &(*link)->rb_right;
+   else if (data_cmp < 0)
+   link = &(*link)->rb_left;
else
link = &(*link)->rb_right;
}
@@ -387,16 +430,20 @@ static struct cm_id_private * cm_insert_
 }
 
 static struct cm_id_private * cm_find_listen(struct ib_device *device,
-__be64 service_id)
+__be64 service_id,
+u8 *private_data)
 {
struct rb_node *node = cm.listen_service_table.rb_node;
struct cm_id_private *cm_id_priv;
+   int data_cmp;
 
while (node) {
cm_id_priv = rb_entry(node, struct cm_id_private, service_node);
+   data_cmp = cm_compare_private_data(private_data,
+  cm_id_priv->compare_data);
if ((cm_id_priv->id.service_mask & service_id) ==
 cm_id_priv->id.service_id &&
-   (cm_id_priv->id.device == device))
+   (cm_id_priv->id.device == device) && !data_cmp)
return cm_id_priv;
 

[PATCH 3/6] net/IB: export ip_dev_find

2006-03-06 Thread Sean Hefty
Export ip_dev_find to allow locating a net_device given an IP address.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>

---

diff -uprN -X linux-2.6.git/Documentation/dontdiff 
linux-2.6.git/net/ipv4/fib_frontend.c 
linux-2.6.ib/net/ipv4/fib_frontend.c
--- linux-2.6.git/net/ipv4/fib_frontend.c   2006-01-16 10:28:29.0 
-0800
+++ linux-2.6.ib/net/ipv4/fib_frontend.c2006-01-16 16:14:24.0 
-0800
@@ -666,4 +666,5 @@ void __init ip_fib_init(void)
 }
 
 EXPORT_SYMBOL(inet_addr_type);
+EXPORT_SYMBOL(ip_dev_find);
 EXPORT_SYMBOL(ip_rt_ioctl);



-
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 4/6] IB: address translation to map IP to IB addresses (GIDs)

2006-03-06 Thread Sean Hefty
Add an address translation service that maps IP addresses to Infiniband
GID addresses using IPoIB.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>

---

diff -uprN -X linux-2.6.git/Documentation/dontdiff 
linux-2.6.git/drivers/infiniband/core/addr.c 
linux-2.6.ib/drivers/infiniband/core/addr.c
--- linux-2.6.git/drivers/infiniband/core/addr.c1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.ib/drivers/infiniband/core/addr.c 2006-01-16 16:14:24.0 
-0800
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2005 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.
+ * Copyright (c) 1999-2005, Mellanox Technologies, Inc. All rights reserved.
+ * Copyright (c) 2005 Intel Corporation.  All rights reserved.
+ *
+ * This Software is licensed under one of the following licenses:
+ *
+ * 1) under the terms of the "Common Public License 1.0" a copy of which is
+ *available from the Open Source Initiative, see
+ *http://www.opensource.org/licenses/cpl.php.
+ *
+ * 2) under the terms of the "The BSD License" a copy of which is
+ *available from the Open Source Initiative, see
+ *http://www.opensource.org/licenses/bsd-license.php.
+ *
+ * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
+ *copy of which is available from the Open Source Initiative, see
+ *http://www.opensource.org/licenses/gpl-license.php.
+ *
+ * Licensee has the right to choose one of the above licenses.
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice and one of the license notices.
+ *
+ * Redistributions in binary form must reproduce both the above copyright
+ * notice, one of the license notices in the documentation
+ * and/or other materials provided with the distribution.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+MODULE_AUTHOR("Sean Hefty");
+MODULE_DESCRIPTION("IB Address Translation");
+MODULE_LICENSE("Dual BSD/GPL");
+
+struct addr_req {
+   struct list_head list;
+   struct sockaddr src_addr;
+   struct sockaddr dst_addr;
+   struct rdma_dev_addr *addr;
+   void *context;
+   void (*callback)(int status, struct sockaddr *src_addr,
+struct rdma_dev_addr *addr, void *context);
+   unsigned long timeout;
+   int status;
+};
+
+static void process_req(void *data);
+
+static DECLARE_MUTEX(mutex);
+static LIST_HEAD(req_list);
+static DECLARE_WORK(work, process_req, NULL);
+struct workqueue_struct *rdma_wq;
+EXPORT_SYMBOL(rdma_wq);
+
+static int copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
+unsigned char *dst_dev_addr)
+{
+   switch (dev->type) {
+   case ARPHRD_INFINIBAND:
+   dev_addr->dev_type = IB_NODE_CA;
+   break;
+   default:
+   return -EADDRNOTAVAIL;
+   }
+
+   memcpy(dev_addr->src_dev_addr, dev->dev_addr, MAX_ADDR_LEN);
+   memcpy(dev_addr->broadcast, dev->broadcast, MAX_ADDR_LEN);
+   if (dst_dev_addr)
+   memcpy(dev_addr->dst_dev_addr, dst_dev_addr, MAX_ADDR_LEN);
+   return 0;
+}
+
+int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
+{
+   struct net_device *dev;
+   u32 ip = ((struct sockaddr_in *) addr)->sin_addr.s_addr;
+   int ret;
+
+   dev = ip_dev_find(ip);
+   if (!dev)
+   return -EADDRNOTAVAIL;
+
+   ret = copy_addr(dev_addr, dev, NULL);
+   dev_put(dev);
+   return ret;
+}
+EXPORT_SYMBOL(rdma_translate_ip);
+
+static void set_timeout(unsigned long time)
+{
+   unsigned long delay;
+
+   cancel_delayed_work(&work);
+
+   delay = time - jiffies;
+   if ((long)delay <= 0)
+   delay = 1;
+
+   queue_delayed_work(rdma_wq, &work, delay);
+}
+
+static void queue_req(struct addr_req *req)
+{
+   struct addr_req *temp_req;
+
+   down(&mutex);
+   list_for_each_entry_reverse(temp_req, &req_list, list) {
+   if (time_after(req->timeout, temp_req->timeout))
+   break;
+   }
+
+   list_add(&req->list, &temp_req->list);
+
+   if (req_list.next == &req->list)
+   set_timeout(req->timeout);
+   up(&mutex);
+}
+
+static void addr_send_arp(struct sockaddr_in *dst_in)
+{
+   struct rtable *rt;
+   struct flowi fl;
+   u32 dst_ip = dst_in->sin_addr.s_addr;
+
+   memset(&fl, 0, sizeof fl);
+   fl.nl_u.ip4_u.daddr = dst_ip;
+   if (ip_route_output_key(&rt, &fl))
+   return;
+
+   arp_send(ARPOP_REQUEST, ETH_P_ARP, rt->rt_gateway, rt->idev->dev,
+rt->rt_src, NULL, rt->idev->dev->dev_addr, NULL);
+   ip_rt_put(rt);
+}
+
+static int addr_resolve_remote(struct sockaddr_in *src_in,
+  struct sockaddr_in *dst_in,
+  struct rdma_dev_addr *addr)
+{
+   u32 src_ip = src_in->sin_addr.s_addr;
+   u32 dst_ip = dst_in->sin

[PATCH 6/6] IB: userspace support for RDMA connection manager

2006-03-06 Thread Sean Hefty
Kernel component necessary to support the userspace RDMA connection management
library.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>

---

diff -uprN -X linux-2.6.git/Documentation/dontdiff 
linux-2.6.git/drivers/infiniband/core/Makefile 
linux-2.6.ib/drivers/infiniband/core/Makefile
--- linux-2.6.git/drivers/infiniband/core/Makefile  2006-01-16 
16:58:58.0 -0800
+++ linux-2.6.ib/drivers/infiniband/core/Makefile   2006-01-16 
16:55:25.0 -0800
@@ -1,5 +1,5 @@
 obj-$(CONFIG_INFINIBAND) +=ib_core.o ib_mad.o ib_sa.o \
-   ib_cm.o ib_addr.o rdma_cm.o
+   ib_cm.o ib_addr.o rdma_cm.o rdma_ucm.o
 obj-$(CONFIG_INFINIBAND_USER_MAD) +=   ib_umad.o
 obj-$(CONFIG_INFINIBAND_USER_ACCESS) +=ib_uverbs.o ib_ucm.o
 
@@ -14,6 +14,8 @@ ib_cm-y :=cm.o
 
 rdma_cm-y :=   cma.o
 
+rdma_ucm-y :=  ucma.o
+
 ib_addr-y :=   addr.o
 
 ib_umad-y :=   user_mad.o
diff -uprN -X linux-2.6.git/Documentation/dontdiff 
linux-2.6.git/drivers/infiniband/core/ucma.c 
linux-2.6.ib/drivers/infiniband/core/ucma.c
--- linux-2.6.git/drivers/infiniband/core/ucma.c1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.ib/drivers/infiniband/core/ucma.c 2006-01-16 16:54:31.0 
-0800
@@ -0,0 +1,788 @@
+/*
+ * Copyright (c) 2005 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *  - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ *  - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+MODULE_AUTHOR("Sean Hefty");
+MODULE_DESCRIPTION("RDMA Userspace Connection Manager Access");
+MODULE_LICENSE("Dual BSD/GPL");
+
+enum {
+   UCMA_MAX_BACKLOG= 128
+};
+
+struct ucma_file {
+   struct semaphoremutex;
+   struct file *filp;
+   struct list_headctxs;
+   struct list_headevents;
+   wait_queue_head_t   poll_wait;
+};
+
+struct ucma_context {
+   int id;
+   wait_queue_head_t   wait;
+   atomic_tref;
+   int events_reported;
+   int backlog;
+
+   struct ucma_file*file;
+   struct rdma_cm_id   *cm_id;
+   __u64   uid;
+
+   struct list_headevents;/* list of pending events. */
+   struct list_headfile_list; /* member in file ctx list */
+};
+
+struct ucma_event {
+   struct ucma_context *ctx;
+   struct list_headfile_list; /* member in file event list */
+   struct list_headctx_list;  /* member in ctx event list */
+   struct rdma_cm_id   *cm_id;
+   struct rdma_ucm_event_resp resp;
+};
+
+static DECLARE_MUTEX(ctx_mutex);
+static DEFINE_IDR(ctx_idr);
+
+static struct ucma_context* ucma_get_ctx(struct ucma_file *file, int id)
+{
+   struct ucma_context *ctx;
+
+   down(&ctx_mutex);
+   ctx = idr_find(&ctx_idr, id);
+   if (!ctx)
+   ctx = ERR_PTR(-ENOENT);
+   else if (ctx->file != file)
+   ctx = ERR_PTR(-EINVAL);
+   else
+   atomic_inc(&ctx->ref);
+   up(&ctx_mutex);
+
+   return ctx;
+}
+
+static void ucma_put_ctx(struct ucma_context *ctx)
+{
+   if (atomic_dec_and_test(&ctx->ref))
+   wake_up(&ctx->wait);
+}
+
+static void ucma_cleanup_events(struct ucma_context *ctx)
+{
+   struct ucma_event *uevent;
+
+   down(&ctx->file->mutex);
+   list_del(&ctx->file_list);
+   while (!list_empty(&ctx->events)) {
+
+   uevent = list_entry(ctx->eve

RE: [PATCH 2/6] IB: match connection requests based on private data

2006-03-06 Thread Caitlin Bestler
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Sean Hefty
> Sent: Monday, March 06, 2006 11:04 AM
> To: 'Roland Dreier'
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; 
> openib-general@openib.org
> Subject: [PATCH 2/6] IB: match connection requests based on 
> private data
> 
> Extend matching connection requests to listens in the 
> Infiniband CM to include private data checks.
> 
> This allows applications to listen on the same service 
> identifier, with private data directing the request to the 
> appropriate application.
> 
> Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>
> 

The term "private data" is intended to convey the
intent that the data is private to the application
layer and is opaque to middleware and the network.

By what mechanism does the listening application
delegate how much of the private data for use by
the CM for sub-dividing a listen? What does an 
application do if it wishes to retain full ownership
of the private data?


-
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 5/6] IB: IP address based RDMA connection manager

2006-03-06 Thread Sean Hefty
Kernel mode connection management agent over Infiniband that connects based
on IP addresses.  The agent defines a generic RDMA connection abstraction
to support clients wanting to connect over different RDMA devices.

Agent also handles RDMA device hotplug events on behalf of clients.

Signed-off-by: Sean Hefty <[EMAIL PROTECTED]>

---

diff -uprN -X linux-2.6.git/Documentation/dontdiff 
linux-2.6.git/drivers/infiniband/core/cma.c 
linux-2.6.ib/drivers/infiniband/core/cma.c
--- linux-2.6.git/drivers/infiniband/core/cma.c 1969-12-31 16:00:00.0 
-0800
+++ linux-2.6.ib/drivers/infiniband/core/cma.c  2006-01-16 16:17:34.0 
-0800
@@ -0,0 +1,1639 @@
+/*
+ * Copyright (c) 2005 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.
+ * Copyright (c) 1999-2005, Mellanox Technologies, Inc. All rights reserved.
+ * Copyright (c) 2005 Intel Corporation.  All rights reserved.
+ *
+ * This Software is licensed under one of the following licenses:
+ *
+ * 1) under the terms of the "Common Public License 1.0" a copy of which is
+ *available from the Open Source Initiative, see
+ *http://www.opensource.org/licenses/cpl.php.
+ *
+ * 2) under the terms of the "The BSD License" a copy of which is
+ *available from the Open Source Initiative, see
+ *http://www.opensource.org/licenses/bsd-license.php.
+ *
+ * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
+ *copy of which is available from the Open Source Initiative, see
+ *http://www.opensource.org/licenses/gpl-license.php.
+ *
+ * Licensee has the right to choose one of the above licenses.
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice and one of the license notices.
+ *
+ * Redistributions in binary form must reproduce both the above copyright
+ * notice, one of the license notices in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+MODULE_AUTHOR("Guy German");
+MODULE_DESCRIPTION("Generic RDMA CM Agent");
+MODULE_LICENSE("Dual BSD/GPL");
+
+#define CMA_CM_RESPONSE_TIMEOUT 20
+#define CMA_MAX_CM_RETRIES 3
+
+static void cma_add_one(struct ib_device *device);
+static void cma_remove_one(struct ib_device *device);
+
+static struct ib_client cma_client = {
+   .name   = "cma",
+   .add= cma_add_one,
+   .remove = cma_remove_one
+};
+
+static LIST_HEAD(dev_list);
+static LIST_HEAD(listen_any_list);
+static DECLARE_MUTEX(mutex);
+
+struct cma_device {
+   struct list_headlist;
+   struct ib_device*device;
+   __be64  node_guid;
+   wait_queue_head_t   wait;
+   atomic_trefcount;
+   struct list_headid_list;
+};
+
+enum cma_state {
+   CMA_IDLE,
+   CMA_ADDR_QUERY,
+   CMA_ADDR_RESOLVED,
+   CMA_ROUTE_QUERY,
+   CMA_ROUTE_RESOLVED,
+   CMA_CONNECT,
+   CMA_ADDR_BOUND,
+   CMA_LISTEN,
+   CMA_DEVICE_REMOVAL,
+   CMA_DESTROYING
+};
+
+/*
+ * Device removal can occur at anytime, so we need extra handling to
+ * serialize notifying the user of device removal with other callbacks.
+ * We do this by disabling removal notification while a callback is in process,
+ * and reporting it after the callback completes.
+ */
+struct rdma_id_private {
+   struct rdma_cm_id   id;
+
+   struct list_headlist;
+   struct list_headlisten_list;
+   struct cma_device   *cma_dev;
+
+   enum cma_state  state;
+   spinlock_t  lock;
+   wait_queue_head_t   wait;
+   atomic_trefcount;
+   wait_queue_head_t   wait_remove;
+   atomic_tdev_remove;
+
+   int backlog;
+   int timeout_ms;
+   struct ib_sa_query  *query;
+   int query_id;
+   struct ib_cm_id *cm_id;
+
+   u32 seq_num;
+   u32 qp_num;
+   enum ib_qp_type qp_type;
+   u8  srq;
+};
+
+struct cma_work {
+   struct work_struct  work;
+   struct rdma_id_private  *id;
+};
+
+union cma_ip_addr {
+   struct in6_addr ip6;
+   struct {
+   __u32 pad[3];
+   __u32 addr;
+   } ip4;
+};
+
+struct cma_hdr {
+   u8 cma_version;
+   u8 ip_version;  /* IP version: 7:4 */
+   __u16 port;
+   union cma_ip_addr src_addr;
+   union cma_ip_addr dst_addr;
+};
+
+struct sdp_hh {
+   u8 sdp_version;
+   u8 ip_version;  /* IP version: 7:4 */
+   u8 sdp_specific1[10];
+   __u16 port;
+   __u16 sdp_specific2;
+   union cma_ip_addr src_addr;
+   union cma_ip_addr dst_addr;
+};
+
+#define CMA_VERSION 0x10
+#define SDP_VERSION 0x22
+
+static int cma_comp(struct rdma_id_private *id_priv,

Re: [openib-general] RE: [PATCH 2/6] IB: match connection requests based on private data

2006-03-06 Thread Sean Hefty

Caitlin Bestler wrote:

The term "private data" is intended to convey the
intent that the data is private to the application
layer and is opaque to middleware and the network.


The private data area is for the use of whatever client resides above the 
Infiniband CM only.  There is no assumption about whether that client is 
middleware or an application.



By what mechanism does the listening application
delegate how much of the private data for use by
the CM for sub-dividing a listen? What does an 
application do if it wishes to retain full ownership

of the private data?


An application that interfaces directly with the Infiniband CM always retains 
full control of any private data.  Applications that interface to middleware are 
restricted by the limitations of that middleware layer.


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


RE: RFC: move SDP from AF_INET_SDP to IPPROTO_SDP

2006-03-06 Thread Caitlin Bestler
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of David Stevens
> Sent: Monday, March 06, 2006 11:49 AM
> To: Michael S. Tsirkin
> Cc: Linux Kernel Mailing List; netdev@vger.kernel.org
> Subject: Re: RFC: move SDP from AF_INET_SDP to IPPROTO_SDP
> 
> I don't know any details about SDP, but if there are no 
> differences at the protocol layer, then neither the address 
> family nor the protocol is appropriate. If it's just an API 
> change, the socket type is the right selector. So, maybe 
> SOCK_DIRECT to go along with SOCK_STREAM, SOCK_DGRAM, etc.
> +-DLS

That wouldn't work either. The whole point of SDP, or TOE,
is that the API is either totally unchanged or at least
essentially unchanged.

Whenever an IP Address is used (SDP/iWARP, TOE and potentially
SDP/IB) changing from AF_INET* is wrong.

For both SDP/iWARP and SDP/IB you could argue that a different
wire protocol is in use so IPPROTO_SDP is acceptable.
That's probably the best answer as long as we are stuck
under the restriction that the selection of an alternate
stack cannot be done in the exact manner that the consumer
wants it done (that is transparently to the application).

There are even some corner case scenarios where the 
application might care whether their SOCK_STREAM was
carried over SDP or plain TCP. So a protocol based
distinction is probably the least misleading of all
the explicit selection options.

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


Re: RFC: move SDP from AF_INET_SDP to IPPROTO_SDP

2006-03-06 Thread Michael S. Tsirkin
Quoting r. David Stevens <[EMAIL PROTECTED]>:
> Subject: Re: RFC: move SDP from AF_INET_SDP to IPPROTO_SDP
> 
> I don't know any details about SDP, but if there are no differences at the
> protocol layer, then neither the address family nor the protocol is
> appropriate. If it's just an API change, the socket type is the right
> selector. So, maybe SOCK_DIRECT to go along with SOCK_STREAM,
> SOCK_DGRAM, etc.

No, the API SDP implements is the regular SOCK_STREAM semantics.

The difference is in the way connections are established with
infiniband connection management messages, and data is transferred
with infiniband reliable connection send messages.

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies
-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread Martin Michlmayr
* Francois Romieu <[EMAIL PROTECTED]> [2006-03-06 21:23]:
> > http://www.cyrius.com/tmp/config-2.6.16-rc5-486
> > By the way, I'm getting the following messages in dmesg:
> netconsole appears enabled. Do you use it ?

It's a standard Debian kernel config so pretty much everything is
enabled as a module.  I didn't use netconsole.
-- 
Martin Michlmayr
http://www.cyrius.com/
-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread Francois Romieu
Martin Michlmayr <[EMAIL PROTECTED]> :
[...]
> http://www.cyrius.com/tmp/config-2.6.16-rc5-486
> 
> By the way, I'm getting the following messages in dmesg:

netconsole appears enabled. Do you use it ?

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


RE: RFC: move SDP from AF_INET_SDP to IPPROTO_SDP

2006-03-06 Thread David Stevens
IPPROTO_* should match the protocol field on the wire, which
I gather isn't different. And I'm assuming there is no standard API
defined already...

What about using a socket option?

+-DLS

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


RE: RFC: move SDP from AF_INET_SDP to IPPROTO_SDP

2006-03-06 Thread Caitlin Bestler
 

> -Original Message-
> From: David Stevens [mailto:[EMAIL PROTECTED] 
> Sent: Monday, March 06, 2006 12:32 PM
> To: Caitlin Bestler
> Cc: Linux Kernel Mailing List; Michael S. Tsirkin; 
> netdev@vger.kernel.org
> Subject: RE: RFC: move SDP from AF_INET_SDP to IPPROTO_SDP
> 
> IPPROTO_* should match the protocol field on the wire, which 
> I gather isn't different. And I'm assuming there is no 
> standard API defined already...
> 

SDP uses the existing standard sockets API.
That was the intent in its design, and it is
the sole justification for its use. If you are
not using the existing sockets API then your
application would be *far* better off coding
directly to RDMA.

The wire protocol *is* different, it uses RDMA.
There is some justification for the application
knowing this, albeit slight ones. For example 
you need to know if the peer supports SDP and
it might effect how intermediate firewalls
need to be configured.

-
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


IPv6: avoid dereference of null route entry in ipv6_del_addr()

2006-03-06 Thread Jean-Mickael Guerin

Hi,

This patch fixes potential null pointer dereference (I never experiment 
such crash).

The patch is made for net-2.6.17.

Regards,

Jean-Mickael

Signed-off-by: [EMAIL PROTECTED]

--
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8df9eb9..8393f45 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -716,16 +716,18 @@ static void ipv6_del_addr(struct inet6_i
ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len);
rt = rt6_lookup(&prefix, NULL, ifp->idev->dev->ifindex, 1);
 
-   if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 
0)) {
-   if (onlink == 0) {
-   ip6_del_rt(rt, NULL, NULL, NULL);
-   rt = NULL;
-   } else if (!(rt->rt6i_flags & RTF_EXPIRES)) {
-   rt->rt6i_expires = expires;
-   rt->rt6i_flags |= RTF_EXPIRES;
+   if (rt) {
+   if ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 
0) {
+   if (onlink == 0) {
+   ip6_del_rt(rt, NULL, NULL, NULL);
+   rt = NULL;
+   } else if (!(rt->rt6i_flags & RTF_EXPIRES)) {
+   rt->rt6i_expires = expires;
+   rt->rt6i_flags |= RTF_EXPIRES;
+   }
}
+   dst_release(&rt->u.dst);
}
-   dst_release(&rt->u.dst);
}
 
in6_ifa_put(ifp);


Re: [RFC/PATCH 6/13] d80211: remove obsolete stuff

2006-03-06 Thread Jouni Malinen
On Mon, Mar 06, 2006 at 08:07:26PM +0100, Jiri Benc wrote:
> On Mon, 6 Mar 2006 10:49:46 -0800, Jouni Malinen wrote:
> > The reason for this optimization was in even high-end CPUs starting to
> > run out of resources when running one radio with 2007 "virtual STAs",

> Yes, I'm aware of that. But I'm afraid that hard-wired need for STA
> interfaces to have incremental MAC addresses is not acceptable - and
> this fact alone means degrading of performance in case of 2000+ STAs.

Since this is not needed for most normal use cases, this is probably
fine. However, being able to test with large number of STAs is very
useful test case for AP functionality (number of APs crash if you try to
associate that many STAs..) and performance. One approach could be to
add a hash table for address to netdev mapping. If that is not easily
doable, a (hopefully) small patch could of course be maintained
separately, but I would prefer to see this operation mode as something
that is supported in the stack by default.

-- 
Jouni MalinenPGP id EFC895FA
-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread Francois Romieu
Martin Michlmayr <[EMAIL PROTECTED]> :
[...]
> By the way, I'm getting the following messages in dmesg:
> 
> eth0: tx err, status 0x7fffb002

Tx underrun.

Is there anything which could induce a noticeable load on the PCI bus ?

-- 
Ueimor

-
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: de2104x: interrupts before interrupt handler is registered

2006-03-06 Thread Francois Romieu
Martin Michlmayr <[EMAIL PROTECTED]> :
[...]
> There's another interrupt related bug in the driver, though.  I
> sometimes get a kernel panic when rsycing several 100 megs of data
> across the LAN.  A picture showing the call trace can be found at
> http://www.cyrius.com/tmp/de2104x_panic.jpg

Not sure about this one, but...

Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>

diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index d7fb3ff..49235e2 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -1455,6 +1455,8 @@ static void de_tx_timeout (struct net_de
synchronize_irq(dev->irq);
de_clean_rings(de);
 
+   de_init_rings(de);
+
de_init_hw(de);

netif_wake_queue(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


spider_net versus sungem_phy

2006-03-06 Thread Jens Osterkamp

Which kernel version was this in ? 2.6.16-rc5 builds ok for me.

drivers/net/spider_net.c:421: multiple definition of `mii_phy_probe'
drivers/net/sungem_phy.o(.opd+0x160):drivers/net/sungem_phy.c:95: first
 defined here -

-
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/9] sky2: warn on newer untested chips

2006-03-06 Thread Stephen Hemminger
Wrong version... of patch please use this one!
-
The driver includes support for the lowcost version of Yukon-EC chipset.
Since this has never been explictly tested, add a disclaimer message
to get some feedback.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- sky2-1.0.orig/drivers/net/sky2.c2006-03-06 13:21:21.0 -0800
+++ sky2-1.0/drivers/net/sky2.c 2006-03-06 13:23:03.0 -0800
@@ -2204,6 +2204,13 @@
return -EOPNOTSUPP;
}
 
+   /* This chip is new and not tested yet */
+   if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
+   pr_info(PFX "%s: is a version of Yukon 2 chipset that has not 
been tested yet.\n",
+   pci_name(hw->pdev));
+   pr_info("Please report success/failure to maintainer <[EMAIL 
PROTECTED]>\n");
+   }
+
/* disable ASF */
if (hw->chip_id <= CHIP_ID_YUKON_EC) {
sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET);
-
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 7/9] sky2: smarter irq handling

2006-03-06 Thread Francois Romieu
(s/osld.org/osdl.org/g)

Stephen Hemminger <[EMAIL PROTECTED]> :
> Redo the interupt handling of sky2 driver based on the IRQ mangement
> documentation. All interrupts are handled by the device0 NAPI poll
> routine.

Is there something beyond smarter irq handling which would urge to
merge this code for 2.6.16 ?

I would not mind some extra time to review it.

-- 
Ueimor
-
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 7/9] sky2: smarter irq handling

2006-03-06 Thread Jeff Garzik

Stephen Hemminger wrote:

On Mon, 6 Mar 2006 22:30:59 +0100
Francois Romieu <[EMAIL PROTECTED]> wrote:



(s/osld.org/osdl.org/g)

Stephen Hemminger <[EMAIL PROTECTED]> :


Redo the interupt handling of sky2 driver based on the IRQ mangement
documentation. All interrupts are handled by the device0 NAPI poll
routine.


Is there something beyond smarter irq handling which would urge to
merge this code for 2.6.16 ?

I would not mind some extra time to review it.




Well, the existing code hangs if it receives a large packet, ring gets, full
or loses race with NAPI.


Seems to me if you fix the first two, the last problem will go away?

Patch #7 makes me much more nervous than the other patches. 
Additionally, 2.6.16-rc is really down to taking one-liners now.


Jeff



-
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 7/9] sky2: smarter irq handling

2006-03-06 Thread Stephen Hemminger
On Mon, 6 Mar 2006 22:30:59 +0100
Francois Romieu <[EMAIL PROTECTED]> wrote:

> (s/osld.org/osdl.org/g)
> 
> Stephen Hemminger <[EMAIL PROTECTED]> :
> > Redo the interupt handling of sky2 driver based on the IRQ mangement
> > documentation. All interrupts are handled by the device0 NAPI poll
> > routine.
> 
> Is there something beyond smarter irq handling which would urge to
> merge this code for 2.6.16 ?
> 
> I would not mind some extra time to review it.
> 

Well, the existing code hangs if it receives a large packet, ring gets, full
or loses race with NAPI.
-
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


[EMAIL PROTECTED]: [PATCH] use fget_light() in net/socket.c]

2006-03-06 Thread Benjamin LaHaise
Hello folks,

Here's an updated copy of the patch to use fget_light in net/socket.c.  
Rerunning the tests show a drop of ~80Mbit/s on average, which looks 
bad until you see the drop in cpu usage from ~89% to ~82%.  That will 
get fixed in another patch...

Before: max 8113.70, min 8026.32, avg 8072.34
 87380  16384  1638410.01  8045.55   87.1187.111.774   1.774 
 87380  16384  1638410.01  8065.14   90.8690.861.846   1.846 
 87380  16384  1638410.00  8077.76   89.8589.851.822   1.822 
 87380  16384  1638410.00  8026.32   89.8089.801.833   1.833 
 87380  16384  1638410.01  8108.59   89.8189.811.815   1.815 
 87380  16384  1638410.01  8034.53   89.0189.011.815   1.815 
 87380  16384  1638410.00  8113.70   90.4590.451.827   1.827 
 87380  16384  1638410.00  8111.37   89.9089.901.816   1.816 
 87380  16384  1638410.01  8077.75   87.9687.961.784   1.784 
 87380  16384  1638410.00  8062.70   90.2590.251.834   1.834 

After: max 8035.81, min 7963.69, avg 7998.14
 87380  16384  1638410.01  8000.93   82.1182.111.682   1.682 
 87380  16384  1638410.01  8016.17   83.6783.671.710   1.710 
 87380  16384  1638410.01  7963.69   83.4783.471.717   1.717 
 87380  16384  1638410.01  8014.35   81.7181.711.671   1.671 
 87380  16384  1638410.00  7967.68   83.4183.411.715   1.715 
 87380  16384  1638410.00  7995.22   81.0081.001.660   1.660 
 87380  16384  1638410.00  8002.61   83.9083.901.718   1.718 
 87380  16384  1638410.00  8035.81   81.7181.711.666   1.666 
 87380  16384  1638410.01  8005.36   82.5682.561.690   1.690 
 87380  16384  1638410.00  7979.61   82.5082.501.694   1.694 


-- 
"Time is of no importance, Mr. President, only life is important."
Don't Email: <[EMAIL PROTECTED]>.

Signed-off-by: Benjamin LaHaise <[EMAIL PROTECTED]>
diff --git a/net/socket.c b/net/socket.c
index 3ca31e8..24c4a1a 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -429,6 +429,28 @@ int sock_map_fd(struct socket *sock)
return fd;
 }
 
+static struct socket *sock_from_file(struct file *file, int *err)
+{
+   struct inode *inode;
+   struct socket *sock;
+
+   if (file->f_op == &socket_file_ops)
+   return file->private_data;  /* set in sock_map_fd */
+
+   inode = file->f_dentry->d_inode;
+   if (!S_ISSOCK(inode->i_mode)) {
+   *err = -ENOTSOCK;
+   return NULL;
+   }
+
+   sock = SOCKET_I(inode);
+   if (sock->file != file) {
+   printk(KERN_ERR "socki_lookup: socket file changed!\n");
+   sock->file = file;
+   }
+   return sock;
+}
+
 /**
  * sockfd_lookup   -   Go from a file number to its socket slot
  * @fd: file handle
@@ -445,31 +467,31 @@ int sock_map_fd(struct socket *sock)
 struct socket *sockfd_lookup(int fd, int *err)
 {
struct file *file;
-   struct inode *inode;
struct socket *sock;
 
-   if (!(file = fget(fd)))
-   {
+   if (!(file = fget(fd))) {
*err = -EBADF;
return NULL;
}
-
-   if (file->f_op == &socket_file_ops)
-   return file->private_data;  /* set in sock_map_fd */
-
-   inode = file->f_dentry->d_inode;
-   if (!S_ISSOCK(inode->i_mode)) {
-   *err = -ENOTSOCK;
+   sock = sock_from_file(file, err);
+   if (!sock)
fput(file);
-   return NULL;
-   }
+   return sock;
+}
 
-   sock = SOCKET_I(inode);
-   if (sock->file != file) {
-   printk(KERN_ERR "socki_lookup: socket file changed!\n");
-   sock->file = file;
+static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
+{
+   struct file *file;
+   struct socket *sock;
+
+   file = fget_light(fd, fput_needed);
+   if (file) {
+   sock = sock_from_file(file, err);
+   if (sock)
+   return sock;
+   fput_light(file, *fput_needed);
}
-   return sock;
+   return NULL;
 }
 
 /**
@@ -1304,19 +1326,17 @@ asmlinkage long sys_bind(int fd, struct 
 {
struct socket *sock;
char address[MAX_SOCK_ADDR];
-   int err;
+   int err, fput_needed;
 
-   if((sock = sockfd_lookup(fd,&err))!=NULL)
+   if((sock = sockfd_lookup_light(fd, &err, &fput_needed))!=NULL)
{
if((err=move_addr_to_kernel(umyaddr,addrlen,address))>=0) {
err = security_socket_bind(sock, (struct sockaddr 
*)address, addrlen);
-   if (err) {
-   sockfd_put(sock);
-   return err;
-   }
-   err = sock->ops->bin

Re: spider_net versus sungem_phy

2006-03-06 Thread Andrew Morton
Jens Osterkamp <[EMAIL PROTECTED]> wrote:
>
> 
> Which kernel version was this in ? 2.6.16-rc5 builds ok for me.
> 
> drivers/net/spider_net.c:421: multiple definition of `mii_phy_probe'
> drivers/net/sungem_phy.o(.opd+0x160):drivers/net/sungem_phy.c:95: first
>  defined here -

It was 2.6.16-rc5-mm2, `make allyesconfig'.  I don't see any patches
against those two files in rc5-mm2.

-
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


[RFC/PATCH] rcuification of ipv4 established and timewait connections

2006-03-06 Thread Benjamin LaHaise
Hello again,

This patch introduces the use of rcu for the ipv4 established connections 
hashtable, as well as the timewait table since they are closely intertwined.  
This removes 4 atomic operations per packet from the tcp_v4_rcv codepath, 
which helps quite a bit when the other performance barriers in the system 
are removed.  Eliminating the rwlock cache bouncing should also help on SMP 
systems.

By itself, this improves local netperf performance on a P4/HT by ~260Mbit/s 
on average.  With smaller packets (say, ethernet size) the difference should 
be larger.

Note that this patch changes the semantics of __inet_lookup() and 
__inet_lookup_established() to *not* perform a sock_hold().  This way 
we can avoid the atomic inc and dec of the reference count and rely on 
rcu pinning the socket over the scope of the rcu_read_lock_bh() region.

Only minimal fixes for ipv6 and dccp to use the renamed wlock, as I am not 
setup to test them.  I have stared at this patch for a while, and I think 
it's correct, but more eyes are definately warranted.  Most of the issues 
regarding the state and lifespan of a struct sock are already handled by 
the network layer as the socket can be locked after being retrieved from 
the connection hashtable, we just have to be careful about reinitializing 
fields that the rcu hash list depends on.

-ben

Before: max 7838.86, min 7771.90, avg 7811.68
 87380  16384  1638410.01  7793.04   90.5690.561.904   1.904 
 87380  16384  1638410.01  7806.54   91.6191.611.923   1.923 
 87380  16384  1638410.00  7819.29   90.8090.801.903   1.903 
 87380  16384  1638410.00  7815.89   90.7090.701.901   1.901 
 87380  16384  1638410.01  7771.90   91.6691.661.932   1.932 
 87380  16384  1638410.00  7831.59   90.2090.201.887   1.887 
 87380  16384  1638410.01  7796.56   91.2691.261.918   1.918 
 87380  16384  1638410.01  7838.86   89.2689.261.866   1.866 
 87380  16384  1638410.01  7835.44   90.5690.561.894   1.894 


After: max 8113.70, min 8026.32, avg 8072.34
 87380  16384  1638410.01  8045.55   87.1187.111.774   1.774 
 87380  16384  1638410.01  8065.14   90.8690.861.846   1.846 
 87380  16384  1638410.00  8077.76   89.8589.851.822   1.822 
 87380  16384  1638410.00  8026.32   89.8089.801.833   1.833 
 87380  16384  1638410.01  8108.59   89.8189.811.815   1.815 
 87380  16384  1638410.01  8034.53   89.0189.011.815   1.815 
 87380  16384  1638410.00  8113.70   90.4590.451.827   1.827 
 87380  16384  1638410.00  8111.37   89.9089.901.816   1.816 
 87380  16384  1638410.01  8077.75   87.9687.961.784   1.784 
 87380  16384  1638410.00  8062.70   90.2590.251.834   1.834 

-ben
-- 
"Time is of no importance, Mr. President, only life is important."
Don't Email: <[EMAIL PROTECTED]>.

Signed-off-by: Benjamin LaHaise <[EMAIL PROTECTED]>
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 25f708f..73b05ab 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -65,7 +65,7 @@ static inline void __inet6_hash(struct i
sk->sk_hash = hash = inet6_sk_ehashfn(sk);
hash &= (hashinfo->ehash_size - 1);
list = &hashinfo->ehash[hash].chain;
-   lock = &hashinfo->ehash[hash].lock;
+   lock = &hashinfo->ehash[hash].wlock;
write_lock(lock);
}
 
@@ -98,7 +98,7 @@ static inline struct sock *
struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash);
 
prefetch(head->chain.first);
-   read_lock(&head->lock);
+   read_lock(&head->wlock);
sk_for_each(sk, node, &head->chain) {
/* For IPV6 do the cheaper port and family tests first. */
if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif))
@@ -118,12 +118,12 @@ static inline struct sock *
goto hit;
}
}
-   read_unlock(&head->lock);
+   read_unlock(&head->wlock);
return NULL;
 
 hit:
sock_hold(sk);
-   read_unlock(&head->lock);
+   read_unlock(&head->wlock);
return sk;
 }
 
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 135d80f..4cde832 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -39,7 +39,7 @@
  * for the rest.  I'll experiment with dynamic table growth later.
  */
 struct inet_ehash_bucket {
-   rwlock_t  lock;
+   rwlock_t wlock;
struct hlist_head chain;
 };
 
@@ -224,7 +224,7 @@ static inline void __inet_hash(struct in
sk->sk_hash = inet_sk_ehashfn(sk);
head = inet_ehash_bucket(hashinfo, sk->sk_hash);
  

Re: [EMAIL PROTECTED]: [PATCH] use fget_light() in net/socket.c]

2006-03-06 Thread Rick Jones

Benjamin LaHaise wrote:

Hello folks,

Here's an updated copy of the patch to use fget_light in net/socket.c.  
Rerunning the tests show a drop of ~80Mbit/s on average, which looks 
bad until you see the drop in cpu usage from ~89% to ~82%.  That will 
get fixed in another patch...


Before: max 8113.70, min 8026.32, avg 8072.34
 87380  16384  1638410.01  8045.55   87.1187.111.774   1.774 
 87380  16384  1638410.01  8065.14   90.8690.861.846   1.846 
 87380  16384  1638410.00  8077.76   89.8589.851.822   1.822 
 87380  16384  1638410.00  8026.32   89.8089.801.833   1.833 
 87380  16384  1638410.01  8108.59   89.8189.811.815   1.815 
 87380  16384  1638410.01  8034.53   89.0189.011.815   1.815 
 87380  16384  1638410.00  8113.70   90.4590.451.827   1.827 
 87380  16384  1638410.00  8111.37   89.9089.901.816   1.816 
 87380  16384  1638410.01  8077.75   87.9687.961.784   1.784 
 87380  16384  1638410.00  8062.70   90.2590.251.834   1.834 


Average service demand: 1.8166 usecCPU/KB



After: max 8035.81, min 7963.69, avg 7998.14
 87380  16384  1638410.01  8000.93   82.1182.111.682   1.682 
 87380  16384  1638410.01  8016.17   83.6783.671.710   1.710 
 87380  16384  1638410.01  7963.69   83.4783.471.717   1.717 
 87380  16384  1638410.01  8014.35   81.7181.711.671   1.671 
 87380  16384  1638410.00  7967.68   83.4183.411.715   1.715 
 87380  16384  1638410.00  7995.22   81.0081.001.660   1.660 
 87380  16384  1638410.00  8002.61   83.9083.901.718   1.718 
 87380  16384  1638410.00  8035.81   81.7181.711.666   1.666 
 87380  16384  1638410.01  8005.36   82.5682.561.690   1.690 
 87380  16384  1638410.00  7979.61   82.5082.501.694   1.694 


Average service demand: 1.6923  usecCPU/KB

So, data transfer efficiency was improved by 6.8%.  Nice.  And that was 
with 16KB sends.


If you trust netperf :) and don't need min and max, you can use the 
confidence intervals feature to get it to run until it is 99 or 95% 
certain that the reported average is within +/- a percentage of the 
"real" average.


The global -I option sets the confidence level and width - eg -I 99,1 
would ask to be 99% certain of being +/- 0.5%.


The global -i option sets the minimum and maximum number of iterations 
in which to attempt to hit the confidence interval - eg -i 30,3 means 
run at least 3 iterations but no more than 30,  or -i 10 means run 10 
iterations regardless.


IIRC my netperf4-partner-in-crime has it reporting min and max as part 
of its confidence intervals support. 
http://www.netperf.org/svn/netperf4/trunk/


rick jones


-
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/6] net/IB: export ip_dev_find

2006-03-06 Thread Roland Dreier
Sean> Export ip_dev_find to allow locating a net_device given an
Sean> IP address.

My plan is to queue all of this stuff for merging in 2.6.17.

Is there any objection from netdev or openib-general people?

I just looked back, and the original "unexport ip_dev_find()" patch
was a de-Bunk-ing change.  Now that there is a modular user, is there
any problem with re-exporting it?

Thanks,
  Roland
-
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 6/6] IB: userspace support for RDMA connection manager

2006-03-06 Thread Roland Dreier
 > +struct rdma_ucm_query_route_resp {
 > +__u64 node_guid;
 > +struct ib_user_path_rec ib_route[2];
 > +struct sockaddr_in6 src_addr;
 > +struct sockaddr_in6 dst_addr;
 > +__u32 num_paths;
 > +__u8 port_num;
 > +__u8 reserved[3];
 > +};

Is there a 32-bit/64-bit compatibility problem here?  From a quick
look, struct sockaddr_in6 is not 8-byte aligned.

 - R.
-
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 6/6] IB: userspace support for RDMA connection manager

2006-03-06 Thread Roland Dreier
I think it makes sense to merge patches 1-5 independently of this
patch.  The kernel interface is needed by iSER and NFS/RDMA, and
maintaining compatibility isn't a huge deal, so we can merge it now
(assuming it looks mergable).

On the other hand I think it would be good to let this userspace
interface cook a little more, say in -mm.

Anyone have any problems with that plan?

 - R.
-
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: [openib-general] Re: [PATCH 6/6] IB: userspace support for RDMA connection manager

2006-03-06 Thread Sean Hefty

Roland Dreier wrote:

 > +struct rdma_ucm_query_route_resp {
 > + __u64 node_guid;
 > + struct ib_user_path_rec ib_route[2];
 > + struct sockaddr_in6 src_addr;
 > + struct sockaddr_in6 dst_addr;
 > + __u32 num_paths;
 > + __u8 port_num;
 > + __u8 reserved[3];
 > +};

Is there a 32-bit/64-bit compatibility problem here?  From a quick
look, struct sockaddr_in6 is not 8-byte aligned.


Unless I miss counted, they should be aligned.  ib_user_path_rec is defined near 
the end of patch 1/6.


+struct ib_user_path_rec {
+   __u8dgid[16];
+   __u8sgid[16];
+   __be16  dlid;
+   __be16  slid;
+   __u32   raw_traffic;
+   __be32  flow_label;
+   __u32   reversible;
+   __u32   mtu;
+   __be16  pkey;
+   __u8hop_limit;
+   __u8traffic_class;
+   __u8numb_path;
+   __u8sl;
+   __u8mtu_selector;
+   __u8rate_selector;
+   __u8rate;
+   __u8packet_life_time_selector;
+   __u8packet_life_time;
+   __u8preference;
+};

- Sean

-
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: [openib-general] Re: [PATCH 6/6] IB: userspace support for RDMA connection manager

2006-03-06 Thread Sean Hefty

Roland Dreier wrote:

On the other hand I think it would be good to let this userspace
interface cook a little more, say in -mm.


I think that this makes sense.

- Sean
-
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/6] net/IB: export ip_dev_find

2006-03-06 Thread David S. Miller
From: Roland Dreier <[EMAIL PROTECTED]>
Date: Mon, 06 Mar 2006 13:31:05 -0800

> Sean> Export ip_dev_find to allow locating a net_device given an
> Sean> IP address.
> 
> My plan is to queue all of this stuff for merging in 2.6.17.
> 
> Is there any objection from netdev or openib-general people?
> 
> I just looked back, and the original "unexport ip_dev_find()" patch
> was a de-Bunk-ing change.  Now that there is a modular user, is there
> any problem with re-exporting it?

I'm fine with re-exporting 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: [openib-general] Re: [PATCH 6/6] IB: userspace support for RDMA connection manager

2006-03-06 Thread Roland Dreier
Sean> Unless I miss counted, they should be aligned.
Sean> ib_user_path_rec is defined near the end of patch 1/6.

You're right.  struct sockaddr_in6 is 28 bytes long (not a multiple of
8) but gcc seems to lay everything out the same on 32-bit and 64-bit
architectures just the same.

 - R.
-
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: [openib-general] [PATCH 2/6] IB: match connection requests based on private data

2006-03-06 Thread Sean Hefty

Sean Hefty wrote:

+static void cm_mask_compare_data(u8 *dst, u8 *src, u8 *mask)
+{
+   int i;
+
+   for (i = 0; i < IB_CM_PRIVATE_DATA_COMPARE_SIZE; i++)
+   dst[i] = src[i] & mask[i];
+}
+
+static int cm_compare_data(struct ib_cm_private_data_compare *src_data,
+  struct ib_cm_private_data_compare *dst_data)
+{
+   u8 src[IB_CM_PRIVATE_DATA_COMPARE_SIZE];
+   u8 dst[IB_CM_PRIVATE_DATA_COMPARE_SIZE];


Ugh.  I sent the wrong patch series.  This was the original set of patches, 
before any feedback was incorporated.  I will need to resend patches 2, 4, 5, 
and 6.  Sorry about this.


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


  1   2   >