Re: pktgen

2006-12-01 Thread Robert Olsson

David Miller writes:

  Agreed.
  
  Robert, please fix this by using a completion so that we can
  wait for the threads to start up, something like this:

Included. It passes my test but Alexey and others test.
Cheers.
--ro

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 733d86d..a630a73 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -147,6 +147,7 @@
 #include linux/proc_fs.h
 #include linux/seq_file.h
 #include linux/wait.h
+#include linux/completion.h
 #include linux/etherdevice.h
 #include net/checksum.h
 #include net/ipv6.h
@@ -160,7 +161,7 @@
 #include asm/div64.h /* do_div */
 #include asm/timex.h
 
-#define VERSION  pktgen v2.68: Packet Generator for packet performance 
testing.\n
+#define VERSION  pktgen v2.69: Packet Generator for packet performance 
testing.\n
 
 /* #define PG_DEBUG(a) a */
 #define PG_DEBUG(a)
@@ -206,6 +207,11 @@ static struct proc_dir_entry *pg_proc_di
 #define VLAN_TAG_SIZE(x) ((x)-vlan_id == 0x ? 0 : 4)
 #define SVLAN_TAG_SIZE(x) ((x)-svlan_id == 0x ? 0 : 4)
 
+struct pktgen_thread_info {
+   struct pktgen_thread *t;
+   struct completion *c;
+};
+
 struct flow_state {
__u32 cur_daddr;
int count;
@@ -3264,10 +3270,11 @@ out:;
  * Main loop of the thread goes here
  */
 
-static void pktgen_thread_worker(struct pktgen_thread *t)
+static void pktgen_thread_worker(struct pktgen_thread_info *info)
 {
DEFINE_WAIT(wait);
struct pktgen_dev *pkt_dev = NULL;
+   struct pktgen_thread *t = info-t;
int cpu = t-cpu;
sigset_t tmpsig;
u32 max_before_softirq;
@@ -3307,6 +3314,8 @@ static void pktgen_thread_worker(struct 
__set_current_state(TASK_INTERRUPTIBLE);
mb();
 
+complete(info-c);
+
while (1) {
 
__set_current_state(TASK_RUNNING);
@@ -3518,6 +3527,8 @@ static struct pktgen_thread *__init pktg
 static int __init pktgen_create_thread(const char *name, int cpu)
 {
int err;
+   struct pktgen_thread_info info;
+struct completion started;
struct pktgen_thread *t = NULL;
struct proc_dir_entry *pe;
 
@@ -3558,7 +3569,11 @@ static int __init pktgen_create_thread(c
 
t-removed = 0;
 
-   err = kernel_thread((void *)pktgen_thread_worker, (void *)t,
+   init_completion(started);
+info.t = t;
+info.c = started;
+
+   err = kernel_thread((void *)pktgen_thread_worker, (void *)info,
  CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
if (err  0) {
printk(pktgen: kernel_thread() failed for cpu %d\n, t-cpu);
@@ -3568,6 +3583,7 @@ static int __init pktgen_create_thread(c
return err;
}
 
+   wait_for_completion(started);
return 0;
 }
 
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pktgen

2006-12-01 Thread Christoph Hellwig
On Thu, Nov 30, 2006 at 08:14:23PM -0800, David Miller wrote:
 Agreed.
 
 Robert, please fix this by using a completion so that we can
 wait for the threads to start up, something like this:

No, that's wrong aswell :)  Please use the kthread_ API that takes
care of all this.  kernel_thread is going away mid-term, so you'd
have to do this work anyway.

-
To unsubscribe from this list: send 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: pktgen

2006-12-01 Thread Alexey Dobriyan

On 12/1/06, Robert Olsson [EMAIL PROTECTED] wrote:

David Miller writes:
  Agreed.
 
  Robert, please fix this by using a completion so that we can
  wait for the threads to start up, something like this:

Included. It passes my test but Alexey and others test.


Confused now. Is my t-control = ~(T_TERMINATE); fix deprecated by
completions?


--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -147,6 +147,7 @@
 #include linux/proc_fs.h
 #include linux/seq_file.h
 #include linux/wait.h
+#include linux/completion.h
 #include linux/etherdevice.h
 #include net/checksum.h
 #include net/ipv6.h
@@ -160,7 +161,7 @@
 #include asm/div64.h   /* do_div */
 #include asm/timex.h

-#define VERSION  pktgen v2.68: Packet Generator for packet performance
testing.\n
+#define VERSION  pktgen v2.69: Packet Generator for packet performance
testing.\n

 /* #define PG_DEBUG(a) a */
 #define PG_DEBUG(a)
@@ -206,6 +207,11 @@ static struct proc_dir_entry *pg_proc_di
 #define VLAN_TAG_SIZE(x) ((x)-vlan_id == 0x ? 0 : 4)
 #define SVLAN_TAG_SIZE(x) ((x)-svlan_id == 0x ? 0 : 4)

+struct pktgen_thread_info {
+   struct pktgen_thread *t;
+   struct completion *c;
+};
+
 struct flow_state {
__u32 cur_daddr;
int count;
@@ -3264,10 +3270,11 @@ out:;
  * Main loop of the thread goes here
  */

-static void pktgen_thread_worker(struct pktgen_thread *t)
+static void pktgen_thread_worker(struct pktgen_thread_info *info)
 {
DEFINE_WAIT(wait);
struct pktgen_dev *pkt_dev = NULL;
+   struct pktgen_thread *t = info-t;
int cpu = t-cpu;
sigset_t tmpsig;
u32 max_before_softirq;
@@ -3307,6 +3314,8 @@ static void pktgen_thread_worker(struct
__set_current_state(TASK_INTERRUPTIBLE);
mb();

+complete(info-c);
+
while (1) {

__set_current_state(TASK_RUNNING);
@@ -3518,6 +3527,8 @@ static struct pktgen_thread *__init pktg
 static int __init pktgen_create_thread(const char *name, int cpu)
 {
int err;
+   struct pktgen_thread_info info;
+struct completion started;
struct pktgen_thread *t = NULL;
struct proc_dir_entry *pe;

@@ -3558,7 +3569,11 @@ static int __init pktgen_create_thread(c

t-removed = 0;

-   err = kernel_thread((void *)pktgen_thread_worker, (void *)t,
+   init_completion(started);
+info.t = t;
+info.c = started;
+
+   err = kernel_thread((void *)pktgen_thread_worker, (void *)info,
  CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
if (err  0) {
printk(pktgen: kernel_thread() failed for cpu %d\n, t-cpu);
@@ -3568,6 +3583,7 @@ static int __init pktgen_create_thread(c
return err;
}

+   wait_for_completion(started);
return 0;
 }

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


[PATCH 0/2][GENETLINK] Some cleanups

2006-12-01 Thread jamal
Using these 2 patches to test how well my lil soldier is doing with
this new email settings; so if they come out mangled, yell.

Patches against net-2.6.20 from an hour ago.

cheers,
jamal

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


[G[PATCH 1/2][ENETLINK] max cmd boundary chec

2006-12-01 Thread jamal
hopefully no mime crap
cheers,
jamal
[GENETLINK] max cmd boundary check

We need to boundary check for commands being registered.

Signed-off-by: Jamal Hadi Salim[EMAIL PROTECTED]

---
commit 349e0e00396b79d8f2f9a41f6dc28dee9e7d3e3e
tree 02388c5729f2481644643a41837135bf52698e9e
parent 5465ae68b5ec11b2820db3f9b4c6fd94f113da44
author J Hadi Salim [EMAIL PROTECTED] Fri, 01 Dec 2006 05:59:46 -0500
committer J Hadi Salim [EMAIL PROTECTED] Fri, 01 Dec 2006 05:59:46 -0500

 include/linux/genetlink.h |1 +
 net/netlink/genetlink.c   |   21 ++---
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index 9049dc6..2427d58 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -7,6 +7,7 @@
 
 #define GENL_MIN_IDNLMSG_MIN_TYPE
 #define GENL_MAX_ID1023
+#define GENL_MAX_CMDS  256
 
 struct genlmsghdr {
__u8cmd;
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index cc874f0..50928da 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -79,13 +79,22 @@ static struct genl_family *genl_family_find_byname(char 
*name)
return NULL;
 }
 
-static struct genl_ops *genl_get_cmd(u8 cmd, struct genl_family *family)
+static struct genl_ops *genl_get_cmd(u8 cmd, struct genl_family *family, int 
*err)
 {
+   int i = 0;
struct genl_ops *ops;
 
-   list_for_each_entry(ops, family-ops_list, ops_list)
-   if (ops-cmd == cmd)
+   list_for_each_entry(ops, family-ops_list, ops_list) {
+   if (ops-cmd == cmd) {
+   *err = -EEXIST;
return ops;
+   }
+   if (++i  GENL_MAX_CMDS) {
+   /* is there a better code for exceeding range?*/
+   *err = -ERANGE;
+   return ops;
+   }
+   }
 
return NULL;
 }
@@ -138,10 +147,8 @@ int genl_register_ops(struct genl_family *family, struct 
genl_ops *ops)
if (ops-dumpit == NULL  ops-doit == NULL)
goto errout;
 
-   if (genl_get_cmd(ops-cmd, family)) {
-   err = -EEXIST;
+   if (genl_get_cmd(ops-cmd, family, err)) 
goto errout;
-   }
 
genl_lock();
list_add_tail(ops-ops_list, family-ops_list);
@@ -313,7 +320,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct 
nlmsghdr *nlh,
if (nlh-nlmsg_len  nlmsg_msg_size(hdrlen))
goto errout;
 
-   ops = genl_get_cmd(hdr-cmd, family);
+   ops = genl_get_cmd(hdr-cmd, family, err);
if (ops == NULL) {
err = -EOPNOTSUPP;
goto errout;


[PATCH 2/2][GENETLINK] add cmd dump completion

2006-12-01 Thread jamal
Sorry, subject was a little messed in the previous one, but should
be fine going forward ..

cheers,
jamal

[GENETLINK] add cmd dump completion

Remove assumption that generic netlink commands cannot have dump
completion callbacks.

Signed-off-by: Jamal Hadi Salim[EMAIL PROTECTED]

---
commit 7df98e8c6358e7e8483279904823b7bb7bcf8e50
tree 774cd008cbfb4f981e30064da301b8fc7f9476f6
parent 349e0e00396b79d8f2f9a41f6dc28dee9e7d3e3e
author Jamal Hadi Salim [EMAIL PROTECTED] Fri, 01 Dec 2006 06:14:20 -0500
committer Jamal Hadi Salim [EMAIL PROTECTED] Fri, 01 Dec 2006 06:14:20 -0500

 include/net/genetlink.h |2 ++
 net/netlink/genetlink.c |2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 7fd131c..adff4c8 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -53,6 +53,7 @@ struct genl_info
  * @policy: attribute validation policy
  * @doit: standard command callback
  * @dumpit: callback for dumpers
+ * @done: completion callback for dumps
  * @ops_list: operations list
  */
 struct genl_ops
@@ -64,6 +65,7 @@ struct genl_ops
   struct genl_info *info);
int(*dumpit)(struct sk_buff *skb,
 struct netlink_callback *cb);
+   int(*done)(struct netlink_callback *cb);
struct list_headops_list;
 };
 
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 50928da..96b6820 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -338,7 +338,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct 
nlmsghdr *nlh,
}
 
*errp = err = netlink_dump_start(genl_sock, skb, nlh,
-ops-dumpit, NULL);
+ops-dumpit, ops-done);
if (err == 0)
skb_pull(skb, min(NLMSG_ALIGN(nlh-nlmsg_len),
  skb-len));


Re: [PATCH 1/1] add auditing to ipsec

2006-12-01 Thread jamal
On Tue, 2006-28-11 at 00:08 -0500, James Morris wrote:
 On Mon, 27 Nov 2006, Joy Latten wrote:

 Looks ok to me.
 

Seems like a lot of other xfrm commands are not covered though?
Design intent?

cheers,
jamal

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


Re: [RFC][PATCH 1/6] mm: slab allocation fairness

2006-12-01 Thread Peter Zijlstra
On Thu, 2006-11-30 at 11:33 -0800, Christoph Lameter wrote:
 On Thu, 30 Nov 2006, Peter Zijlstra wrote:
 
  No, the forced allocation is to test the allocation hardness at that
  point in time. I could not think of another way to test that than to
  actually to an allocation.
 
 Typically we do this by checking the number of free pages in a zone 
 compared to the high low limits. See mmzone.h.

This doesn't work under high load because of direct reclaim. And if I go
run direct reclaim to test if I can raise the free pages level to an
acceptable level for the given gfp flags, I might as well do the whole
allocation.

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


Re: [RFC][PATCH 5/6] slab: kmem_cache_objs_to_pages()

2006-12-01 Thread Peter Zijlstra
On Thu, 2006-11-30 at 10:55 -0800, Christoph Lameter wrote:
 On Thu, 30 Nov 2006, Peter Zijlstra wrote:
 
  +unsigned int kmem_cache_objs_to_pages(struct kmem_cache *cachep, int nr)
  +{
  +   return ((nr + cachep-num - 1) / cachep-num)  cachep-gfporder;
 
 cachep-num refers to the number of objects in a slab of gfporder.
 
 thus
 
 return (nr + cachep-num - 1) / cachep-num;

No, that would give the number of slabs needed, I want pages.

-
To unsubscribe from this list: send 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: [G[PATCH 1/2][ENETLINK] max cmd boundary chec

2006-12-01 Thread Thomas Graf
* jamal [EMAIL PROTECTED] 2006-12-01 06:30
 hopefully no mime crap
 cheers,
 jamal

 [GENETLINK] max cmd boundary check
 
 We need to boundary check for commands being registered.
 
 Signed-off-by: Jamal Hadi Salim[EMAIL PROTECTED]

I can't see why this should be required. genl_register_ops()
enforces a unique command id and genl_ops-cmd is u8 so
there is no way to register more than 256 commands anyway.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2][GENETLINK] add cmd dump completion

2006-12-01 Thread Thomas Graf
* jamal [EMAIL PROTECTED] 2006-12-01 06:33
 Sorry, subject was a little messed in the previous one, but should
 be fine going forward ..
 
 cheers,
 jamal
 

 [GENETLINK] add cmd dump completion
 
 Remove assumption that generic netlink commands cannot have dump
 completion callbacks.

This looks good.
-
To unsubscribe from this list: send 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] NetXen: 1G/10G Ethernet Driver updates

2006-12-01 Thread Amit S. Kale
Hi,

Thanks Ueimor, Stephen, and Jeff!
We have incorporated all your feedbacks, and rebased wrt 
5e3f6b98b639c611c45751081c59ae9a04081964.
I will be sending patchset shortly.

--Amit
-
To unsubscribe from this list: send 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] NetXen: driver cleanup, removed unnecessary __iomem type casts

2006-12-01 Thread Amit S. Kale
Signed-off-by: Amit S. Kale [EMAIL PROTECTED]

 netxen_nic.h |   38 --
 netxen_nic_ethtool.c |5 ++---
 netxen_nic_hw.c  |   12 +---
 netxen_nic_main.c|8 +++-
 4 files changed, 18 insertions(+), 45 deletions(-)


diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 1bee560..d925053 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -343,7 +343,6 @@ typedef enum {
NETXEN_BRDTYPE_P2_SB31_10G_HMEZ = 0x000e,
NETXEN_BRDTYPE_P2_SB31_10G_CX4 = 0x000f
 } netxen_brdtype_t;
-#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t))
 
 typedef enum {
NETXEN_BRDMFG_INVENTEC = 1
@@ -937,9 +936,7 @@ static inline void netxen_nic_disable_in
/*
 * ISR_INT_MASK: Can be read from window 0 or 1.
 */
-   writel(0x7ff,
-  (void __iomem
-   *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
+   writel(0x7ff, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
 
 }
 
@@ -959,14 +956,12 @@ static inline void netxen_nic_enable_int
break;
}
 
-   writel(mask,
-  (void __iomem
-   *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
+   writel(mask, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
 
if (!(adapter-flags  NETXEN_NIC_MSI_ENABLED)) {
mask = 0xbff;
-   writel(mask, (void __iomem *)
-  (PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_MASK)));
+   writel(mask, PCI_OFFSET_SECOND_RANGE(adapter,
+ISR_INT_TARGET_MASK));
}
 }
 
@@ -975,13 +970,13 @@ static inline void netxen_nic_enable_int
  */
 
 #define NETXEN_MAX_SHORT_NAME 16
-typedef struct {
+struct netxen_brdinfo {
netxen_brdtype_t brdtype;   /* type of board */
long ports; /* max no of physical ports */
char short_name[NETXEN_MAX_SHORT_NAME];
-} netxen_brdinfo_t;
+};
 
-static const netxen_brdinfo_t netxen_boards[] = {
+static const struct netxen_brdinfo netxen_boards[] = {
{NETXEN_BRDTYPE_P2_SB31_10G_CX4, 1, XGb CX4},
{NETXEN_BRDTYPE_P2_SB31_10G_HMEZ, 1, XGb HMEZ},
{NETXEN_BRDTYPE_P2_SB31_10G_IMEZ, 2, XGb IMEZ},
@@ -990,24 +985,7 @@ static const netxen_brdinfo_t netxen_boa
{NETXEN_BRDTYPE_P2_SB31_2G, 2, Dual Gb},
 };
 
-#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t))
-
-static inline void get_brd_ports_name_by_type(u32 type, int *ports, char *name)
-{
-   int i, found = 0;
-   for (i = 0; i  NUM_SUPPORTED_BOARDS; ++i) {
-   if (netxen_boards[i].brdtype == type) {
-   *ports = netxen_boards[i].ports;
-   strcpy(name, netxen_boards[i].short_name);
-   found = 1;
-   break;
-   }
-   }
-   if (!found) {
-   *ports = 0;
-   name = Unknown;
-   }
-}
+#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(struct 
netxen_brdinfo))
 
 static inline void get_brd_port_by_type(u32 type, int *ports)
 {
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c 
b/drivers/net/netxen/netxen_nic_ethtool.c
index f3fc35c..9a914ae 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -139,8 +139,7 @@ netxen_nic_get_settings(struct net_devic
 {
struct netxen_port *port = netdev_priv(dev);
struct netxen_adapter *adapter = port-adapter;
-   struct netxen_board_info *boardinfo;
-   boardinfo = adapter-ahw.boardcfg;
+   struct netxen_board_info *boardinfo = adapter-ahw.boardcfg;
 
/* read which mode */
if (adapter-ahw.board_type == NETXEN_NIC_GBE) {
@@ -208,7 +207,7 @@ netxen_nic_get_settings(struct net_devic
ecmd-autoneg = AUTONEG_DISABLE;
break;
default:
-   printk(ERROR: Unsupported board model %d\n,
+   printk(KERN_ERR netxen-nic: Unsupported board model %d\n,
   (netxen_brdtype_t) boardinfo-board_type);
return -EIO;
 
diff --git a/drivers/net/netxen/netxen_nic_hw.c 
b/drivers/net/netxen/netxen_nic_hw.c
index 99e647a..105c24f 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -275,10 +275,8 @@ int netxen_nic_hw_resources(struct netxe
rcv_desc-desc_head = (struct rcv_desc *)addr;
}
 
-   addr = netxen_alloc(adapter-ahw.pdev,
-   STATUS_DESC_RINGSIZE,
-   recv_ctx-
-   rcv_status_desc_phys_addr,
+   addr = netxen_alloc(adapter-ahw.pdev, STATUS_DESC_RINGSIZE,
+   recv_ctx-rcv_status_desc_phys_addr,
   

[PATCH 2/3] NetXen: 64-bit memory fixes

2006-12-01 Thread Amit S. Kale
NetXen: 1G/10G Ethernet driver updates
- These fixes take care of driver on machines with 4G memory
- Driver cleanup

Signed-off-by: Amit S. Kale [EMAIL PROTECTED]

 netxen_nic.h  |   29 +--
 netxen_nic_ethtool.c  |   19 ++--
 netxen_nic_hw.c   |4 
 netxen_nic_hw.h   |4 
 netxen_nic_init.c |   51 +++-
 netxen_nic_isr.c  |3 
 netxen_nic_main.c |  204 +++---
 netxen_nic_phan_reg.h |   10 +-
 8 files changed, 286 insertions(+), 38 deletions(-)


diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index d925053..029e6c7 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -6,12 +6,12 @@
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
- *
+ *
  * This program is distributed in the hope that 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., 59 Temple Place - Suite 330, Boston,
@@ -89,8 +89,8 @@
  * normalize a 64MB crb address to 32MB PCI window 
  * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1
  */
-#define NETXEN_CRB_NORMAL(reg)\
-   (reg) - NETXEN_CRB_PCIX_HOST2 + NETXEN_CRB_PCIX_HOST
+#define NETXEN_CRB_NORMAL(reg) \
+   ((reg) - NETXEN_CRB_PCIX_HOST2 + NETXEN_CRB_PCIX_HOST)
 
 #define NETXEN_CRB_NORMALIZE(adapter, reg) \
pci_base_offset(adapter, NETXEN_CRB_NORMAL(reg))
@@ -164,7 +164,7 @@ enum {
 
 #define MAX_CMD_DESCRIPTORS1024
 #define MAX_RCV_DESCRIPTORS32768
-#define MAX_JUMBO_RCV_DESCRIPTORS  1024
+#define MAX_JUMBO_RCV_DESCRIPTORS  4096
 #define MAX_RCVSTATUS_DESCRIPTORS  MAX_RCV_DESCRIPTORS
 #define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS
 #define MAX_RCV_DESC   MAX_RCV_DESCRIPTORS
@@ -591,6 +591,16 @@ struct netxen_skb_frag {
u32 length;
 };
 
+/* Bounce buffer index */
+struct bounce_index {
+   /* Index of a buffer */
+   unsigned buffer_index;
+   /* Offset inside the buffer */
+   unsigned buffer_offset;
+};
+
+#define IS_BOUNCE 0xcafebb
+
 /*Following defines are for the state of the buffers*/
 #defineNETXEN_BUFFER_FREE  0
 #defineNETXEN_BUFFER_BUSY  1
@@ -610,6 +620,8 @@ struct netxen_cmd_buffer {
unsigned long time_stamp;
u32 state;
u32 no_of_descriptors;
+   u32 tx_bounce_buff;
+   struct bounce_index bnext;
 };
 
 /* In rx_buffer, we do not need multiple fragments as is a single buffer */
@@ -618,6 +630,9 @@ struct netxen_rx_buffer {
u64 dma;
u16 ref_handle;
u16 state;
+   u32 rx_bounce_buff;
+   struct bounce_index bnext;
+   char *bounce_ptr;
 };
 
 /* Board types */
@@ -702,6 +717,7 @@ struct netxen_recv_context {
 };
 
 #define NETXEN_NIC_MSI_ENABLED 0x02
+#define NETXEN_DMA_MASK0xfffe
 
 struct netxen_drvops;
 
@@ -1018,6 +1034,9 @@ static inline void get_brd_name_by_type(
 
 int netxen_is_flash_supported(struct netxen_adapter *adapter);
 int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]);
+int netxen_get_next_bounce_buffer(struct bounce_index *head,
+ struct bounce_index *tail,
+ struct bounce_index *biret, unsigned len);
 
 extern void netxen_change_ringparam(struct netxen_adapter *adapter);
 extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr,
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c 
b/drivers/net/netxen/netxen_nic_ethtool.c
index 9a914ae..8d8e5e1 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -6,12 +6,12 @@
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
- *
+ *
  * This program is distributed in the hope that 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., 59 Temple Place - Suite 330, Boston,
@@ -118,7 +118,7 @@ netxen_nic_get_drvinfo(struct net_device
u32 fw_minor = 0;
u32 fw_build 

Re: [G[PATCH 1/2][ENETLINK] max cmd boundary chec

2006-12-01 Thread jamal
Shall i assume that the patch showed up fine i.e no crap like mime?
I still didnt get an echo back, did it make the list?

On Fri, 2006-01-12 at 13:49 +0100, Thomas Graf wrote:

 I can't see why this should be required. genl_register_ops()
 enforces a unique command id 
 and genl_ops-cmd is u8 so there is no way to register more than 
 256 commands anyway.

By mistake during the tutorial, i had the id at something like 321.
It registered fine but then listing the command showed it with a
different id than what i thought it should be. I think it chops off
all the bystes other than the LS one - which is not a good error
check.
The compiler will whine actually. If you ignore it (perhaps not seeing
the warning in a mass compile) it registers just fine.

cheers,
jamal

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


RFC: XFRM changing the view of xfrm_aevent_id

2006-12-01 Thread jamal
while trying to patch iproute2 to display the xfrm aevents i came to the
conclusion that the xfrm_aevent_id struct didnt provide enough info
for me to uniquely identify an SA.
I need two other items: the reqid and saddr.

The structure currently looks like

struct xfrm_aevent_id {
struct xfrm_usersa_id   sa_id;
__u32   flags;
};

I could add the two items mentioned above in it and break the ABI.
This may sound dangerous, but the usage of this ABI is not widespread.
AFAIK, the only other person who might have used this is Kristzian (on
CC).

If this is considered evil, then i will transfer the two items in
a new TLV but it wont be as pretty.

Thoughts?

cheers,
jamal

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


Re: [G[PATCH 1/2][ENETLINK] max cmd boundary chec

2006-12-01 Thread Thomas Graf
* jamal [EMAIL PROTECTED] 2006-12-01 09:30
 Shall i assume that the patch showed up fine i.e no crap like mime?
 I still didnt get an echo back, did it make the list?
 
 On Fri, 2006-01-12 at 13:49 +0100, Thomas Graf wrote:
 
  I can't see why this should be required. genl_register_ops()
  enforces a unique command id 
  and genl_ops-cmd is u8 so there is no way to register more than 
  256 commands anyway.
 
 By mistake during the tutorial, i had the id at something like 321.
 It registered fine but then listing the command showed it with a
 different id than what i thought it should be. I think it chops off
 all the bystes other than the LS one - which is not a good error
 check.
 The compiler will whine actually. If you ignore it (perhaps not seeing
 the warning in a mass compile) it registers just fine.

There is no way to fix this in the interface. If you do u8 op = 312
and ignore the compiler warning which states that the value has been
truncated it can't be helped, the interface will see op = 56 and
register it normally. It is logically impossible to have more than 256
entries on the cmd list, the boundry check you're adding is completely
useless.
-
To unsubscribe from this list: send 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: XFRM changing the view of xfrm_aevent_id

2006-12-01 Thread KOVACS Krisztian

  Hi,

On Friday 01 December 2006 15:37, jamal wrote:
 struct xfrm_aevent_id {
 struct xfrm_usersa_id   sa_id;
 __u32   flags;
 };

 I could add the two items mentioned above in it and break the ABI.
 This may sound dangerous, but the usage of this ABI is not widespread.
 AFAIK, the only other person who might have used this is Kristzian (on
 CC).

  I do not use the XFRM netlink interface at the moment, so breaking the 
ABI is absolutely not a problem for me.

--
 Regards,
  Krisztian Kovacs
-
To unsubscribe from this list: send 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: [G[PATCH 1/2][ENETLINK] max cmd boundary chec

2006-12-01 Thread jamal
On Fri, 2006-01-12 at 15:40 +0100, Thomas Graf wrote:

 There is no way to fix this in the interface. If you do u8 op = 312
 and ignore the compiler warning which states that the value has been
 truncated it can't be helped, the interface will see op = 56 

Indeed I think this is what i saw. 
312 == 0x138
This will be chopped to 0x38 == decimal 56

 and register it normally. 
 It is logically impossible to have more than 256
 entries on the cmd list, 
 the boundry check you're adding is completely
 useless.

You cannot have more than 256 commands because 0x138 and 0x38 are
treated as the same command. So does 0x238, 0x1138...
It is useless/unneeded if the register ops will always see the chopped
value. Is this so?

cheers,
jamal

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


Re: [G[PATCH 1/2][ENETLINK] max cmd boundary chec

2006-12-01 Thread Thomas Graf
* jamal [EMAIL PROTECTED] 2006-12-01 09:52
 You cannot have more than 256 commands because 0x138 and 0x38 are
 treated as the same command. So does 0x238, 0x1138...
 It is useless/unneeded if the register ops will always see the chopped
 value. Is this so?

The interface enforces a proper value by the type it accepts which
is certainly more desireable than a runtime error. If you happen
to ignore compiler warnings, then maybe there is the problem. Despite
of all this, the patch you propose doesn't work anyway.

If you really want a runtime error you have to change the cmd field
in genl_ops to be of larger size and then just check  MAX_ARGS in
register_ops() rather than making get_cmd() more expensive which
is called for every message received. I don't see any reason why
this should be better than a compile warning.
-
To unsubscribe from this list: send 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] [IPVS] transparent proxying

2006-12-01 Thread Wensong Zhang


Hi Jinhua,

home_king wrote:

hi, Wensong. Thanks for your appraise.

 I see that this patch probably makes IPVS code a bit complicated and
 packet traversing less efficiently.

In my opinion, worry about the side-effect to the packet throughput is 
not
necessary. First, normal packets with mark rarely appear in the 
NF_IP_FORWARD

chain, while people mark packets aiming at the network administration job
usually on the NF_IP_LOCAL_IN or NF_IP_OUTPUT chain. Second, the new 
hook fn
is called after ipvs SNAT hook fn, and pass the packets handled by the 
latter
hook fn by simply checking the ipvs_property flag, so it would not 
disturb the
SNAT job. Third, the new hook fn is just a thin wrapper of ip_vs_in(), 
so now
that all packets which go through NF_IP_LOCAL_IN will be entirely 
checked up
by ip_vs_in(), no matter they are virtual-server relative or not, why 
we mind
that a comparatively small quantity of packets which go through 
NF_IP_FORWARD

will be checked too?

I see that every firewall-marked packet will be checked by ip_vs_in(), 
no matter whether

the packet is related to IPVS or not. It's a bit less efficient.

 If I remember correctly, policy-based routing can work with IPVS in
 kernel 2.2 and 2.4 for transparent cache cluster for a long time. It
 should work in kernel 2.6 too.

Indeed, policy route can help too, but the patch provides a native 
manner to

deploy transparent proxy, and meanwhile, this manner will not break the
backbone networking context, such as policy routing setting, iptables 
rules,

etc.
I am afraid that the method used in the patch is not native, it breaks 
on IP fragments.
IPVS is a kind of layer-4 switching, it routes packet by checking 
layer-4 information

such as address and port number. ip_vs_in() is hooked at NF_IP_LOCAL_IN, so
that all the packets received by ip_vs_in() are already defragmented. On 
NF_IP_FORWARD
hook, there may be some IP fragements, ip_vs_in() cannot handle those IP 
fragments.


I think that it's probably better to let each part do its own things in 
the design.


Cheers,

Wensong

-
To unsubscribe from this list: send 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: [G[PATCH 1/2][ENETLINK] max cmd boundary chec

2006-12-01 Thread jamal
On Fri, 2006-01-12 at 16:16 +0100, Thomas Graf wrote:

 The interface enforces a proper value by the type it accepts which
 is certainly more desireable than a runtime error. 
 If you happen
 to ignore compiler warnings, then maybe there is the problem. 

It is easy to overlook compiler warnings. However, it is not an
excuse. 

 Despite
 of all this, the patch you propose doesn't work anyway.
 
 If you really want a runtime error you have to change the cmd field
 in genl_ops to be of larger size and then just check  MAX_ARGS in
 register_ops() rather than making get_cmd() more expensive which
 is called for every message received. I don't see any reason why
 this should be better than a compile warning.


Ok, you make a good arguement. Lets just junk this patch. 

cheers,
jamal

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


pci_set_power_state(): 0000:00:0a.0: state=3, current state=5

2006-12-01 Thread Marco Berizzi
Hi everybody,

I'm running linux 2.6.19 (on a pretty old system),
and everytime I run 'mii-tool' I get a ton of:

pci_set_power_state(): :00:0a.0: state=3, current state=5

Here is dmesg:

PCI: setting IRQ 10 as level-triggered
PCI: Found IRQ 10 for device :00:0a.0
:00:0a.0: 3Com PCI 3c905 Boomerang 100baseTx at 0001dc00.
PCI: Found IRQ 11 for device :00:0b.0
PCI: Sharing IRQ 11 with :00:07.2
:00:0b.0: 3Com PCI 3c905 Boomerang 100baseTx at 0001da00.
ip_conntrack_pptp version 3.1 loaded
ip_nat_pptp version 3.0 loaded
eth0:  setting full-duplex.
eth1:  setting full-duplex.
eth2:  setting full-duplex.
[EMAIL PROTECTED]:/var/log# mii-tool
eth0: negotiated 100baseTx-FD, link ok
eth1: negotiated 100baseTx-FD, link ok
eth2: negotiated 100baseTx-FD, link ok
[EMAIL PROTECTED]:/var/log# dmesg
Linux version 2.6.19 ([EMAIL PROTECTED]) (gcc version 3.2.3) #1
Thu Nov 30 16:41:00 CET 2006
BIOS-provided physical RAM map:
  BIOS-e820:  - 0009fc00 (usable)
  BIOS-e820: 0009fc00 - 000a (reserved)
  BIOS-e820: 000f - 0010 (reserved)
  BIOS-e820: 0010 - 1000 (usable)
  BIOS-e820:  - 0001 (reserved)
256MB LOWMEM available.
Entering add_active_range(0, 0, 65536) 0 entries of 256 used
Zone PFN ranges:
   DMA 0 - 4096
   Normal   4096 -65536
early_node_map[1] active PFN ranges
 0:0 -65536
On node 0 totalpages: 65536
   DMA zone: 32 pages used for memmap
   DMA zone: 0 pages reserved
   DMA zone: 4064 pages, LIFO batch:0
   Normal zone: 480 pages used for memmap
   Normal zone: 60960 pages, LIFO batch:15
DMI 2.1 present.
ACPI: Unable to locate RSDP
Allocating PCI resources starting at 2000 (gap:
1000:efff)
Detected 267.288 MHz processor.
Built 1 zonelists.  Total pages: 65024
Kernel command line: auto BOOT_IMAGE=Linux ro root=301
Local APIC disabled by BIOS -- you can enable it with lapic
mapped APIC to d000 (01201000)
Enabling fast FPU save and restore... done.
Initializing CPU#0
PID hash table entries: 1024 (order: 10, 4096 bytes)
Console: colour VGA+ 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256584k/262144k available (1946k kernel code, 5132k
reserved, 578k data, 160k init, 0k highmem)
virtual kernel memory layout:
 fixmap  : 0xfffb7000 - 0xf000   ( 288 kB)
 vmalloc : 0xd080 - 0xfffb5000   ( 759 MB)
 lowmem  : 0xc000 - 0xd000   ( 256 MB)
   .init : 0xc037a000 - 0xc03a2000   ( 160 kB)
   .data : 0xc02e6b89 - 0xc0377494   ( 578 kB)
   .text : 0xc010 - 0xc02e6b89   (1946 kB)
Checking if this processor honours the WP bit even in
supervisor mode... Ok.
Calibrating delay using timer specific routine.. 535.18
BogoMIPS (lpj=1070378)
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 0183f9ff 
    
CPU: L1 I cache: 16K, L1 D cache: 16K
CPU: After all inits, caps: 0183f9ff  
0040   
Compat vDSO mapped to e000.
CPU: Intel Celeron (Covington) stepping 00
Checking 'hlt' instruction... OK.
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xfda61, last bus=1
PCI: Using configuration type 1
Setting up standard PCI resources
ACPI: Interpreter disabled.
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
* Found PM-Timer Bug on the chipset. Due to workarounds for
a bug,
* this clock source is slow. Consider trying other clock sources
PCI quirk: region 6100-613f claimed by PIIX4 ACPI
PCI quirk: region 5f00-5f0f claimed by PIIX4 SMB
Boot video device is :01:00.0
PCI: Using IRQ router PIIX/ICH [8086/7110] at :00:07.0
PCI: setting IRQ 11 as level-triggered
PCI: Found IRQ 11 for device :00:07.2
PCI: Sharing IRQ 11 with :00:0b.0
PCI: Bridge: :00:01.0
   IO window: b000-bfff
   MEM window: efe0-efef
   PREFETCH window: e5c0-e7cf
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 8192 bind 4096)
TCP reno registered
SGI XFS with no debug enabled
io scheduler noop registered
io scheduler deadline registered (default)
Limiting direct PCI/PCI transfers.
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override
with idebus=xx
PIIX4: IDE controller at PCI slot :00:07.1
PIIX4: chipset revision 1
PIIX4: not 100% native mode: will probe irqs later
 ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA,
hdb:pio
 ide1: BM-DMA at 0xffa8-0xffaf, BIOS settings: hdc:pio,
hdd:pio
Probing IDE interface ide0...
hda: QUANTUM FIREBALL EX3.2A, ATA DISK drive
ide0 at 

Re: [PATCH 1/3] NetXen: driver cleanup, removed unnecessary __iomem type casts

2006-12-01 Thread Stephen Hemminger

Amit S. Kale wrote:



+#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(struct 
netxen_brdinfo
  

You could use ARRAYSIZE(netxen_boards) for this you know.
-
To unsubscribe from this list: send 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: pktgen

2006-12-01 Thread Robert Olsson

Alexey Dobriyan writes:

  
  Confused now. Is my t-control = ~(T_TERMINATE); fix deprecated by
  completions?
 
 It's not needed with completion patch as this does the job a bit more
 mainstream. The T_TERMINATE seems to work well I've tested on machine
 with CPU:s. Only once I noticed that only 2 of 4 threads got started 
 but it could be something else...

 And the race is hardly seen with any real use of pktgen.. .Let's hear
 what others... and completions was out-of-date.

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


[PATCH 2.6.20] PHY: Add support for configuring the PHY connection interface

2006-12-01 Thread Andy Fleming
Most PHYs connect to an ethernet controller over a GMII or MII
interface.  However, a growing number are connected over
different interfaces, such as RGMII or SGMII.

The ethernet driver will tell the PHY what type of connection it
is by setting it manually, or passing it in through phy_connect
(or phy_attach).

Changes include:
* Updates to documentation
* Updates to PHY Lib consumers
* Changes to PHY Lib to add interface support
* Some minor changes to whitespace in phy.h
* gianfar driver now detects interface and passes appropriate
  value to PHY Lib
Signed-off-by: Andrew Fleming [EMAIL PROTECTED]
---
This version of the patch changes interface to be a typed enum, and 
switches gianfar to discover the interface, rather than having it passed 
in from the platform code.

 Documentation/networking/phy.txt   |   13 
 drivers/net/au1000_eth.c   |3 ++-
 drivers/net/fs_enet/fs_enet-main.c |3 ++-
 drivers/net/gianfar.c  |   39 ++--
 drivers/net/gianfar.h  |3 +++
 drivers/net/phy/phy_device.c   |   29 ++-
 include/linux/phy.h|   26 ++--
 7 files changed, 93 insertions(+), 23 deletions(-)

diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt
index 29ccae4..0bc95ea 100644
--- a/Documentation/networking/phy.txt
+++ b/Documentation/networking/phy.txt
@@ -1,7 +1,7 @@
 
 ---
 PHY Abstraction Layer
-(Updated 2005-07-21)
+(Updated 2006-11-30)
 
 Purpose
 
@@ -97,11 +97,12 @@ Letting the PHY Abstraction Layer do Eve
  
  Next, you need to know the device name of the PHY connected to this device. 
  The name will look something like, phy0:0, where the first number is the
- bus id, and the second is the PHY's address on that bus.
+ bus id, and the second is the PHY's address on that bus.  Typically,
+ the bus is responsible for making its ID unique.
  
  Now, to connect, just call this function:
  
-   phydev = phy_connect(dev, phy_name, adjust_link, flags);
+   phydev = phy_connect(dev, phy_name, adjust_link, flags, interface);
 
  phydev is a pointer to the phy_device structure which represents the PHY.  If
  phy_connect is successful, it will return the pointer.  dev, here, is the
@@ -115,6 +116,10 @@ Letting the PHY Abstraction Layer do Eve
  This is useful if the system has put hardware restrictions on
  the PHY/controller, of which the PHY needs to be aware.
 
+ interface is a u32 which specifies the connection type used
+ between the controller and the PHY.  Examples are GMII, MII,
+ RGMII, and SGMII.  For a full list, see include/linux/phy.h
+
  Now just make sure that phydev-supported and phydev-advertising have any
  values pruned from them which don't make sense for your controller (a 10/100
  controller may be connected to a gigabit capable PHY, so you would need to
@@ -191,7 +196,7 @@ Doing it all yourself
start, or disables then frees them for stop.
 
  struct phy_device * phy_attach(struct net_device *dev, const char *phy_id,
-u32 flags);
+u32 flags, phy_interface_t interface);
 
Attaches a network device to a particular PHY, binding the PHY to a generic
driver if none was found during bus initialization.  Passes in
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 7db3c8a..f0b6879 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -360,7 +360,8 @@ #endif /* defined(AU1XXX_PHY_STATIC_CONF
BUG_ON(!phydev);
BUG_ON(phydev-attached_dev);
 
-   phydev = phy_connect(dev, phydev-dev.bus_id, au1000_adjust_link, 0);
+   phydev = phy_connect(dev, phydev-dev.bus_id, au1000_adjust_link, 0,
+   PHY_INTERFACE_MODE_MII);
 
if (IS_ERR(phydev)) {
printk(KERN_ERR %s: Could not attach to PHY\n, dev-name);
diff --git a/drivers/net/fs_enet/fs_enet-main.c 
b/drivers/net/fs_enet/fs_enet-main.c
index cb39587..889d3a1 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -779,7 +779,8 @@ static int fs_init_phy(struct net_device
fep-oldspeed = 0;
fep-oldduplex = -1;
if(fep-fpi-bus_id)
-   phydev = phy_connect(dev, fep-fpi-bus_id, fs_adjust_link, 0);
+   phydev = phy_connect(dev, fep-fpi-bus_id, fs_adjust_link, 0,
+   PHY_INTERFACE_MODE_MII);
else {
printk(No phy bus ID specified in BSP code\n);
return -EINVAL;
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index a06d8d1..4fb9d96 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -9,7 +9,7 @@
  * Author: Andy Fleming
  * Maintainer: Kumar Gala
  *
- * Copyright (c) 2002-2004 Freescale Semiconductor, Inc.
+ * Copyright (c) 2002-2006 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU 

Re: [Madwifi-devel] ar5k and Atheros AR5005G

2006-12-01 Thread Luis R. Rodriguez

On 11/29/06, Stephen Hemminger [EMAIL PROTECTED] wrote:

On Wed, 29 Nov 2006 08:03:28 -0800
David Kimdon [EMAIL PROTECTED] wrote:

 On Wed, Nov 29, 2006 at 04:38:56PM +0100, Michael Buesch wrote:
  On Wednesday 29 November 2006 16:24, David Kimdon wrote:
   On Wed, Nov 29, 2006 at 04:12:33PM +0100, Michael Buesch wrote:
On Wednesday 29 November 2006 15:34, Nick Kossifidis wrote:
   Why do you say that?
  
   There is absolutely no reason why dadwifi can't be merged into the
   mainline once the hal issue is resolved.
 
  Last time we talked about that stuff, it was decided that
  we don't want a HAL... See archives.

 To be clear, that is all part of the hal issue that needs to be
 resolved.  Removing the hal abstraction is not difficult for an
 interested party once source for the hal is available.  The next step
 in such an effort would be to add an open hal to dadwifi, IMO.


Isn't it obvious. Planning from goal through intermediate steps gives:

0 - today (raw materials)
* softmac stack: d80211
* open hal: ar5k
* glue layer: dadwifi

1- put pieces together
* d80211 + dadwifi + ar5k


The problem actually is that ar5k port to Linux Nick wrote currently
only works with an older version of madwifi (svn 1142) which itself
needs some patching and that dadwifi is based on the latest and
greatest madwifi source base. So a d80211 + dadwifi + ar5k will only
work if Nick's ar5k port is extended to support the latest
madwifi/dadwifi. I haven't had time yet to determine the exact
requirements on Nick's ported openhal to work with dadwifi but that
should be our focus for now in parallel with completing dadwifi.

For those curious the attached patch fixes madwifi 1142 release for
use with kernels = 2.6.18-rc1. Add Nick's ar5k port to linux and
you'll have a Free driver ready. Since I see the mb's openhal git
repos is down here is a link for it as I checked it out on 2006-08-03:

http://www.kernel.org/pub/linux/kernel/people/mcgrof/openhal-2006-08-03.tar.gz

(give it sometime to sync)

To make things easier for development I'd like to suggest a few madwif
ibranches created:

* madwifi-1152-openhal: based on madwifi-1152, patched with my patch,
added openhal, old hal removed. Working free solution. Should exist
just as a reference and to allow users to checkout a working free
alternative in the mean time.

* madwifi-dadwifi-openal: based on the latest dadwifi with the
openhal, old hal removed. As dadwifi gets updated you can pull updates
to this branch. As the openhal advances you can make updates to the
openhal here.

Once we get dadwifi+openhal branch working I believe it should become
the trunk of madwifi.

Lastly, if anyone needs access to atheros hardware for development of
this driver or the openhal please let me know and you will get access
to a lot of nodes for development.

 Luis
diff -Naurp madwifi-openhal/ath/if_ath.c madwifi-openhal-fixed/ath/if_ath.c
--- madwifi-openhal/ath/if_ath.c	2005-06-24 06:41:22.0 -0400
+++ madwifi-openhal-fixed/ath/if_ath.c	2006-08-04 14:49:38.0 -0400
@@ -245,13 +245,20 @@ enum {
 #endif
 
 static	int countrycode = -1;
-MODULE_PARM(countrycode, i);
-MODULE_PARM_DESC(countrycode, Override default country code);
 static	int outdoor = -1;
-MODULE_PARM(outdoor, i);
-MODULE_PARM_DESC(outdoor, Enable/disable outdoor use);
 static	int xchanmode = -1;
+#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,5,52))
+MODULE_PARM(countrycode, i);
+MODULE_PARM(outdoor, i);
 MODULE_PARM(xchanmode, i);
+#else
+#include linux/moduleparam.h
+module_param(countrycode, int, 0);
+module_param(outdoor, int, 0);
+module_param(xchanmode, int, 0);
+#endif
+MODULE_PARM_DESC(countrycode, Override default country code);
+MODULE_PARM_DESC(outdoor, Enable/disable outdoor use);
 MODULE_PARM_DESC(xchanmode, Enable/disable extended channel mode);
 
 int
diff -Naurp madwifi-openhal/openhal/ar5xxx.h madwifi-openhal-fixed/openhal/ar5xxx.h
--- madwifi-openhal/openhal/ar5xxx.h	2006-08-03 15:24:30.0 -0400
+++ madwifi-openhal-fixed/openhal/ar5xxx.h	2006-08-04 14:42:37.0 -0400
@@ -1425,7 +1425,7 @@ struct ar5k_srev_name {
 	{ 5111,	AR5K_VERSION_RAD,	AR5K_SREV_RAD_5111 },	\
 	{ 2111,	AR5K_VERSION_RAD,	AR5K_SREV_RAD_2111 },	\
 	{ 5112,	AR5K_VERSION_RAD,	AR5K_SREV_RAD_5112 },	\
-	{ 5112a,	AR5K_VERSION_RAD,	AR5K_SREV_RAD_5112A },	\ 
+	{ 5112a,	AR5K_VERSION_RAD,	AR5K_SREV_RAD_5112A },	\
 	{ 2112,	AR5K_VERSION_RAD,	AR5K_SREV_RAD_2112 },	\
 	{ 2112a,	AR5K_VERSION_RAD,	AR5K_SREV_RAD_2112A },	\
 	{ ,	AR5K_VERSION_RAD,	AR5K_SREV_UNKNOWN }	\


Re: [Madwifi-devel] ar5k and Atheros AR5005G

2006-12-01 Thread Luis R. Rodriguez

On 12/1/06, Luis R. Rodriguez [EMAIL PROTECTED] wrote:


* madwifi-1152-openhal: based on madwifi-1152, patched with my patch,
added openhal, old hal removed. Working free solution. Should exist
just as a reference and to allow users to checkout a working free
alternative in the mean time.


typo meant 1142
-
To unsubscribe from this list: send 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/3] NetXen: 64-bit memory fixes

2006-12-01 Thread Stephen Hemminger
Please don't mix whitespace and other fixes at same time.
Add a cleanup patch at beginning or end of series.

Please don't add other things like the driver name this in with bounce buffer
patch. Why the name change from netxen to netxen_nic?


 +/* Bounce buffer index */
 +struct bounce_index {
 + /* Index of a buffer */
 + unsigned buffer_index;
 + /* Offset inside the buffer */
 + unsigned buffer_offset;
 +};
 +
 +#define IS_BOUNCE 0xcafebb

Magic number? is this safe? why? there is a Documentation
file for these magic-number.txt.

 diff --git a/drivers/net/netxen/netxen_nic_isr.c 
 b/drivers/net/netxen/netxen_nic_isr.c
 index ae180fe..f6ae9fd 100644
 --- a/drivers/net/netxen/netxen_nic_isr.c
 +++ b/drivers/net/netxen/netxen_nic_isr.c
 @@ -68,8 +68,7 @@ struct net_device_stats *netxen_nic_get_
  void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 portno,
u32 link)
  {
 - struct netxen_port *pport = adapter-port[portno];
 - struct net_device *netdev = pport-netdev;
 + struct net_device *netdev = (adapter-port[portno])-netdev;
  

Parens unnecessary here.

-- 
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: e100: inappropriate handling of shared interrupt ?

2006-12-01 Thread Shaw Vrana
Hi Auke,

On Mon, Nov 27, 2006 at 11:18:13AM -0800, Auke Kok wrote:
 I'm seeing some odd behavior using the e100 driver for an intel ethernet
 controller 82557/8/9 (revv 10).  It appears as if the e100 driver is
 handling interrupts generated by another device, though I am not certain
 of this..
 
 Using some printks, I see some odd packets received that are eventually
 dropped somewhere up the stack.  The packets usually look something like
 this:
 
 SrcAddr: 8.0.69.0 (bogus source ip)
 DstAddr: 0.40.226.169  (bogus dest ip)
 Protocol: 6
 InputInt: 2
 SrcPort: 20
 DstPort: 8793
 
 The src address and dest. address are entirely bogus, the protocol is not
 always TCP, but I've seen it be icmp or udp.  In addition, I see _nothing_
 using tcpdump, which I also do not understand as I didn't think packets
 were dropped before tcpdump.  I've seen this behavior on multiple machines
 using the same hardware, but haven't been able to make much sense of it. 
 These packets do not seem to affect the normal operation of the device,
 i.e. it services correct ips/ports just as one would expect.
 
 B/c I haven't been able to see the packets using tcpdump, I have been
 thinking that the packets were generated by the box itself.  The packets
 appear to be constantly arriving, though it does not appear as if a packet
 with the same src ip/dst ip arrives more than once, though I could be
 wrong about this.
 
 From dmesg I see that the e100 is sharing irq 12.
 
 e100: Intel(R) PRO/100 Network Driver, 3.4.8-k2-NAPI
 e100: Copyright(c) 1999-2005 Intel Corporation
 PCI: Found IRQ 12 for device :01:04.0
 PCI: Sharing IRQ 12 with :00:02.0
 PCI: Sharing IRQ 12 with :00:1d.0
 divert: allocating divert_blk for eth0
 e100: eth0: e100_probe: addr 0xe8083000, irq 12, MAC addr 00:0E:B6:26:95:05
 (This is the only other message I see mentioning irq 12)
 
 what does /proc/interrupts say after the box is fully booted?

   CPU0   
  0: 1236112960  XT-PIC  timer
  2:  0  XT-PIC  cascade
  4: 144338  XT-PIC  serial
  5:2109514  XT-PIC  primary
  8:  0  XT-PIC  rtc
  9:  0  XT-PIC  ehci_hcd
 10:   55010907  XT-PIC  lan0_0
 12:   57079668  XT-PIC  wan0_0
 14:   28456949  XT-PIC  ide0
NMI:  0 
ERR:  0


 Notice that 0 errors are reported..  How could this be?
 
 use ethtool -S eth1 to get more information on errors etc.
 
 It's unlikely that an irq problem shows up in the ifconfig error stats. 
 Those are completely different counters that don't interact.

NIC statistics:
 rx_packets: 25896640
 tx_packets: 33721440
 rx_bytes: 391691733
 tx_bytes: 2804738076
 rx_errors: 0
 tx_errors: 0
 rx_dropped: 0
 tx_dropped: 0
 multicast: 0
 collisions: 0
 rx_length_errors: 0
 rx_over_errors: 0
 rx_crc_errors: 0
 rx_frame_errors: 0
 rx_fifo_errors: 0
 rx_missed_errors: 0
 tx_aborted_errors: 0
 tx_carrier_errors: 0
 tx_fifo_errors: 0
 tx_heartbeat_errors: 0
 tx_window_errors: 0
 tx_deferred: 0
 tx_single_collisions: 0
 tx_multi_collisions: 0
 tx_flow_control_pause: 40967
 rx_flow_control_pause: 0
 rx_flow_control_unsupported: 0
 tx_tco_packets: 0
 rx_tco_packets: 0


Unfortunately I do not currently have a machine in the lab on which I can
reproduce this problem, so this data toook a little while to get.  I did
find a box with the same version of the NIC, but the weird packets did not
appear on there at all.  I have seen this problem personally, but that box
seems to have disappeared.

Is there any reason these packets would not be reported in the above
statistics?  And if an interrupt sharing error is out, where could these
packets be coming from?

 can you try with the latest e100 driver from e1000.sf.net ? I don't think 
 it solves it but it might help to try (doesn't hurt).

I'll fly the NIC home and test the new driver if worse comes to worse.. :(


Thanks for your input,
Shaw
-
To unsubscribe from this list: send 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] skge: don't clear MC state on link down

2006-12-01 Thread Stephen Hemminger
I would rather fix Andy's problem by not clearing
multicast information on link down.

Also, add code to restore multicast state after ethtool phy reset.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
---
 drivers/net/skge.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index b294903..010fc65 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2154,8 +2154,6 @@ static void yukon_link_down(struct skge_
int port = skge-port;
u16 ctrl;
 
-   gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);
-
ctrl = gma_read16(hw, port, GM_GP_CTRL);
ctrl = ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA);
gma_write16(hw, port, GM_GP_CTRL, ctrl);
@@ -2167,7 +2165,6 @@ static void yukon_link_down(struct skge_
gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, ctrl);
}
 
-   yukon_reset(hw, port);
skge_link_down(skge);
 
yukon_init(hw, port);
@@ -2268,6 +2265,8 @@ static void skge_phy_reset(struct skge_p
yukon_init(hw, port);
}
mutex_unlock(hw-phy_mutex);
+
+   dev-set_multicast_list(dev);
 }
 
 /* Basic MII support */
-- 
1.4.1

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


Multiple end-points behind same NAT

2006-12-01 Thread Venkat Yekkirala
Hi,

I am wondering if 26sec supports NAT-Traversal for multiple
endpoints behind the same NAT. In looking at xfrm_tmpl it's
not obvious to me that it's supported, at least going by the
following from the setkey man page:

 When NAT-T is enabled in the kernel, policy matching for ESP over
 UDP packets may be done on endpoint addresses and port (this
 depends on the system.  System that do not perform the port check
 cannot support multiple endpoints behind the same NAT).  When
 using ESP over UDP, you can specify port numbers in the endpoint
 addresses to get the correct matching.  Here is an example:

 spdadd 10.0.11.0/24[any] 10.0.11.33/32[any] any -P out ipsec
 esp/tunnel/192.168.0.1[4500]-192.168.1.2[3]/require ;

Or is this to be accomplished in a different way?

Thanks,

venkat
-
To unsubscribe from this list: send 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] skge: don't clear MC state on link down

2006-12-01 Thread Andy Gospodarek

On 12/1/06, Stephen Hemminger [EMAIL PROTECTED] wrote:

I would rather fix Andy's problem by not clearing
multicast information on link down.

Also, add code to restore multicast state after ethtool phy reset.



Stephen,

I'll ACK that change instead as long as we can be sure that this isn't
needed for hardware reasons.

-andy
-
To unsubscribe from this list: send 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] rt2400: fix breakage from API changes

2006-12-01 Thread John W. Linville
Here's my whack at fixing-up the rt2400pci driver to compile, since
the recent API changes broke it.  This only covers that one driver,
so lots more (albeit similar) work needs to be done to cover the
other rt2x00 family drivers.

Ivo and Johannes, please take a quick look to see if I'm obviously
missing something or handling something incorrectly.  I don't have
the hardware in questions, so this is completely untested. :-)

Signed-off-by: John W. Linville [EMAIL PROTECTED]
---

 drivers/net/wireless/d80211/rt2x00/rt2400pci.c |  308 -
 drivers/net/wireless/d80211/rt2x00/rt2400pci.h |   32 +-
 drivers/net/wireless/d80211/rt2x00/rt2x00.h|3 
 3 files changed, 125 insertions(+), 218 deletions(-)

diff --git a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 
b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
index d3efc11..dba5cf0 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
@@ -35,7 +35,6 @@ #include linux/skbuff.h
 #include linux/netdevice.h
 #include linux/etherdevice.h
 #include linux/wireless.h
-#include linux/ethtool.h
 
 #include net/iw_handler.h
 #include net/d80211.h
@@ -343,81 +342,6 @@ static void rt2x00_eeprom_multiread(cons
 }
 
 /*
- * Ethtool handlers.
- */
-static void rt2400pci_get_drvinfo(struct net_device *net_dev,
-   struct ethtool_drvinfo *drvinfo)
-{
-   struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
-
-   strcpy(drvinfo-driver, DRV_NAME);
-   strcpy(drvinfo-version, DRV_VERSION);
-   strcpy(drvinfo-fw_version, N/A);
-   strcpy(drvinfo-bus_info, pci_name(rt2x00dev_pci(rt2x00dev)));
-   drvinfo-eedump_len = EEPROM_SIZE;
-   drvinfo-regdump_len = CSR_REG_SIZE;
-}
-
-static int rt2400pci_get_regs_len(struct net_device *net_dev)
-{
-   return CSR_REG_SIZE;
-}
-
-static void rt2400pci_get_regs(struct net_device *net_dev,
-   struct ethtool_regs *regs, void *data)
-{
-   struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
-
-   rt2x00_register_multiread(rt2x00dev, CSR_REG_BASE, data, CSR_REG_SIZE);
-   regs-version = rt2x00_rev(rt2x00dev-chip);
-   regs-len = CSR_REG_SIZE;
-}
-
-#ifdef CONFIG_RT2400PCI_DEBUG
-static u32 rt2400pci_get_msglevel(struct net_device *net_dev)
-{
-   return rt2x00_debug_level;
-}
-
-static void rt2400pci_set_msglevel(struct net_device *net_dev, u32 msg)
-{
-   rt2x00_debug_level = !!msg;
-}
-#endif /* CONFIG_RT2400PCI_DEBUG */
-
-static int rt2400pci_get_eeprom_len(struct net_device *net_dev)
-{
-   return EEPROM_SIZE;
-}
-
-static int rt2400pci_get_eeprom(struct net_device *net_dev,
-   struct ethtool_eeprom *eeprom, u8 *data)
-{
-   struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
-
-   eeprom-magic = 0xbad;
-
-   rt2x00_eeprom_multiread(rt2x00dev,
-   eeprom-offset / sizeof(u16), (void*)data, eeprom-len);
-
-   return 0;
-}
-
-static struct ethtool_ops rt2400pci_ethtool_ops = {
-   .get_drvinfo= rt2400pci_get_drvinfo,
-   .get_regs_len   = rt2400pci_get_regs_len,
-   .get_regs   = rt2400pci_get_regs,
-#ifdef CONFIG_RT2400PCI_DEBUG
-   .get_msglevel   = rt2400pci_get_msglevel,
-   .set_msglevel   = rt2400pci_set_msglevel,
-#endif /* CONFIG_RT2400PCI_DEBUG */
-   .get_link   = ethtool_op_get_link,
-   .get_eeprom_len = rt2400pci_get_eeprom_len,
-   .get_eeprom = rt2400pci_get_eeprom,
-   .get_perm_addr  = ethtool_op_get_perm_addr,
-};
-
-/*
  * Configuration handlers.
  */
 static void rt2400pci_config_bssid(struct rt2x00_dev *rt2x00dev, u8 *bssid)
@@ -722,8 +646,7 @@ static void rt2400pci_config_duration(st
 
 static void rt2400pci_config_rate(struct rt2x00_dev *rt2x00dev, const int rate)
 {
-   struct ieee80211_conf *conf = ieee80211_get_hw_conf(
-   pci_get_drvdata(rt2x00dev_pci(rt2x00dev)));
+   struct ieee80211_conf *conf = rt2x00dev-hw.conf;
u32 reg[4];
u32 value;
u32 preamble;
@@ -1389,7 +1312,6 @@ static void rt2400pci_uninitialize(struc
  */
 static int rt2400pci_enable_radio(struct rt2x00_dev *rt2x00dev)
 {
-   struct net_device *net_dev = pci_get_drvdata(rt2x00dev_pci(rt2x00dev));
u32 reg;
 
/*
@@ -1444,22 +1366,21 @@ static int rt2400pci_enable_radio(struct
 
SET_FLAG(rt2x00dev, DEVICE_ENABLED_RADIO);
 
-   ieee80211_start_queues(net_dev);
-   ieee80211_netif_oper(net_dev, NETIF_WAKE);
+   ieee80211_start_queues(rt2x00dev-hw);
+   ieee80211_netif_oper(rt2x00dev-hw, NETIF_WAKE);
 
return 0;
 }
 
 static void rt2400pci_disable_radio(struct rt2x00_dev *rt2x00dev)
 {
-   struct net_device *net_dev = pci_get_drvdata(rt2x00dev_pci(rt2x00dev));
u32 reg;
 
if (!GET_FLAG(rt2x00dev, DEVICE_ENABLED_RADIO))
return;
 
-   ieee80211_netif_oper(net_dev, NETIF_STOP);
-   ieee80211_stop_queues(net_dev);
+   ieee80211_netif_oper(rt2x00dev-hw, 

Re: [RFC] rt2400: fix breakage from API changes

2006-12-01 Thread Ivo van Doorn
Hi,

 Here's my whack at fixing-up the rt2400pci driver to compile, since
 the recent API changes broke it.  This only covers that one driver,
 so lots more (albeit similar) work needs to be done to cover the
 other rt2x00 family drivers.
 
 Ivo and Johannes, please take a quick look to see if I'm obviously
 missing something or handling something incorrectly.  I don't have
 the hardware in questions, so this is completely untested. :-)

Patch looks good.
I believe I could have a patchseries available next weekend (December 9th)
that will update rt2x00 to the latest cvs version.
Its been a while since my last patch series to the wireless-dev tree,
but that was because I was quite busy the last months.
I'll start working on the patchs series this week, so they should be done
at the end of the week. That should save you some time working on
unknown code ;) And will provide a version that has been well tested. :)

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


[PATCH 5/5] sky2: msi enhancements.

2006-12-01 Thread Stephen Hemminger
If using Message Signaled Interrupts (MSI) then the IRQ will never
be shared. Don't call pci_disable_msi() unless using MSI.

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


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

--- netdev-2.6.orig/drivers/net/sky2.c  2006-12-01 14:23:33.0 -0800
+++ netdev-2.6/drivers/net/sky2.c   2006-12-01 14:23:36.0 -0800
@@ -3311,7 +3311,7 @@
return IRQ_NONE;
 
if (status  Y2_IS_IRQ_SW) {
-   hw-msi_detected = 1;
+   hw-msi = 1;
wake_up(hw-msi_wait);
sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ);
}
@@ -3330,7 +3330,7 @@
 
sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);
 
-   err = request_irq(pdev-irq, sky2_test_intr, IRQF_SHARED, DRV_NAME, hw);
+   err = request_irq(pdev-irq, sky2_test_intr, 0, DRV_NAME, hw);
if (err) {
printk(KERN_ERR PFX %s: cannot assign irq %d\n,
   pci_name(pdev), pdev-irq);
@@ -3340,9 +3340,9 @@
sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ);
sky2_read8(hw, B0_CTST);
 
-   wait_event_timeout(hw-msi_wait, hw-msi_detected, HZ/10);
+   wait_event_timeout(hw-msi_wait, hw-msi, HZ/10);
 
-   if (!hw-msi_detected) {
+   if (!hw-msi) {
/* MSI test failed, go back to INTx mode */
printk(KERN_INFO PFX %s: No interrupt generated using MSI, 
   switching to INTx mode.\n,
@@ -3475,7 +3475,8 @@
goto err_out_free_netdev;
}
 
-   err = request_irq(pdev-irq,  sky2_intr, IRQF_SHARED, dev-name, hw);
+   err = request_irq(pdev-irq,  sky2_intr, hw-msi ? 0 : IRQF_SHARED,
+ dev-name, hw);
if (err) {
printk(KERN_ERR PFX %s: cannot assign irq %d\n,
   pci_name(pdev), pdev-irq);
@@ -3505,7 +3506,8 @@
return 0;
 
 err_out_unregister:
-   pci_disable_msi(pdev);
+   if (hw-msi)
+   pci_disable_msi(pdev);
unregister_netdev(dev);
 err_out_free_netdev:
free_netdev(dev);
@@ -3548,7 +3550,8 @@
sky2_read8(hw, B0_CTST);
 
free_irq(pdev-irq, hw);
-   pci_disable_msi(pdev);
+   if (hw-msi)
+   pci_disable_msi(pdev);
pci_free_consistent(pdev, STATUS_LE_BYTES, hw-st_le, hw-st_dma);
pci_release_regions(pdev);
pci_disable_device(pdev);
--- netdev-2.6.orig/drivers/net/sky2.h  2006-12-01 14:23:30.0 -0800
+++ netdev-2.6/drivers/net/sky2.h   2006-12-01 14:23:36.0 -0800
@@ -1900,7 +1900,7 @@
dma_addr_t   st_dma;
 
struct timer_listidle_timer;
-   int  msi_detected;
+   int  msi;
wait_queue_head_tmsi_wait;
 };
 

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


[PATCH 3/5] sky2: fixes for Yukon EC_U chip revisions

2006-12-01 Thread Stephen Hemminger
Update workarounds for 88E803X based on the latest SysKonnect vendor
driver version (8.41). Tested on EC_U rev A1, only.
These up the receive performance.

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

---
 drivers/net/sky2.c |   13 ++---
 drivers/net/sky2.h |9 +++--
 2 files changed, 13 insertions(+), 9 deletions(-)

--- netdev-2.6.orig/drivers/net/sky2.c  2006-12-01 14:23:27.0 -0800
+++ netdev-2.6/drivers/net/sky2.c   2006-12-01 14:23:30.0 -0800
@@ -677,17 +677,15 @@
/* Flush Rx MAC FIFO on any flow control or error */
sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR);
 
-   /* Set threshold to 0xa (64 bytes)
-*  ASF disabled so no need to do WA dev #4.30
-*/
-   sky2_write16(hw, SK_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF);
+   /* Set threshold to 0xa (64 bytes) + 1 to workaround pause bug  */
+   sky2_write16(hw, SK_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF+1);
 
/* Configure Tx MAC FIFO */
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR);
sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON);
 
if (hw-chip_id == CHIP_ID_YUKON_EC_U) {
-   sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 512/8);
+   sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8);
sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8);
if (hw-dev[port]-mtu  ETH_DATA_LEN) {
/* set Tx GMAC FIFO Almost Empty Threshold */
@@ -1061,7 +1059,8 @@
sky2-rx_put = sky2-rx_next = 0;
sky2_qset(hw, rxq);
 
-   if (hw-chip_id == CHIP_ID_YUKON_EC_U  hw-chip_rev = 2) {
+   if (hw-chip_id == CHIP_ID_YUKON_EC_U 
+   (hw-chip_rev == CHIP_REV_YU_EC_U_A1 || hw-chip_rev == 
CHIP_REV_YU_EC_U_B0)) {
/* MAC Rx RAM Read is controlled by hardware */
sky2_write32(hw, Q_ADDR(rxq, Q_F), F_M_RX_RAM_DIS);
}
@@ -1510,7 +1509,7 @@
 
/* WA for dev. #4.209 */
if (hw-chip_id == CHIP_ID_YUKON_EC_U
-hw-chip_rev == CHIP_REV_YU_EC_U_A1)
+(hw-chip_rev == CHIP_REV_YU_EC_U_A1 || hw-chip_rev == 
CHIP_REV_YU_EC_U_B0))
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
 sky2-speed != SPEED_1000 ?
 TX_STFW_ENA : TX_STFW_DIS);
--- netdev-2.6.orig/drivers/net/sky2.h  2006-12-01 14:19:32.0 -0800
+++ netdev-2.6/drivers/net/sky2.h   2006-12-01 14:23:30.0 -0800
@@ -383,8 +383,13 @@
CHIP_REV_YU_EC_A2= 1,  /* Chip Rev. for Yukon-EC A2 */
CHIP_REV_YU_EC_A3= 2,  /* Chip Rev. for Yukon-EC A3 */
 
-   CHIP_REV_YU_EC_U_A0  = 0,
-   CHIP_REV_YU_EC_U_A1  = 1,
+   CHIP_REV_YU_EC_U_A0  = 1,
+   CHIP_REV_YU_EC_U_A1  = 2,
+   CHIP_REV_YU_EC_U_B0  = 3,
+
+   CHIP_REV_YU_FE_A1= 1,
+   CHIP_REV_YU_FE_A2= 2,
+
 };
 
 /* B2_Y2_CLK_GATE   8 bit  Clock Gating (Yukon-2 only) */

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


[PATCH 2/5] sky2: add Dlink 560SX id

2006-12-01 Thread Stephen Hemminger
Add new PCI ID for DLink 560SX.
This from the latest SysKonnect vendor driver (version 8.41).

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

---
 drivers/net/sky2.c |1 +
 1 file changed, 1 insertion(+)

--- netdev-2.6.orig/drivers/net/sky2.c  2006-12-01 14:23:21.0 -0800
+++ netdev-2.6/drivers/net/sky2.c   2006-12-01 14:23:27.0 -0800
@@ -104,6 +104,7 @@
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) },/* DGE-560T */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4001) },/* DGE-550SX */
+   { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4B02) },/* DGE-560SX */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) },

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


[PATCH 0/5] sky2: driver update

2006-12-01 Thread Stephen Hemminger
This patchset is the little stuff that I found during testing
and development of later versions. It does NOT fix the problems
reported in Bugzilla that are occurring on the newer (untested)
motherboards.

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


[PATCH 4/5] sky2: kfree_skb_any needed

2006-12-01 Thread Stephen Hemminger
It is possible for the sky2 driver NAPI poll routine to be called with
IRQ's disabled if netpoll is trying to make space in the tx queue. This
is an obscure path, but if it happens, the kfree_skb needs to happen
via softirq. Calling kfree_skb with IRQ's disabled is a not allowed.

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

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

--- netdev-2.6.orig/drivers/net/sky2.c  2006-12-01 14:23:30.0 -0800
+++ netdev-2.6/drivers/net/sky2.c   2006-12-01 14:23:33.0 -0800
@@ -1453,7 +1453,7 @@
if (unlikely(netif_msg_tx_done(sky2)))
printk(KERN_DEBUG %s: tx done %u\n,
   dev-name, idx);
-   dev_kfree_skb(re-skb);
+   dev_kfree_skb_any(re-skb);
}
 
le-opcode = 0; /* paranoia */

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


[PATCH 1/5] sky2: receive error handling fix

2006-12-01 Thread Stephen Hemminger
If sky2 detects out of memory, or gets a bad frame, it reuses the same receive
buffer, but forgets to poke the hardware. This could lead to the receiver
getting stuck if there were lots of errors.

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


---
 drivers/net/sky2.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- netdev-2.6.orig/drivers/net/sky2.c  2006-12-01 14:19:32.0 -0800
+++ netdev-2.6/drivers/net/sky2.c   2006-12-01 14:23:21.0 -0800
@@ -2065,7 +2065,7 @@
case OP_RXSTAT:
skb = sky2_receive(dev, length, status);
if (!skb)
-   break;
+   goto force_update;
 
skb-protocol = eth_type_trans(skb, dev);
dev-last_rx = jiffies;
@@ -2081,8 +2081,8 @@
 
/* Update receiver after 16 frames */
if (++buf_write[le-link] == RX_BUF_WRITE) {
-   sky2_put_idx(hw, rxqaddr[le-link],
-sky2-rx_put);
+force_update:
+   sky2_put_idx(hw, rxqaddr[le-link], 
sky2-rx_put);
buf_write[le-link] = 0;
}
 

--
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: pktgen

2006-12-01 Thread David Miller
From: Christoph Hellwig [EMAIL PROTECTED]
Date: Fri, 1 Dec 2006 08:22:25 +

 On Thu, Nov 30, 2006 at 08:14:23PM -0800, David Miller wrote:
  Agreed.
  
  Robert, please fix this by using a completion so that we can
  wait for the threads to start up, something like this:
 
 No, that's wrong aswell :)  Please use the kthread_ API that takes
 care of all this.  kernel_thread is going away mid-term, so you'd
 have to do this work anyway.

I was going to suggest this Christophe, but I wanted a change small
and easy enough to verify in order to merge the fix into the -stable
branch.  Converting the thing over to kthread would make the change
more risky in such a context.

-
To unsubscribe from this list: send 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: pktgen

2006-12-01 Thread David Miller
From: Alexey Dobriyan [EMAIL PROTECTED]
Date: Fri, 1 Dec 2006 12:51:53 +0300

 On 12/1/06, Robert Olsson [EMAIL PROTECTED] wrote:
  David Miller writes:
Agreed.
   
Robert, please fix this by using a completion so that we can
wait for the threads to start up, something like this:
 
  Included. It passes my test but Alexey and others test.
 
 Confused now. Is my t-control = ~(T_TERMINATE); fix deprecated by
 completions?

The completions solve the bug completely.

But later on we should integate a change that eliminates
these spurious t-control bit clears at the start of the
pktgen thread execution, it just isn't needed to fix the
bug so we can make it later.
-
To unsubscribe from this list: send 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] amd8111e use standard CRC lib

2006-12-01 Thread Stephen Hemminger
I noticed this driver (and several others) reinvent their own copy of the
existing CRC library. Don't have the hardware, but tested by extracting
code and comparing result.

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

---
 drivers/net/amd8111e.c |   27 +--
 drivers/net/amd8111e.h |4 
 2 files changed, 1 insertion(+), 30 deletions(-)

--- old/drivers/net/amd8111e.c
+++ new/drivers/net/amd8111e.c
@@ -1490,32 +1490,7 @@ static void amd8111e_read_regs(struct am
buf[12] = readl(mmio + STAT0);
 }
 
-/*
-amd8111e crc generator implementation is different from the kernel
-ether_crc() function.
-*/
-static int amd8111e_ether_crc(int len, char* mac_addr)
-{
-   int i,byte;
-   unsigned char octet;
-   u32 crc= INITCRC;
-
-   for(byte=0; byte  len; byte++){
-   octet = mac_addr[byte];
-   for( i=0;i  8; i++){
-   /*If the next bit form the input stream is 1,subtract   
 the divisor (CRC32) from the dividend(crc).*/
-   if( (octet  0x1) ^ (crc  0x1) ){
-   crc = 1;
-   crc ^= CRC32;
-   }
-   else
-   crc = 1;
 
-   octet = 1;
-   }
-   }
-   return crc;
-}
 /*
 This function sets promiscuos mode, all-multi mode or the multicast address
 list to the device.
@@ -1556,7 +1531,7 @@ static void amd8111e_set_multicast_list(
mc_filter[1] = mc_filter[0] = 0;
for (i = 0, mc_ptr = dev-mc_list; mc_ptr  i  dev-mc_count;
 i++, mc_ptr = mc_ptr-next) {
-   bit_num = ( amd8111e_ether_crc(ETH_ALEN,mc_ptr-dmi_addr)   
  26 )  0x3f;
+   bit_num = (ether_crc_le(ETH_ALEN, mc_ptr-dmi_addr)  26)  
0x3f;
mc_filter[bit_num  5] |= 1  (bit_num  31);
}
amd8111e_writeq(*(u64*)mc_filter,lp-mmio+ LADRF);
--- chelsio-t2.orig/drivers/net/amd8111e.h
+++ chelsio-t2/drivers/net/amd8111e.h
@@ -651,10 +651,6 @@ typedef enum {
 /* driver ioctl parameters */
 #define AMD8111E_REG_DUMP_LEN   13*sizeof(u32)
 
-/* crc generator constants */
-#define CRC32 0xedb88320
-#define INITCRC 0x
-
 /* amd8111e desriptor format */
 
 struct amd8111e_tx_dr{
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/10] chelsio: add MSI support

2006-12-01 Thread Stephen Hemminger
Using MSI can avoid sharing IRQ and associated overhead.
Tested on PCI-X.

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

---
 drivers/net/chelsio/common.h |1 +
 drivers/net/chelsio/cxgb2.c  |   20 +---
 2 files changed, 18 insertions(+), 3 deletions(-)

--- chelsio.orig/drivers/net/chelsio/common.h
+++ chelsio/drivers/net/chelsio/common.h
@@ -228,6 +228,7 @@ struct adapter_params {
unsigned short chip_revision;
unsigned char  chip_version;
unsigned char  is_asic;
+   unsigned char  has_msi;
 };
 
 struct link_config {
--- chelsio.orig/drivers/net/chelsio/cxgb2.c
+++ chelsio/drivers/net/chelsio/cxgb2.c
@@ -107,6 +107,10 @@ static int t1powersave = 1;/* HW defaul
 module_param(t1powersave, int, 0);
 MODULE_PARM_DESC(t1powersave, Enable/Disable T1 powersaving mode);
 
+static int disable_msi = 0;
+module_param(disable_msi, int, 0);
+MODULE_PARM_DESC(disable_msi, Disable Message Signaled Interrupt (MSI));
+
 static const char pci_speed[][4] = {
33, 66, 100, 133
 };
@@ -215,11 +219,19 @@ static int cxgb_up(struct adapter *adapt
}
 
t1_interrupts_clear(adapter);
-   if ((err = request_irq(adapter-pdev-irq,
-  t1_select_intr_handler(adapter), IRQF_SHARED,
-  adapter-name, adapter))) {
+
+   adapter-params.has_msi = !disable_msi  pci_enable_msi(adapter-pdev) 
== 0;
+   err = request_irq(adapter-pdev-irq,
+ t1_select_intr_handler(adapter),
+ adapter-params.has_msi ? 0 : IRQF_SHARED,
+ adapter-name, adapter);
+   if (err) {
+   if (adapter-params.has_msi)
+   pci_disable_msi(adapter-pdev);
+
goto out_err;
}
+
t1_sge_start(adapter-sge);
t1_interrupts_enable(adapter);
  out_err:
@@ -234,6 +246,8 @@ static void cxgb_down(struct adapter *ad
t1_sge_stop(adapter-sge);
t1_interrupts_disable(adapter);
free_irq(adapter-pdev-irq, adapter);
+   if (adapter-params.has_msi)
+   pci_disable_msi(adapter-pdev);
 }
 
 static int cxgb_open(struct net_device *dev)

-- 

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


[PATCH 06/10] chelsio: cleanup pm3393 code

2006-12-01 Thread Stephen Hemminger
Replace macro with function for updating RMON values

Cleanups:
* remove unused enum's
* Fix comment format

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

---
 drivers/net/chelsio/pm3393.c |   69 ++-
 1 file changed, 29 insertions(+), 40 deletions(-)

--- chelsio-t2.orig/drivers/net/chelsio/pm3393.c
+++ chelsio-t2/drivers/net/chelsio/pm3393.c
@@ -43,22 +43,6 @@
 #include elmer0.h
 #include suni1x10gexp_regs.h
 
-/* 802.3ae 10Gb/s MDIO Manageable Device(MMD)
- */
-enum {
-   MMD_RESERVED,
-   MMD_PMAPMD,
-   MMD_WIS,
-   MMD_PCS,
-   MMD_PHY_XGXS,   /* XGMII Extender Sublayer */
-   MMD_DTE_XGXS,
-};
-
-enum {
-   PHY_XGXS_CTRL_1,
-   PHY_XGXS_STATUS_1
-};
-
 #define OFFSET(REG_ADDR)(REG_ADDR  2)
 
 /* Max frame size PM3393 can handle. Includes Ethernet header and CRC. */
@@ -128,12 +112,12 @@ static int pm3393_reset(struct cmac *cma
 
 /*
  * Enable interrupts for the PM3393
-
-   1. Enable PM3393 BLOCK interrupts.
-   2. Enable PM3393 Master Interrupt bit(INTE)
-   3. Enable ELMER's PM3393 bit.
-   4. Enable Terminator external interrupt.
-*/
+ *
+ * 1. Enable PM3393 BLOCK interrupts.
+ * 2. Enable PM3393 Master Interrupt bit(INTE)
+ * 3. Enable ELMER's PM3393 bit.
+ * 4. Enable Terminator external interrupt.
+ */
 static int pm3393_interrupt_enable(struct cmac *cmac)
 {
u32 pl_intr;
@@ -261,11 +245,7 @@ static int pm3393_interrupt_clear(struct
 static int pm3393_interrupt_handler(struct cmac *cmac)
 {
u32 master_intr_status;
-/*
-   1. Read master interrupt register.
-   2. Read BLOCK's interrupt status registers.
-   3. Handle BLOCK interrupts.
-*/
+
/* Read the master interrupt status register. */
pmread(cmac, SUNI1x10GEXP_REG_MASTER_INTERRUPT_STATUS,
   master_intr_status);
@@ -473,20 +453,29 @@ static int pm3393_set_speed_duplex_fc(st
return 0;
 }
 
+static void pm3393_rmon_update(struct adapter *adapter, u32 offs, u64 *val,
+  int over)
+{
+   u32 val0, val1, val2;
+
+   t1_tpi_read(adapter, offs, val0);
+   t1_tpi_read(adapter, offs + 4, val1);
+   t1_tpi_read(adapter, offs + 8, val2);
+
+   *val = ~0ull  40;
+   *val |= val0  0x;
+   *val |= (val1  0x)  16;
+   *val |= (u64)(val2  0xff)  32;
+
+   if (over)
+   *val += 1ull  40;
+}
+
 #define RMON_UPDATE(mac, name, stat_name) \
-   { \
-   t1_tpi_read((mac)-adapter, OFFSET(name), val0);   \
-   t1_tpi_read((mac)-adapter, OFFSET(((name)+1)), val1); \
-   t1_tpi_read((mac)-adapter, OFFSET(((name)+2)), val2); \
-   (mac)-stats.stat_name = ((u64)val0  0x) | \
-   (((u64)val1  0x)  16) | \
-   (((u64)val2  0xff)  32) | \
-   ((mac)-stats.stat_name  \
-   (~(u64)0  40)); \
-   if (ro \
-   ((name -  SUNI1x10GEXP_REG_MSTAT_COUNTER_0_LOW)  2)) \
-   (mac)-stats.stat_name += ((u64)1  40); \
-   }
+   pm3393_rmon_update((mac)-adapter, OFFSET(name),\
+  (mac)-stats.stat_name, \
+  (ro ((name - SUNI1x10GEXP_REG_MSTAT_COUNTER_0_LOW)  2)))
+
 
 static const struct cmac_statistics *pm3393_update_statistics(struct cmac *mac,
  int flag)

-- 

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


[PATCH 01/10] chelsio: whitespace fixes

2006-12-01 Thread Stephen Hemminger
Fix indentation and blank/tab issues.

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

---
 drivers/net/chelsio/cxgb2.c  |2 +-
 drivers/net/chelsio/espi.c   |2 +-
 drivers/net/chelsio/pm3393.c |   16 
 drivers/net/chelsio/subr.c   |   12 ++--
 4 files changed, 16 insertions(+), 16 deletions(-)

--- chelsio.orig/drivers/net/chelsio/cxgb2.c
+++ chelsio/drivers/net/chelsio/cxgb2.c
@@ -729,7 +729,7 @@ static int get_coalesce(struct net_devic
 
 static int get_eeprom_len(struct net_device *dev)
 {
-return EEPROM_SIZE;
+   return EEPROM_SIZE;
 }
 
 #define EEPROM_MAGIC(ap) \
--- chelsio.orig/drivers/net/chelsio/espi.c
+++ chelsio/drivers/net/chelsio/espi.c
@@ -192,7 +192,7 @@ int t1_espi_intr_handler(struct peespi *
 
 const struct espi_intr_counts *t1_espi_get_intr_counts(struct peespi *espi)
 {
-return espi-intr_cnt;
+   return espi-intr_cnt;
 }
 
 static void espi_setup_for_pm3393(adapter_t *adapter)
--- chelsio.orig/drivers/net/chelsio/pm3393.c
+++ chelsio/drivers/net/chelsio/pm3393.c
@@ -46,17 +46,17 @@
 /* 802.3ae 10Gb/s MDIO Manageable Device(MMD)
  */
 enum {
-MMD_RESERVED,
-MMD_PMAPMD,
-MMD_WIS,
-MMD_PCS,
-MMD_PHY_XGXS,  /* XGMII Extender Sublayer */
-MMD_DTE_XGXS,
+   MMD_RESERVED,
+   MMD_PMAPMD,
+   MMD_WIS,
+   MMD_PCS,
+   MMD_PHY_XGXS,   /* XGMII Extender Sublayer */
+   MMD_DTE_XGXS,
 };
 
 enum {
-PHY_XGXS_CTRL_1,
-PHY_XGXS_STATUS_1
+   PHY_XGXS_CTRL_1,
+   PHY_XGXS_STATUS_1
 };
 
 #define OFFSET(REG_ADDR)(REG_ADDR  2)
--- chelsio.orig/drivers/net/chelsio/subr.c
+++ chelsio/drivers/net/chelsio/subr.c
@@ -166,11 +166,11 @@ static int t1_pci_intr_handler(adapter_t
 {
u32 pcix_cause;
 
-   pci_read_config_dword(adapter-pdev, A_PCICFG_INTR_CAUSE, pcix_cause);
+   pci_read_config_dword(adapter-pdev, A_PCICFG_INTR_CAUSE, pcix_cause);
 
if (pcix_cause) {
pci_write_config_dword(adapter-pdev, A_PCICFG_INTR_CAUSE,
-pcix_cause);
+  pcix_cause);
t1_fatal_err(adapter);/* PCI errors are fatal */
}
return 0;
@@ -420,9 +420,9 @@ int t1_link_start(struct cphy *phy, stru
  */
 int elmer0_ext_intr_handler(adapter_t *adapter)
 {
-   struct cphy *phy;
+   struct cphy *phy;
int phy_cause;
-   u32 cause;
+   u32 cause;
 
t1_tpi_read(adapter, A_ELMER0_INT_CAUSE, cause);
 
@@ -515,7 +515,7 @@ void t1_interrupts_clear(adapter_t* adap
}
 
/* Enable interrupts for external devices. */
-   pl_intr = readl(adapter-regs + A_PL_CAUSE);
+   pl_intr = readl(adapter-regs + A_PL_CAUSE);
 
writel(pl_intr | F_PL_INTR_EXT | F_PL_INTR_PCIX,
   adapter-regs + A_PL_CAUSE);
@@ -643,7 +643,7 @@ static int board_init(adapter_t *adapter
case CHBT_BOARD_N110:
case CHBT_BOARD_N210:
writel(V_TPIPAR(0xf), adapter-regs + A_TPI_PAR);
-   t1_tpi_write(adapter, A_ELMER0_GPO, 0x800);
+   t1_tpi_write(adapter, A_ELMER0_GPO, 0x800);
break;
}
return 0;

-- 

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


[PATCH 00/10] chelsio: 10G driver

2006-12-01 Thread Stephen Hemminger
These patches are against netdev-2.6#upstream version of driver.

-- 

-
To unsubscribe from this list: send 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/10] chelsio: use kzalloc

2006-12-01 Thread Stephen Hemminger
Use kzalloc in several places.

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


---
 drivers/net/chelsio/mv88x201x.c |4 ++--
 drivers/net/chelsio/pm3393.c|3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

--- chelsio.orig/drivers/net/chelsio/mv88x201x.c
+++ chelsio/drivers/net/chelsio/mv88x201x.c
@@ -205,11 +205,11 @@ static struct cphy *mv88x201x_phy_create
 struct mdio_ops *mdio_ops)
 {
u32 val;
-   struct cphy *cphy = kmalloc(sizeof(*cphy), GFP_KERNEL);
+   struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
 
if (!cphy)
return NULL;
-   memset(cphy, 0, sizeof(*cphy));
+
cphy_init(cphy, adapter, phy_addr, mv88x201x_ops, mdio_ops);
 
/* Commands the PHY to enable XFP's clock. */
--- chelsio.orig/drivers/net/chelsio/pm3393.c
+++ chelsio/drivers/net/chelsio/pm3393.c
@@ -631,10 +631,9 @@ static struct cmac *pm3393_mac_create(ad
 {
struct cmac *cmac;
 
-   cmac = kmalloc(sizeof(*cmac) + sizeof(cmac_instance), GFP_KERNEL);
+   cmac = kzalloc(sizeof(*cmac) + sizeof(cmac_instance), GFP_KERNEL);
if (!cmac)
return NULL;
-   memset(cmac, 0, sizeof(*cmac));
 
cmac-ops = pm3393_ops;
cmac-instance = (cmac_instance *) (cmac + 1);

-- 

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


[PATCH 03/10] chelsio: remove unused mutex

2006-12-01 Thread Stephen Hemminger
This mutex is unused in current (non TOE) code.

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

---
 drivers/net/chelsio/common.h |1 -
 drivers/net/chelsio/cxgb2.c  |1 -
 2 files changed, 2 deletions(-)

--- chelsio-t2.orig/drivers/net/chelsio/common.h
+++ chelsio-t2/drivers/net/chelsio/common.h
@@ -212,7 +212,6 @@ struct adapter {
struct work_struct stats_update_task;
struct timer_list stats_update_timer;
 
-   struct semaphore mib_mutex;
spinlock_t tpi_lock;
spinlock_t work_lock;
/* guards async operations */
--- chelsio-t2.orig/drivers/net/chelsio/cxgb2.c
+++ chelsio-t2/drivers/net/chelsio/cxgb2.c
@@ -1040,7 +1040,6 @@ static int __devinit init_one(struct pci
adapter-msg_enable = dflt_msg_enable;
adapter-mmio_len = mmio_len;
 
-   init_MUTEX(adapter-mib_mutex);
spin_lock_init(adapter-tpi_lock);
spin_lock_init(adapter-work_lock);
spin_lock_init(adapter-async_lock);

-- 

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


[PATCH 09/10] chelsio: statistics improvement

2006-12-01 Thread Stephen Hemminger
Cleanup statistics management:
 * Get rid of duplicate or unused statistics
 * Convert high volume stats to per-cpu and 64 bit

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

---
 drivers/net/chelsio/cxgb2.c |   74 ++--
 drivers/net/chelsio/sge.c   |   65 +-
 drivers/net/chelsio/sge.h   |   29 +++--
 3 files changed, 100 insertions(+), 68 deletions(-)

--- chelsio.orig/drivers/net/chelsio/cxgb2.c
+++ chelsio/drivers/net/chelsio/cxgb2.c
@@ -390,13 +390,19 @@ static char stats_strings[][ETH_GSTRING_
RxOutOfRangeLengthField,
RxFrameTooLongErrors,
 
-   TSO,
-   VLANextractions,
-   VLANinsertions,
+   /* Port stats */
+   RxPackets,
RxCsumGood,
+   TxPackets,
TxCsumOffload,
-   RxDrops
-
+   TxTso,
+   RxVlan,
+   TxVlan,
+
+   /* Interrupt stats */
+   rx drops,
+   pure_rsps,
+   unhandled irqs,
respQ_empty,
respQ_overflow,
freelistQ_empty,
@@ -404,10 +410,6 @@ static char stats_strings[][ETH_GSTRING_
pkt_mismatch,
cmdQ_full0,
cmdQ_full1,
-   tx_ipfrags,
-   tx_reg_pkts,
-   tx_lso_pkts,
-   tx_do_cksum,
 
espi_DIP2ParityErr,
espi_DIP4Err,
@@ -451,12 +453,10 @@ static void get_stats(struct net_device 
struct adapter *adapter = dev-priv;
struct cmac *mac = adapter-port[dev-if_port].mac;
const struct cmac_statistics *s;
-   const struct sge_port_stats *ss;
const struct sge_intr_counts *t;
+   struct sge_port_stats ss;
 
s = mac-ops-statistics_update(mac, MAC_STATS_UPDATE_FULL);
-   ss = t1_sge_get_port_stats(adapter-sge, dev-if_port);
-   t = t1_sge_get_intr_counts(adapter-sge);
 
*data++ = s-TxOctetsOK;
*data++ = s-TxOctetsBad;
@@ -492,35 +492,37 @@ static void get_stats(struct net_device 
*data++ = s-RxOutOfRangeLengthField;
*data++ = s-RxFrameTooLongErrors;
 
-   *data++ = ss-tso;
-   *data++ = ss-vlan_xtract;
-   *data++ = ss-vlan_insert;
-   *data++ = ss-rx_cso_good;
-   *data++ = ss-tx_cso;
-   *data++ = ss-rx_drops;
-
-   *data++ = (u64)t-respQ_empty;
-   *data++ = (u64)t-respQ_overflow;
-   *data++ = (u64)t-freelistQ_empty;
-   *data++ = (u64)t-pkt_too_big;
-   *data++ = (u64)t-pkt_mismatch;
-   *data++ = (u64)t-cmdQ_full[0];
-   *data++ = (u64)t-cmdQ_full[1];
-   *data++ = (u64)t-tx_ipfrags;
-   *data++ = (u64)t-tx_reg_pkts;
-   *data++ = (u64)t-tx_lso_pkts;
-   *data++ = (u64)t-tx_do_cksum;
+   t1_sge_get_port_stats(adapter-sge, dev-if_port, ss);
+   *data++ = ss.rx_packets;
+   *data++ = ss.rx_cso_good;
+   *data++ = ss.tx_packets;
+   *data++ = ss.tx_cso;
+   *data++ = ss.tx_tso;
+   *data++ = ss.vlan_xtract;
+   *data++ = ss.vlan_insert;
+
+   t = t1_sge_get_intr_counts(adapter-sge);
+   *data++ = t-rx_drops;
+   *data++ = t-pure_rsps;
+   *data++ = t-unhandled_irqs;
+   *data++ = t-respQ_empty;
+   *data++ = t-respQ_overflow;
+   *data++ = t-freelistQ_empty;
+   *data++ = t-pkt_too_big;
+   *data++ = t-pkt_mismatch;
+   *data++ = t-cmdQ_full[0];
+   *data++ = t-cmdQ_full[1];
 
if (adapter-espi) {
const struct espi_intr_counts *e;
 
e = t1_espi_get_intr_counts(adapter-espi);
-   *data++ = (u64) e-DIP2_parity_err;
-   *data++ = (u64) e-DIP4_err;
-   *data++ = (u64) e-rx_drops;
-   *data++ = (u64) e-tx_drops;
-   *data++ = (u64) e-rx_ovflw;
-   *data++ = (u64) e-parity_err;
+   *data++ = e-DIP2_parity_err;
+   *data++ = e-DIP4_err;
+   *data++ = e-rx_drops;
+   *data++ = e-tx_drops;
+   *data++ = e-rx_ovflw;
+   *data++ = e-parity_err;
}
 }
 
--- chelsio.orig/drivers/net/chelsio/sge.c
+++ chelsio/drivers/net/chelsio/sge.c
@@ -274,7 +274,7 @@ struct sge {
struct sk_buff  *espibug_skb[MAX_NPORTS];
u32 sge_control;/* shadow value of sge control reg */
struct sge_intr_counts stats;
-   struct sge_port_stats port_stats[MAX_NPORTS];
+   struct sge_port_stats *port_stats[MAX_NPORTS];
struct sched*tx_sched;
struct cmdQ cmdQ[SGE_CMDQ_N] cacheline_aligned_in_smp;
 };
@@ -820,6 +820,11 @@ static inline unsigned int jumbo_payload
  */
 void t1_sge_destroy(struct sge *sge)
 {
+   int i;
+
+   for_each_port(sge-adapter, i)
+   free_percpu(sge-port_stats[i]);
+
kfree(sge-tx_sched);
free_tx_resources(sge);
free_rx_resources(sge);
@@ -985,14 +990,28 @@ int t1_sge_intr_error_handler(struct sge
return 0;
 }
 
-const struct sge_intr_counts *t1_sge_get_intr_counts(struct sge *sge)
+const struct sge_intr_counts 

[PATCH 07/10] chelsio: use standard CRC routines

2006-12-01 Thread Stephen Hemminger
Replace driver crc calculation with existing library.

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

---
 drivers/net/Kconfig  |1 +
 drivers/net/chelsio/pm3393.c |   31 +++
 2 files changed, 4 insertions(+), 28 deletions(-)

--- chelsio.orig/drivers/net/Kconfig
+++ chelsio/drivers/net/Kconfig
@@ -2360,6 +2360,7 @@ menu Ethernet (1 Mbit)
 config CHELSIO_T1
 tristate Chelsio 10Gb Ethernet support
 depends on PCI
+   select CRC32
 help
   This driver supports Chelsio gigabit and 10-gigabit
   Ethernet cards. More information about adapter features and
--- chelsio.orig/drivers/net/chelsio/pm3393.c
+++ chelsio/drivers/net/chelsio/pm3393.c
@@ -43,6 +43,8 @@
 #include elmer0.h
 #include suni1x10gexp_regs.h
 
+#include linux/crc32.h
+
 #define OFFSET(REG_ADDR)(REG_ADDR  2)
 
 /* Max frame size PM3393 can handle. Includes Ethernet header and CRC. */
@@ -345,33 +347,6 @@ static int pm3393_set_mtu(struct cmac *c
return 0;
 }
 
-static u32 calc_crc(u8 *b, int len)
-{
-   int i;
-   u32 crc = (u32)~0;
-
-   /* calculate crc one bit at a time */
-   while (len--) {
-   crc ^= *b++;
-   for (i = 0; i  8; i++) {
-   if (crc  0x1)
-   crc = (crc  1) ^ 0xedb88320;
-   else
-   crc = (crc  1);
-   }
-   }
-
-   /* reverse bits */
-   crc = ((crc  4)  0x0f0f0f0f) | ((crc  4)  0xf0f0f0f0);
-   crc = ((crc  2)  0x) | ((crc  2)  0x);
-   crc = ((crc  1)  0x) | ((crc  1)  0x);
-   /* swap bytes */
-   crc = (crc  16) | (crc  16);
-   crc = (crc  8  0x00ff00ff) | (crc  8  0xff00ff00);
-
-   return crc;
-}
-
 static int pm3393_set_rx_mode(struct cmac *cmac, struct t1_rx_mode *rm)
 {
int enabled = cmac-instance-enabled  MAC_DIRECTION_RX;
@@ -405,7 +380,7 @@ static int pm3393_set_rx_mode(struct cma
u16 mc_filter[4] = { 0, };
 
while ((addr = t1_get_next_mcaddr(rm))) {
-   bit = (calc_crc(addr, ETH_ALEN)  23)  0x3f;  /* 
bit[23:28] */
+   bit = (ether_crc(ETH_ALEN, addr)  23)  0x3f; /* 
bit[23:28] */
mc_filter[bit  4] |= 1  (bit  0xf);
}
pmwrite(cmac, SUNI1x10GEXP_REG_RXXG_MULTICAST_HASH_LOW, 
mc_filter[0]);

-- 

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


[PATCH 10/10] chelesio: transmit locking (plus bug fix).

2006-12-01 Thread Stephen Hemminger
If transmit lock is contended on, then push return code back
and retry at higher level.

Bugfix: If buffer is reallocated because of lack of headroom
and the send is blocked, then drop packet. This is necessary
because caller would end up requeuing a freed skb.

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

---
 drivers/net/chelsio/sge.c |   19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

--- chelsio.orig/drivers/net/chelsio/sge.c
+++ chelsio/drivers/net/chelsio/sge.c
@@ -1778,7 +1778,9 @@ static int t1_sge_tx(struct sk_buff *skb
struct cmdQ *q = sge-cmdQ[qid];
unsigned int credits, pidx, genbit, count, use_sched_skb = 0;
 
-   spin_lock(q-lock);
+   if (!spin_trylock(q-lock))
+   return NETDEV_TX_LOCKED;
+
reclaim_completed_tx(sge, q);
 
pidx = q-pidx;
@@ -1887,6 +1889,8 @@ int t1_start_xmit(struct sk_buff *skb, s
struct sge *sge = adapter-sge;
struct sge_port_stats *st = per_cpu_ptr(sge-port_stats[dev-if_port], 
smp_processor_id());
struct cpl_tx_pkt *cpl;
+   struct sk_buff *orig_skb = skb;
+   int ret;
 
if (skb-protocol == htons(ETH_P_CPL5))
goto send;
@@ -1930,8 +1934,6 @@ int t1_start_xmit(struct sk_buff *skb, s
 * Complain when this happens but try to fix things up.
 */
if (unlikely(skb_headroom(skb)  dev-hard_header_len - 
ETH_HLEN)) {
-   struct sk_buff *orig_skb = skb;
-
pr_debug(%s: headroom %d header_len %d\n, dev-name,
 skb_headroom(skb), dev-hard_header_len);
 
@@ -1991,7 +1993,16 @@ int t1_start_xmit(struct sk_buff *skb, s
 send:
st-tx_packets++;
dev-trans_start = jiffies;
-   return t1_sge_tx(skb, adapter, 0, dev);
+   ret = t1_sge_tx(skb, adapter, 0, dev);
+
+   /* If transmit busy, and we reallocated skb's due to headroom limit,
+* then silently discard to avoid leak.
+*/
+   if (unlikely(ret != NETDEV_TX_OK  skb != orig_skb)) {
+   dev_kfree_skb_any(skb);
+   ret = NETDEV_TX_OK;
+   }
+   return ret;
 }
 
 /*

-- 

-
To unsubscribe from this list: send 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: Multiple end-points behind same NAT

2006-12-01 Thread Herbert Xu
Venkat Yekkirala [EMAIL PROTECTED] wrote:
 
 I am wondering if 26sec supports NAT-Traversal for multiple
 endpoints behind the same NAT. In looking at xfrm_tmpl it's
 not obvious to me that it's supported, at least going by the
 following from the setkey man page:
 
 When NAT-T is enabled in the kernel, policy matching for ESP over
 UDP packets may be done on endpoint addresses and port (this
 depends on the system.  System that do not perform the port check
 cannot support multiple endpoints behind the same NAT).  When
 using ESP over UDP, you can specify port numbers in the endpoint
 addresses to get the correct matching.  Here is an example:
 
 spdadd 10.0.11.0/24[any] 10.0.11.33/32[any] any -P out ipsec
 esp/tunnel/192.168.0.1[4500]-192.168.1.2[3]/require ;
 
 Or is this to be accomplished in a different way?

It depends on whether it's transport mode or tunnel mode.  In tunnel
mode it should work just fine.  Transport mode on the other hand
has fundamental problems with NAT-T that go beyond the Linux
implementation.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2][GENETLINK] add cmd dump completion

2006-12-01 Thread David Miller
From: jamal [EMAIL PROTECTED]
Date: Fri, 01 Dec 2006 06:33:48 -0500

 [GENETLINK] add cmd dump completion
 
 Remove assumption that generic netlink commands cannot have dump
 completion callbacks.
 
 Signed-off-by: Jamal Hadi Salim[EMAIL PROTECTED]

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


Re: RFC: XFRM changing the view of xfrm_aevent_id

2006-12-01 Thread David Miller
From: jamal [EMAIL PROTECTED]
Date: Fri, 01 Dec 2006 09:37:52 -0500

 The structure currently looks like
 
 struct xfrm_aevent_id {
 struct xfrm_usersa_id   sa_id;
 __u32   flags;
 };
 
 I could add the two items mentioned above in it and break the ABI.
 This may sound dangerous, but the usage of this ABI is not widespread.
 AFAIK, the only other person who might have used this is Kristzian (on
 CC).
 
 If this is considered evil, then i will transfer the two items in
 a new TLV but it wont be as pretty.
 
 Thoughts?

Let's change it now while we still can.

A few months from now, I will probably not give the same
answer :)
-
To unsubscribe from this list: send 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: [PKT_SCHED] act_gact: division by zero

2006-12-01 Thread David Miller
From: Nordlund Kim (Nokia-NET/Helsinki) [EMAIL PROTECTED]
Date: Thu, 30 Nov 2006 15:51:04 +0200 (EET)

 
 On Thu, 30 Nov 2006, ext Patrick McHardy wrote:
  I think it should reject an invalid configuration or handle
  the zero case correctly by not dividing.
 
 You are correct. Not returning -EINVAL, because someone might
 want to use the value zero in some future gact_prob algorithm?
 
 Signed-off-by: Kim Nordlund [EMAIL PROTECTED]

Applied, thanks Kim.
-
To unsubscribe from this list: send 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/3] NetXen: 64-bit memory fixes

2006-12-01 Thread Jeff Garzik

Amit S. Kale wrote:

NetXen: 1G/10G Ethernet driver updates
- These fixes take care of driver on machines with 4G memory
- Driver cleanup

Signed-off-by: Amit S. Kale [EMAIL PROTECTED]

 netxen_nic.h  |   29 +--
 netxen_nic_ethtool.c  |   19 ++--
 netxen_nic_hw.c   |4 
 netxen_nic_hw.h   |4 
 netxen_nic_init.c |   51 +++-
 netxen_nic_isr.c  |3 
 netxen_nic_main.c |  204 +++---

 netxen_nic_phan_reg.h |   10 +-


NAK, the driver itself should not be doing bounce buffering


-
To unsubscribe from this list: send 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.18] declance: Support the I/O ASIC LANCE w/o TURBOchannel

2006-12-01 Thread Andrew Morton
On Sat, 02 Dec 2006 00:19:58 -0500
Jeff Garzik [EMAIL PROTECTED] wrote:

 Maciej W. Rozycki wrote:
   The onboard LANCE of I/O ASIC systems is not a TURBOchannel device, at 
  least from the software point of view.  Therefore it does not rely on any 
  kernel TURBOchannel bus services and can be supported even if support for 
  TURBOchannel has not been enabled in the configuration.
  
  Signed-off-by: Maciej W. Rozycki [EMAIL PROTECTED]
 
 can you (or Andrew) please resend your patches against 2.6.19?
 

I have then all (I think) queued up.  Will send once I've done a round
of build-testing.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 1/4] - Potential performance bottleneck for Linxu TCP

2006-12-01 Thread Evgeniy Polyakov
On Thu, Nov 30, 2006 at 12:14:43PM -0800, David Miller ([EMAIL PROTECTED]) 
wrote:
  It steals timeslices from other processes to complete tcp_recvmsg()
  task, and only when it does it for too long, it will be preempted.
  Processing backlog queue on behalf of need_resched() will break
  fairness too - processing itself can take a lot of time, so process
  can be scheduled away in that part too.
 
 Yes, at this point I agree with this analysis.
 
 Currently I am therefore advocating some way to allow
 full input packet handling even amidst tcp_recvmsg()
 processing.

Isn't it a step in direction of full tcp processing bound to process
context? :)

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


[2.6 patch] remove ip{,6}_queue

2006-12-01 Thread Adrian Bunk
This patch removes ip{,6}_queue that were scheduled for removal
in mid-2005.

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

---

 Documentation/feature-removal-schedule.txt |   12 
 Documentation/networking/ip-sysctl.txt |1 
 include/linux/netfilter_ipv4/Kbuild|1 
 include/linux/netfilter_ipv4/ip_queue.h|   72 --
 include/linux/netlink.h|4 
 net/core/dev.c |2 
 net/ipv4/netfilter/Kconfig |   12 
 net/ipv4/netfilter/Makefile|2 
 net/ipv4/netfilter/ip_queue.c  |  742 -
 net/ipv6/netfilter/Kconfig |   20 
 net/ipv6/netfilter/Makefile|1 
 net/ipv6/netfilter/ip6_queue.c |  729 
 security/selinux/hooks.c   |4 
 security/selinux/nlmsgtab.c|   13 
 14 files changed, 2 insertions(+), 1613 deletions(-)

--- linux-2.6.19-rc6-mm2/Documentation/feature-removal-schedule.txt.old 
2006-12-01 19:35:09.0 +0100
+++ linux-2.6.19-rc6-mm2/Documentation/feature-removal-schedule.txt 
2006-12-01 19:36:51.0 +0100
@@ -97,18 +97,6 @@
 
 ---
 
-What:  ip_queue and ip6_queue (old ipv4-only and ipv6-only netfilter queue)
-When:  December 2005
-Why:   This interface has been obsoleted by the new layer3-independent
-   nfnetlink_queue.  The Kernel interface is compatible, so the old
-   ip[6]tables QUEUE targets still work and will transparently handle
-   all packets into nfnetlink queue number 0.  Userspace users will have
-   to link against API-compatible library on top of libnfnetlink_queue 
-   instead of the current 'libipq'.
-Who:   Harald Welte [EMAIL PROTECTED]
-

-
 What:  remove EXPORT_SYMBOL(kernel_thread)
 When:  August 2006
 Files: arch/*/kernel/*_ksyms.c
--- linux-2.6.19-rc6-mm2/net/ipv4/netfilter/Kconfig.old 2006-12-01 
19:36:01.0 +0100
+++ linux-2.6.19-rc6-mm2/net/ipv4/netfilter/Kconfig 2006-12-01 
19:36:51.0 +0100
@@ -215,18 +215,6 @@
 
  To compile it as a module, choose M here.  If unsure, say Y.
 
-config IP_NF_QUEUE
-   tristate IP Userspace queueing via NETLINK (OBSOLETE)
-   help
- Netfilter has the ability to queue packets to user space: the
- netlink device can be used to access them using this driver.
-
- This option enables the old IPv4-only ip_queue implementation
- which has been obsoleted by the new nfnetlink_queue code (see
- CONFIG_NETFILTER_NETLINK_QUEUE).
-
- To compile it as a module, choose M here.  If unsure, say N.
-
 config IP_NF_IPTABLES
tristate IP tables support (required for filtering/masq/NAT)
depends on NETFILTER_XTABLES
--- linux-2.6.19-rc6-mm2/net/ipv4/netfilter/Makefile.old2006-12-01 
19:36:01.0 +0100
+++ linux-2.6.19-rc6-mm2/net/ipv4/netfilter/Makefile2006-12-01 
19:36:51.0 +0100
@@ -85,8 +85,6 @@
 # just filtering instance of ARP tables for now
 obj-$(CONFIG_IP_NF_ARPFILTER) += arptable_filter.o
 
-obj-$(CONFIG_IP_NF_QUEUE) += ip_queue.o
-
 # objects for l3 independent conntrack
 nf_conntrack_ipv4-objs  :=  nf_conntrack_l3proto_ipv4.o 
nf_conntrack_proto_icmp.o
 
--- linux-2.6.19-rc6-mm2/net/ipv6/netfilter/Kconfig.old 2006-12-01 
19:36:01.0 +0100
+++ linux-2.6.19-rc6-mm2/net/ipv6/netfilter/Kconfig 2006-12-01 
19:36:51.0 +0100
@@ -19,26 +19,6 @@
 
  To compile it as a module, choose M here.  If unsure, say N.
 
-config IP6_NF_QUEUE
-   tristate IP6 Userspace queueing via NETLINK (OBSOLETE)
-   ---help---
-
- This option adds a queue handler to the kernel for IPv6
- packets which enables users to receive the filtered packets
- with QUEUE target using libipq.
-
- THis option enables the old IPv6-only ip6_queue implementation
- which has been obsoleted by the new nfnetlink_queue code (see
- CONFIG_NETFILTER_NETLINK_QUEUE).
-
- (C) Fernando Anton 2001
- IPv64 Project - Work based in IPv64 draft by Arturo Azcorra.
- Universidad Carlos III de Madrid
- Universidad Politecnica de Alcala de Henares
- email: [EMAIL PROTECTED].
-
- To compile it as a module, choose M here.  If unsure, say N.
-
 config IP6_NF_IPTABLES
tristate IP6 tables support (required for filtering)
depends on NETFILTER_XTABLES
--- linux-2.6.19-rc6-mm2/net/ipv6/netfilter/Makefile.old2006-12-01 
19:36:01.0 +0100
+++ linux-2.6.19-rc6-mm2/net/ipv6/netfilter/Makefile2006-12-01 
19:36:51.0 +0100
@@ -14,7 +14,6 @@
 obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
 obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o
 obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o
-obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o
 obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
 obj-$(CONFIG_IP6_NF_RAW) += ip6table_raw.o
 

[2.6 patch] net/*/nf_conntrack_*.c:possible cleanups

2006-12-01 Thread Adrian Bunk
This patch contains the following possible cleanups:
- make the following needlessly global functions static:
  - net/netfilter/nf_conntrack_core.c: nf_conntrack_register_cache()
  - net/netfilter/nf_conntrack_core.c: nf_conntrack_unregister_cache()
  - net/netfilter/nf_conntrack_core.c: __nf_conntrack_attach()
  - net/netfilter/nf_conntrack_core.c: set_hashsize()
  - net/netfilter/nf_conntrack_proto_sctp.c: nf_conntrack_proto_sctp_init()
  - net/netfilter/nf_conntrack_proto_sctp.c: nf_conntrack_proto_sctp_fini()
- make the following needlessly global variables/locks/structs static:
  - net/ipv6/netfilter/nf_conntrack_reasm.c: nf_ct_frag6_secret_interval
  - net/ipv6/netfilter/nf_conntrack_reasm.c: nf_ct_frag6_mem
  - net/netfilter/nf_conntrack_core.c: nf_ct_cache_lock
  - net/netfilter/nf_conntrack_proto_sctp.c: nf_conntrack_protocol_sctp4
  - net/netfilter/nf_conntrack_proto_sctp.c: nf_conntrack_protocol_sctp6
- #if 0 the following unused global functions:
  - net/ipv6/netfilter/nf_conntrack_reasm.c: nf_ct_frag6_kfree_frags()
  - net/netfilter/nf_conntrack_core.c: nf_conntrack_tuple_taken()
  - net/netfilter/nf_conntrack_core.c: nf_ct_invert_tuplepr()
- remove the following unused or write-only variables:
  - net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c: nat_module_is_loaded
  - net/ipv6/netfilter/nf_conntrack_reasm.c: nf_ct_frag6_nqueues
- remove the following unused hooks:
  - net/netfilter/nf_conntrack_core.c: nf_conntrack_destroyed()
  - net/netfilter/nf_conntrack_ftp.c: nf_nat_ftp_hook()
- remove the following unused EXPORT_SYMBOL's:
  - nf_ct_iterate_cleanup
  - nf_ct_protos
  - nf_ct_l3protos

Please review which of these changes make sense and which might conflict 
with pending patches.

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

---

 include/net/netfilter/nf_conntrack.h   |   17 ---
 include/net/netfilter/nf_conntrack_core.h  |2 -
 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |4 --
 net/ipv6/netfilter/nf_conntrack_reasm.c|9 ++---
 net/netfilter/nf_conntrack_core.c  |   21 ++---
 net/netfilter/nf_conntrack_ftp.c   |   26 +++--
 net/netfilter/nf_conntrack_proto_sctp.c|9 ++---
 net/netfilter/nf_conntrack_standalone.c|7 
 8 files changed, 23 insertions(+), 72 deletions(-)

--- 
linux-2.6.18-rc1-mm1-full/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c.old
2006-07-09 19:20:35.0 +0200
+++ linux-2.6.18-rc1-mm1-full/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
2006-07-09 19:20:46.0 +0200
@@ -113,12 +113,8 @@
return NF_ACCEPT;
 }
 
-int nat_module_is_loaded = 0;
 static u_int32_t ipv4_get_features(const struct nf_conntrack_tuple *tuple)
 {
-   if (nat_module_is_loaded)
-   return NF_CT_F_NAT;
-
return NF_CT_F_BASIC;
 }
 
--- linux-2.6.18-rc1-mm1-full/net/ipv6/netfilter/nf_conntrack_reasm.c.old   
2006-07-09 19:21:08.0 +0200
+++ linux-2.6.18-rc1-mm1-full/net/ipv6/netfilter/nf_conntrack_reasm.c   
2006-07-09 19:22:45.0 +0200
@@ -99,13 +99,11 @@
 static DEFINE_RWLOCK(nf_ct_frag6_lock);
 static u32 nf_ct_frag6_hash_rnd;
 static LIST_HEAD(nf_ct_frag6_lru_list);
-int nf_ct_frag6_nqueues = 0;
 
 static __inline__ void __fq_unlink(struct nf_ct_frag6_queue *fq)
 {
hlist_del(fq-list);
list_del(fq-lru_list);
-   nf_ct_frag6_nqueues--;
 }
 
 static __inline__ void fq_unlink(struct nf_ct_frag6_queue *fq)
@@ -143,7 +141,7 @@
 }
 
 static struct timer_list nf_ct_frag6_secret_timer;
-int nf_ct_frag6_secret_interval = 10 * 60 * HZ;
+static int nf_ct_frag6_secret_interval = 10 * 60 * HZ;
 
 static void nf_ct_frag6_secret_rebuild(unsigned long dummy)
 {
@@ -173,7 +171,7 @@
mod_timer(nf_ct_frag6_secret_timer, now + nf_ct_frag6_secret_interval);
 }
 
-atomic_t nf_ct_frag6_mem = ATOMIC_INIT(0);
+static atomic_t nf_ct_frag6_mem = ATOMIC_INIT(0);
 
 /* Memory Tracking Functions. */
 static inline void frag_kfree_skb(struct sk_buff *skb, unsigned int *work)
@@ -331,7 +329,6 @@
hlist_add_head(fq-list, nf_ct_frag6_hash[hash]);
INIT_LIST_HEAD(fq-lru_list);
list_add_tail(fq-lru_list, nf_ct_frag6_lru_list);
-   nf_ct_frag6_nqueues++;
write_unlock(nf_ct_frag6_lock);
return fq;
 }
@@ -842,6 +839,7 @@
nf_conntrack_put_reasm(skb);
 }
 
+#if 0
 int nf_ct_frag6_kfree_frags(struct sk_buff *skb)
 {
struct sk_buff *s, *s2;
@@ -856,6 +854,7 @@
 
return 0;
 }
+#endif  /*  0  */
 
 int nf_ct_frag6_init(void)
 {
--- linux-2.6.18-rc1-mm1-full/include/net/netfilter/nf_conntrack_core.h.old 
2006-07-09 19:23:09.0 +0200
+++ linux-2.6.18-rc1-mm1-full/include/net/netfilter/nf_conntrack_core.h 
2006-07-09 19:23:16.0 +0200
@@ -68,8 +68,6 @@
return ret;
 }
 
-extern void __nf_conntrack_attach(struct sk_buff *nskb, struct sk_buff *skb);
-
 extern struct list_head *nf_conntrack_hash;
 extern struct list_head nf_conntrack_expect_list;
 

Re: [patch 1/4] - Potential performance bottleneck for Linxu TCP

2006-12-01 Thread David Miller
From: Evgeniy Polyakov [EMAIL PROTECTED]
Date: Fri, 1 Dec 2006 12:53:07 +0300

 Isn't it a step in direction of full tcp processing bound to process
 context? :)

:-)

Rather, it is just finer grained locking.
-
To unsubscribe from this list: send 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: [netfilter-core] [2.6 patch] remove ip{,6}_queue

2006-12-01 Thread Patrick McHardy
Adrian Bunk wrote:
 This patch removes ip{,6}_queue that were scheduled for removal
 in mid-2005.

Thanks for the reminder, I forgot to remove the feature-removal-schedule
entry last time you asked.

We really can't remove ip_queue. Many users use this, there is no binary
compatible interface and even the compat replacement for the originally
statically linked library doesn't work. There is also no real necessity
to remove the code, so the feature-removal-schedule entry should be
removed instead.

Dave, please apply this patch. Thanks.

diff --git a/Documentation/feature-removal-schedule.txt 
b/Documentation/feature-removal-schedule.txt
index b3949cd..8244716 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -70,18 +70,6 @@ Who: Dominik Brodowski [EMAIL PROTECTED]
 
 ---
 
-What:  ip_queue and ip6_queue (old ipv4-only and ipv6-only netfilter queue)
-When:  December 2005
-Why:   This interface has been obsoleted by the new layer3-independent
-   nfnetlink_queue.  The Kernel interface is compatible, so the old
-   ip[6]tables QUEUE targets still work and will transparently handle
-   all packets into nfnetlink queue number 0.  Userspace users will have
-   to link against API-compatible library on top of libnfnetlink_queue 
-   instead of the current 'libipq'.
-Who:   Harald Welte [EMAIL PROTECTED]
-

-
 What:  remove EXPORT_SYMBOL(kernel_thread)
 When:  August 2006
 Files: arch/*/kernel/*_ksyms.c


Re: [netfilter-core] [2.6 patch] net/*/nf_conntrack_*.c:possible cleanups

2006-12-01 Thread Patrick McHardy
Adrian Bunk wrote:
 This patch contains the following possible cleanups:
 - make the following needlessly global functions static:
   - net/netfilter/nf_conntrack_core.c: nf_conntrack_register_cache()
   - net/netfilter/nf_conntrack_core.c: nf_conntrack_unregister_cache()
   - net/netfilter/nf_conntrack_core.c: __nf_conntrack_attach()
   - net/netfilter/nf_conntrack_core.c: set_hashsize()
   - net/netfilter/nf_conntrack_proto_sctp.c: nf_conntrack_proto_sctp_init()
   - net/netfilter/nf_conntrack_proto_sctp.c: nf_conntrack_proto_sctp_fini()
 - make the following needlessly global variables/locks/structs static:
   - net/ipv6/netfilter/nf_conntrack_reasm.c: nf_ct_frag6_secret_interval
   - net/ipv6/netfilter/nf_conntrack_reasm.c: nf_ct_frag6_mem
   - net/netfilter/nf_conntrack_core.c: nf_ct_cache_lock
   - net/netfilter/nf_conntrack_proto_sctp.c: nf_conntrack_protocol_sctp4
   - net/netfilter/nf_conntrack_proto_sctp.c: nf_conntrack_protocol_sctp6
 - #if 0 the following unused global functions:
   - net/ipv6/netfilter/nf_conntrack_reasm.c: nf_ct_frag6_kfree_frags()
   - net/netfilter/nf_conntrack_core.c: nf_conntrack_tuple_taken()
   - net/netfilter/nf_conntrack_core.c: nf_ct_invert_tuplepr()
 - remove the following unused or write-only variables:
   - net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c: nat_module_is_loaded
   - net/ipv6/netfilter/nf_conntrack_reasm.c: nf_ct_frag6_nqueues
 - remove the following unused hooks:
   - net/netfilter/nf_conntrack_core.c: nf_conntrack_destroyed()
   - net/netfilter/nf_conntrack_ftp.c: nf_nat_ftp_hook()
 - remove the following unused EXPORT_SYMBOL's:
   - nf_ct_iterate_cleanup
   - nf_ct_protos
   - nf_ct_l3protos
 
 Please review which of these changes make sense and which might conflict 
 with pending patches.

Thanks Adrian. We have a large nf_conntrack merge coming up, which
conflicts with this patch and includes new users of some of these
symbols. Please send your patch again once these changes have
been merged.

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


Re: 2.6.19-rc6-mm2: uli526x only works after reload

2006-12-01 Thread Rafael J. Wysocki
On Friday, 1 December 2006 02:20, Greg KH wrote:
 On Wed, Nov 29, 2006 at 06:18:09PM -0800, Andrew Morton wrote:
  On Thu, 30 Nov 2006 02:04:15 +0100
  Rafael J. Wysocki [EMAIL PROTECTED] wrote:
  
 
 git-netdev-all.patch
 git-netdev-all-fixup.patch
 libphy-dont-do-that.patch

Are you able to eliminate libphy-dont-do-that.patch?

 Is a broken-out version of git-netdev-all.patch available from 
 somewhere?

Nope, and my few fumbling attempts to generate the sort of patch series
which you want didn't work out too well.  One has to downgrade to
git-bisect :(

What does doesn't work mean, btw?
   
   Well, it turns out not to be 100% reproducible.  I can only reproduce it 
   after
   a soft reboot (eg. shutdown -r now).
   
   Then, while configuring network interfaces the system says the interface 
   name
   is ethxx0, but it should be eth1 (eth0 is an RTL-8139, which is not 
   used).  Now
   if I run ifconfig, it says:
   
   eth0: error fetching interface information: Device not found
   
   and that's all (normally, ifconfig would show the information for lo and 
   eth1,
   without eth0).  Moreover, 'ifconfig eth1' says:
   
   eth1: error fetching interface information: Device not found
   
   Next, I run 'rmmod uli526x' and 'modprobe uli526x' and then 'ifconfig' is
   still saying the above (about eth0), but 'ifconfig eth1' seems to work as
   it should.  However, the interface often fails to transfer anything after
   that.
  
  Lovely.  Sounds like some startup race, perhaps against userspace.
  
  Is CONFIG_PCI_MULTITHREAD_PROBE set?  (err, we meant to disable that for
  2.6.19 but forgot).
 
 No, I disabled it for 2.6.19, -mm turns it back on :)

But it's not set in my .config.

Greetings,
Rafael


-- 
You never change things by fighting the existing reality.
R. Buckminster Fuller
-
To unsubscribe from this list: send 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: [netfilter-core] [2.6 patch] remove ip{,6}_queue

2006-12-01 Thread David Miller
From: Patrick McHardy [EMAIL PROTECTED]
Date: Sat, 02 Dec 2006 00:21:54 +0100

 We really can't remove ip_queue. Many users use this, there is no binary
 compatible interface and even the compat replacement for the originally
 statically linked library doesn't work. There is also no real necessity
 to remove the code, so the feature-removal-schedule entry should be
 removed instead.
 
 Dave, please apply this patch. Thanks.

Done, 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


[git patches] net driver fixes

2006-12-01 Thread Jeff Garzik

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

to receive the following updates:

 drivers/net/Kconfig   |4 +-
 drivers/net/bonding/bond_main.c   |   63 ++---
 drivers/net/cs89x0.c  |4 +-
 drivers/net/spider_net.c  |   20 ++--
 drivers/net/spider_net.h  |8 ++-
 drivers/net/wireless/zd1211rw/zd_ieee80211.h  |2 -
 drivers/net/wireless/zd1211rw/zd_mac.c|2 -
 drivers/net/wireless/zd1211rw/zd_mac.h|4 +-
 drivers/net/wireless/zd1211rw/zd_usb.c|   26 +-
 drivers/net/wireless/zd1211rw/zd_usb.h|   14 +++---
 net/ieee80211/ieee80211_tx.c  |4 +-
 net/ieee80211/softmac/ieee80211softmac_scan.c |2 -
 12 files changed, 76 insertions(+), 77 deletions(-)

George G. Davis:
  Fix an offset error when reading the CS89x0 ADD_PORT register

James K Lewis:
  Spidernet: remove ETH_ZLEN check in earlier patch

John W. Linville:
  Revert zd1211rw: Removed unneeded packed attributes

Laurent Riffard:
  bonding: fix an oops when slave device does not provide get_stats

Linas Vepstas:
  spidernet: poor network performance

Michael Buesch:
  softmac: remove netif_tx_disable when scanning

Ralf Baechle:
  drivers/net: SAA9730: Fix build error

Ulrich Kunitz:
  zd1211rw: Fix of a locking bug

Zhu Yi:
  ieee80211: Fix kernel panic when QoS is enabled

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 6e863aa..30ae712 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1769,8 +1769,8 @@ config VIA_RHINE_NAPI
  information.
 
 config LAN_SAA9730
-   bool Philips SAA9730 Ethernet support (EXPERIMENTAL)
-   depends on NET_PCI  EXPERIMENTAL  MIPS
+   bool Philips SAA9730 Ethernet support
+   depends on NET_PCI  PCI  MIPS_ATLAS
help
  The SAA9730 is a combined multimedia and peripheral controller used
  in thin clients, Internet access terminals, and diskless
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 17a4611..488d8ed 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1336,6 +1336,13 @@ int bond_enslave(struct net_device *bond
goto err_undo_flags;
}
 
+   if (slave_dev-get_stats == NULL) {
+   printk(KERN_NOTICE DRV_NAME
+   : %s: the driver for slave device %s does not provide 
+   get_stats function, network statistics will be 
+   inaccurate.\n, bond_dev-name, slave_dev-name);
+   }
+
new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL);
if (!new_slave) {
res = -ENOMEM;
@@ -3605,33 +3612,35 @@ static struct net_device_stats *bond_get
read_lock_bh(bond-lock);
 
bond_for_each_slave(bond, slave, i) {
-   sstats = slave-dev-get_stats(slave-dev);
-
-   stats-rx_packets += sstats-rx_packets;
-   stats-rx_bytes += sstats-rx_bytes;
-   stats-rx_errors += sstats-rx_errors;
-   stats-rx_dropped += sstats-rx_dropped;
-
-   stats-tx_packets += sstats-tx_packets;
-   stats-tx_bytes += sstats-tx_bytes;
-   stats-tx_errors += sstats-tx_errors;
-   stats-tx_dropped += sstats-tx_dropped;
-
-   stats-multicast += sstats-multicast;
-   stats-collisions += sstats-collisions;
-
-   stats-rx_length_errors += sstats-rx_length_errors;
-   stats-rx_over_errors += sstats-rx_over_errors;
-   stats-rx_crc_errors += sstats-rx_crc_errors;
-   stats-rx_frame_errors += sstats-rx_frame_errors;
-   stats-rx_fifo_errors += sstats-rx_fifo_errors;
-   stats-rx_missed_errors += sstats-rx_missed_errors;
-
-   stats-tx_aborted_errors += sstats-tx_aborted_errors;
-   stats-tx_carrier_errors += sstats-tx_carrier_errors;
-   stats-tx_fifo_errors += sstats-tx_fifo_errors;
-   stats-tx_heartbeat_errors += sstats-tx_heartbeat_errors;
-   stats-tx_window_errors += sstats-tx_window_errors;
+   if (slave-dev-get_stats) {
+   sstats = slave-dev-get_stats(slave-dev);
+
+   stats-rx_packets += sstats-rx_packets;
+   stats-rx_bytes += sstats-rx_bytes;
+   stats-rx_errors += sstats-rx_errors;
+   stats-rx_dropped += sstats-rx_dropped;
+
+   stats-tx_packets += sstats-tx_packets;
+   stats-tx_bytes += sstats-tx_bytes;
+   stats-tx_errors += sstats-tx_errors;
+   stats-tx_dropped += sstats-tx_dropped;
+
+