[PATCHv2] net: sh_eth: Add su pport for Renesas SuperH Ethernet

2008-02-07 Thread Yoshihiro Shimoda
Add support for Renesas SuperH Ethernet controller.
This driver supported SH7710 and SH7712.

Signed-off-by: Yoshihiro Shimoda [EMAIL PROTECTED]
---
 drivers/net/Kconfig  |   12
 drivers/net/Makefile |1
 drivers/net/sh_eth.c | 1178 +
 drivers/net/sh_eth.h |  468 
 4 files changed, 1659 insertions(+)

diff -uprN a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig   2008-02-07 16:15:46.0 +0900
+++ b/drivers/net/Kconfig   2008-02-07 16:20:52.0 +0900
@@ -512,6 +512,18 @@ config STNIC

  If unsure, say N.

+config SH_ETH
+   tristate Renesas SuperH Ethernet support
+   depends on SUPERH  \
+   (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712)
+   select CRC32
+   select MII
+   select MDIO_BITBANG
+   select PHYLIB
+   help
+ Renesas SuperH Ethernet device driver.
+ This driver support SH7710 and SH7712.
+
 config SUNLANCE
tristate Sun LANCE support
depends on SBUS
diff -uprN a/drivers/net/Makefile b/drivers/net/Makefile
--- a/drivers/net/Makefile  2008-02-07 16:15:46.0 +0900
+++ b/drivers/net/Makefile  2008-02-07 16:20:53.0 +0900
@@ -80,6 +80,7 @@ obj-$(CONFIG_VIA_RHINE) += via-rhine.o
 obj-$(CONFIG_VIA_VELOCITY) += via-velocity.o
 obj-$(CONFIG_ADAPTEC_STARFIRE) += starfire.o
 obj-$(CONFIG_RIONET) += rionet.o
+obj-$(CONFIG_SH_ETH) += sh_eth.o

 #
 # end link order section
diff -uprN a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
--- a/drivers/net/sh_eth.c  1970-01-01 09:00:00.0 +0900
+++ b/drivers/net/sh_eth.c  2008-02-07 16:20:54.0 +0900
@@ -0,0 +1,1178 @@
+/*
+ *  SuperH Ethernet device driver
+ *
+ *  Copyright (C) 2006,2007 Nobuhiro Iwamatsu
+ *  Copyright (C) 2008 Renesas Solutions Corp.
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms and conditions of the GNU General Public License,
+ *  version 2, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope it will be useful, but WITHOUT
+ *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ *  more details.
+ *  You should have received a copy of the GNU General Public License along 
with
+ *  this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *  The full GNU General Public License is included in this distribution in
+ *  the file called COPYING.
+ */
+
+#include linux/version.h
+#include linux/init.h
+#include linux/dma-mapping.h
+#include linux/etherdevice.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/mdio-bitbang.h
+#include linux/netdevice.h
+#include linux/phy.h
+#include asm/cache.h
+#include asm/io.h
+#include sh_eth.h
+
+/*
+ * Program the hardware MAC address from dev-dev_addr.
+ */
+static void __init update_mac_address(struct net_device *ndev)
+{
+   u32 ioaddr = ndev-base_addr;
+
+   ctrl_outl((ndev-dev_addr[0]  24) | (ndev-dev_addr[1]  16) |
+ (ndev-dev_addr[2]  8) | (ndev-dev_addr[3]),
+ ioaddr + MAHR);
+   ctrl_outl((ndev-dev_addr[4]  8) | (ndev-dev_addr[5]),
+ ioaddr + MALR);
+}
+
+/*
+ * Get MAC address from SuperH MAC address register
+ *
+ * SuperH's Ethernet device doesn't have 'ROM' to MAC address.
+ * This driver get MAC address that use by bootloader(U-boot or sh-ipl+g).
+ * When you want use this device, you must set MAC address in bootloader.
+ *
+ */
+static void __init read_mac_address(struct net_device *ndev)
+{
+   u32 ioaddr = ndev-base_addr;
+
+   ndev-dev_addr[0] = (ctrl_inl(ioaddr + MAHR)  24);
+   ndev-dev_addr[1] = (ctrl_inl(ioaddr + MAHR)  16)  0xFF;
+   ndev-dev_addr[2] = (ctrl_inl(ioaddr + MAHR)  8)  0xFF;
+   ndev-dev_addr[3] = (ctrl_inl(ioaddr + MAHR)  0xFF);
+   ndev-dev_addr[4] = (ctrl_inl(ioaddr + MALR)  8)  0xFF;
+   ndev-dev_addr[5] = (ctrl_inl(ioaddr + MALR)  0xFF);
+}
+
+struct bb_info {
+   struct mdiobb_ctrl ctrl;
+   u32 addr;
+   u32 mmd_msk;/* MMD */
+   u32 mdo_msk;
+   u32 mdi_msk;
+   u32 mdc_msk;
+};
+
+/* PHY bit set */
+static void bb_set(u32 addr, u32 msk)
+{
+   ctrl_outl(ctrl_inl(addr) | msk, addr);
+}
+
+/* PHY bit clear */
+static void bb_clr(u32 addr, u32 msk)
+{
+   ctrl_outl((ctrl_inl(addr)  ~msk), addr);
+}
+
+/* PHY bit read */
+static int bb_read(u32 addr, u32 msk)
+{
+   return (ctrl_inl(addr)  msk) != 0;
+}
+
+/* Data I/O pin control */
+static inline void sh__mmd_ctrl(struct mdiobb_ctrl *ctrl, int bit)
+{
+   struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
+   if (bit)
+   bb_set(bitbang-addr, bitbang-mmd_msk);
+   else
+   bb_clr(bitbang-addr, bitbang-mmd_msk);
+}
+
+/* Set bit data*/

Re: [PATCHv2] net: sh_eth: Add support for Renesas SuperH Ethernet

2008-02-07 Thread Andrew Morton
On Thu, 07 Feb 2008 17:39:23 +0900 Yoshihiro Shimoda [EMAIL PROTECTED] wrote:

 Add support for Renesas SuperH Ethernet controller.
 This driver supported SH7710 and SH7712.
 

Nice looking driver.

Quick comments:

 ...

 +/*
 + * Program the hardware MAC address from dev-dev_addr.
 + */
 +static void __init update_mac_address(struct net_device *ndev)
 +{
 + u32 ioaddr = ndev-base_addr;
 +
 + ctrl_outl((ndev-dev_addr[0]  24) | (ndev-dev_addr[1]  16) |
 +   (ndev-dev_addr[2]  8) | (ndev-dev_addr[3]),
 +   ioaddr + MAHR);
 + ctrl_outl((ndev-dev_addr[4]  8) | (ndev-dev_addr[5]),
 +   ioaddr + MALR);
 +}
 +
 +/*
 + * Get MAC address from SuperH MAC address register
 + *
 + * SuperH's Ethernet device doesn't have 'ROM' to MAC address.
 + * This driver get MAC address that use by bootloader(U-boot or sh-ipl+g).
 + * When you want use this device, you must set MAC address in bootloader.
 + *
 + */
 +static void __init read_mac_address(struct net_device *ndev)
 +{
 + u32 ioaddr = ndev-base_addr;
 +
 + ndev-dev_addr[0] = (ctrl_inl(ioaddr + MAHR)  24);
 + ndev-dev_addr[1] = (ctrl_inl(ioaddr + MAHR)  16)  0xFF;
 + ndev-dev_addr[2] = (ctrl_inl(ioaddr + MAHR)  8)  0xFF;
 + ndev-dev_addr[3] = (ctrl_inl(ioaddr + MAHR)  0xFF);
 + ndev-dev_addr[4] = (ctrl_inl(ioaddr + MALR)  8)  0xFF;
 + ndev-dev_addr[5] = (ctrl_inl(ioaddr + MALR)  0xFF);
 +}

Both the above functions are called from non-__init code and hence cannot
be __init.  sh_eth_tsu_init() is wrong too.  Please check all section
annotations in the driver.

 +struct bb_info {
 + struct mdiobb_ctrl ctrl;
 + u32 addr;
 + u32 mmd_msk;/* MMD */
 + u32 mdo_msk;
 + u32 mdi_msk;
 + u32 mdc_msk;
 +};

Please cc David Brownell on updates to this driver - perhaps he will find
time to review the bit-banging interface usage.

 +/* PHY bit set */
 +static void bb_set(u32 addr, u32 msk)
 +{
 + ctrl_outl(ctrl_inl(addr) | msk, addr);
 +}
 +
 +/* PHY bit clear */
 +static void bb_clr(u32 addr, u32 msk)
 +{
 + ctrl_outl((ctrl_inl(addr)  ~msk), addr);
 +}
 +
 +/* PHY bit read */
 +static int bb_read(u32 addr, u32 msk)
 +{
 + return (ctrl_inl(addr)  msk) != 0;
 +}
 +
 +/* Data I/O pin control */
 +static inline void sh__mmd_ctrl(struct mdiobb_ctrl *ctrl, int bit)
 +{
 + struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
 + if (bit)
 + bb_set(bitbang-addr, bitbang-mmd_msk);
 + else
 + bb_clr(bitbang-addr, bitbang-mmd_msk);
 +}
 +
 +/* Set bit data*/
 +static inline void sh__set_mdio(struct mdiobb_ctrl *ctrl, int bit)
 +{
 + struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
 +
 + if (bit)
 + bb_set(bitbang-addr, bitbang-mdo_msk);
 + else
 + bb_clr(bitbang-addr, bitbang-mdo_msk);
 +}
 +
 +/* Get bit data*/
 +static inline int sh__get_mdio(struct mdiobb_ctrl *ctrl)
 +{
 + struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
 + return bb_read(bitbang-addr, bitbang-mdi_msk);
 +}

There seems to be a fairly random mixture of inline and non-inline here. 
I'd suggest that you just remove all the `inline's.  The compiler does a
pretty good job of working doing this for you.

 +/* MDC pin control */
 +static inline void sh__mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit)
 +{
 + struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
 +
 + if (bit)
 + bb_set(bitbang-addr, bitbang-mdc_msk);
 + else
 + bb_clr(bitbang-addr, bitbang-mdc_msk);
 +}
 +
 +/* mdio bus control struct */
 +static struct mdiobb_ops bb_ops = {
 + .owner = THIS_MODULE,
 + .set_mdc = sh__mdc_ctrl,
 + .set_mdio_dir = sh__mmd_ctrl,
 + .set_mdio_data = sh__set_mdio,
 + .get_mdio_data = sh__get_mdio,
 +};

It's particularly inappropriate that sh__mdc_ctrl() was inlined - it is
only ever called via a function pointer and hence will never be inlined!

 ...

 +static void sh_eth_timer(unsigned long data)
 +{
 + struct net_device *ndev = (struct net_device *)data;
 + struct sh_eth_private *mdp = netdev_priv(ndev);
 + int next_tick = 10 * HZ;
 +
 + /* We could do something here... nah. */
 + mdp-timer.expires = jiffies + next_tick;
 + add_timer(mdp-timer);

mod_timer() would be neater here.

 +}

 ...

 +
 +/* network device open function */
 +static int sh_eth_open(struct net_device *ndev)
 +{
 + int ret = 0;
 + struct sh_eth_private *mdp = netdev_priv(ndev);
 +
 + ret = request_irq(ndev-irq, sh_eth_interrupt, 0, ndev-name, ndev);
 + if (ret) {
 + printk(KERN_ERR Can not assign IRQ number to %s\n, CARDNAME);
 + return ret;
 + }
 +
 + /* Descriptor set */
 + ret = sh_eth_ring_init(ndev);
 + if (ret)
 + goto out_free_irq;
 +
 + /* device init */
 + ret = sh_eth_dev_init(ndev);
 + if (ret)
 + goto out_free_irq;
 +
 + /* 

Re: [PATCH] Add IPv6 support to TCP SYN cookies

2008-02-07 Thread Eric Dumazet

Evgeniy Polyakov a écrit :

On Wed, Feb 06, 2008 at 10:30:24AM -0800, Glenn Griffin ([EMAIL PROTECTED]) 
wrote:
  

+static u32 cookie_hash(struct in6_addr *saddr, struct in6_addr *daddr,
+  __be16 sport, __be16 dport, u32 count, int c)
+{
+   __u32 tmp[16 + 5 + SHA_WORKSPACE_WORDS];


This huge buffer should not be allocated on stack.
  

I can replace it will a kmalloc, but for my benefit what's the practical
size we try and limit the stack to?  It seemed at first glance to me
that 404 bytes plus the arguments, etc. was not such a large buffer for
a non-recursive function.  Plus the alternative with a kmalloc requires



Well, maybe for connection establishment path it is not, but it is
absolutely the case in the sending and sometimes receiving pathes for 4k
stacks. The main problem is that bugs which happen because of stack
overflow are so much obscure, that it is virtually impossible to detect
where overflow happend. 'Debug stack overflow' somehow does not help to
detect it.

Usually there is about 1-1.5 kb of free stack for each process, so this
change will cut one third of the free stack, getting into account that
something can store ipv6 addresses on stack too, this can end up badly.

  

propogating the possible error status back up to tcp_ipv6.c in the event
we are unable to allocate enough memory, so it can simply drop the
connection.  Not an impossible task by any means but it does
significantly complicate things and I would like to know it's worth the
effort.  Also would it be worth it to provide a supplemental patch for
the ipv4 implementation as it allocates the same buffer?



One can reorganize syncookie support to work with request hash tables
too, so that we could allocate per hash-bucket space and use it as a
scratchpad for cookies.

  

Or maybe use percpu storage for that...

I am not sure if cookie_hash() is always called with preemption disabled.
(If not, we have to use get_cpu_var()/put_cpu_var())

[NET] IPV4: lower stack usage in cookie_hash() function

400 bytes allocated on stack might be a litle bit too much. Using a 
per_cpu var is more friendly.


Signed-off-by: Eric Dumazet [EMAIL PROTECTED]


diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index f470fe4..177da14 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -35,10 +35,12 @@ module_init(init_syncookies);
 #define COOKIEBITS 24  /* Upper bits store count */
 #define COOKIEMASK (((__u32)1  COOKIEBITS) - 1)
 
+static DEFINE_PER_CPU(__u32, cookie_scratch)[16 + 5 + SHA_WORKSPACE_WORDS];
+
 static u32 cookie_hash(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport,
   u32 count, int c)
 {
-   __u32 tmp[16 + 5 + SHA_WORKSPACE_WORDS];
+   __u32 *tmp = __get_cpu_var(cookie_scratch);
 
memcpy(tmp + 3, syncookie_secret[c], sizeof(syncookie_secret[c]));
tmp[0] = (__force u32)saddr;


Re: [patch 2.6.24-git] net/enc28j60: oops fix

2008-02-07 Thread Claudio Lanconelli

David Brownell wrote:

Prevent oops on enc28j60 packet RX:  make sure buffers are aligned.
Not all architectures support unaligned accesses in kernel space.

Signed-off-by: David Brownell [EMAIL PROTECTED]
  


Acked-by: Claudio Lanconelli [EMAIL PROTECTED]


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

--- a/drivers/net/enc28j60.c2008-02-06 09:29:00.0 -0800
+++ b/drivers/net/enc28j60.c2008-02-06 09:30:03.0 -0800
@@ -900,7 +900,7 @@ static void enc28j60_hw_rx(struct net_de
if (RSV_GETBIT(rxstat, RSV_LENCHECKERR))
ndev-stats.rx_frame_errors++;
} else {
-   skb = dev_alloc_skb(len);
+   skb = dev_alloc_skb(len + NET_IP_ALIGN);
if (!skb) {
if (netif_msg_rx_err(priv))
dev_err(ndev-dev,
@@ -908,6 +908,7 @@ static void enc28j60_hw_rx(struct net_de
ndev-stats.rx_dropped++;
} else {
skb-dev = ndev;
+   skb_reserve(skb, NET_IP_ALIGN);
/* copy the packet from the receive buffer */
enc28j60_mem_read(priv, priv-next_pk_ptr + sizeof(rsv),
len, skb_put(skb, len));


  


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


Re: [patch 2.6.24-git] net/enc28j60: low power mode

2008-02-07 Thread Claudio Lanconelli

David Brownell wrote:

The driver seemed to already have some goofage there:

  # ifconfig eth1 up
  net eth1: link down
  net eth1: link down
  net eth1: normal mode
  net eth1: multicast mode
  net eth1: multicast mode
  #

  

Without low power patch I have:

# ifconfig eth0 up
net eth0: link down
net eth0: normal mode
net eth0: multicast mode
net eth0: multicast mode
# net eth0: link up - Half duplex


I'd normally expect it not to go down when told to go up, and
then only to do the multicast thing once ...
  

multicast is called by network stacks, no control by the driver. The driver
just print message.
I don't know why enc28j60_set_multicast_list() are called more than once.

When you do an ifconfig up the driver reset the chip, so you see link down
before link up message.



  
In such cases If I dump the counters with ifconfig I got rx error 
counter  0 and the RX and TX packets counters are freezed.
Actually I don't know what causes the freeze, it needs investigation. 
The cause can be the rx error condition or the power down/up commands.

May be receiving packets while it's going to wakeup causes problems.



The enc28j60_setlink() was odd too.  It insists the link be down
before changing duplex, then brings the link up ... so I had to
put it down again to maintain the lowpower if not up invariant.

But the way it brings the link up is to enc28j60_hw_init(), which
it also does when bringing the link up.  So there's no need to
bring the link up when changing duplex ...


  

I don't follow you anymore.
To change duplex mode the link must be down.
enc28j60_setlink() reinitialize the chip with new duplex mode,
enc28j60_hw_init() never brings link up.

I propose you to add set_lowpower(true) in the enc28j60_probe() and in 
the enc28j60_net_close() after enc28j60_hw_disable().

Probably we don't need to set_lowpower(false) in enc28j60_net_open() since
it performs a soft reset with enc28j60_hw_init().
Do you agree?




use
if(netif_msg_drv(priv)) ...
Doing so we can switch on/off messages runtime using ethtool.



OK, although there's still a role for -DDEBUG compile-time
mesage removal.

  

It's ok to use

if(netif_msg_drv(priv)) dev_dbv(...



This driver also abuses __FUNCTION__ (general policy:  don't use it)
  

Why?

Then there should be a single routine for all such busy-wait loops,
so each such usage doesn't need to be open-coded.  Less space, and
more obviously correct.  I'll add one and make phy_read() use it too.

  

Ok

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


[PATCH 6/7] PS3: gelic: Add support for dual network interface

2008-02-07 Thread Masakazu Mokuno
PS3: gelic: Add support for dual network interface

Add support for dual network (net_device) interface so that ethernet
and wireless can own separate ethX interfaces.

V2
  - Fix the bug that bringing down and up the interface keeps rx
disabled.
  - Make 'gelic_net_poll_controller()' extern , as David Woodhouse
pointed out at the previous submission.
  - Fix weird usage of member names for the rx descriptor chain
V1
  - Export functions which are convenient for both interfaces
  - Move irq allocation/release code to driver probe/remove handlers
because interfaces share interrupts.
  - Allocate skbs by using dev_alloc_skb() instead of netdev_alloc_skb()
as the interfaces share the hardware rx queue.
  - Add gelic_port struct in order to abstract dual interface handling
  - Change handlers for hardware queues so that they can handle dual
{source,destination} interfaces.
  - Use new NAPI functions
This is a prerequisite for the new PS3 wireless support.

 drivers/net/ps3_gelic_net.c |  765 +++-
 drivers/net/ps3_gelic_net.h |  108 +-
 2 files changed, 564 insertions(+), 309 deletions(-)

--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -48,27 +48,22 @@
 #include ps3_gelic_net.h
 
 #define DRV_NAME Gelic Network Driver
-#define DRV_VERSION 1.0
+#define DRV_VERSION 1.1
 
 MODULE_AUTHOR(SCE Inc.);
 MODULE_DESCRIPTION(Gelic Network driver);
 MODULE_LICENSE(GPL);
 
-static inline struct device *ctodev(struct gelic_card *card)
-{
-   return card-dev-core;
-}
-static inline u64 bus_id(struct gelic_card *card)
-{
-   return card-dev-bus_id;
-}
-static inline u64 dev_id(struct gelic_card *card)
-{
-   return card-dev-dev_id;
-}
+
+static inline void gelic_card_enable_rxdmac(struct gelic_card *card);
+static inline void gelic_card_disable_rxdmac(struct gelic_card *card);
+static inline void gelic_card_disable_txdmac(struct gelic_card *card);
+static inline void gelic_card_reset_chain(struct gelic_card *card,
+ struct gelic_descr_chain *chain,
+ struct gelic_descr *start_descr);
 
 /* set irq_mask */
-static int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask)
+int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask)
 {
int status;
 
@@ -76,20 +71,23 @@ static int gelic_card_set_irq_mask(struc
mask, 0);
if (status)
dev_info(ctodev(card),
-lv1_net_set_interrupt_mask failed %d\n, status);
+%s failed %d\n, __func__, status);
return status;
 }
+
 static inline void gelic_card_rx_irq_on(struct gelic_card *card)
 {
-   gelic_card_set_irq_mask(card, card-ghiintmask | GELIC_CARD_RXINT);
+   card-irq_mask |= GELIC_CARD_RXINT;
+   gelic_card_set_irq_mask(card, card-irq_mask);
 }
 static inline void gelic_card_rx_irq_off(struct gelic_card *card)
 {
-   gelic_card_set_irq_mask(card, card-ghiintmask  ~GELIC_CARD_RXINT);
+   card-irq_mask = ~GELIC_CARD_RXINT;
+   gelic_card_set_irq_mask(card, card-irq_mask);
 }
 
-static void
-gelic_card_get_ether_port_status(struct gelic_card *card, int inform)
+static void gelic_card_get_ether_port_status(struct gelic_card *card,
+int inform)
 {
u64 v2;
struct net_device *ether_netdev;
@@ -100,7 +98,7 @@ gelic_card_get_ether_port_status(struct 
card-ether_port_status, v2);
 
if (inform) {
-   ether_netdev = card-netdev;
+   ether_netdev = card-netdev[GELIC_PORT_ETHERNET];
if (card-ether_port_status  GELIC_LV1_ETHER_LINK_UP)
netif_carrier_on(ether_netdev);
else
@@ -108,6 +106,48 @@ gelic_card_get_ether_port_status(struct 
}
 }
 
+void gelic_card_up(struct gelic_card *card)
+{
+   pr_debug(%s: called\n, __func__);
+   down(card-updown_lock);
+   if (atomic_inc_return(card-users) == 1) {
+   pr_debug(%s: real do\n, __func__);
+   /* enable irq */
+   gelic_card_set_irq_mask(card, card-irq_mask);
+   /* start rx */
+   gelic_card_enable_rxdmac(card);
+
+   napi_enable(card-napi);
+   }
+   up(card-updown_lock);
+   pr_debug(%s: done\n, __func__);
+}
+
+void gelic_card_down(struct gelic_card *card)
+{
+   u64 mask;
+   pr_debug(%s: called\n, __func__);
+   down(card-updown_lock);
+   if (atomic_dec_if_positive(card-users) == 0) {
+   pr_debug(%s: real do\n, __func__);
+   napi_disable(card-napi);
+   /*
+* Disable irq. Wireless interrupts will
+* be disabled later if any
+*/
+   mask = card-irq_mask  (GELIC_CARD_WLAN_EVENT_RECEIVED |
+

[PATCH 4/7] PS3: gelic: remove duplicated ethtool handlers

2008-02-07 Thread Masakazu Mokuno
PS3: gelic: remove duplicated ethtool handlers

Remove some ethtool handlers, which duplicate functionality that was already
provided by the common ethtool handlers.

Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |   43 +++
 1 file changed, 3 insertions(+), 40 deletions(-)

--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -1196,28 +1196,6 @@ static int gelic_ether_get_settings(stru
return 0;
 }
 
-static u32 gelic_ether_get_link(struct net_device *netdev)
-{
-   struct gelic_card *card = netdev_priv(netdev);
-   int status;
-   u64 v1, v2;
-   int link;
-
-   status = lv1_net_control(bus_id(card), dev_id(card),
-GELIC_LV1_GET_ETH_PORT_STATUS,
-GELIC_LV1_VLAN_TX_ETHERNET, 0, 0,
-v1, v2);
-   if (status)
-   return 0; /* link down */
-
-   if (v1  GELIC_LV1_ETHER_LINK_UP)
-   link = 1;
-   else
-   link = 0;
-
-   return link;
-}
-
 static int gelic_net_nway_reset(struct net_device *netdev)
 {
if (netif_running(netdev)) {
@@ -1227,21 +1205,6 @@ static int gelic_net_nway_reset(struct n
return 0;
 }
 
-static u32 gelic_net_get_tx_csum(struct net_device *netdev)
-{
-   return (netdev-features  NETIF_F_IP_CSUM) != 0;
-}
-
-static int gelic_net_set_tx_csum(struct net_device *netdev, u32 data)
-{
-   if (data)
-   netdev-features |= NETIF_F_IP_CSUM;
-   else
-   netdev-features = ~NETIF_F_IP_CSUM;
-
-   return 0;
-}
-
 static u32 gelic_net_get_rx_csum(struct net_device *netdev)
 {
struct gelic_card *card = netdev_priv(netdev);
@@ -1260,10 +1223,10 @@ static int gelic_net_set_rx_csum(struct 
 static struct ethtool_ops gelic_net_ethtool_ops = {
.get_drvinfo= gelic_net_get_drvinfo,
.get_settings   = gelic_ether_get_settings,
-   .get_link   = gelic_ether_get_link,
+   .get_link   = ethtool_op_get_link,
.nway_reset = gelic_net_nway_reset,
-   .get_tx_csum= gelic_net_get_tx_csum,
-   .set_tx_csum= gelic_net_set_tx_csum,
+   .get_tx_csum= ethtool_op_get_tx_csum,
+   .set_tx_csum= ethtool_op_set_tx_csum,
.get_rx_csum= gelic_net_get_rx_csum,
.set_rx_csum= gelic_net_set_rx_csum,
 };


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


[PATCH 1/7] PS3: gelic: Fix the wrong dev_id passed

2008-02-07 Thread Masakazu Mokuno
PS3: gelic: Fix the wrong dev_id passed

The device id for lv1_net_set_interrupt_status_indicator() is wrong.
This path would be invoked only in the case of an initialization failure.

Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -1512,7 +1512,7 @@ static int ps3_gelic_driver_probe (struc
 
 fail_setup_netdev:
lv1_net_set_interrupt_status_indicator(bus_id(card),
-  bus_id(card),
+  dev_id(card),
   0 , 0);
 fail_status_indicator:
ps3_dma_region_free(dev-d_region);


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


[PATCH 0/7] PS3: gelic: gelic updates and wireless support

2008-02-07 Thread Masakazu Mokuno
Hi,

This set is a collection of patches I submitted before in this ML on
last December and a patch that adds the wireless support to PS3.

The wireless bit (#7) is already ACKed by John [EMAIL PROTECTED]
and Dan [EMAIL PROTECTED].  The ethernet bits have been reviewed and
have no obvious outstanding comments.

Please apply for 2.6.25.

[1] PS3: gelic: Fix the wrong dev_id passed
[2] PS3: gelic: Add endianness macros
[3] PS3: gelic: Code cleanup
[4] PS3: gelic: Remove duplicated ethtool handlers
[5] PS3: gelic: Add support for port link status
[6] PS3: gelic: Add support for dual network interface
[7] PS3: gelic: Add wireless support for PS3


-- 
Masakazu MOKUNO

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


Re: [patch 2.6.24-git] net/enc28j60: oops fix, low power mode

2008-02-07 Thread Claudio Lanconelli

David Brownell wrote:

How long did that take?  I did about four dozen

ifconfig eth1 up
sleep 3
ifconfig eth1 down

cycles ... it worked fine.  The sleep was to let the link
negotiation complete.

  

After a couple of :

ifconfig eth0 down
(wait just 1 second)
ifconfig eth0 up

the network is frozen.

If I do another
ifconfig eth0 down
(wait just 1 second)
ifconfig eth0 up

restarts.
It's random, no rule.

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


[PATCH 2/7] PS3: gelic: Add endianness macros

2008-02-07 Thread Masakazu Mokuno
PS3: gelic: Add endianness macros

Mark the members of the structure for DMA descriptors with proper endian
annotations and use the appropriate accessor macros.
As the gelic driver works only on PS3, all these macros will be
expanded to null.

Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |   70 
 drivers/net/ps3_gelic_net.h |   16 +-
 2 files changed, 47 insertions(+), 39 deletions(-)

--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -98,7 +98,7 @@ gelic_net_get_descr_status(struct gelic_
 {
u32 cmd_status;
 
-   cmd_status = descr-dmac_cmd_status;
+   cmd_status = be32_to_cpu(descr-dmac_cmd_status);
cmd_status = GELIC_NET_DESCR_IND_PROC_SHIFT;
return cmd_status;
 }
@@ -117,13 +117,13 @@ static void gelic_net_set_descr_status(s
u32 cmd_status;
 
/* read the status */
-   cmd_status = descr-dmac_cmd_status;
+   cmd_status = be32_to_cpu(descr-dmac_cmd_status);
/* clean the upper 4 bits */
cmd_status = GELIC_NET_DESCR_IND_PROC_MASKO;
/* add the status to it */
cmd_status |= ((u32)status)  GELIC_NET_DESCR_IND_PROC_SHIFT;
/* and write it back */
-   descr-dmac_cmd_status = cmd_status;
+   descr-dmac_cmd_status = cpu_to_be32(cmd_status);
/*
 * dma_cmd_status field is used to indicate whether the descriptor
 * is valid or not.
@@ -193,7 +193,7 @@ static int gelic_net_init_chain(struct g
/* chain bus addr of hw descriptor */
descr = start_descr;
for (i = 0; i  no; i++, descr++) {
-   descr-next_descr_addr = descr-next-bus_addr;
+   descr-next_descr_addr = cpu_to_be32(descr-next-bus_addr);
}
 
chain-head = start_descr;
@@ -245,7 +245,7 @@ static int gelic_net_prepare_rx_descr(st
 %s:allocate skb failed !!\n, __func__);
return -ENOMEM;
}
-   descr-buf_size = bufsize;
+   descr-buf_size = cpu_to_be32(bufsize);
descr-dmac_cmd_status = 0;
descr-result_size = 0;
descr-valid_size = 0;
@@ -256,9 +256,10 @@ static int gelic_net_prepare_rx_descr(st
if (offset)
skb_reserve(descr-skb, GELIC_NET_RXBUF_ALIGN - offset);
/* io-mmu-map the skb */
-   descr-buf_addr = dma_map_single(ctodev(card), descr-skb-data,
-GELIC_NET_MAX_MTU,
-DMA_FROM_DEVICE);
+   descr-buf_addr = cpu_to_be32(dma_map_single(ctodev(card),
+descr-skb-data,
+GELIC_NET_MAX_MTU,
+DMA_FROM_DEVICE));
if (!descr-buf_addr) {
dev_kfree_skb_any(descr-skb);
descr-skb = NULL;
@@ -284,7 +285,7 @@ static void gelic_net_release_rx_chain(s
do {
if (descr-skb) {
dma_unmap_single(ctodev(card),
-descr-buf_addr,
+be32_to_cpu(descr-buf_addr),
 descr-skb-len,
 DMA_FROM_DEVICE);
descr-buf_addr = 0;
@@ -353,10 +354,11 @@ static void gelic_net_release_tx_descr(s
 {
struct sk_buff *skb = descr-skb;
 
-   BUG_ON(!(descr-data_status  (1  GELIC_NET_TXDESC_TAIL)));
+   BUG_ON(!(be32_to_cpu(descr-data_status) 
+(1  GELIC_NET_TXDESC_TAIL)));
 
-   dma_unmap_single(ctodev(card), descr-buf_addr, skb-len,
-DMA_TO_DEVICE);
+   dma_unmap_single(ctodev(card),
+be32_to_cpu(descr-buf_addr), skb-len, DMA_TO_DEVICE);
dev_kfree_skb_any(skb);
 
descr-buf_addr = 0;
@@ -610,28 +612,29 @@ static void gelic_net_set_txdescr_cmdsta
  struct sk_buff *skb)
 {
if (skb-ip_summed != CHECKSUM_PARTIAL)
-   descr-dmac_cmd_status = GELIC_NET_DMAC_CMDSTAT_NOCS |
-   GELIC_NET_DMAC_CMDSTAT_END_FRAME;
+   descr-dmac_cmd_status =
+   cpu_to_be32(GELIC_NET_DMAC_CMDSTAT_NOCS |
+   GELIC_NET_DMAC_CMDSTAT_END_FRAME);
else {
/* is packet ip?
 * if yes: tcp? udp? */
if (skb-protocol == htons(ETH_P_IP)) {
if (ip_hdr(skb)-protocol == IPPROTO_TCP)
descr-dmac_cmd_status =
-   GELIC_NET_DMAC_CMDSTAT_TCPCS |
-   GELIC_NET_DMAC_CMDSTAT_END_FRAME;
+   cpu_to_be32(GELIC_NET_DMAC_CMDSTAT_TCPCS |
+   

[PATCH 3/7] PS3: gelic: code cleanup

2008-02-07 Thread Masakazu Mokuno
PS3: gelic: code cleanup

Code cleanup:
 - Use appropriate prefixes for names instead of fixed 'gelic_net'
   so that objects of the functions, variables and constants can be estimated.
 - Remove definitions for IPSec offload to the gelic hardware.  This
   functionality is never supported on PS3.
 - Group constants with enum.
 - Use bitwise constants for interrupt status, instead of bit numbers to
   eliminate shift operations.
 - Style fixes.
Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |  464 +---
 drivers/net/ps3_gelic_net.h |  283 +++---
 2 files changed, 389 insertions(+), 358 deletions(-)

--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -54,21 +54,21 @@ MODULE_AUTHOR(SCE Inc.);
 MODULE_DESCRIPTION(Gelic Network driver);
 MODULE_LICENSE(GPL);
 
-static inline struct device *ctodev(struct gelic_net_card *card)
+static inline struct device *ctodev(struct gelic_card *card)
 {
return card-dev-core;
 }
-static inline u64 bus_id(struct gelic_net_card *card)
+static inline u64 bus_id(struct gelic_card *card)
 {
return card-dev-bus_id;
 }
-static inline u64 dev_id(struct gelic_net_card *card)
+static inline u64 dev_id(struct gelic_card *card)
 {
return card-dev-dev_id;
 }
 
 /* set irq_mask */
-static int gelic_net_set_irq_mask(struct gelic_net_card *card, u64 mask)
+static int gelic_card_set_irq_mask(struct gelic_card *card, u64 mask)
 {
int status;
 
@@ -79,51 +79,40 @@ static int gelic_net_set_irq_mask(struct
 lv1_net_set_interrupt_mask failed %d\n, status);
return status;
 }
-static inline void gelic_net_rx_irq_on(struct gelic_net_card *card)
+static inline void gelic_card_rx_irq_on(struct gelic_card *card)
 {
-   gelic_net_set_irq_mask(card, card-ghiintmask | GELIC_NET_RXINT);
+   gelic_card_set_irq_mask(card, card-ghiintmask | GELIC_CARD_RXINT);
 }
-static inline void gelic_net_rx_irq_off(struct gelic_net_card *card)
+static inline void gelic_card_rx_irq_off(struct gelic_card *card)
 {
-   gelic_net_set_irq_mask(card, card-ghiintmask  ~GELIC_NET_RXINT);
+   gelic_card_set_irq_mask(card, card-ghiintmask  ~GELIC_CARD_RXINT);
 }
 /**
- * gelic_net_get_descr_status -- returns the status of a descriptor
+ * gelic_descr_get_status -- returns the status of a descriptor
  * @descr: descriptor to look at
  *
  * returns the status as in the dmac_cmd_status field of the descriptor
  */
-static enum gelic_net_descr_status
-gelic_net_get_descr_status(struct gelic_net_descr *descr)
+static enum gelic_descr_dma_status
+gelic_descr_get_status(struct gelic_descr *descr)
 {
-   u32 cmd_status;
-
-   cmd_status = be32_to_cpu(descr-dmac_cmd_status);
-   cmd_status = GELIC_NET_DESCR_IND_PROC_SHIFT;
-   return cmd_status;
+   return be32_to_cpu(descr-dmac_cmd_status)  GELIC_DESCR_DMA_STAT_MASK;
 }
 
 /**
- * gelic_net_set_descr_status -- sets the status of a descriptor
+ * gelic_descr_set_status -- sets the status of a descriptor
  * @descr: descriptor to change
  * @status: status to set in the descriptor
  *
  * changes the status to the specified value. Doesn't change other bits
  * in the status
  */
-static void gelic_net_set_descr_status(struct gelic_net_descr *descr,
-  enum gelic_net_descr_status status)
+static void gelic_descr_set_status(struct gelic_descr *descr,
+  enum gelic_descr_dma_status status)
 {
-   u32 cmd_status;
-
-   /* read the status */
-   cmd_status = be32_to_cpu(descr-dmac_cmd_status);
-   /* clean the upper 4 bits */
-   cmd_status = GELIC_NET_DESCR_IND_PROC_MASKO;
-   /* add the status to it */
-   cmd_status |= ((u32)status)  GELIC_NET_DESCR_IND_PROC_SHIFT;
-   /* and write it back */
-   descr-dmac_cmd_status = cpu_to_be32(cmd_status);
+   descr-dmac_cmd_status = cpu_to_be32(status |
+   (be32_to_cpu(descr-dmac_cmd_status) 
+~GELIC_DESCR_DMA_STAT_MASK));
/*
 * dma_cmd_status field is used to indicate whether the descriptor
 * is valid or not.
@@ -134,24 +123,24 @@ static void gelic_net_set_descr_status(s
 }
 
 /**
- * gelic_net_free_chain - free descriptor chain
+ * gelic_card_free_chain - free descriptor chain
  * @card: card structure
  * @descr_in: address of desc
  */
-static void gelic_net_free_chain(struct gelic_net_card *card,
-struct gelic_net_descr *descr_in)
+static void gelic_card_free_chain(struct gelic_card *card,
+ struct gelic_descr *descr_in)
 {
-   struct gelic_net_descr *descr;
+   struct gelic_descr *descr;
 
for (descr = descr_in; descr  descr-bus_addr; descr = descr-next) {
dma_unmap_single(ctodev(card), descr-bus_addr,
-GELIC_NET_DESCR_SIZE, DMA_BIDIRECTIONAL);
+

[PATCH 5/7] PS3: gelic: add support for port link status

2008-02-07 Thread Masakazu Mokuno
PS3: gelic: add support for port link status

Add support for interrupt driven port link status detection.

Signed-off-by: Masakazu Mokuno [EMAIL PROTECTED]
---
 drivers/net/ps3_gelic_net.c |   77 
 drivers/net/ps3_gelic_net.h |2 +
 2 files changed, 52 insertions(+), 27 deletions(-)

--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -87,6 +87,28 @@ static inline void gelic_card_rx_irq_off
 {
gelic_card_set_irq_mask(card, card-ghiintmask  ~GELIC_CARD_RXINT);
 }
+
+static void
+gelic_card_get_ether_port_status(struct gelic_card *card, int inform)
+{
+   u64 v2;
+   struct net_device *ether_netdev;
+
+   lv1_net_control(bus_id(card), dev_id(card),
+   GELIC_LV1_GET_ETH_PORT_STATUS,
+   GELIC_LV1_VLAN_TX_ETHERNET, 0, 0,
+   card-ether_port_status, v2);
+
+   if (inform) {
+   ether_netdev = card-netdev;
+   if (card-ether_port_status  GELIC_LV1_ETHER_LINK_UP)
+   netif_carrier_on(ether_netdev);
+   else
+   netif_carrier_off(ether_netdev);
+   }
+}
+
+
 /**
  * gelic_descr_get_status -- returns the status of a descriptor
  * @descr: descriptor to look at
@@ -1032,6 +1054,10 @@ static irqreturn_t gelic_card_interrupt(
gelic_card_kick_txdma(card, card-tx_chain.tail);
spin_unlock_irqrestore(card-tx_dma_lock, flags);
}
+
+   /* ether port status changed */
+   if (status  GELIC_CARD_PORT_STATUS_CHANGED)
+   gelic_card_get_ether_port_status(card, 1);
return IRQ_HANDLED;
 }
 
@@ -1128,13 +1154,14 @@ static int gelic_net_open(struct net_dev
napi_enable(card-napi);
 
card-tx_dma_progress = 0;
-   card-ghiintmask = GELIC_CARD_RXINT | GELIC_CARD_TXINT;
+   card-ghiintmask = GELIC_CARD_RXINT | GELIC_CARD_TXINT |
+   GELIC_CARD_PORT_STATUS_CHANGED;
 
gelic_card_set_irq_mask(card, card-ghiintmask);
gelic_card_enable_rxdmac(card);
 
netif_start_queue(netdev);
-   netif_carrier_on(netdev);
+   gelic_card_get_ether_port_status(card, 1);
 
return 0;
 
@@ -1157,39 +1184,35 @@ static int gelic_ether_get_settings(stru
struct ethtool_cmd *cmd)
 {
struct gelic_card *card = netdev_priv(netdev);
-   int status;
-   u64 v1, v2;
-   int speed, duplex;
 
-   speed = duplex = -1;
-   status = lv1_net_control(bus_id(card), dev_id(card),
-GELIC_LV1_GET_ETH_PORT_STATUS,
-GELIC_LV1_VLAN_TX_ETHERNET, 0, 0,
-v1, v2);
-   if (status) {
-   /* link down */
-   } else {
-   if (v1  GELIC_LV1_ETHER_FULL_DUPLEX) {
-   duplex = DUPLEX_FULL;
-   } else {
-   duplex = DUPLEX_HALF;
-   }
+   gelic_card_get_ether_port_status(card, 0);
 
-   if (v1  GELIC_LV1_ETHER_SPEED_10) {
-   speed = SPEED_10;
-   } else if (v1  GELIC_LV1_ETHER_SPEED_100) {
-   speed = SPEED_100;
-   } else if (v1  GELIC_LV1_ETHER_SPEED_1000) {
-   speed = SPEED_1000;
-   }
+   if (card-ether_port_status  GELIC_LV1_ETHER_FULL_DUPLEX)
+   cmd-duplex = DUPLEX_FULL;
+   else
+   cmd-duplex = DUPLEX_HALF;
+
+   switch (card-ether_port_status  GELIC_LV1_ETHER_SPEED_MASK) {
+   case GELIC_LV1_ETHER_SPEED_10:
+   cmd-speed = SPEED_10;
+   break;
+   case GELIC_LV1_ETHER_SPEED_100:
+   cmd-speed = SPEED_100;
+   break;
+   case GELIC_LV1_ETHER_SPEED_1000:
+   cmd-speed = SPEED_1000;
+   break;
+   default:
+   pr_info(%s: speed unknown\n, __func__);
+   cmd-speed = SPEED_10;
+   break;
}
+
cmd-supported = SUPPORTED_TP | SUPPORTED_Autoneg |
SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full;
cmd-advertising = cmd-supported;
-   cmd-speed = speed;
-   cmd-duplex = duplex;
cmd-autoneg = AUTONEG_ENABLE; /* always enabled */
cmd-port = PORT_TP;
 
--- a/drivers/net/ps3_gelic_net.h
+++ b/drivers/net/ps3_gelic_net.h
@@ -261,6 +261,8 @@ struct gelic_card {
atomic_t tx_timeout_task_counter;
wait_queue_head_t waitq;
 
+   u64 ether_port_status;
+
struct gelic_descr *tx_top, *rx_top;
struct gelic_descr descr[0];
 };


--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  

Re: [patch 2.6.24-git] net/enc28j60: low power mode

2008-02-07 Thread Claudio Lanconelli

Sorry,
let me repeat what I said in previous mail.
I propose you to add set_lowpower(true) in the enc28j60_probe() and in 
the enc28j60_net_close() after enc28j60_hw_disable().

Probably we don't need to set_lowpower(false) in enc28j60_net_open() since
it performs a soft reset with enc28j60_hw_init() (not sure).

Furthermore, as you suggested, we also need to remove hw_init() from the 
setlink()

because hw_init() is called when we bring link up.

--- enc28j60.c 20 Dec 2007 10:47:01 - 1.22
+++ enc28j60.c 7 Feb 2008 11:07:20 -
@@ -740,12 +740,6 @@
if (!priv-hw_enable) {
if (autoneg == AUTONEG_DISABLE  speed == SPEED_10) {
priv-full_duplex = (duplex == DUPLEX_FULL);
- if (!enc28j60_hw_init(priv)) {
- if (netif_msg_drv(priv))
- dev_err(ndev-dev,
- hw_reset() failed\n);
- ret = -EINVAL;
- }
} else {
if (netif_msg_link(priv))
dev_warn(ndev-dev,

Can you update your low power patch with these modifications?

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


[RFC] [IPV4][IPV6][TCP] remove skb-dev NULL assignation in tcp_v[4|6]_rcv functions

2008-02-07 Thread Daniel Lezcano


Subject: [RFC] remove skb-dev NULL assignation
From: Daniel Lezcano [EMAIL PROTECTED]

I was trying to figure out why in the tcp_v4_rcv/tcp_v6_rcv function,
the skb-dev field is set to NULL. There is certainly a good reason,
but I was not able to find it.

Is it possible to remove this ?

Signed-off-by: Daniel Lezcano [EMAIL PROTECTED]
---
 net/ipv4/tcp_ipv4.c |2 --
 net/ipv6/tcp_ipv6.c |2 --
 2 files changed, 4 deletions(-)

Index: net-2.6/net/ipv4/tcp_ipv4.c
===
--- net-2.6.orig/net/ipv4/tcp_ipv4.c
+++ net-2.6/net/ipv4/tcp_ipv4.c
@@ -1661,8 +1661,6 @@ process:
 	if (sk_filter(sk, skb))
 		goto discard_and_relse;
 
-	skb-dev = NULL;
-
 	bh_lock_sock_nested(sk);
 	ret = 0;
 	if (!sock_owned_by_user(sk)) {
Index: net-2.6/net/ipv6/tcp_ipv6.c
===
--- net-2.6.orig/net/ipv6/tcp_ipv6.c
+++ net-2.6/net/ipv6/tcp_ipv6.c
@@ -1722,8 +1722,6 @@ process:
 	if (sk_filter(sk, skb))
 		goto discard_and_relse;
 
-	skb-dev = NULL;
-
 	bh_lock_sock_nested(sk);
 	ret = 0;
 	if (!sock_owned_by_user(sk)) {


Re: [patch 2.6.24-git] net/enc28j60: section fix

2008-02-07 Thread Claudio Lanconelli

David Brownell wrote:

Minor bugfixes to the enc28j60 driver ... wrong section marking and
indentation, and bogus use of spi_bus_type.  (Setting the bus type
of a driver is a SPI framework responsibility.)

Signed-off-by: David Brownell [EMAIL PROTECTED]
  


Acked-by: Claudio Lanconelli [EMAIL PROTECTED]

---
Bonus patch.

 drivers/net/enc28j60.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/net/enc28j60.c
+++ b/drivers/net/enc28j60.c
@@ -1555,7 +1555,7 @@ error_alloc:
return ret;
 }
 
-static int enc28j60_remove(struct spi_device *spi)

+static int __devexit enc28j60_remove(struct spi_device *spi)
 {
struct enc28j60_net *priv = dev_get_drvdata(spi-dev);
 
@@ -1572,9 +1572,8 @@ static int enc28j60_remove(struct spi_de

 static struct spi_driver enc28j60_driver = {
.driver = {
   .name = DRV_NAME,
-  .bus = spi_bus_type,
   .owner = THIS_MODULE,
-  },
+},
.probe = enc28j60_probe,
.remove = __devexit_p(enc28j60_remove),
 };


  


--
To unsubscribe from this list: send 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] [IPV4][IPV6][TCP] remove skb-dev NULL assignation in tcp_v[4|6]_rcv functions

2008-02-07 Thread David Miller
From: Daniel Lezcano [EMAIL PROTECTED]
Date: Thu, 07 Feb 2008 12:17:27 +0100

 Subject: [RFC] remove skb-dev NULL assignation
 
 I was trying to figure out why in the tcp_v4_rcv/tcp_v6_rcv function,
 the skb-dev field is set to NULL. There is certainly a good reason,
 but I was not able to find it.
 
 Is it possible to remove this ?
 
 Signed-off-by: Daniel Lezcano [EMAIL PROTECTED]

It is illegal to reference a device outside of the netif_receive_skb()
code path without taking a reference to it.

Since we are queueing it to a socket, we have to NULL out the skb-dev
since thee packets lifetime is being expanded outside of that allowed
window.
--
To unsubscribe from this list: send 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: [bisected] Re: [bug] networking broke, ssh: connect to port 22: Protocol error

2008-02-07 Thread Ingo Molnar

* Casey Schaufler [EMAIL PROTECTED] wrote:

  So unlike some other security modules like SELINUX, enabling SMACK 
  breaks un-aware userspace and breaks TCP networking?
  
  I dont think that's expected behavior - and i'd definitely like to 
  enable SMACK in automated tests to check for regressions, etc.
 
 As Stephen mentions later, Smack uses CIPSO. sshd does not like any IP 
 options because of traceroute, and must be built with that check 
 disabled with the current Smack version. I have been looking at using 
 unlabeled packets for the ambient label, it appears that doing so 
 would make life simpler. I will get right on it.

ok - feel free to send me any patches to test.

Ingo
--
To unsubscribe from this list: send 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] rtnetlink.c: send a single notification on device state changes

2008-02-07 Thread Laszlo Attila Toth
In do_setlink() a single notification is sent at the end of the function
if any modification occured. If the address has been changed, another
notification is sent.

Both of them is required because originally only the NETDEV_CHANGEADDR
notification was sent and although device state change implies address
change, some programs may expect the original notification. It remains
for compatibity.

If set_operstate() is called from do_setlink(), it doesn't send
a notification, only if it is called from rtnl_create_link() as earlier.

Signed-off-by: Laszlo Attila Toth [EMAIL PROTECTED]
---
 net/core/rtnetlink.c |   36 ++--
 1 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 61ac8d0..ecb02af 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -504,7 +504,7 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct 
dst_entry *dst, u32 id,
 
 EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo);
 
-static void set_operstate(struct net_device *dev, unsigned char transition)
+static int set_operstate(struct net_device *dev, unsigned char transition, 
bool send_notification)
 {
unsigned char operstate = dev-operstate;
 
@@ -527,8 +527,12 @@ static void set_operstate(struct net_device *dev, unsigned 
char transition)
write_lock_bh(dev_base_lock);
dev-operstate = operstate;
write_unlock_bh(dev_base_lock);
-   netdev_state_change(dev);
-   }
+
+   if (send_notification)
+   netdev_state_change(dev);
+   return 1;
+   } else
+   return 0;
 }
 
 static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
@@ -822,6 +826,7 @@ static int do_setlink(struct net_device *dev, struct 
ifinfomsg *ifm,
if (tb[IFLA_BROADCAST]) {
nla_memcpy(dev-broadcast, tb[IFLA_BROADCAST], dev-addr_len);
send_addr_notify = 1;
+   modified = 1;
}
 
if (ifm-ifi_flags || ifm-ifi_change) {
@@ -834,16 +839,23 @@ static int do_setlink(struct net_device *dev, struct 
ifinfomsg *ifm,
dev_change_flags(dev, flags);
}
 
-   if (tb[IFLA_TXQLEN])
-   dev-tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+   if (tb[IFLA_TXQLEN]) {
+   if (dev-tx_queue_len != nla_get_u32(tb[IFLA_TXQLEN])) {
+   dev-tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+   modified = 1;
+   }
+   }
 
if (tb[IFLA_OPERSTATE])
-   set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
+   modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), 
false);
 
if (tb[IFLA_LINKMODE]) {
-   write_lock_bh(dev_base_lock);
-   dev-link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
-   write_unlock_bh(dev_base_lock);
+   if (dev-link_mode != nla_get_u8(tb[IFLA_LINKMODE])) {
+   write_lock_bh(dev_base_lock);
+   dev-link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
+   write_lock_bh(dev_base_lock);
+   modified = 1;
+   }
}
 
err = 0;
@@ -857,6 +869,10 @@ errout:
 
if (send_addr_notify)
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
+
+   if (modified)
+   netdev_state_change(dev);
+
return err;
 }
 
@@ -974,7 +990,7 @@ struct net_device *rtnl_create_link(struct net *net, char 
*ifname,
if (tb[IFLA_TXQLEN])
dev-tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
if (tb[IFLA_OPERSTATE])
-   set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
+   set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), true);
if (tb[IFLA_LINKMODE])
dev-link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
 
-- 
1.5.2.5

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


[BUG][AX25] Fwd: SMP with AX.25

2008-02-07 Thread Jarek Poplawski
On Wed, Feb 06, 2008 at 07:45:29AM +, Jarek Poplawski wrote:
...
 From: Jann Traschewski [EMAIL PROTECTED]
 Subject: SMP with AX.25

(testing patch #2)

According to some OOPSes reported by Jann it seems ax25_kick
tries to clone NULL skbs sometimes. Probably there is needed
a sock lock, but until it's checked more this patch should
help to avoid this. There are probably also cases where ax25
-paclen == 0 can happen: let's check for this.

I attach this patch for testing purpose only.

Jarek P.

---

diff -Nurp 2.6.24-/net/ax25/ax25_out.c 2.6.24+/net/ax25/ax25_out.c
--- 2.6.24-/net/ax25/ax25_out.c 2008-01-24 22:58:37.0 +
+++ 2.6.24+/net/ax25/ax25_out.c 2008-02-07 11:48:39.0 +
@@ -117,6 +117,12 @@ void ax25_output(ax25_cb *ax25, int pacl
unsigned char *p;
int frontlen, len, fragno, ka9qfrag, first = 1;
 
+   if (paclen  16) {
+   WARN_ON_ONCE(1);
+   kfree_skb(skb);
+   return;
+   }
+
if ((skb-len - 1)  paclen) {
if (*skb-data == AX25_P_TEXT) {
skb_pull(skb, 1); /* skip PID */
@@ -263,6 +269,8 @@ void ax25_kick(ax25_cb *ax25)
 * Dequeue the frame and copy it.
 */
skb  = skb_dequeue(ax25-write_queue);
+   if (!skb)
+   return;
 
do {
if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] Remove unnecessary locks from rtnetlink

2008-02-07 Thread Laszlo Attila Toth

David Miller írta:

From: Laszlo Attila Toth [EMAIL PROTECTED]
Date: Fri,  1 Feb 2008 17:07:33 +0100


The do_setlink() function is protected by rtnl, additional locks are 
unnecessary.
and the set_operstate() function is called from protected parts. Locks removed
from both functions.

The set_operstate() is also called from rtnl_create_link() and from no other 
places.
In rtnl_create_link() none of the changes is protected by set_lock_bh() except
inside set_operstate(), different locking scheme is not necessary
for the operstate.

Signed-off-by: Laszlo Attila Toth [EMAIL PROTECTED]


The protection using dev_base_lock() is needed.

When analyzing cases like this you need to also look at other code
paths outside of rtnetlink that access -operstate and -link_mode,
you obviously didn't do this.

For example, net/core/net-sysfs.c takes a read lock on dev_base_lock
in order to fetch a stable copy of both netif_running() and
dev-operstate at the same time.

Similar write locking to protect dev-operstate is made by
net/core/link_watch.c:rfc2863_policy(), for the same reason rtnetlink
has to make this locking.

You therefore cannot remove it.


Thanks for your answer, yes, unfortunatelly I checked only inside 
rtnetlink.c


--
Attila
--
To unsubscribe from this list: send 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] ctcm: infrastructure for replaced ctc driver

2008-02-07 Thread Rick Troth
On Thu, 7 Feb 2008, Christoph Hellwig wrote:
 ...
  +/*
  + * drivers/s390/net/ctcm_dbug.c
  + *
  + * Copyright IBM Corp. 2001, 2007
  + * Authors:Peter Tiedemann ([EMAIL PROTECTED])
  + *
  + */

 Please don't mention filenames in the top of file comments.
 On the other hand a little description of what this file
 does would be quite useful.  (This comment applies to all
 files in this patch)

Better descriptions, yes.  Of course.
But are you saying to NOT name the file in its comments?
I am surprised.  If I am reading correctly, then I disagree.

Is the exclusion of the name of the source file from its comments
a stylistic decision the other kernel developers have agreed to?
Or is it tied to automation?  Or have I (hopefully) misunderstood?

-- R;   

()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments



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


Re: [PATCH] [resend] 3c509: convert to isa_driver and pnp_driver v3

2008-02-07 Thread Marc Zyngier
 Ondrej == Ondrej Zary [EMAIL PROTECTED] writes:

Ondrej Tested using 3 ISA cards in various combinations of PnP and non-PnP 
modes.

Ondrej  #ifdef CONFIG_EISA
Ondrej ret = eisa_driver_register(el3_eisa_driver);
Ondrej +   if (!ret)
Ondrej +   eisa_registeted = 1;
Ondrej  #endif
^^^

You probably should at least test-compile this driver with CONFIG_EISA
enabled...

Regards,

M.
-- 
And if you don't know where you're going, any road will take you there...
--
To unsubscribe from this list: send 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] [IPV4][IPV6][TCP] remove skb-dev NULL assignation in tcp_v[4|6]_rcv functions

2008-02-07 Thread Daniel Lezcano

David Miller wrote:

From: Daniel Lezcano [EMAIL PROTECTED]
Date: Thu, 07 Feb 2008 12:17:27 +0100


Subject: [RFC] remove skb-dev NULL assignation

I was trying to figure out why in the tcp_v4_rcv/tcp_v6_rcv function,
the skb-dev field is set to NULL. There is certainly a good reason,
but I was not able to find it.

Is it possible to remove this ?

Signed-off-by: Daniel Lezcano [EMAIL PROTECTED]


It is illegal to reference a device outside of the netif_receive_skb()
code path without taking a reference to it.

Since we are queueing it to a socket, we have to NULL out the skb-dev
since thee packets lifetime is being expanded outside of that allowed
window.


Got it. Thank you very much.
--
To unsubscribe from this list: send 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 01/24 for-2.6.25] DM9000: Fix endian-ness of data accesses. Patch from: Laurent Pinchart [EMAIL PROTECTED]

2008-02-07 Thread Christoph Hellwig
On Tue, Feb 05, 2008 at 12:02:00AM +, Ben Dooks wrote:
 This patch splits the receive status in 8bit wide fields and convert the
 packet length from little endian to CPU byte order.
 
 Signed-off-by: Laurent Pinchart [EMAIL PROTECTED]
 Signed-off-by: Ben Dooks [EMAIL PROTECTED]
 
 Index: linux-2.6.24-git5-dm9k/drivers/net/dm9000.c
 ===
 --- linux-2.6.24-git5-dm9k.orig/drivers/net/dm9000.c
 +++ linux-2.6.24-git5-dm9k/drivers/net/dm9000.c
 @@ -867,7 +867,8 @@ dm9000_timer(unsigned long data)
  }
  
  struct dm9000_rxhdr {
 - u16 RxStatus;
 + u8  RxPktReady;
 + u8  RxStatus;
   u16 RxLen;

thgis should be __le16.  Also please install sparse and do a

make C=2 CHECKFLAGS=-D__CHECK_ENDIAN__

run over the driver to make sure all hw structures are properly
annotated and you do byteswaps consistantly.

--
To unsubscribe from this list: send 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 01/24 for-2.6.25] DM9000: Fix endian-ness of data accesses. Patch from: Laurent Pinchart [EMAIL PROTECTED]

2008-02-07 Thread Laurent Pinchart
On Wednesday 06 February 2008 12:46, Jeff Garzik wrote:
 two comments:

 1) you should be using __le16 type

 2) seems like you should do the same for RxStatus, rather than splitting it

The DM9000 datasheet (or rather the application notes) describes two distinct 
fields, even though they both contain some kind of status information.

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75


pgp4F3bh4jbhk.pgp
Description: PGP signature


[patch 2/3] af_iucv: broken send_skb_q results in endless loop

2008-02-07 Thread Ursula Braun
From: Ursula Braun [EMAIL PROTECTED]

A race has been detected in iucv_callback_txdone().
skb_unlink has to be done inside the locked area.

In addition checkings for successful allocations are inserted.

Signed-off-by: Ursula Braun [EMAIL PROTECTED]
---

 net/iucv/af_iucv.c |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff -urpN linux-2.6/net/iucv/af_iucv.c linux-2.6-patched/net/iucv/af_iucv.c
--- linux-2.6/net/iucv/af_iucv.c2008-02-07 13:24:12.0 +0100
+++ linux-2.6-patched/net/iucv/af_iucv.c2008-02-07 13:24:38.0 
+0100
@@ -482,6 +482,10 @@ static int iucv_sock_connect(struct sock
/* Create path. */
iucv-path = iucv_path_alloc(IUCV_QUEUELEN_DEFAULT,
 IPRMDATA, GFP_KERNEL);
+   if (!iucv-path) {
+   err = -ENOMEM;
+   goto done;
+   }
err = iucv_path_connect(iucv-path, af_iucv_handler,
sa-siucv_user_id, NULL, user_data, sk);
if (err) {
@@ -1094,6 +1098,8 @@ static void iucv_callback_rx(struct iucv
 
 save_message:
save_msg = kzalloc(sizeof(struct sock_msg_q), GFP_ATOMIC | GFP_DMA);
+   if (!save_msg)
+   return;
save_msg-path = path;
save_msg-msg = *msg;
 
@@ -1118,10 +1124,10 @@ static void iucv_callback_txdone(struct 
this = list_skb;
list_skb = list_skb-next;
} while (memcmp(msg-tag, this-cb, 4)  list_skb);
+   __skb_unlink(this, list);
 
spin_unlock_irqrestore(list-lock, flags);
 
-   skb_unlink(this, iucv_sk(sk)-send_skb_q);
kfree_skb(this);
}
 

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


[patch 3/3] af_iucv: defensive programming of iucv_callback_txdone

2008-02-07 Thread Ursula Braun
From: Ursula Braun [EMAIL PROTECTED]

The loop in iucv_callback_txdone presumes existence of an entry
with msg-tag in the send_skb_q list. In error cases this
assumption might be wrong and might cause an endless loop.
Loop is rewritten to guarantee loop end in case of missing
msg-tag entry in send_skb_q.

Signed-off-by: Ursula Braun [EMAIL PROTECTED]
---

 net/iucv/af_iucv.c |   21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

diff -urpN linux-2.6/net/iucv/af_iucv.c linux-2.6-patched/net/iucv/af_iucv.c
--- linux-2.6/net/iucv/af_iucv.c2008-02-07 13:24:39.0 +0100
+++ linux-2.6-patched/net/iucv/af_iucv.c2008-02-07 13:24:39.0 
+0100
@@ -1112,24 +1112,31 @@ static void iucv_callback_txdone(struct 
 struct iucv_message *msg)
 {
struct sock *sk = path-private;
-   struct sk_buff *this;
+   struct sk_buff *this = NULL;
struct sk_buff_head *list = iucv_sk(sk)-send_skb_q;
struct sk_buff *list_skb = list-next;
unsigned long flags;
 
-   if (list_skb) {
+   if (!skb_queue_empty(list)) {
spin_lock_irqsave(list-lock, flags);
 
-   do {
-   this = list_skb;
+   while (list_skb != (struct sk_buff *)list) {
+   if (!memcmp(msg-tag, list_skb-cb, 4)) {
+   this = list_skb;
+   break;
+   }
list_skb = list_skb-next;
-   } while (memcmp(msg-tag, this-cb, 4)  list_skb);
-   __skb_unlink(this, list);
+   }
+   if (this)
+   __skb_unlink(this, list);
 
spin_unlock_irqrestore(list-lock, flags);
 
-   kfree_skb(this);
+   if (this)
+   kfree_skb(this);
}
+   if (!this)
+   printk(KERN_ERR AF_IUCV msg tag %u not found\n, msg-tag);
 
if (sk-sk_state == IUCV_CLOSING) {
if (skb_queue_empty(iucv_sk(sk)-send_skb_q)) {

-- 
--
To unsubscribe from this list: send 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 01/24 for-2.6.25] DM9000: Fix endian-ness of data accesses. Patch from: Laurent Pinchart [EMAIL PROTECTED]

2008-02-07 Thread Jeff Garzik

Laurent Pinchart wrote:

On Wednesday 06 February 2008 12:46, Jeff Garzik wrote:

two comments:

1) you should be using __le16 type

2) seems like you should do the same for RxStatus, rather than splitting it


The DM9000 datasheet (or rather the application notes) describes two distinct 
fields, even though they both contain some kind of status information.


Sure, there are plenty of distinct fields, just like with every chipset. 
 That doesn't mean byte instructions are the best choice.


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] New device for DM9601 usb net driver

2008-02-07 Thread Robert Brockway
Hi Peter.  I've verified that the Hirose USB-100 (0x0a47, 0x9601) is a 
clone of the DAVICOM DM9601.  I patched dm9601.c to identify this device 
and now have these in production.  Unified diff against 2.6.24 attached.


Cheers,

Rob

--
With sufficient thrust, pigs fly just fine...
-- RFC 1925 The Twelve Networking Truths--- drivers/net/usb/dm9601.c.old	2008-01-27 00:51:50.0 -0500
+++ drivers/net/usb/dm9601.c	2008-02-07 10:27:40.0 -0500
@@ -590,6 +590,10 @@ static const struct usb_device_id produc
 	 USB_DEVICE(0x0a46, 0x8515),	/* ADMtek ADM8515 USB NIC */
 	 .driver_info = (unsigned long)dm9601_info,
 	 },
+	{
+	USB_DEVICE(0x0a47, 0x9601),/* Hirose USB-100 */
+	.driver_info = (unsigned long)dm9601_info,
+	},
 	{},			// END
 };
 


[PATCH] [IPV6] Minor cleanup: remove unused definitions in net/ip6_fib.h

2008-02-07 Thread Rami Rosen
Hi,

This patch removes some unused definitions and one method typedef
declaration (f_pnode)
in include/net/ip6_fib.h, as they are not used in the kernel.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index d8d85b1..953d604 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -150,19 +150,6 @@ struct rt6_statistics {
  *
  */
 
-#define RTPRI_FIREWALL 8   /* Firewall control information */
-#define RTPRI_FLOW 16  /* Flow based forwarding rules  */
-#define RTPRI_KERN_CTL 32  /* Kernel control routes*/
-
-#define RTPRI_USER_MIN 256 /* Mimimum user priority*/
-#define RTPRI_USER_MAX 1024/* Maximum user priority*/
-
-#define RTPRI_KERN_DFLT4096/* Kernel default routes
*/
-
-#defineMAX_FLOW_BACKTRACE  32
-
-
-typedef void   (*f_pnode)(struct fib6_node *fn, void *);
 
 struct fib6_table {
struct hlist_node   tb6_hlist;


Re: Bug? Kernels 2.6.2x drops TCP packets over wireless (independentof card used)

2008-02-07 Thread Marcin Koziej
  I have problem with wireless network connectivity;
  TCP connections hang and timeout before all data is read.
  
  Problem description:
  I am connected to the network via hotspot wifi router:
  ath0  IEEE 802.11g  ESSID:hotspot  Nickname:
Mode:Managed  Frequency:2.462 GHz  Access Point: 
  00:60:B3:6C:A1:2E   
Bit Rate:11 Mb/s   Tx-Power:17 dBm   Sensitivity=1/1  
Retry:off   RTS thr:off   Fragment thr:off
Power Management:off
Link Quality=19/70  Signal level=-77 dBm  Noise level=-96 dBm
Rx invalid nwid:43882  Rx invalid crypt:0  Rx invalid frag:0
Tx excessive retries:0  Invalid misc:0   Missed beacon:0
  
  ICMP and UDP protocols seem to work (provided by 0% packet loss 
  ping to router (and internet servers), and a working DNS resolver)
  However, when I try to connect to a TCP service, for example FTP or HTTP, 
  the
  connection is made, request 
  sent but truncated answer (or no answer) ever read back.
  
  For example: 
  # ftp ftp.icm.edu.pl
  Connected to ftp.icm.edu.pl (193.219.28.140).
  220-
  (hangs)
  
  The packet dump is:
  23:56:08.807674 IP 192.168.1.2.51909  sunsite2.icm.edu.pl.ftp: S
  980196671:980196671(0) win 5840 mss 1460,sackOK,timestamp 1971553 
  0,nop,wscale 5
  0x:  4500 003c 885e 4000 4006 124c c0a8 0102  E..[EMAIL 
  PROTECTED]@..L
  0x0010:  c1db 1c8c cac5 0015 3a6c 9d3f    :l.?
  0x0020:  a002 16d0 d91a  0204 05b4 0402 080a  
  0x0030:  001e 1561   0103 0305...a
  23:56:08.821639 IP sunsite2.icm.edu.pl.ftp  192.168.1.2.51909: S
  2723526584:2723526584(0) ack 980196672 win 5792 mss 1460,sackOK,timestamp
  983901832 1971553,nop,wscale 7
  0x:  4500 003c  4000 3c06 9eaa c1db 1c8c  E..[EMAIL 
  PROTECTED]...
  0x0010:  c0a8 0102 0015 cac5 a255 b7b8 3a6c 9d40  .U..:l.@
  0x0020:  a012 16a0 1dfc  0204 05b4 0402 080a  
  0x0030:  3aa5 2688 001e 1561 0103 0307:.a
  23:56:08.821685 IP 192.168.1.2.51909  sunsite2.icm.edu.pl.ftp: . ack 1 win 
  183
  nop,nop,timestamp 1971567 983901832
  0x:  4500 0034 885f 4000 4006 1253 c0a8 0102  [EMAIL 
  PROTECTED]@..S
  0x0010:  c1db 1c8c cac5 0015 3a6c 9d40 a255 b7b9  :[EMAIL 
  PROTECTED]
  0x0020:  8010 00b7 62a3  0101 080a 001e 156f  b..o
  0x0030:  3aa5 2688:..
  23:56:08.842801 IP sunsite2.icm.edu.pl.ftp  192.168.1.2.51909: P 1:7(6) 
  ack 1
  win 46 nop,nop,timestamp 983901837 1971567
  0x:  4510 003a 9135 4000 3c06 0d67 c1db 1c8c  E..:[EMAIL 
  PROTECTED]..g
  0x0010:  c0a8 0102 0015 cac5 a255 b7b9 3a6c 9d40  .U..:l.@
  0x0020:  8018 002e f3af  0101 080a 3aa5 268d  :..
  0x0030:  001e 156f 3232 302d 0d0a ...o220-..
  23:56:08.843069 IP 192.168.1.2.51909  sunsite2.icm.edu.pl.ftp: . ack 7 win 
  183
  nop,nop,timestamp 1971588 983901837
  0x:  4510 0034 8860 4000 4006 1242 c0a8 0102  [EMAIL 
  PROTECTED]@..B
  0x0010:  c1db 1c8c cac5 0015 3a6c 9d40 a255 b7bf  :[EMAIL 
  PROTECTED]
  0x0020:  8010 00b7 6283  0101 080a 001e 1584  b...
  0x0030:  3aa5 268d:..
  23:56:31.920327 IP 192.168.1.2.51909  sunsite2.icm.edu.pl.ftp: F 1:1(0) 
  ack 7
  win 183 nop,nop,timestamp 1994676 983901837
  0x:  4510 0034 8861 4000 4006 1241 c0a8 0102  [EMAIL 
  PROTECTED]@..A
  0x0010:  c1db 1c8c cac5 0015 3a6c 9d40 a255 b7bf  :[EMAIL 
  PROTECTED]
  0x0020:  8011 00b7 0852  0101 080a 001e 6fb4  .Ro.
  0x0030:  3aa5 268d:..
  23:56:31.935145 IP sunsite2.icm.edu.pl.ftp  192.168.1.2.51909: . ack 2 win 
  46
  nop,nop,timestamp 983907613 1994676
  0x:  4510 0034 913d 4000 3c06 0d65 c1db 1c8c  [EMAIL 
  PROTECTED]..e
  0x0010:  c0a8 0102 0015 cac5 a255 b8e5 3a6c 9d41  .U..:l.A
  0x0020:  8010 002e f124  0101 080a 3aa5 3d1d  .$..:.=.
  0x0030:  001e 6fb4..o.
  
  Other machines work with the router fine.
  
  How can I solve this problem?
  I tried to look for some relevand info with athdebug, but i'm not sure what 
  to
  look for.
  Can You help me?
  
  System:
  I am using  Atheros Communications, Inc. AR5212 802.11abg NIC PCMCIA card.
  Computer is Acer Aspire 1520.
  
  I use vanilla kernel:
  Linux 2.6.23 #1 Sat Jan 12 12:07:39 CET 2008 i686 AMD Athlon(tm) 64 
  Processor
  3700+ AuthenticAMD GNU/Linux
  and madwifi driver ath_pci 0.9.4.5 (0.9.3.3)
  kernel options: irqpoll (without irqpoll system doesn't detect pcmcia 
  cards).
  
  Device detection:
  ath_hal: module license 'Proprietary' taints kernel.
  ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
  ath_pci: 0.9.4.5 (0.9.3.3)
  ath_rate_sample: 

Re: converting fore200e driver to use request_firmware()

2008-02-07 Thread Stephen Hemminger
On Thu, 07 Feb 2008 14:20:19 -0500
chas williams - CONTRACTOR [EMAIL PROTECTED] wrote:

 In message [EMAIL PROTECTED],David Miller writes:
  however, i ran into a little problem with the sbus interface.  what should
  i pass for 'struct device *' for an sbus device?
 
 sdev-ofdev.dev should work
 
 thanks!  that is what i needed.  so what i have works on pci and is
 quite a bit cleaner than the current mess for the firmware.  the only
 iffy part is the conversion of the struct fore_200e to a struct device
 which is depends your bus.  perhaps it should be a seperate routine.
 
 any comments on the following?
 
 diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig
 index 1c7ae30..a5303ee 100644
 --- a/drivers/atm/Kconfig
 +++ b/drivers/atm/Kconfig
 @@ -325,81 +325,21 @@ config ATM_IA_DEBUG
 speed of the driver, and the size of your syslog files! When
 inactive, they will have only a modest impact on performance.
  
 -config ATM_FORE200E_MAYBE
 +config ATM_FORE200E
   tristate FORE Systems 200E-series
 - depends on PCI || SBUS
 + depends on (PCI || SBUS)
   ---help---
 This is a driver for the FORE Systems 200E-series ATM adapter
 cards. It simultaneously supports PCA-200E and SBA-200E models
 on PCI and SBUS hosts. Say Y (or M to compile as a module
 named fore_200e) here if you have one of these ATM adapters.
  
 -   Note that the driver will actually be compiled only if you
 -   additionally enable the support for PCA-200E and/or SBA-200E
 -   cards.
 -
 See the file file:Documentation/networking/fore200e.txt for
 further details.
  

Think you  now need to select FW_LOADER?

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


Re: + smack-unlabeled-outgoing-ambient-packets.patch added to -mm tree

2008-02-07 Thread Paul Moore
On Thursday 07 February 2008 3:04:59 pm Andrew Morton wrote:
 On Thu, 7 Feb 2008 14:50:41 -0500

 Paul Moore [EMAIL PROTECTED] wrote:
  On Thursday 07 February 2008 2:02:06 pm [EMAIL PROTECTED] wrote:
   The patch titled
Smack: unlabeled outgoing ambient packets
   has been added to the -mm tree.  Its filename is
smack-unlabeled-outgoing-ambient-packets.patch
  
   Before you just go and hit reply, please:
  a) Consider who else should be cc'ed
  b) Prefer to cc a suitable mailing list as well
  c) Ideally: find the original patch on the mailing list and do a
 reply-to-all to that, adding suitable additional cc's
 
  I didn't see this patch hit any of the relevant mailing lists (am I
  missing one somewhere?) so I'm just CC'ing everyone on the To/CC line,
  minus mm-commits.

 It was on linux-kernel and netdev.  I've restored those cc's.

My apologies, those mailing list postings there haven't hit my inbox yet.

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


Re: [BUG][AX25] Fwd: SMP with AX.25

2008-02-07 Thread Jarek Poplawski
On Thu, Feb 07, 2008 at 08:35:11PM +0100, Jarek Poplawski wrote:
 Here I resend another OOPS I got from Jann:
 
 On Thu, Feb 07, 2008 at 05:42:42PM +0100, Jann Traschewski wrote:
 ...
  BUG: unable to handle kernel NULL pointer dereference at virtual address
  0065
  printing eip: c02266c7 *pde = 
  Oops:  [#1] SMP
  Modules linked in: netconsole ppp_deflate zlib_deflate zlib_inflate bsd_comp
  ppp_async ppp_generic slhc tun bitrev crc32 mkiss ax25 crc16 iptable_nat
  nf_nat nf_conntrack_ipv4 xt_state nf_conntrack ipt_REJECT iptable_filter
  iptable_mangle xt_MARK ipv6 ipip tunnel4 ide_cd cdrom aic7xxx
  scsi_transport_spi parport_serial parport_pc parport i2c_piix4 genrtc
  
  Pid: 3035, comm: linuxnet Not tainted (2.6.24-dg8ngn #1)
  EIP: 0060:[c02266c7] EFLAGS: 00010202 CPU: 0
  EIP is at skb_clone+0x3/0x4d
  EAX:  EBX:  ECX: 0001 EDX: 0020
  ESI: 0008 EDI:  EBP: f700a4ac ESP: f720b9ac
   DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
  Process linuxnet (pid: 3035, ti=f720a000 task=f7c63570 task.ti=f720a000)
  Stack: f700a400 f8a0a8f9 c01254db   f700a400 f700a4cc
  f700a400 __wake_up_common+0x32/0x5c
  __wake_up+0x32/0x42

Jann, this report is a bit damaged here, so I could be wrong, but it
looks similar to your first reports, and I guess this skb_clone is
called from ax25_kick too. Then my today testing patch #2 should help
for this, I hope.

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


Re: oops with ipcomp

2008-02-07 Thread Beschorner Daniel
 OK, so are you now able to reproduce this crash without waiting
 for hours? That would be really helpful in tracking it down.

Yes, I can reproduce it in minutes now.

 Could you show me the exact policies/SAs of the tunnel involved
 in the crash?

esp/cbc(aes128)/hmac(sha1)


Mit freundlichen Grüßen
i.A. Daniel Beschorner
Entwicklung
   
FACTON GmbH
Prager Str. 2
01069 Dresden

Tel.: +49-351-40223-0
Mobil: +49-151-54446012
Fax: +49-351-40223-15
Mail: [EMAIL PROTECTED]
Web: www.facton.com



Neuer FACTON-Unternehmensauftritt im Internet: www.facton.com 
Alle Schulungstermine 2008 in der Übersicht: www.facton.com/akademie2008 



Vertretungsberechtigte Geschäftsführer: Thoralf Nehls, Martin Nehls 
Sitz der Gesellschaft: Prager Straße 2, 01069 Dresden 
Handelsregister: Amtsgericht Dresden HRB 17304




This email message is intended only for the person(s) to whom it is addressed
and as such is confidential. If you have received this communication in error,
please notify us immediately and delete the original message.
Thank you for your cooperation.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] 3c509: convert to isa_driver and pnp_driver v4

2008-02-07 Thread Ondrej Zary
Hello,
this patch converts 3c509 driver to isa_driver and pnp_driver. The result is 
that autoloading using udev and hibernation works with ISA PnP cards. It also 
adds hibernation support for non-PnP ISA cards.

xcvr module parameter was removed as its value was not used.

Tested using 3 ISA cards in various combinations of PnP and non-PnP modes. 
EISA and MCA only compile-tested.

Signed-off-by: Ondrej Zary [EMAIL PROTECTED]

--- linux-2.6.24-orig/drivers/net/3c509.c   2008-01-27 19:48:19.0 
+0100
+++ linux-2.6.24-pentium/drivers/net/3c509.c2008-02-07 17:58:45.0 
+0100
@@ -54,25 +54,24 @@
v1.19a 28Oct2002 Davud Ruggiero [EMAIL PROTECTED]
- Increase *read_eeprom udelay to workaround oops with 
2 cards.
v1.19b 08Nov2002 Marc Zyngier [EMAIL PROTECTED]
-   - Introduce driver model for EISA cards.
+   - Introduce driver model for EISA cards.
+   v1.20  04Feb2008 Ondrej Zary [EMAIL PROTECTED]
+   - convert to isa_driver and pnp_driver and some cleanups
 */
 
 #define DRV_NAME   3c509
-#define DRV_VERSION1.19b
-#define DRV_RELDATE08Nov2002
+#define DRV_VERSION1.20
+#define DRV_RELDATE04Feb2008
 
 /* A few values that may be tweaked. */
 
 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT  (400*HZ/1000)
-/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
-static int max_interrupt_work = 10;
 
 #include linux/module.h
-#ifdef CONFIG_MCA
 #include linux/mca.h
-#endif
-#include linux/isapnp.h
+#include linux/isa.h
+#include linux/pnp.h
 #include linux/string.h
 #include linux/interrupt.h
 #include linux/errno.h
@@ -97,10 +96,6 @@
 
 static char version[] __initdata = DRV_NAME .c: DRV_VERSION   DRV_RELDATE 
 [EMAIL PROTECTED];
 
-#if defined(CONFIG_PM)  (defined(CONFIG_MCA) || defined(CONFIG_EISA))
-#define EL3_SUSPEND
-#endif
-
 #ifdef EL3_DEBUG
 static int el3_debug = EL3_DEBUG;
 #else
@@ -111,6 +106,7 @@
  * a global variable so that the mca/eisa probe routines can increment
  * it */
 static int el3_cards = 0;
+#define EL3_MAX_CARDS 8
 
 /* To minimize the size of the driver source I only define operating
constants if they are used several times.  You'll need the manual
@@ -119,7 +115,7 @@
 #define EL3_DATA 0x00
 #define EL3_CMD 0x0e
 #define EL3_STATUS 0x0e
-#define EEPROM_READ 0x80
+#defineEEPROM_READ 0x80
 
 #define EL3_IO_EXTENT  16
 
@@ -168,23 +164,31 @@
  */
 #define SKB_QUEUE_SIZE 64
 
+typedef enum { EL3_ISA, EL3_PNP, EL3_MCA, EL3_EISA } el3_cardtype;
+
 struct el3_private {
struct net_device_stats stats;
-   struct net_device *next_dev;
spinlock_t lock;
/* skb send-queue */
int head, size;
struct sk_buff *queue[SKB_QUEUE_SIZE];
-   enum {
-   EL3_MCA,
-   EL3_PNP,
-   EL3_EISA,
-   } type; /* type of device */
-   struct device *dev;
+   el3_cardtype type;
 };
-static int id_port __initdata = 0x110; /* Start with 0x110 to avoid new sound 
cards.*/
-static struct net_device *el3_root_dev;
+static int id_port;
+static int current_tag;
+static struct net_device *el3_devs[EL3_MAX_CARDS];
+
+/* Parameters that may be passed into the module. */
+static int debug = -1;
+static int irq[] = {-1, -1, -1, -1, -1, -1, -1, -1};
+/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
+static int max_interrupt_work = 10;
+#ifdef CONFIG_PNP
+static int nopnp;
+#endif
 
+static int __init el3_common_init(struct net_device *dev);
+static void el3_common_remove (struct net_device *dev);
 static ushort id_read_eeprom(int index);
 static ushort read_eeprom(int ioaddr, int index);
 static int el3_open(struct net_device *dev);
@@ -199,23 +203,277 @@
 static void el3_down(struct net_device *dev);
 static void el3_up(struct net_device *dev);
 static const struct ethtool_ops ethtool_ops;
-#ifdef EL3_SUSPEND
+#ifdef CONFIG_PM
 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);
-#endif
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void el3_poll_controller(struct net_device *dev);
 #endif
 
+/* Return 0 on success, 1 on error, 2 when found already detected PnP card */
+static int el3_isa_id_sequence(__be16 *phys_addr)
+{
+   short lrs_state = 0xff;
+   int i;
+
+   /* ISA boards are detected by sending the ID sequence to the
+  ID_PORT.  We find cards past the first by setting the 'current_tag'
+  on cards as they are found.  Cards with their tag set will not
+  respond to subsequent ID sequences. */
+
+   outb(0x00, id_port);
+   outb(0x00, 

[PATCH 2/3][NETLABEL]: Don't produce unused variables when IPv6 is off.

2008-02-07 Thread Pavel Emelyanov
Some code declares variables on the stack, but uses them
under #ifdef CONFIG_IPV6, so thay become unused when ipv6
is off. Fortunately, they are used in a switch's case
branches, so the fix is rather simple.

Is it OK from coding style POV to add braces inside cases,
or should I better avoid such style and rework the patch?

Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

---
 net/netlabel/netlabel_unlabeled.c |   28 ++--
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/net/netlabel/netlabel_unlabeled.c 
b/net/netlabel/netlabel_unlabeled.c
index 42e81fd..3587874 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -617,8 +617,6 @@ static int netlbl_unlhsh_add(struct net *net,
int ifindex;
struct net_device *dev;
struct netlbl_unlhsh_iface *iface;
-   struct in_addr *addr4, *mask4;
-   struct in6_addr *addr6, *mask6;
struct audit_buffer *audit_buf = NULL;
char *secctx = NULL;
u32 secctx_len;
@@ -651,7 +649,9 @@ static int netlbl_unlhsh_add(struct net *net,
audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCADD,
  audit_info);
switch (addr_len) {
-   case sizeof(struct in_addr):
+   case sizeof(struct in_addr): {
+   struct in_addr *addr4, *mask4;
+
addr4 = (struct in_addr *)addr;
mask4 = (struct in_addr *)mask;
ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid);
@@ -661,8 +661,11 @@ static int netlbl_unlhsh_add(struct net *net,
   addr4-s_addr,
   mask4-s_addr);
break;
+   }
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-   case sizeof(struct in6_addr):
+   case sizeof(struct in6_addr): {
+   struct in6_addr *addr6, *mask6;
+
addr6 = (struct in6_addr *)addr;
mask6 = (struct in6_addr *)mask;
ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid);
@@ -671,6 +674,7 @@ static int netlbl_unlhsh_add(struct net *net,
   dev_name,
   addr6, mask6);
break;
+   }
 #endif /* IPv6 */
default:
ret_val = -EINVAL;
@@ -1741,10 +1745,6 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb,
   u16 family,
   struct netlbl_lsm_secattr *secattr)
 {
-   struct iphdr *hdr4;
-   struct ipv6hdr *hdr6;
-   struct netlbl_unlhsh_addr4 *addr4;
-   struct netlbl_unlhsh_addr6 *addr6;
struct netlbl_unlhsh_iface *iface;
 
rcu_read_lock();
@@ -1752,21 +1752,29 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb,
if (iface == NULL)
goto unlabel_getattr_nolabel;
switch (family) {
-   case PF_INET:
+   case PF_INET: {
+   struct iphdr *hdr4;
+   struct netlbl_unlhsh_addr4 *addr4;
+
hdr4 = ip_hdr(skb);
addr4 = netlbl_unlhsh_search_addr4(hdr4-saddr, iface);
if (addr4 == NULL)
goto unlabel_getattr_nolabel;
secattr-attr.secid = addr4-secid;
break;
+   }
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-   case PF_INET6:
+   case PF_INET6: {
+   struct ipv6hdr *hdr6;
+   struct netlbl_unlhsh_addr6 *addr6;
+
hdr6 = ipv6_hdr(skb);
addr6 = netlbl_unlhsh_search_addr6(hdr6-saddr, iface);
if (addr6 == NULL)
goto unlabel_getattr_nolabel;
secattr-attr.secid = addr6-secid;
break;
+   }
 #endif /* IPv6 */
default:
goto unlabel_getattr_nolabel;
-- 
1.5.3.4

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


[PATCH 1/3][NETLABEL]: Compilation for CONFIG_AUDIT=n case.

2008-02-07 Thread Pavel Emelyanov
The audit_log_start() will expand into an empty do { } while (0)
construction and the audit_ctx becomes unused.

The solution: push current-audit_context into audit_log_start()
directly, since it is not required in any other place in the 
calling function.

Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

---
 net/netlabel/netlabel_user.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/netlabel/netlabel_user.c b/net/netlabel/netlabel_user.c
index 85a96a3..023fc8f 100644
--- a/net/netlabel/netlabel_user.c
+++ b/net/netlabel/netlabel_user.c
@@ -96,7 +96,6 @@ int netlbl_netlink_init(void)
 struct audit_buffer *netlbl_audit_start_common(int type,
   struct netlbl_audit *audit_info)
 {
-   struct audit_context *audit_ctx = current-audit_context;
struct audit_buffer *audit_buf;
char *secctx;
u32 secctx_len;
@@ -104,7 +103,7 @@ struct audit_buffer *netlbl_audit_start_common(int type,
if (audit_enabled == 0)
return NULL;
 
-   audit_buf = audit_log_start(audit_ctx, GFP_ATOMIC, type);
+   audit_buf = audit_log_start(current-audit_context, GFP_ATOMIC, type);
if (audit_buf == NULL)
return NULL;
 
-- 
1.5.3.4

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


[PATCH] (02/06/08 Linus git) Smack unlabeled outgoing ambient packets

2008-02-07 Thread Casey Schaufler

From: Casey Schaufler [EMAIL PROTECTED]

Smack uses CIPSO labeling, but allows for unlabeled packets
by specifying an ambient label that is applied to incoming
unlabeled packets. Because the other end of the connection
may dislike IP options, and ssh is one know application that
behaves thus, it is prudent to respond in kind. This patch
changes the network labeling behavior such that an outgoing
packet that would be given a CIPSO label that matches the
ambient label is left unlabeled.

Signed-off-by: Casey Schaufler [EMAIL PROTECTED]

---

security/smack/smack_lsm.c |9 +
1 file changed, 9 insertions(+)

diff -uprN -X linux-2.6.25-g0206-base//Documentation/dontdiff 
linux-2.6.25-g0206-base/security/smack/smack_lsm.c 
linux-2.6.25-g0206/security/smack/smack_lsm.c
--- linux-2.6.25-g0206-base/security/smack/smack_lsm.c  2008-02-06 
16:01:43.0 -0800
+++ linux-2.6.25-g0206/security/smack/smack_lsm.c   2008-02-06 
18:39:55.0 -0800
@@ -1276,6 +1276,12 @@ static void smack_to_secattr(char *smack
 * Convert the outbound smack value (smk_out) to a
 * secattr and attach it to the socket.
 *
+ * If the label is the ambient label do not set the secattr.
+ * Thus, all ambient packets are unlabeled and all unlabeled
+ * packets are ambient. This permits unlabeled responces to
+ * unlabeled requests without knowing on a per-packet basis
+ * if the packet was labeled ambient or was unlabeled.
+ *
 * Returns 0 on success or an error code
 */
static int smack_netlabel(struct sock *sk)
@@ -1284,6 +1290,9 @@ static int smack_netlabel(struct sock *s
struct netlbl_lsm_secattr secattr;
int rc = 0;

+   if (strncmp(ssp-smk_out, smack_net_ambient, SMK_MAXLEN) == 0)
+   return 0;
+
netlbl_secattr_init(secattr);
smack_to_secattr(ssp-smk_out, secattr);
if (secattr.flags != NETLBL_SECATTR_NONE)

--
To unsubscribe from this list: send 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] [IPV6] Minor clenup: remove two unused definitions in net/ip6_route.h

2008-02-07 Thread Rami Rosen
Hi,
Remove IP6_RT_PRIO_FW and IP6_RT_FLOW_MASK definitions in
include/net/ip6_route.h, as they are not used in the kernel.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index faac0ee..f99e4f0 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -1,11 +1,9 @@
 #ifndef _NET_IP6_ROUTE_H
 #define _NET_IP6_ROUTE_H
 
-#define IP6_RT_PRIO_FW 16
 #define IP6_RT_PRIO_USER   1024
 #define IP6_RT_PRIO_ADDRCONF   256
 #define IP6_RT_PRIO_KERN   512
-#define IP6_RT_FLOW_MASK   0x00ff
 
 struct route_info {
__u8type;


Re: oops with ipcomp

2008-02-07 Thread Herbert Xu
On Wed, Feb 06, 2008 at 09:55:03PM +0100, Beschorner Daniel wrote:

 A is the oopsing 2.6.24, B is 2.6.23.
 I didn't change anything in the scenario recently, till 2.6.23 all
 worked fine.

OK, so are you now able to reproduce this crash without waiting
for hours? That would be really helpful in tracking it down.

Could you show me the exact policies/SAs of the tunnel involved
in the crash?

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


[patch 0/3] [IUCV] fixes for net-2.6.25

2008-02-07 Thread Ursula Braun
-- 
Dave,

the following 3 patches are intended for 2.6.25 and contain:
- locking changes in iucv.c
- locking changes in af_iucv.c
- extra checkings for successful allocations in af_iucv.c
- secure handling of send_skb_q list in af_iucv.c
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 1/3] iucv: wrong irq-disabling locking at module load time

2008-02-07 Thread Ursula Braun
From: Ursula Braun [EMAIL PROTECTED]

Linux may hang when running af_iucv socket programs concurrently
with a load of module netiucv. iucv_register() tries to take the
iucv_table_lock with spin_lock_irq. This conflicts with
iucv_connect() which has a need for an smp_call_function while
holding the iucv_table_lock.
Solution: use bh-disabling locking in iucv_register()

Signed-off-by: Ursula Braun [EMAIL PROTECTED]
---

 net/iucv/iucv.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -urpN linux-2.6/net/iucv/iucv.c linux-2.6-patched/net/iucv/iucv.c
--- linux-2.6/net/iucv/iucv.c   2008-02-07 13:24:12.0 +0100
+++ linux-2.6-patched/net/iucv/iucv.c   2008-02-07 13:24:34.0 +0100
@@ -693,9 +693,9 @@ int iucv_register(struct iucv_handler *h
iucv_setmask_up();
INIT_LIST_HEAD(handler-paths);
 
-   spin_lock_irq(iucv_table_lock);
+   spin_lock_bh(iucv_table_lock);
list_add_tail(handler-list, iucv_handler_list);
-   spin_unlock_irq(iucv_table_lock);
+   spin_unlock_bh(iucv_table_lock);
rc = 0;
 out_mutex:
mutex_unlock(iucv_register_mutex);

-- 
--
To unsubscribe from this list: send 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] Add IPv6 support to TCP SYN cookies

2008-02-07 Thread Ross Vandegrift
On Wed, Feb 06, 2008 at 09:53:57AM +0100, Andi Kleen wrote:
 That would be useful yes -- for different bandwidths.

My initial test is end-to-end 1000Mbps, but I've got a few different
packet rates.

 If the young/old heuristics do not work well enough anymore most
 likely we should try readding RED to the syn queue again. That used
 to be pretty effective in the early days. I don't quite remember why
 Linux didn't end up using it in fact.

I'm running juno-z with 2, 4,  8 threads of syn flood to port 80.
wireshark measures 2 threads at 350pps, 4 threads at 750pps, and 8
threads at 1200pps.  Under no SYN flood, the server handles 750 HTTP
requests per second, measured via httping in flood mode.

With a default tcp_max_syn_backlog of 1024, I can trivially prevent
any inbound client connections with 2 threads of syn flood.
Enabling tcp_syncookies brings the connection handling back up to 725
fetches per second.

If I raise the backlog to 16384, 4 threads gives me about 650 legit
requests per sec.  Going to 8 threads makes connections very unreliable - a
handful will get through every 15 to 20 seconds.  Again,
tcp_syncookies returns performance almost totally back to normal.

Cranking juno-z to the max generates me about 16kpps.  Any syn backlog
is easily overwhelmed and nothing gets through.  tcp_syncookies gets
me back to 650 requests per second.

At these levels the CPU impact of tcp_syncookies is nothing.  I can't
measure a difference.  In the real world, a 16kpps syn flood is small.
People with a distributed botnet can easily get to the hundreds of
thousands, and I have seen over million packets per second of SYN flood.


BTW, I can trigger a soft lockup BUG when I restart apache to change the
backlog during the 16kpps test-case:

BUG: soft lockup detected on CPU#1!
 [c044d1ec] softlockup_tick+0x96/0xa4
 [c042ddb0] update_process_times+0x39/0x5c
 [c04196f7] smp_apic_timer_interrupt+0x5b/0x6c
 [c04059bf] apic_timer_interrupt+0x1f/0x24
 [c045007b] taskstats_exit_send+0x152/0x371
 [c05c007b] netlink_kernel_create+0x5/0x11c
 [c05a7415] reqsk_queue_alloc+0x32/0x81
 [c05a5aca] lock_sock+0x8e/0x96
 [c05ce8c4] inet_csk_listen_start+0x17/0x106
 [c05e720f] inet_listen+0x3c/0x5f
 [c05a3e55] sys_listen+0x4a/0x66
 [c05a4f4d] sys_socketcall+0x98/0x19e
 [c0407ef7] do_syscall_trace+0xab/0xb1
 [c0404eff] syscall_call+0x7/0xb
 ===
BUG: soft lockup detected on CPU#3!
 [c044d1ec] softlockup_tick+0x96/0xa4
 [c042ddb0] update_process_times+0x39/0x5c
 [c04196f7] smp_apic_timer_interrupt+0x5b/0x6c
 [c04059bf] apic_timer_interrupt+0x1f/0x24
 [c045007b] taskstats_exit_send+0x152/0x371
 [c05c007b] netlink_kernel_create+0x5/0x11c
 [c05a7415] reqsk_queue_alloc+0x32/0x81
 [c05a5aca] lock_sock+0x8e/0x96
 [c05ce8c4] inet_csk_listen_start+0x17/0x106
 [c05e720f] inet_listen+0x3c/0x5f
 [c05a3e55] sys_listen+0x4a/0x66
 [c05a4f4d] sys_socketcall+0x98/0x19e
 [c0407ef7] do_syscall_trace+0xab/0xb1
 [c0404eff] syscall_call+0x7/0xb
 ===







-- 
Ross Vandegrift
[EMAIL PROTECTED]

The good Christian should beware of mathematicians, and all those who
make empty prophecies. The danger already exists that the mathematicians
have made a covenant with the devil to darken the spirit and to confine
man in the bonds of Hell.
--St. Augustine, De Genesi ad Litteram, Book II, xviii, 37
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG][AX25] Fwd: SMP with AX.25

2008-02-07 Thread Jarek Poplawski
Here I resend another OOPS I got from Jann:

On Thu, Feb 07, 2008 at 05:42:42PM +0100, Jann Traschewski wrote:
...
 BUG: unable to handle kernel NULL pointer dereference at virtual address
 0065
 printing eip: c02266c7 *pde = 
 Oops:  [#1] SMP
 Modules linked in: netconsole ppp_deflate zlib_deflate zlib_inflate bsd_comp
 ppp_async ppp_generic slhc tun bitrev crc32 mkiss ax25 crc16 iptable_nat
 nf_nat nf_conntrack_ipv4 xt_state nf_conntrack ipt_REJECT iptable_filter
 iptable_mangle xt_MARK ipv6 ipip tunnel4 ide_cd cdrom aic7xxx
 scsi_transport_spi parport_serial parport_pc parport i2c_piix4 genrtc
 
 Pid: 3035, comm: linuxnet Not tainted (2.6.24-dg8ngn #1)
 EIP: 0060:[c02266c7] EFLAGS: 00010202 CPU: 0
 EIP is at skb_clone+0x3/0x4d
 EAX:  EBX:  ECX: 0001 EDX: 0020
 ESI: 0008 EDI:  EBP: f700a4ac ESP: f720b9ac
  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
 Process linuxnet (pid: 3035, ti=f720a000 task=f7c63570 task.ti=f720a000)
 Stack: f700a400 f8a0a8f9 c01254db   f700a400 f700a4cc
 f700a400 __wake_up_common+0x32/0x5c
 __wake_up+0x32/0x42
  [c0224e67] sock_def_readable+0x39/0x63
  [c02251e1] sock_queue_rcv_skb+0xb6/0xd1
  [c022b060] netif_receive_skb+0x309/0x372
  [c0117f35] dequeue_entity+0xb/0x2a
  [c022d42f] process_backlog+0x5c/0xaa
  [c022cf21] net_rx_action+0x8d/0x173
  [c012213a] __do_softirq+0x5d/0xc1
  [c01221d0] do_softirq+0x32/0x36
  [c01223df] local_bh_enable_ip+0x35/0x40
  [c0261ebe] udp_poll+0xc1/0xd5
  [c0220f2c] sock_poll+0xc/0xe
  [c016495a] do_select+0x229/0x3c9
  [c01650b6] __pollwait+0x0/0xac
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c0118e73] default_wake_function+0x0/0x8
  [c011756c] __wake_up_common+0x32/0x5c
  [c011911c] __wake_up+0x32/0x42
  [c0164da0] core_sys_select+0x2a6/0x2c7
  [c011756c] __wake_up_common+0x32/0x5c
  [c011911c] __wake_up+0x32/0x42
  [c01d13c2] tty_wakeup+0x4c/0x50
  [c01d72c6] pty_unthrottle+0x12/0x1d
  [f89fc60e] mkiss_receive_buf+0x381/0x3af [mkiss]
 sys_select+0xa4/0x187
 syscall_call+0x7/0xb
 Kernel panic - not syncing: Fatal exception in interrupt
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG][AX25] Fwd: SMP with AX.25

2008-02-07 Thread Jarek Poplawski

 -- Forwarded message --
 From: Jann Traschewski [EMAIL PROTECTED]
 Date: Thu, 7 Feb 2008 06:27:38 +0100
 Subject: FW: smp kernel oops ax25 2008-02-07
 To: Jarek Poplawski [EMAIL PROTECTED]
...
 BUG: unable to handle kernel NULL pointer dereference at virtual address
 0065
 printing eip: c02266c7 *pde = 
 Oops:  [#1] SMP
 Modules linked in: netconsole ppp_deflate zlib_deflate zlib_inflate bsd_comp
 ppp_async ppp_generic slhc tun bitrev crc32 mkiss ax25 crc16 iptable_nat
 nf_nat nf_conntrack_ipv4 xt_state nf_conntrack ipt_REJECT iptable_filter
 iptable_mangle xt_MARK ipv6 ipip tunnel4 ide_cd cdrom aic7xxx
 scsi_transport_spi parport_serial parport_pc parport i2c_piix4 genrtc
 
 Pid: 19761, comm: frmaster Not tainted (2.6.24-dg8ngn #1)
 EIP: 0060:[c02266c7] EFLAGS: 00010297 CPU: 1
 EIP is at skb_clone+0x3/0x4d
 EAX:  EBX:  ECX:  EDX: 0020
 ESI: 0008 EDI:  EBP: c0cfc8ac ESP: d3cfddc4
  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
 Process frmaster (pid: 19761, ti=d3cfc000 task=f7fbf570 task.ti=d3cfc000)
 Stack: c0cfc800 f8a0a8f9 c0cfc800 d3cfdf6c 0007 0015 c0cfc8cc
 e84492e0
c0cfc800 d3cfdf64 f6e6fbc0 f8a0e9d8 d3cfde60  c1d8c340
 d3cfdea0
c0cfc800 f5d12200 d3cfdf24 c014143d 01e7a9be  d3cfdf24
 0022
 Call Trace:
  [f8a0a8f9] ax25_kick+0xaf/0x184 [ax25]
  [f8a0e9d8] ax25_sendmsg+0x35f/0x49a [ax25]
  [c014143d] __generic_file_aio_write_nolock+0x474/0x4d3
  [c0221214] sock_aio_write+0xbc/0xc8
  [c01414f7] generic_file_aio_write+0x5b/0xb0
  [c015a1d3] do_sync_write+0xc7/0x10a
  [c022b643] dev_hard_start_xmit+0x20a/0x26a
  [c012db6d] autoremove_wake_function+0x0/0x35
  [c01253d3] lock_timer_base+0x19/0x35
  [c015a960] vfs_write+0x9e/0x10c
  [c015aeb7] sys_write+0x41/0x67
  [c0103e4e] syscall_call+0x7/0xb
  ===
 Code: 24 20 89 7c 24 08 89 44 24 04 03 aa 9c 00 00 00 89 2c 24 e8 cc 67 f9
 ff 89 44 24 54 8b 44 24 54 83 c4 3c 5b 5e 5f 5d c3 53 89 c3 8a 40 65 24 18
 3c 08 75 1f 8d 8b a8 00 00 00 f6 41 65 18 75 13
 EIP: [c02266c7] skb_clone+0x3/0x4d SS:ESP 0068:d3cfddc4
 ---[ end trace 504af05b5c529aa1 ]---
--
To unsubscribe from this list: send 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: converting fore200e driver to use request_firmware()

2008-02-07 Thread chas williams - CONTRACTOR
In message [EMAIL PROTECTED],David Miller writes:
 however, i ran into a little problem with the sbus interface.  what should
 i pass for 'struct device *' for an sbus device?

sdev-ofdev.dev should work

thanks!  that is what i needed.  so what i have works on pci and is
quite a bit cleaner than the current mess for the firmware.  the only
iffy part is the conversion of the struct fore_200e to a struct device
which is depends your bus.  perhaps it should be a seperate routine.

any comments on the following?

diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig
index 1c7ae30..a5303ee 100644
--- a/drivers/atm/Kconfig
+++ b/drivers/atm/Kconfig
@@ -325,81 +325,21 @@ config ATM_IA_DEBUG
  speed of the driver, and the size of your syslog files! When
  inactive, they will have only a modest impact on performance.
 
-config ATM_FORE200E_MAYBE
+config ATM_FORE200E
tristate FORE Systems 200E-series
-   depends on PCI || SBUS
+   depends on (PCI || SBUS)
---help---
  This is a driver for the FORE Systems 200E-series ATM adapter
  cards. It simultaneously supports PCA-200E and SBA-200E models
  on PCI and SBUS hosts. Say Y (or M to compile as a module
  named fore_200e) here if you have one of these ATM adapters.
 
- Note that the driver will actually be compiled only if you
- additionally enable the support for PCA-200E and/or SBA-200E
- cards.
-
  See the file file:Documentation/networking/fore200e.txt for
  further details.
 
-config ATM_FORE200E_PCA
-   bool PCA-200E support
-   depends on ATM_FORE200E_MAYBE  PCI
-   help
- Say Y here if you want your PCA-200E cards to be probed.
-
-config ATM_FORE200E_PCA_DEFAULT_FW
-   bool Use default PCA-200E firmware (normally enabled)
-   depends on ATM_FORE200E_PCA
-   help
- Use the default PCA-200E firmware data shipped with the driver.
-
- Normal users do not have to deal with the firmware stuff, so
- they should say Y here.
-
-config ATM_FORE200E_PCA_FW
-   string Pathname of user-supplied binary firmware
-   depends on ATM_FORE200E_PCA  !ATM_FORE200E_PCA_DEFAULT_FW
-   default 
-   help
- This defines the pathname of an alternative PCA-200E binary
- firmware image supplied by the user. This pathname may be
- absolute or relative to the drivers/atm directory.
-
- The driver comes with an adequate firmware image, so normal users do
- not have to supply an alternative one. They just say Y to Use
- default PCA-200E firmware instead.
-
-config ATM_FORE200E_SBA
-   bool SBA-200E support
-   depends on ATM_FORE200E_MAYBE  SBUS
-   help
- Say Y here if you want your SBA-200E cards to be probed.
-
-config ATM_FORE200E_SBA_DEFAULT_FW
-   bool Use default SBA-200E firmware (normally enabled)
-   depends on ATM_FORE200E_SBA
-   help
- Use the default SBA-200E firmware data shipped with the driver.
-
- Normal users do not have to deal with the firmware stuff, so
- they should say Y here.
-
-config ATM_FORE200E_SBA_FW
-   string Pathname of user-supplied binary firmware
-   depends on ATM_FORE200E_SBA  !ATM_FORE200E_SBA_DEFAULT_FW
-   default 
-   help
- This defines the pathname of an alternative SBA-200E binary
- firmware image supplied by the user. This pathname may be
- absolute or relative to the drivers/atm directory.
-
- The driver comes with an adequate firmware image, so normal users do
- not have to supply an alternative one. They just say Y to Use
- default SBA-200E firmware, above.
-
 config ATM_FORE200E_USE_TASKLET
bool Defer interrupt work to a tasklet
-   depends on (PCI || SBUS)  (ATM_FORE200E_PCA || ATM_FORE200E_SBA)
+   depends on ATM_FORE200E
default n
help
  This defers work to be done by the interrupt handler to a
@@ -408,7 +348,7 @@ config ATM_FORE200E_USE_TASKLET
 
 config ATM_FORE200E_TX_RETRY
int Maximum number of tx retries
-   depends on (PCI || SBUS)  (ATM_FORE200E_PCA || ATM_FORE200E_SBA)
+   depends on ATM_FORE200E
default 16
---help---
  Specifies the number of times the driver attempts to transmit
@@ -425,7 +365,7 @@ config ATM_FORE200E_TX_RETRY
 
 config ATM_FORE200E_DEBUG
int Debugging level (0-3)
-   depends on (PCI || SBUS)  (ATM_FORE200E_PCA || ATM_FORE200E_SBA)
+   depends on ATM_FORE200E
default 0
help
  Specifies the level of debugging messages issued by the driver.
@@ -436,12 +376,6 @@ config ATM_FORE200E_DEBUG
  the performances of the driver, and the size of your syslog files!
  Keep the debugging level to 0 during normal operations.
 
-config ATM_FORE200E
-   tristate
-   depends on (PCI || SBUS)  (ATM_FORE200E_PCA || ATM_FORE200E_SBA)
-   

[patch 23/45] forcedeth: mac address mcp77/79

2008-02-07 Thread Greg KH
2.6.24-stable review patch.  If anyone has any objections, please let us know.

--
From: Ayaz Abdulla [EMAIL PROTECTED]

patch 2b91213064bd882c3adf35f028c6d12fab3269ec in mainline.

This patch is a critical fix for MCP77 and MCP79 devices. The feature
flags were missing the define for correct mac address
(DEV_HAS_CORRECT_MACADDR).

Signed-off-by: Ayaz Abdulla [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

---
 drivers/net/forcedeth.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5593,35 +5593,35 @@ static struct pci_device_id pci_tbl[] = 
},
{   /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_32),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_33),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_34),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_35),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_36),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_37),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_38),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 

[PATCH 3/3][NETLABLE]: Hide netlbl_unlabel_audit_addr6 under ifdef CONFIG_IPV6.

2008-02-07 Thread Pavel Emelyanov
This one is called from under this config only, so move
it in the same place.

Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]

---
 net/netlabel/netlabel_unlabeled.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/netlabel/netlabel_unlabeled.c 
b/net/netlabel/netlabel_unlabeled.c
index 3587874..3e745b7 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -180,6 +180,7 @@ static void netlbl_unlabel_audit_addr4(struct audit_buffer 
*audit_buf,
}
 }
 
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 /**
  * netlbl_unlabel_audit_addr6 - Audit an IPv6 address
  * @audit_buf: audit buffer
@@ -213,6 +214,7 @@ static void netlbl_unlabel_audit_addr6(struct audit_buffer 
*audit_buf,
audit_log_format(audit_buf,  src_prefixlen=%d, mask_len);
}
 }
+#endif /* IPv6 */
 
 /*
  * Unlabeled Connection Hash Table Functions
-- 
1.5.3.4

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


Re: Problem receiving multicast/promiscuous-mode with kernel.2.6.24

2008-02-07 Thread David Stevens
You need to join the multicast group on the interface you want
to receive it. If you're setting both imr_address and imr_index
to 0, you haven't specified an interface.

Instead of setting imr_ifindex to 0, try setting it like this:

imr.imr_ifindex = if_nametoindex(eth0);

 (or whatever interface you need).

You can verify that you've joined the group on the correct
interface with netstat -g, also. Make sure that the interface
field is correct for the group you want.

And because I can't resist mentioning it, inet_aton is deprecated--
suggest inet_pton() with appropriate arguments and return value
checking instead.

There was a bug fix where the sense of promiscuous mode was
backwards for multicasting, which is probably why it was accidently
(and incorrectly) working in earlier kernels.

If that doesn't do it for you, let me know; better if you can post the
full code (or even better, the smallest subset that demonstrates the
problem).

+-DLS

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


Problem receiving multicast/promiscuous-mode with kernel.2.6.24

2008-02-07 Thread Reither Robert
Visit AVD on prolight+sound in Frankfurt from 12.-15. March 2008 - Hall 8.0, 
Stand G16




Hi,

i'm working on a realtime-audio application, which should be capeable to 
receive RTP packets via multicast addresses.

App did work fine till i switched from 2.6.22 to kernel 2.6.24 (because of 
hwmon support for VIA EPIA LT15000AG)

With kernel 2.6.22 i had no problems, i'm using almost identical .config
Also tried kernel 2.6.24-rc5, same problem.
Tried it on two different boards (VIA EPIA LT, VIA EPIA 5000, diff. NIC's, 
cpu's mem, etc ..)

I'm using the same setsockopt with IP_ADD_MEMBERSHIP as before for all 
interfaces.
But now my app does not receive multicast packets !

Strange thing is, as long as tcpdump is running, the app (and tcpdump) get the 
multicast packets, but if i stopp tcpdump, my application at the same moment 
gets no more multicast packets.

I can see with netstat -g the joined MC-address (if app is active)
multicast route is set up properly.

Closer look:
-
Right after reboot, receiving of mc-packets worked for just one time.
After one ADD_MEMBERSHIP/DROP_MEMBERSHIP cycle it won't work any longer.

If i deny tcpdump setting promiscous-mode (-p) i get no packets.

Looks like somehow the NIC won't be (re)set to promiscous mode.

My user code:

int join_multicast_group (int fd, const char *mc_address)
{
struct ip_mreqn imr;

log_message(DVA_LOG_INFO,In join_mc_group: %s\n,mc_address);

if (inet_aton (mc_address, imr.imr_multiaddr) == 0) {
log_message (DVA_LOG_ERROR, join_mc:Bad IP address format: %s\n, mc_address);
return -1;
}

imr.imr_address.s_addr = INADDR_ANY;
imr.imr_ifindex = 0;

// Check if already member
if (setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, imr, sizeof (imr))  0)
{
if (errno == EADDRINUSE) // Address already joined for IP_ADD_MEMBERSHIP
log_message(DVA_LOG_INFO,Already joined IP_ADD_MEMBERSHIP for %s.\n, 
mc_address);
else
{
log_perror (DVA_LOG_ERROR, getsockopt ip_add_membership);
return -1;
}
}
return 0;
}

and quite the same with DROP_MEMBERSHIP before i close the socket.




Robert Reither
Research  Development
AV Digital Audio- Videotechnik GmbH
Pottendorfer Strasse 25-27/4/1/1
A-1120 Wien/Austria
Commercial Register No.: FN 201615v
Commercial Court: Handelsgericht Wien
VAT-No.: ATU 50461904
Tel.: +43/1/3680368 43
email: [EMAIL PROTECTED]
Visit: http://www.av-digital.at 


Robert Reither
Research  Development
AV Digital Audio- Videotechnik GmbH
Pottendorfer Strasse 25-27/4/1/1
A-1120 Wien/Austria
Commercial Register No.: FN 201615v
Commercial Court: Handelsgericht Wien
VAT-No.: ATU 50461904
Tel.: +43/1/3680368 43
email: [EMAIL PROTECTED]
Visit: http://www.av-digital.at 


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


[patch 0/3] s390: ctc patches for 2.6.25 (4th try)

2008-02-07 Thread Ursula Braun
-- 
Jeff,

this resend includes improvements proposed by Christoph Hellwig:
  netiucv changes are postponed to a future patch
  drivers/s390/net/fsm.h is not changed
  drivers/s390/net/Makefile is adapted
  changed indentation of cpp directives
  removed forward declaration of chx_rxidle
  removed kerneldoc-like keywords
  removed unnecessary type casts
  kept local variable of type struct ctcm_priv

We kept the filenames in the top of file comments, since this is common
to drivers/s390-parts.
And we kept the ccw_device_halt call due to different usages
in different drivers.

The following patches are intended for 2.6.25. Besides clean-ups
they replace the old ctc driver by a reworked ctcm driver.
This ctcm driver supports the channel-to-channel connections of the
old ctc driver plus an additional MPC protocol to provide SNA
connectivity.

Patch 1/3: clean-ups in Kconfig
Patch 2/3: reworked ctc driver
Patch 3/3: removal of old ctc driver

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


[patch 1/3] drivers/s390/net: Kconfig brush up

2008-02-07 Thread Ursula Braun
From: Peter Tiedemann [EMAIL PROTECTED]
From: Ursula Braun [EMAIL PROTECTED]

adapt drivers/s390/net/Kconfig to current IBM wording
and further cosmetics

Signed-off-by: Peter Tiedemann [EMAIL PROTECTED]
Signed-off-by: Ursula Braun [EMAIL PROTECTED]

---
 drivers/s390/net/Kconfig |   43 ++-
 1 file changed, 22 insertions(+), 21 deletions(-)

Index: linux-2.6-uschi/drivers/s390/net/Kconfig
===
--- linux-2.6-uschi.orig/drivers/s390/net/Kconfig
+++ linux-2.6-uschi/drivers/s390/net/Kconfig
@@ -5,22 +5,23 @@ config LCS
tristate Lan Channel Station Interface
depends on CCW  NETDEVICES  (NET_ETHERNET || TR || FDDI)
help
-  Select this option if you want to use LCS networking  on IBM S/390
-  or zSeries. This device driver supports Token Ring (IEEE 802.5),
-  FDDI (IEEE 802.7) and Ethernet. 
-  This option is also available as a module which will be
-  called lcs.ko. If you do not know what it is, it's safe to say Y.
+  Select this option if you want to use LCS networking on IBM System z.
+  This device driver supports Token Ring (IEEE 802.5),
+  FDDI (IEEE 802.7) and Ethernet.
+  To compile as a module, choose M. The module name is lcs.ko.
+  If you do not know what it is, it's safe to choose Y.
 
 config CTC
tristate CTC device support
depends on CCW  NETDEVICES
help
- Select this option if you want to use channel-to-channel networking
- on IBM S/390 or zSeries. This device driver supports real CTC
- coupling using ESCON. It also supports virtual CTCs when running
- under VM. It will use the channel device configuration if this is
- available.  This option is also available as a module which will be
- called ctc.ko.  If you do not know what it is, it's safe to say Y.
+ Select this option if you want to use channel-to-channel
+ point-to-point networking on IBM System z.
+ This device driver supports real CTC coupling using ESCON.
+ It also supports virtual CTCs when running under VM.
+ To compile as a module, choose M. The module name is ctc.ko.
+ To compile into the kernel, choose Y.
+ If you do not need any channel-to-channel connection, choose N.
 
 config NETIUCV
tristate IUCV network device support (VM only)
@@ -29,9 +30,9 @@ config NETIUCV
  Select this option if you want to use inter-user communication
  vehicle networking under VM or VIF. It enables a fast communication
  link between VM guests. Using ifconfig a point-to-point connection
- can be established to the Linux for zSeries and S7390 system
- running on the other VM guest. This option is also available
- as a module which will be called netiucv.ko. If unsure, say Y.
+ can be established to the Linux on IBM System z
+ running on the other VM guest. To compile as a module, choose M.
+ The module name is netiucv.ko. If unsure, choose Y.
 
 config SMSGIUCV
tristate IUCV special message support (VM only)
@@ -47,22 +48,22 @@ config CLAW
  This driver supports channel attached CLAW devices.
  CLAW is Common Link Access for Workstation.  Common devices
   that use CLAW are RS/6000s, Cisco Routers (CIP) and 3172 devices.
- To compile as a module choose M here:  The module will be called
- claw.ko to compile into the kernel choose Y
+ To compile as a module, choose M. The module name is claw.ko.
+ To compile into the kernel, choose Y.
 
 config QETH
tristate Gigabit Ethernet device support
depends on CCW  NETDEVICES  IP_MULTICAST  QDIO
help
- This driver supports the IBM S/390 and zSeries OSA Express adapters
+ This driver supports the IBM System z OSA Express adapters
  in QDIO mode (all media types), HiperSockets interfaces and VM 
GuestLAN
  interfaces in QDIO and HIPER mode.

- For details please refer to the documentation provided by IBM at   
- http://www10.software.ibm.com/developerworks/opensource/linux390
+ For details please refer to the documentation provided by IBM at
+ http://www.ibm.com/developerworks/linux/linux390
 
- To compile this driver as a module, choose M here: the
- module will be called qeth.ko.
+ To compile this driver as a module, choose M.
+ The module name is qeth.ko.
 
 
 comment Gigabit Ethernet default settings

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


Re: Bug? Kernels 2.6.2x drops TCP packets over wireless (independentof card used)

2008-02-07 Thread Eric Dumazet

Marcin Koziej a écrit :

I have problem with wireless network connectivity;
TCP connections hang and timeout before all data is read.

Problem description:
I am connected to the network via hotspot wifi router:
ath0  IEEE 802.11g  ESSID:hotspot  Nickname:
  Mode:Managed  Frequency:2.462 GHz  Access Point: 00:60:B3:6C:A1:2E   
  Bit Rate:11 Mb/s   Tx-Power:17 dBm   Sensitivity=1/1  
  Retry:off   RTS thr:off   Fragment thr:off

  Power Management:off
  Link Quality=19/70  Signal level=-77 dBm  Noise level=-96 dBm
  Rx invalid nwid:43882  Rx invalid crypt:0  Rx invalid frag:0
  Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ICMP and UDP protocols seem to work (provided by 0% packet loss 
ping to router (and internet servers), and a working DNS resolver)

However, when I try to connect to a TCP service, for example FTP or HTTP, the
connection is made, request 
sent but truncated answer (or no answer) ever read back.


For example: 
# ftp ftp.icm.edu.pl

Connected to ftp.icm.edu.pl (193.219.28.140).
220-
(hangs)

The packet dump is:
23:56:08.807674 IP 192.168.1.2.51909  sunsite2.icm.edu.pl.ftp: S
980196671:980196671(0) win 5840 mss 1460,sackOK,timestamp 1971553 
0,nop,wscale 5


see here wscale = 5, so win = 186880


0x:  4500 003c 885e 4000 4006 124c c0a8 0102  E..[EMAIL 
PROTECTED]@..L
0x0010:  c1db 1c8c cac5 0015 3a6c 9d3f    :l.?
0x0020:  a002 16d0 d91a  0204 05b4 0402 080a  
0x0030:  001e 1561   0103 0305...a
23:56:08.821639 IP sunsite2.icm.edu.pl.ftp  192.168.1.2.51909: S
2723526584:2723526584(0) ack 980196672 win 5792 mss 1460,sackOK,timestamp
983901832 1971553,nop,wscale 7
0x:  4500 003c  4000 3c06 9eaa c1db 1c8c  E..[EMAIL 
PROTECTED]...
0x0010:  c0a8 0102 0015 cac5 a255 b7b8 3a6c 9d40  .U..:l.@
0x0020:  a012 16a0 1dfc  0204 05b4 0402 080a  
0x0030:  3aa5 2688 001e 1561 0103 0307:.a
23:56:08.821685 IP 192.168.1.2.51909  sunsite2.icm.edu.pl.ftp: . ack 1 win 183
nop,nop,timestamp 1971567 983901832
0x:  4500 0034 885f 4000 4006 1253 c0a8 0102  [EMAIL 
PROTECTED]@..S
0x0010:  c1db 1c8c cac5 0015 3a6c 9d40 a255 b7b9  :[EMAIL 
PROTECTED]
0x0020:  8010 00b7 62a3  0101 080a 001e 156f  b..o
0x0030:  3aa5 2688:..
23:56:08.842801 IP sunsite2.icm.edu.pl.ftp  192.168.1.2.51909: P 1:7(6) ack 1
win 46 nop,nop,timestamp 983901837 1971567
0x:  4510 003a 9135 4000 3c06 0d67 c1db 1c8c  E..:[EMAIL 
PROTECTED]..g
0x0010:  c0a8 0102 0015 cac5 a255 b7b9 3a6c 9d40  .U..:l.@
0x0020:  8018 002e f3af  0101 080a 3aa5 268d  :..
0x0030:  001e 156f 3232 302d 0d0a ...o220-..
23:56:08.843069 IP 192.168.1.2.51909  sunsite2.icm.edu.pl.ftp: . ack 7 win 183
nop,nop,timestamp 1971588 983901837


here, win = 183 is probably not correctly understood by remote peer (as 5856)


0x:  4510 0034 8860 4000 4006 1242 c0a8 0102  [EMAIL 
PROTECTED]@..B
0x0010:  c1db 1c8c cac5 0015 3a6c 9d40 a255 b7bf  :[EMAIL 
PROTECTED]
0x0020:  8010 00b7 6283  0101 080a 001e 1584  b...
0x0030:  3aa5 268d:..
23:56:31.920327 IP 192.168.1.2.51909  sunsite2.icm.edu.pl.ftp: F 1:1(0) ack 7
win 183 nop,nop,timestamp 1994676 983901837
0x:  4510 0034 8861 4000 4006 1241 c0a8 0102  [EMAIL 
PROTECTED]@..A
0x0010:  c1db 1c8c cac5 0015 3a6c 9d40 a255 b7bf  :[EMAIL 
PROTECTED]
0x0020:  8011 00b7 0852  0101 080a 001e 6fb4  .Ro.
0x0030:  3aa5 268d:..
23:56:31.935145 IP sunsite2.icm.edu.pl.ftp  192.168.1.2.51909: . ack 2 win 46
nop,nop,timestamp 983907613 1994676
0x:  4510 0034 913d 4000 3c06 0d65 c1db 1c8c  [EMAIL 
PROTECTED]..e
0x0010:  c0a8 0102 0015 cac5 a255 b8e5 3a6c 9d41  .U..:l.A
0x0020:  8010 002e f124  0101 080a 3aa5 3d1d  .$..:.=.
0x0030:  001e 6fb4..o.

Other machines work with the router fine.

How can I solve this problem?
I tried to look for some relevand info with athdebug, but i'm not sure what to
look for.
Can You help me?

System:
I am using  Atheros Communications, Inc. AR5212 802.11abg NIC PCMCIA card.
Computer is Acer Aspire 1520.

I use vanilla kernel:
Linux 2.6.23 #1 Sat Jan 12 12:07:39 CET 2008 i686 AMD Athlon(tm) 64 Processor
3700+ AuthenticAMD GNU/Linux
and madwifi driver ath_pci 0.9.4.5 (0.9.3.3)
kernel options: irqpoll (without irqpoll system doesn't detect pcmcia cards).

Device detection:
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
ath_pci: 0.9.4.5 

Re: Bug? Kernels 2.6.2x drops TCP packets over wireless (independent of card used)

2008-02-07 Thread Eric Dumazet

Marcin Koziej a écrit :

hmm, i think, the site is broken (193.219.28.140), and not the card or
the driver is wrong. when it does, then other sites are auch
reproductable ..

/* is use auch madwifi-0.9.3.3, but it think, it is not driver problem */



Unfortunately, this is not the case :(  This happens to all TCP connections, 
inside and outside LAN,
also with the telnet session with the router. I also tried to manipulate MTU, 
but without any positive effect.
I also tried to change things like net.ipv4.tcp_congestion_control -- which i 
figured out might affect TCP traffic, but also didn't get any results.
I'm afraid this can have something to do with IRQ, because the PCMCIA cards (my 
Atheros wireless card is such) are visible only with irqpoll kernel option.

Of course, as I mentioned, everything works fine with kernel 2.6.19; with the 
same servers etc.

  
Very strange, as the tcpdump you gave shows that the remote peer only 
sent 220-\r\n


This was ACKed, and then nothing but timeout. We can conclude remote 
peer is *very* slow or a firewall is blocking trafic after 6 bytes sent :)


Could you give a tcpdump for the same destination, on 2.6.19 this time ?





--
To unsubscribe from this list: send 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: + smack-unlabeled-outgoing-ambient-packets.patch added to -mm tree

2008-02-07 Thread David Miller
From: Andrew Morton [EMAIL PROTECTED]
Date: Thu, 7 Feb 2008 12:04:59 -0800

 It was on linux-kernel and netdev.  I've restored those cc's.

Perhaps Paul missed it because his email address was bouncing with
user unknown errors a few days ago so he got removed from all the
mailing lists @ vger :-)
--
To unsubscribe from this list: send 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: + smack-unlabeled-outgoing-ambient-packets.patch added to -mm tree

2008-02-07 Thread David Miller
From: Paul Moore [EMAIL PROTECTED]
Date: Thu, 7 Feb 2008 15:14:34 -0500

 My apologies, those mailing list postings there haven't hit my inbox yet.

I had to remove you a few days ago, see my other reply to
Andrew.

You are back on the lists now, so I hope that bounce problem
has been solved.
--
To unsubscribe from this list: send 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: + smack-unlabeled-outgoing-ambient-packets.patch added to -mm tree

2008-02-07 Thread Paul Moore
On Thursday 07 February 2008 8:34:02 pm David Miller wrote:
 From: Paul Moore [EMAIL PROTECTED]
 Date: Thu, 7 Feb 2008 15:14:34 -0500

  My apologies, those mailing list postings there haven't hit my inbox yet.

 I had to remove you a few days ago, see my other reply to
 Andrew.

 You are back on the lists now, so I hope that bounce problem
 has been solved.

Yeah, that discussion with Andrew made me look a bit deeper at my mail folders 
and I realized the last message I received from any of the vger.kernel.org 
mailing lists was late Tuesday night ... I thought Wednesday was awfully 
quiet :/

I have no idea what was causing the mail problem, probably somebody in our IT 
department playing around with some new knobs, oh well.  I resubscribed this 
afternoon with both fingers crossed.

-- 
paul moore
linux security @ hp
--
To unsubscribe from this list: send 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: [IPV4]: route: fix crash ip_route_input

2008-02-07 Thread David Miller
From: Patrick McHardy [EMAIL PROTECTED]
Date: Wed, 06 Feb 2008 14:36:57 +0100

 [IPV4]: route: fix crash ip_route_input
 
 ip_route_me_harder() may call ip_route_input() with skbs that don't
 have skb-dev set for skbs rerouted in LOCAL_OUT and TCP resets
 generated by the REJECT target, resulting in a crash when dereferencing
 skb-dev-nd_net. Since ip_route_input() has an input device argument,
 it seems correct to use that one anyway.
 
 Bug introduced in b5921910a1 (Routing cache virtualization).
 
 Signed-off-by: Patrick McHardy [EMAIL PROTECTED]

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


Re: [patch 0/3] [IUCV] fixes for net-2.6.25

2008-02-07 Thread David Miller
From: Ursula Braun [EMAIL PROTECTED]
Date: Thu, 07 Feb 2008 15:28:42 +0100

 -- 
 Dave,
 
 the following 3 patches are intended for 2.6.25 and contain:
 - locking changes in iucv.c
 - locking changes in af_iucv.c
 - extra checkings for successful allocations in af_iucv.c
 - secure handling of send_skb_q list in af_iucv.c

Applied, 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] [IPV6] Minor clenup: remove two unused definitions in net/ip6_route.h

2008-02-07 Thread David Miller
From: Rami Rosen [EMAIL PROTECTED]
Date: Thu, 7 Feb 2008 17:58:07 +0200

 Remove IP6_RT_PRIO_FW and IP6_RT_FLOW_MASK definitions in
 include/net/ip6_route.h, as they are not used in the kernel.
 
 Signed-off-by: Rami Rosen [EMAIL PROTECTED]

Applied.

If you grep for fc_metric in the tree you'll see some
explicit uses of the magic constant 1024 which probably
should be replaced with IP6_RT_PRIO_USER.  If you could
verify that and cook up a patch if correct, I'd appreciate
it.

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] [IPV6] Minor cleanup: remove unused definitions in net/ip6_fib.h

2008-02-07 Thread David Miller
From: Rami Rosen [EMAIL PROTECTED]
Date: Thu, 7 Feb 2008 18:23:58 +0200

 Hi,
 
 This patch removes some unused definitions and one method typedef
 declaration (f_pnode)
 in include/net/ip6_fib.h, as they are not used in the kernel.
 
 Signed-off-by: Rami Rosen [EMAIL PROTECTED]

Applied, 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: + smack-unlabeled-outgoing-ambient-packets.patch added to -mm tree

2008-02-07 Thread David Miller
From: Paul Moore [EMAIL PROTECTED]
Date: Thu, 7 Feb 2008 20:54:56 -0500

 I have no idea what was causing the mail problem, probably somebody
 in our IT department playing around with some new knobs, oh well.  I
 resubscribed this afternoon with both fingers crossed.

In the future please contact [EMAIL PROTECTED] when you
notice you have been unsubscribed so we can work on fixing the
issue.

Blind resubscriptions are severely frowned upon, we remove you for
good reason and if the problem isn't solved you'll just soil up my
inbox further with bounces
--
To unsubscribe from this list: send 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] [TIPC] Kill unused static inline (x5)

2008-02-07 Thread David Miller
From: Ilpo_Järvinen [EMAIL PROTECTED]
Date: Sat, 26 Jan 2008 01:02:38 +0200

 All these static inlines are unused:
 
 in_own_zone 1 (net/tipc/addr.h)
 msg_dataoctet   1 (net/tipc/msg.h)
 msg_direct  1 (include/net/tipc/tipc_msg.h)
 msg_options 1 (include/net/tipc/tipc_msg.h)
 tipc_nmap_get   1 (net/tipc/bcast.h)
 
 Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]

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


Re: + smack-unlabeled-outgoing-ambient-packets.patch added to -mm tree

2008-02-07 Thread Paul Moore
On Thursday 07 February 2008 9:15:19 pm David Miller wrote:
 From: Paul Moore [EMAIL PROTECTED]
 Date: Thu, 7 Feb 2008 20:54:56 -0500

  I have no idea what was causing the mail problem, probably somebody
  in our IT department playing around with some new knobs, oh well.  I
  resubscribed this afternoon with both fingers crossed.

 In the future please contact [EMAIL PROTECTED] when you
 notice you have been unsubscribed so we can work on fixing the
 issue.

 Blind resubscriptions are severely frowned upon, we remove you for
 good reason and if the problem isn't solved you'll just soil up my
 inbox further with bounces

Both points noted for future reference.  While the end result is the same, I 
can promise you my actions are not maliciously stupid, just ignorantly 
stupid ;)

-- 
paul moore
linux security @ hp
--
To unsubscribe from this list: send 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] [TIPC]: declare proto_ops structures as 'const'.

2008-02-07 Thread David Miller
From: Florian Westphal [EMAIL PROTECTED]
Date: Sat, 26 Jan 2008 00:37:53 +0100

 Signed-off-by: Florian Westphal [EMAIL PROTECTED]

Applied, 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 0/3] CAN: Some updates for 2.6.25

2008-02-07 Thread David Miller
From: [EMAIL PROTECTED]
Date: Wed,  6 Feb 2008 23:07:49 +0100

 The following patches are intended for 2.6.25.

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


Re: [PATCH 3/3] Interface to query tun/tap features.

2008-02-07 Thread Max Krasnyansky
Hi Rusty,

Sorry for delay in reply. I totally missed this one. Need to fix my mail 
filters. 
See below.

Rusty Russell wrote:
 (No real change, just updated with new bits)
 
 The problem with introducing IFF_RECV_CSUM and IFF_RECV_GSO is that
 they need to set dev-features to enable GSO and/or checksumming,
 which is supposed to be done before register_netdevice(), ie. as part
 of TUNSETIFF.
 
 Unfortunately, TUNSETIFF has always just ignored flags it doesn't understand,
 so there's no good way of detecting whether the kernel supports IFF_GSO_HDR.
 
 This patch implements a TUNGETFEATURES ioctl which returns all the valid IFF
 flags.  It could be extended later to include other features.
 
 Here's an example program which uses it:
 
 #include linux/if_tun.h
 #include sys/types.h
 #include sys/ioctl.h
 #include sys/stat.h
 #include fcntl.h
 #include err.h
 #include stdio.h
 
 static struct {
   unsigned int flag;
   const char *name;
 } known_flags[] = {
   { IFF_TUN, TUN },
   { IFF_TAP, TAP },
   { IFF_NO_PI, NO_PI },
   { IFF_ONE_QUEUE, ONE_QUEUE },
   { IFF_VIRTIO_HDR, VIRTIO_HDR },
   { IFF_RECV_CSUM, RECV_CSUM },
   { IFF_RECV_GSO, RECV_GSO },
 };
 
 int main()
 {
   unsigned int features, i;
 
   int netfd = open(/dev/net/tun, O_RDWR);
   if (netfd  0)
   err(1, Opening /dev/net/tun);
 
   if (ioctl(netfd, TUNGETFEATURES, features) != 0) {
   printf(Kernel does not support TUNGETFEATURES, guessing\n);
   features = (IFF_TUN|IFF_TAP|IFF_NO_PI|IFF_ONE_QUEUE);
   }
   printf(Available features are: );
   for (i = 0; i  sizeof(known_flags)/sizeof(known_flags[0]); i++) {
   if (features  known_flags[i].flag) {
   features = ~known_flags[i].flag;
   printf(%s , known_flags[i].name);
   }
   }
   if (features)
   printf((UNKNOWN %#x), features);
   printf(\n);
   return 0;
 }
 
 Signed-off-by: Rusty Russell [EMAIL PROTECTED]
 ---
  drivers/net/tun.c  |9 +
  include/linux/if_tun.h |3 +++
  2 files changed, 12 insertions(+)
 
 diff -r c0e7a8b99325 drivers/net/tun.c
 --- a/drivers/net/tun.c   Wed Jan 23 20:12:51 2008 +1100
 +++ b/drivers/net/tun.c   Wed Jan 23 20:17:28 2008 +1100
 @@ -790,6 +790,15 @@ static int tun_chr_ioctl(struct inode *i
   return 0;
   }
  
 + if (cmd == TUNGETFEATURES) {
 + /* Currently this just means: what IFF flags are valid?.
 +  * This is needed because we never checked for invalid flags on
 +  * TUNSETIFF.  This was introduced with IFF_GSO_HDR, so if a
 +  * kernel doesn't have this ioctl, it doesn't have GSO header
 +  * support. */
 + return put_user(IFF_ALL_FLAGS, (unsigned int __user*)argp);
 + }
 +
   if (!tun)
   return -EBADFD;
  
 diff -r c0e7a8b99325 include/linux/if_tun.h
 --- a/include/linux/if_tun.h  Wed Jan 23 20:12:51 2008 +1100
 +++ b/include/linux/if_tun.h  Wed Jan 23 20:17:28 2008 +1100
 @@ -82,6 +82,7 @@ struct tun_struct {
  #define TUNSETOWNER   _IOW('T', 204, int)
  #define TUNSETLINK_IOW('T', 205, int)
  #define TUNSETGROUP   _IOW('T', 206, int)
 +#define TUNGETFEATURES _IOR('T', 207, unsigned int)
  
  /* TUNSETIFF ifr flags */
  #define IFF_TUN  0x0001
 @@ -91,6 +92,8 @@ struct tun_struct {
  #define IFF_VIRTIO_HDR   0x4000
  #define IFF_RECV_CSUM0x8000
  #define IFF_RECV_GSO 0x0800
 +#define IFF_ALL_FLAGS (IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE | \
 +IFF_VIRTIO_HDR | IFF_RECV_CSUM | IFF_RECV_GSO)
  
  struct tun_pi {
   unsigned short flags;

Definitely Ack this one. Query interface makes perfect sense.
I'll reply to the GSO itself shortly.

I was going to create git tree for tun changes for awhile now. Looks like the 
time has come.
I'll do that asap.

Thanx
Max

 


--
To unsubscribe from this list: send 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] Add IPv6 support to TCP SYN cookies

2008-02-07 Thread Glenn Griffin
 Or maybe use percpu storage for that...

That seems like a good approach.  I'll incorporate it into my v6 patch,
and send out an update.  Thanks.

 I am not sure if cookie_hash() is always called with preemption disabled.
 (If not, we have to use get_cpu_var()/put_cpu_var())

cookie_hash is always called within NET_RX_SOFTIRQ context so I believe
preemption will always be disabled by __do_softirq().  So there
shouldn't be a need to use get_cpu_var/put_cpu_var, somebody correct me
if I'm wrong.

--Glenn

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


Re: [Bugme-new] [Bug 9888] New: tun device without protocol info header fails under IPv6

2008-02-07 Thread Max Krasnyansky
Andrew Morton wrote:
 On Mon,  4 Feb 2008 13:46:13 -0800 (PST)
 [EMAIL PROTECTED] wrote:

 Open a tun device as type TUN, set the TUN_NO_PI flag, and try sending an 
 IPv6
 packet. The packet appears at the interface under tcpdumps, but propagates no
 further. This is because the default protocol info used for tun devices where
 the TUN_NO_PI flag is set assumes IPv4 as can be seen by the initialization 
 at
 the top of the tun_get_user function in drivers/net/tun.c file given by

 struct tun_pi pi = { 0, __constant_htons(ETH_P_IP) };

 This can easily be fixed by adding a quick check at the top of tun_get_user.
 Basically the code that used to read

 if (!(tun-flags  TUN_NO_PI)) {
 if ((len -= sizeof(pi))  count)
 return -EINVAL;

 if(memcpy_fromiovec((void *)pi, iv, sizeof(pi)))
 return -EFAULT;
 }

 when changed to read

 if (!(tun-flags  TUN_NO_PI)) {
 if ((len -= sizeof(pi))  count)
 return -EINVAL;

 if(memcpy_fromiovec((void *)pi, iv, sizeof(pi)))
 return -EFAULT;
 }
 else {
   /* Fixup default pi if IPv6 rather than IPv4 */
   if (((tun-flags  TUN_TYPE_MASK) == TUN_TUN_DEV) 
   (*(char *)(iv-iov_base)  == 0x60)) {
 pi.proto = __constant_htons(ETH_P_IPV6);
   }
 }

 fixes the problem. 

 How do we get this in as part of the maintained codebase??

 
 Please email a tested patch prepared as described in
 
   Documentation/SubmittingPatches
   Documentation/SubmitChecklist
   http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt
 
 to
 
   Maxim Krasnyansky [EMAIL PROTECTED]
   David S. Miller [EMAIL PROTECTED]
   Andrew Morton [EMAIL PROTECTED]
   netdev@vger.kernel.org

btw I'd be ok with this fix. But I guess the questions is why not use 
struct tun_pi in the apps instead ?

Max





--
To unsubscribe from this list: send 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] Add IPv6 support to TCP SYN cookies

2008-02-07 Thread Glenn Griffin
Updated to incorporate Eric's suggestion of using a per cpu buffer
rather than allocating on the stack.  Just a two line change, but will
resend in it's entirety.

Signed-off-by: Glenn Griffin [EMAIL PROTECTED]
---
 include/net/tcp.h|8 ++
 net/ipv4/syncookies.c|7 +-
 net/ipv4/tcp_input.c |1 +
 net/ipv4/tcp_minisocks.c |2 +
 net/ipv4/tcp_output.c|1 +
 net/ipv6/Makefile|1 +
 net/ipv6/syncookies.c|  267 ++
 net/ipv6/tcp_ipv6.c  |   77 ++
 8 files changed, 338 insertions(+), 26 deletions(-)
 create mode 100644 net/ipv6/syncookies.c

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 7de4ea3..c428ec7 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -29,6 +29,7 @@
 #include linux/skbuff.h
 #include linux/dmaengine.h
 #include linux/crypto.h
+#include linux/cryptohash.h
 
 #include net/inet_connection_sock.h
 #include net/inet_timewait_sock.h
@@ -434,11 +435,17 @@ extern inttcp_disconnect(struct 
sock *sk, int flags);
 extern voidtcp_unhash(struct sock *sk);
 
 /* From syncookies.c */
+extern __u32 syncookie_secret[2][16-3+SHA_DIGEST_WORDS];
 extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 
struct ip_options *opt);
 extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 
 __u16 *mss);
 
+/* From net/ipv6/syncookies.c */
+extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
+extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,
+__u16 *mss);
+
 /* tcp_output.c */
 
 extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
@@ -1332,6 +1339,7 @@ extern int tcp_proc_register(struct tcp_seq_afinfo 
*afinfo);
 extern void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo);
 
 extern struct request_sock_ops tcp_request_sock_ops;
+extern struct request_sock_ops tcp6_request_sock_ops;
 
 extern int tcp_v4_destroy_sock(struct sock *sk);
 
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index f470fe4..cc6637b 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -10,8 +10,6 @@
  *  2 of the License, or (at your option) any later version.
  *
  *  $Id: syncookies.c,v 1.18 2002/02/01 22:01:04 davem Exp $
- *
- *  Missing: IPv6 support.
  */
 
 #include linux/tcp.h
@@ -23,14 +21,15 @@
 
 extern int sysctl_tcp_syncookies;
 
-static __u32 syncookie_secret[2][16-3+SHA_DIGEST_WORDS];
+__u32 syncookie_secret[2][16-3+SHA_DIGEST_WORDS];
+EXPORT_SYMBOL(syncookie_secret);
 
 static __init int init_syncookies(void)
 {
get_random_bytes(syncookie_secret, sizeof(syncookie_secret));
return 0;
 }
-module_init(init_syncookies);
+__initcall(init_syncookies);
 
 #define COOKIEBITS 24  /* Upper bits store count */
 #define COOKIEMASK (((__u32)1  COOKIEBITS) - 1)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 19c449f..93e128c 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5326,6 +5326,7 @@ discard:
 
 EXPORT_SYMBOL(sysctl_tcp_ecn);
 EXPORT_SYMBOL(sysctl_tcp_reordering);
+EXPORT_SYMBOL(sysctl_tcp_adv_win_scale);
 EXPORT_SYMBOL(tcp_parse_options);
 EXPORT_SYMBOL(tcp_rcv_established);
 EXPORT_SYMBOL(tcp_rcv_state_process);
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index b61b768..0f494cd 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -35,6 +35,8 @@
 #endif
 
 int sysctl_tcp_syncookies __read_mostly = SYNC_INIT;
+EXPORT_SYMBOL(sysctl_tcp_syncookies);
+
 int sysctl_tcp_abort_on_overflow __read_mostly;
 
 struct inet_timewait_death_row tcp_death_row = {
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index ed750f9..cbfef8b 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2560,6 +2560,7 @@ void tcp_send_probe0(struct sock *sk)
}
 }
 
+EXPORT_SYMBOL(tcp_select_initial_window);
 EXPORT_SYMBOL(tcp_connect);
 EXPORT_SYMBOL(tcp_make_synack);
 EXPORT_SYMBOL(tcp_simple_retransmit);
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index 24f3aa0..ae14617 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -16,6 +16,7 @@ ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o 
xfrm6_input.o \
 ipv6-$(CONFIG_NETFILTER) += netfilter.o
 ipv6-$(CONFIG_IPV6_MULTIPLE_TABLES) += fib6_rules.o
 ipv6-$(CONFIG_PROC_FS) += proc.o
+ipv6-$(CONFIG_SYN_COOKIES) += syncookies.o
 
 ipv6-objs += $(ipv6-y)
 
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
new file mode 100644
index 000..063dade
--- /dev/null
+++ b/net/ipv6/syncookies.c
@@ -0,0 +1,267 @@
+/*
+ *  IPv6 Syncookies implementation for the Linux kernel
+ *
+ *  Authors:
+ *  Glenn Griffin  [EMAIL PROTECTED]
+ *
+ *  Based on IPv4 implementation by Andi Kleen
+ *  linux/net/ipv4/syncookies.c
+ *
+ * This program is free software; you can redistribute it 

Re: [PATCH 2/3] partial checksum and GSO support for tun/tap.

2008-02-07 Thread Max Krasnyansky
Rusty Russell wrote:
 (Changes since last time: we how have explicit IFF_RECV_CSUM and 
 IFF_RECV_GSO bits, and some renaming of virtio_net hdr)
 
 We use the virtio_net_hdr: it is an ABI already and designed to
 encapsulate such metadata as GSO and partial checksums.
 
 IFF_VIRTIO_HDR means you will write and read a 'struct virtio_net_hdr'
 at the start of each packet.  You can always write packets with
 partial checksum and gso to the tap device using this header.
 
 IFF_RECV_CSUM means you can handle reading packets with partial
 checksums.  If IFF_RECV_GSO is also set, it means you can handle
 reading (all types of) GSO packets.

 Note that there is no easy way to detect if these flags are supported:
 see next patch.

Again sorry for delay in replying. Here are my thoughts on this.

I like the approach in general. Certainly the part that creates skbs out of the 
user-space
pages looks good. And it's fits nicely into existing TUN driver model.
However I actually wanted to change the model :). In particular I'm talking 
about 
syscall per packet 
After messing around with things like libe1000.sf.net I'd like to make TUN/TAP 
driver look 
more like modern nic's to the user-space. In other words I'm thinking about 
introducing RX and
TX rings that the user-space can then mmap() and write/read packets descriptors 
to/from.
That will saves the number of system calls that the user-space app needs to do. 
That by 
itself saves a lot of overhead, combined with the GSO it's be lightning fast.

I'm going to send you a version that I cooked up awhile ago in a private email. 
Do not want
to spam netdev :). It's not quite the RX/TX ring model but I'll give you an 
idea.
I did some profiling and PPS (packets per second) numbers that user-space can 
handle literally 
sky rocketed.

btw We had a long discussion with Eugeniy Polakov on mapping user-pages vs 
mmap()ing large
kernel buffer and doing normal memcpy() (ie instead of copy_to/fromuser()) in 
the kernel.
On small packets overhead of get_user_pages() eats up all the benefits. So we 
should think
of some scheme that nicely combines the two. Kind of like copy break that 
latest net 
drivers do these days.

Also btw why call it VIRTIO ? For example I'm actually interested in speeding 
up tunning
and general network apps. We have wireless basestation apps here that need to 
handle packets
in user-space. Those kind things have nothing to with virtualization.

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


[IPSEC] flow: reorder struct flow_cache_entry and remove SLAB_HWCACHE_ALIGN

2008-02-07 Thread Eric Dumazet

1) We can shrink sizeof(struct flow_cache_entry) by 8 bytes on 64bit arches.
2) No need to align these structures to hardware cache lines, this only waste 
 ram for very litle gain.


Signed-off-by: Eric Dumazet [EMAIL PROTECTED]

diff --git a/net/core/flow.c b/net/core/flow.c
index 9cfe845..a77531c 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -30,8 +30,8 @@ struct flow_cache_entry {
struct flow_cache_entry *next;
u16 family;
u8  dir;
-   struct flowikey;
u32 genid;
+   struct flowikey;
void*object;
atomic_t*object_ref;
 };
@@ -346,7 +346,7 @@ static int __init flow_cache_init(void)
 
flow_cachep = kmem_cache_create(flow_cache,
sizeof(struct flow_cache_entry),
-   0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
+   0, SLAB_PANIC,
NULL);
flow_hash_shift = 10;
flow_lwm = 2 * flow_hash_size;


Re: [Bugme-new] [Bug 9914] New: bnx2 driver of latest kernel 2.6.24 not working with Cisco catalyst 650x Switch

2008-02-07 Thread Andrew Morton
On Thu,  7 Feb 2008 23:06:55 -0800 (PST) [EMAIL PROTECTED] wrote:

 http://bugzilla.kernel.org/show_bug.cgi?id=9914
 
Summary: bnx2 driver of latest kernel 2.6.24 not working with
 Cisco catalyst 650x Switch
Product: Drivers
Version: 2.5
  KernelVersion: 2.6.24
   Platform: All
 OS/Version: Linux
   Tree: Mainline
 Status: NEW
   Severity: normal
   Priority: P1
  Component: Network
 AssignedTo: [EMAIL PROTECTED]
 ReportedBy: [EMAIL PROTECTED]
 
 
 Latest working kernel version: (Works with Redhat 4 kernel)
 Earliest failing kernel version: 2.6.24
 Distribution: Self, kernel.org's kernel version 2.6.24
 Hardware Environment: Dell 2950
 Software Environment: Linux from Scratch, kernel version 2.6.24
 
 Problem Description:
 I am using the latest kernel 2.6.24. The hardware unit is a 2950 Dell box.
 The firmware version of bnx2 is 2.9.1. The bnx2 driver does work with other
 flavors of Cisco Switches like 290x. It is having problems at a customer site
 who has a Cisco 650x.
 
 The customer tried the RHEL 4 and does seem to work fine. The RHEL4 comes with
 the version of bnx2: 1.4.38
 
 The version on 2.6.24 is 1.6.9.
 
 Can anyone give me pointers as to why this is broken? Where can I get a 
 patch? 
 
 Any help is appreciated.
 
 
 
 
 Steps to reproduce:
 The driver does not auto-negotiate, neither does it work with a fixed link
 speed.
 
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[DECNET] ROUTE: remove unecessary alignment

2008-02-07 Thread Eric Dumazet

Same alignment requirement was removed on IP route cache in the past.

This alignment actually has bad effect on 32 bit arches, uniprocessor, since
sizeof(dn_rt_hash_bucket) is forced to 8 bytes instead of 4.

Signed-off-by: Eric Dumazet [EMAIL PROTECTED]

diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 31be29b..9dc0abb 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -94,7 +94,7 @@ struct dn_rt_hash_bucket
 {
struct dn_route *chain;
spinlock_t lock;
-} __attribute__((__aligned__(8)));
+};
 
 extern struct neigh_table dn_neigh_table;
 


Re: [DECNET] ROUTE: remove unecessary alignment

2008-02-07 Thread David Miller
From: Eric Dumazet [EMAIL PROTECTED]
Date: Fri, 08 Feb 2008 08:21:06 +0100

 Same alignment requirement was removed on IP route cache in the past.
 
 This alignment actually has bad effect on 32 bit arches, uniprocessor, since
 sizeof(dn_rt_hash_bucket) is forced to 8 bytes instead of 4.
 
 Signed-off-by: Eric Dumazet [EMAIL PROTECTED]

Applied, anyone who shows love for DecNET deserves some love
in return :-)
--
To unsubscribe from this list: send 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: [IPSEC] flow: reorder struct flow_cache_entry and remove SLAB_HWCACHE_ALIGN

2008-02-07 Thread David Miller
From: Eric Dumazet [EMAIL PROTECTED]
Date: Fri, 08 Feb 2008 08:12:49 +0100

 1) We can shrink sizeof(struct flow_cache_entry) by 8 bytes on 64bit arches.
 2) No need to align these structures to hardware cache lines, this only waste 
   ram for very litle gain.
 
 Signed-off-by: Eric Dumazet [EMAIL PROTECTED]

Applied, thanks 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