[patch 07/12] 3c509: bus registration fix

2006-03-08 Thread akpm

From: Andrew Morton [EMAIL PROTECTED]

- Don't call eisa_driver_unregister() if eisa_driver_register() failed.

- Properly propagate error values.

Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/3c509.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff -puN drivers/net/3c509.c~3c509-bus-registration-fix drivers/net/3c509.c
--- devel/drivers/net/3c509.c~3c509-bus-registration-fix2006-03-08 
00:05:52.0 -0800
+++ devel-akpm/drivers/net/3c509.c  2006-03-08 00:05:52.0 -0800
@@ -1574,6 +1574,7 @@ MODULE_LICENSE(GPL);
 
 static int __init el3_init_module(void)
 {
+   int ret = 0;
el3_cards = 0;
 
if (debug = 0)
@@ -1589,14 +1590,16 @@ static int __init el3_init_module(void)
}
 
 #ifdef CONFIG_EISA
-   if (eisa_driver_register (el3_eisa_driver)  0) {
-   eisa_driver_unregister (el3_eisa_driver);
-   }
+   ret = eisa_driver_register(el3_eisa_driver);
 #endif
 #ifdef CONFIG_MCA
-   mca_register_driver(el3_mca_driver);
+   {
+   int err = mca_register_driver(el3_mca_driver);
+   if (ret == 0)
+   ret = err;
+   }
 #endif
-   return 0;
+   return ret;
 }
 
 static void __exit el3_cleanup_module(void)
_
-
To unsubscribe from this list: send 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 12/12] de620: fix section mismatch warning

2006-03-08 Thread akpm

From: Sam Ravnborg [EMAIL PROTECTED]

In latest -mm de620 gave following warning:
WARNING: drivers/net/de620.o - Section mismatch: reference to  \
.init.text:de620_probe from .text between 'init_module' (at offset \
0x1682) and 'cleanup_module'

init_module() call de620_probe() which is declared __init.
Fix is to declare init_module() __init too.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/de620.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/de620.c~de620-fix-section-mismatch-warning 
drivers/net/de620.c
--- devel/drivers/net/de620.c~de620-fix-section-mismatch-warning
2006-03-08 00:05:57.0 -0800
+++ devel-akpm/drivers/net/de620.c  2006-03-08 00:05:57.0 -0800
@@ -1012,7 +1012,7 @@ static int __init read_eeprom(struct net
 #ifdef MODULE
 static struct net_device *de620_dev;
 
-int init_module(void)
+int __init init_module(void)
 {
de620_dev = de620_probe(-1);
if (IS_ERR(de620_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 02/12] 8139cp: register interrupt handler when net device is registered

2006-03-08 Thread akpm

From: Pierre Ossman [EMAIL PROTECTED]

Avoids missing interrupts if the interrupt mask gets out of sync.

The reason this patch is needed for me is that the resume function is
broken.  It enables interrupts unconditionally, but the interrupt handler
is only registered when the device is up.

I don't have enough knowledge about the driver to fix the resume function
so this patch will instead make sure that the interrupt handler is
registered at all times (which can be a nice safeguard even when the resume
function gets fixed).

(akpm: carry this in -mm pending a fix of the resume function)

Signed-off-by: Pierre Ossman [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/8139cp.c |   17 +++--
 1 files changed, 7 insertions(+), 10 deletions(-)

diff -puN 
drivers/net/8139cp.c~8139cp-register-interrupt-handler-when-net-device-is-registered
 drivers/net/8139cp.c
--- 
devel/drivers/net/8139cp.c~8139cp-register-interrupt-handler-when-net-device-is-registered
  2006-03-08 00:05:51.0 -0800
+++ devel-akpm/drivers/net/8139cp.c 2006-03-08 00:05:51.0 -0800
@@ -1201,20 +1201,11 @@ static int cp_open (struct net_device *d
 
cp_init_hw(cp);
 
-   rc = request_irq(dev-irq, cp_interrupt, SA_SHIRQ, dev-name, dev);
-   if (rc)
-   goto err_out_hw;
-
netif_carrier_off(dev);
mii_check_media(cp-mii_if, netif_msg_link(cp), TRUE);
netif_start_queue(dev);
 
return 0;
-
-err_out_hw:
-   cp_stop_hw(cp);
-   cp_free_rings(cp);
-   return rc;
 }
 
 static int cp_close (struct net_device *dev)
@@ -1235,7 +1226,6 @@ static int cp_close (struct net_device *
spin_unlock_irqrestore(cp-lock, flags);
 
synchronize_irq(dev-irq);
-   free_irq(dev-irq, dev);
 
cp_free_rings(cp);
return 0;
@@ -1819,6 +1809,10 @@ static int cp_init_one (struct pci_dev *
if (rc)
goto err_out_iomap;
 
+   rc = request_irq(dev-irq, cp_interrupt, SA_SHIRQ, dev-name, dev);
+   if (rc)
+   goto err_out_unreg;
+
printk (KERN_INFO %s: RTL-8139C+ at 0x%lx, 
%02x:%02x:%02x:%02x:%02x:%02x, 
IRQ %d\n,
@@ -1838,6 +1832,8 @@ static int cp_init_one (struct pci_dev *
 
return 0;
 
+err_out_unreg:
+   unregister_netdev(dev);
 err_out_iomap:
iounmap(regs);
 err_out_res:
@@ -1858,6 +1854,7 @@ static void cp_remove_one (struct pci_de
 
if (!dev)
BUG();
+   free_irq(dev-irq, dev);
unregister_netdev(dev);
iounmap(cp-regs);
if (cp-wol_enabled) pci_set_power_state (pdev, PCI_D0);
_
-
To unsubscribe from this list: send 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/12] ipw2200 warning fix

2006-03-08 Thread akpm

From: Andrew Morton [EMAIL PROTECTED]

drivers/net/wireless/ipw2200.c: In function `ipw_load':
drivers/net/wireless/ipw2200.c:3224: warning: `ucode_name' might be used 
uninitialized in this function
drivers/net/wireless/ipw2200.c:3225: warning: `fw_name' might be used 
uninitialized in this function

Cc: Jesse Brandeburg [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/wireless/ipw2200.c |4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)

diff -puN drivers/net/wireless/ipw2200.c~ipw2200-warning-fix 
drivers/net/wireless/ipw2200.c
--- devel/drivers/net/wireless/ipw2200.c~ipw2200-warning-fix2006-03-08 
00:05:51.0 -0800
+++ devel-akpm/drivers/net/wireless/ipw2200.c   2006-03-08 00:05:51.0 
-0800
@@ -3242,10 +3242,8 @@ static int ipw_load(struct ipw_priv *pri
break;
default:
rc = -EINVAL;
-   }
-
-   if (rc  0)
goto error;
+   }
 
if (!priv-rxq)
priv-rxq = ipw_rx_queue_alloc(priv);
_
-
To unsubscribe from this list: send 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 08/12] 3c509: use proper suspend/resume API

2006-03-08 Thread akpm

From: Pekka Enberg [EMAIL PROTECTED]

Convert 3c509 driver to use proper suspend/resume API instead of the
deprecated pm_register/pm_unregister.

Signed-off-by: Pekka Enberg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/3c509.c |   70 +-
 1 files changed, 23 insertions(+), 47 deletions(-)

diff -puN drivers/net/3c509.c~3c509-use-proper-suspend-resume-api 
drivers/net/3c509.c
--- devel/drivers/net/3c509.c~3c509-use-proper-suspend-resume-api   
2006-03-08 00:05:52.0 -0800
+++ devel-akpm/drivers/net/3c509.c  2006-03-08 00:05:52.0 -0800
@@ -100,6 +100,10 @@ static int max_interrupt_work = 10;
 static char versionA[] __initdata = DRV_NAME .c: DRV_VERSION   DRV_RELDATE 
 [EMAIL PROTECTED];
 static char versionB[] __initdata = 
http://www.scyld.com/network/3c509.html\n;;
 
+#if defined(CONFIG_PM)  (defined(CONFIG_MCA) || defined(CONFIG_EISA))
+#define EL3_SUSPEND
+#endif
+
 #ifdef EL3_DEBUG
 static int el3_debug = EL3_DEBUG;
 #else
@@ -174,9 +178,6 @@ struct el3_private {
/* skb send-queue */
int head, size;
struct sk_buff *queue[SKB_QUEUE_SIZE];
-#ifdef CONFIG_PM_LEGACY
-   struct pm_dev *pmdev;
-#endif
enum {
EL3_MCA,
EL3_PNP,
@@ -201,11 +202,15 @@ static void el3_tx_timeout (struct net_d
 static void el3_down(struct net_device *dev);
 static void el3_up(struct net_device *dev);
 static struct ethtool_ops ethtool_ops;
-#ifdef CONFIG_PM_LEGACY
-static int el3_suspend(struct pm_dev *pdev);
-static int el3_resume(struct pm_dev *pdev);
-static int el3_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void *data);
+#ifdef EL3_SUSPEND
+static int el3_suspend(struct device *, pm_message_t);
+static int el3_resume(struct device *);
+#else
+#define el3_suspend NULL
+#define el3_resume NULL
 #endif
+
+
 /* generic device remove for all device types */
 #if defined(CONFIG_EISA) || defined(CONFIG_MCA)
 static int el3_device_remove (struct device *device);
@@ -229,7 +234,9 @@ static struct eisa_driver el3_eisa_drive
.driver   = {
.name= 3c509,
.probe   = el3_eisa_probe,
-   .remove  = __devexit_p (el3_device_remove)
+   .remove  = __devexit_p (el3_device_remove),
+   .suspend = el3_suspend,
+   .resume  = el3_resume,
}
 };
 #endif
@@ -262,6 +269,8 @@ static struct mca_driver el3_mca_driver 
.bus = mca_bus_type,
.probe = el3_mca_probe,
.remove = __devexit_p(el3_device_remove),
+   .suspend = el3_suspend,
+   .resume  = el3_resume,
},
 };
 #endif /* CONFIG_MCA */
@@ -362,10 +371,6 @@ static void el3_common_remove (struct ne
struct el3_private *lp = netdev_priv(dev);
 
(void) lp;  /* Keep gcc quiet... */
-#ifdef CONFIG_PM_LEGACY
-   if (lp-pmdev)
-   pm_unregister(lp-pmdev);
-#endif
 #if defined(__ISAPNP__)
if (lp-type == EL3_PNP)
pnp_device_detach(to_pnp_dev(lp-dev));
@@ -572,16 +577,6 @@ no_pnp:
if (err)
goto out1;
 
-#ifdef CONFIG_PM_LEGACY
-   /* register power management */
-   lp-pmdev = pm_register(PM_ISA_DEV, card_idx, el3_pm_callback);
-   if (lp-pmdev) {
-   struct pm_dev *p;
-   p = lp-pmdev;
-   p-data = (struct net_device *)dev;
-   }
-#endif
-
el3_cards++;
lp-next_dev = el3_root_dev;
el3_root_dev = dev;
@@ -1480,20 +1475,17 @@ el3_up(struct net_device *dev)
 }
 
 /* Power Management support functions */
-#ifdef CONFIG_PM_LEGACY
+#ifdef EL3_SUSPEND
 
 static int
-el3_suspend(struct pm_dev *pdev)
+el3_suspend(struct device *pdev, pm_message_t state)
 {
unsigned long flags;
struct net_device *dev;
struct el3_private *lp;
int ioaddr;

-   if (!pdev  !pdev-data)
-   return -EINVAL;
-
-   dev = (struct net_device *)pdev-data;
+   dev = pdev-driver_data;
lp = netdev_priv(dev);
ioaddr = dev-base_addr;
 
@@ -1510,17 +1502,14 @@ el3_suspend(struct pm_dev *pdev)
 }
 
 static int
-el3_resume(struct pm_dev *pdev)
+el3_resume(struct device *pdev)
 {
unsigned long flags;
struct net_device *dev;
struct el3_private *lp;
int ioaddr;

-   if (!pdev  !pdev-data)
-   return -EINVAL;
-
-   dev = (struct net_device *)pdev-data;
+   dev = pdev-driver_data;
lp = netdev_priv(dev);
ioaddr = dev-base_addr;
 
@@ -1536,20 +1525,7 @@ el3_resume(struct pm_dev *pdev)
return 0;
 }
 
-static int
-el3_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void 

[patch 01/12] tulip: NatSemi DP83840A PHY fix

2006-03-08 Thread akpm

From: Thibaut VARENE [EMAIL PROTECTED]

Fix a problem with Tulip 21142 HP branded PCI cards (PN#: B5509-66001),
which feature a NatSemi DP83840A PHY.

Without that patch, it is impossible to properly initialize the card's PHY,
and it's thus impossible to monitor/configure it.

It's a timing/posting problem, and it is solved exactly the same way Grant
fixed it elsewhere already.

Signed-off-by: Thibaut VARENE [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Acked-by: Grant Grundler [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/tulip/media.c |   18 +-
 1 files changed, 17 insertions(+), 1 deletion(-)

diff -puN drivers/net/tulip/media.c~tulip-natsemi-dp83840a-phy-fix 
drivers/net/tulip/media.c
--- devel/drivers/net/tulip/media.c~tulip-natsemi-dp83840a-phy-fix  
2006-03-08 00:05:50.0 -0800
+++ devel-akpm/drivers/net/tulip/media.c2006-03-08 00:05:50.0 
-0800
@@ -263,11 +263,27 @@ void tulip_select_media(struct net_devic
u16 *reset_sequence = 
((u16*)(p+3))[init_length];
int reset_length = p[2 + init_length*2];
misc_info = reset_sequence + reset_length;
-   if (startup)
+   if (startup) {
+   int timeout = 10;   /* max 1 ms */
for (i = 0; i  reset_length; i++)

iowrite32(get_u16(reset_sequence[i])  16, ioaddr + CSR15);
+
+   /* flush posted writes */
+   ioread32(ioaddr + CSR15);
+
+   /* Sect 3.10.3 in DP83840A.pdf (p39) */
+   udelay(500);
+
+   /* Section 4.2 in DP83840A.pdf (p43) */
+   /* and IEEE 802.3 22.2.4.1.1 Reset */
+   while (timeout-- 
+   (tulip_mdio_read (dev, phy_num, 
MII_BMCR)  BMCR_RESET))
+   udelay(100);
+   }
for (i = 0; i  init_length; i++)
iowrite32(get_u16(init_sequence[i])  
16, ioaddr + CSR15);
+
+   ioread32(ioaddr + CSR15);   /* flush posted 
writes */
} else {
u8 *init_sequence = p + 2;
u8 *reset_sequence = p + 3 + init_length;
_
-
To unsubscribe from this list: send 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 06/12] sky2: use mutex

2006-03-08 Thread akpm

From: Stephen Hemminger [EMAIL PROTECTED]

Convert sky2 driver phy semaphore to a mutex.

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

 drivers/net/sky2.c |   31 ---
 drivers/net/sky2.h |2 +-
 2 files changed, 17 insertions(+), 16 deletions(-)

diff -puN drivers/net/sky2.c~sky2-use-mutex drivers/net/sky2.c
--- devel/drivers/net/sky2.c~sky2-use-mutex 2006-03-08 00:05:52.0 
-0800
+++ devel-akpm/drivers/net/sky2.c   2006-03-08 00:05:52.0 -0800
@@ -28,6 +28,7 @@
 #include linux/kernel.h
 #include linux/version.h
 #include linux/module.h
+#include linux/mutex.h
 #include linux/netdevice.h
 #include linux/dma-mapping.h
 #include linux/etherdevice.h
@@ -504,9 +505,9 @@ static void sky2_phy_init(struct sky2_hw
 /* Force a renegotiation */
 static void sky2_phy_reinit(struct sky2_port *sky2)
 {
-   down(sky2-phy_sema);
+   mutex_lock(sky2-phy_mutex);
sky2_phy_init(sky2-hw, sky2-port);
-   up(sky2-phy_sema);
+   mutex_unlock(sky2-phy_mutex);
 }
 
 static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
@@ -571,9 +572,9 @@ static void sky2_mac_init(struct sky2_hw
 
sky2_read16(hw, SK_REG(port, GMAC_IRQ_SRC));
 
-   down(sky2-phy_sema);
+   mutex_lock(sky2-phy_mutex);
sky2_phy_init(hw, port);
-   up(sky2-phy_sema);
+   mutex_unlock(sky2-phy_mutex);
 
/* MIB clear */
reg = gma_read16(hw, port, GM_PHY_ADDR);
@@ -886,9 +887,9 @@ static int sky2_ioctl(struct net_device 
case SIOCGMIIREG: {
u16 val = 0;
 
-   down(sky2-phy_sema);
+   mutex_lock(sky2-phy_mutex);
err = __gm_phy_read(hw, sky2-port, data-reg_num  0x1f, val);
-   up(sky2-phy_sema);
+   mutex_unlock(sky2-phy_mutex);
 
data-val_out = val;
break;
@@ -898,10 +899,10 @@ static int sky2_ioctl(struct net_device 
if (!capable(CAP_NET_ADMIN))
return -EPERM;
 
-   down(sky2-phy_sema);
+   mutex_lock(sky2-phy_mutex);
err = gm_phy_write(hw, sky2-port, data-reg_num  0x1f,
   data-val_in);
-   up(sky2-phy_sema);
+   mutex_unlock(sky2-phy_mutex);
break;
}
return err;
@@ -1633,7 +1634,7 @@ static void sky2_phy_task(void *arg)
struct sky2_hw *hw = sky2-hw;
u16 istatus, phystat;
 
-   down(sky2-phy_sema);
+   mutex_lock(sky2-phy_mutex);
istatus = gm_phy_read(hw, sky2-port, PHY_MARV_INT_STAT);
phystat = gm_phy_read(hw, sky2-port, PHY_MARV_PHY_STAT);
 
@@ -1661,7 +1662,7 @@ static void sky2_phy_task(void *arg)
sky2_link_down(sky2);
}
 out:
-   up(sky2-phy_sema);
+   mutex_unlock(sky2-phy_mutex);
 
spin_lock_irq(hw-hw_lock);
hw-intr_mask |= (sky2-port == 0) ? Y2_IS_IRQ_PHY1 : Y2_IS_IRQ_PHY2;
@@ -2732,7 +2733,7 @@ static int sky2_phys_id(struct net_devic
ms = data * 1000;
 
/* save initial values */
-   down(sky2-phy_sema);
+   mutex_lock(sky2-phy_mutex);
if (hw-chip_id == CHIP_ID_YUKON_XL) {
u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
@@ -2748,9 +2749,9 @@ static int sky2_phys_id(struct net_devic
sky2_led(hw, port, onoff);
onoff = !onoff;
 
-   up(sky2-phy_sema);
+   mutex_unlock(sky2-phy_mutex);
interrupted = msleep_interruptible(250);
-   down(sky2-phy_sema);
+   mutex_lock(sky2-phy_mutex);
 
ms -= 250;
}
@@ -2765,7 +2766,7 @@ static int sky2_phys_id(struct net_devic
gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover);
}
-   up(sky2-phy_sema);
+   mutex_unlock(sky2-phy_mutex);
 
return 0;
 }
@@ -3078,7 +3079,7 @@ static __devinit struct net_device *sky2
sky2-rx_csum = (hw-chip_id != CHIP_ID_YUKON_XL);
 
INIT_WORK(sky2-phy_task, sky2_phy_task, sky2);
-   init_MUTEX(sky2-phy_sema);
+   mutex_init(sky2-phy_mutex);
sky2-tx_pending = TX_DEF_PENDING;
sky2-rx_pending = is_ec_a1(hw) ? 8 : RX_DEF_PENDING;
sky2-rx_bufsize = sky2_buf_size(ETH_DATA_LEN);
diff -puN drivers/net/sky2.h~sky2-use-mutex drivers/net/sky2.h
--- devel/drivers/net/sky2.h~sky2-use-mutex 2006-03-08 00:05:52.0 
-0800
+++ devel-akpm/drivers/net/sky2.h   2006-03-08 00:05:52.0 -0800
@@ -1870,7 +1870,7 @@ struct sky2_port {
struct net_device_stats net_stats;
 
struct work_struct   phy_task;
-   struct semaphore phy_sema;
+   struct mutex phy_mutex;
 };
 
 struct sky2_hw {
_
-
To unsubscribe from this list: 

[patch 09/12] tg3: netif_carrier_off runs too early; could still be queued when init fails

2006-03-08 Thread akpm

From: Jeff Mahoney [EMAIL PROTECTED]

Move the netif_carrier_off() call from tg3_init_one()-
tg3_init_link_config() to tg3_open() as is the convention for most other
network drivers.

I was getting a panic after a tg3 device failed to initialize due to DMA
failure.  The oops pointed to the link watch queue with spinlock debugging
enabled.  Without spinlock debugging, the Oops didn't occur.

I suspect that the link event was getting queued but not executed until
after the DMA test had failed and the device was freed.  The link event was
then operating on freed memory, which could contain anything.  With this
patch applied, the Oops no longer occurs.

Signed-off-by: Jeff Mahoney [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/tg3.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN 
drivers/net/tg3.c~tg3-netif_carrier_off-runs-too-early-could-still-be-queued-when-init-fails
 drivers/net/tg3.c
--- 
devel/drivers/net/tg3.c~tg3-netif_carrier_off-runs-too-early-could-still-be-queued-when-init-fails
  2006-03-08 00:05:53.0 -0800
+++ devel-akpm/drivers/net/tg3.c2006-03-08 00:05:53.0 -0800
@@ -6460,6 +6460,8 @@ static int tg3_open(struct net_device *d
struct tg3 *tp = netdev_priv(dev);
int err;
 
+   netif_carrier_off(tp-dev);
+
tg3_full_lock(tp, 0);
 
tg3_disable_ints(tp);
@@ -10456,7 +10458,6 @@ static void __devinit tg3_init_link_conf
tp-link_config.speed = SPEED_INVALID;
tp-link_config.duplex = DUPLEX_INVALID;
tp-link_config.autoneg = AUTONEG_ENABLE;
-   netif_carrier_off(tp-dev);
tp-link_config.active_speed = SPEED_INVALID;
tp-link_config.active_duplex = DUPLEX_INVALID;
tp-link_config.phy_is_low_power = 0;
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 03/12] via-rhine + link loss + autoneg off == trouble

2006-03-08 Thread akpm

From: Denis Vlasenko [EMAIL PROTECTED]

Fixes stuck carrier off condition when ethernet line speed/duplex
autonegotiation is turned off before cable is plugged in.

Signed-off-by: Denis Vlasenko [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Cc: Lee Revell [EMAIL PROTECTED]
Cc: Roger Luethi [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/mii.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN drivers/net/mii.c~via-rhine-link-loss-autoneg-off-==-trouble 
drivers/net/mii.c
--- devel/drivers/net/mii.c~via-rhine-link-loss-autoneg-off-==-trouble  
2006-03-08 00:05:51.0 -0800
+++ devel-akpm/drivers/net/mii.c2006-03-08 00:05:51.0 -0800
@@ -267,8 +267,10 @@ unsigned int mii_check_media (struct mii
int lpa2 = 0;
 
/* if forced media, go no further */
-   if (mii-force_media)
+   if (mii-force_media) {
+   netif_carrier_on(mii-dev);
return 0; /* duplex did not change */
+   }
 
/* check current and old link status */
old_carrier = netif_carrier_ok(mii-dev) ? 1 : 0;
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 05/12] drivers/net/e1000/: proper prototypes

2006-03-08 Thread akpm

From: Adrian Bunk [EMAIL PROTECTED]

This patch moves prototypes of global variables and functions to a header
file.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: John Ronciak [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000.h |   22 ++
 drivers/net/e1000/e1000_ethtool.c |   13 -
 drivers/net/e1000/e1000_main.c|   14 --
 3 files changed, 22 insertions(+), 27 deletions(-)

diff -puN drivers/net/e1000/e1000_ethtool.c~drivers-net-e1000-proper-prototypes 
drivers/net/e1000/e1000_ethtool.c
--- devel/drivers/net/e1000/e1000_ethtool.c~drivers-net-e1000-proper-prototypes 
2006-03-08 00:05:51.0 -0800
+++ devel-akpm/drivers/net/e1000/e1000_ethtool.c2006-03-08 
00:05:51.0 -0800
@@ -32,19 +32,6 @@
 
 #include asm/uaccess.h
 
-extern char e1000_driver_name[];
-extern char e1000_driver_version[];
-
-extern int e1000_up(struct e1000_adapter *adapter);
-extern void e1000_down(struct e1000_adapter *adapter);
-extern void e1000_reset(struct e1000_adapter *adapter);
-extern int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
-extern int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
-extern int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
-extern void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
-extern void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
-extern void e1000_update_stats(struct e1000_adapter *adapter);
-
 struct e1000_stats {
char stat_string[ETH_GSTRING_LEN];
int sizeof_stat;
diff -puN drivers/net/e1000/e1000.h~drivers-net-e1000-proper-prototypes 
drivers/net/e1000/e1000.h
--- devel/drivers/net/e1000/e1000.h~drivers-net-e1000-proper-prototypes 
2006-03-08 00:05:51.0 -0800
+++ devel-akpm/drivers/net/e1000/e1000.h2006-03-08 00:05:51.0 
-0800
@@ -339,4 +339,26 @@ struct e1000_adapter {
boolean_t tso_force;
 #endif
 };
+
+
+/*  e1000_main.c  */
+extern char e1000_driver_name[];
+extern char e1000_driver_version[];
+int e1000_up(struct e1000_adapter *adapter);
+void e1000_down(struct e1000_adapter *adapter);
+void e1000_reset(struct e1000_adapter *adapter);
+int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
+void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
+int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
+void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
+void e1000_update_stats(struct e1000_adapter *adapter);
+int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
+
+/*  e1000_ethtool.c  */
+void e1000_set_ethtool_ops(struct net_device *netdev);
+
+/*  e1000_param.c  */
+void e1000_check_options(struct e1000_adapter *adapter);
+
+
 #endif /* _E1000_H_ */
diff -puN drivers/net/e1000/e1000_main.c~drivers-net-e1000-proper-prototypes 
drivers/net/e1000/e1000_main.c
--- devel/drivers/net/e1000/e1000_main.c~drivers-net-e1000-proper-prototypes
2006-03-08 00:05:51.0 -0800
+++ devel-akpm/drivers/net/e1000/e1000_main.c   2006-03-08 00:05:51.0 
-0800
@@ -140,14 +140,6 @@ static struct pci_device_id e1000_pci_tb
 
 MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
 
-int e1000_up(struct e1000_adapter *adapter);
-void e1000_down(struct e1000_adapter *adapter);
-void e1000_reset(struct e1000_adapter *adapter);
-int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
-int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
-int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
-void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
-void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
 static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
 struct e1000_tx_ring *txdr);
 static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
@@ -156,7 +148,6 @@ static void e1000_free_tx_resources(stru
 struct e1000_tx_ring *tx_ring);
 static void e1000_free_rx_resources(struct e1000_adapter *adapter,
 struct e1000_rx_ring *rx_ring);
-void e1000_update_stats(struct e1000_adapter *adapter);
 
 /* Local Function Prototypes */
 
@@ -212,7 +203,6 @@ static void e1000_alloc_rx_buffers_ps(st
 static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
 static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
   int cmd);
-void e1000_set_ethtool_ops(struct net_device *netdev);
 static void e1000_enter_82542_rst(struct e1000_adapter *adapter);
 static void e1000_leave_82542_rst(struct e1000_adapter *adapter);
 static void e1000_tx_timeout(struct net_device *dev);
@@ -237,10 +227,6 @@ static void e1000_netpoll (struct net_de
 #endif
 
 
-/* Exported from other modules */
-
-extern void e1000_check_options(struct e1000_adapter *adapter);
-
 static struct 

[patch 10/12] CONFIG_FORCEDETH updates

2006-03-08 Thread akpm

From: Adrian Bunk [EMAIL PROTECTED]

This patch contains the following possible updates:
- let FORCEDETH no longer depend on EXPERIMENTAL
- remove the Reverse Engineered from the option text:
  for the user it's important which hardware the driver supports, not
  how it was developed

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/Kconfig |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/Kconfig~config_forcedeth-updates drivers/net/Kconfig
--- devel/drivers/net/Kconfig~config_forcedeth-updates  2006-03-08 
00:05:53.0 -0800
+++ devel-akpm/drivers/net/Kconfig  2006-03-08 00:05:53.0 -0800
@@ -1371,8 +1371,8 @@ config B44
  called b44.
 
 config FORCEDETH
-   tristate Reverse Engineered nForce Ethernet support (EXPERIMENTAL)
-   depends on NET_PCI  PCI  EXPERIMENTAL
+   tristate nForce Ethernet support
+   depends on NET_PCI  PCI
help
  If you have a network (Ethernet) controller of this type, say Y and
  read the Ethernet-HOWTO, available from
_
-
To unsubscribe from this list: send 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/18] sem2mutex: drivers/net/irda

2006-03-08 Thread akpm

From: Arjan van de Ven [EMAIL PROTECTED]

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/irda/irtty-sir.c  |   19 ++-
 drivers/net/irda/sir_dongle.c |   19 ++-
 2 files changed, 20 insertions(+), 18 deletions(-)

diff -puN drivers/net/irda/irtty-sir.c~sem2mutex-drivers-net-irda 
drivers/net/irda/irtty-sir.c
--- devel/drivers/net/irda/irtty-sir.c~sem2mutex-drivers-net-irda   
2006-03-08 00:08:47.0 -0800
+++ devel-akpm/drivers/net/irda/irtty-sir.c 2006-03-08 00:08:47.0 
-0800
@@ -33,6 +33,7 @@
 #include asm/uaccess.h
 #include linux/smp_lock.h
 #include linux/delay.h
+#include linux/mutex.h
 
 #include net/irda/irda.h
 #include net/irda/irda_device.h
@@ -338,7 +339,7 @@ static inline void irtty_stop_receiver(s
 /*/
 
 /* serialize ldisc open/close with sir_dev */
-static DECLARE_MUTEX(irtty_sem);
+static DEFINE_MUTEX(irtty_mutex);
 
 /* notifier from sir_dev when irda% device gets opened (ifup) */
 
@@ -348,11 +349,11 @@ static int irtty_start_dev(struct sir_de
struct tty_struct *tty;
 
/* serialize with ldisc open/close */
-   down(irtty_sem);
+   mutex_lock(irtty_mutex);
 
priv = dev-priv;
if (unlikely(!priv || priv-magic!=IRTTY_MAGIC)) {
-   up(irtty_sem);
+   mutex_unlock(irtty_mutex);
return -ESTALE;
}
 
@@ -363,7 +364,7 @@ static int irtty_start_dev(struct sir_de
/* Make sure we can receive more data */
irtty_stop_receiver(tty, FALSE);
 
-   up(irtty_sem);
+   mutex_unlock(irtty_mutex);
return 0;
 }
 
@@ -375,11 +376,11 @@ static int irtty_stop_dev(struct sir_dev
struct tty_struct *tty;
 
/* serialize with ldisc open/close */
-   down(irtty_sem);
+   mutex_lock(irtty_mutex);
 
priv = dev-priv;
if (unlikely(!priv || priv-magic!=IRTTY_MAGIC)) {
-   up(irtty_sem);
+   mutex_unlock(irtty_mutex);
return -ESTALE;
}
 
@@ -390,7 +391,7 @@ static int irtty_stop_dev(struct sir_dev
if (tty-driver-stop)
tty-driver-stop(tty);
 
-   up(irtty_sem);
+   mutex_unlock(irtty_mutex);
 
return 0;
 }
@@ -514,13 +515,13 @@ static int irtty_open(struct tty_struct 
priv-dev = dev;
 
/* serialize with start_dev - in case we were racing with ifup */
-   down(irtty_sem);
+   mutex_lock(irtty_mutex);
 
dev-priv = priv;
tty-disc_data = priv;
tty-receive_room = 65536;
 
-   up(irtty_sem);
+   mutex_unlock(irtty_mutex);
 
IRDA_DEBUG(0, %s - %s: irda line discipline opened\n, __FUNCTION__, 
tty-name);
 
diff -puN drivers/net/irda/sir_dongle.c~sem2mutex-drivers-net-irda 
drivers/net/irda/sir_dongle.c
--- devel/drivers/net/irda/sir_dongle.c~sem2mutex-drivers-net-irda  
2006-03-08 00:08:47.0 -0800
+++ devel-akpm/drivers/net/irda/sir_dongle.c2006-03-08 00:08:47.0 
-0800
@@ -16,6 +16,7 @@
 #include linux/init.h
 #include linux/smp_lock.h
 #include linux/kmod.h
+#include linux/mutex.h
 
 #include net/irda/irda.h
 
@@ -28,7 +29,7 @@
  */
 
 static LIST_HEAD(dongle_list); /* list of registered dongle 
drivers */
-static DECLARE_MUTEX(dongle_list_lock);/* protects the list */
+static DEFINE_MUTEX(dongle_list_lock); /* protects the list */
 
 int irda_register_dongle(struct dongle_driver *new)
 {
@@ -38,25 +39,25 @@ int irda_register_dongle(struct dongle_d
IRDA_DEBUG(0, %s : registering dongle \%s\ (%d).\n,
   __FUNCTION__, new-driver_name, new-type);
 
-   down(dongle_list_lock);
+   mutex_lock(dongle_list_lock);
list_for_each(entry, dongle_list) {
drv = list_entry(entry, struct dongle_driver, dongle_list);
if (new-type == drv-type) {
-   up(dongle_list_lock);
+   mutex_unlock(dongle_list_lock);
return -EEXIST;
}
}
list_add(new-dongle_list, dongle_list);
-   up(dongle_list_lock);
+   mutex_unlock(dongle_list_lock);
return 0;
 }
 EXPORT_SYMBOL(irda_register_dongle);
 
 int irda_unregister_dongle(struct dongle_driver *drv)
 {
-   down(dongle_list_lock);
+   mutex_lock(dongle_list_lock);
list_del(drv-dongle_list);
-   up(dongle_list_lock);
+   mutex_unlock(dongle_list_lock);
return 0;
 }
 EXPORT_SYMBOL(irda_unregister_dongle);
@@ -75,7 +76,7 @@ int sirdev_get_dongle(struct sir_dev *de
return -EBUSY;

/* serialize access to the 

[patch 01/18] git-net: remove MODULE_PARM()

2006-03-08 Thread akpm

From: Andrew Morton [EMAIL PROTECTED]

MODULE_PARM() is deprecated and is about to go away altogether.

Cc: David S. Miller [EMAIL PROTECTED]
Cc: Rusty Russell [EMAIL PROTECTED]
Cc: David Basden [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/irda/toim3232-sir.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff -puN drivers/net/irda/toim3232-sir.c~git-net-vs-remove-module_parm 
drivers/net/irda/toim3232-sir.c
--- devel/drivers/net/irda/toim3232-sir.c~git-net-vs-remove-module_parm 
2006-03-08 00:08:45.0 -0800
+++ devel-akpm/drivers/net/irda/toim3232-sir.c  2006-03-08 00:08:45.0 
-0800
@@ -125,18 +125,18 @@
 
 #include sir-dev.h
 
-MODULE_PARM(toim3232delay, i);
-MODULE_PARM_DESC(toim3232delay, toim3232 dongle write complete delay);
 static int toim3232delay = 150;/* default is 150 ms */
+module_param(toim3232delay, int, 0);
+MODULE_PARM_DESC(toim3232delay, toim3232 dongle write complete delay);
 
 #if 0
-MODULE_PARM(toim3232flipdtr, i);
-MODULE_PARM_DESC(toim3232flipdtr, toim3232 dongle invert DTR (Reset));
 static int toim3232flipdtr = 0;/* default is DTR high to reset */
+module_param(toim3232flipdtr, int, 0);
+MODULE_PARM_DESC(toim3232flipdtr, toim3232 dongle invert DTR (Reset));
 
-MODULE_PARM(toim3232fliptrs, i);
-MODULE_PARM_DESC(toim3232fliprts, toim3232 dongle invert RTS (BR/D));
 static int toim3232fliprts = 0;/* default is RTS high for baud change 
*/
+module_param(toim3232fliptrs, int, 0);
+MODULE_PARM_DESC(toim3232fliprts, toim3232 dongle invert RTS (BR/D));
 #endif
 
 static int toim3232_open(struct sir_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 06/18] sem2mutex: cassini

2006-03-08 Thread akpm

From: Ingo Molnar [EMAIL PROTECTED]

Semaphore to mutexes conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Cc: Ronald Bultje [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Cc: Yi Zhu [EMAIL PROTECTED]
Cc: James Ketrenos [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/cassini.c |   40 
 drivers/net/cassini.h |2 +-
 2 files changed, 21 insertions(+), 21 deletions(-)

diff -puN drivers/net/cassini.c~sem2mutex-cassini drivers/net/cassini.c
--- devel/drivers/net/cassini.c~sem2mutex-cassini   2006-03-08 
00:09:23.0 -0800
+++ devel-akpm/drivers/net/cassini.c2006-03-08 00:09:23.0 -0800
@@ -91,6 +91,7 @@
 #include linux/mii.h
 #include linux/ip.h
 #include linux/tcp.h
+#include linux/mutex.h
 
 #include net/checksum.h
 
@@ -3892,7 +3893,7 @@ static void cas_reset(struct cas *cp, in
spin_unlock(cp-stat_lock[N_TX_RINGS]);
 }
 
-/* Shut down the chip, must be called with pm_sem held.  */
+/* Shut down the chip, must be called with pm_mutex held.  */
 static void cas_shutdown(struct cas *cp)
 {
unsigned long flags;
@@ -4311,11 +4312,11 @@ static int cas_open(struct net_device *d
int hw_was_up, err;
unsigned long flags;
 
-   down(cp-pm_sem);
+   mutex_lock(cp-pm_mutex);
 
hw_was_up = cp-hw_running;
 
-   /* The power-management semaphore protects the hw_running
+   /* The power-management mutex protects the hw_running
 * etc. state so it is safe to do this bit without cp-lock
 */
if (!cp-hw_running) {
@@ -4364,7 +4365,7 @@ static int cas_open(struct net_device *d
cas_unlock_all_restore(cp, flags);
 
netif_start_queue(dev);
-   up(cp-pm_sem);
+   mutex_unlock(cp-pm_mutex);
return 0;
 
 err_spare:
@@ -4372,7 +4373,7 @@ err_spare:
cas_free_rxds(cp);
 err_tx_tiny:
cas_tx_tiny_free(cp);
-   up(cp-pm_sem);
+   mutex_unlock(cp-pm_mutex);
return err;
 }
 
@@ -4382,7 +4383,7 @@ static int cas_close(struct net_device *
struct cas *cp = netdev_priv(dev);
 
/* Make sure we don't get distracted by suspend/resume */
-   down(cp-pm_sem);
+   mutex_lock(cp-pm_mutex);
 
netif_stop_queue(dev);
 
@@ -4399,7 +4400,7 @@ static int cas_close(struct net_device *
cas_spare_free(cp);
cas_free_rxds(cp);
cas_tx_tiny_free(cp);
-   up(cp-pm_sem);
+   mutex_unlock(cp-pm_mutex);
return 0;
 }
 
@@ -4834,10 +4835,10 @@ static int cas_ioctl(struct net_device *
unsigned long flags;
int rc = -EOPNOTSUPP;

-   /* Hold the PM semaphore while doing ioctl's or we may collide
+   /* Hold the PM mutex while doing ioctl's or we may collide
 * with open/close and power management and oops.
 */
-   down(cp-pm_sem);
+   mutex_lock(cp-pm_mutex);
switch (cmd) {
case SIOCGMIIPHY:   /* Get address of MII PHY in use. */
data-phy_id = cp-phy_addr;
@@ -4867,7 +4868,7 @@ static int cas_ioctl(struct net_device *
break;
};
 
-   up(cp-pm_sem);
+   mutex_unlock(cp-pm_mutex);
return rc;
 }
 
@@ -4994,7 +4995,7 @@ static int __devinit cas_init_one(struct
spin_lock_init(cp-tx_lock[i]);
}
spin_lock_init(cp-stat_lock[N_TX_RINGS]);
-   init_MUTEX(cp-pm_sem);
+   mutex_init(cp-pm_mutex);
 
init_timer(cp-link_timer);
cp-link_timer.function = cas_link_timer;
@@ -5116,10 +5117,10 @@ err_out_free_consistent:
cp-init_block, cp-block_dvma);
 
 err_out_iounmap:
-   down(cp-pm_sem);
+   mutex_lock(cp-pm_mutex);
if (cp-hw_running)
cas_shutdown(cp);
-   up(cp-pm_sem);
+   mutex_unlock(cp-pm_mutex);
 
iounmap(cp-regs);
 
@@ -5152,11 +5153,11 @@ static void __devexit cas_remove_one(str
cp = netdev_priv(dev);
unregister_netdev(dev);
 
-   down(cp-pm_sem);
+   mutex_lock(cp-pm_mutex);
flush_scheduled_work();
if (cp-hw_running)
cas_shutdown(cp);
-   up(cp-pm_sem);
+   mutex_unlock(cp-pm_mutex);
 
 #if 1
if (cp-orig_cacheline_size) {
@@ -5183,10 +5184,7 @@ static int cas_suspend(struct pci_dev *p
struct cas *cp = netdev_priv(dev);
unsigned long flags;
 
-   /* We hold the PM semaphore during entire driver
-* sleep time
-*/
-   down(cp-pm_sem);
+   mutex_lock(cp-pm_mutex);

/* If the driver is opened, we stop the DMA */
if (cp-opened) {
@@ -5206,6 +5204,7 @@ static int cas_suspend(struct pci_dev *p
 
if (cp-hw_running)
cas_shutdown(cp);
+   mutex_unlock(cp-pm_mutex);
 
return 0;
 }
@@ 

[patch 15/18] x25: fix kernel error message 64 bit kernel

2006-03-08 Thread akpm

From: Shaun Pereira [EMAIL PROTECTED]

Fixes the following error from kernel
T2 kernel: schedule_timeout:
wrong timeout value  from 88164796

Signed-off-by: Shaun Pereira [EMAIL PROTECTED]
Acked-by: Arnd Bergmann [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 net/x25/af_x25.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN net/x25/af_x25.c~x25-fix-kernel-error-message-64-bit-kernel 
net/x25/af_x25.c
--- devel/net/x25/af_x25.c~x25-fix-kernel-error-message-64-bit-kernel   
2006-03-08 00:09:43.0 -0800
+++ devel-akpm/net/x25/af_x25.c 2006-03-08 00:09:43.0 -0800
@@ -744,7 +744,7 @@ out:
return rc;
 }
 
-static int x25_wait_for_data(struct sock *sk, int timeout)
+static int x25_wait_for_data(struct sock *sk, long timeout)
 {
DECLARE_WAITQUEUE(wait, current);
int rc = 0;
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 03/18] sem2mutex: net/

2006-03-08 Thread akpm

From: Arjan van de Ven [EMAIL PROTECTED]

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 include/net/xfrm.h |3 ++-
 net/atm/ioctl.c|   15 ---
 net/bluetooth/rfcomm/core.c|8 +---
 net/core/dev.c |7 ---
 net/core/flow.c|7 ---
 net/ipv4/ipcomp.c  |   17 +
 net/ipv4/netfilter/ip_queue.c  |   11 ++-
 net/ipv4/xfrm4_tunnel.c|   11 ++-
 net/ipv6/ipcomp6.c |   15 ---
 net/ipv6/netfilter/ip6_queue.c |   11 ++-
 net/ipv6/xfrm6_tunnel.c|   11 ++-
 net/key/af_key.c   |4 ++--
 net/netfilter/nf_sockopt.c |   25 +
 net/socket.c   |   31 ---
 net/sunrpc/cache.c |   17 +
 net/sunrpc/sched.c |   11 ++-
 net/unix/garbage.c |7 ---
 net/xfrm/xfrm_policy.c |4 ++--
 net/xfrm/xfrm_user.c   |4 ++--
 19 files changed, 118 insertions(+), 101 deletions(-)

diff -puN include/net/xfrm.h~sem2mutex-net include/net/xfrm.h
--- devel/include/net/xfrm.h~sem2mutex-net  2006-03-08 00:08:47.0 
-0800
+++ devel-akpm/include/net/xfrm.h   2006-03-08 00:08:47.0 -0800
@@ -11,6 +11,7 @@
 #include linux/crypto.h
 #include linux/pfkeyv2.h
 #include linux/in6.h
+#include linux/mutex.h
 
 #include net/sock.h
 #include net/dst.h
@@ -24,7 +25,7 @@ extern struct sock *xfrm_nl;
 extern u32 sysctl_xfrm_aevent_etime;
 extern u32 sysctl_xfrm_aevent_rseqth;
 
-extern struct semaphore xfrm_cfg_sem;
+extern struct mutex xfrm_cfg_mutex;
 
 /* Organization of SPD aka XFRM rules

diff -puN net/atm/ioctl.c~sem2mutex-net net/atm/ioctl.c
--- devel/net/atm/ioctl.c~sem2mutex-net 2006-03-08 00:08:47.0 -0800
+++ devel-akpm/net/atm/ioctl.c  2006-03-08 00:08:47.0 -0800
@@ -18,6 +18,7 @@
 #include linux/atmmpc.h
 #include net/atmclip.h
 #include linux/atmlec.h
+#include linux/mutex.h
 #include asm/ioctls.h
 
 #include resources.h
@@ -25,22 +26,22 @@
 #include common.h
 
 
-static DECLARE_MUTEX(ioctl_mutex);
+static DEFINE_MUTEX(ioctl_mutex);
 static LIST_HEAD(ioctl_list);
 
 
 void register_atm_ioctl(struct atm_ioctl *ioctl)
 {
-   down(ioctl_mutex);
+   mutex_lock(ioctl_mutex);
list_add_tail(ioctl-list, ioctl_list);
-   up(ioctl_mutex);
+   mutex_unlock(ioctl_mutex);
 }
 
 void deregister_atm_ioctl(struct atm_ioctl *ioctl)
 {
-   down(ioctl_mutex);
+   mutex_lock(ioctl_mutex);
list_del(ioctl-list);
-   up(ioctl_mutex);
+   mutex_unlock(ioctl_mutex);
 }
 
 EXPORT_SYMBOL(register_atm_ioctl);
@@ -137,7 +138,7 @@ int vcc_ioctl(struct socket *sock, unsig
 
error = -ENOIOCTLCMD;
 
-   down(ioctl_mutex);
+   mutex_lock(ioctl_mutex);
list_for_each(pos, ioctl_list) {
struct atm_ioctl * ic = list_entry(pos, struct atm_ioctl, list);
if (try_module_get(ic-owner)) {
@@ -147,7 +148,7 @@ int vcc_ioctl(struct socket *sock, unsig
break;
}
}
-   up(ioctl_mutex);
+   mutex_unlock(ioctl_mutex);
 
if (error != -ENOIOCTLCMD)
goto done;
diff -puN net/bluetooth/rfcomm/core.c~sem2mutex-net net/bluetooth/rfcomm/core.c
--- devel/net/bluetooth/rfcomm/core.c~sem2mutex-net 2006-03-08 
00:08:47.0 -0800
+++ devel-akpm/net/bluetooth/rfcomm/core.c  2006-03-08 00:08:47.0 
-0800
@@ -37,6 +37,8 @@
 #include linux/wait.h
 #include linux/device.h
 #include linux/net.h
+#include linux/mutex.h
+
 #include net/sock.h
 #include asm/uaccess.h
 #include asm/unaligned.h
@@ -57,9 +59,9 @@ static unsigned int l2cap_mtu = RFCOMM_M
 
 static struct task_struct *rfcomm_thread;
 
-static DECLARE_MUTEX(rfcomm_sem);
-#define rfcomm_lock()  down(rfcomm_sem);
-#define rfcomm_unlock()up(rfcomm_sem);
+static DEFINE_MUTEX(rfcomm_mutex);
+#define rfcomm_lock()  mutex_lock(rfcomm_mutex)
+#define rfcomm_unlock()mutex_unlock(rfcomm_mutex)
 
 static unsigned long rfcomm_event;
 
diff -puN net/core/dev.c~sem2mutex-net net/core/dev.c
--- devel/net/core/dev.c~sem2mutex-net  2006-03-08 00:08:47.0 -0800
+++ devel-akpm/net/core/dev.c   2006-03-08 00:08:47.0 -0800
@@ -81,6 +81,7 @@
 #include linux/types.h
 #include linux/kernel.h
 #include linux/sched.h
+#include linux/mutex.h
 #include linux/string.h
 #include linux/mm.h
 #include linux/socket.h
@@ -2938,7 +2939,7 @@ static void netdev_wait_allrefs(struct n
  * 2) Since we run with the RTNL semaphore not held, we can 

[patch 04/18] sem2mutex: sungem

2006-03-08 Thread akpm

From: Ingo Molnar [EMAIL PROTECTED]

Semaphore to mutexes conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Cc: Ronald Bultje [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Cc: Yi Zhu [EMAIL PROTECTED]
Cc: James Ketrenos [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/sungem.c |   37 +++--
 drivers/net/sungem.h |6 +++---
 2 files changed, 22 insertions(+), 21 deletions(-)

diff -puN drivers/net/sungem.c~sem2mutex-sungem drivers/net/sungem.c
--- devel/drivers/net/sungem.c~sem2mutex-sungem 2006-03-08 00:08:48.0 
-0800
+++ devel-akpm/drivers/net/sungem.c 2006-03-08 00:08:48.0 -0800
@@ -55,6 +55,7 @@
 #include linux/workqueue.h
 #include linux/if_vlan.h
 #include linux/bitops.h
+#include linux/mutex.h
 
 #include asm/system.h
 #include asm/io.h
@@ -2284,7 +2285,7 @@ static void gem_reset_task(void *data)
 {
struct gem *gp = (struct gem *) data;
 
-   down(gp-pm_sem);
+   mutex_lock(gp-pm_mutex);
 
netif_poll_disable(gp-dev);
 
@@ -2311,7 +2312,7 @@ static void gem_reset_task(void *data)
 
netif_poll_enable(gp-dev);
 
-   up(gp-pm_sem);
+   mutex_unlock(gp-pm_mutex);
 }
 
 
@@ -2320,14 +2321,14 @@ static int gem_open(struct net_device *d
struct gem *gp = dev-priv;
int rc = 0;
 
-   down(gp-pm_sem);
+   mutex_lock(gp-pm_mutex);
 
/* We need the cell enabled */
if (!gp-asleep)
rc = gem_do_start(dev);
gp-opened = (rc == 0);
 
-   up(gp-pm_sem);
+   mutex_unlock(gp-pm_mutex);
 
return rc;
 }
@@ -2340,13 +2341,13 @@ static int gem_close(struct net_device *
 * our caller (dev_close) already did it for us
 */
 
-   down(gp-pm_sem);
+   mutex_lock(gp-pm_mutex);
 
gp-opened = 0; 
if (!gp-asleep)
gem_do_stop(dev, 0);
 
-   up(gp-pm_sem);
+   mutex_unlock(gp-pm_mutex);

return 0;
 }
@@ -2358,7 +2359,7 @@ static int gem_suspend(struct pci_dev *p
struct gem *gp = dev-priv;
unsigned long flags;
 
-   down(gp-pm_sem);
+   mutex_lock(gp-pm_mutex);
 
netif_poll_disable(dev);
 
@@ -2391,11 +2392,11 @@ static int gem_suspend(struct pci_dev *p
/* Stop the link timer */
del_timer_sync(gp-link_timer);
 
-   /* Now we release the semaphore to not block the reset task who
+   /* Now we release the mutex to not block the reset task who
 * can take it too. We are marked asleep, so there will be no
 * conflict here
 */
-   up(gp-pm_sem);
+   mutex_unlock(gp-pm_mutex);
 
/* Wait for a pending reset task to complete */
while (gp-reset_task_pending)
@@ -2424,7 +2425,7 @@ static int gem_resume(struct pci_dev *pd
 
printk(KERN_INFO %s: resuming\n, dev-name);
 
-   down(gp-pm_sem);
+   mutex_lock(gp-pm_mutex);
 
/* Keep the cell enabled during the entire operation, no need to
 * take a lock here tho since nothing else can happen while we are
@@ -2440,7 +2441,7 @@ static int gem_resume(struct pci_dev *pd
 * still asleep, a new sleep cycle may bring it back
 */
gem_put_cell(gp);
-   up(gp-pm_sem);
+   mutex_unlock(gp-pm_mutex);
return 0;
}
pci_set_master(gp-pdev);
@@ -2486,7 +2487,7 @@ static int gem_resume(struct pci_dev *pd
 
netif_poll_enable(dev);

-   up(gp-pm_sem);
+   mutex_unlock(gp-pm_mutex);
 
return 0;
 }
@@ -2591,7 +2592,7 @@ static int gem_change_mtu(struct net_dev
return 0;
}
 
-   down(gp-pm_sem);
+   mutex_lock(gp-pm_mutex);
spin_lock_irq(gp-lock);
spin_lock(gp-tx_lock);
dev-mtu = new_mtu;
@@ -2602,7 +2603,7 @@ static int gem_change_mtu(struct net_dev
}
spin_unlock(gp-tx_lock);
spin_unlock_irq(gp-lock);
-   up(gp-pm_sem);
+   mutex_unlock(gp-pm_mutex);
 
return 0;
 }
@@ -2771,10 +2772,10 @@ static int gem_ioctl(struct net_device *
int rc = -EOPNOTSUPP;
unsigned long flags;
 
-   /* Hold the PM semaphore while doing ioctl's or we may collide
+   /* Hold the PM mutex while doing ioctl's or we may collide
 * with power management.
 */
-   down(gp-pm_sem);
+   mutex_lock(gp-pm_mutex);

spin_lock_irqsave(gp-lock, flags);
gem_get_cell(gp);
@@ -2812,7 +2813,7 @@ static int gem_ioctl(struct net_device *
gem_put_cell(gp);
spin_unlock_irqrestore(gp-lock, flags);
 
-   up(gp-pm_sem);
+   mutex_unlock(gp-pm_mutex);

return rc;
 }
@@ -3033,7 +3034,7 @@ static int __devinit gem_init_one(struct
 

[patch 12/18] net: allow 32 bit socket ioctl in 64 bit kernel

2006-03-08 Thread akpm

From: Shaun Pereira [EMAIL PROTECTED]

Since the register_ioctl32_conversion() patch in the kernel is now obsolete,
provide another method to allow 32 bit user space ioctls to reach the kernel.

Signed-off-by: Shaun Pereira [EMAIL PROTECTED]
Acked-by: Arnd Bergmann [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 include/linux/net.h |6 ++
 net/socket.c|   21 +
 2 files changed, 27 insertions(+)

diff -puN include/linux/net.h~net-allow-32-bit-socket-ioctl-in-64-bit-kernel 
include/linux/net.h
--- devel/include/linux/net.h~net-allow-32-bit-socket-ioctl-in-64-bit-kernel
2006-03-08 00:09:39.0 -0800
+++ devel-akpm/include/linux/net.h  2006-03-08 00:09:40.0 -0800
@@ -143,6 +143,8 @@ struct proto_ops {
  struct poll_table_struct *wait);
int (*ioctl) (struct socket *sock, unsigned int cmd,
  unsigned long arg);
+   int (*compat_ioctl) (struct socket *sock, unsigned int cmd,
+ unsigned long arg);
int (*listen)(struct socket *sock, int len);
int (*shutdown)  (struct socket *sock, int flags);
int (*setsockopt)(struct socket *sock, int level,
@@ -247,6 +249,8 @@ SOCKCALL_UWRAP(name, poll, (struct file 
  (file, sock, wait)) \
 SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \
 unsigned long arg), (sock, cmd, arg)) \
+SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \
+unsigned long arg), (sock, cmd, arg)) \
 SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \
 SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) 
\
 SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \
@@ -271,6 +275,7 @@ static const struct proto_ops name##_ops
.getname= __lock_##name##_getname,  \
.poll   = __lock_##name##_poll, \
.ioctl  = __lock_##name##_ioctl,\
+   .compat_ioctl   = __lock_##name##_compat_ioctl, \
.listen = __lock_##name##_listen,   \
.shutdown   = __lock_##name##_shutdown, \
.setsockopt = __lock_##name##_setsockopt,   \
@@ -279,6 +284,7 @@ static const struct proto_ops name##_ops
.recvmsg= __lock_##name##_recvmsg,  \
.mmap   = __lock_##name##_mmap, \
 };
+
 #endif
 
 #define MODULE_ALIAS_NETPROTO(proto) \
diff -puN net/socket.c~net-allow-32-bit-socket-ioctl-in-64-bit-kernel 
net/socket.c
--- devel/net/socket.c~net-allow-32-bit-socket-ioctl-in-64-bit-kernel   
2006-03-08 00:09:39.0 -0800
+++ devel-akpm/net/socket.c 2006-03-08 00:09:40.0 -0800
@@ -107,6 +107,10 @@ static unsigned int sock_poll(struct fil
  struct poll_table_struct *wait);
 static long sock_ioctl(struct file *file,
  unsigned int cmd, unsigned long arg);
+#ifdef CONFIG_COMPAT
+static long compat_sock_ioctl(struct file *file,
+ unsigned int cmd, unsigned long arg);
+#endif
 static int sock_fasync(int fd, struct file *filp, int on);
 static ssize_t sock_readv(struct file *file, const struct iovec *vector,
  unsigned long count, loff_t *ppos);
@@ -128,6 +132,9 @@ static struct file_operations socket_fil
.aio_write =sock_aio_write,
.poll = sock_poll,
.unlocked_ioctl = sock_ioctl,
+#ifdef CONFIG_COMPAT
+   .compat_ioctl = compat_sock_ioctl,
+#endif
.mmap = sock_mmap,
.open = sock_no_open,   /* special open code to disallow open 
via /proc */
.release =  sock_close,
@@ -2136,6 +2143,20 @@ void socket_seq_show(struct seq_file *se
 }
 #endif /* CONFIG_PROC_FS */
 
+#ifdef CONFIG_COMPAT
+static long compat_sock_ioctl(struct file *file, unsigned cmd,
+   unsigned long arg)
+{
+   struct socket *sock = file-private_data;
+   int ret = -ENOIOCTLCMD;
+
+   if (sock-ops-compat_ioctl)
+   ret = sock-ops-compat_ioctl(sock, cmd, arg);
+
+   return ret;
+}
+#endif
+
 /* ABI emulation layers need these two */
 EXPORT_SYMBOL(move_addr_to_kernel);
 EXPORT_SYMBOL(move_addr_to_user);
_
-
To unsubscribe from this list: send 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 09/18] suni: cast arg properly in SONET_SETFRAMING

2006-03-08 Thread akpm

From: Alexey Dobriyan [EMAIL PROTECTED]

Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

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

diff -puN drivers/atm/suni.c~suni-cast-arg-properly-in-sonet_setframing 
drivers/atm/suni.c
--- devel/drivers/atm/suni.c~suni-cast-arg-properly-in-sonet_setframing 
2006-03-08 00:09:36.0 -0800
+++ devel-akpm/drivers/atm/suni.c   2006-03-08 00:09:36.0 -0800
@@ -188,7 +188,7 @@ static int suni_ioctl(struct atm_dev *de
case SONET_GETDIAG:
return get_diag(dev,arg);
case SONET_SETFRAMING:
-   if (arg != SONET_FRAME_SONET) return -EINVAL;
+   if ((int)(unsigned long)arg != SONET_FRAME_SONET) 
return -EINVAL;
return 0;
case SONET_GETFRAMING:
return put_user(SONET_FRAME_SONET,(int __user *)arg) ?
_
-
To unsubscribe from this list: send 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 08/18] happymeal: add pci probing

2006-03-08 Thread akpm

From: Jiri Slaby [EMAIL PROTECTED]

Pci probing functions added, some functions were rewritten.  Use PCI_DEVICE
macro.

Signed-off-by: Jiri Slaby [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/sunhme.c |   79 -
 1 files changed, 55 insertions(+), 24 deletions(-)

diff -puN drivers/net/sunhme.c~happtmeal-add-pci-probing drivers/net/sunhme.c
--- devel/drivers/net/sunhme.c~happtmeal-add-pci-probing2006-03-08 
00:09:31.0 -0800
+++ devel-akpm/drivers/net/sunhme.c 2006-03-08 00:09:31.0 -0800
@@ -3013,7 +3013,7 @@ static void get_hme_mac_nonsparc(struct 
 }
 #endif /* !(__sparc__) */
 
-static int __init happy_meal_pci_init(struct pci_dev *pdev)
+static int __devinit happy_meal_pci_init(struct pci_dev *pdev)
 {
struct quattro *qp = NULL;
 #ifdef __sparc__
@@ -3073,6 +3073,7 @@ static int __init happy_meal_pci_init(st
memset(hp, 0, sizeof(*hp));
 
hp-happy_dev = pdev;
+   pci_dev_get(pdev);
 
spin_lock_init(hp-happy_lock);
 
@@ -3260,6 +3261,7 @@ err_out_free_res:
pci_release_regions(pdev);
 
 err_out_clear_quattro:
+   pci_dev_put(pdev);
if (qp != NULL)
qp-happy_meals[qfe_slot] = NULL;
 
@@ -3304,21 +3306,58 @@ static int __init happy_meal_sbus_probe(
 #endif
 
 #ifdef CONFIG_PCI
-static int __init happy_meal_pci_probe(void)
+static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
+   const struct pci_device_id *id)
 {
-   struct pci_dev *pdev = NULL;
-   int cards = 0;
+   int retval;
+
+   retval = pci_enable_device(pdev);
+   if (retval  0)
+   goto err;
+
+   pci_set_master(pdev);
+   happy_meal_pci_init(pdev);
+
+   return 0;
+err:
+   return retval;
+}
 
-   while ((pdev = pci_find_device(PCI_VENDOR_ID_SUN,
-  PCI_DEVICE_ID_SUN_HAPPYMEAL, pdev)) != 
NULL) {
-   if (pci_enable_device(pdev))
-   continue;
-   pci_set_master(pdev);
-   cards++;
-   happy_meal_pci_init(pdev);
+static void __devexit happy_meal_pci_remove(struct pci_dev *pdev)
+{
+   struct quattro *tmp, *qp = qfe_pci_list;
+   struct pci_dev *bdev = pdev-bus-self;
+
+   if (qp-quattro_dev == bdev) { /* is it the 1st one? */
+   qfe_pci_list = qp-next;
+   kfree(qp);
+   goto end;
}
-   return cards;
+
+   for (; qp-next != NULL; qp = qp-next) /* some further? */
+   if (qp-next-quattro_dev == bdev)
+   break;
+
+   tmp = qp-next; /* kill it, but preserve list */
+   qp-next = qp-next-next;
+   kfree(tmp);
+end:
+   pci_dev_put(pdev);
 }
+
+static struct pci_device_id happy_meal_pci_tbl[] = {
+   { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
+   { 0 }
+};
+MODULE_DEVICE_TABLE(pci, happy_meal_pci_tbl);
+
+static struct pci_driver happy_meal_pci_driver = {
+   .name   = happy_meal_pci,
+   .id_table   = happy_meal_pci_tbl,
+   .probe  = happy_meal_pci_probe,
+   .remove = __devexit_p(happy_meal_pci_remove)
+};
+
 #endif
 
 static int __init happy_meal_probe(void)
@@ -3337,11 +3376,10 @@ static int __init happy_meal_probe(void)
cards += happy_meal_sbus_probe();
 #endif
 #ifdef CONFIG_PCI
-   cards += happy_meal_pci_probe();
+   return pci_register_driver(happy_meal_pci_driver);
+#else
+   return cards ? 0 : -ENODEV;
 #endif
-   if (!cards)
-   return -ENODEV;
-   return 0;
 }
 
 
@@ -3408,14 +3446,7 @@ static void __exit happy_meal_cleanup_mo
}
 #endif
 #ifdef CONFIG_PCI
-   while (qfe_pci_list) {
-   struct quattro *qfe = qfe_pci_list;
-   struct quattro *next = qfe-next;
-
-   kfree(qfe);
-
-   qfe_pci_list = next;
-   }
+   pci_unregister_driver(happy_meal_pci_driver);
 #endif
 }
 
_
-
To unsubscribe from this list: send 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 07/18] sem2mutex: net/, #2

2006-03-08 Thread akpm

From: Ingo Molnar [EMAIL PROTECTED]

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

(akpm: something went wrong with this patch.  Might need redoing)

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 include/linux/sunrpc/svcsock.h|2 
 include/net/af_unix.h |3 
 net/atm/common.c  |4 -
 net/atm/resources.c   |   32 +
 net/atm/resources.h   |3 
 net/bridge/netfilter/ebtables.c   |   91 ++--
 net/ipv4/ipvs/ip_vs_app.c |   19 +++--
 net/ipv4/netfilter/arp_tables.c   |2 
 net/ipv4/netfilter/ip_tables.c|2 
 net/ipv6/netfilter/ip6_tables.c   |2 
 net/netfilter/nf_conntrack_core.c |   16 ++--
 net/sunrpc/svcsock.c  |8 +-
 net/unix/af_unix.c|   22 +++---
 13 files changed, 107 insertions(+), 99 deletions(-)

diff -puN include/linux/sunrpc/svcsock.h~sem2mutex-net-2 
include/linux/sunrpc/svcsock.h
--- devel/include/linux/sunrpc/svcsock.h~sem2mutex-net-22006-03-08 
00:09:25.0 -0800
+++ devel-akpm/include/linux/sunrpc/svcsock.h   2006-03-08 00:09:25.0 
-0800
@@ -36,7 +36,7 @@ struct svc_sock {
 
struct list_headsk_deferred;/* deferred requests that need 
to
 * be revisted */
-   struct semaphoresk_sem; /* to serialize sending data */
+   struct mutexsk_mutex;   /* to serialize sending data */
 
int (*sk_recvfrom)(struct svc_rqst *rqstp);
int (*sk_sendto)(struct svc_rqst *rqstp);
diff -puN include/net/af_unix.h~sem2mutex-net-2 include/net/af_unix.h
--- devel/include/net/af_unix.h~sem2mutex-net-2 2006-03-08 00:09:25.0 
-0800
+++ devel-akpm/include/net/af_unix.h2006-03-08 00:09:25.0 -0800
@@ -4,6 +4,7 @@
 #include linux/config.h
 #include linux/socket.h
 #include linux/un.h
+#include linux/mutex.h
 #include net/sock.h
 
 extern void unix_inflight(struct file *fp);
@@ -71,7 +72,7 @@ struct unix_sock {
 struct unix_address *addr;
 struct dentry  *dentry;
 struct vfsmount*mnt;
-struct semaphorereadsem;
+   struct mutexreadlock;
 struct sock*peer;
 struct sock*other;
 struct sock*gc_tree;
diff -puN net/atm/common.c~sem2mutex-net-2 net/atm/common.c
--- devel/net/atm/common.c~sem2mutex-net-2  2006-03-08 00:09:25.0 
-0800
+++ devel-akpm/net/atm/common.c 2006-03-08 00:09:25.0 -0800
@@ -451,12 +451,12 @@ int vcc_connect(struct socket *sock, int
dev = try_then_request_module(atm_dev_lookup(itf), 
atm-device-%d, itf);
} else {
dev = NULL;
-   down(atm_dev_mutex);
+   mutex_lock(atm_dev_mutex);
if (!list_empty(atm_devs)) {
dev = list_entry(atm_devs.next, struct atm_dev, 
dev_list);
atm_dev_hold(dev);
}
-   up(atm_dev_mutex);
+   mutex_unlock(atm_dev_mutex);
}
if (!dev)
return -ENODEV;
diff -puN net/atm/resources.c~sem2mutex-net-2 net/atm/resources.c
--- devel/net/atm/resources.c~sem2mutex-net-2   2006-03-08 00:09:25.0 
-0800
+++ devel-akpm/net/atm/resources.c  2006-03-08 00:09:25.0 -0800
@@ -18,6 +18,8 @@
 #include linux/bitops.h
 #include linux/capability.h
 #include linux/delay.h
+#include linux/mutex.h
+
 #include net/sock.h   /* for struct sock */
 
 #include common.h
@@ -26,7 +28,7 @@
 
 
 LIST_HEAD(atm_devs);
-DECLARE_MUTEX(atm_dev_mutex);
+DEFINE_MUTEX(atm_dev_mutex);
 
 static struct atm_dev *__alloc_atm_dev(const char *type)
 {
@@ -65,9 +67,9 @@ struct atm_dev *atm_dev_lookup(int numbe
 {
struct atm_dev *dev;
 
-   down(atm_dev_mutex);
+   mutex_lock(atm_dev_mutex);
dev = __atm_dev_lookup(number);
-   up(atm_dev_mutex);
+   mutex_unlock(atm_dev_mutex);
return dev;
 }
 
@@ -83,11 +85,11 @@ struct atm_dev *atm_dev_register(const c
type);
return NULL;
}
-   down(atm_dev_mutex);
+   mutex_lock(atm_dev_mutex);
if (number != -1) {
if ((inuse = __atm_dev_lookup(number))) {
atm_dev_put(inuse);
-   up(atm_dev_mutex);
+   mutex_unlock(atm_dev_mutex);
kfree(dev);
return NULL;
}
@@ -112,12 +114,12 @@ struct atm_dev *atm_dev_register(const c
printk(KERN_ERR atm_dev_register: 
   atm_proc_dev_register failed for dev %s\n,
   

[patch 16/18] x25: allow ITU-T DTE facilities for x25

2006-03-08 Thread akpm

From: Shaun Pereira [EMAIL PROTECTED]

Allows use of the optional user facility to insert ITU-T
(http://www.itu.int/ITU-T/) specified DTE facilities in call set-up x25
packets.  This feature is optional; no facilities will be added if the ioctl
is not used, and call setup packet remains the same as before.

If the ioctls provided by the patch are used, then a facility marker will be
added to the x25 packet header so that the called dte address extension
facility can be differentiated from other types of facilities (as described in
the ITU-T X.25 recommendation) that are also allowed in the x25 packet header.

Facility markers are made up of two octets, and may be present in the x25
packet headers of call-request, incoming call, call accepted, clear request,
and clear indication packets.  The first of the two octets represents the
facility code field and is set to zero by this patch.  The second octet of the
marker represents the facility parameter field and is set to 0x0F because the
marker will be inserted before ITU-T type DTE facilities.

Since according to ITU-T X.25 Recommendation X.25(10/96)- 7.1 All networks
will support the facility markers with a facility parameter field set to all
ones or to , therefore this patch should work with all x.25 networks.

While there are many ITU-T DTE facilities, this patch implements only the
called and calling address extension, with placeholders in the
x25_dte_facilities structure for the rest of the facilities.

Testing:

This patch was tested using a cisco xot router connected on its serial ports
to an X.25 network, and on its lan ports to a host running an xotd daemon.

It is also possible to test this patch using an xotd daemon and an x25tap
patch, where the xotd daemons work back-to-back without actually using an x.25
network.  See www.fyonne.net for details on how to do this.

Signed-off-by: Shaun Pereira [EMAIL PROTECTED]
Acked-by: Andrew Hendry [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 include/linux/x25.h  |   26 +++
 include/net/x25.h|   21 +++--
 net/x25/af_x25.c |   45 +++-
 net/x25/x25_facilities.c |   82 +++--
 net/x25/x25_in.c |3 -
 net/x25/x25_subr.c   |6 +-
 6 files changed, 163 insertions(+), 20 deletions(-)

diff -puN include/linux/x25.h~x25-allow-itu-t-dte-facilities-for-x25 
include/linux/x25.h
--- devel/include/linux/x25.h~x25-allow-itu-t-dte-facilities-for-x25
2006-03-08 00:09:43.0 -0800
+++ devel-akpm/include/linux/x25.h  2006-03-08 00:09:43.0 -0800
@@ -11,6 +11,8 @@
 #ifndefX25_KERNEL_H
 #defineX25_KERNEL_H
 
+#include linux/types.h
+
 #defineSIOCX25GSUBSCRIP(SIOCPROTOPRIVATE + 0)
 #defineSIOCX25SSUBSCRIP(SIOCPROTOPRIVATE + 1)
 #defineSIOCX25GFACILITIES  (SIOCPROTOPRIVATE + 2)
@@ -21,6 +23,8 @@
 #define SIOCX25SCUDMATCHLEN(SIOCPROTOPRIVATE + 7)
 #define SIOCX25CALLACCPTAPPRV   (SIOCPROTOPRIVATE + 8)
 #define SIOCX25SENDCALLACCPT(SIOCPROTOPRIVATE + 9)
+#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
+#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
 
 /*
  * Values for {get,set}sockopt.
@@ -77,6 +81,8 @@ struct x25_subscrip_struct {
 #defineX25_MASK_PACKET_SIZE0x04
 #defineX25_MASK_WINDOW_SIZE0x08
 
+#define X25_MASK_CALLING_AE 0x10
+#define X25_MASK_CALLED_AE 0x20
 
 
 /*
@@ -99,6 +105,26 @@ struct x25_facilities {
 };
 
 /*
+* ITU DTE facilities
+* Only the called and calling address
+* extension are currently implemented.
+* The rest are in place to avoid the struct
+* changing size if someone needs them later
+*/
+
+struct x25_dte_facilities {
+   __u16 delay_cumul;
+   __u16 delay_target;
+   __u16 delay_max;
+   __u8 min_throughput;
+   __u8 expedited;
+   __u8 calling_len;
+   __u8 called_len;
+   __u8 calling_ae[20];
+   __u8 called_ae[20];
+};
+
+/*
  * Call User Data structure.
  */
 struct x25_calluserdata {
diff -puN include/net/x25.h~x25-allow-itu-t-dte-facilities-for-x25 
include/net/x25.h
--- devel/include/net/x25.h~x25-allow-itu-t-dte-facilities-for-x25  
2006-03-08 00:09:43.0 -0800
+++ devel-akpm/include/net/x25.h2006-03-08 00:09:43.0 -0800
@@ -101,9 +101,17 @@ enum {
 #defineX25_FAC_PACKET_SIZE 0x42
 #defineX25_FAC_WINDOW_SIZE 0x43
 
-#defineX25_MAX_FAC_LEN 20  /* Plenty to spare */
+#define X25_MAX_FAC_LEN60
 #defineX25_MAX_CUD_LEN 128
 
+#define X25_FAC_CALLING_AE 0xCB
+#define X25_FAC_CALLED_AE  0xC9
+
+#define X25_MARKER 0x00
+#define X25_DTE_SERVICES   0x0F
+#define X25_MAX_AE_LEN 40  /* Max num of 
semi-octets in AE - OSI Nw */
+#define X25_MAX_DTE_FACIL_LEN  21  /* Max length of DTE 
facility params */
+
 /**
  * struct 

[patch 14/18] x25: ioctl conversion 32 bit user to 64 bit kernel

2006-03-08 Thread akpm

From: Shaun Pereira [EMAIL PROTECTED]

To allow 32 bit x25 module structures to be passed to a 64 bit kernel via
ioctl using the new compat_sock_ioctl registration mechanism instead of the
obsolete 'register_ioctl32_conversion into hash table' mechanism

Signed-off-by: Shaun Pereira [EMAIL PROTECTED]
Acked-by: Arnd Bergmann [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 net/x25/af_x25.c |  124 +
 1 files changed, 124 insertions(+)

diff -puN net/x25/af_x25.c~x25-ioctl-conversion-32-bit-user-to-64-bit-kernel 
net/x25/af_x25.c
--- devel/net/x25/af_x25.c~x25-ioctl-conversion-32-bit-user-to-64-bit-kernel
2006-03-08 00:09:42.0 -0800
+++ devel-akpm/net/x25/af_x25.c 2006-03-08 00:09:42.0 -0800
@@ -54,7 +54,10 @@
 #include linux/termios.h /* For TIOCINQ/OUTQ */
 #include linux/notifier.h
 #include linux/init.h
+#include linux/compat.h
+
 #include net/x25.h
+#include net/compat.h
 
 int sysctl_x25_restart_request_timeout = X25_DEFAULT_T20;
 int sysctl_x25_call_request_timeout= X25_DEFAULT_T21;
@@ -69,6 +72,14 @@ static const struct proto_ops x25_proto_
 
 static struct x25_address null_x25_address = {   };
 
+#ifdef CONFIG_COMPAT
+struct compat_x25_subscrip_struct {
+   char device[200-sizeof(compat_ulong_t)];
+   compat_ulong_t global_facil_mask;
+   compat_uint_t extended;
+};
+#endif
+
 int x25_addr_ntoa(unsigned char *p, struct x25_address *called_addr,
  struct x25_address *calling_addr)
 {
@@ -1387,6 +1398,116 @@ static struct net_proto_family x25_famil
.owner  =   THIS_MODULE,
 };
 
+#ifdef CONFIG_COMPAT
+static int compat_x25_subscr_ioctl(unsigned int cmd,
+   struct compat_x25_subscrip_struct __user *x25_subscr32)
+{
+   struct compat_x25_subscrip_struct x25_subscr;
+   struct x25_neigh *nb;
+   struct net_device *dev;
+   int rc = -EINVAL;
+
+   rc = -EFAULT;
+   if (copy_from_user(x25_subscr, x25_subscr32, sizeof(*x25_subscr32)))
+   goto out;
+
+   rc = -EINVAL;
+   dev = x25_dev_get(x25_subscr.device);
+   if (dev == NULL)
+   goto out;
+
+   nb = x25_get_neigh(dev);
+   if (nb == NULL)
+   goto out_dev_put;
+
+   dev_put(dev);
+
+   if (cmd == SIOCX25GSUBSCRIP) {
+   x25_subscr.extended = nb-extended;
+   x25_subscr.global_facil_mask = nb-global_facil_mask;
+   rc = copy_to_user(x25_subscr32, x25_subscr,
+   sizeof(*x25_subscr32)) ? -EFAULT : 0;
+   } else {
+   rc = -EINVAL;
+   if (x25_subscr.extended == 0 || x25_subscr.extended == 1) {
+   rc = 0;
+   nb-extended = x25_subscr.extended;
+   nb-global_facil_mask = x25_subscr.global_facil_mask;
+   }
+   }
+   x25_neigh_put(nb);
+out:
+   return rc;
+out_dev_put:
+   dev_put(dev);
+   goto out;
+}
+
+static int compat_x25_ioctl(struct socket *sock, unsigned int cmd,
+   unsigned long arg)
+{
+   void __user *argp = compat_ptr(arg);
+   struct sock *sk = sock-sk;
+
+   int rc = -ENOIOCTLCMD;
+
+   switch(cmd) {
+   case TIOCOUTQ:
+   case TIOCINQ:
+   rc = x25_ioctl(sock, cmd, (unsigned long)argp);
+   break;
+   case SIOCGSTAMP:
+   rc = -EINVAL;
+   if (sk)
+   rc = compat_sock_get_timestamp(sk,
+   (struct timeval __user*)argp);
+   break;
+   case SIOCGIFADDR:
+   case SIOCSIFADDR:
+   case SIOCGIFDSTADDR:
+   case SIOCSIFDSTADDR:
+   case SIOCGIFBRDADDR:
+   case SIOCSIFBRDADDR:
+   case SIOCGIFNETMASK:
+   case SIOCSIFNETMASK:
+   case SIOCGIFMETRIC:
+   case SIOCSIFMETRIC:
+   rc = -EINVAL;
+   break;
+   case SIOCADDRT:
+   case SIOCDELRT:
+   rc = -EPERM;
+   if (!capable(CAP_NET_ADMIN))
+   break;
+   rc = x25_route_ioctl(cmd, argp);
+   break;
+   case SIOCX25GSUBSCRIP:
+   rc = compat_x25_subscr_ioctl(cmd, argp);
+   break;
+   case SIOCX25SSUBSCRIP:
+   rc = -EPERM;
+   if (!capable(CAP_NET_ADMIN))
+   break;
+   rc = compat_x25_subscr_ioctl(cmd, argp);
+   break;
+   case SIOCX25GFACILITIES:
+   case SIOCX25SFACILITIES:
+   case SIOCX25GCALLUSERDATA:
+   case SIOCX25SCALLUSERDATA:
+   case SIOCX25GCAUSEDIAG:
+   case SIOCX25SCUDMATCHLEN:
+   case SIOCX25CALLACCPTAPPRV:
+   case SIOCX25SENDCALLACCPT:
+   rc = x25_ioctl(sock, cmd, (unsigned long)argp);
+   break;
+   default:
+   rc = -ENOIOCTLCMD;
+   break;
+   }
+   

Re: [PATCH] x86-64, use page-virtual to get 64 byte struct page

2006-03-08 Thread Eric Dumazet

Eric Dumazet a écrit :


8011db70 pfn_to_page: /* pfn_to_page total: 487244  0.8036 */
 18501  0.0305 :8011db70:   mov2965994(%rip),%ecx
# memnode_shift

 83312  0.1374 :8011db76:   mov%rdi,%rax
 2 3.3e-06 :8011db79:   push   %rbp
   :8011db7a:   shl$0xc,%rax
 21880  0.0361 :8011db7e:   mov%rsp,%rbp
   601 9.9e-04 :8011db81:   shr%cl,%rax
   :8011db84:   movzbq 
0x803f0d60(%rax),%rax
 56462  0.0931 :8011db8c:   mov
0x804264e0(,%rax,8),%rcx

26 4.3e-05 :8011db94:   mov%rdi,%rax
 1 1.6e-06 :8011db97:   sub0x3340(%rcx),%rax
164872  0.2719 :8011db9e:   lea0x0(,%rax,8),%rdx
43 7.1e-05 :8011dba6:   shl$0x6,%rax
   :8011dbaa:   sub%rdx,%rax
 73574  0.1214 :8011dbad:   add0x3330(%rcx),%rax
38 6.3e-05 :8011dbb4:   leaveq
 67932  0.1120 :8011dbb5:   retq


Some comments about pfn_to_page()

1) reorder struct pglist_data
-
0x3340(%rcx) is node_start_pfn, and 0x3330(%rcx) is node_mem_map

These offsets show they may be in different cache lines.

Maybe we should change 'struct pglist_data' ordering so that those two fields 
are in the same memory cache line ?


2) Place memnodeshift in front of memnodemap
-

For most setups, only the first bytes in memnodemap[] are read.

And the linker usually puts memnodeshift AFTER memnodemap.
Two different cache lines are used.

I suggest the following change (seems better than playing vmlinux.lds games)

include/asm-x86_64/mmzone.h
struct memnode {
int shift;
u8 map[NODEMAPSIZE];
} cacheline_aligned;
extern struct memnode memnode;
#define memnode_shift memnode.shift
#define memnodemap memnode.map


Thank you

Eric

-
To unsubscribe from this list: send 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 02/12] 8139cp: register interrupt handler when net device is registered

2006-03-08 Thread Pierre Ossman
[EMAIL PROTECTED] wrote:
 From: Pierre Ossman [EMAIL PROTECTED]
 
 Avoids missing interrupts if the interrupt mask gets out of sync.
 
 The reason this patch is needed for me is that the resume function is
 broken.  It enables interrupts unconditionally, but the interrupt handler
 is only registered when the device is up.
 
 I don't have enough knowledge about the driver to fix the resume function
 so this patch will instead make sure that the interrupt handler is
 registered at all times (which can be a nice safeguard even when the resume
 function gets fixed).
 
 (akpm: carry this in -mm pending a fix of the resume function)
 
 Signed-off-by: Pierre Ossman [EMAIL PROTECTED]
 Cc: Jeff Garzik [EMAIL PROTECTED]
 Signed-off-by: Andrew Morton [EMAIL PROTECTED]
 ---

This was fixed properly by Francois Romieu, so please merge those instead:

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

Rgds
Pierre

-
To unsubscribe from this list: send 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] x86-64, use page-virtual to get 64 byte struct page

2006-03-08 Thread Andi Kleen
On Wednesday 08 March 2006 03:38, Benjamin LaHaise wrote:

 It's hardly that uncommon for pages to cross cachelines or for pages to
 move around CPUs with networking. 

Data?

 Please name some sort of benchmarks that show your concerns for decreased
 performance.  

Anything that manipulates lots of data.

 I've shown you one that gets improved, and I think the pages 
 not overlapping cachelines is only a good thing.

I think increasing the working set and wasting lots of money for this is only
a bad thing.

 I know these things look like piddly little worthless optimizations

In this case they look more like make the big picture worse for some 
microbenchmark to me.

-Andi

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


Re: [PATCH] x86-64, use page-virtual to get 64 byte struct page

2006-03-08 Thread Andi Kleen
On Wednesday 08 March 2006 10:09, Eric Dumazet wrote:

 I suggest the following change (seems better than playing vmlinux.lds
 games)

 include/asm-x86_64/mmzone.h
 struct memnode {
  int shift;
  u8 map[NODEMAPSIZE];
 } cacheline_aligned;
 extern struct memnode memnode;
 #define memnode_shift memnode.shift
 #define memnodemap memnode.map

Can you send tested patches with proper descriptions and signed off lines 
please?

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


[GIT PATCH] TIPC updates

2006-03-08 Thread Per Liden
Hi Dave,

Here is a set of patches for net-2.6.17.

Please pull from:

git://tipc.cslab.ericsson.net/pub/git/tipc.git

Thanks
/Per

 net/tipc/bcast.c   |   58 +++
 net/tipc/bearer.c  |   20 +--
 net/tipc/cluster.c |   20 +--
 net/tipc/cluster.h |2 +
 net/tipc/config.c  |4 +-
 net/tipc/dbg.c |4 +-
 net/tipc/discover.c|8 ++--
 net/tipc/eth_media.c   |4 +-
 net/tipc/link.c|   89 +++-
 net/tipc/name_distr.c  |6 ++-
 net/tipc/name_table.c  |   62 ++---
 net/tipc/net.c |7 ++--
 net/tipc/node.c|   20 +--
 net/tipc/node.h|2 +
 net/tipc/node_subscr.c |2 +
 net/tipc/port.c|   57 ++-
 net/tipc/ref.c |8 ++--
 net/tipc/ref.h |4 +-
 net/tipc/socket.c  |   28 ---
 net/tipc/subscr.c  |   30 
 net/tipc/user_reg.c|4 +-
 net/tipc/zone.c|   12 +++---
 22 files changed, 230 insertions(+), 221 deletions(-)

commit 387f290cb34ad2d791ced01614ba7062cbcac879
Author: Per Liden [EMAIL PROTECTED]
Date:   Thu Feb 9 12:46:56 2006 +0100

[TIPC] reduce stack usage

The node_map struct can be quite large (516 bytes) and allocating two of
them on the stack is not a good idea since we might only have a 4K stack
to start with.

Signed-off-by: Per Liden [EMAIL PROTECTED]

commit 8242fb4d3d516c4763b0861496e0e2b9bd89e37a
Author: Adrian Bunk [EMAIL PROTECTED]
Date:   Tue Feb 7 10:53:21 2006 +0100

[2.6 patch] net/tipc/: possible cleanups

This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global functions:
  - name_table.c: tipc_nametbl_print()
  - name_table.c: tipc_nametbl_dump()
  - net.c: tipc_net_next_node()

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

commit d71b81ce24e05e3f5d10ad7ffc8f777ce23421f2
Author: Per Liden [EMAIL PROTECTED]
Date:   Fri Jan 20 15:02:21 2006 +0100

[TIPC] Remove unused functions

Signed-off-by: Per Liden [EMAIL PROTECTED]

commit 14bc3a94dccb30e61b93981b8897afcf46ebd0a9
Author: Sam Ravnborg [EMAIL PROTECTED]
Date:   Fri Jan 20 08:52:44 2006 +0100

[PATCH] tipc: remove inlines from *.c

With reference to latest discussions on linux-kernel with respect to
inline here is a patch for tipc to remove all inlines as used in
the .c files. See also chapter 14 in Documentation/CodingStyle.

Before:
   textdata bss dec hex filename
 10299052921752  110034   1add2 tipc.o

Now:
   textdata bss dec hex filename
 10119052921752  108234   1a6ca tipc.o

This is a nice text size reduction which will improve icache usage.
In some cases bigger ( 4 lines) functions where declared inline
and used in many places, they are most probarly no longer inlined by gcc
resulting in the size reduction.
There are several one liners that no longer are declared inline, but gcc
should inline these just fine without the inline hint.

With this patch applied one warning is added about an unused static
function - that was hidded by utilising inline before.
The function in question were kept so this patch is solely a
inline removal patch.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Per Liden [EMAIL PROTECTED]

commit 81f71f5283f5c531a134cad0c272eb1492007cd4
Author: Sam Ravnborg [EMAIL PROTECTED]
Date:   Thu Jan 19 23:18:55 2006 +0100

[PATCH] tipc: fix simple sparse warnings

Tried to run the new tipc stack through sparse.
Following patch fixes all cases where 0 was used
as replacement of NULL.
Use NULL to document this is a pointer and to silence sparse.

This brough sparse warning count down with 127 to 24 warnings.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Per Liden [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: [GIT PATCH] TIPC updates

2006-03-08 Thread David S. Miller
From: Per Liden [EMAIL PROTECTED]
Date: Wed, 8 Mar 2006 11:18:15 +0100 (CET)

 Here is a set of patches for net-2.6.17.
 
 Please pull from:
 
   git://tipc.cslab.ericsson.net/pub/git/tipc.git

Looks good, but I can't pull it cleanly.

Please fix this up, thanks.

[EMAIL PROTECTED]:~/src/GIT/net-2.6.17$ git pull 
git://tipc.cslab.ericsson.net/pub/git/tipc.git
Unpacking 1382 objects
 100% (1382/1382) done
Trying really trivial in-index merge...
fatal: Merge requires file-level merging
Nope.
Merging HEAD with 387f290cb34ad2d791ced01614ba7062cbcac879
Merging: 
6976152167aec234b7b2421a10acc404e3ec8381 [ATM]: Fix build after 
neigh-parms-neigh_destructor change. 
387f290cb34ad2d791ced01614ba7062cbcac879 [TIPC] reduce stack usage 
found 1 common ancestor(s): 
e0a5c57848f7690a247bb8af4fa412844b0b00bb Merge branch 'upstream-fixes' of 
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 
Renaming net/{ipv4/netfilter/ipt_policy.c = netfilter/xt_policy.c} 
Auto-merging net/netfilter/xt_policy.c 
Auto-merging include/linux/pci_ids.h 
Auto-merging drivers/net/tg3.c 
CONFLICT (content): Merge conflict in drivers/net/tg3.c 

Automatic merge failed; fix up by hand
-
To unsubscribe from this list: send 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] x86-64, use page-virtual to get 64 byte struct page

2006-03-08 Thread Eric Dumazet

Andi Kleen a écrit :



Can you send tested patches with proper descriptions and signed off lines 
please?


-Andi




You are welcome Andi :)

[PATCH] x86_64 : group memnodemap and memnodeshift in a memnode structure

pfn_to_page() and others need to access both memnode_shift and the very first 
bytes of memnodemap[]. If we force memnode_shift to be just before the 
memnodemap array, we can reduce the memory footprint to one cache line instead 
of two for most setups. This patch introduce a 'memnode' structure where shift 
 and map[] are carefully placed.


Signed-off-by: Eric Dumazet [EMAIL PROTECTED]
--- linux-2.6.16-rc5/include/asm-x86_64/mmzone.h2006-02-27 
06:09:35.0 +0100
+++ linux-2.6.16-rc5-ed/include/asm-x86_64/mmzone.h 2006-03-08 
12:05:31.0 +0100
@@ -15,8 +15,13 @@
 #define NODEMAPSIZE 0xfff
 
 /* Simple perfect hash to map physical addresses to node numbers */
-extern int memnode_shift; 
-extern u8  memnodemap[NODEMAPSIZE]; 
+struct memnode {
+   int shift;
+   u8 map[NODEMAPSIZE];
+} cacheline_aligned;
+extern struct memnode memnode;
+#define memnode_shift memnode.shift
+#define memnodemap memnode.map
 
 extern struct pglist_data *node_data[];
 
--- linux-2.6.16-rc5/arch/x86_64/mm/numa.c  2006-02-27 06:09:35.0 
+0100
+++ linux-2.6.16-rc5-ed/arch/x86_64/mm/numa.c   2006-03-08 12:28:32.0 
+0100
@@ -25,8 +25,7 @@
 struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
 bootmem_data_t plat_node_bdata[MAX_NUMNODES];
 
-int memnode_shift;
-u8  memnodemap[NODEMAPSIZE];
+struct memnode memnode;
 
 unsigned char cpu_to_node[NR_CPUS] __read_mostly = {
[0 ... NR_CPUS-1] = NUMA_NO_NODE
@@ -357,8 +356,7 @@
 
 EXPORT_SYMBOL(cpu_to_node);
 EXPORT_SYMBOL(node_to_cpumask);
-EXPORT_SYMBOL(memnode_shift);
-EXPORT_SYMBOL(memnodemap);
+EXPORT_SYMBOL(memnode);
 EXPORT_SYMBOL(node_data);
 
 #ifdef CONFIG_DISCONTIGMEM


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

2006-03-08 Thread Evgeniy Polyakov
On Tue, Mar 07, 2006 at 03:03:13PM -0800, David S. Miller ([EMAIL PROTECTED]) 
wrote:
 From: Evgeniy Polyakov [EMAIL PROTECTED]
 Date: Wed, 8 Mar 2006 00:51:33 +0300
 
  RCU introduces noticeble latencies for writing part compared to
  rwlock, so workloads when a lot of new short connections are created
  and destroyed, like busy web server within LAN with small latencies,
  will suffer from this, doesn't it?
 
 To a certain extent, yes, and that is why this kind of patch
 needs a lot of testing.
 
 But to be honest, TCP is a lot less sensitive to the RCU
 latencies than things like the routing cache are, so I really
 don't expect any real problems in this area.
 
 You cannot create one full-fledged TCP socket per packet,
 but you can create a new routing cache entry per packet :-)

When I tested RCU for similar change for kevent, but postponed more work
to RCU callback, including socket closing and some attempts to inode
dereferencing, such change forced performance degradation for httperf
benchmark and trivial web server from 2600 requests/sec down to 2200
with 4.1K index page and 1500 MTU. 

I still have this testbed and will gladly test this change tomorrow 
if it applies cleanly to 2.6.15-rc7?

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


[2.6 patch] drivers/net/wireless/ipw2200.c: make ipw_qos_current_mode() static

2006-03-08 Thread Adrian Bunk
This patch makes the needlessly global function ipw_qos_current_mode() 
static.


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

---

This patch was already sent on:
- 4 Mar 2006

--- linux-2.6.16-rc5-mm2-full/drivers/net/wireless/ipw2200.c.old
2006-03-03 17:49:37.0 +0100
+++ linux-2.6.16-rc5-mm2-full/drivers/net/wireless/ipw2200.c2006-03-03 
17:50:00.0 +0100
@@ -6566,7 +6566,7 @@
 * get the modulation type of the current network or
 * the card current mode
 */
-u8 ipw_qos_current_mode(struct ipw_priv * priv)
+static u8 ipw_qos_current_mode(struct ipw_priv * priv)
 {
u8 mode = 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 6/6] ipw2100: Update version ipw2100 stamp to 1.2.2

2006-03-08 Thread Jiri Benc
On Wed, 8 Mar 2006 12:26:48 +0800, Zhu Yi wrote:
 --- a/drivers/net/wireless/ipw2100.c
 +++ b/drivers/net/wireless/ipw2100.c
 [...]
 -#define IPW2100_VERSION git-1.1.4
 +#define IPW2100_VERSION git-1.2.2

From [PATCH 1/6] ipw2x00: expend Copyright to 2006:

 --- a/Documentation/networking/README.ipw2100
 +++ b/Documentation/networking/README.ipw2100
 [...]
 -Version: 1.1.3
 -Date   : October 17, 2005
 +Version: git-1.1.5
 +Date   : January 25, 2006

Seems like you have some chaos in version numbers. Also, your patches
sometimes do more changes than described (nothing serious, though).

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


Re: [patch 08/18] happymeal: add pci probing

2006-03-08 Thread Jiri Slaby
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] napsal(a):
 From: Jiri Slaby [EMAIL PROTECTED]
 
 Pci probing functions added, some functions were rewritten.  Use PCI_DEVICE
 macro.
 
 Signed-off-by: Jiri Slaby [EMAIL PROTECTED]
 Signed-off-by: Andrew Morton [EMAIL PROTECTED]
 ---
 
  drivers/net/sunhme.c |   79 -
  1 files changed, 55 insertions(+), 24 deletions(-)
Drop it for now, Andrew, please.
It needs -fix, but not enough time here, sorry.

thanks,
- --
Jiri Slaby www.fi.muni.cz/~xslaby
~\-/~  [EMAIL PROTECTED]  ~\-/~
B67499670407CE62ACC8 22A032CC55C339D47A7E
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFEDs3KMsxVwznUen4RAhG5AJ4+LW4+il+6/+1yn2ZpwS45C5wOhACfUlma
JKdi2oDsIRznOUCopqGPoyg=
=K7Fe
-END PGP SIGNATURE-
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/6] ipw2100: semaphore to mutexes conversion

2006-03-08 Thread Christoph Hellwig
On Wed, Mar 08, 2006 at 12:25:13PM +0800, Zhu Yi wrote:
 
 From: Ingo Molnar [EMAIL PROTECTED]
 Date: Tue, 28 Feb 2006 07:20:54 + (+0800)
 
 [PATCH 4/6] ipw2100: semaphore to mutexes conversion
 
 semaphore to mutexes conversion.
 
 the conversion was generated via scripts, and the result was validated
 automatically via a script as well.
 
 build-tested.
 
 Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
 Signed-off-by: Zhu Yi [EMAIL PROTECTED]
 ---
 
 --- a/drivers/net/wireless/ipw2100.c
 +++ b/drivers/net/wireless/ipw2100.c
 @@ -194,6 +194,7 @@ static struct ipw2100_fw ipw2100_firmwar
  #endif
  
  #include linux/moduleparam.h
 +#include linux/mutex.h
  module_param(debug, int, 0444);

please keep a whitespace after the includes and before the module_param
statements.

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


Re: [PATCH 6/6] ipw2100: Update version ipw2100 stamp to 1.2.2

2006-03-08 Thread Christoph Hellwig
On Wed, Mar 08, 2006 at 12:26:48PM +0800, Zhu Yi wrote:
 
 From: Zhu Yi [EMAIL PROTECTED]
 Date: Tue, 21 Feb 2006 18:46:15 + (+0800)
 
 [PATCH 6/6] ipw2100: Update version ipw2100 stamp to 1.2.2
 ---
 
 --- a/drivers/net/wireless/ipw2100.c
 +++ b/drivers/net/wireless/ipw2100.c
 @@ -167,7 +167,7 @@ that only one external action is invoked
  
  #include ipw2100.h
  
 -#define IPW2100_VERSION git-1.1.4
 +#define IPW2100_VERSION git-1.2.2

git-foo is a pretty stupid version number, please kill the git- prefix.

-
To unsubscribe from this list: send 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 15/16] ipw2200: switch to the new ipw2200-fw-3.0 image format

2006-03-08 Thread Christoph Hellwig
On Wed, Mar 08, 2006 at 01:34:31PM +0800, Zhu Yi wrote:
 
 From: James Ketrenos [EMAIL PROTECTED]
 Date: Wed, 8 Mar 2006 03:22:28 + (+0800)
 
 [PATCH 15/16] ipw2200: switch to the new ipw2200-fw-3.0 image format
 
 This patch modifies the driver to support the ipw2200-fw-3.0 image format.
 
 The 3.0 fw image does not add any new capabilities, but as a result of
 image format changes, it should fix two problems experienced by users:
 
 1) Race conditions with the request_firmware interface and udev/hotplug
 are improved as only a single request_firmware call is now required to
 load the firmware and microcode (vs. 3 separate calls previously)
 
 2) The monitor mode firmware (sniffer) is now packaged with the correct
 boot image so it can now function without frequent restarts.
 
 Note: Once you apply this patch, you will also need to upgrade your
 firmware image to the 3.0 version available from:
 
 http://ipw2200.sf.net/firmware.php

NACK.  Requiring people to have different firmware for different kernels
is completely unacceptable.  Please add support for both firmware formats.

-
To unsubscribe from this list: send 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: Re: TSO and IPoIB performance degradation

2006-03-08 Thread Michael S. Tsirkin
Quoting r. David S. Miller [EMAIL PROTECTED]:
 Subject: Re: Re: TSO and IPoIB performance degradation
 
 From: Roland Dreier [EMAIL PROTECTED]
 Date: Tue, 07 Mar 2006 17:17:30 -0800
 
  The reason TSO comes up is that reverting the patch described below
  helps (or helped at some point at least) IPoIB throughput quite a bit.
 
 I wish you had started the thread by mentioning this specific patch

Er, since you mention it, the first message in thread did include this link:
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=314324121f9b94b2ca657a494cf2b9cb0e4a28cc
and I even pasted the patch description there, but oh well.

Now that Roland helped us clear it all up, and now that it has been clarified
that reverting this patch gives us back most of the performance, is the answer
to my question the same?

What I was trying to figure out was, how can we re-enable the trick without
hurting TSO? Could a solution be to simply look at the frame size, and call
tcp_send_delayed_ack if the frame size is small?

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


Re: [PATCH 6/6] ipw2100: Update version ipw2100 stamp to 1.2.2

2006-03-08 Thread James Ketrenos
Christoph Hellwig wrote:

On Wed, Mar 08, 2006 at 12:26:48PM +0800, Zhu Yi wrote:
  

-#define IPW2100_VERSION git-1.1.4
+#define IPW2100_VERSION git-1.2.2



git-foo is a pretty stupid version number, please kill the git- prefix.
  

Perhaps for you... 

For us this prefix has been very useful in isolating problems reported
by users.

The 'git' prefix means this was based on the out-of-tree version foo
which can then be quickly followed up with more directed questions to
the user.

James

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


Re: [PATCH 15/16] ipw2200: switch to the new ipw2200-fw-3.0 image format

2006-03-08 Thread James Ketrenos
Christoph Hellwig wrote:

On Wed, Mar 08, 2006 at 01:34:31PM +0800, Zhu Yi wrote:
  

From: James Ketrenos [EMAIL PROTECTED]
Date: Wed, 8 Mar 2006 03:22:28 + (+0800)

[PATCH 15/16] ipw2200: switch to the new ipw2200-fw-3.0 image format

This patch modifies the driver to support the ipw2200-fw-3.0 image format.

The 3.0 fw image does not add any new capabilities, but as a result of
image format changes, it should fix two problems experienced by users:

1) Race conditions with the request_firmware interface and udev/hotplug
are improved as only a single request_firmware call is now required to
load the firmware and microcode (vs. 3 separate calls previously)

2) The monitor mode firmware (sniffer) is now packaged with the correct
boot image so it can now function without frequent restarts.

Note: Once you apply this patch, you will also need to upgrade your
firmware image to the 3.0 version available from:

http://ipw2200.sf.net/firmware.php



NACK.  Requiring people to have different firmware for different kernels
is completely unacceptable.  

The in-tree driver has a 1:1 mapping to firmware version numbering.  You
currently can't do what you state is unacceptable.  If we provided a
v2.5 firmware image, you would have to upgrade your firmware if we
patched the driver to load that image.

Please add support for both firmware formats.

This patch removes the 1:1 mapping to version number changes, allowing
future firmware versions to be used without change to the driver
(provided the interface to the firmware does not change)

In other words, if we provide a firmware image v2.5, you won't be able
to use it without changing the driver.  And if you change the driver,
you will have to upgrade the firmware. 

With this patch applied, we can release 3.1, 3.2, 3.3... and you don't
have to change the driver.

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


Re: [GIT PATCH] TIPC updates

2006-03-08 Thread Per Liden
On Wed, 8 Mar 2006, David S. Miller wrote:

 From: Per Liden [EMAIL PROTECTED]
 Date: Wed, 8 Mar 2006 11:18:15 +0100 (CET)
 
  Here is a set of patches for net-2.6.17.
  
  Please pull from:
  
  git://tipc.cslab.ericsson.net/pub/git/tipc.git
 
 Looks good, but I can't pull it cleanly.

Ok, looks like git://git.kernel.org is still not in sync, but I managed to 
resync over http instead. Please retry the pull. Should be clean now.

/Per
-
To unsubscribe from this list: send 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] x86-64, use page-virtual to get 64 byte struct page

2006-03-08 Thread Andi Kleen
On Wednesday 08 March 2006 17:07, Benjamin LaHaise wrote:

 You haven't come up with any data to support your position, 

You're proposing to waste 0.1% of the memory of the system
with a quite dubious optimization.

Unless you're showing real gains on some macro benchmark I won't
accept that change.

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


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

2006-03-08 Thread Benjamin LaHaise
On Wed, Mar 08, 2006 at 02:01:04PM +0300, Evgeniy Polyakov wrote:
 When I tested RCU for similar change for kevent, but postponed more work
 to RCU callback, including socket closing and some attempts to inode
 dereferencing, such change forced performance degradation for httperf
 benchmark and trivial web server from 2600 requests/sec down to 2200
 with 4.1K index page and 1500 MTU. 
 
 I still have this testbed and will gladly test this change tomorrow 
 if it applies cleanly to 2.6.15-rc7?

I think it should, the code it touches isn't that heavily changed.  The 
results should be most interesting.  It might be useful to compare SMP 
and non-SMP cases as the difference in locks may show up in the test.

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


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

2006-03-08 Thread Jean Tourrilhes
On Tue, Mar 07, 2006 at 07:11:27PM -0800, Simon Barber wrote:
 Overloading configuration parameters with extra meanings like this makes
 it harder to configure the system - I think it's useful to keep an
 on/off function separate from the power setting.
 
 Simon 

The main issue I have with adding another separate setting is
that I'm trying to fight the sprawling wireless API. Every time we add
a new command in the API, we have to implement it in a dozen driver
and support it more or less forever (deprecating things is hard).
Many people already complain that Wireless Extension is too
bloated (while simultaneously complaining that their pet feature is
not available).

I'm personally pragmatic, not dogmatic. So, I'm asking myself
these two questions :

1) Why is this setting useful to the user ?
If a user want to disable/power-off its network interface, the
official and supported way to do that is 'ifconfig ethX down'. Most
driver do support that, and it leaves the network stack in a
consistent state (interface is down, routing will use an alternate
interface).
Moreover, Linux power management and ACPI will probably define
ways to suspend the device, if not done already.
So, why do we need yet another way to acheive the same thing ?

2) in practical terms, for the average user, what is the
difference between shutting down the Tx power and shutting down the
whole MAC ? If you shut down Tx power, you can't remain associated,
you can't scan, and can't do anything useful in general, so there is
little point in keeping the rest of the MAC active.

Also, I disagree that it make things harder for the user. By
default, this parameter has the right value (on), so the user doesn't
have to touch it, and it's only if he touches it that he may run into
troubles. There are plenty of driver setting available (standard or
private) that the user will never touch.

To me, it's clear that we don't need to waste our collective
time supporting this feature.
And if a driver author insist on exporting such feature, he
can use 'txpower on'. It's not perfect, but a pretty good match. If
the author doesn't like that, there is plenty of driver specific APIs
available (iwpriv, /proc, sysfs...).

Have fun...

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


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Benjamin LaHaise
On Wed, Mar 08, 2006 at 12:26:56PM -0800, Ravikiran G Thirumalai wrote:
 +static inline void percpu_counter_mod_bh(struct percpu_counter *fbc, long 
 amount)
 +{
 + local_bh_disable();
 + fbc-count += amount;
 + local_bh_enable();
 +}

Please use local_t instead, then you don't have to do the local_bh_disable() 
and enable() and the whole thing collapses down into 1 instruction on x86.

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


Re: [patch 3/4] net: percpufy frequently used vars -- proto.sockets_allocated

2006-03-08 Thread Ravikiran G Thirumalai
On Tue, Mar 07, 2006 at 06:16:02PM -0800, Andrew Morton wrote:
 Ravikiran G Thirumalai [EMAIL PROTECTED] wrote:

   +static inline int read_sockets_allocated(struct proto *prot)
   +{
   +  int total = 0;
   +  int cpu;
   +  for_each_cpu(cpu)
   +  total += *per_cpu_ptr(prot-sockets_allocated, cpu);
   +  return total;
   +}
 
 This is likely too big to be inlined, plus sock.h doesn't include enough
 headers to reliably compile this code.
 
   +static inline void mod_sockets_allocated(int *sockets_allocated, int 
  count)
   +{
   +  (*per_cpu_ptr(sockets_allocated, get_cpu())) += count;
   +  put_cpu();
   +}
   +
 
 Ditto.

OK, here is a revised patch.


Change the atomic_t sockets_allocated member of struct proto to a 
per-cpu counter.

Signed-off-by: Pravin B. Shelar [EMAIL PROTECTED]
Signed-off-by: Ravikiran Thirumalai [EMAIL PROTECTED]
Signed-off-by: Shai Fultheim [EMAIL PROTECTED]

Index: linux-2.6.16-rc5mm3/include/net/sock.h
===
--- linux-2.6.16-rc5mm3.orig/include/net/sock.h 2006-03-08 11:03:19.0 
-0800
+++ linux-2.6.16-rc5mm3/include/net/sock.h  2006-03-08 12:06:52.0 
-0800
@@ -543,7 +543,7 @@ struct proto {
/* Memory pressure */
void(*enter_memory_pressure)(void);
struct percpu_counter   *memory_allocated;  /* Current allocated 
memory. */
-   atomic_t*sockets_allocated; /* Current number of 
sockets. */
+   int *sockets_allocated; /* Current number of 
sockets (percpu counter). */
 
/*
 * Pressure flag: try to collapse.
@@ -579,6 +579,12 @@ struct proto {
} stats[NR_CPUS];
 };
 
+extern int read_sockets_allocated(struct proto *prot);
+extern void mod_sockets_allocated(int *sockets_allocated, int count);
+
+#define inc_sockets_allocated(c) mod_sockets_allocated(c, 1)
+#define dec_sockets_allocated(c) mod_sockets_allocated(c, -1)
+
 extern int proto_register(struct proto *prot, int alloc_slab);
 extern void proto_unregister(struct proto *prot);
 
Index: linux-2.6.16-rc5mm3/include/net/tcp.h
===
--- linux-2.6.16-rc5mm3.orig/include/net/tcp.h  2006-03-08 11:03:19.0 
-0800
+++ linux-2.6.16-rc5mm3/include/net/tcp.h   2006-03-08 11:39:40.0 
-0800
@@ -226,7 +226,7 @@ extern int sysctl_tcp_mtu_probing;
 extern int sysctl_tcp_base_mss;
 
 extern struct percpu_counter tcp_memory_allocated;
-extern atomic_t tcp_sockets_allocated;
+extern int *tcp_sockets_allocated;
 extern int tcp_memory_pressure;
 
 /*
Index: linux-2.6.16-rc5mm3/net/core/sock.c
===
--- linux-2.6.16-rc5mm3.orig/net/core/sock.c2006-03-08 11:03:19.0 
-0800
+++ linux-2.6.16-rc5mm3/net/core/sock.c 2006-03-08 12:09:19.0 -0800
@@ -771,7 +771,7 @@ struct sock *sk_clone(const struct sock 
newsk-sk_sleep  = NULL;
 
if (newsk-sk_prot-sockets_allocated)
-   atomic_inc(newsk-sk_prot-sockets_allocated);
+   
inc_sockets_allocated(newsk-sk_prot-sockets_allocated); 
}
 out:
return newsk;
@@ -1451,6 +1451,25 @@ void sk_common_release(struct sock *sk)
 
 EXPORT_SYMBOL(sk_common_release);
 
+int read_sockets_allocated(struct proto *prot)
+{
+   int total = 0;
+   int cpu;
+   for_each_cpu(cpu)
+   total += *per_cpu_ptr(prot-sockets_allocated, cpu);
+   return total;
+}
+
+EXPORT_SYMBOL(read_sockets_allocated);
+
+void mod_sockets_allocated(int *sockets_allocated, int count)
+{
+   (*per_cpu_ptr(sockets_allocated, get_cpu())) += count;
+   put_cpu();
+}
+
+EXPORT_SYMBOL(mod_sockets_allocated);
+
 static DEFINE_RWLOCK(proto_list_lock);
 static LIST_HEAD(proto_list);
 
@@ -1620,7 +1639,7 @@ static void proto_seq_printf(struct seq_
%2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c 
%2c %2c %2c %2c %2c %2c\n,
   proto-name,
   proto-obj_size,
-  proto-sockets_allocated != NULL ? 
atomic_read(proto-sockets_allocated) : -1,
+  proto-sockets_allocated != NULL ? 
read_sockets_allocated(proto) : -1,
   proto-memory_allocated != NULL ?

percpu_counter_read_positive(proto-memory_allocated) : -1,
   proto-memory_pressure != NULL ? *proto-memory_pressure ? 
yes : no : NI,
Index: linux-2.6.16-rc5mm3/net/core/stream.c
===
--- linux-2.6.16-rc5mm3.orig/net/core/stream.c  2006-03-08 11:08:28.0 
-0800
+++ linux-2.6.16-rc5mm3/net/core/stream.c   2006-03-08 11:39:40.0 
-0800
@@ -242,7 +242,7 @@ int sk_stream_mem_schedule(struct sock *
return 1;
 
if (!*sk-sk_prot-memory_pressure ||
-   

Re: [patch 2/4] net: percpufy frequently used vars -- struct proto.memory_allocated

2006-03-08 Thread Ravikiran G Thirumalai
On Tue, Mar 07, 2006 at 07:22:34PM -0800, Andrew Morton wrote:
 Ravikiran G Thirumalai [EMAIL PROTECTED] wrote:
  
  The problem is percpu_counter_sum has to read all the cpus cachelines.  If
  we have to use percpu_counter_sum everywhere, then might as well use plain
  per-cpu counters instead of  batching ones no?
 
 I didn't say use it everywhere ;)

:) No you did not. Sorry.  When the counter shows large varience it will affect
all places where it is read and it wasn't clear to me where to use
percpu_counter_sum vs percpu_counter_read in the context of the patch.  
But yes, using percpu_counter_sum at the critical points makes things better.
Thanks for pointing it out.  Here is an attempt on those lines. 

 
   Maybe, on very large cpu counts, 
  we should just change the FBC_BATCH so that variance does not go quadratic.
  Something like 32.  So that variance is 32 * NR_CPUS in that case, instead
  of (NR_CPUS * NR_CPUS * 2) currently.  Comments?
 
 Sure, we need to make that happen.  But it got all mixed up with the
 spinlock removal and it does need quite some thought and testing and
 documentation to help developers to choose the right settings and
 appropriate selection of defaults, etc.

I was thinking on the lines of something like the following as a simple fix
to the quadratic variance. But yes, it needs some experimentation before hand..

#if NR_CPUS = 16
#define FBC_BATCH   (32)
#else
#define FBC_BATCH   (NR_CPUS*4)
#endif

Thanks,
Kiran


Change struct proto-memory_allocated to a batching per-CPU counter 
(percpu_counter) from an atomic_t.  A batching counter is better than a 
plain per-CPU counter as this field is read often. 

Changes since last post: Use the more accurate percpu_counter_sum() at 
critical places.

Signed-off-by: Pravin B. Shelar [EMAIL PROTECTED]
Signed-off-by: Ravikiran Thirumalai [EMAIL PROTECTED]
Signed-off-by: Shai Fultheim [EMAIL PROTECTED]

Index: linux-2.6.16-rc5mm3/include/net/sock.h
===
--- linux-2.6.16-rc5mm3.orig/include/net/sock.h 2006-03-08 10:36:07.0 
-0800
+++ linux-2.6.16-rc5mm3/include/net/sock.h  2006-03-08 11:03:19.0 
-0800
@@ -48,6 +48,7 @@
 #include linux/netdevice.h
 #include linux/skbuff.h  /* struct sk_buff */
 #include linux/security.h
+#include linux/percpu_counter.h
 
 #include linux/filter.h
 
@@ -541,8 +542,9 @@ struct proto {
 
/* Memory pressure */
void(*enter_memory_pressure)(void);
-   atomic_t*memory_allocated;  /* Current allocated 
memory. */
+   struct percpu_counter   *memory_allocated;  /* Current allocated 
memory. */
atomic_t*sockets_allocated; /* Current number of 
sockets. */
+
/*
 * Pressure flag: try to collapse.
 * Technical note: it is used by multiple contexts non atomically.
Index: linux-2.6.16-rc5mm3/include/net/tcp.h
===
--- linux-2.6.16-rc5mm3.orig/include/net/tcp.h  2006-03-08 10:36:07.0 
-0800
+++ linux-2.6.16-rc5mm3/include/net/tcp.h   2006-03-08 11:03:19.0 
-0800
@@ -225,7 +225,7 @@ extern int sysctl_tcp_abc;
 extern int sysctl_tcp_mtu_probing;
 extern int sysctl_tcp_base_mss;
 
-extern atomic_t tcp_memory_allocated;
+extern struct percpu_counter tcp_memory_allocated;
 extern atomic_t tcp_sockets_allocated;
 extern int tcp_memory_pressure;
 
Index: linux-2.6.16-rc5mm3/net/core/sock.c
===
--- linux-2.6.16-rc5mm3.orig/net/core/sock.c2006-03-08 10:36:07.0 
-0800
+++ linux-2.6.16-rc5mm3/net/core/sock.c 2006-03-08 11:03:19.0 -0800
@@ -1616,12 +1616,13 @@ static char proto_method_implemented(con
 
 static void proto_seq_printf(struct seq_file *seq, struct proto *proto)
 {
-   seq_printf(seq, %-9s %4u %6d  %6d   %-3s %6u   %-3s  %-10s 
+   seq_printf(seq, %-9s %4u %6d  %6lu   %-3s %6u   %-3s  %-10s 
%2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c 
%2c %2c %2c %2c %2c %2c\n,
   proto-name,
   proto-obj_size,
   proto-sockets_allocated != NULL ? 
atomic_read(proto-sockets_allocated) : -1,
-  proto-memory_allocated != NULL ? 
atomic_read(proto-memory_allocated) : -1,
+  proto-memory_allocated != NULL ?
+   
percpu_counter_read_positive(proto-memory_allocated) : -1,
   proto-memory_pressure != NULL ? *proto-memory_pressure ? 
yes : no : NI,
   proto-max_header,
   proto-slab == NULL ? no : yes,
Index: linux-2.6.16-rc5mm3/net/core/stream.c
===
--- linux-2.6.16-rc5mm3.orig/net/core/stream.c  2006-03-08 10:36:07.0 
-0800
+++ linux-2.6.16-rc5mm3/net/core/stream.c   2006-03-08 

Re: [patch 02/12] 8139cp: register interrupt handler when net device is registered

2006-03-08 Thread Francois Romieu
Pierre Ossman [EMAIL PROTECTED] :
[...]
 This was fixed properly by Francois Romieu, so please merge those instead:
 
 http://bugzilla.kernel.org/show_bug.cgi?id=5681

The patch has already been merged in mainline.

-- 
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: [Lse-tech] Re: [Patch 7/7] Generic netlink interface (delay accounting)

2006-03-08 Thread Shailabh Nagar

jamal wrote:


On Mon, 2006-06-03 at 12:00 -0500, Shailabh Nagar wrote:

 

My design was to have the listener get both responses (what I call 
replies in the code) as well as events (data sent on exit of pid)


   



I think i may not be doing justice explaining this, so let me be more
elaborate so we can be in sync.
Here is the classical way of doing things:

- Assume several apps in user space and a target in the kernel (this
could be reversed or combined in many ways, but the sake of
simplicity/clarity make the above assumption).
- suppose we have five user space apps A, B, C, D, E; these processes
would typically do one of the following class of activities:

a) configure (ADD/NEW/DEL etc). This is issued towards the kernel to
set/create/delete/flush some scalar attribute or vector. These sorts of
commands are synchronous. i.e you issue them, you expect a response
(which may indicate success/failure etc). The response is unicast; the
effect of what they affected may cause an event which may be multicast.

b) query(GET). This is issued towards the kernel to query state of
configured items. These class of commands are also synchronous. There
are special cases of the query which dump everything in the target -
literally called dumps. The response is unicast.

c) events. These are _asynchronous_ messages issued by the kernel to
indicate some happening in the kernel. The event may be caused by #a
above or any other activity in the kernel. Events are multicast.
To receive them you have to register for the multicast group. You do so
via sockets. You can register to many multicast group.

For clarity again assume we have a multicast group where announcements
of pids exiting is seen and C and D are registered to such a multicast
group.
Suppose process A exits. That would fall under #c above. C and D will be
notified.
Suppose B configures something in the kernel that forces the kernel to
have process E exit and that such an operation is successful. B will get
acknowledgement it succeeded (unicast). C and D will get notified
(multicast). 
Suppose C issued a GET to find details about a specific pid, then only C

will get that info back (message is unicast).
[A response message to a GET is typically designed to be the same as an
ADD message i.e one should be able to take exactly the same message,
change one or two things and shove back into the kernel to configure].
Suppose D issued a GET with dump flag, then D will get the details of
all pids (message is unicast).

Is this clear? Is there more than the above you need?
 

Thanks for the clarification of the usage model. While our needs are 
certainly much less complex,

it is useful to know the range of options.


There are no hard rules on what you need to be multicasting and as an
example you could send periodic(aka time based) samples from the kernel
on a multicast channel and that would be received by all. It did seem
odd that you want to have a semi-promiscous mode where a response to a
GET is multicast. If that is still what you want to achieve, then you
should.
 

Ok, we'll probably switch to the classical mode you suggest since the 
efficient processing
rationale for choosing to operate in the semi-promiscous mode earlier 
can be overcome by

writing a multi-threaded userspace utility.

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


   



This is more of the classical way of doing things. 



 


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


 


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

   



If you never open a connection to the kernel, nothing will be generated
towards user space. 
There are other techniques to rate limit event generation as well (one

such technique is a nagle-like algorithm used by xfrm).

 


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

   



Yes, please in your doc feedback remind me of this,

 


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


 


Will do.

   



also take a look at the excellent documentation Thomas Graf has put in
the kernel for all the utilities for manipulating netlink messages and
tell me if that should also be put in this doc (It is listed as a TODO).


 


Ok.

Thanks,
Shailabh


cheers,
jamal

 



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


Re: TSO and IPoIB performance degradation

2006-03-08 Thread David S. Miller
From: Michael S. Tsirkin [EMAIL PROTECTED]
Date: Wed, 8 Mar 2006 14:53:11 +0200

 What I was trying to figure out was, how can we re-enable the trick without
 hurting TSO? Could a solution be to simply look at the frame size, and call
 tcp_send_delayed_ack if the frame size is small?

The problem is that this patch helps performance when the
receiver is CPU limited.

The old code would delay ACKs forever if the CPU of the
receiver was slow, because we'd wait for all received
packets to be copied into userspace before spitting out
the ACK.  This would allow the pipe to empty, since the
sender is waiting for ACKs in order to send more into
the pipe, and once the ACK did go out it would cause the
sender to emit an enormous burst of data.  Both of these
behaviors are highly frowned upon for a TCP stack.

I'll try to look at this some more later today.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Ravikiran G Thirumalai
On Wed, Mar 08, 2006 at 04:17:33PM -0500, Benjamin LaHaise wrote:
 On Wed, Mar 08, 2006 at 01:07:26PM -0800, Ravikiran G Thirumalai wrote:
 
 Last time I checked, all the major architectures had efficient local_t 
 implementations.  Most of the RISC CPUs are able to do a load / store 
 conditional implementation that is the same cost (since memory barriers 
 tend to be explicite on powerpc).  So why not use it?

Then, for the batched percpu_counters, we could gain by using local_t only for 
the UP case. But we will have to have a new local_long_t implementation 
for that.  Do you think just one use case of local_long_t warrants for a new
set of apis?

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


Re: [PATCH 7/9] sky2: smarter irq handling

2006-03-08 Thread Francois Romieu
Stephen Hemminger [EMAIL PROTECTED] :
[...]
 Then stop at #6. 

#1..#6 applied to branch 'for-jeff' at
git://electric-eye.fr.zoreil.com/home/romieu/linux-2.6.git

Shortlog


Francois Romieu:
  de2104x: prevent interrupt before the interrupt handler is registered
  de2104x: fix the TX watchdog

Stephen Hemminger:
  sky2: remove support for old untested hardware
  sky2: warn on newer untested chips
  sky2: remove wake-on-lan until fixed
  sky2: not really random enough for entropy pool
  sky2: force Tx interrupt when ring near full
  sky2: don't choke on oversize frames

Patch
-

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 72c1630..34afa0d 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -61,10 +61,6 @@
  * a receive requires one (or two if using 64 bit dma).
  */
 
-#define is_ec_a1(hw) \
-   unlikely((hw)-chip_id == CHIP_ID_YUKON_EC  \
-(hw)-chip_rev == CHIP_REV_YU_EC_A1)
-
 #define RX_LE_SIZE 512
 #define RX_LE_BYTES(RX_LE_SIZE*sizeof(struct sky2_rx_le))
 #define RX_MAX_PENDING (RX_LE_SIZE/2 - 2)
@@ -74,7 +70,7 @@
 #define TX_RING_SIZE   512
 #define TX_DEF_PENDING (TX_RING_SIZE - 1)
 #define TX_MIN_PENDING 64
-#define MAX_SKB_TX_LE  (4 + 2*MAX_SKB_FRAGS)
+#define MAX_SKB_TX_LE  (4 + 
(sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS)
 
 #define STATUS_RING_SIZE   2048/* 2 ports * (TX + 2*RX) */
 #define STATUS_LE_BYTES(STATUS_RING_SIZE*sizeof(struct 
sky2_status_le))
@@ -622,8 +618,8 @@ static void sky2_mac_init(struct sky2_hw
 
/* Configure Rx MAC FIFO */
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR);
-   sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T),
-GMF_RX_CTRL_DEF);
+   sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
+GMF_OPER_ON | GMF_RX_F_FL_ON);
 
/* Flush Rx MAC FIFO on any flow control or error */
sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR);
@@ -725,37 +721,11 @@ static inline struct sky2_tx_le *get_tx_
return le;
 }
 
-/*
- * This is a workaround code taken from SysKonnect sk98lin driver
- * to deal with chip bug on Yukon EC rev 0 in the wraparound case.
- */
-static void sky2_put_idx(struct sky2_hw *hw, unsigned q,
-   u16 idx, u16 *last, u16 size)
+/* Update chip's next pointer */
+static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, u16 idx)
 {
wmb();
-   if (is_ec_a1(hw)  idx  *last) {
-   u16 hwget = sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_GET_IDX));
-
-   if (hwget == 0) {
-   /* Start prefetching again */
-   sky2_write8(hw, Y2_QADDR(q, PREF_UNIT_FIFO_WM), 0xe0);
-   goto setnew;
-   }
-
-   if (hwget == size - 1) {
-   /* set watermark to one list element */
-   sky2_write8(hw, Y2_QADDR(q, PREF_UNIT_FIFO_WM), 8);
-
-   /* set put index to first list element */
-   sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), 0);
-   } else  /* have hardware go to end of list */
-   sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX),
-size - 1);
-   } else {
-setnew:
-   sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx);
-   }
-   *last = idx;
+   sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx);
mmiowb();
 }
 
@@ -995,9 +965,12 @@ static int sky2_rx_start(struct sky2_por
sky2_rx_add(sky2, re-mapaddr);
}
 
+   /* Truncate oversize frames */
+   sky2_write16(hw, SK_REG(sky2-port, RX_GMF_TR_THR), sky2-rx_bufsize - 
8);
+   sky2_write32(hw, SK_REG(sky2-port, RX_GMF_CTRL_T), RX_TRUNC_ON);
+
/* Tell chip about available buffers */
-   sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2-rx_put);
-   sky2-rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX));
+   sky2_put_idx(hw, rxq, sky2-rx_put);
return 0;
 nomem:
sky2_rx_clean(sky2);
@@ -1145,6 +1118,7 @@ static int sky2_xmit_frame(struct sk_buf
struct sky2_tx_le *le = NULL;
struct tx_ring_info *re;
unsigned i, len;
+   int avail;
dma_addr_t mapping;
u32 addr64;
u16 mss;
@@ -1287,11 +1261,14 @@ static int sky2_xmit_frame(struct sk_buf
re-idx = sky2-tx_prod;
le-ctrl |= EOP;
 
-   sky2_put_idx(hw, txqaddr[sky2-port], sky2-tx_prod,
-sky2-tx_last_put, TX_RING_SIZE);
+   avail = tx_avail(sky2);
+   if (avail  TX_MIN_PENDING) {
+   le-ctrl |= FRC_STAT;
+   if (avail = MAX_SKB_TX_LE)
+   netif_stop_queue(dev);
+   }
 
-   if (tx_avail(sky2) = MAX_SKB_TX_LE)
-   

Re: [PATCH, RESEND] Add MWI workaround for Tulip DC21143

2006-03-08 Thread Francois Romieu
Geert Uytterhoeven [EMAIL PROTECTED] :
 On Tue, 7 Mar 2006, Ralf Baechle wrote:
[...]
  I'm just not convinced of having such a workaround as a build option.
  The average person building a a kernel will probably not know if the
  option needs to be enabled or not.
 
 Indeed, if it's mentioned in the errata of the chip, the driver should take
 care of it.

Something like the patch below (+Mr Horton Signed-off-by: and description):

diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
index 05d2d96..d109540 100644
--- a/drivers/net/tulip/tulip.h
+++ b/drivers/net/tulip/tulip.h
@@ -262,7 +262,14 @@ enum t21143_csr6_bits {
 #define RX_RING_SIZE   128 
 #define MEDIA_MASK 31
 
+/* MWI can fail on 21143 rev 65 if the receive buffer ends
+   on a cache line boundary. Ensure it doesn't ... */
+
+#ifdef CONFIG_MIPS_COBALT
+#define PKT_BUF_SZ (1536 + 4)
+#else
 #define PKT_BUF_SZ 1536/* Size of each temporary Rx buffer. */
+#endif
 
 #define TULIP_MIN_CACHE_LINE   8   /* in units of 32-bit words */
 
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index c67c912..ca6eeda 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -294,6 +294,8 @@ static void tulip_up(struct net_device *
if (tp-mii_cnt  ||  (tp-mtabletp-mtable-has_mii))
iowrite32(0x0004, ioaddr + CSR6);
 
+   printk(KERN_DEBUG %s: CSR0 %08x\n, dev-name, tp-csr0);
+
/* Reset the chip, holding bit 0 set at least 50 PCI cycles. */
iowrite32(0x0001, ioaddr + CSR0);
udelay(100);
@@ -1155,8 +1157,10 @@ static void __devinit tulip_mwi_config (
/* if we have any cache line size at all, we can do MRM */
csr0 |= MRM;
 
+#ifndef CONFIG_MIPS_COBALT
/* ...and barring hardware bugs, MWI */
if (!(tp-chip_id == DC21143  tp-revision == 65))
+#endif
csr0 |= MWI;
 
/* set or disable MWI in the standard PCI command bit.
@@ -1182,7 +1186,7 @@ static void __devinit tulip_mwi_config (
 */
switch (cache) {
case 8:
-   csr0 |= MRL | (1  CALShift) | (16  BurstLenShift);
+   csr0 |= MRL | (1  CALShift) | (8  BurstLenShift);
break;
case 16:
csr0 |= MRL | (2  CALShift) | (16  BurstLenShift);
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Benjamin LaHaise
On Wed, Mar 08, 2006 at 02:25:28PM -0800, Ravikiran G Thirumalai wrote:
 Then, for the batched percpu_counters, we could gain by using local_t only 
 for 
 the UP case. But we will have to have a new local_long_t implementation 
 for that.  Do you think just one use case of local_long_t warrants for a new
 set of apis?

I think it may make more sense to simply convert local_t into a long, given 
that most of the users will be things like stats counters.

-ben
-- 
Time is of no importance, Mr. President, only life is important.
Don't Email: [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 7/9] sky2: smarter irq handling

2006-03-08 Thread Stephen Hemminger
Please take the three patches yesterday for 2.6.16,
The others can wait.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/9] sky2: smarter irq handling

2006-03-08 Thread Francois Romieu
Stephen Hemminger [EMAIL PROTECTED] :
 Please take the three patches yesterday for 2.6.16,
 The others can wait.

So instead of #1..#6 from 07/03/2006, #1..#3 from 08/03/2003
which actually cover (with minor differences) #4..#6 from 07/03/2006 
should be pushed ?

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


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Andrew Morton
Ravikiran G Thirumalai [EMAIL PROTECTED] wrote:

 On Wed, Mar 08, 2006 at 04:17:33PM -0500, Benjamin LaHaise wrote:
  On Wed, Mar 08, 2006 at 01:07:26PM -0800, Ravikiran G Thirumalai wrote:
  
  Last time I checked, all the major architectures had efficient local_t 
  implementations.  Most of the RISC CPUs are able to do a load / store 
  conditional implementation that is the same cost (since memory barriers 
  tend to be explicite on powerpc).  So why not use it?
 
 Then, for the batched percpu_counters, we could gain by using local_t only 
 for 
 the UP case. But we will have to have a new local_long_t implementation 
 for that.  Do you think just one use case of local_long_t warrants for a new
 set of apis?
 

local_t maps onto 32-bit values on 32-bit machines and onto 64-bit values
on 64-bit machines.  unsigned longs.  I don't quite trust the signedness
handling across all archs.

looks

Yes, alpha (for example) went and made its local_t's signed, which is wrong
and dangerous.

ia64 is signed.

mips is signed.

parisc is signed.

s390 is signed.

sparc64 is signed.

x86_64 is signed 32-bit!

All other architectures use unsigned long.  A fiasco.

Once decrapify-asm-generic-localh.patch is merged I think all architectures
can and should use asm-generic/local.h.

Until decrapify-asm-generic-localh.patch has been merged and the downstream
arch consolidation has happened and the signedness problems have been
carefully reviewed and fixed I wouldn't go within a mile of local_t.

Once all that is sorted out then yes, it makes sense to convert per-cpu
counters to local_t.  Note that local_t is unsigned, and percpu_counter
needs to treat it as signed.

We should also move the out-of-line percpu_counter implementation over to
lib/something.c (in obj-y).

But none of that has anything to do with these 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


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Andrew Morton
Andrew Morton [EMAIL PROTECTED] wrote:

 Once decrapify-asm-generic-localh.patch is merged I think all architectures
  can and should use asm-generic/local.h.

err, no.  Because that's just atomic_long_t, and that's a locked instruction.

We need to review and fix up those architectures which have implemented the
optimised versions.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Andrew Morton
Benjamin LaHaise [EMAIL PROTECTED] wrote:

 On Wed, Mar 08, 2006 at 02:25:28PM -0800, Ravikiran G Thirumalai wrote:
  Then, for the batched percpu_counters, we could gain by using local_t only 
  for 
  the UP case. But we will have to have a new local_long_t implementation 
  for that.  Do you think just one use case of local_long_t warrants for a new
  set of apis?
 
 I think it may make more sense to simply convert local_t into a long, given 
 that most of the users will be things like stats counters.
 

Yes, I agree that making local_t signed would be better.  It's consistent
with atomic_t, atomic64_t and atomic_long_t and it's a bit more flexible.

Perhaps.  A lot of applications would just be upcounters for statistics,
where unsigned is desired.  But I think the consistency argument wins out.

-
To unsubscribe from this list: send 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] pcnet32: Introduce basic AT 2700/01 FTX support

2006-03-08 Thread Don Fry
On Mon, Feb 27, 2006 at 11:45:51AM +0100, Seewer Philippe wrote:
 OK, found it.
 
 The code in pcnet32_open assigns XCVR_INTERNAL to ecmd.port instead of 
 ecmd.transceiver, making mii_ethtool_sset fail and leaving all phys 
 configured to defaults.
 
 On the Allied Telesyn FTX cards this means to use autoneg on tp when 
 default is fiber and 10/half on fiber when tp is default. Thats why the 
 fiber port didn't work, because it only supports 100Mbit. Overriding the 
 speed/duplex with ethtool makes it work though.
 
 Assigning XCRV_INTERNAL to the correct attribute introduces a new 
 problem: Since all options are ignored the code forces all phys to 
 10/half, so ethtool is needed again to reconfigure the settings.
 
 Changing the option override in probe1 to |= works and configures all 
 phy's with the correct options (except for autoneg of course, which is 
 still specifically ignored).
 
 I don't know whether it was the intention of the patch to force usage of 
 ethtool or not... Any suggestions?
 
 Regards
 Philippe Seewer

I get the same results in my testing.  Good catch on the coding error
for ecmd.transciever.  Without adding some more specific code to support
the Allied Telesyn cards I don`t know how to get things to work without
using ethtool.

Maybe someone else has a better idea.

Here is my current patch for you to review.  I would like to submit it
for 2.6.17.

--- linux-2.6.16-rc5/drivers/net/pcnet32.c.orig Mon Jan  2 19:21:10 2006
+++ linux-2.6.16-rc5/drivers/net/pcnet32.c  Wed Mar  8 15:38:01 2006
@@ -22,8 +22,8 @@
  */
 
 #define DRV_NAME   pcnet32
-#define DRV_VERSION1.31c
-#define DRV_RELDATE01.Nov.2005
+#define DRV_VERSION1.32
+#define DRV_RELDATE08.Mar.2006
 #define PFXDRV_NAME : 
 
 static const char *version =
@@ -133,7 +133,7 @@ static const char pcnet32_gstrings_test[
 };
 #define PCNET32_TEST_LEN (sizeof(pcnet32_gstrings_test) / ETH_GSTRING_LEN)
 
-#define PCNET32_NUM_REGS 168
+#define PCNET32_NUM_REGS 136
 
 #define MAX_UNITS 8/* More are supported, limit only on options */
 static int options[MAX_UNITS];
@@ -265,6 +265,8 @@ static int homepna[MAX_UNITS];
  * v1.31c  01 Nov 2005 Don Fry Allied Telesyn 2700/2701 FX are 100Mbit only.
  *Force 100Mbit FD if Auto (ASEL) is selected.
  *See Bugzilla 2669 and 4551.
+ * v1.32   08 Mar20065 Thomas Bogendoerfer and Don Fry added Multi-Phy
+ *handling for supporting AT-270x FTX cards with FX and Tx PHYs
  */
 
 
@@ -375,6 +377,7 @@ struct pcnet32_private {
 unsigned int   dirty_rx, dirty_tx; /* The ring entries to be free()ed. 
*/
 struct net_device_stats stats;
 char   tx_full;
+char   phycount;   /* number of phys found */
 intoptions;
 unsigned int   shared_irq:1,   /* shared irq possible */
dxsuflo:1,  /* disable transmit stop on uflo */
@@ -384,6 +387,9 @@ struct pcnet32_private {
 struct timer_list  watchdog_timer;
 struct timer_list  blink_timer;
 u32msg_enable; /* debug message level */
+
+/* each bit indicates an available PHY */
+u32phymask;
 };
 
 static void pcnet32_probe_vlbus(void);
@@ -415,6 +421,7 @@ static void pcnet32_get_regs(struct net_
 static void pcnet32_purge_tx_ring(struct net_device *dev);
 static int pcnet32_alloc_ring(struct net_device *dev, char *name);
 static void pcnet32_free_ring(struct net_device *dev);
+static void pcnet32_check_media(struct net_device *dev, int verbose);
 
 
 enum pci_flags_bit {
@@ -936,9 +943,14 @@ static int pcnet32_phys_id(struct net_de
 return 0;
 }
 
+#define PCNET32_REGS_PER_PHY   32
+#define PCNET32_MAX_PHYS   32
 static int pcnet32_get_regs_len(struct net_device *dev)
 {
-return(PCNET32_NUM_REGS * sizeof(u16));
+struct pcnet32_private *lp = dev-priv;
+int j = lp-phycount * PCNET32_REGS_PER_PHY;
+
+return((PCNET32_NUM_REGS + j) * sizeof(u16));
 }
 
 static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
@@ -998,9 +1010,14 @@ static void pcnet32_get_regs(struct net_
 
 /* read mii phy registers */
 if (lp-mii) {
-   for (i=0; i32; i++) {
-   lp-a.write_bcr(ioaddr, 33, ((lp-mii_if.phy_id)  5) | i);
-   *buff++ = lp-a.read_bcr(ioaddr, 34);
+   int j;
+   for (j=0; jPCNET32_MAX_PHYS; j++) {
+   if (lp-phymask  (1  j)) {
+   for (i=0; iPCNET32_REGS_PER_PHY; i++) {
+   lp-a.write_bcr(ioaddr, 33, (j  5) | i);
+   *buff++ = lp-a.read_bcr(ioaddr, 34);
+   }
+   }
}
 }
 
@@ -1009,10 +1026,6 @@ static void pcnet32_get_regs(struct net_
a-write_csr(ioaddr, 5, 0x);
 }
 
-i = buff - (u16 *)ptr;
-for (; i  PCNET32_NUM_REGS; i++)
-   *buff++ = 0;
-
 spin_unlock_irqrestore(lp-lock, 

Re: [Patch 1/1] updated: TCP/UDP getpeersec

2006-03-08 Thread Herbert Xu
Catherine Zhang [EMAIL PROTECTED] wrote:
 
 From: [EMAIL PROTECTED]
 
 This patch implements an application of the LSM-IPSec networking
 controls whereby an application can determine the label of the
 security association its TCP or UDP sockets are currently connected to
 via getsockopt and the auxiliary data mechanism of recvmsg.

Looks good to me.

Acked-by: Herbert Xu [EMAIL PROTECTED]

Dave, perhaps we should queue this for 2.6.17?

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: [Patch 1/1] updated: TCP/UDP getpeersec

2006-03-08 Thread David S. Miller
From: Herbert Xu [EMAIL PROTECTED]
Date: Thu, 09 Mar 2006 11:33:19 +1100

 Catherine Zhang [EMAIL PROTECTED] wrote:
  
  From: [EMAIL PROTECTED]
  
  This patch implements an application of the LSM-IPSec networking
  controls whereby an application can determine the label of the
  security association its TCP or UDP sockets are currently connected to
  via getsockopt and the auxiliary data mechanism of recvmsg.
 
 Looks good to me.
 
 Acked-by: Herbert Xu [EMAIL PROTECTED]
 
 Dave, perhaps we should queue this for 2.6.17?

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


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Andrew Morton
Ravikiran G Thirumalai [EMAIL PROTECTED] wrote:

 On Wed, Mar 08, 2006 at 03:43:21PM -0800, Andrew Morton wrote:
  Benjamin LaHaise [EMAIL PROTECTED] wrote:
  
   I think it may make more sense to simply convert local_t into a long, 
   given 
   that most of the users will be things like stats counters.
   
  
  Yes, I agree that making local_t signed would be better.  It's consistent
  with atomic_t, atomic64_t and atomic_long_t and it's a bit more flexible.
  
  Perhaps.  A lot of applications would just be upcounters for statistics,
  where unsigned is desired.  But I think the consistency argument wins out.
 
 It already is... for most of the arches except x86_64.

x86 uses unsigned long.

 And on -mm, the asm-generic version uses atomic_long_t for local_t (signed
 long) which seems right.

No, it uses unsigned long.  The only place where signedness matters is
local_read(), and there it is typecast to ulong.

 Although, I wonder why we use:
 
 #define local_read(l) ((unsigned long)atomic_long_read((l)-a))
 
 It would return a huge value if the local counter was even -1 no?

It's casting a signed long to an unsigned long.  That does the right thing.
Yes, it'll convert -1 to 0x[].

-
To unsubscribe from this list: send 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] compat. ifconf: fix limits

2006-03-08 Thread David S. Miller
From: Randy.Dunlap [EMAIL PROTECTED]
Date: Wed, 8 Mar 2006 09:16:08 -0800

 From: Randy Dunlap [EMAIL PROTECTED]
 
 A recent change to compat. dev_ifconf() in fs/compat_ioctl.c
 causes ifconf data to be truncated 1 entry too early when copying it
 to userspace.  The correct amount of data (length) is returned,
 but the final entry is empty (zero, not filled in).
 The for-loop 'i' check should use = to allow the final struct
 ifreq32 to be copied.  I also used the ifconf-corruption program
 in kernel bugzilla #4746 to make sure that this change does not
 re-introduce the corruption.
 
 Signed-off-by: Randy Dunlap [EMAIL PROTECTED]

Good catch, applied.  Thanks Randy.

Is this one relevant for -stable?
-
To unsubscribe from this list: send 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 netdev-2.6] e1000: driver update

2006-03-08 Thread Jeff Kirsher
The series only contains one patch.  Sorry for the cover email, I was trying to 
edit the patch email and did not intend to create cover email.  The one patch 
in this series is a fix for mii-tool.  This patch was created using Jeff 
Garzik's latest 'upstream' branch.

Jeff,
This patch is diff'd off your latest 'upstream' branch, should I also 
create a patch for 2.6.16 also?

--
Cheers,
Jeff

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


[PATCH netdev-2.6 ] e1000: Fix mii-tool access to setting speed and duplex

2006-03-08 Thread Jeff Kirsher
Paul Rolland reported that e1000 was having a hard time using mii-tool to set 
speed and duplex.  This patch fixes the issue on both newer hardware as well as 
fixing the code issue that originally caused the problem.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Jeff Kirsher [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 9adaf5f..5f7e5c8 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4171,7 +4171,7 @@ e1000_mii_ioctl(struct net_device *netde
spin_unlock_irqrestore(adapter-stats_lock, flags);
return -EIO;
}
-   if (adapter-hw.phy_type == e1000_phy_m88) {
+   if (adapter-hw.phy_type == e1000_media_type_copper) {
switch (data-reg_num) {
case PHY_CTRL:
if (mii_reg  MII_CR_POWER_DOWN)
@@ -4187,8 +4187,8 @@ e1000_mii_ioctl(struct net_device *netde
else
spddplx = SPEED_10;
spddplx += (mii_reg  0x100)
-  ? FULL_DUPLEX :
-  HALF_DUPLEX;
+  ? DUPLEX_FULL :
+  DUPLEX_HALF;
retval = e1000_set_spd_dplx(adapter,
spddplx);
if (retval) {

-
To unsubscribe from this list: send 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] compat. ifconf: fix limits

2006-03-08 Thread Randy.Dunlap
On Wed, 08 Mar 2006 16:46:27 -0800 (PST) David S. Miller wrote:

 From: Randy.Dunlap [EMAIL PROTECTED]
 Date: Wed, 8 Mar 2006 09:16:08 -0800
 
  From: Randy Dunlap [EMAIL PROTECTED]
  
  A recent change to compat. dev_ifconf() in fs/compat_ioctl.c
  causes ifconf data to be truncated 1 entry too early when copying it
  to userspace.  The correct amount of data (length) is returned,
  but the final entry is empty (zero, not filled in).
  The for-loop 'i' check should use = to allow the final struct
  ifreq32 to be copied.  I also used the ifconf-corruption program
  in kernel bugzilla #4746 to make sure that this change does not
  re-introduce the corruption.
  
  Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
 
 Good catch, applied.  Thanks Randy.
 
 Is this one relevant for -stable?

Yes, IMO.  Have to wait for it to be merged upstream, right?

---
~Randy
-
To unsubscribe from this list: send 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] compat. ifconf: fix limits

2006-03-08 Thread David S. Miller
From: Randy.Dunlap [EMAIL PROTECTED]
Date: Wed, 8 Mar 2006 17:41:16 -0800

 On Wed, 08 Mar 2006 16:46:27 -0800 (PST) David S. Miller wrote:
 
  Is this one relevant for -stable?
 
 Yes, IMO.  Have to wait for it to be merged upstream, right?

I'll take care of everything, thanks Randy.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Andi Kleen
Andrew Morton [EMAIL PROTECTED] writes:
 
 x86_64 is signed 32-bit!

I'll change it. You want signed 64bit?

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


Re: [patch 1/4] net: percpufy frequently used vars -- add percpu_counter_mod_bh

2006-03-08 Thread Andrew Morton
Andi Kleen [EMAIL PROTECTED] wrote:

 Andrew Morton [EMAIL PROTECTED] writes:
  
  x86_64 is signed 32-bit!
 
 I'll change it. You want signed 64bit?
 

Well it's all random at present.  Since the API is defined as unsigned I
guess it's be best to make it unsigned for now.  Later, when someone gets
down to making it signed and reviewing all the users they can flip x86_64
to signed along with the rest of the architectures.

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


Re: [Patch 1/1] updated: TCP/UDP getpeersec

2006-03-08 Thread Xiaolan Zhang
Hi, James,

I am working on a separate patch for Unix datagram, instead of mixing the 
two into one patch.

thanks,
Catherine

James Morris [EMAIL PROTECTED] wrote on 03/08/2006 09:56:33 PM:

 On Wed, 8 Mar 2006, David S. Miller wrote:
 
  I thought James still had some objections?
  James?
 
 Is this the patch from a few weeks back?  If so, it needs updating to 
 support Unix datagram.
 
 
 - James
 -- 
 James Morris
 [EMAIL PROTECTED]
 
 

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


[PATCH netdev-2.6 ] e100: Fix eeh on pseries during ethtool -t

2006-03-08 Thread Jeff Kirsher
This patch was diff'd against the latest 'upstream' branch from Garzik's tree.  
This patch can be pulled from the following location:

git://198.78.49.142/linux-2.6.git e100-upstream

Jeff - should a patch be made for 2.6.16 also?

Olaf Hering reported a problem on pseries with e100 where ethtool -t would 
cause a bus error, and the e100 driver would stop working.  Due to the new load 
ucode command the cb list must be allocated before calling e100_init_hw, so 
remove the call and just let e100_up take care of it.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Jeff Kirsher [EMAIL PROTECTED]
---

 drivers/net/e100.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index ed13f72..4707972 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2154,6 +2154,9 @@ static int e100_loopback_test(struct nic
 
msleep(10);
 
+   pci_dma_sync_single_for_cpu(nic-pdev, nic-rx_to_clean-dma_addr,
+RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+
if(memcmp(nic-rx_to_clean-skb-data + sizeof(struct rfd),
   skb-data, ETH_DATA_LEN))
err = -EAGAIN;
@@ -2161,8 +2164,8 @@ static int e100_loopback_test(struct nic
 err_loopback_none:
mdio_write(nic-netdev, nic-mii.phy_id, MII_BMCR, 0);
nic-loopback = lb_none;
-   e100_hw_init(nic);
e100_clean_cbs(nic);
+   e100_hw_reset(nic);
 err_clean_rx:
e100_rx_clean_list(nic);
return err;

-
To unsubscribe from this list: send 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 14/16] ipw2200: wireless extension sensitivity threshold support

2006-03-08 Thread Zhu Yi
On Wed, 2006-03-08 at 13:23 +0100, Jiri Benc wrote:
 On Wed, 8 Mar 2006 13:34:10 +0800, Zhu Yi wrote:
  +3.2 iwconfig sens
  +---
  +
  +The 'iwconfig ethX sens XX' command will not set the signal sensitivity
  +threshold, as described in iwconfig documentation, but rather the number
  +of consecutive missed beacons that will trigger handover, i.e. roaming
  +to another access point. At the same time, it will set the disassociation
  +threshold to 3 times the given value.
 
 I don't think it's a good idea to misuse 'iwconfig sens' for this.

This has been discussed on ipw2100-devel ML. Jean will change the manual
for 'iwconfig sens'.
http://marc.theaimsgroup.com/?l=ipw2100-develm=114141001301586w=2

Thanks,
-yi

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


potential leak in tun_get_user

2006-03-08 Thread Dave Jones
We're leaking an skb in a failure path in this function.

Coverity #632
Signed-off-by: Dave Jones [EMAIL PROTECTED]

--- linux-2.6/drivers/net/tun.c~2006-03-08 22:43:54.0 -0500
+++ linux-2.6/drivers/net/tun.c 2006-03-08 22:46:16.0 -0500
@@ -249,8 +249,11 @@ static __inline__ ssize_t tun_get_user(s
 
if (align)
skb_reserve(skb, align);
-   if (memcpy_fromiovec(skb_put(skb, len), iv, len))
+   if (memcpy_fromiovec(skb_put(skb, len), iv, len)) {
+   tun-stats.rx_dropped++;
+   kfree_skb(skb);
return -EFAULT;
+   }
 
skb-dev = tun-dev;
switch (tun-flags  TUN_TYPE_MASK) {

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


Re: [GIT PATCH] TIPC updates

2006-03-08 Thread David S. Miller
From: Per Liden [EMAIL PROTECTED]
Date: Wed, 8 Mar 2006 17:05:08 +0100 (CET)

 On Wed, 8 Mar 2006, David S. Miller wrote:
 
  From: Per Liden [EMAIL PROTECTED]
  Date: Wed, 8 Mar 2006 11:18:15 +0100 (CET)
  
   Here is a set of patches for net-2.6.17.
   
   Please pull from:
   
 git://tipc.cslab.ericsson.net/pub/git/tipc.git
  
  Looks good, but I can't pull it cleanly.
 
 Ok, looks like git://git.kernel.org is still not in sync, but I managed to 
 resync over http instead. Please retry the pull. Should be clean now.

It's still broken, please clone a fresh tree, add your patches
on top of that, then ask me to re-pull.

When I rebase the tree, it destroys all of the object hashes.
So you cannot use an old pre-rebase tree, and expect pulls
to work for me into the rebased tree.

I'm sorry this is such a pain in the butt, but I like to rebase
from time to time to clear out all the merge noise and cleanly
get networking bug fixes that I have sent upstream since the
most recent rebase.

If this is too difficult, just send me patches.

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


Re: [PATCH 1/3] bridge-netfilter: whitespace fix

2006-03-08 Thread David S. Miller
From: Stephen Hemminger [EMAIL PROTECTED]
Date: Mon, 6 Feb 2006 14:39:18 -0800

 This applies after the RCU fix patches; it can be held until 2.6.17.
 Run br_netfilter through Lindent to fix whitespace.
 
 Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]

This patch set doesn't apply cleanly, please regenerate.
Thanks a lot.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Bugme-new] [Bug 6177] New: Java remote debugging is slow due to apparent networking bug

2006-03-08 Thread Stephen Hemminger
I am not sure if it is the same problem, but I am now able to reproduce 
slowness

if I use eclipse and debug something. It is annoying, but not fatal.

If I turn off TCP appropriate byte count:
   sudo sysctl -w net.ipv4.tcp_abc=0
then the problem goes away. See RFC 3465
http://www.apps.ietf.org/rfc/rfc3465.html
for a description.

I have gotten massive strace's and the java VM is:
   1) Turning on TCP_NODELAY
   2) Sending small packets.

So I think we are counting the small packets now counting against it and 
it getting

blocked.  There are a several possible options:
1) Ship with TCP ABC = 0 off -- bad because no one ever changes things to be
   more fair.
2) Ship with TCP ABC set 2 -- makes it more aggressive, that may work.
3) Tweak TCP to know more about the loopback interface so it has bigger cwnd
4) Fix java

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


Re: [Bugme-new] [Bug 6177] New: Java remote debugging is slow due to apparent networking bug

2006-03-08 Thread David S. Miller
From: Stephen Hemminger [EMAIL PROTECTED]
Date: Wed, 08 Mar 2006 23:24:22 -0800

 I have gotten massive strace's and the java VM is:
 1) Turning on TCP_NODELAY
 2) Sending small packets.

Java is doing the wrong thing, obviously.

 4) Fix java

And this is the only reasonable recourse.

You cannot turn on TCP_NODELAY and expect good performance
when sending out small packets.  You are asking for low
latency and no delaying of packets in order to allow larger
ones to accumulate.

The kernel is doing exactly what Java is asking it to do.

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