atl1 developers wanted

2007-10-28 Thread Chris Snook

Greetings, netdev!

	Since the Linux Driver Project apparently has a glut of talent, I figured I'd 
ask for a little help with an existing driver.  As some of you may know, Jay 
Cliburn and I have been working on atl1 since last summer, and we've gotten the 
driver merged and stable.  It does the basic things one expects a gigE driver to 
do, and it no longer does the things one expects a gigE driver to *not* do, but 
there are some hardware features that we don't support very well, or at all.


	If you have an atl1 board and want to get your hands dirty, we could use some 
help with the following:


Performance features:

TSO -- it works, but it's really slow, so we currently disable it by default
LRO -- would be nice to have
NAPI -- would be nice to have
configurable interrupt coalescing -- we're not currently taking advantage of 
this

feature testing:

jumbo frames -- last I checked, I could open connections with large MTU, but 
we've done very little validation, benchmarking, or optimization


IPv6 -- seems to work, but the hardware doesn't support offloading for IPv6 
traffic, so we need to know about the performance to prioritize work on the 
aforementioned performance features


other:

make WoLAN work reliably

-- 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] proc_fs.h redux

2007-10-28 Thread Alexey Dobriyan
On Sat, Oct 27, 2007 at 03:40:04PM -0700, Joe Perches wrote:
 On Sat, 2007-10-27 at 23:47 +0400, Alexey Dobriyan wrote:
  Remove proc_fs.h from headers that doesn't really need it.
 
  --- a/arch/powerpc/kernel/process.c
  +++ b/arch/powerpc/kernel/process.c
  @@ -17,6 +17,7 @@
   #include linux/errno.h
   #include linux/sched.h
   #include linux/kernel.h
  +#include linux/fs.h
 
 Your code doesn't match your patch description.
 
 You've got new includes of:
 
 linux/fs.h
 linux/proc_fs.h
 linux/err.h
 linux/kref.h
 
 and forward declarations of
 
 struct proc_dir_entry;
 struct file_operations;

Removal of header A from header B creates compilation breakages for
files which were getting A indirectly. So you have to complensate in all
such cases.

 As a general rule, I think it better to use includes
 than use naked forward declarations.

Well, we also want faster compilation and less time wasted when
test-compiling patches.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2.6.24 1/1]S2io: Fixed memory leak by freeing MSI-X local entry memories when vector allocation fails

2007-10-28 Thread Sivakumar Subramani
- Fixed memory leak by freeing MSI-X local entry memories when vector allocation
fails in s2io_add_isr.
- Added two utility functions do_rem_msix_isr and do_rem_inta_isr to eliminate
code duplication.

Signed-off-by: Veena Parat [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]
Signed-off-by: Santosh Rastapur [EMAIL PROTECTED]
---
diff -Nurp 2-0-26-6/drivers/net/s2io.c 2-0-26-7/drivers/net/s2io.c
--- 2-0-26-6/drivers/net/s2io.c 2007-10-24 09:20:39.0 -0700
+++ 2-0-26-7/drivers/net/s2io.c 2007-10-24 09:46:16.0 -0700
@@ -84,7 +84,7 @@
 #include s2io.h
 #include s2io-regs.h
 
-#define DRV_VERSION 2.0.26.6
+#define DRV_VERSION 2.0.26.7
 
 /* S2io Driver name  version. */
 static char s2io_driver_name[] = Neterion;
@@ -3775,6 +3775,46 @@ static int __devinit s2io_test_msi(struc
 
return err;
 }
+
+static void do_rem_msix_isr(struct s2io_nic * sp)
+{
+   struct swStat *stats = sp-mac_control.stats_info-sw_stat;
+   int i;
+   u16 msi_control;
+
+   for (i=1; (sp-s2io_entries[i].in_use ==
+   MSIX_REGISTERED_SUCCESS); i++) {
+   int vector = sp-entries[i].vector;
+   void *arg = sp-s2io_entries[i].arg;
+
+   synchronize_irq(vector);
+   free_irq(vector, arg);
+   }
+
+   kfree(sp-entries);
+   stats-mem_freed +=
+   (MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
+   kfree(sp-s2io_entries);
+   stats-mem_freed +=
+   (MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry));
+   sp-entries = NULL;
+   sp-s2io_entries = NULL;
+
+   pci_read_config_word(sp-pdev, 0x42, msi_control);
+   msi_control = 0xFFFE; /* Disable MSI */
+   pci_write_config_word(sp-pdev, 0x42, msi_control);
+
+   pci_disable_msix(sp-pdev);
+}
+
+static void do_rem_inta_isr(struct s2io_nic * sp)
+{
+   struct net_device *dev = sp-dev;
+
+   synchronize_irq(sp-pdev-irq);
+   free_irq(sp-pdev-irq, dev);
+}
+
 /* * *
  * Functions defined below concern the OS part of the driver *
  * * */
@@ -3809,28 +3849,11 @@ static int s2io_open(struct net_device *
int ret = s2io_enable_msi_x(sp);
 
if (!ret) {
-   u16 msi_control;
 
ret = s2io_test_msi(sp);
 
/* rollback MSI-X, will re-enable during add_isr() */
-   kfree(sp-entries);
-   sp-mac_control.stats_info-sw_stat.mem_freed +=
-   (MAX_REQUESTED_MSI_X *
-   sizeof(struct msix_entry));
-   kfree(sp-s2io_entries);
-   sp-mac_control.stats_info-sw_stat.mem_freed +=
-   (MAX_REQUESTED_MSI_X *
-   sizeof(struct s2io_msix_entry));
-   sp-entries = NULL;
-   sp-s2io_entries = NULL;
-
-   pci_read_config_word(sp-pdev, 0x42, msi_control);
-   msi_control = 0xFFFE; /* Disable MSI */
-   pci_write_config_word(sp-pdev, 0x42, msi_control);
-
-   pci_disable_msix(sp-pdev);
-
+   do_rem_msix_isr(sp);
}
if (ret) {
 
@@ -6864,15 +6887,22 @@ static int s2io_add_isr(struct s2io_nic 
}
}
if (err) {
+   do_rem_msix_isr(sp);
+
DBG_PRINT(ERR_DBG,%s:MSI-X-%d registration 
  failed\n, dev-name, i);
-   DBG_PRINT(ERR_DBG, Returned: %d\n, err);
-   return -1;
+
+   DBG_PRINT(ERR_DBG, %s: Defaulting to INTA\n,
+   dev-name);
+   sp-config.intr_type = INTA;
+   break;
}
sp-s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
}
-   printk(MSI-X-TX %d entries enabled\n,msix_tx_cnt);
-   printk(MSI-X-RX %d entries enabled\n,msix_rx_cnt);
+   if(!err) {
+   printk(MSI-X-TX %d entries enabled\n,msix_tx_cnt);
+   printk(MSI-X-RX %d entries enabled\n,msix_rx_cnt);
+   }
}
if (sp-config.intr_type == INTA) {
err = request_irq((int) sp-pdev-irq, s2io_isr, IRQF_SHARED,
@@ -6887,40 +6917,10 @@ static int s2io_add_isr(struct s2io_nic 
 }
 static void s2io_rem_isr(struct s2io_nic * sp)
 {
-   struct net_device *dev = sp-dev;
-   struct swStat *stats = sp-mac_control.stats_info-sw_stat;
-
-   if (sp-config.intr_type == MSI_X) {
-   int 

Re: [PATCH] proc_fs.h redux

2007-10-28 Thread Sam Ravnborg
 
 As a general rule, I think it better to use includes
 than use naked forward declarations.

Quite the opposite - at least in the kernel source.
The general rule is that a .h file shall include the
.h files which contain declarations used by said .h files.
But naked declarations as above is preferred over including
a full header file.

We see the full header dependency thing to blow off when
inline function are used - which is more and more the case.
In several cases we have converted inline functions to macros
just to simplify the nightmare of header dependencies we have.

Arnaldo have a nice script that generate a .ps file
showing all the dependencies.
He lately posted this URL: http://oops.ghostprotocols.net:81/acme/tcp.h.ps

Sam
-
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] proc_fs.h redux

2007-10-28 Thread Russell King
On Sat, Oct 27, 2007 at 03:40:04PM -0700, Joe Perches wrote:
 and forward declarations of
 
 struct proc_dir_entry;
 struct file_operations;
 
 As a general rule, I think it better to use includes
 than use naked forward declarations.

If you go down that route, you end up with _lots_ of circular
dependencies - header file X needs Y needs Z which needs X.  We've
been there, several times.  It very quickly becomes quite
unmaintainable - you end up with hard to predict behaviour from
include files.

The only realistic solution is to use forward declarations.

-- 
Russell King
 Linux kernel2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
-
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


b44 ssb link errors on sparc

2007-10-28 Thread Meelis Roos
  MODPOST 434 modules
ERROR: ioremap [drivers/ssb/ssb.ko] undefined!
ERROR: iounmap [drivers/ssb/ssb.ko] undefined!
ERROR: dma_alloc_coherent [drivers/net/b44.ko] undefined!
ERROR: dma_get_cache_alignment [drivers/net/b44.ko] undefined!
ERROR: dma_free_coherent [drivers/net/b44.ko] undefined!
ERROR: dma_mapping_error [drivers/net/b44.ko] undefined!
ERROR: dma_map_single [drivers/net/b44.ko] undefined!
ERROR: dma_sync_single_for_cpu [drivers/net/b44.ko] undefined!
ERROR: dma_sync_single_range_for_cpu [drivers/net/b44.ko] undefined!
ERROR: dma_unmap_single [drivers/net/b44.ko] undefined!

Do SSB and B44 need to depend on DMA API? They can be selected on 32-bit 
sparc architecture but do not link. This is 2.6.24-rc1 + yesterdays git.

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


Re: [PATCH] proc_fs.h redux

2007-10-28 Thread Bernhard Walle
* Russell King [EMAIL PROTECTED] [2007-10-28 11:34]:
 
 If you go down that route, you end up with _lots_ of circular
 dependencies - header file X needs Y needs Z which needs X.  We've
 been there, several times.  It very quickly becomes quite
 unmaintainable - you end up with hard to predict behaviour from
 include files.
 
 The only realistic solution is to use forward declarations.

In header files, yes. But that's not true for implementation files.


Thanks,
   Bernhard
-
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] proc_fs.h redux

2007-10-28 Thread Russell King
On Sun, Oct 28, 2007 at 12:59:52PM +0100, Bernhard Walle wrote:
 * Russell King [EMAIL PROTECTED] [2007-10-28 11:34]:
  
  If you go down that route, you end up with _lots_ of circular
  dependencies - header file X needs Y needs Z which needs X.  We've
  been there, several times.  It very quickly becomes quite
  unmaintainable - you end up with hard to predict behaviour from
  include files.
  
  The only realistic solution is to use forward declarations.
 
 In header files, yes. But that's not true for implementation files.

I don't think that needs saying - it's quite obvious.  You can't
access the contents of structures without their definitions being
available.

-- 
Russell King
 Linux kernel2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
-
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] proc_fs.h redux

2007-10-28 Thread Bernhard Walle
* Russell King [EMAIL PROTECTED] [2007-10-28 14:04]:
 On Sun, Oct 28, 2007 at 12:59:52PM +0100, Bernhard Walle wrote:
  * Russell King [EMAIL PROTECTED] [2007-10-28 11:34]:
   
   If you go down that route, you end up with _lots_ of circular
   dependencies - header file X needs Y needs Z which needs X.  We've
   been there, several times.  It very quickly becomes quite
   unmaintainable - you end up with hard to predict behaviour from
   include files.
   
   The only realistic solution is to use forward declarations.
  
  In header files, yes. But that's not true for implementation files.
 
 I don't think that needs saying - it's quite obvious.  You can't
 access the contents of structures without their definitions being
 available.

Of course. But there might be the case where an implementation file
doesn't access the structure itself but just passes the pointer to
some other function (which is implemented in another file). In that
case, you also have the choice between forward declaration and
including the header file in the implementation file.



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


Re: [PATCH] Fix/Rewrite of the mipsnet driver

2007-10-28 Thread Ralf Baechle
On Sun, Oct 28, 2007 at 04:38:46AM +, Thiemo Seufer wrote:

 Hello All,
 
 currently the mipsnet driver fails after transmitting a number of
 packages because SKBs are allocated but never freed. I fixed that
 and coudn't refrain from removing the most egregious warts.
 
 - mipsnet.h folded into mipsnet.c, as it doesn't provide any
   useful external interface.
 - Free SKB after transmission.
 - Call free_irq in mipsnet_close, to balance the request_irq in
   mipsnet_open.
 - Removed duplicate read of rxDataCount.
 - Some identifiers are now less verbose.
 - Removed dead and/or unnecessarily complex code.
 - Code formatting fixes.
 
 Tested on Qemu's mipssim emulation, with this patch it can boot a
 Debian NFSroot.

The patch does no longer apply to a recent tree, can you respin it?

  Ralf
-
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 00/04] pull request for 'upstream-jeff' branch

2007-10-28 Thread Francois Romieu

Please pull from branch 'upstream-jeff' in repository

git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6.git 
upstream-jeff

to get the changes below.

Distance from 'master' (96fd4cd3e40e240f0c385af87f58e74da8b7099a)
-

d1417862d7355f0b395d83f2884afd614b086695
bbd82f956e0db6190b16a8a00d3ed5d979f488e8
93dd79e87bbc98ef02610d54fe72d4a1931ee15e
7fab06c0ca89d99442a4baeddf417add585e2672

Diffstat


 drivers/net/Kconfig |   13 +++--
 drivers/net/r8169.c |   12 ++--
 2 files changed, 13 insertions(+), 12 deletions(-)

Shortlog


Francois Romieu (2):
  ipg: missing Kconfig dependency
  ipg: Kconfig whitepaces/tab damages

Stephen Hemminger (2):
  r8169: napi config
  r8169: remove poll_locked logic

Patch
-

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 86b8641..72d3447 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -166,13 +166,14 @@ config NET_SB1000
  If you don't have this card, of course say N.
 
 config IP1000
-   tristate IP1000 Gigabit Ethernet support
-   depends on PCI  EXPERIMENTAL
-   ---help---
- This driver supports IP1000 gigabit Ethernet cards.
+   tristate IP1000 Gigabit Ethernet support
+   depends on PCI  EXPERIMENTAL
+   select MII
+   ---help---
+ This driver supports IP1000 gigabit Ethernet cards.
 
- To compile this driver as a module, choose M here: the module
- will be called ipg.  This is recommended.
+ To compile this driver as a module, choose M here: the module
+ will be called ipg.  This is recommended.
 
 source drivers/net/arcnet/Kconfig
 
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index e8960f2..b94fa7e 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -392,7 +392,9 @@ struct rtl8169_private {
void __iomem *mmio_addr;/* memory map physical address */
struct pci_dev *pci_dev;/* Index of PCI device */
struct net_device *dev;
+#ifdef CONFIG_R8169_NAPI
struct napi_struct napi;
+#endif
spinlock_t lock;/* spin lock flag */
u32 msg_enable;
int chipset;
@@ -2989,13 +2991,16 @@ static void rtl8169_down(struct net_device *dev)
 {
struct rtl8169_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp-mmio_addr;
-   unsigned int poll_locked = 0;
unsigned int intrmask;
 
rtl8169_delete_timer(dev);
 
netif_stop_queue(dev);
 
+#ifdef CONFIG_R8169_NAPI
+   napi_disable(tp-napi);
+#endif
+
 core_down:
spin_lock_irq(tp-lock);
 
@@ -3009,11 +3014,6 @@ core_down:
 
synchronize_irq(dev-irq);
 
-   if (!poll_locked) {
-   napi_disable(tp-napi);
-   poll_locked++;
-   }
-
/* Give a racing hard_start_xmit a few cycles to complete. */
synchronize_sched();  /* FIXME: should this be synchronize_irq()? */
 
-- 
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


[PATCH 01/04] r8169: napi config

2007-10-28 Thread Francois Romieu
Don't call napi_disable if not configured and make sure that any
misuse of napi_xxx in future fails with a compile error.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Cc: Edward Hsu [EMAIL PROTECTED]
---
 drivers/net/r8169.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index e8960f2..c5eaf49 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -392,7 +392,9 @@ struct rtl8169_private {
void __iomem *mmio_addr;/* memory map physical address */
struct pci_dev *pci_dev;/* Index of PCI device */
struct net_device *dev;
+#ifdef CONFIG_R8169_NAPI
struct napi_struct napi;
+#endif
spinlock_t lock;/* spin lock flag */
u32 msg_enable;
int chipset;
@@ -3010,7 +3012,9 @@ core_down:
synchronize_irq(dev-irq);
 
if (!poll_locked) {
+#ifdef CONFIG_R8169_NAPI
napi_disable(tp-napi);
+#endif
poll_locked++;
}
 
-- 
1.5.2.4

-
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 02/04] r8169: remove poll_locked logic

2007-10-28 Thread Francois Romieu
Disabling napi polling early is well enough.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Cc: Edward Hsu [EMAIL PROTECTED]
---
 drivers/net/r8169.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c5eaf49..b94fa7e 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2991,13 +2991,16 @@ static void rtl8169_down(struct net_device *dev)
 {
struct rtl8169_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp-mmio_addr;
-   unsigned int poll_locked = 0;
unsigned int intrmask;
 
rtl8169_delete_timer(dev);
 
netif_stop_queue(dev);
 
+#ifdef CONFIG_R8169_NAPI
+   napi_disable(tp-napi);
+#endif
+
 core_down:
spin_lock_irq(tp-lock);
 
@@ -3011,13 +3014,6 @@ core_down:
 
synchronize_irq(dev-irq);
 
-   if (!poll_locked) {
-#ifdef CONFIG_R8169_NAPI
-   napi_disable(tp-napi);
-#endif
-   poll_locked++;
-   }
-
/* Give a racing hard_start_xmit a few cycles to complete. */
synchronize_sched();  /* FIXME: should this be synchronize_irq()? */
 
-- 
1.5.2.4

-
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 03/04] ipg: missing Kconfig dependency

2007-10-28 Thread Francois Romieu
Fix for the error below while linking vmlinux:
[...]
drivers/built-in.o: In function `ipg_ioctl':
drivers/net/ipg.c:2148: undefined reference to `generic_mii_ioctl'
drivers/built-in.o: In function `ipg_get_settings':
drivers/net/ipg.c:2181: undefined reference to `mii_ethtool_gset'
drivers/built-in.o: In function `ipg_set_settings':
drivers/net/ipg.c:2193: undefined reference to `mii_ethtool_sset'
drivers/built-in.o: In function `ipg_nway_reset':
drivers/net/ipg.c:2205: undefined reference to `mii_nway_restart'
make: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Cc: Avuton Olrich [EMAIL PROTECTED]
Cc: Jesse Huang [EMAIL PROTECTED]
Cc: Sorbica Shieh [EMAIL PROTECTED]
---
 drivers/net/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 86b8641..9f7ec7d 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -168,6 +168,7 @@ config NET_SB1000
 config IP1000
tristate IP1000 Gigabit Ethernet support
depends on PCI  EXPERIMENTAL
+   select MII
---help---
  This driver supports IP1000 gigabit Ethernet cards.
 
-- 
1.5.2.4

-
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 04/04] ipg: Kconfig whitepaces/tab damages

2007-10-28 Thread Francois Romieu
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Cc: Avuton Olrich [EMAIL PROTECTED]
Cc: Jesse Huang [EMAIL PROTECTED]
Cc: Sorbica Shieh [EMAIL PROTECTED]
---
 drivers/net/Kconfig |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 9f7ec7d..72d3447 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -166,14 +166,14 @@ config NET_SB1000
  If you don't have this card, of course say N.
 
 config IP1000
-   tristate IP1000 Gigabit Ethernet support
-   depends on PCI  EXPERIMENTAL
+   tristate IP1000 Gigabit Ethernet support
+   depends on PCI  EXPERIMENTAL
select MII
-   ---help---
- This driver supports IP1000 gigabit Ethernet cards.
+   ---help---
+ This driver supports IP1000 gigabit Ethernet cards.
 
- To compile this driver as a module, choose M here: the module
- will be called ipg.  This is recommended.
+ To compile this driver as a module, choose M here: the module
+ will be called ipg.  This is recommended.
 
 source drivers/net/arcnet/Kconfig
 
-- 
1.5.2.4

-
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] proc_fs.h redux

2007-10-28 Thread Roman Zippel
Hi,

On Sunday 28 October 2007, Russell King wrote:

 On Sat, Oct 27, 2007 at 03:40:04PM -0700, Joe Perches wrote:
  and forward declarations of
 
  struct proc_dir_entry;
  struct file_operations;
 
  As a general rule, I think it better to use includes
  than use naked forward declarations.

 If you go down that route, you end up with _lots_ of circular
 dependencies - header file X needs Y needs Z which needs X.  We've
 been there, several times.  It very quickly becomes quite
 unmaintainable - you end up with hard to predict behaviour from
 include files.

 The only realistic solution is to use forward declarations.

It's unfortunately more complicated than that. What basically needs to be done 
is to separate declarations from its users (usually inline functions). The 
problem is to correctly pull the declarations from the asm/... and 
linux/... header in the correct order. A typical mistake is to put 
declarations and inline functions in the same linux header and then include 
some additional from an asm header. For most high level header it's not much 
of a problem, but let's take linux/list.h as example. struct list_head is 
used everywhere, but just to get this one definition one also gets quite a 
few other dependencies as well.

bye, Roman
-
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/14 v2] nes: module and device initialization

2007-10-28 Thread Glenn Grundstrom
 
 OK, on a process level, my plan is to pull the current driver into a
 neteffect branch in my git tree with the intention of merging it for
 2.6.25.  I'll let you know when that's ready (probably early next
 week).  I'll probably do some cleanups there, and you can send me
 cleanup/fix patches against that branch any time too.  We should try
 to keep the cycle time short: the interval between the first posting
 of this driver and the current one was pretty long, and there's a lot
 of cleanup to do to get ready for the next merge window.  Does that
 plan make sense?
 
  - R.
 

Thanks Roland.  Let me know when you have your branch ready.

Glenn.
-
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: [linux-pm] QUESTION: How to fix race between .suspend routine and watchdog timer

2007-10-28 Thread Maxim Levitsky
On Sunday 28 October 2007 00:24:10 Alan Stern wrote:
 On Sat, 27 Oct 2007, Maxim Levitsky wrote:
 
   Use del_timer_sync().  It guarantees that when it returns, the timer 
   will be stopped and the timer routine will no longer be running on any 
   CPU.
   
  Even if the timer re-enables itself, are you sure?
 
 Last time I looked at the source code, that's what it did.  I'll look
 again...  Yep, it still does.  It checks to see if the timer routine is
 currently running; if so then it waits a little while and tries again.
 
 Alan Stern
 
 

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


Re: [PATCH] Fix/Rewrite of the mipsnet driver

2007-10-28 Thread Thiemo Seufer
Ralf Baechle wrote:
 On Sun, Oct 28, 2007 at 04:38:46AM +, Thiemo Seufer wrote:
 
  Hello All,
  
  currently the mipsnet driver fails after transmitting a number of
  packages because SKBs are allocated but never freed. I fixed that
  and coudn't refrain from removing the most egregious warts.
  
  - mipsnet.h folded into mipsnet.c, as it doesn't provide any
useful external interface.
  - Free SKB after transmission.
  - Call free_irq in mipsnet_close, to balance the request_irq in
mipsnet_open.
  - Removed duplicate read of rxDataCount.
  - Some identifiers are now less verbose.
  - Removed dead and/or unnecessarily complex code.
  - Code formatting fixes.
  
  Tested on Qemu's mipssim emulation, with this patch it can boot a
  Debian NFSroot.
 
 The patch does no longer apply to a recent tree, can you respin it?

Updated against linux-mips.org head and appended. Only compile-tested
this time, the mipssim kernel currently fails to build.


Thiemo


Signed-off-by: Thiemo Seufer [EMAIL PROTECTED]
---
 b/drivers/net/mipsnet.c |  201 
 drivers/net/mipsnet.h   |  112 --
 2 files changed, 134 insertions(+), 179 deletions(-)

diff --git a/drivers/net/mipsnet.c b/drivers/net/mipsnet.c
index aafc3ce..e9c0c79 100644
--- a/drivers/net/mipsnet.c
+++ b/drivers/net/mipsnet.c
@@ -4,8 +4,6 @@
  * for more details.
  */
 
-#define DEBUG
-
 #include linux/init.h
 #include linux/io.h
 #include linux/kernel.h
@@ -15,11 +13,93 @@
 #include linux/platform_device.h
 #include asm/mips-boards/simint.h
 
-#include mipsnet.h   /* actual device IO mapping */
+#define MIPSNET_VERSION 2007-10-28
+
+/*
+ * Net status/control block as seen by sw in the core.
+ */
+struct mipsnet_regs {
+   /*
+* Device info for probing, reads as MIPSNET%d where %d is some
+* form of version.
+*/
+   uint64_t devId; /*0x00 */
 
-#define MIPSNET_VERSION 2005-06-20
+   /*
+* read only busy flag.
+* Set and cleared by the Net Device to indicate that an rx or a tx
+* is in progress.
+*/
+   uint32_t busy;  /*0x08 */
 
-#define mipsnet_reg_address(dev, field) (dev-base_addr + field_offset(field))
+   /*
+* Set by the Net Device.
+* The device will set it once data has been received.
+* The value is the number of bytes that should be read from
+* rxDataBuffer.  The value will decrease till 0 until all the data
+* from rxDataBuffer has been read.
+*/
+   uint32_t rxDataCount;   /*0x0c */
+#define MIPSNET_MAX_RXTX_DATACOUNT (1  16)
+
+   /*
+* Settable from the MIPS core, cleared by the Net Device.
+* The core should set the number of bytes it wants to send,
+* then it should write those bytes of data to txDataBuffer.
+* The device will clear txDataCount has been processed (not
+* necessarily sent).
+*/
+   uint32_t txDataCount;   /*0x10 */
+
+   /*
+* Interrupt control
+*
+* Used to clear the interrupted generated by this dev.
+* Write a 1 to clear the interrupt. (except bit31).
+*
+* Bit0 is set if it was a tx-done interrupt.
+* Bit1 is set when new rx-data is available.
+*Until this bit is cleared there will be no other RXs.
+*
+* Bit31 is used for testing, it clears after a read.
+*Writing 1 to this bit will cause an interrupt to be generated.
+*To clear the test interrupt, write 0 to this register.
+*/
+   uint32_t interruptControl;  /*0x14 */
+#define MIPSNET_INTCTL_TXDONE ((uint32_t)(1  0))
+#define MIPSNET_INTCTL_RXDONE ((uint32_t)(1  1))
+#define MIPSNET_INTCTL_TESTBIT((uint32_t)(1  31))
+
+   /*
+* Readonly core-specific interrupt info for the device to signal
+* the core. The meaning of the contents of this field might change.
+*/
+   /* XXX: the whole memIntf interrupt scheme is messy: the device
+* should have no control what so ever of what VPE/register set is
+* being used.
+* The MemIntf should only expose interrupt lines, and something in
+* the config should be responsible for the line-core/vpe bindings.
+*/
+   uint32_t interruptInfo; /*0x18 */
+
+   /*
+* This is where the received data is read out.
+* There is more data to read until rxDataReady is 0.
+* Only 1 byte at this regs offset is used.
+*/
+   uint32_t rxDataBuffer;  /*0x1c */
+
+   /*
+* This is where the data to transmit is written.
+* Data should be written for the amount specified in the
+* txDataCount register.
+* Only 1 byte at this regs offset is used.
+*/
+   uint32_t txDataBuffer;  /*0x20 */
+};
+
+#define regaddr(dev, field) \
+  (dev-base_addr + offsetof(struct mipsnet_regs, field))
 
 

[RFC][BNX2X] .h files rewrite

2007-10-28 Thread Eliezer Tamir
Dave,

Please take a look and tell me if this is better than the last attempt.

Main changes:

* Rewrite of the init code: 
1. Full rewrite of the generated code into something easier to read.
2. Removed zeroes by adding a zero command.
3. Big chucks of data are read by the chip using the DMA engine 
(instead of being written by the driver).
4. Gzipped more of the data.

* Removed BE microcode, the swapping is done in the driver instead.

* Rewrite of the HSI - broke it into three files bnx2x_hsi.h bnx2x_reg.h and 
bnx2x_fw_defs.h

* Fixed SPARSE warnings.

* Fixed all but three checkpatch.pl warnings. (IMHO they are false positives)

The diff is against latest net-2.6.

ftp link:
ftp://[EMAIL PROTECTED]/0001-bnx2x-h-file-rewrite.txt

gzipped:
ftp://[EMAIL PROTECTED]/0001-bnx2x-h-file-rewrite.txt.gz

(will also attache patch inline as reply to this email for review)

Thanks
Eliezer


-
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] - trivial - Improve appletalk checksum calculation

2007-10-28 Thread Urs Thuermann
Herbert Xu [EMAIL PROTECTED] writes:

 But your code differs significantly from Stephen's version.
 However, if it is correct it does look like a good improvement.
 
 So please write a simple test program.  It can't that bad since
 there are only 65536 values to test :)

I think the code is simple enough to see immediately that it should
calculate the same checksum.  But I have written a short test program
to show this and tested it on i686 (gcc-4.2.2) and powerpc (gcc-3.4.5)
without optimization and with -O6.

BTW, shouldn't unsigned long be replaced by unsigned int to avoid
64-bit operations one some platforms?

urs


#include stdio.h

unsigned long f1(unsigned long sum)
{
sum = 1;
if (sum  0x1) {
sum++;
sum = 0x;
}
return sum;
}

unsigned long f2(unsigned long sum)
{
sum = ((sum  0x8000)15) | ((sum  0x7fff)1);
return sum;
}

int main()
{
unsigned long s;

for (s = 0; s  65536; s++) {
if (f1(s) != f2(s) || f1(s)  65535)
printf(%ld\n, s);
}
return 0;
}
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Fix/Rewrite of the mipsnet driver

2007-10-28 Thread Stephen Hemminger
On Sun, 28 Oct 2007 20:03:08 +
Thiemo Seufer [EMAIL PROTECTED] wrote:

 Ralf Baechle wrote:
  On Sun, Oct 28, 2007 at 04:38:46AM +, Thiemo Seufer wrote:
  
   Hello All,
   
   currently the mipsnet driver fails after transmitting a number of
   packages because SKBs are allocated but never freed. I fixed that
   and coudn't refrain from removing the most egregious warts.
   
   - mipsnet.h folded into mipsnet.c, as it doesn't provide any
 useful external interface.
   - Free SKB after transmission.
   - Call free_irq in mipsnet_close, to balance the request_irq in
 mipsnet_open.
   - Removed duplicate read of rxDataCount.
   - Some identifiers are now less verbose.
   - Removed dead and/or unnecessarily complex code.
   - Code formatting fixes.
   
   Tested on Qemu's mipssim emulation, with this patch it can boot a
   Debian NFSroot.
  
  The patch does no longer apply to a recent tree, can you respin it?
 
 Updated against linux-mips.org head and appended. Only compile-tested
 this time, the mipssim kernel currently fails to build.
 
 
 Thiemo
 
 
 Signed-off-by: Thiemo Seufer [EMAIL PROTECTED]
 ---
  b/drivers/net/mipsnet.c |  201 
 
  drivers/net/mipsnet.h   |  112 --
  2 files changed, 134 insertions(+), 179 deletions(-)
 
 diff --git a/drivers/net/mipsnet.c b/drivers/net/mipsnet.c
 index aafc3ce..e9c0c79 100644
 --- a/drivers/net/mipsnet.c
 +++ b/drivers/net/mipsnet.c
 @@ -4,8 +4,6 @@
   * for more details.
   */
  
 -#define DEBUG
 -
  #include linux/init.h
  #include linux/io.h
  #include linux/kernel.h
 @@ -15,11 +13,93 @@
  #include linux/platform_device.h
  #include asm/mips-boards/simint.h
  
 -#include mipsnet.h /* actual device IO mapping */
 +#define MIPSNET_VERSION 2007-10-28
 +
 +/*
 + * Net status/control block as seen by sw in the core.
 + */
 +struct mipsnet_regs {
 + /*
 +  * Device info for probing, reads as MIPSNET%d where %d is some
 +  * form of version.
 +  */
 + uint64_t devId; /*0x00 */
  
 -#define MIPSNET_VERSION 2005-06-20
 + /*
 +  * read only busy flag.
 +  * Set and cleared by the Net Device to indicate that an rx or a tx
 +  * is in progress.
 +  */
 + uint32_t busy;  /*0x08 */
  
 -#define mipsnet_reg_address(dev, field) (dev-base_addr + 
 field_offset(field))
 + /*
 +  * Set by the Net Device.
 +  * The device will set it once data has been received.
 +  * The value is the number of bytes that should be read from
 +  * rxDataBuffer.  The value will decrease till 0 until all the data
 +  * from rxDataBuffer has been read.
 +  */
 + uint32_t rxDataCount;   /*0x0c */
 +#define MIPSNET_MAX_RXTX_DATACOUNT (1  16)
 +
 + /*
 +  * Settable from the MIPS core, cleared by the Net Device.
 +  * The core should set the number of bytes it wants to send,
 +  * then it should write those bytes of data to txDataBuffer.
 +  * The device will clear txDataCount has been processed (not
 +  * necessarily sent).
 +  */
 + uint32_t txDataCount;   /*0x10 */
 +
 + /*
 +  * Interrupt control
 +  *
 +  * Used to clear the interrupted generated by this dev.
 +  * Write a 1 to clear the interrupt. (except bit31).
 +  *
 +  * Bit0 is set if it was a tx-done interrupt.
 +  * Bit1 is set when new rx-data is available.
 +  *Until this bit is cleared there will be no other RXs.
 +  *
 +  * Bit31 is used for testing, it clears after a read.
 +  *Writing 1 to this bit will cause an interrupt to be generated.
 +  *To clear the test interrupt, write 0 to this register.
 +  */
 + uint32_t interruptControl;  /*0x14 */
 +#define MIPSNET_INTCTL_TXDONE ((uint32_t)(1  0))
 +#define MIPSNET_INTCTL_RXDONE ((uint32_t)(1  1))
 +#define MIPSNET_INTCTL_TESTBIT((uint32_t)(1  31))
 +
 + /*
 +  * Readonly core-specific interrupt info for the device to signal
 +  * the core. The meaning of the contents of this field might change.
 +  */
 + /* XXX: the whole memIntf interrupt scheme is messy: the device
 +  * should have no control what so ever of what VPE/register set is
 +  * being used.
 +  * The MemIntf should only expose interrupt lines, and something in
 +  * the config should be responsible for the line-core/vpe bindings.
 +  */
 + uint32_t interruptInfo; /*0x18 */
 +
 + /*
 +  * This is where the received data is read out.
 +  * There is more data to read until rxDataReady is 0.
 +  * Only 1 byte at this regs offset is used.
 +  */
 + uint32_t rxDataBuffer;  /*0x1c */
 +
 + /*
 +  * This is where the data to transmit is written.
 +  * Data should be written for the amount specified in the
 +  * txDataCount register.
 +  * Only 1 byte at this regs offset is used.
 +  */
 + uint32_t txDataBuffer;  /*0x20 */
 +};
 +
 

Re: [PATCH] Fix/Rewrite of the mipsnet driver

2007-10-28 Thread Thiemo Seufer
Stephen Hemminger wrote:
 On Sun, 28 Oct 2007 20:03:08 +
 Thiemo Seufer [EMAIL PROTECTED] wrote:
 
  Ralf Baechle wrote:
   On Sun, Oct 28, 2007 at 04:38:46AM +, Thiemo Seufer wrote:
   
Hello All,

currently the mipsnet driver fails after transmitting a number of
packages because SKBs are allocated but never freed. I fixed that
and coudn't refrain from removing the most egregious warts.

- mipsnet.h folded into mipsnet.c, as it doesn't provide any
  useful external interface.
- Free SKB after transmission.
- Call free_irq in mipsnet_close, to balance the request_irq in
  mipsnet_open.
- Removed duplicate read of rxDataCount.
- Some identifiers are now less verbose.
- Removed dead and/or unnecessarily complex code.
- Code formatting fixes.

Tested on Qemu's mipssim emulation, with this patch it can boot a
Debian NFSroot.
   
   The patch does no longer apply to a recent tree, can you respin it?
  
  Updated against linux-mips.org head and appended. Only compile-tested
  this time, the mipssim kernel currently fails to build.

[snip]
 It is standard practice in the kernel to use u32 rather than uint32_t.
 
 Also cast of shift is unneeded  (1u  0) works fine.

A leftover from the old code. changes accordingly.


Thiemo


Signed-off-by: Thiemo Seufer [EMAIL PROTECTED]
---
 b/drivers/net/mipsnet.c |  201 
 drivers/net/mipsnet.h   |  112 --
 2 files changed, 134 insertions(+), 179 deletions(-)

diff --git a/drivers/net/mipsnet.c b/drivers/net/mipsnet.c
index aafc3ce..6ad5ab3 100644
--- a/drivers/net/mipsnet.c
+++ b/drivers/net/mipsnet.c
@@ -4,8 +4,6 @@
  * for more details.
  */
 
-#define DEBUG
-
 #include linux/init.h
 #include linux/io.h
 #include linux/kernel.h
@@ -15,11 +13,93 @@
 #include linux/platform_device.h
 #include asm/mips-boards/simint.h
 
-#include mipsnet.h   /* actual device IO mapping */
+#define MIPSNET_VERSION 2007-10-28
+
+/*
+ * Net status/control block as seen by sw in the core.
+ */
+struct mipsnet_regs {
+   /*
+* Device info for probing, reads as MIPSNET%d where %d is some
+* form of version.
+*/
+   u64 devId;  /*0x00 */
 
-#define MIPSNET_VERSION 2005-06-20
+   /*
+* read only busy flag.
+* Set and cleared by the Net Device to indicate that an rx or a tx
+* is in progress.
+*/
+   u32 busy;   /*0x08 */
 
-#define mipsnet_reg_address(dev, field) (dev-base_addr + field_offset(field))
+   /*
+* Set by the Net Device.
+* The device will set it once data has been received.
+* The value is the number of bytes that should be read from
+* rxDataBuffer.  The value will decrease till 0 until all the data
+* from rxDataBuffer has been read.
+*/
+   u32 rxDataCount;/*0x0c */
+#define MIPSNET_MAX_RXTX_DATACOUNT (1  16)
+
+   /*
+* Settable from the MIPS core, cleared by the Net Device.
+* The core should set the number of bytes it wants to send,
+* then it should write those bytes of data to txDataBuffer.
+* The device will clear txDataCount has been processed (not
+* necessarily sent).
+*/
+   u32 txDataCount;/*0x10 */
+
+   /*
+* Interrupt control
+*
+* Used to clear the interrupted generated by this dev.
+* Write a 1 to clear the interrupt. (except bit31).
+*
+* Bit0 is set if it was a tx-done interrupt.
+* Bit1 is set when new rx-data is available.
+*Until this bit is cleared there will be no other RXs.
+*
+* Bit31 is used for testing, it clears after a read.
+*Writing 1 to this bit will cause an interrupt to be generated.
+*To clear the test interrupt, write 0 to this register.
+*/
+   u32 interruptControl;   /*0x14 */
+#define MIPSNET_INTCTL_TXDONE (1u  0)
+#define MIPSNET_INTCTL_RXDONE (1u  1)
+#define MIPSNET_INTCTL_TESTBIT(1u  31)
+
+   /*
+* Readonly core-specific interrupt info for the device to signal
+* the core. The meaning of the contents of this field might change.
+*/
+   /* XXX: the whole memIntf interrupt scheme is messy: the device
+* should have no control what so ever of what VPE/register set is
+* being used.
+* The MemIntf should only expose interrupt lines, and something in
+* the config should be responsible for the line-core/vpe bindings.
+*/
+   u32 interruptInfo;  /*0x18 */
+
+   /*
+* This is where the received data is read out.
+* There is more data to read until rxDataReady is 0.
+* Only 1 byte at this regs offset is used.
+*/
+   u32 rxDataBuffer;   /*0x1c */
+
+   /*
+* This is where the data to transmit is written.
+ 

Re: [PATCH] Fix/Rewrite of the mipsnet driver

2007-10-28 Thread Ralf Baechle
On Sun, Oct 28, 2007 at 01:22:04PM -0700, Stephen Hemminger wrote:

  -#define MIPSNET_INTCTL_TXDONE ((uint32_t)(1   0))
  -#define MIPSNET_INTCTL_RXDONE ((uint32_t)(1   1))
  -#define MIPSNET_INTCTL_TESTBIT((uint32_t)(1  31))
  -#define MIPSNET_INTCTL_ALLSOURCES  (MIPSNET_INTCTL_TXDONE | \
  -MIPSNET_INTCTL_RXDONE | \
  -MIPSNET_INTCTL_TESTBIT)
 
 It is standard practice in the kernel to use u32 rather than uint32_t.

uint32_t has widely leaked in and as long as it's not used in headers
exported to userland is perfectly fine.  But if we want to achieve
consistence throughout the kernel it'll take a little witch hunt for
uint32_t and co.

 Also cast of shift is unneeded  (1u  0) works fine.

Old sins of mipsnet.h which was just copied into mipsnet.c.  Or toothing
pains of a driver on its way to sanity.

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


Re: 2.6.24-rc1 kills onboard r8169 (rtl8111b) NIC

2007-10-28 Thread Francois Romieu
Sergey S. Kostyliov [EMAIL PROTECTED] :
[...]
 After booting 2.6.24-rc1 on my home machine I lost onboard rtl8111b
 network card. It is neither functional nor even visible by lspci
 anymore.
 
 Moreover rebooting to previous 2.6.23-rc9 didn't fix it - card was
 still not available.

It should reappear after some time at rest. Until I come with
something better, you should use 2.6.24-rc with the r8169 driver from
2.6.23.

-- 
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] - trivial - Improve appletalk checksum calculation

2007-10-28 Thread Joe Perches
On Sun, 2007-10-28 at 21:18 +0100, Urs Thuermann wrote:

 I have written a short test program to show this and tested it on i686
 (gcc-4.2.2) and powerpc (gcc-3.4.5) without optimization and with -O6.

Thanks for that.

 BTW, shouldn't unsigned long be replaced by unsigned int to avoid
 64-bit operations one some platforms?

probably unsigned long should be u16.

Compiled, untested.

diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 7c0b515..c3890cc 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -922,25 +922,19 @@ static int atrtr_ioctl(unsigned int cmd, void __user *arg)
  * Checksum: This is 'optional'. It's quite likely also a good
  * candidate for assembler hackery 8)
  */
-static unsigned long atalk_sum_partial(const unsigned char *data,
-  int len, unsigned long sum)
+static u16 atalk_sum_partial(const unsigned char *data,
+int len, u16 sum)
 {
-   /* This ought to be unwrapped neatly. I'll trust gcc for now */
while (len--) {
-   sum += *data;
-   sum = 1;
-   if (sum  0x1) {
-   sum++;
-   sum = 0x;
-   }
-   data++;
+   sum += *data++;
+   sum = ((sum  0x8000)  15) | ((sum  0x7fff)  1);
}
return sum;
 }
 
 /*  Checksum skb data --  similar to skb_checksum  */
-static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
-  int len, unsigned long sum)
+static u16 atalk_sum_skb(const struct sk_buff *skb, int offset,
+int len, u16 sum)
 {
int start = skb_headlen(skb);
int i, copy;
@@ -1010,13 +1004,13 @@ static unsigned long atalk_sum_skb(const struct sk_buff 
*skb, int offset,
 
 static __be16 atalk_checksum(const struct sk_buff *skb, int len)
 {
-   unsigned long sum;
+   u16 sum;
 
/* skip header 4 bytes */
sum = atalk_sum_skb(skb, 4, len-4, 0);
 
/* Use 0x for 0. 0 itself means none */
-   return sum ? htons((unsigned short)sum) : htons(0x);
+   return cpu_to_be16(sum ? sum : 0x);
 }
 
 static struct proto ddp_proto = {
  * 




-
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] ehea: add kexec support

2007-10-28 Thread Michael Ellerman

On Fri, 2007-10-26 at 14:37 +0200, Jan-Bernd Themann wrote:
 eHEA resources that are allocated via H_CALLs have a unique identifier each.
 These identifiers are necessary to free the resources. A reboot notifier
 is used to free all eHEA resources before the indentifiers get lost, i.e
 before kexec starts a new kernel.
 
 Signed-off-by: Jan-Bernd Themann [EMAIL PROTECTED]
 

How do you plan to support kdump?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


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


Re: [PATCH] r8169: don't call napi_disable if not doing NAPI

2007-10-28 Thread Romano Giannetti

On Fri, 2007-10-26 at 11:33 -0700, Stephen Hemminger wrote:
 Don't call napi_disable if not configured.
 And make sure that any misuse of napi_xxx in future fails
 with a compile error.

Will test as soon as possible (been without internet in the week end). 
Thanks.

As a bonus, I tried more thing, and I had a signal form lockdep. You can
find it here:

http://www.dea.icai.upcomillas.es/romano/linux/info/2624rc1_5/

patching and compiling now.

Romano 

-- 
Sorry for the disclaimer --- ¡I cannot stop it!



--
La presente comunicación tiene carácter confidencial y es para el exclusivo uso 
del destinatario indicado en la misma. Si Ud. no es el destinatario indicado, 
le informamos que cualquier forma de distribución, reproducción o uso de esta 
comunicación y/o de la información contenida en la misma están estrictamente 
prohibidos por la ley. Si Ud. ha recibido esta comunicación por error, por 
favor, notifíquelo inmediatamente al remitente contestando a este mensaje y 
proceda a continuación a destruirlo. Gracias por su colaboración.

This communication contains confidential information. It is for the exclusive 
use of the intended addressee. If you are not the intended addressee, please 
note that any form of distribution, copying or use of this communication or the 
information in it is strictly prohibited by law. If you have received this 
communication in error, please immediately notify the sender by reply e-mail 
and destroy this message. Thank you for your cooperation. 
-
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


HFSC dangerous behaviour (not a bug)

2007-10-28 Thread Denys
Hi All

During testing i found very strange thing. 
After applying even example shaper:
http://linux-ip.net/tc/hfsc.en/
-
#  Example  from  Figure  1. 
tc  qdisc  add  dev  eth0  root  handle  1:  hfsc 
tc  class  add  dev  eth0  parent  1:  classid  1:1  hfsc  sc  rate  
1000kbit  ul  rate  1000kbit 
tc  class  add  dev  eth0  parent  1:1  classid  1:10  hfsc  sc  rate  
500kbit  ul  rate  1000kbit 
tc  class  add  dev  eth0  parent  1:1  classid  1:20  hfsc  sc  rate  
500kbit  ul  rate  1000kbit 
tc  class  add  dev  eth0  parent  1:10  classid  1:11  hfsc  sc  umax  
1500b  dmax  53ms  rate  400kbit  ul  rate  1000kbit 
tc  class  add  dev  eth0  parent  1:10  classid  1:12  hfsc  sc  umax  
1500b  dmax  30ms  rate  100kbit  ul  rate  1000kbit
---
I had all traffic on eth0 stopped. Tried on br0 - same result. Even ARP 
becoming non-functional.

Stats:

tc -s class show dev br0
class hfsc 1: root
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 period 0 level 3

class hfsc 1:11 parent 1:10 sc m1 0bit d 23.0ms m2 40bit ul m1 0bit d 0us 
m2 1000Kbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 period 0 level 0

class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 1000Kbit ul m1 0bit d 0us m2 
1000Kbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 period 0 level 2

class hfsc 1:10 parent 1:1 sc m1 0bit d 0us m2 50bit ul m1 0bit d 0us m2 
1000Kbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 period 0 level 1

class hfsc 1:20 parent 1:1 sc m1 0bit d 0us m2 50bit ul m1 0bit d 0us m2 
1000Kbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 period 0 level 0

class hfsc 1:12 parent 1:10 sc m1 40bit d 30.0ms m2 10bit ul m1 0bit 
d 0us m2 1000Kbit
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 period 0 level 0

tc -s qdisc show dev br0
qdisc hfsc 1: root
 Sent 0 bytes 0 pkt (dropped 3, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0

After specifying correct default class everything worked fine.

In HTB if you dont specify default class, traffic just pass without 
shaping. 
Is it possible to keep same behaviour on both disciplines?
Probably just dropping all traffic not good idea, cause if user working on 
remote box by forgetting specifying default class or by mistake using 
incorrect class number he will loose access to the box, if same interface is 
used for tests on shaping and access.
In same time it is good, and can show accurate results on shaping, without 
bypassing some forgotten traffic.
But at least it must be same, IMHO, on HTB and HFSC.

--
Denys Fedoryshchenko
Technical Manager
Virtual ISP S.A.L.

-
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


HFSC dangerous behaviour (not a bug)

2007-10-28 Thread Denys
Additionally, it doesn't show rate in stats (so it is difficult to measure, 
how much is really using each class).

qdisc hfsc 1: root default 200
 Sent 1392761062 bytes 965768 pkt (dropped 52, overlimits 1620539 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
qdisc bfifo 200: parent 1:200 limit 5000Kb
 Sent 3159118 bytes 17598 pkt (dropped 0, overlimits 0 requeues 177)
 rate 0bit 0pps backlog 0b 0p requeues 177
qdisc bfifo 910: parent 1:910 limit 212b
 Sent 514985563 bytes 360381 pkt (dropped 0, overlimits 0 requeues 314751)
 rate 0bit 0pps backlog 0b 0p requeues 314751
qdisc bfifo 1101: parent 1:1101 limit 100b
 Sent 139858294 bytes 94506 pkt (dropped 0, overlimits 0 requeues 85889)
 rate 0bit 0pps backlog 0b 0p requeues 85889
qdisc bfifo 1102: parent 1:1102 limit 100b
 Sent 96248464 bytes 65436 pkt (dropped 0, overlimits 0 requeues 58030)
 rate 0bit 0pps backlog 0b 0p requeues 58030
qdisc bfifo 1103: parent 1:1103 limit 100b
 Sent 111740612 bytes 75945 pkt (dropped 0, overlimits 0 requeues 66919)
 rate 0bit 0pps backlog 0b 0p requeues 66919
qdisc bfifo 923: parent 1:923 limit 375000b
 Sent 244333639 bytes 163399 pkt (dropped 0, overlimits 0 requeues 134977)
 rate 0bit 0pps backlog 0b 0p requeues 134977
qdisc bfifo 924: parent 1:924 limit 20b
 Sent 101499905 bytes 68041 pkt (dropped 0, overlimits 0 requeues 43722)
 rate 0bit 0pps backlog 0b 0p requeues 43722
qdisc bfifo 925: parent 1:925 limit 20b
 Sent 159908141 bytes 106077 pkt (dropped 51, overlimits 0 requeues 34702)
 rate 0bit 0pps backlog 0b 0p requeues 34702
qdisc bfifo 926: parent 1:926 limit 20b
 Sent 21027140 bytes 14382 pkt (dropped 0, overlimits 0 requeues 10707)
 rate 0bit 0pps backlog 0b 0p requeues 10707
qdisc bfifo 955: parent 1:955 limit 50b
 Sent 186 bytes 3 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0




--
Denys Fedoryshchenko
Technical Manager
Virtual ISP S.A.L.

-
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


Bonding in active-backup mode with arp monitoring on Xen

2007-10-28 Thread Tsutomu Fujii
Hi.

I was trying to use bonding from a guest OS on xen in active-backup
mode with arp monitoring, but the virtual server can't communicate to
the peer server via bonding interface.

The network structure is the following.

+---+
|virtual I/F(eth0)  | - have IP address.
+---+
|  virtual bridge(xenbr0)   |
+---+
| bonding(bond0)| - don't have IP address
+--+-+--+
|phy I/F(peth0)| |phy I/F(peth1)|
+--+ +--+

The attached file describes how I configured the network.

In this case, when I run 'cat /proc/net/bonding/bond0', 'MII Status'
is shown as down.

This behavior only occurs in active-backup mode with arp monitoring.
It does not happen in active-backup mode with mii monitoring nor other
mode that can use arp monitoring.

From the output of tcpdump, it seems that arp packet isn't transmitted.
This problem is caused because bond_activebackup_arp_mon(), which is the
function that sends arp packet in active-backup mode, checks whether
bonding master interface has an IP address(bond_has_ip()), before arp
packets are transmitted using bond_arp_send_all().
In the above setting, bonding master interface don't have IP address.

How about removing bond_has_ip() from the condition for calling
bond_arp_send_all() to use bonding with xen?
When I removed bond_has_ip(), the resulting kernel worked fine and
active-backup mode works with arp monitoring.

I confirmed this behavior in RHEL5(2.6.18-44.el5xen). And I confirmed
that the upstream kernel(2.6.23) also has the same condition before
calling bond_arp_send_all().

Thanks.

---
Tsutomu Fujii


Setting procedure of bonding.

1) Make or modify the following config file on dom0.
   - /etc/sysconfig/network-scripts/ifcfg-bond0
 TYPE=Bonding
 DEVICE=bond0
 BOOTPROTO=none
 ONBOOT=no

   - /etc/sysconfig/network-scripts/ifcfg-eth1
 DEVICE=eth1
 BOOTPROTO=none
 ONBOOT=no

   - /etc/sysconfig/network-scripts/ifcfg-eth2
 DEVICE=eth2
 BOOTPROTO=none
 ONBOOT=no

   - /etc/modprobe.conf (Add to following two lines.)
 alias bond0 bonding
 options bonding mode=1 arp_interval=100 arp_ip_target=192.168.0.254

2) Run the following command on dom0.
   # brctl addbr xenbr0
   # ip link set xenbr0 arp off
   # ip link set xenbr0 multicast off

   # ip link set eth0 name peth0
   # ip link set eth1 name peth1
   # ip link set veth0 name eth0
   # ip link set veth1 name eth1

   # ifup bond0
   # ifenslave bond0 peth0 peth1
   # ifdown bond0

   # ip link set bond0 down
   # ip link set bond0 arp off
   # ip link set bond0 multicast off
   # ip link set bond0 addr fe:ff:ff:ff:ff:ff

   # ip link set vif0.0 down
   # ip link set vif0.0 arp off
   # ip link set vif0.0 multicast off
   # ip link set vif0.0 addr fe:ff:ff:ff:ff:ff

   # ip link set xenbr0 up
   # brctl addif xenbr0 bond0
   # ip link set bond0 up
   # brctl addif xenbr0 vif0.0
   # ip link set vif0.0 up

   # ip link set eth0 addr 00:16:3e:70:00:03
   # ip link set eth0 arp on
   # ifup eth0
   # ifconfig eth0 192.168.0.1



Re: [PATCH] - trivial - Improve appletalk checksum calculation

2007-10-28 Thread Joe Perches
On Sun, 2007-10-28 at 14:01 -0700, Joe Perches wrote:
 probably unsigned long should be u16.

Or not.
x86 u16 performs much worse than u32 (~ 50% worse)


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


[PATCH 2.6.24-rc] [IPV6] NDISC: Fix setting base_reachable_time_ms variable.

2007-10-28 Thread YOSHIFUJI Hideaki / 吉藤英明
This bug was introduced by the commit
d12af679bcf8995a237560bdf7a4d734f8df5dbb.

Signed-off-by: YOSHIFUJI Hideaki [EMAIL PROTECTED]

--- 
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 20cfc90..36f7dbf 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1670,7 +1670,7 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int 
write, struct file * f
filp, buffer, lenp, ppos);
 
else if ((strcmp(ctl-procname, retrans_time_ms) == 0) ||
-(strcmp(ctl-procname, base_reacable_time_ms) == 0))
+(strcmp(ctl-procname, base_reachable_time_ms) == 0))
ret = proc_dointvec_ms_jiffies(ctl, write,
   filp, buffer, lenp, ppos);
else

-- 
YOSHIFUJI Hideaki @ USAGI Project  [EMAIL PROTECTED]
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] ucc_geth: add support for netpoll

2007-10-28 Thread Li Yang-r58472
 -Original Message-
 From: Anton Vorontsov [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, October 27, 2007 10:38 PM
 To: Sergei Shtylyov
 Cc: Anton Vorontsov; netdev@vger.kernel.org; Li Yang-r58472; 
 [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PATCH] ucc_geth: add support for netpoll
 
 On Sat, Oct 27, 2007 at 05:09:51PM +0400, Sergei Shtylyov wrote:
  Hello.
  
  Anton Vorontsov wrote:
  
   This patch adds netpoll support for the QE UCC Gigabit Ethernet 
   driver. The approach is very similar to the gianfar driver.
  
  It's rather contrarywise -- this is standard approach 
 and gianfar 
  with its
  3 TSEC IRQs has a quite non-standard poll_controller() 
 implementation.
 
 Oh.. well, right -- gianfar a bit more comlex in that regard.
 
  
   Tested using netconsole.
  
  KGDBoE is considered a better test (I hope you've also 
 tested with it).
 
 At the time of posting it was tested using netconsole only, a 
 few days later it's was tested using KGDBoE also. So, it works indeed.
 
   Signed-off-by: Anton Vorontsov [EMAIL PROTECTED] 
 diff --git 
   a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 
   18a6f48..06807ce 100644
   --- a/drivers/net/ucc_geth.c
   +++ b/drivers/net/ucc_geth.c
   @@ -3691,6 +3691,22 @@ static irqreturn_t 
 ucc_geth_irq_handler(int irq, void *info)
 return IRQ_HANDLED;
}

   +#ifdef CONFIG_NET_POLL_CONTROLLER
   +/*
   + * Polling 'interrupt' - used by things like netconsole to send 
   +skbs
   + * without having to re-enable interrupts. It's not called while
   + * the interrupt routine is executing.
   + */
   +static void ucc_netpoll(struct net_device *dev) {
   + struct ucc_geth_private *ugeth = netdev_priv(dev);
   +
   + disable_irq(ugeth-ug_info-uf_info.irq);
   + ucc_geth_irq_handler(ugeth-ug_info-uf_info.irq, dev);
   + enable_irq(ugeth-ug_info-uf_info.irq);
  
  Why not make it less complex (for a reader and gcc too :-) ?
 
 Yup, I'm agree here but it's too late. Again. ;-)
 
 This patch already accepted into the -mm (a week or so after 
 the silence), so.. now I'd rather not bother Andrew with such 
 really cosmetic changes. But if Jeff would directly apply 
 modfied patch, I'll send it. ;-)

Oops.  The original patch happened to hit the Junk mail box. :(  I think
the patch is good to merge after the cosmetic change.  I can do it in
next pull request to Jeff.

Thanks
- Leo
-
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: [UDP6]: Restore sk_filter optimisation

2007-10-28 Thread Mitsuru Chinen
Hello Herbert,

Let me ask a question about this patch.
After this patch was applied, 2 of the protocol stack behaviors were
changed when it receives a UDP datagram with broken checksum:

 1. udp6InDatagrams is incremented instead of udpInErrors
 2. In userland, recvfrom() replies an error with EAGAIN.
recvfrom() wasn't aware of such a packet before.

Are these changes intentional?

Best Regards,

Mitsuru Chinen [EMAIL PROTECTED]


On Tue, 6 Mar 2007 12:20:10 +1100
Herbert Xu [EMAIL PROTECTED] wrote:

 Hi Dave:
 
 [UDP6]: Restore sk_filter optimisation
 
 This reverts the changeset
 
 [IPV6]: UDPv6 checksum.
 
 We always need to check UDPv6 checksum because it is mandatory.
 
 The sk_filter optimisation has nothing to do whether we verify the
 checksum.  It simply postpones it to the point when the user calls
 recv or poll.
 
 Signed-off-by: Herbert Xu [EMAIL PROTECTED]
 
 Cheers,
 -- 
 Visit Openswan at http://www.openswan.org/
 Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
 Home Page: http://gondor.apana.org.au/~herbert/
 PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
 --
 diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
 index 0ad4719..4474480 100644
 --- a/net/ipv6/udp.c
 +++ b/net/ipv6/udp.c
 @@ -279,8 +279,10 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff 
 *skb)
   }
   }
 
 - if (udp_lib_checksum_complete(skb))
 - goto drop;
 + if (sk-sk_filter) {
 + if (udp_lib_checksum_complete(skb))
 + goto drop;
 + }
 
   if ((rc = sock_queue_rcv_skb(sk,skb))  0) {
   /* Note that an ENOMEM error is charged twice */
-
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: [UDP6]: Restore sk_filter optimisation

2007-10-28 Thread YOSHIFUJI Hideaki / 吉藤英明
In article [EMAIL PROTECTED] (at Mon, 29 Oct 2007 15:33:20 +0900), Mitsuru 
Chinen [EMAIL PROTECTED] says:

 Hello Herbert,
 
 Let me ask a question about this patch.
 After this patch was applied, 2 of the protocol stack behaviors were
 changed when it receives a UDP datagram with broken checksum:
 
  1. udp6InDatagrams is incremented instead of udpInErrors
  2. In userland, recvfrom() replies an error with EAGAIN.
 recvfrom() wasn't aware of such a packet before.
 
 Are these changes intentional?

And, we're not sure how much the optimization's benefit is.
It is even worse when we are handling multicast packets.

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