Re: [PATCH 0/5] Diet struct net_device a bit

2007-10-24 Thread Johannes Berg
On Mon, 2007-10-22 at 16:31 +0400, Pavel Emelyanov wrote:

  * ieee80211_ptr is used in many wireless drivers. Need time
to check for the config dependencies.

Depending on CFG80211 should be fine, if not that's a bug elsewhere.

johannes


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


Re: on the topic of alternate MAC addresses

2007-10-24 Thread Johannes Berg
On Tue, 2007-10-23 at 20:22 -0700, David Miller wrote:

 However, it's not the virt clients that do this, it's the control
 node (aka: domain 0) which has to manage these things.
 
 It has to manage all of the global hardware resources and allocate
 them out to itself and the clients anyways.
 
 And this is why I think it's sufficient to just publish the list of
 MAC addresses from the driver, and leave the allocation and policy
 to the userland virtualizatin daemon running on the control node.

From a wireless angle, however, it's not sufficient. It appears that
there are some wireless cards that have multiple MAC addresses in their
EEPROM (or a way to generate multiple, by e.g. the vendor assigning only
even addresses and reserving odd ones). Then, bringing up a second,
third, ... virtual wireless interface should for best usability choose
an alternate address if the same one cannot be used due to restrictions.

We can probably manage this issue in userspace, in fact, for AP mode we
require proper configuration in hostapd, but it seems that some sort of
reservation system would be easier for multiple virtual station
interfaces when supported (currently no driver does).

johannes


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


Re: [PATCH 13/13] r8169: more phy init for the 8168

2007-10-24 Thread Glen Gray
Are any of these likely to fix the Ethernet multicast issues a few of us 
have seen with 8110sc cards ?


Francois Romieu wrote:

Realtek's r8168 driver version 8.003.00 adds new init sequences
(they do not appear in version 8.002.00).

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

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 8ffd573..e8960f2 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1243,6 +1243,16 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
 
 	rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));

 }
+static void rtl8168b_hw_phy_config(void __iomem *ioaddr)
+{
+   struct phy_reg phy_reg_init[] = {
+   { 0x1f, 0x },
+   { 0x10, 0xf41b },
+   { 0x1f, 0x }
+   };
+
+   rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+}
 
 static void rtl8168cp_hw_phy_config(void __iomem *ioaddr)

 {
@@ -1279,6 +1289,22 @@ static void rtl8168c_hw_phy_config(void __iomem *ioaddr)
rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
+static void rtl8168cx_hw_phy_config(void __iomem *ioaddr)

+{
+   struct phy_reg phy_reg_init[] = {
+   { 0x1f, 0x },
+   { 0x12, 0x2300 },
+   { 0x1f, 0x0003 },
+   { 0x16, 0x0f0a },
+   { 0x1f, 0x },
+   { 0x1f, 0x0002 },
+   { 0x0c, 0x7eb8 },
+   { 0x1f, 0x }
+   };
+
+   rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+}
+
 static void rtl_hw_phy_config(struct net_device *dev)
 {
struct rtl8169_private *tp = netdev_priv(dev);
@@ -1296,12 +1322,20 @@ static void rtl_hw_phy_config(struct net_device *dev)
case RTL_GIGA_MAC_VER_04:
rtl8169sb_hw_phy_config(ioaddr);
break;
+   case RTL_GIGA_MAC_VER_11:
+   case RTL_GIGA_MAC_VER_12:
+   case RTL_GIGA_MAC_VER_17:
+   rtl8168b_hw_phy_config(ioaddr);
+   break;
case RTL_GIGA_MAC_VER_18:
rtl8168cp_hw_phy_config(ioaddr);
break;
case RTL_GIGA_MAC_VER_19:
rtl8168c_hw_phy_config(ioaddr);
break;
+   case RTL_GIGA_MAC_VER_20:
+   rtl8168cx_hw_phy_config(ioaddr);
+   break;
default:
break;
}
  



--
Glen Gray [EMAIL PROTECTED]  Digital Depot, Thomas Street
Senior Software EngineerDublin 8, Ireland
Lincor Solutions Ltd.  Ph: +353 (0) 1 4893682

-
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 RESEND] ip_gre: sendto/recvfrom NBMA address

2007-10-24 Thread Alexey Kuznetsov
Hello!

 I was able to set a nbma gre tunnel, add routes to it and it worked
 perfectly ok.
 
 Link-level next hop worked:
 ip route add route via link-level-address dev tunnel-dev onlink

This can work if you use gre0. By plain luck it has all-zero dev_addr.

It will break on nbma devices set with:

ip tunnel add XXX mode gre local a.b.c.d [key whatever] ...

Alexey
-
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] USB: net: Fix asix read transfer buffer allocations.

2007-10-24 Thread Valentine Barshak
On systems with noncoherent cache, allocating dma buffers
on the stack for USB IN transfers causes kernel crash,
because usb map_urb_for_dma() code calls dma_map_single(),
that invalidates data cache for DMA_FROM_DEVICE transfer direction
and causes stack data loss if transfer size is less than cache line
and not cache-line aligned. This patch makes asix usb network
driver allocate USB IN transfer buffers with kmalloc instead of
directly using variables on stack. It also sets data parameter to NULL
for zero-length transfers and uses ETH_ALEN size for allocating MAC 
address buffer.

Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
---
 drivers/net/usb/asix.c |   44 +++-
 1 files changed, 31 insertions(+), 13 deletions(-)

diff -pruN linux-2.6.orig/drivers/net/usb/asix.c 
linux-2.6/drivers/net/usb/asix.c
--- linux-2.6.orig/drivers/net/usb/asix.c   2007-10-23 20:52:11.0 
+0400
+++ linux-2.6/drivers/net/usb/asix.c2007-10-23 20:57:38.0 +0400
@@ -568,15 +568,23 @@ static void asix_set_multicast(struct ne
 static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
 {
struct usbnet *dev = netdev_priv(netdev);
+   void *buf;
u16 res;
 
+   buf = kmalloc(2, GFP_KERNEL);
+   if (!buf)
+   return -ENOMEM;
+
mutex_lock(dev-phy_mutex);
asix_set_sw_mii(dev);
asix_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id,
-   (__u16)loc, 2, (u16 *)res);
+   (__u16)loc, 2, buf);
asix_set_hw_mii(dev);
mutex_unlock(dev-phy_mutex);
 
+   res = *((u16 *)buf);
+   kfree(buf);
+
devdbg(dev, asix_mdio_read() phy_id=0x%02x, loc=0x%02x, 
returns=0x%04x, phy_id, loc, le16_to_cpu(res  0x));
 
return le16_to_cpu(res  0x);
@@ -622,13 +630,22 @@ static void
 asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
 {
struct usbnet *dev = netdev_priv(net);
+   void *buf;
u8 opt;
 
-   if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, opt)  0) {
+   buf = kmalloc(1, GFP_KERNEL);
+   if (!buf)
+   return;
+
+   if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, buf)  0) {
wolinfo-supported = 0;
wolinfo-wolopts = 0;
+   kfree(buf);
return;
}
+   opt = *((u8 *)buf);
+   kfree(buf);
+
wolinfo-supported = WAKE_PHY | WAKE_MAGIC;
wolinfo-wolopts = 0;
if (opt  AX_MONITOR_MODE) {
@@ -644,7 +661,6 @@ asix_set_wol(struct net_device *net, str
 {
struct usbnet *dev = netdev_priv(net);
u8 opt = 0;
-   u8 buf[1];
 
if (wolinfo-wolopts  WAKE_PHY)
opt |= AX_MONITOR_LINK;
@@ -654,7 +670,7 @@ asix_set_wol(struct net_device *net, str
opt |= AX_MONITOR_MODE;
 
if (asix_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE,
- opt, 0, 0, buf)  0)
+ opt, 0, 0, NULL)  0)
return -EINVAL;
 
return 0;
@@ -820,7 +836,7 @@ static int ax88172_bind(struct usbnet *d
for (i = 2; i = 0; i--) {
if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS,
(gpio_bits  (i * 8))  0xff, 0, 0,
-   buf))  0)
+   NULL))  0)
goto out2;
msleep(5);
}
@@ -831,7 +847,7 @@ static int ax88172_bind(struct usbnet *d
/* Get the MAC address */
memset(buf, 0, ETH_ALEN);
if ((ret = asix_read_cmd(dev, AX88172_CMD_READ_NODE_ID,
-   0, 0, 6, buf))  0) {
+   0, 0, ETH_ALEN, buf))  0) {
dbg(read AX_CMD_READ_NODE_ID failed: %d, ret);
goto out2;
}
@@ -909,7 +925,7 @@ static int ax88772_bind(struct usbnet *d
 
usbnet_get_endpoints(dev,intf);
 
-   buf = kmalloc(6, GFP_KERNEL);
+   buf = kmalloc(ETH_ALEN, GFP_KERNEL);
if(!buf) {
dbg (Cannot allocate memory for buffer);
ret = -ENOMEM;
@@ -923,7 +939,7 @@ static int ax88772_bind(struct usbnet *d
/* 0x10 is the phy id of the embedded 10/100 ethernet phy */
embd_phy = ((asix_get_phy_addr(dev)  0x1f) == 0x10 ? 1 : 0);
if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
-   embd_phy, 0, 0, buf))  0) {
+   embd_phy, 0, 0, NULL))  0) {
dbg(Select PHY #1 failed: %d, ret);
goto out2;
}
@@ -998,7 +1014,7 @@ static int ax88772_bind(struct usbnet *d
 
if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
-   AX88772_IPG2_DEFAULT, 0, buf))  0) {
+ 

Re: [linux-usb-devel] [PATCH] USB: net: Fix asix read transfer buffer allocations.

2007-10-24 Thread Valentine Barshak

Sorry,
CC'ed Dave Brownell instead of Dave Hollis :)
-
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] USB: net: Fix asix read transfer buffer allocations.

2007-10-24 Thread Valentine Barshak
On systems with noncoherent cache, allocating dma buffers
on the stack for USB IN transfers causes kernel crash,
because usb map_urb_for_dma() code calls dma_map_single(),
that invalidates data cache for DMA_FROM_DEVICE transfer direction
and causes stack data loss if transfer size is less than cache line
and not cache-line aligned. This patch makes asix usb network
driver allocate USB IN transfer buffers with kmalloc instead of
directly using variables on stack. It also sets data parameter to NULL
for zero-length transfers and uses ETH_ALEN size for allocating MAC 
address buffer.

Signed-off-by: Valentine Barshak [EMAIL PROTECTED]
---
 drivers/net/usb/asix.c |   44 +++-
 1 files changed, 31 insertions(+), 13 deletions(-)

diff -pruN linux-2.6.orig/drivers/net/usb/asix.c 
linux-2.6/drivers/net/usb/asix.c
--- linux-2.6.orig/drivers/net/usb/asix.c   2007-10-23 20:52:11.0 
+0400
+++ linux-2.6/drivers/net/usb/asix.c2007-10-23 20:57:38.0 +0400
@@ -568,15 +568,23 @@ static void asix_set_multicast(struct ne
 static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
 {
struct usbnet *dev = netdev_priv(netdev);
+   void *buf;
u16 res;
 
+   buf = kmalloc(2, GFP_KERNEL);
+   if (!buf)
+   return -ENOMEM;
+
mutex_lock(dev-phy_mutex);
asix_set_sw_mii(dev);
asix_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id,
-   (__u16)loc, 2, (u16 *)res);
+   (__u16)loc, 2, buf);
asix_set_hw_mii(dev);
mutex_unlock(dev-phy_mutex);
 
+   res = *((u16 *)buf);
+   kfree(buf);
+
devdbg(dev, asix_mdio_read() phy_id=0x%02x, loc=0x%02x, 
returns=0x%04x, phy_id, loc, le16_to_cpu(res  0x));
 
return le16_to_cpu(res  0x);
@@ -622,13 +630,22 @@ static void
 asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
 {
struct usbnet *dev = netdev_priv(net);
+   void *buf;
u8 opt;
 
-   if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, opt)  0) {
+   buf = kmalloc(1, GFP_KERNEL);
+   if (!buf)
+   return;
+
+   if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, buf)  0) {
wolinfo-supported = 0;
wolinfo-wolopts = 0;
+   kfree(buf);
return;
}
+   opt = *((u8 *)buf);
+   kfree(buf);
+
wolinfo-supported = WAKE_PHY | WAKE_MAGIC;
wolinfo-wolopts = 0;
if (opt  AX_MONITOR_MODE) {
@@ -644,7 +661,6 @@ asix_set_wol(struct net_device *net, str
 {
struct usbnet *dev = netdev_priv(net);
u8 opt = 0;
-   u8 buf[1];
 
if (wolinfo-wolopts  WAKE_PHY)
opt |= AX_MONITOR_LINK;
@@ -654,7 +670,7 @@ asix_set_wol(struct net_device *net, str
opt |= AX_MONITOR_MODE;
 
if (asix_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE,
- opt, 0, 0, buf)  0)
+ opt, 0, 0, NULL)  0)
return -EINVAL;
 
return 0;
@@ -820,7 +836,7 @@ static int ax88172_bind(struct usbnet *d
for (i = 2; i = 0; i--) {
if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS,
(gpio_bits  (i * 8))  0xff, 0, 0,
-   buf))  0)
+   NULL))  0)
goto out2;
msleep(5);
}
@@ -831,7 +847,7 @@ static int ax88172_bind(struct usbnet *d
/* Get the MAC address */
memset(buf, 0, ETH_ALEN);
if ((ret = asix_read_cmd(dev, AX88172_CMD_READ_NODE_ID,
-   0, 0, 6, buf))  0) {
+   0, 0, ETH_ALEN, buf))  0) {
dbg(read AX_CMD_READ_NODE_ID failed: %d, ret);
goto out2;
}
@@ -909,7 +925,7 @@ static int ax88772_bind(struct usbnet *d
 
usbnet_get_endpoints(dev,intf);
 
-   buf = kmalloc(6, GFP_KERNEL);
+   buf = kmalloc(ETH_ALEN, GFP_KERNEL);
if(!buf) {
dbg (Cannot allocate memory for buffer);
ret = -ENOMEM;
@@ -923,7 +939,7 @@ static int ax88772_bind(struct usbnet *d
/* 0x10 is the phy id of the embedded 10/100 ethernet phy */
embd_phy = ((asix_get_phy_addr(dev)  0x1f) == 0x10 ? 1 : 0);
if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
-   embd_phy, 0, 0, buf))  0) {
+   embd_phy, 0, 0, NULL))  0) {
dbg(Select PHY #1 failed: %d, ret);
goto out2;
}
@@ -998,7 +1014,7 @@ static int ax88772_bind(struct usbnet *d
 
if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
-   AX88772_IPG2_DEFAULT, 0, buf))  0) {
+ 

Re: [BUG] 2.6.23-git19 - S390x: Kernel panic while bringing up the network interface

2007-10-24 Thread Kamalesh Babulal
Heiko Carstens wrote:
 On Wed, Oct 24, 2007 at 08:59:06AM +0530, Kamalesh Babulal wrote:
 Hi,

 Kernel panic's while bringing up the network interface with the 2.6.23-git19

 Setting network parameters:  Ý  OK  ¨
 Bringing up loopback interface:  Ý  OK  ¨
 Bringing up interface eth0:
  Ý002e2f72¨ inet_ioctl+0xd6/0x110
  Ý0027cae2¨ sock_ioctl+0x26e/0x2a0
  Ý000b4c52¨ do_ioctl+0x4a/0xac
  Ý000b5076¨ vfs_ioctl+0x3c2/0x3d8
  Ý000b50ec¨ sys_ioctl+0x60/0x88
  Ý00021b7e¨ sysc_noemu+0x10/0x16
  Ý021201ca¨ 0x21201ca

  0Kernel panic - not syncing: Fatal exception in interrupt
 00: HCPGSP2629I The virtual machine is placed in CP mode due to a SIGP stop 
 from
  CPU 01.
 02: HCPGSP2629I The virtual machine is placed in CP mode due to a SIGP stop 
 from
  CPU 01.
 03: HCPGSP2629I The virtual machine is placed in CP mode due to a SIGP stop 
 from
  CPU 01.
 01: HCPGIR450W CP entered; disabled wait PSW 00020001 8000  
 000164DE
 
 That should be fixed with this one:
 
 commit f1ecfd5d3b69d98b814435758c485e6fd0e112de
 Author: Ursula Braun [EMAIL PROTECTED]
 Date:   Mon Oct 22 16:16:14 2007 +0200
 
 remove header_ops bug in qeth driver
 
 Remove qeth bug caused by commit:
 [NET]: Move hardware header operations out of netdevice.
 
 This is the second part of the qeth header_ops patch, since
 first patch sent 10/19 has been insufficient.
 Nevertheless first patch is still valid and should be kept.
 
 Signed-off-by: Ursula Braun [EMAIL PROTECTED]
 Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
 
 Patch is in -rc1. Could you please pull and try again? Thanks.

Hi,

The kernel panic is not seen in the 2.6.24-rc1 kernel.

-- 
Thanks  Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
-
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] USB: net: Fix asix read transfer buffer allocations.

2007-10-24 Thread David Hollis

On Wed, 2007-10-24 at 15:33 +0400, Valentine Barshak wrote:
 On systems with noncoherent cache, allocating dma buffers
 on the stack for USB IN transfers causes kernel crash,
 because usb map_urb_for_dma() code calls dma_map_single(),
 that invalidates data cache for DMA_FROM_DEVICE transfer direction
 and causes stack data loss if transfer size is less than cache line
 and not cache-line aligned. This patch makes asix usb network
 driver allocate USB IN transfer buffers with kmalloc instead of
 directly using variables on stack. It also sets data parameter to NULL
 for zero-length transfers and uses ETH_ALEN size for allocating MAC 
 address buffer.
 
 Signed-off-by: Valentine Barshak [EMAIL PROTECTED]

Acked-by: David Hollis [EMAIL PROTECTED]

 ---
  drivers/net/usb/asix.c |   44 +++-
  1 files changed, 31 insertions(+), 13 deletions(-)
 
 diff -pruN linux-2.6.orig/drivers/net/usb/asix.c 
 linux-2.6/drivers/net/usb/asix.c
 --- linux-2.6.orig/drivers/net/usb/asix.c 2007-10-23 20:52:11.0 
 +0400
 +++ linux-2.6/drivers/net/usb/asix.c  2007-10-23 20:57:38.0 +0400
 @@ -568,15 +568,23 @@ static void asix_set_multicast(struct ne
  static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
  {
   struct usbnet *dev = netdev_priv(netdev);
 + void *buf;
   u16 res;
  
 + buf = kmalloc(2, GFP_KERNEL);
 + if (!buf)
 + return -ENOMEM;
 +
   mutex_lock(dev-phy_mutex);
   asix_set_sw_mii(dev);
   asix_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id,
 - (__u16)loc, 2, (u16 *)res);
 + (__u16)loc, 2, buf);
   asix_set_hw_mii(dev);
   mutex_unlock(dev-phy_mutex);
  
 + res = *((u16 *)buf);
 + kfree(buf);
 +
   devdbg(dev, asix_mdio_read() phy_id=0x%02x, loc=0x%02x, 
 returns=0x%04x, phy_id, loc, le16_to_cpu(res  0x));
  
   return le16_to_cpu(res  0x);
 @@ -622,13 +630,22 @@ static void
  asix_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
  {
   struct usbnet *dev = netdev_priv(net);
 + void *buf;
   u8 opt;
  
 - if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, opt)  0) {
 + buf = kmalloc(1, GFP_KERNEL);
 + if (!buf)
 + return;
 +
 + if (asix_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, buf)  0) {
   wolinfo-supported = 0;
   wolinfo-wolopts = 0;
 + kfree(buf);
   return;
   }
 + opt = *((u8 *)buf);
 + kfree(buf);
 +
   wolinfo-supported = WAKE_PHY | WAKE_MAGIC;
   wolinfo-wolopts = 0;
   if (opt  AX_MONITOR_MODE) {
 @@ -644,7 +661,6 @@ asix_set_wol(struct net_device *net, str
  {
   struct usbnet *dev = netdev_priv(net);
   u8 opt = 0;
 - u8 buf[1];
  
   if (wolinfo-wolopts  WAKE_PHY)
   opt |= AX_MONITOR_LINK;
 @@ -654,7 +670,7 @@ asix_set_wol(struct net_device *net, str
   opt |= AX_MONITOR_MODE;
  
   if (asix_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE,
 -   opt, 0, 0, buf)  0)
 +   opt, 0, 0, NULL)  0)
   return -EINVAL;
  
   return 0;
 @@ -820,7 +836,7 @@ static int ax88172_bind(struct usbnet *d
   for (i = 2; i = 0; i--) {
   if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS,
   (gpio_bits  (i * 8))  0xff, 0, 0,
 - buf))  0)
 + NULL))  0)
   goto out2;
   msleep(5);
   }
 @@ -831,7 +847,7 @@ static int ax88172_bind(struct usbnet *d
   /* Get the MAC address */
   memset(buf, 0, ETH_ALEN);
   if ((ret = asix_read_cmd(dev, AX88172_CMD_READ_NODE_ID,
 - 0, 0, 6, buf))  0) {
 + 0, 0, ETH_ALEN, buf))  0) {
   dbg(read AX_CMD_READ_NODE_ID failed: %d, ret);
   goto out2;
   }
 @@ -909,7 +925,7 @@ static int ax88772_bind(struct usbnet *d
  
   usbnet_get_endpoints(dev,intf);
  
 - buf = kmalloc(6, GFP_KERNEL);
 + buf = kmalloc(ETH_ALEN, GFP_KERNEL);
   if(!buf) {
   dbg (Cannot allocate memory for buffer);
   ret = -ENOMEM;
 @@ -923,7 +939,7 @@ static int ax88772_bind(struct usbnet *d
   /* 0x10 is the phy id of the embedded 10/100 ethernet phy */
   embd_phy = ((asix_get_phy_addr(dev)  0x1f) == 0x10 ? 1 : 0);
   if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
 - embd_phy, 0, 0, buf))  0) {
 + embd_phy, 0, 0, NULL))  0) {
   dbg(Select PHY #1 failed: %d, ret);
   goto out2;
   }
 @@ -998,7 +1014,7 @@ static int ax88772_bind(struct usbnet *d
  
   if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
   AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
 - 

Re: [RFC][PATCH 0/3][XFRM]: Support packet processing error statistics.

2007-10-24 Thread jamal
On Wed, 2007-24-10 at 12:30 +0900, Masahide NAKAMURA wrote:

 At IPsec point of view, actually SPI mismatch caused by user configuration
 cannot be identified easily since identify of SAD is consist of SPI, address 
 and
 protocol(ESP/AH...) and linux SAD uses hash database. It is database identify
 mismatch. Then, SPI mismatch goes NoStates at my patch.
 OTOH Key mismatch goes ProtoError since esp[46]_input returns error.

Would be useful to just document what you said above so that user doesnt
have to intepret it.

 Thanks for pointing the RFC. I've read it, however, I cannot find them at the 
 RFC.

My bad. 

  In any case, it seems to me to be more accurate to not call them MIB
  stats if they are not. This doesnt qualify using the macros, utilities
  etc used for MIBs.
 

BTW, I meant doesnt disqualify them above;- 

 How about assuming it as private MIB of linux?

Ok, makes sense to me now - that would be a good choice (i dont see any
confusion with enteprise mib). 

 Shouldn't we have something after XFRM_  to distinguish from other XFRM
 macros?
 

It is not needed - I am sorry that i missed the Linux MIB part in your
emails so far. That would be good enough.

2) Why /proc? Are you going to make these available also via netlink? 
   
   Because /proc is easy to see it without any modified application.
   If you want the netlink interface, I can do it as the next step. Do you 
   want it?
  
  Absolutely - it would be much appreciated. And if you dont have time, I
  will write and test the user space part extension.
 
 Thanks. After my first step is completed, could you write the netlink part?

Thanks.

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: [RFC][PATCH 0/3][XFRM]: Support packet processing error statistics.

2007-10-24 Thread jamal
On Wed, 2007-24-10 at 12:59 +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:
 In article [EMAIL PROTECTED] (at Tue, 23 Oct 2007 16:08:34 +0900), Masahide 
 NAKAMURA [EMAIL PROTECTED] says:
 

  Now we have the following candidates:
  
  (1) my patchXFRM_MIB_INHDRERROR
  (2) some extender   XFRM_XXX_INHDRERROR (XXX is requested)
  (3) not-mib extenderXFRM_NOTMIB_INHDRERROR
  (4) no extender XFRM_INHDRERROR
  (5) merge linux-mib LINUX_MIB_XFRMINHDRERROR
  
  Comments?
 
 I would support (5) or (1).

#5 it is then.

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


[PATCH] small memory leak with FIB rules

2007-10-24 Thread Denis V. Lunev
This patch fixes a small memory leak. Default fib rules can be deleted by
the user if the rule does not carry FIB_RULE_PERMANENT flag, f.e. by
ip rule flush

Such a rule will not be freed as the ref-counter has 2 on start and becomes
clearly unreachable after removal.

Signed-off-by: Denis V. Lunev [EMAIL PROTECTED]

-

 include/net/fib_rules.h |3 ++
 net/core/fib_rules.c|   22 
 net/decnet/dn_rules.c   |   13 +---
 net/ipv4/fib_rules.c|   51 ++--
 net/ipv6/fib6_rules.c   |   37 ++
 5 files changed, 62 insertions(+), 64 deletions(-)

-

diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -107,4 +107,7 @@ extern int  fib_rules_unregister(struct 
fib_rules_ops *);
 extern int fib_rules_lookup(struct fib_rules_ops *,
 struct flowi *, int flags,
 struct fib_lookup_arg *);
+extern int fib_default_rule_add(struct fib_rules_ops *,
+u32 pref, u32 table,
+u32 flags);
 #endif
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 13de6f5..848132b 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -18,6 +18,28 @@
 static LIST_HEAD(rules_ops);
 static DEFINE_SPINLOCK(rules_mod_lock);
 
+int fib_default_rule_add(struct fib_rules_ops *ops,
+u32 pref, u32 table, u32 flags)
+{
+   struct fib_rule *r;
+
+   r = kzalloc(ops-rule_size, GFP_KERNEL);
+   if (r == NULL)
+   return -ENOMEM;
+
+   atomic_set(r-refcnt, 1);
+   r-action = FR_ACT_TO_TBL;
+   r-pref = pref;
+   r-table = table;
+   r-flags = flags;
+
+   /* The lock is not required here, the list in unreacheable
+* at the moment this function is called */
+   list_add_tail(r-list, ops-rules_list);
+   return 0;
+}
+EXPORT_SYMBOL(fib_default_rule_add);
+
 static void notify_rule_change(int event, struct fib_rule *rule,
   struct fib_rules_ops *ops, struct nlmsghdr *nlh,
   u32 pid);
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index ddd3f04..ffebea0 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -48,15 +48,6 @@ struct dn_fib_rule
u8  flags;
 };
 
-static struct dn_fib_rule default_rule = {
-   .common = {
-   .refcnt =   ATOMIC_INIT(2),
-   .pref = 0x7fff,
-   .table =RT_TABLE_MAIN,
-   .action =   FR_ACT_TO_TBL,
-   },
-};
-
 
 int dn_fib_lookup(struct flowi *flp, struct dn_fib_res *res)
 {
@@ -262,8 +253,8 @@ static struct fib_rules_ops dn_fib_rules_ops = {
 
 void __init dn_fib_rules_init(void)
 {
-   list_add_tail(default_rule.common.list,
-   dn_fib_rules_ops.rules_list);
+   BUG_ON(fib_default_rule_add(dn_fib_rules_ops, 0x7fff,
+   RT_TABLE_MAIN, 0));
fib_rules_register(dn_fib_rules_ops);
 }
 
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index f16839c..a0ada3a 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -49,33 +49,6 @@ struct fib4_rule
 #endif
 };
 
-static struct fib4_rule default_rule = {
-   .common = {
-   .refcnt =   ATOMIC_INIT(2),
-   .pref = 0x7FFF,
-   .table =RT_TABLE_DEFAULT,
-   .action =   FR_ACT_TO_TBL,
-   },
-};
-
-static struct fib4_rule main_rule = {
-   .common = {
-   .refcnt =   ATOMIC_INIT(2),
-   .pref = 0x7FFE,
-   .table =RT_TABLE_MAIN,
-   .action =   FR_ACT_TO_TBL,
-   },
-};
-
-static struct fib4_rule local_rule = {
-   .common = {
-   .refcnt =   ATOMIC_INIT(2),
-   .table =RT_TABLE_LOCAL,
-   .action =   FR_ACT_TO_TBL,
-   .flags =FIB_RULE_PERMANENT,
-   },
-};
-
 #ifdef CONFIG_NET_CLS_ROUTE
 u32 fib_rules_tclass(struct fib_result *res)
 {
@@ -319,11 +292,27 @@ static struct fib_rules_ops fib4_rules_ops = {
.owner  = THIS_MODULE,
 };
 
-void __init fib4_rules_init(void)
+static int __init fib_default_rules_init(void)
 {
-   list_add_tail(local_rule.common.list, fib4_rules_ops.rules_list);
-   list_add_tail(main_rule.common.list, fib4_rules_ops.rules_list);
-   list_add_tail(default_rule.common.list, fib4_rules_ops.rules_list);
+   int err;
+
+   err = fib_default_rule_add(fib4_rules_ops, 0,
+  RT_TABLE_LOCAL, FIB_RULE_PERMANENT);
+   

[PATCH] dev_change_name: ignore changes to same name

2007-10-24 Thread Stephen Hemminger
Prevent error/backtrace from dev_rename() when changing
name of network device to the same name. This is a common
situation with udev and other scripts that bind addr to device.

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

--- a/net/core/dev.c2007-10-24 06:01:31.0 -0700
+++ b/net/core/dev.c2007-10-24 06:41:18.0 -0700
@@ -885,6 +885,9 @@ int dev_change_name(struct net_device *d
if (!dev_valid_name(newname))
return -EINVAL;
 
+   if (strncmp(newname, dev-name, IFNAMSIZ) == 0)
+   return 0;
+
memcpy(oldname, dev-name, IFNAMSIZ);
 
if (strchr(newname, '%')) {
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] NET: Validate device addr prior to interface-up

2007-10-24 Thread Stephen Hemminger

 diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
 index ed8a3d4..5471cd2 100644
 --- a/net/ethernet/eth.c
 +++ b/net/ethernet/eth.c
 @@ -298,6 +298,14 @@ static int eth_change_mtu(struct net_device *dev, int 
 new_mtu)
   return 0;
  }
  
 +static int eth_validate_addr(struct net_device *dev)
 +{
 + if (!is_valid_ether_addr(dev-dev_addr))
 + return -EINVAL;
 + 
 + return 0;
 +}

Shouldn't this be const struct net_device *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


[PATCH 3/3] [IPSEC]: Separate inner/outer mode processing on output

2007-10-24 Thread Herbert Xu
[IPSEC]: Separate inner/outer mode processing on output

With inter-family transforms the inner mode differs from the outer mode.
Attempting to handle both sides from the same function means that it
needs to handle both IPv4 and IPv6 which creates duplication and confusion.

This patch separates the two parts on the output path so that each function
deals with one family only.

In particular, the functions xfrm4_extract_output/xfrm6_extract_output
moves the pertinent fields from the IPv4/IPv6 IP headers into a neutral
format stored in skb-cb.  This is then used by the outer mode output
functions to write the outer IP header.  In this way the output function
no longer has to know about the inner address family.

Since the extract functions are only called by tunnel modes (the only
modes that can support inter-family transforms), I've also moved the
xfrm*_tunnel_check_size calls into them.  This allows the correct ICMP
message to be sent as opposed to now where you might call icmp_send with
an IPv6 packet and vice versa.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 include/net/xfrm.h   |   50 ++-
 net/ipv4/xfrm4_mode_beet.c   |   17 --
 net/ipv4/xfrm4_mode_tunnel.c |   37 +--
 net/ipv4/xfrm4_output.c  |   41 +--
 net/ipv4/xfrm4_state.c   |   16 +
 net/ipv6/xfrm6_mode_beet.c   |   28 
 net/ipv6/xfrm6_mode_tunnel.c |   31 --
 net/ipv6/xfrm6_output.c  |   39 +
 net/ipv6/xfrm6_state.c   |   17 ++
 9 files changed, 192 insertions(+), 84 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 2da5ac5..06e244f 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -255,6 +255,7 @@ extern int __xfrm_state_delete(struct xfrm_state *x);
 
 struct xfrm_state_afinfo {
unsigned intfamily;
+   unsigned intproto;
struct module   *owner;
struct xfrm_type*type_map[IPPROTO_MAX];
struct xfrm_mode*mode_map[XFRM_MODE_MAX];
@@ -265,6 +266,8 @@ struct xfrm_state_afinfo {
int (*tmpl_sort)(struct xfrm_tmpl **dst, struct 
xfrm_tmpl **src, int n);
int (*state_sort)(struct xfrm_state **dst, struct 
xfrm_state **src, int n);
int (*output)(struct sk_buff *skb);
+   int (*extract_output)(struct xfrm_state *x,
+ struct sk_buff *skb);
 };
 
 extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
@@ -310,7 +313,18 @@ struct xfrm_mode {
 * header.  The value of the network header will always point
 * to the top IP header while skb-data will point to the payload.
 */
-   int (*output)(struct xfrm_state *x,struct sk_buff *skb);
+   int (*output2)(struct xfrm_state *x,struct sk_buff *skb);
+
+   /*
+* This is the actual output entry point.
+*
+* For transport mode and equivalent this would be identical to
+* output2 (which does not need to be set).  While tunnel mode
+* and equivalent would set this to a tunnel encapsulation function
+* (xfrm4_prepare_output or xfrm6_prepare_output) that would in turn
+* call output2.
+*/
+   int (*output)(struct xfrm_state *x, struct sk_buff *skb);
 
struct xfrm_state_afinfo *afinfo;
struct module *owner;
@@ -452,6 +466,34 @@ struct xfrm_skb_cb {
 
 #define XFRM_SKB_CB(__skb) ((struct xfrm_skb_cb *)((__skb)-cb[0]))
 
+/*
+ * This structure is used by the afinfo prepare_input/prepare_output functions
+ * to transmit header information to the mode input/output functions.
+ */
+struct xfrm_mode_skb_cb {
+   union {
+   struct inet_skb_parm h4;
+   struct inet6_skb_parm h6;
+} header;
+
+/* DF bit from header for IPv4, always set to DF for IPv6. */
+__be16 frag_off;
+
+/* TOS for IPv4, class for IPv6. */
+u8 tos;
+
+/* TTL for IPv4, hop limitfor IPv6. */
+u8 ttl;
+
+/* Protocol for IPv4, NH for IPv6. */
+u8 protocol;
+
+/* Used by IPv6 only, zero for IPv4. */
+u8 flow_lbl[3];
+};
+
+#define XFRM_MODE_SKB_CB(__skb) ((struct xfrm_mode_skb_cb *)((__skb)-cb[0]))
+
 /* Audit Information */
 struct xfrm_audit
 {
@@ -1049,6 +1091,7 @@ extern void xfrm_replay_notify(struct xfrm_state *x, int 
event);
 extern int xfrm_state_mtu(struct xfrm_state *x, int mtu);
 extern int xfrm_init_state(struct xfrm_state *x);
 extern int xfrm_output(struct sk_buff *skb);
+extern int xfrm4_extract_header(struct sk_buff *skb);
 extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
   int encap_type);
 extern int xfrm4_rcv(struct sk_buff *skb);
@@ 

[0/3] [IPSEC]: Separate inner/outer family processing on output

2007-10-24 Thread Herbert Xu
Hi Dave:

These three patches are the first step in fixing inter-family
support on the data path (the previous series should've solved
it for the control path).

I still need to fix the continuation on the output path and
repeat this process for the input path.

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


[PATCH 1/3] [IPSEC]: Forbid BEET + ipcomp for now

2007-10-24 Thread Herbert Xu
[IPSEC]: Forbid BEET + ipcomp for now

While BEET can theoretically work with IPComp the current code can't do that
because it tries to construct a BEET mode tunnel type which doesn't (and
cannot) exist.  In fact as it is it won't even attach a tunnel object at
all for BEET which is bogus.

To support this fully we'd also need to change the policy checks on input
to recognise a plain tunnel as a legal variant of an optional BEET transform.

This patch simply fails such constructions for now.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 net/ipv4/ipcomp.c  |   19 +++
 net/ipv6/ipcomp6.c |   18 +++---
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 0bfeb02..5059571 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -182,7 +182,6 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
 static struct xfrm_state *ipcomp_tunnel_create(struct xfrm_state *x)
 {
struct xfrm_state *t;
-   u8 mode = XFRM_MODE_TUNNEL;
 
t = xfrm_state_alloc();
if (t == NULL)
@@ -193,9 +192,7 @@ static struct xfrm_state *ipcomp_tunnel_create(struct 
xfrm_state *x)
t-id.daddr.a4 = x-id.daddr.a4;
memcpy(t-sel, x-sel, sizeof(t-sel));
t-props.family = AF_INET;
-   if (x-props.mode == XFRM_MODE_BEET)
-   mode = x-props.mode;
-   t-props.mode = mode;
+   t-props.mode = x-props.mode;
t-props.saddr.a4 = x-props.saddr.a4;
t-props.flags = x-props.flags;
 
@@ -389,15 +386,21 @@ static int ipcomp_init_state(struct xfrm_state *x)
if (x-encap)
goto out;
 
+   x-props.header_len = 0;
+   switch (x-props.mode) {
+   case XFRM_MODE_TRANSPORT:
+   break;
+   case XFRM_MODE_TUNNEL:
+   x-props.header_len += sizeof(struct iphdr);
+   default:
+   goto out;
+   }
+
err = -ENOMEM;
ipcd = kzalloc(sizeof(*ipcd), GFP_KERNEL);
if (!ipcd)
goto out;
 
-   x-props.header_len = 0;
-   if (x-props.mode == XFRM_MODE_TUNNEL)
-   x-props.header_len += sizeof(struct iphdr);
-
mutex_lock(ipcomp_resource_mutex);
if (!ipcomp_alloc_scratches())
goto error;
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 80ef2a1..957e10a 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -190,7 +190,6 @@ static void ipcomp6_err(struct sk_buff *skb, struct 
inet6_skb_parm *opt,
 static struct xfrm_state *ipcomp6_tunnel_create(struct xfrm_state *x)
 {
struct xfrm_state *t = NULL;
-   u8 mode = XFRM_MODE_TUNNEL;
 
t = xfrm_state_alloc();
if (!t)
@@ -204,9 +203,7 @@ static struct xfrm_state *ipcomp6_tunnel_create(struct 
xfrm_state *x)
memcpy(t-id.daddr.a6, x-id.daddr.a6, sizeof(struct in6_addr));
memcpy(t-sel, x-sel, sizeof(t-sel));
t-props.family = AF_INET6;
-   if (x-props.mode == XFRM_MODE_BEET)
-   mode = x-props.mode;
-   t-props.mode = mode;
+   t-props.mode = x-props.mode;
memcpy(t-props.saddr.a6, x-props.saddr.a6, sizeof(struct in6_addr));
 
if (xfrm_init_state(t))
@@ -405,22 +402,21 @@ static int ipcomp6_init_state(struct xfrm_state *x)
if (x-encap)
goto out;
 
-   err = -ENOMEM;
-   ipcd = kzalloc(sizeof(*ipcd), GFP_KERNEL);
-   if (!ipcd)
-   goto out;
-
x-props.header_len = 0;
switch (x-props.mode) {
-   case XFRM_MODE_BEET:
case XFRM_MODE_TRANSPORT:
break;
case XFRM_MODE_TUNNEL:
x-props.header_len += sizeof(struct ipv6hdr);
default:
-   goto error;
+   goto out;
}
 
+   err = -ENOMEM;
+   ipcd = kzalloc(sizeof(*ipcd), GFP_KERNEL);
+   if (!ipcd)
+   goto out;
+
mutex_lock(ipcomp6_resource_mutex);
if (!ipcomp6_alloc_scratches())
goto error;
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] [IPSEC]: Move x-outer_mode-output out of locked section

2007-10-24 Thread Herbert Xu
[IPSEC]: Move x-outer_mode-output out of locked section

RO mode is the only one that requires a locked output function.  So it's
easier to move the lock into that function rather than requiring everyone
else to run under the lock.

In particular, this allows us to move the size check into the output
function without causing a potential dead-lock should the ICMP error
somehow hit the same SA on transmission.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
---

 net/ipv6/xfrm6_mode_ro.c |3 +++
 net/xfrm/xfrm_output.c   |8 
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/xfrm6_mode_ro.c b/net/ipv6/xfrm6_mode_ro.c
index a7bc8c6..4a01cb3 100644
--- a/net/ipv6/xfrm6_mode_ro.c
+++ b/net/ipv6/xfrm6_mode_ro.c
@@ -28,6 +28,7 @@
 #include linux/kernel.h
 #include linux/module.h
 #include linux/skbuff.h
+#include linux/spinlock.h
 #include linux/stringify.h
 #include linux/time.h
 #include net/ipv6.h
@@ -53,7 +54,9 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct 
sk_buff *skb)
__skb_pull(skb, hdr_len);
memmove(ipv6_hdr(skb), iph, hdr_len);
 
+   spin_lock_bh(x-lock);
x-lastused = get_seconds();
+   spin_unlock_bh(x-lock);
 
return 0;
 }
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 58d5a74..b1efdc8 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -53,6 +53,10 @@ int xfrm_output(struct sk_buff *skb)
}
 
do {
+   err = x-outer_mode-output(x, skb);
+   if (err)
+   goto error;
+
spin_lock_bh(x-lock);
err = xfrm_state_check(x, skb);
if (err)
@@ -64,10 +68,6 @@ int xfrm_output(struct sk_buff *skb)
xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);
}
 
-   err = x-outer_mode-output(x, skb);
-   if (err)
-   goto error;
-
x-curlft.bytes += skb-len;
x-curlft.packets++;
 
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] make bonding/bond_main.c:bond_deinit() static

2007-10-24 Thread Adrian Bunk
bond_deinit() can now become static.

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

---

 drivers/net/bonding/bond_main.c |3 ++-
 drivers/net/bonding/bonding.h   |1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

5e5d2537b927f55a2199a0d9a073f41bb71290f6 
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6f85cc3..8bb0092 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -188,6 +188,7 @@ struct bond_parm_tbl arp_validate_tbl[] = {
 /*-- Forward declarations ---*/
 
 static void bond_send_gratuitous_arp(struct bonding *bond);
+static void bond_deinit(struct net_device *bond_dev);
 
 /* General routines -*/
 
@@ -4404,7 +4405,7 @@ static int bond_init(struct net_device *bond_dev, struct 
bond_params *params)
 /* De-initialize device specific data.
  * Caller must hold rtnl_lock.
  */
-void bond_deinit(struct net_device *bond_dev)
+static void bond_deinit(struct net_device *bond_dev)
 {
struct bonding *bond = bond_dev-priv;
 
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index b818060..aceaabb 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -298,7 +298,6 @@ int bond_dev_queue_xmit(struct bonding *bond, struct 
sk_buff *skb, struct net_de
 int bond_create(char *name, struct bond_params *params, struct bonding 
**newbond);
 void bond_destroy(struct bonding *bond);
 int  bond_release_and_destroy(struct net_device *bond_dev, struct net_device 
*slave_dev);
-void bond_deinit(struct net_device *bond_dev);
 int bond_create_sysfs(void);
 void bond_destroy_sysfs(void);
 void bond_destroy_sysfs_entry(struct bonding *bond);

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


[2.6 patch] drivers/net/ipg.c: cleanups

2007-10-24 Thread Adrian Bunk
This patch contains the following cleanups:
- make ipg_nic_get_stats() static
- move DefaultPhyParam[] from ipg.h to ipg.c and make it static

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

---

 drivers/net/ipg.c |   22 +-
 drivers/net/ipg.h |   20 
 2 files changed, 21 insertions(+), 21 deletions(-)

a3a6ac23118e63f10ff3832dc906da6e9bc3ea3d 
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index 6888723..dbd23bb 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -55,6 +55,26 @@ MODULE_DESCRIPTION(IC Plus IP1000 Gigabit Ethernet Adapter 
Linux Driver 
   DrvVer);
 MODULE_LICENSE(GPL);
 
+//variable record -- index by leading revision/length
+//Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN
+static unsigned short DefaultPhyParam[] = {
+   // 11/12/03 IP1000A v1-3 rev=0x40
+   
/*--
+   (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 
0xfff2,
+27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 
0x0003, 23, 0x92f6,
+31, 0x, 23, 0x003d, 30, 0x00de, 20, 
0x20e7,  9, 0x0700,
+ 
--*/
+   // 12/17/03 IP1000A v1-4 rev=0x40
+   (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31,
+   0x,
+   30, 0x005e, 9, 0x0700,
+   // 01/09/04 IP1000A v1-5 rev=0x41
+   (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31,
+   0x,
+   30, 0x005e, 9, 0x0700,
+   0x
+};
+
 static const char *ipg_brand_name[] = {
IC PLUS IP1000 1000/100/10 based NIC,
Sundance Technology ST2021 based NIC,
@@ -990,7 +1010,7 @@ static void ipg_nic_txcleanup(struct net_device *dev)
 }
 
 /* Provides statistical information about the IPG NIC. */
-struct net_device_stats *ipg_nic_get_stats(struct net_device *dev)
+static struct net_device_stats *ipg_nic_get_stats(struct net_device *dev)
 {
struct ipg_nic_private *sp = netdev_priv(dev);
void __iomem *ioaddr = sp-ioaddr;
diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
index e418b90..d5d092c 100644
--- a/drivers/net/ipg.h
+++ b/drivers/net/ipg.h
@@ -833,24 +833,4 @@ struct ipg_nic_private {
struct delayed_work task;
 };
 
-//variable record -- index by leading revision/length
-//Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN
-unsigned short DefaultPhyParam[] = {
-   // 11/12/03 IP1000A v1-3 rev=0x40
-   
/*--
-   (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 
0xfff2,
-27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 
0x0003, 23, 0x92f6,
-31, 0x, 23, 0x003d, 30, 0x00de, 20, 
0x20e7,  9, 0x0700,
- 
--*/
-   // 12/17/03 IP1000A v1-4 rev=0x40
-   (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31,
-   0x,
-   30, 0x005e, 9, 0x0700,
-   // 01/09/04 IP1000A v1-5 rev=0x41
-   (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31,
-   0x,
-   30, 0x005e, 9, 0x0700,
-   0x
-};
-
 #endif /* __LINUX_IPG_H */

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


[2.6 patch] make ircomm_tty static

2007-10-24 Thread Adrian Bunk
ircomm_tty can now become static.

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

---

 include/net/irda/ircomm_tty.h |1 -
 net/irda/ircomm/ircomm_tty.c  |2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

487bdc857155e7346cbb80b07d2ec3df150fc9d2 
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
index 8dabdd6..eea2e61 100644
--- a/include/net/irda/ircomm_tty.h
+++ b/include/net/irda/ircomm_tty.h
@@ -127,7 +127,6 @@ extern int ircomm_tty_ioctl(struct tty_struct *tty, struct 
file *file,
unsigned int cmd, unsigned long arg);
 extern void ircomm_tty_set_termios(struct tty_struct *tty, 
   struct ktermios *old_termios);
-extern hashbin_t *ircomm_tty;
 
 #endif
 
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 3d241e4..1120b15 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -77,7 +77,7 @@ static int ircomm_tty_read_proc(char *buf, char **start, 
off_t offset, int len,
 #endif /* CONFIG_PROC_FS */
 static struct tty_driver *driver;
 
-hashbin_t *ircomm_tty = NULL;
+static hashbin_t *ircomm_tty = NULL;
 
 static const struct tty_operations ops = {
.open= ircomm_tty_open,

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


[2.6 patch] make tcp_match_skb_to_sack() static

2007-10-24 Thread Adrian Bunk
tcp_match_skb_to_sack() can become static.

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

---
b734b439219a6251b7deb65dad2307f9c891f680 
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9288220..603400d 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1204,8 +1204,8 @@ static int tcp_check_dsack(struct tcp_sock *tp, struct 
sk_buff *ack_skb,
  * which may fail and creates some hassle (caller must handle error case
  * returns).
  */
-int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb,
- u32 start_seq, u32 end_seq)
+static int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb,
+u32 start_seq, u32 end_seq)
 {
int in_sack, err;
unsigned int pkt_len;

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


[2.6 patch] make sunrpc/xprtsock.c:xs_setup_{udp,tcp}() static

2007-10-24 Thread Adrian Bunk
xs_setup_{udp,tcp}() can now become static.

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

---

 include/linux/sunrpc/xprtsock.h |6 --
 net/sunrpc/xprtsock.c   |4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

833a31c8caef70589f33be8e3a1fc9d8e01ce3c2 
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h
index 2c6c2c2..c2a46c4 100644
--- a/include/linux/sunrpc/xprtsock.h
+++ b/include/linux/sunrpc/xprtsock.h
@@ -9,12 +9,6 @@
 
 #ifdef __KERNEL__
 
-/*
- * Socket transport setup operations
- */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args);
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args);
-
 intinit_socket_xprt(void);
 void   cleanup_socket_xprt(void);
 
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 02298f5..2f630a5 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1828,7 +1828,7 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create 
*args,
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
 {
struct sockaddr *addr = args-dstaddr;
struct rpc_xprt *xprt;
@@ -1894,7 +1894,7 @@ struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
 {
struct sockaddr *addr = args-dstaddr;
struct rpc_xprt *xprt;

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


[2.6 patch] unexport sock_enable_timestamp

2007-10-24 Thread Adrian Bunk
sock_enable_timestamp() no longer has any modular users.

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

---
c207a1b7709635c74b953324e60ab5a732ea279c 
diff --git a/net/core/sock.c b/net/core/sock.c
index febbcbc..bba9949 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1649,7 +1649,6 @@ void sock_enable_timestamp(struct sock *sk)
net_enable_timestamp();
}
 }
-EXPORT_SYMBOL(sock_enable_timestamp);
 
 /*
  * Get a socket option on an socket.

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


[2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread Adrian Bunk
This patch removes the unused EXPORT_SYMBOL(icmpmsg_statistics).

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

---
4ce74657ac0b1bdcb4c7bc359d05643f8cc4a08b 
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 272c69e..233de06 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -1104,5 +1104,4 @@ void __init icmp_init(struct net_proto_family *ops)
 EXPORT_SYMBOL(icmp_err_convert);
 EXPORT_SYMBOL(icmp_send);
 EXPORT_SYMBOL(icmp_statistics);
-EXPORT_SYMBOL(icmpmsg_statistics);
 EXPORT_SYMBOL(xrlim_allow);

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


[2.6 patch] #if 0 sctp_update_copy_cksum()

2007-10-24 Thread Adrian Bunk
sctp_update_copy_cksum() is no longer used.

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

---

 include/net/sctp/sctp.h |1 -
 net/sctp/crc32c.c   |2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

fc6646f84c07666228166c678ff2b5916db925ed 
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 119f5a1..93eb708 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -156,7 +156,6 @@ int sctp_primitive_ASCONF(struct sctp_association *, void 
*arg);
 __u32 sctp_start_cksum(__u8 *ptr, __u16 count);
 __u32 sctp_update_cksum(__u8 *ptr, __u16 count, __u32 cksum);
 __u32 sctp_end_cksum(__u32 cksum);
-__u32 sctp_update_copy_cksum(__u8 *, __u8 *, __u16 count, __u32 cksum);
 
 /*
  * sctp/input.c
diff --git a/net/sctp/crc32c.c b/net/sctp/crc32c.c
index 59cf7b0..181edab 100644
--- a/net/sctp/crc32c.c
+++ b/net/sctp/crc32c.c
@@ -170,6 +170,7 @@ __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 
crc32)
return crc32;
 }
 
+#if 0
 __u32 sctp_update_copy_cksum(__u8 *to, __u8 *from, __u16 length, __u32 crc32)
 {
__u32 i;
@@ -186,6 +187,7 @@ __u32 sctp_update_copy_cksum(__u8 *to, __u8 *from, __u16 
length, __u32 crc32)
 
return crc32;
 }
+#endif  /*  0  */
 
 __u32 sctp_end_cksum(__u32 crc32)
 {

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


[2.6 patch] unexport softnet_data

2007-10-24 Thread Adrian Bunk
The EXPORT_PER_CPU_SYMBOL(softnet_data) is no longer used.

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

---
6bf19ad197b0076e48be8720659d38413d438e26 
diff --git a/net/core/dev.c b/net/core/dev.c
index 38b03da..113d216 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4469,4 +4469,3 @@ EXPORT_SYMBOL(br_fdb_put_hook);
 EXPORT_SYMBOL(dev_load);
 #endif
 
-EXPORT_PER_CPU_SYMBOL(softnet_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


[2.6 patch] net/sctp/auth.c: make 3 functions static

2007-10-24 Thread Adrian Bunk
This patch makes three needlessly global functions static.

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

---

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

102a72ca5278d3c502bee6af4c4d11c9876d5a2d 
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index 4945954..9e8f13b 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -88,7 +88,6 @@ static inline void sctp_auth_key_hold(struct sctp_auth_bytes 
*key)
 
 void sctp_auth_key_put(struct sctp_auth_bytes *key);
 struct sctp_shared_key *sctp_auth_shkey_create(__u16 key_id, gfp_t gfp);
-void sctp_auth_shkey_free(struct sctp_shared_key *sh_key);
 void sctp_auth_destroy_keys(struct list_head *keys);
 int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp);
 struct sctp_shared_key *sctp_auth_get_shkey(
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 7818107..5a2dd38 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -107,7 +107,7 @@ struct sctp_shared_key *sctp_auth_shkey_create(__u16 
key_id, gfp_t gfp)
 }
 
 /* Free the shared key stucture */
-void sctp_auth_shkey_free(struct sctp_shared_key *sh_key)
+static void sctp_auth_shkey_free(struct sctp_shared_key *sh_key)
 {
BUG_ON(!list_empty(sh_key-key_list));
sctp_auth_key_put(sh_key-key);
@@ -220,7 +220,7 @@ static struct sctp_auth_bytes *sctp_auth_make_key_vector(
 
 
 /* Make a key vector based on our local parameters */
-struct sctp_auth_bytes *sctp_auth_make_local_vector(
+static struct sctp_auth_bytes *sctp_auth_make_local_vector(
const struct sctp_association *asoc,
gfp_t gfp)
 {
@@ -232,7 +232,7 @@ struct sctp_auth_bytes *sctp_auth_make_local_vector(
 }
 
 /* Make a key vector based on peer's parameters */
-struct sctp_auth_bytes *sctp_auth_make_peer_vector(
+static struct sctp_auth_bytes *sctp_auth_make_peer_vector(
const struct sctp_association *asoc,
gfp_t gfp)
 {

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


[2.6 patch] remove Documentation/networking/net-modules.txt

2007-10-24 Thread Adrian Bunk
According to git, the only one who touched this file during the last
5 years was me when removing drivers...

modinfo offers less ancient information.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: Geert Uytterhoeven [EMAIL PROTECTED]
Acked-by: Paul Gortmaker [EMAIL PROTECTED]

---

This patch has been sent on:
- 14 Aug 2007
- 23 Jul 2007

 Documentation/networking/00-INDEX|2 
 Documentation/networking/net-modules.txt |  315 ---
 2 files changed, 317 deletions(-)

--- linux-2.6.22-rc6-mm1/Documentation/networking/00-INDEX.old  2007-07-23 
20:28:51.0 +0200
+++ linux-2.6.22-rc6-mm1/Documentation/networking/00-INDEX  2007-07-23 
20:28:59.0 +0200
@@ -80,8 +80,6 @@
- Behaviour of cards under Multicast
 ncsa-telnet
- notes on how NCSA telnet (DOS) breaks with MTU discovery enabled.
-net-modules.txt
-   - info and insmod parameters for all network driver modules.
 netdevices.txt
- info on network device driver functions exported to the kernel.
 olympic.txt
--- linux-2.6.22-rc6-mm1/Documentation/networking/net-modules.txt   
2007-07-12 20:43:37.0 +0200
+++ /dev/null   2006-09-19 00:45:31.0 +0200
@@ -1,315 +0,0 @@
-Wed 2-Aug-95  [EMAIL PROTECTED]
-
-   Linux network driver modules
-
-   Do not mistake this for README.modules at the top-level
-   directory!  That document tells about modules in general, while
-   this one tells only about network device driver modules.
-
-   This is a potpourri of INSMOD-time(*) configuration options
-   (if such exists) and their default values of various modules
-   in the Linux network drivers collection.
-
-   Some modules have also hidden (= non-documented) tunable values.
-   The choice of not documenting them is based on general belief, that
-   the less the user needs to know, the better.  (There are things that
-   driver developers can use, others should not confuse themselves.)
-
-   In many cases it is highly preferred that insmod:ing is done
-   ONLY with defining an explicit address for the card, AND BY
-   NOT USING AUTO-PROBING!
-
-   Now most cards have some explicitly defined base address that they
-   are compiled with (to avoid auto-probing, among other things).
-   If that compiled value does not match your actual configuration,
-   do use the io=0xXXX -parameter for the insmod, and give there
-   a value matching your environment.
-
-   If you are adventurous, you can ask the driver to autoprobe
-   by using the io=0 parameter, however it is a potentially dangerous
-   thing to do in a live system.  (If you don't know where the
-   card is located, you can try autoprobing, and after possible
-   crash recovery, insmod with proper IO-address..)
-
-   --
-   (*) INSMOD-time means when you load module with
-   /sbin/insmod  you can feed it optional parameters.
-   See man insmod.
-   --
-
-
-   8390 based Network Modules  (Paul Gortmaker, Nov 12, 1995)
-   --
-
-(Includes: smc-ultra, ne, wd, 3c503, hp, hp-plus, e2100 and ac3200)
-
-The 8390 series of network drivers now support multiple card systems without 
-reloading the same module multiple times (memory efficient!) This is done by 
-specifying multiple comma separated values, such as:
-
-   insmod 3c503.o io=0x280,0x300,0x330,0x350  xcvr=0,1,0,1
-
-The above would have the one module controlling four 3c503 cards, with card 2
-and 4 using external transceivers. The insmod manual describes the usage
-of comma separated value lists.
-
-It is *STRONGLY RECOMMENDED* that you supply io= instead of autoprobing.
-If an io= argument is not supplied, then the ISA drivers will complain
-about autoprobing being not recommended, and begrudgingly autoprobe for
-a *SINGLE CARD ONLY* -- if you want to use multiple cards you *have* to 
-supply an io=0xNNN,0xQQQ,... argument.
-
-The ne module is an exception to the above. A NE2000 is essentially an
-8390 chip, some bus glue and some RAM. Because of this, the ne probe is
-more invasive than the rest, and so at boot we make sure the ne probe is 
-done last of all the 8390 cards (so that it won't trip over other 8390 based
-cards) With modules we can't ensure that all other non-ne 8390 cards have
-already been found. Because of this, the ne module REQUIRES an io=0xNNN 
-argument passed in via insmod. It will refuse to autoprobe.
-
-It is also worth noting that auto-IRQ probably isn't as reliable during 
-the flurry of interrupt activity on a running machine. Cards such as the 
-ne2000 that can't get the IRQ setting from an EEPROM or configuration
-register are probably best supplied with an irq=M argument as well.
-
-
---
-Card/Module List - Configurable Parameters and 

[2.6 patch] bonding/bond_main.c: fix cut'n'paste error

2007-10-24 Thread Adrian Bunk
This patch fixes a cut'n'paste error in
commit 1b76b31693d4a6088dec104ff6a6ead54081a3c2.

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

---
4888742f8d7fe3b97fbc2911aa46375048173d01 
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e5fab4b..6937ef0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3682,7 +3682,7 @@ static int bond_open(struct net_device *bond_dev)
}
 
if (bond-params.mode == BOND_MODE_8023AD) {
-   INIT_DELAYED_WORK(bond-ad_work, bond_alb_monitor);
+   INIT_DELAYED_WORK(bond-ad_work, 
bond_3ad_state_machine_handler);
queue_delayed_work(bond-wq, bond-ad_work, 0);
/* register to receive LACPDUs */
bond_register_lacpdu(bond);

-
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/2] forcedeth new device ids

2007-10-24 Thread Ayaz Abdulla
This patch adds new device ids and features for mcp77 devices into the 
forcedeth driver.


Signed-off-by: Ayaz Abdulla [EMAIL PROTECTED]
--- old/drivers/net/forcedeth.c 2007-10-23 16:47:08.0 -0400
+++ new/drivers/net/forcedeth.c 2007-10-23 16:47:11.0 -0400
@@ -5597,6 +5597,22 @@
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_31),
.driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
+   {   /* MCP77 Ethernet Controller */
+   PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_32),
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   },
+   {   /* MCP77 Ethernet Controller */
+   PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_33),
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   },
+   {   /* MCP77 Ethernet Controller */
+   PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_34),
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   },
+   {   /* MCP77 Ethernet Controller */
+   PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_35),
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   },
{0,},
 };
 


[PATCH 1/2] forcedeth new device ids

2007-10-24 Thread Ayaz Abdulla

This patch adds new device ids for mcp77 devices.

Signed-off-by: Ayaz Abdulla [EMAIL PROTECTED]
--- old/include/linux/pci_ids.h 2007-10-23 16:49:46.0 -0400
+++ new/include/linux/pci_ids.h 2007-10-23 16:50:50.0 -0400
@@ -1236,6 +1236,10 @@
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE   0x0560
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE   0x056C
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE   0x0759
+#define PCI_DEVICE_ID_NVIDIA_NVENET_32  0x0760
+#define PCI_DEVICE_ID_NVIDIA_NVENET_33  0x0761
+#define PCI_DEVICE_ID_NVIDIA_NVENET_34  0x0762
+#define PCI_DEVICE_ID_NVIDIA_NVENET_35  0x0763
 
 #define PCI_VENDOR_ID_IMS  0x10e0
 #define PCI_DEVICE_ID_IMS_TT1280x9128


Re: [2.6 patch] make sunrpc/xprtsock.c:xs_setup_{udp,tcp}() static

2007-10-24 Thread Chuck Lever

Adrian Bunk wrote:

xs_setup_{udp,tcp}() can now become static.


ACK.  Sorry this was overlooked.


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

---

 include/linux/sunrpc/xprtsock.h |6 --
 net/sunrpc/xprtsock.c   |4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

833a31c8caef70589f33be8e3a1fc9d8e01ce3c2 
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h

index 2c6c2c2..c2a46c4 100644
--- a/include/linux/sunrpc/xprtsock.h
+++ b/include/linux/sunrpc/xprtsock.h
@@ -9,12 +9,6 @@
 
 #ifdef __KERNEL__
 
-/*

- * Socket transport setup operations
- */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args);
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args);
-
 intinit_socket_xprt(void);
 void   cleanup_socket_xprt(void);
 
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c

index 02298f5..2f630a5 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1828,7 +1828,7 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create 
*args,
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
 {
struct sockaddr *addr = args-dstaddr;
struct rpc_xprt *xprt;
@@ -1894,7 +1894,7 @@ struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
 {
struct sockaddr *addr = args-dstaddr;
struct rpc_xprt *xprt;



begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
email;internet:chuck dot lever at nospam oracle dot com
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard



Re: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread David Stevens
[EMAIL PROTECTED] wrote on 10/24/2007 09:24:10 AM:

 This patch removes the unused EXPORT_SYMBOL(icmpmsg_statistics).
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
 
 ---
 4ce74657ac0b1bdcb4c7bc359d05643f8cc4a08b 
 diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
 index 272c69e..233de06 100644
 --- a/net/ipv4/icmp.c
 +++ b/net/ipv4/icmp.c
 @@ -1104,5 +1104,4 @@ void __init icmp_init(struct net_proto_family 
*ops)
  EXPORT_SYMBOL(icmp_err_convert);
  EXPORT_SYMBOL(icmp_send);
  EXPORT_SYMBOL(icmp_statistics);
 -EXPORT_SYMBOL(icmpmsg_statistics);
  EXPORT_SYMBOL(xrlim_allow);

icmpmsg_statistics belongs with (and replaces some of the 
old...)
icmp_statistics. I'm not sure that any modules use it, but I think you
should remove both or neither.

+-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: stateless 1:1 NAT

2007-10-24 Thread Florin Andrei

Herbert Xu wrote:

Florin Andrei [EMAIL PROTECTED] wrote:
I've heard that stateless 1:1 NAT will be possible with the upcoming 
2.6.24 kernel.
I'd like to test that feature, but I'm not sure when it will actually be 
included. Will it be present in the release candidates for 2.6.24?

I just need a somewhat stable kernel tree to play with.


Yes it will be.


OK, if I download 2.6.24-rc1, will it have this feature already?
If not, when is it supposed to be included in the main kernel?

Thanks,

--
Florin Andrei

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


Re: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread Adrian Bunk
On Wed, Oct 24, 2007 at 12:07:45PM -0700, David Stevens wrote:
 [EMAIL PROTECTED] wrote on 10/24/2007 09:24:10 AM:
 
  This patch removes the unused EXPORT_SYMBOL(icmpmsg_statistics).
  
  Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
  
  ---
  4ce74657ac0b1bdcb4c7bc359d05643f8cc4a08b 
  diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
  index 272c69e..233de06 100644
  --- a/net/ipv4/icmp.c
  +++ b/net/ipv4/icmp.c
  @@ -1104,5 +1104,4 @@ void __init icmp_init(struct net_proto_family 
 *ops)
   EXPORT_SYMBOL(icmp_err_convert);
   EXPORT_SYMBOL(icmp_send);
   EXPORT_SYMBOL(icmp_statistics);
  -EXPORT_SYMBOL(icmpmsg_statistics);
   EXPORT_SYMBOL(xrlim_allow);
 
 icmpmsg_statistics belongs with (and replaces some of the 
 old...)
 icmp_statistics. I'm not sure that any modules use it, but I think you
 should remove both or neither.

icmp_statistics is used by the dccp_ipv4 and sctp modules.

icmpmsg_statistics is not used by any modules.

 +-DLS

cu
Adrian

-- 

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

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


Re: [PATCH 1/2] NFS: change the ip_map cache code to handle IPv6 addresses

2007-10-24 Thread Brian Haley

Hi Aurelien,

I think you're almost there, at least with my comments :)


linux-2.6.23-ipmap/include/net/ipv6.h
--- linux-2.6.23-haley/include/net/ipv6.h2007-10-22 
09:42:58.0 +0200
+++ linux-2.6.23-ipmap/include/net/ipv6.h2007-10-22 
10:10:59.0 +0200

@@ -21,6 +21,7 @@
#include net/ndisc.h
#include net/flow.h
#include net/snmp.h
+#include linux/in.h

#define SIN6_LEN_RFC213324

@@ -167,6 +168,12 @@ DECLARE_SNMP_STAT(struct udp_mib, udplit
if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, 
field); \

elseSNMP_INC_STATS_USER(udp_stats_in6, field);} while(0)

+#define IS_ADDR_MAPPED(a) \
+(((uint32_t *) (a))[0] == 0\
+ ((uint32_t *) (a))[1] == 0\
+ (((uint32_t *) (a))[2] == 0\
+|| ((uint32_t *) (a))[2] == htonl(0x)))
+
struct ip6_ra_chain
{
struct ip6_ra_chain*next;
@@ -380,7 +387,7 @@ static inline int ipv6_addr_any(const st
static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
{
return ((a-s6_addr32[0] | a-s6_addr32[1]) == 0 
- a-s6_addr32[2] == htonl(0x));
+a-s6_addr32[2] == htonl(0x));
}


You don't need to touch ipv6.h at all, IS_ADDR_MAPPED is unused and the 
other is removing a space.



static void ip_map_init(struct cache_head *cnew, struct cache_head *citem)
{
@@ -125,7 +133,7 @@ static void ip_map_init(struct cache_hea
struct ip_map *item = container_of(citem, struct ip_map, h);

strcpy(new-m_class, item-m_class);
-new-m_addr.s_addr = item-m_addr.s_addr;
+ipv6_addr_copy((new-m_addr), (item-m_addr));


Extra () here.


@@ -651,7 +694,7 @@ svcauth_unix_set_client(struct svc_rqst
ipm = ip_map_cached_get(rqstp);
if (ipm == NULL)
ipm = ip_map_lookup(rqstp-rq_server-sv_program-pg_class,
-sin-sin_addr);
+(sin6-sin6_addr));


Extra () here.

-Brian
-
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/2] NFS: handle IPv6 addresses in nfs ctl

2007-10-24 Thread Brian Haley

Hi Aurelien,

Again, a few more comments.

I might just modify these in my own tree and send out a patch that 
combines both into one, it might be less work.



@@ -229,9 +229,20 @@ static ssize_t write_getfs(struct file *
return -EINVAL;
data = (struct nfsctl_fsparm*)buf;
err = -EPROTONOSUPPORT;
-   if (data-gd_addr.sa_family != AF_INET)
+   switch (data-gd_addr.sa_family) {
+   case AF_INET6:
+   sin6 = sin6_storage;


This should be:

in6 = sin6_storage;


+   sin6 = (struct sockaddr_in6 *)data-gd_addr;
+		ipv6_addr_copy(in6, (sin6-sin6_addr)); 


Extra () here.

-	if (!(clp = auth_unix_lookup(in6))) 
+	switch (data-gd_addr.sa_family) {

+   case AF_INET:
+   /* IPv6 address mapping */
+   ipv6_addr_set(in6, 0, 0, htonl(0x), ((struct sockaddr_in 
*)data-gd_addr)-sin_addr.s_addr);
+   break;
+   case AF_INET6:
+   sin6 = sin6_storage;


This should be:

in6 = sin6_storage;


+   sin6 = (struct sockaddr_in6 *)data-gd_addr;
+   ipv6_addr_copy(in6, (sin6-sin6_addr));


Extra () here.

-Brian
-
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] PowerPC: Add BCM5248 and Marvell 88E1111 PHY support to NEW EMAC.

2007-10-24 Thread Valentine Barshak

Benjamin Herrenschmidt wrote:

On Tue, 2007-10-23 at 20:57 -0500, Valentine Barshak wrote:


+static int m88e_init(struct mii_phy *phy)
+{
+   printk(%s: Marvell 88E Ethernet\n, __FUNCTION__);
+   phy_write(phy, 0x14, 0x0ce3);
+   phy_write(phy, 0x18, 0x4101);
+   phy_write(phy, 0x09, 0x0e00);
+   phy_write(phy, 0x04, 0x01e1);
+   phy_write(phy, 0x00, 0x9140);
+   phy_write(phy, 0x00, 0x1140);
+
+   return  0;
+}


Care to put a few comments on why the above is necessary and what it
does ?


I think this set's up Marvell ext control (0x14) and led control (0x18) 
registers with some default values, Also sets some bits in the
CTRL1000, ADVERTISE and basic mode control registers and resets the phy 
for the changes to take effect. Unfortunately, I don't have a detailed 
88E description and can't tell anything about it. Looks like the 
code was originally ported from u-boot and is needed to init the phy :)

Stefan, do you have any info on this?
Thanks,
Valentine.



Thanks !
Ben.


+static struct mii_phy_ops m88e_phy_ops = {
+   .init   = m88e_init,
+   .setup_aneg = genmii_setup_aneg,
+   .setup_forced   = genmii_setup_forced,
+   .poll_link  = genmii_poll_link,
+   .read_link  = genmii_read_link
+};
+
+static struct mii_phy_def m88e_phy_def = {
+
+   .phy_id = 0x01410CC0,
+   .phy_id_mask= 0x0ff0,
+   .name   = Marvell 88E Ethernet,
+   .ops= m88e_phy_ops,
+};
+
 static struct mii_phy_def *mii_phy_table[] = {
cis8201_phy_def,
+   bcm5248_phy_def,
+   m88e_phy_def,
genmii_phy_def,
NULL
 };




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


Re: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread David Stevens
[EMAIL PROTECTED] wrote on 10/24/2007 12:14:37 PM:

 On Wed, Oct 24, 2007 at 12:07:45PM -0700, David Stevens wrote:
  [EMAIL PROTECTED] wrote on 10/24/2007 09:24:10 AM:
  
   This patch removes the unused EXPORT_SYMBOL(icmpmsg_statistics).
   
   Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
   
   ---
   4ce74657ac0b1bdcb4c7bc359d05643f8cc4a08b 
   diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
   index 272c69e..233de06 100644
   --- a/net/ipv4/icmp.c
   +++ b/net/ipv4/icmp.c
   @@ -1104,5 +1104,4 @@ void __init icmp_init(struct net_proto_family 
  *ops)
EXPORT_SYMBOL(icmp_err_convert);
EXPORT_SYMBOL(icmp_send);
EXPORT_SYMBOL(icmp_statistics);
   -EXPORT_SYMBOL(icmpmsg_statistics);
EXPORT_SYMBOL(xrlim_allow);
  
  icmpmsg_statistics belongs with (and replaces some of the 
  old...)
  icmp_statistics. I'm not sure that any modules use it, but I think 
you
  should remove both or neither.
 
 icmp_statistics is used by the dccp_ipv4 and sctp modules.

The only items left in icmp_statistics are InMsgs, InErrs, 
OutMsgs, OutErrs,
so if dccp and sctp are sending or receiving any in or out ICMP messages, 
they
should be using the new macros (which reference icmpmsg_statistics, not
icmp_statistics) to count them.
I took a quick look at SCTP. I don't know if that's going through 
icmp_rcv()
or not; if so, I think it's double-counting; if not, then it isn't 
counting the
individual types (as it should), and it should have ICMPMSG macros doing 
that.

So, again, icmpmsg_statistics either should stay exported, or 
neither
icmpmsg_statistics nor icmp_statistics should be exported (depending on 
how
SCTP and DCCP code is resolved). It's incorrect in the current code to
incrememnt ICMP_MIB_INMSGS without incrementing one of the types too.

 +-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: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread David Stevens
I took a look at the DCCP references, and I think they're just
incrementing the wrong MIB variable -- e.g., it's incrementing
ICMP_MIB_INERRORS when the skb length is less than the
header indicates. That's not an ICMP_MIB_INERRORS error,
that's an IPSTATS_MIB_INHDRERRORS error. ICMP_MIB_INERRORS
is when you receive an ICMP error packet; an IP header error
is something else entirely.

That's followed by a failed lookup incrementing ICMP_MIB_INERRORS
which should be an unknown port error in the transport MIB (assuming
it has one-- it's not an ICMP error; could be an IP error, if the address
isn't local, rather than unknown port).

In SCTP, it appears to have similar problems. SCTP errors are not
ICMP errors, though it perhaps should be calling icmp_send() to
send one to the offending host for some of the cases.

I haven't seen any ICMP-relevant stats correctly referenced in
these yet.

I don't want to patch them directly, since I can't easily test them;
if someone who works with DCCP and SCTP would like to, I'd
be happy to review. Any volunteers?

+-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: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread Vlad Yasevich
David Stevens wrote:
 I took a look at the DCCP references, and I think they're just
 incrementing the wrong MIB variable -- e.g., it's incrementing
 ICMP_MIB_INERRORS when the skb length is less than the
 header indicates. That's not an ICMP_MIB_INERRORS error,
 that's an IPSTATS_MIB_INHDRERRORS error. ICMP_MIB_INERRORS
 is when you receive an ICMP error packet; an IP header error
 is something else entirely.
 
 That's followed by a failed lookup incrementing ICMP_MIB_INERRORS
 which should be an unknown port error in the transport MIB (assuming
 it has one-- it's not an ICMP error; could be an IP error, if the address
 isn't local, rather than unknown port).
 
 In SCTP, it appears to have similar problems. SCTP errors are not
 ICMP errors, though it perhaps should be calling icmp_send() to
 send one to the offending host for some of the cases.
 
 I haven't seen any ICMP-relevant stats correctly referenced in
 these yet.
 
 I don't want to patch them directly, since I can't easily test them;
 if someone who works with DCCP and SCTP would like to, I'd
 be happy to review. Any volunteers?

I'll take a look at the SCTP ones.  Thanks for review.

-vlad

 
 +-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
 

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


Re: [2.6 patch] net/sctp/auth.c: make 3 functions static

2007-10-24 Thread Vlad Yasevich
Adrian Bunk wrote:
 This patch makes three needlessly global functions static.
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

ACK.  Thanks for catching these..

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


Re: [2.6 patch] #if 0 sctp_update_copy_cksum()

2007-10-24 Thread Vlad Yasevich
Adrian Bunk wrote:
 sctp_update_copy_cksum() is no longer used.
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

ACK.

-vlad

 
 ---
 
  include/net/sctp/sctp.h |1 -
  net/sctp/crc32c.c   |2 ++
  2 files changed, 2 insertions(+), 1 deletion(-)
 
 fc6646f84c07666228166c678ff2b5916db925ed 
 diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
 index 119f5a1..93eb708 100644
 --- a/include/net/sctp/sctp.h
 +++ b/include/net/sctp/sctp.h
 @@ -156,7 +156,6 @@ int sctp_primitive_ASCONF(struct sctp_association *, void 
 *arg);
  __u32 sctp_start_cksum(__u8 *ptr, __u16 count);
  __u32 sctp_update_cksum(__u8 *ptr, __u16 count, __u32 cksum);
  __u32 sctp_end_cksum(__u32 cksum);
 -__u32 sctp_update_copy_cksum(__u8 *, __u8 *, __u16 count, __u32 cksum);
  
  /*
   * sctp/input.c
 diff --git a/net/sctp/crc32c.c b/net/sctp/crc32c.c
 index 59cf7b0..181edab 100644
 --- a/net/sctp/crc32c.c
 +++ b/net/sctp/crc32c.c
 @@ -170,6 +170,7 @@ __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 
 crc32)
   return crc32;
  }
  
 +#if 0
  __u32 sctp_update_copy_cksum(__u8 *to, __u8 *from, __u16 length, __u32 crc32)
  {
   __u32 i;
 @@ -186,6 +187,7 @@ __u32 sctp_update_copy_cksum(__u8 *to, __u8 *from, __u16 
 length, __u32 crc32)
  
   return crc32;
  }
 +#endif  /*  0  */
  
  __u32 sctp_end_cksum(__u32 crc32)
  {
 
 -
 To unsubscribe from this list: send the line unsubscribe netdev in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

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


Re: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread David Stevens
My bad -- I see what it's doing, and it looks ok after all.

I thought I saw an INMSGS (but didn't).  These are ICMP errors that
went through icmp_rcv() and were counted correctly before getting
to the protocol error handlers. These are failures due mostly to not
having enough, or the right protocol info in the error packet being
handled. I'm not sure I'd count those as ICMP errors, since the
ICMP header itself is correct, but ok...

SCTP doesn't look so bad, though I think the references are
still questionable (but debatable) as ICMP errors.

sctp_v4_err is incrementing ICMP_MIB_INERRORS if there
isn't enough IP header to find the ports, I see. I'm not sure
that counts as an ICMP error, but it's not so terrible.

It's doing the same thing if a lookup fails to match vtag from
the encapsulated error packet. Again, I don't know that those
are ICMP errors (which normally are something wrong with
the ICMP header).

So, I stand corrected, and sorry about the histrionics. Since
these are arguably ICMP errors, and since errors is the only
thing being MIB-counted in DCCP and SCTP, then it now looks
ok to me as-is, and also ok to remove icmpmsg_statistics from
exporting.

+-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: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread Vlad Yasevich
David Stevens wrote:
 I took a look at the DCCP references, and I think they're just
 incrementing the wrong MIB variable -- e.g., it's incrementing
 ICMP_MIB_INERRORS when the skb length is less than the
 header indicates. That's not an ICMP_MIB_INERRORS error,
 that's an IPSTATS_MIB_INHDRERRORS error. ICMP_MIB_INERRORS
 is when you receive an ICMP error packet; an IP header error
 is something else entirely.

Looking at icmp_rcv(), ICMP_MIB_INERRORS is incremented if:
 a) checksum fails
 b) no enough room in skb for icmp header
 c) type out of bound
 and other error conditions while processing ICMP packet.

Are all of these wrong as well?

There are other places that increment this statistic for errors
during processing.

 
 That's followed by a failed lookup incrementing ICMP_MIB_INERRORS
 which should be an unknown port error in the transport MIB (assuming
 it has one-- it's not an ICMP error; could be an IP error, if the address
 isn't local, rather than unknown port).
 
 In SCTP, it appears to have similar problems. SCTP errors are not
 ICMP errors, though it perhaps should be calling icmp_send() to
 send one to the offending host for some of the cases.

I'll skip the insufficient buffer space statistic yet, since, per above,
it's not clear which one should be used.

Others, I agree are move ULP errors, but the mibs don't account for those
yet.

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


Re: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread Vlad Yasevich
David Stevens wrote:
 My bad -- I see what it's doing, and it looks ok after all.
 

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


Re: [2.6 patch] unexport icmpmsg_statistics

2007-10-24 Thread Vlad Yasevich
David Stevens wrote:
 My bad -- I see what it's doing, and it looks ok after all.
 
 I thought I saw an INMSGS (but didn't).  These are ICMP errors that
 went through icmp_rcv() and were counted correctly before getting
 to the protocol error handlers. These are failures due mostly to not
 having enough, or the right protocol info in the error packet being
 handled. I'm not sure I'd count those as ICMP errors, since the
 ICMP header itself is correct, but ok...
 
 SCTP doesn't look so bad, though I think the references are
 still questionable (but debatable) as ICMP errors.
 
 sctp_v4_err is incrementing ICMP_MIB_INERRORS if there
 isn't enough IP header to find the ports, I see. I'm not sure
 that counts as an ICMP error, but it's not so terrible.
 
 It's doing the same thing if a lookup fails to match vtag from
 the encapsulated error packet. Again, I don't know that those
 are ICMP errors (which normally are something wrong with
 the ICMP header).

This particular case is the one that bugs the most, but that
error matches best.

Seems like all ULPs treat socket lookup error as ICMP_MIB_INERRORS
(tcp, udp, sctp, dccp).

SCTP is a little special in that in needs to check one one piece
of data (the 'vtag') to correctly identify the connection.
If that piece doesn't match, we treat that as the same error.

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


Re: [2.6 patch] make tcp_match_skb_to_sack() static

2007-10-24 Thread Ilpo Järvinen
On Wed, 24 Oct 2007, Adrian Bunk wrote:

 tcp_match_skb_to_sack() can become static.
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

[...snip...]

Thanks, I should have noticed that right from the beginning...

Added DaveM to recipients.

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


Re: [PATCH 13/13] r8169: more phy init for the 8168

2007-10-24 Thread Francois Romieu
Glen Gray [EMAIL PROTECTED] :
 Are any of these likely to fix the Ethernet multicast issues a few of us 
 have seen with 8110sc cards ?

No, this serie is not expected to.

I have planned to work on it again during the bugfix phase of 2.6.24-rc.

Is it still an option for you to use the old realtek driver + bandaid
(no pun) in the meantime ?

-- 
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: [2.6 patch] bonding/bond_main.c: fix cut'n'paste error

2007-10-24 Thread Jay Vosburgh


Adrian Bunk [EMAIL PROTECTED] wrote:
This patch fixes a cut'n'paste error in
commit 1b76b31693d4a6088dec104ff6a6ead54081a3c2.

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

Please apply.

-J

Acked-by: Jay Vosburgh [EMAIL PROTECTED]


---
4888742f8d7fe3b97fbc2911aa46375048173d01 
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e5fab4b..6937ef0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3682,7 +3682,7 @@ static int bond_open(struct net_device *bond_dev)
   }

   if (bond-params.mode == BOND_MODE_8023AD) {
-  INIT_DELAYED_WORK(bond-ad_work, bond_alb_monitor);
+  INIT_DELAYED_WORK(bond-ad_work, 
bond_3ad_state_machine_handler);
   queue_delayed_work(bond-wq, bond-ad_work, 0);
   /* register to receive LACPDUs */
   bond_register_lacpdu(bond);

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


Re: [PATCH 1/3] [IPSEC]: Forbid BEET + ipcomp for now

2007-10-24 Thread Herbert Xu
On Wed, Oct 24, 2007 at 05:41:34PM +0200, Nicolas Dichtel wrote:

 +x-props.header_len = 0;
 +switch (x-props.mode) {
 +case XFRM_MODE_TRANSPORT:
 +break;
 +case XFRM_MODE_TUNNEL:
 +x-props.header_len += sizeof(struct iphdr);
 I think, the break statement is missing, is it ?

Indeed it is.  I'm going to fix this and repost all 3 patches.

Thanks,
-- 
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
-
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: stateless 1:1 NAT

2007-10-24 Thread Herbert Xu
Florin Andrei [EMAIL PROTECTED] wrote:

 OK, if I download 2.6.24-rc1, will it have this feature already?

Yes.

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
-
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] napi: use non-interruptible sleep in napi_disable

2007-10-24 Thread Benjamin Herrenschmidt
The current napi_disable() uses msleep_interruptible() but doesn't
(and can't) exit in case there's a signal, thus ending up doing a
hot spin without a cpu_relax. Use uninterruptible sleep instead.

Signed-off-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
---

 include/linux/netdevice.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-work/include/linux/netdevice.h
===
--- linux-work.orig/include/linux/netdevice.h   2007-10-17 12:39:16.0 
+1000
+++ linux-work/include/linux/netdevice.h2007-10-17 12:45:00.0 
+1000
@@ -390,7 +390,7 @@ static inline void napi_complete(struct 
 static inline void napi_disable(struct napi_struct *n)
 {
while (test_and_set_bit(NAPI_STATE_SCHED, n-state))
-   msleep_interruptible(1);
+   msleep(1);
 }
 
 /**
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


QUESTION: How to fix race between .suspend routine and watchdog timer

2007-10-24 Thread Maxim Levitsky
Hi,

Recently, trying to fix saa7134 suspend/resume problems I found that there 
is a race between IRQ handler and .suspend , and that I cant let driver access 
the device
while its in D3 since it can lock up some systems.

Now I am looking to fix those issues in two drivers that have my 
.suspend/.resume routines.
the saa7134 capture chip and dmfe, the davicom network driver.

Looking through the dmfe code, I noticed yet another possible race.
A race between the .suspend, and a timer that serves both as a watchdog, and 
link state detector.
Again I need to prevent it from running during the suspend/resume, but how?

I can use del_timer in .suspend, and mod_timer in .resume, but that doesn't 
protect against
race with already running timer.
I can use del_timer_sync, but it states that it is useless if timer re-enables 
itself, and I agree with that.
In dmfe case the timer does re-enable itself.

I can put checks in the timer for -insuspend, and don't re enable it if set,
but that opens a new can of worms with memory barriers, etc...

So please tell me how properly to do that.

By the way, this problem, together with synchronize_irq it very generic, since 
most drivers
have and irq handler, and a timeout timer.

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] napi: use non-interruptible sleep in napi_disable

2007-10-24 Thread Jeff Garzik

Benjamin Herrenschmidt wrote:

The current napi_disable() uses msleep_interruptible() but doesn't
(and can't) exit in case there's a signal, thus ending up doing a
hot spin without a cpu_relax. Use uninterruptible sleep instead.

Signed-off-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
---

 include/linux/netdevice.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-work/include/linux/netdevice.h
===
--- linux-work.orig/include/linux/netdevice.h   2007-10-17 12:39:16.0 
+1000
+++ linux-work/include/linux/netdevice.h2007-10-17 12:45:00.0 
+1000
@@ -390,7 +390,7 @@ static inline void napi_complete(struct 
 static inline void napi_disable(struct napi_struct *n)

 {
while (test_and_set_bit(NAPI_STATE_SCHED, n-state))
-   msleep_interruptible(1);
+   msleep(1);
 }


ACK


-
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