RE: [PATCH 1/2] NET: Multiple queue network device support

2007-02-23 Thread Sreenivasa Honnur
Function map_queue returns queue_index as 0 always. There is no
support to return different queue numbers.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Kok, Auke
Sent: Friday, February 09, 2007 5:40 AM
To: David Miller; Garzik, Jeff; netdev@vger.kernel.org;
linux-kernel@vger.kernel.org
Cc: Kok, Auke; Peter Waskiewicz Jr; Brandeburg, Jesse; Kok, Auke;
Ronciak, John
Subject: [PATCH 1/2] NET: Multiple queue network device support


From: Peter Waskiewicz Jr [EMAIL PROTECTED]

Added an API and associated supporting routines for multiqueue network
devices.  This allows network devices supporting multiple TX queues to
configure each queue within the netdevice and manage each queue
independantly.  Changes to the PRIO Qdisc also allow a user to map
multiple flows to individual TX queues, taking advantage of each queue
on the device.

Signed-off-by: Peter Waskiewicz Jr [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
---

 include/linux/netdevice.h |   73 
 include/net/sch_generic.h |3 +
 net/Kconfig   |   20 
 net/core/dev.c|   51 
 net/sched/sch_generic.c   |  117
+
 net/sched/sch_prio.c  |  106
++---
 6 files changed, 364 insertions(+), 6 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index
2e37f50..c7f94a8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -106,6 +106,16 @@ struct netpoll_info;  #define MAX_HEADER
(LL_MAX_HEADER + 48)  #endif
 
+#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
+
+struct net_device_subqueue
+{
+   /* Give a lock and a flow control state for each queue */
+   unsigned long   state;
+   spinlock_t  queue_lock cacheline_aligned_in_smp;
+};
+#endif
+
 /*
  * Network device statistics. Akin to the 2.0 ether stats but
  * with byte counters.
@@ -339,6 +349,10 @@ struct net_device
 #define NETIF_F_GEN_CSUM   (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
 #define NETIF_F_ALL_CSUM   (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
 
+#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
+#define NETIF_F_MULTI_QUEUE8192/* Has multiple TX/RX queues */
+#endif
+
struct net_device   *next_sched;
 
/* Interface index. Unique device identifier*/
@@ -532,6 +546,19 @@ struct net_device
struct device   dev;
/* space for optional statistics and wireless sysfs groups */
struct attribute_group  *sysfs_groups[3];
+
+#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
+   /* To retrieve statistics per subqueue - FOR FUTURE USE */
+   struct net_device_stats* (*get_subqueue_stats)(struct net_device
*dev,
+   int
queue_index);
+
+   /* The TX queue control structures */
+   struct net_device_subqueue  *egress_subqueue;
+   int egress_subqueue_count;
+   int (*hard_start_subqueue_xmit)(struct
sk_buff *skb,
+   struct
net_device *dev,
+   int
queue_index);
+#endif /* CONFIG_NET_MULTI_QUEUE_DEVICE */
 };
 #define to_net_dev(d) container_of(d, struct net_device, dev)
 
@@ -673,6 +700,52 @@ static inline int netif_running(const struct
net_device *dev)
return test_bit(__LINK_STATE_START, dev-state);  }
 
+#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
+
+/*
+ * Routines to manage the subqueues on a device.  We only need start
+ * stop, and a check if it's stopped.  All other device management is
+ * done at the overall netdevice level.
+ * Also test the netif state if we're multi-queue at all.
+ */
+static inline void netif_start_subqueue(struct net_device *dev, int
+queue_index) {
+   clear_bit(__LINK_STATE_XOFF,
+dev-egress_subqueue[queue_index].state);
+}
+
+static inline void netif_stop_subqueue(struct net_device *dev, int
+queue_index) { #ifdef CONFIG_NETPOLL_TRAP
+   if (netpoll_trap())
+   return;
+#endif
+   set_bit(__LINK_STATE_XOFF,
dev-egress_subqueue[queue_index].state);
+}
+
+static inline int netif_subqueue_stopped(const struct net_device *dev,
+ int queue_index) {
+   return test_bit(__LINK_STATE_XOFF,
+   dev-egress_subqueue[queue_index].state);
+}
+
+static inline void netif_wake_subqueue(struct net_device *dev, int
+queue_index) { #ifdef CONFIG_NETPOLL_TRAP
+   if (netpoll_trap())
+   return;
+#endif
+   if (test_and_clear_bit(__LINK_STATE_XOFF,
+
dev-egress_subqueue[queue_index].state))
+   __netif_schedule(dev);
+}
+
+static inline int netif_is_multiqueue(const struct net_device *dev) {
+   return (!!(NETIF_F_MULTI_QUEUE  dev-features)); } #endif /* 
+CONFIG_NET_MULTI_QUEUE_DEVICE */
+
 
 /* Use this variant when it is known for 

RE: [PATCH 1/2] NET: Multiple queue network device support

2007-02-23 Thread Sreenivasa Honnur
Fucntion map_queue returns queue index as '0'. There is no support to
return different queue indexes.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Kok, Auke
Sent: Friday, February 09, 2007 5:40 AM
To: David Miller; Garzik, Jeff; netdev@vger.kernel.org;
linux-kernel@vger.kernel.org
Cc: Kok, Auke; Peter Waskiewicz Jr; Brandeburg, Jesse; Kok, Auke;
Ronciak, John
Subject: [PATCH 1/2] NET: Multiple queue network device support


From: Peter Waskiewicz Jr [EMAIL PROTECTED]

Added an API and associated supporting routines for multiqueue network
devices.  This allows network devices supporting multiple TX queues to
configure each queue within the netdevice and manage each queue
independantly.  Changes to the PRIO Qdisc also allow a user to map
multiple flows to individual TX queues, taking advantage of each queue
on the device.

Signed-off-by: Peter Waskiewicz Jr [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
---

 include/linux/netdevice.h |   73 
 include/net/sch_generic.h |3 +
 net/Kconfig   |   20 
 net/core/dev.c|   51 
 net/sched/sch_generic.c   |  117
+
 net/sched/sch_prio.c  |  106
++---
 6 files changed, 364 insertions(+), 6 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index
2e37f50..c7f94a8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -106,6 +106,16 @@ struct netpoll_info;  #define MAX_HEADER
(LL_MAX_HEADER + 48)  #endif
 
+#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
+
+struct net_device_subqueue
+{
+   /* Give a lock and a flow control state for each queue */
+   unsigned long   state;
+   spinlock_t  queue_lock cacheline_aligned_in_smp;
+};
+#endif
+
 /*
  * Network device statistics. Akin to the 2.0 ether stats but
  * with byte counters.
@@ -339,6 +349,10 @@ struct net_device
 #define NETIF_F_GEN_CSUM   (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
 #define NETIF_F_ALL_CSUM   (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
 
+#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
+#define NETIF_F_MULTI_QUEUE8192/* Has multiple TX/RX queues */
+#endif
+
struct net_device   *next_sched;
 
/* Interface index. Unique device identifier*/
@@ -532,6 +546,19 @@ struct net_device
struct device   dev;
/* space for optional statistics and wireless sysfs groups */
struct attribute_group  *sysfs_groups[3];
+
+#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
+   /* To retrieve statistics per subqueue - FOR FUTURE USE */
+   struct net_device_stats* (*get_subqueue_stats)(struct net_device
*dev,
+   int
queue_index);
+
+   /* The TX queue control structures */
+   struct net_device_subqueue  *egress_subqueue;
+   int egress_subqueue_count;
+   int (*hard_start_subqueue_xmit)(struct
sk_buff *skb,
+   struct
net_device *dev,
+   int
queue_index);
+#endif /* CONFIG_NET_MULTI_QUEUE_DEVICE */
 };
 #define to_net_dev(d) container_of(d, struct net_device, dev)
 
@@ -673,6 +700,52 @@ static inline int netif_running(const struct
net_device *dev)
return test_bit(__LINK_STATE_START, dev-state);  }
 
+#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
+
+/*
+ * Routines to manage the subqueues on a device.  We only need start
+ * stop, and a check if it's stopped.  All other device management is
+ * done at the overall netdevice level.
+ * Also test the netif state if we're multi-queue at all.
+ */
+static inline void netif_start_subqueue(struct net_device *dev, int
+queue_index) {
+   clear_bit(__LINK_STATE_XOFF,
+dev-egress_subqueue[queue_index].state);
+}
+
+static inline void netif_stop_subqueue(struct net_device *dev, int
+queue_index) { #ifdef CONFIG_NETPOLL_TRAP
+   if (netpoll_trap())
+   return;
+#endif
+   set_bit(__LINK_STATE_XOFF,
dev-egress_subqueue[queue_index].state);
+}
+
+static inline int netif_subqueue_stopped(const struct net_device *dev,
+ int queue_index) {
+   return test_bit(__LINK_STATE_XOFF,
+   dev-egress_subqueue[queue_index].state);
+}
+
+static inline void netif_wake_subqueue(struct net_device *dev, int
+queue_index) { #ifdef CONFIG_NETPOLL_TRAP
+   if (netpoll_trap())
+   return;
+#endif
+   if (test_and_clear_bit(__LINK_STATE_XOFF,
+
dev-egress_subqueue[queue_index].state))
+   __netif_schedule(dev);
+}
+
+static inline int netif_is_multiqueue(const struct net_device *dev) {
+   return (!!(NETIF_F_MULTI_QUEUE  dev-features)); } #endif /* 
+CONFIG_NET_MULTI_QUEUE_DEVICE */
+
 
 /* Use this variant when it is known for sure 

natsemi: Fix detection of vanilla natsemi cards

2007-02-23 Thread Mark Brown
Bob Tracy [EMAIL PROTECTED] reported that the addition of support
for Aculab E1/T1 cPCI carrier cards broke detection of vanilla natsemi
cards.  This patch fixes that: the problem is that the driver-specific
data in the PCI device table is an index into a second table and this
had not been updated for the vanilla cards.

This patch fixes the problem minimally.

Signed-Off-By: Mark Brown [EMAIL PROTECTED]

--- linux.orig/drivers/net/natsemi.c2007-02-23 11:13:03.0 +
+++ linux/drivers/net/natsemi.c 2007-02-23 11:12:00.0 +
@@ -260,7 +260,7 @@
 
 static const struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, 0x0020, 0x12d9, 0x000c, 0, 0, 0 },
-   { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }
+   { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
{ } /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, natsemi_pci_tbl);

-- 
You grabbed my hand and we fell into it, like a daydream - or a fever.
-
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] [TCP]: Correct reordering detection change (no FRTO case)

2007-02-23 Thread Ilpo Järvinen
The reordering detection must work also when FRTO has not been
used at all which was the original intention of mine, just the
expression of the idea was flawed.

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
---
Applies on the top of tcp-2.6 branch as you would probably have
guessed.

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index bb3f234..f6ba07f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1240,7 +1240,7 @@ tcp_sacktag_write_queue(struct sock *sk,
tp-left_out = tp-sacked_out + tp-lost_out;
 
if ((reord  tp-fackets_out)  icsk-icsk_ca_state != TCP_CA_Loss 
-   (tp-frto_highmark  after(tp-snd_una, tp-frto_highmark)))
+   (!tp-frto_highmark || after(tp-snd_una, tp-frto_highmark)))
tcp_update_reordering(sk, ((tp-fackets_out + 1) - reord), 0);
 
 #if FASTRETRANS_DEBUG  0
-- 
1.4.2


Re: [Kgdb-bugreport] [PATCH 2.6.20-rc7] 8139too KGDBoE fix

2007-02-23 Thread Mark Huth

Amit S. Kale wrote:

Hi Net Gurus,

This thread came up on kgdb-bugreport mailing list. Could you please suggest 
us what's the correct way of fixing this problem?


1. When running a kgdb on RTL8139 ethernet interface: 8139too driver prints 
too many Out-of-sync dirty pointer messages on console and gdb can't 
connect to kgdb stub. These messages can be suppressed, though it still 
results in connection failures frequently. 
  
We think this comes from calling the driver while the queue is stopped.  
Drivers should not do horrible things when hard start is called with the 
queue stopped, but unfortunately, at this time, at least some drivers 
do  explode or complain under that condition.
2. Here is how kgdb uses polling mechanism for communication to gdb.  kgdb 
calls netpoll_set_trap(1) just before entering a loop where it communicates 
to gdb. It calls netpoll_set_trap(0) after it is done and wants to resume a 
kernel. The communication to gdb goes through netpoll_poll (which calls kgdb 
rx_hook) and netpoll_send_udp functions.


3. A queue for an interface may have been stopped by it's driver by calling 
netif_stop_queue. After this if kgdb attempts to enter communication with 
gdb, it'll call netpoll_set_trap(1), after which the queue can't be started 
again. This is a potential deadlock situation. Is there a way out of this?
  
We are trying without setting the CONFIG_NETPOLL_TRAP option.  This 
option is what turns off the function of the netif_stop/wake_queue 
calls, which breaks the usual flow control mechanism used by netpoll 
transmit function.  It also prevents the netif_schedule call, which will 
puts the device on the tx softirq queue.  However, in the case where 
interupts are off and scheduling is not allowed - which would be the 
netpoll_set_trap(1) condition, the softirq will not run until netpoll is 
done and the user of netpoll returns the system to normal operation.  So 
I am unclear that allowing the schedule is a problem.  There may be some 
obscure race conditions on smp, so we are trying to analyze that part, 
but for the moment are testing with the netif_schedule call allowed in 
the event of queuing the device.
4. Is it necessary to call netpoll_set_trap(1) at all before entering gdb 
communication loop? Even if a driver stops the queue in middle of the 
communication netpoll_poll and netpoll_send_udp calls can recover from that 
by calling driver's interrupt and poll routines. Is this a valid statement?
  
netpoll_set_trap() is necessary, as it informs the netpoll code to 
respond to arp requests on behalf of the netpoll user, as well as making 
sure that skbs are freed without needing the completion queue stuff to 
run (I think)

Thanks a lot.
-Amit



On Thursday 22 February 2007 22:11, Sergei Shtylyov wrote:
  

Hello, I wrote:


Even with this patch, the packets probably get stuck somewhere in
the driver, as cross-gdb sees tail of the $g packet reply only in
reply to next packet...
  

 This wasn;t happeing on x86 probably because the register packet
should be much shorted there than on PPC...

  

 Argh! That's all because of the CONFIG_NETPOLL_TRAP that
CONFIG_KGDBOE* options select -- since the initial breakpoint enables
trapping via KGDBoE's pre_exception() handler,
netif_{stop/wake}_queue() stop to work and that causes KGDBoE to
literally flood 8139too with packets (although it can't queue up
more than 4). Looks like a general design issue to me... :-/


Well, maybe not. But many drivers are surely unprepared to their
hard_start_xmit() method being called with queue alraedy stopped and
those with small TX queue (like natsemi with which we're also having
trouble) would get flooded as well. I'm going to submit a patch to
netdev adding extra check for TX ring being full -- after/if it gets
accepted, this patch won't be needed anymore.
  

Here is what comes to my mind right away. It might need some more
polishing or cleaning up:

A potential solution will be to check the if hard_start_xmit() returns
NETDEV_TX_BUSY. In case transmit queue is busy (due to lot of threads
or queue getting full), we should wait in netpoll_send_skb(), call a
cleanup through poll() and then retry sending packet.


  This is already being done by netpoll iself. The thing is that
hard_start_xmit() doesdn't return NETDEV_TX_BUSY in those drivers. :-/
  

In addition to that we set trapped. I wonder whether it is possible that
a queue is stopped and we enter kgdb. It would be a deadlock.
-Amit


Why? Netpoll does call the driver's interrupt and NAPI handlers in
that case (until the retry count is 0).
  

Ah, got it -- since the traffic trapping (when enabled) effectively
bypasses netif_wake_queue(), a queue would never be actually woken up.
Maybe it's worth to always return 0 from netif_queue_stopped() in this
case? Or maybe the correct thing to do when trapping is to just thiddle the
__LINK_STATE_XOFF 

Re: [Kgdb-bugreport] [PATCH 2.6.20-rc7] 8139too KGDBoE fix

2007-02-23 Thread Sergei Shtylyov

Hello.

Stephen Hemminger wrote:

This thread came up on kgdb-bugreport mailing list. Could you please suggest 
us what's the correct way of fixing this problem?


1. When running a kgdb on RTL8139 ethernet interface: 8139too driver prints 
too many Out-of-sync dirty pointer messages on console and gdb can't 
connect to kgdb stub. These messages can be suppressed, though it still 
results in connection failures frequently. 


We think this comes from calling the driver while the queue is stopped.  
Drivers should not do horrible things when hard start is called with the 
queue stopped, but unfortunately, at this time, at least some drivers 
do  explode or complain under that condition.



The kernel is built on a set of assumptions about calling context. Your
out of tree code is violating one of them. Why not check for stopped queue
and do some action to try and clear it, that is what netconsole does.


   The queue can't be stopped when the netpoll traffic trapping is enabled 
(cause this effectively bypasses queue control), So, the stopped queue 
indoication doesn't work also -- *that* is the problem. It's not at all 
specific to KGBoE -- only to traffic trapping.



You can't ask a device to send a packet when it has no resources.


   When traffic trapping is enabled, and driver stops the queue, the 
__LINK_STATE_XOFF flag does *not* get set, so netif_queue_stopped() resturns 
*zero*.  What may be done in this situation?


WBR, Sergei
-
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: [Kgdb-bugreport] [PATCH 2.6.20-rc7] 8139too KGDBoE fix

2007-02-23 Thread Stephen Hemminger
On Fri, 23 Feb 2007 22:16:59 +0300
Sergei Shtylyov [EMAIL PROTECTED] wrote:

 Hello.
 
 Stephen Hemminger wrote:
 
 This thread came up on kgdb-bugreport mailing list. Could you please 
 suggest 
 us what's the correct way of fixing this problem?
 
 1. When running a kgdb on RTL8139 ethernet interface: 8139too driver 
 prints 
 too many Out-of-sync dirty pointer messages on console and gdb can't 
 connect to kgdb stub. These messages can be suppressed, though it still 
 results in connection failures frequently. 
 
 We think this comes from calling the driver while the queue is stopped.  
 Drivers should not do horrible things when hard start is called with the 
 queue stopped, but unfortunately, at this time, at least some drivers 
 do  explode or complain under that condition.
 
 The kernel is built on a set of assumptions about calling context. Your
 out of tree code is violating one of them. Why not check for stopped queue
 and do some action to try and clear it, that is what netconsole does.
 
 The queue can't be stopped when the netpoll traffic trapping is enabled 
 (cause this effectively bypasses queue control), So, the stopped queue 
 indoication doesn't work also -- *that* is the problem. It's not at all 
 specific to KGBoE -- only to traffic trapping.
 
  You can't ask a device to send a packet when it has no resources.
 
 When traffic trapping is enabled, and driver stops the queue, the 
 __LINK_STATE_XOFF flag does *not* get set, so netif_queue_stopped() resturns 
 *zero*.  What may be done in this situation?

Read netpoll_send_skb()

int status = NETDEV_TX_BUSY;
...
if (netif_tx_trylock(dev)) {
/* try until next clock tick */
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
tries  0; --tries) {
if (!netif_queue_stopped(dev))
status = dev-hard_start_xmit(skb, dev);

if (status == NETDEV_TX_OK)
break;

/* tickle device maybe there is some cleanup */
netpoll_poll(np);

udelay(USEC_PER_POLL);
}
netif_tx_unlock(dev);

netpoll_poll() allows device to try and cleanup transmit resources.

-- 
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: [Kgdb-bugreport] [PATCH 2.6.20-rc7] 8139too KGDBoE fix

2007-02-23 Thread Sergei Shtylyov

Stephen Hemminger wrote:

This thread came up on kgdb-bugreport mailing list. Could you please suggest 
us what's the correct way of fixing this problem?


1. When running a kgdb on RTL8139 ethernet interface: 8139too driver prints 
too many Out-of-sync dirty pointer messages on console and gdb can't 
connect to kgdb stub. These messages can be suppressed, though it still 
results in connection failures frequently. 


We think this comes from calling the driver while the queue is stopped.  
Drivers should not do horrible things when hard start is called with the 
queue stopped, but unfortunately, at this time, at least some drivers 
do  explode or complain under that condition.



The kernel is built on a set of assumptions about calling context. Your
out of tree code is violating one of them. Why not check for stopped queue
and do some action to try and clear it, that is what netconsole does.


  The queue can't be stopped when the netpoll traffic trapping is enabled 
(cause this effectively bypasses queue control), So, the stopped queue 
indoication doesn't work also -- *that* is the problem. It's not at all 
specific to KGBoE -- only to traffic trapping.



You can't ask a device to send a packet when it has no resources.


   When traffic trapping is enabled, and driver stops the queue, the 
__LINK_STATE_XOFF flag does *not* get set, so netif_queue_stopped() resturns 
*zero*.  What may be done in this situation?



Read netpoll_send_skb()



int status = NETDEV_TX_BUSY;
...
if (netif_tx_trylock(dev)) {
/* try until next clock tick */
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
tries  0; --tries) {
if (!netif_queue_stopped(dev))
status = dev-hard_start_xmit(skb, dev);

if (status == NETDEV_TX_OK)
break;

/* tickle device maybe there is some cleanup */
netpoll_poll(np);

udelay(USEC_PER_POLL);
}
netif_tx_unlock(dev);



netpoll_poll() allows device to try and cleanup transmit resources.


   Read linux/netdevice.h:

static inline void netif_stop_queue(struct net_device *dev)
{
#ifdef CONFIG_NETPOLL_TRAP
if (netpoll_trap())
return;
#endif
set_bit(__LINK_STATE_XOFF, dev-state);
}

static inline int netif_queue_stopped(const struct net_device *dev)
{
return test_bit(__LINK_STATE_XOFF, dev-state);
}

   When the driver calls netif_stop_queue() having his TX queue filled to the 
brim (4 buffers in case of 8139too) and netpoll_trap() returns 1, what will 
happen?


WBR, Sergei
-
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] forcedeth: disable msix

2007-02-23 Thread Andy Gospodarek
On Tue, Feb 20, 2007 at 03:34:40AM -0500, Ayaz Abdulla wrote:
 There seems to be an issue when both MSI-X is enabled and NAPI is 
 configured. This patch disables MSI-X until the issue is root caused.
 
 Signed-Off-By: Ayaz Abdulla [EMAIL PROTECTED]
 

 --- orig/drivers/net/forcedeth.c  2007-02-20 03:29:04.0 -0500
 +++ new/drivers/net/forcedeth.c   2007-02-20 03:29:33.0 -0500
 @@ -839,7 +839,7 @@
   NV_MSIX_INT_DISABLED,
   NV_MSIX_INT_ENABLED
  };
 -static int msix = NV_MSIX_INT_ENABLED;
 +static int msix = NV_MSIX_INT_DISABLED;
  
  /*
   * DMA 64bit


Ayaz,

Can you elaborate on symptoms that would make one want to use this
patch?

-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


[PATCH 3/2] myri10ge: fix copyright and license

2007-02-23 Thread Brice Goglin
Fix copyright and license (regents should not have ever been used).

Signed-off-by: Brice Goglin [EMAIL PROTECTED]
---
 drivers/net/myri10ge/myri10ge.c |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

Index: linux-rc/drivers/net/myri10ge/myri10ge.c
===
--- linux-rc.orig/drivers/net/myri10ge/myri10ge.c   2007-02-21 
18:06:49.0 +0100
+++ linux-rc/drivers/net/myri10ge/myri10ge.c2007-02-23 20:13:08.0 
+0100
@@ -1,7 +1,7 @@
 /*
  * myri10ge.c: Myricom Myri-10G Ethernet driver.
  *
- * Copyright (C) 2005, 2006 Myricom, Inc.
+ * Copyright (C) 2005 - 2007 Myricom, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -16,17 +16,17 @@
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  *
  *
  * If the eeprom on your board is not recent enough, you will need to get a


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


Re: [PATCH 0/2] myri10ge updates

2007-02-23 Thread Brice Goglin
Brice Goglin wrote:
 Hi Jeff,

 No big change in myri10ge these days, mainly just a workaround for
 boards that were shipped with a bug in their firmware (patch #1, for
 2.6.21).

 Since things are pretty calm here, I am also resending the Large Receive
 Offload patch for inclusion (patch #2, maybe only for 2.6.22?). I didn't
 hear of anybody working on a generic LRO for the core stack, while our
 driver performance suffered from missing LRO for several months already.
 The code has been intensively tested by multiple customers.

 Thanks,
 Brice
   

I just got a last-minute copyright/license fix. I sent it as patch #3.
Please apply this one for 2.6.21.

thanks,
Brice

-
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/2] skge: fix transmitter flow control

2007-02-23 Thread Stephen Hemminger
It looks like the skge driver inherited another bug from the sk98lin code.
If I send from 1000mbit port to a machine on 100mbit port, the switch should
be doing hardware flow control, but no pause frames show up in the statistics.

This is the analog of the recent sky2 fixes. The device needs to listen
for multicast pause frames and then not discard them.

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

---
 drivers/net/skge.c |   43 ---
 drivers/net/skge.h |3 +--
 2 files changed, 33 insertions(+), 13 deletions(-)

--- sky2-dev.orig/drivers/net/skge.c2007-02-23 13:17:25.0 -0800
+++ sky2-dev/drivers/net/skge.c 2007-02-23 13:53:05.0 -0800
@@ -2767,6 +2767,17 @@
return err;
 }
 
+static const u8 pause_mc_addr[ETH_ALEN] = { 0x1, 0x80, 0xc2, 0x0, 0x0, 0x1 };
+
+static void genesis_add_filter(u8 filter[8], const u8 *addr)
+{
+   u32 crc, bit;
+
+   crc = ether_crc_le(ETH_ALEN, addr);
+   bit = ~crc  0x3f;
+   filter[bit/8] |= 1  (bit%8);
+}
+
 static void genesis_set_multicast(struct net_device *dev)
 {
struct skge_port *skge = netdev_priv(dev);
@@ -2788,24 +2799,33 @@
memset(filter, 0xff, sizeof(filter));
else {
memset(filter, 0, sizeof(filter));
-   for (i = 0; list  i  count; i++, list = list-next) {
-   u32 crc, bit;
-   crc = ether_crc_le(ETH_ALEN, list-dmi_addr);
-   bit = ~crc  0x3f;
-   filter[bit/8] |= 1  (bit%8);
-   }
+
+   if (skge-flow_status == FLOW_STAT_REM_SEND
+   || skge-flow_status == FLOW_STAT_SYMMETRIC)
+   genesis_add_filter(filter, pause_mc_addr);
+
+   for (i = 0; list  i  count; i++, list = list-next)
+   genesis_add_filter(filter, list-dmi_addr);
}
 
xm_write32(hw, port, XM_MODE, mode);
xm_outhash(hw, port, XM_HSM, filter);
 }
 
+static void yukon_add_filter(u8 filter[8], const u8 *addr)
+{
+u32 bit = ether_crc(ETH_ALEN, addr)  0x3f;
+filter[bit/8] |= 1  (bit%8);
+}
+
 static void yukon_set_multicast(struct net_device *dev)
 {
struct skge_port *skge = netdev_priv(dev);
struct skge_hw *hw = skge-hw;
int port = skge-port;
struct dev_mc_list *list = dev-mc_list;
+   int rx_pause = (skge-flow_status == FLOW_STAT_REM_SEND
+   || skge-flow_status == FLOW_STAT_SYMMETRIC);
u16 reg;
u8 filter[8];
 
@@ -2818,16 +2838,17 @@
reg = ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
else if (dev-flags  IFF_ALLMULTI) /* all multicast */
memset(filter, 0xff, sizeof(filter));
-   else if (dev-mc_count == 0)/* no multicast */
+   else if (dev-mc_count == 0  !rx_pause)/* no multicast */
reg = ~GM_RXCR_MCF_ENA;
else {
int i;
reg |= GM_RXCR_MCF_ENA;
 
-   for (i = 0; list  i  dev-mc_count; i++, list = list-next) {
-   u32 bit = ether_crc(ETH_ALEN, list-dmi_addr)  0x3f;
-   filter[bit/8] |= 1  (bit%8);
-   }
+   if (rx_pause)
+   yukon_add_filter(filter, pause_mc_addr);
+
+   for (i = 0; list  i  dev-mc_count; i++, list = list-next)
+   yukon_add_filter(filter, list-dmi_addr);
}
 
 
--- sky2-dev.orig/drivers/net/skge.h2007-02-23 13:30:36.0 -0800
+++ sky2-dev/drivers/net/skge.h 2007-02-23 13:31:11.0 -0800
@@ -1849,8 +1849,7 @@
  GMR_FS_JABBER,
 /* Rx GMAC FIFO Flush Mask (default) */
RX_FF_FL_DEF_MSK = GMR_FS_CRC_ERR | GMR_FS_RX_FF_OV |GMR_FS_MII_ERR |
-  GMR_FS_BAD_FC | GMR_FS_GOOD_FC | GMR_FS_UN_SIZE |
-  GMR_FS_JABBER,
+  GMR_FS_BAD_FC |  GMR_FS_UN_SIZE | GMR_FS_JABBER,
 };
 
 /* RX_GMF_CTRL_T   32 bit  Rx GMAC FIFO Control/Test */
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] skge: comma consistency

2007-02-23 Thread Stephen Hemminger
Use comma's consistently.

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

--- sky2-dev.orig/drivers/net/skge.c2007-02-23 13:53:25.0 -0800
+++ sky2-dev/drivers/net/skge.c 2007-02-23 13:53:41.0 -0800
@@ -77,13 +77,13 @@
{ PCI_DEVICE(PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B) },
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) },
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) },
-   { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), },
+   { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T) },
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) },/* DGE-530T */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */
{ PCI_DEVICE(PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD) },
{ PCI_DEVICE(PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064) },
-   { PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0015, },
+   { PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0015 },
{ 0 }
 };
 MODULE_DEVICE_TABLE(pci, skge_id_table);
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] r8169: more alignment for the 0x8168

2007-02-23 Thread Francois Romieu
Mike Isely [EMAIL PROTECTED] :
[...]
 Obviously I have an interest in any change here not breaking the NIC on 
 my system.  So please let me know if/when you'd like me to test drive a 
 candidate fix that keeps everyone happy...

The experimental r8169 patch of the day against 2.6.21-rc1 is available at:
http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.21-rc1/

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


[PATCH 4/6] sky2: more stats

2007-02-23 Thread Stephen Hemminger
This is a simple enhancement to dump more device statistics with ethtool.

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

---
 drivers/net/sky2.c |   27 ++-
 1 file changed, 22 insertions(+), 5 deletions(-)

--- linux-2.6.16.y.orig/drivers/net/sky2.c  2007-02-23 14:45:36.0 
-0800
+++ linux-2.6.16.y/drivers/net/sky2.c   2007-02-23 14:45:39.0 -0800
@@ -2542,17 +2542,34 @@
{ rx_unicast,GM_RXF_UC_OK },
{ tx_mac_pause,  GM_TXF_MPAUSE },
{ rx_mac_pause,  GM_RXF_MPAUSE },
-   { collisions,GM_TXF_SNG_COL },
+   { collisions,GM_TXF_COL },
{ late_collision,GM_TXF_LAT_COL },
{ aborted,   GM_TXF_ABO_COL },
+   { single_collisions, GM_TXF_SNG_COL },
{ multi_collisions, GM_TXF_MUL_COL },
-   { fifo_underrun, GM_TXE_FIFO_UR },
-   { fifo_overflow, GM_RXE_FIFO_OV },
-   { rx_toolong,GM_RXF_LNG_ERR },
-   { rx_jabber, GM_RXF_JAB_PKT },
+
+   { rx_short,  GM_RXF_SHT },
{ rx_runt,   GM_RXE_FRAG },
+   { rx_64_byte_packets, GM_RXF_64B },
+   { rx_65_to_127_byte_packets, GM_RXF_127B },
+   { rx_128_to_255_byte_packets, GM_RXF_255B },
+   { rx_256_to_511_byte_packets, GM_RXF_511B },
+   { rx_512_to_1023_byte_packets, GM_RXF_1023B },
+   { rx_1024_to_1518_byte_packets, GM_RXF_1518B },
+   { rx_1518_to_max_byte_packets, GM_RXF_MAX_SZ },
{ rx_too_long,   GM_RXF_LNG_ERR },
+   { rx_fifo_overflow, GM_RXE_FIFO_OV },
+   { rx_jabber, GM_RXF_JAB_PKT },
{ rx_fcs_error,   GM_RXF_FCS_ERR },
+
+   { tx_64_byte_packets, GM_TXF_64B },
+   { tx_65_to_127_byte_packets, GM_TXF_127B },
+   { tx_128_to_255_byte_packets, GM_TXF_255B },
+   { tx_256_to_511_byte_packets, GM_TXF_511B },
+   { tx_512_to_1023_byte_packets, GM_TXF_1023B },
+   { tx_1024_to_1518_byte_packets, GM_TXF_1518B },
+   { tx_1519_to_max_byte_packets, GM_TXF_MAX_SZ },
+   { tx_fifo_underrun, GM_TXE_FIFO_UR },
 };
 
 static u32 sky2_get_rx_csum(struct net_device *dev)

--
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 6/6] sky2: email and version change.

2007-02-23 Thread Stephen Hemminger
Put in new email address.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
---
 drivers/net/sky2.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.16.y.orig/drivers/net/sky2.c  2007-02-23 14:45:42.0 
-0800
+++ linux-2.6.16.y/drivers/net/sky2.c   2007-02-23 14:45:44.0 -0800
@@ -6,7 +6,7 @@
  * of the original driver such as link fail-over and link management because
  * those should be done at higher levels.
  *
- * Copyright (C) 2005 Stephen Hemminger [EMAIL PROTECTED]
+ * Copyright (C) 2005 Stephen Hemminger [EMAIL PROTECTED]
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@
 #include sky2.h
 
 #define DRV_NAME   sky2
-#define DRV_VERSION0.15
+#define DRV_VERSION0.15.1
 #define PFXDRV_NAME  
 
 /*
@@ -3481,6 +3481,6 @@
 module_exit(sky2_cleanup_module);
 
 MODULE_DESCRIPTION(Marvell Yukon 2 Gigabit Ethernet driver);
-MODULE_AUTHOR(Stephen Hemminger [EMAIL PROTECTED]);
+MODULE_AUTHOR(Stephen Hemminger [EMAIL PROTECTED]);
 MODULE_LICENSE(GPL);
 MODULE_VERSION(DRV_VERSION);

--
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/6] sky2: allow multicast pause frames

2007-02-23 Thread Stephen Hemminger
The 802 standard allows pause frames to be either unicast or multicast.
Switches seem to send unicast frames, but on a direct link, other boards send
multicast pause.  Unless the filter bit is set, these pause frames get
dropped.

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

---
 drivers/net/sky2.c |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

--- linux-2.6.16.y.orig/drivers/net/sky2.c  2007-02-23 14:44:52.0 
-0800
+++ linux-2.6.16.y/drivers/net/sky2.c   2007-02-23 14:44:54.0 -0800
@@ -2686,6 +2686,14 @@
return 0;
 }
 
+static void inline sky2_add_filter(u8 filter[8], const u8 *addr)
+{
+   u32 bit;
+
+   bit = ether_crc(ETH_ALEN, addr)  63;
+   filter[bit  3] |= 1  (bit  7);
+}
+
 static void sky2_set_multicast(struct net_device *dev)
 {
struct sky2_port *sky2 = netdev_priv(dev);
@@ -2694,6 +2702,7 @@
struct dev_mc_list *list = dev-mc_list;
u16 reg;
u8 filter[8];
+   static const u8 pause_mc_addr[ETH_ALEN] = { 0x1, 0x80, 0xc2, 0x0, 0x0, 
0x1 };
 
memset(filter, 0, sizeof(filter));
 
@@ -2704,16 +2713,17 @@
reg = ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
else if ((dev-flags  IFF_ALLMULTI) || dev-mc_count  16) /* all 
multicast */
memset(filter, 0xff, sizeof(filter));
-   else if (dev-mc_count == 0)/* no multicast */
+   else if (dev-mc_count == 0  !sky2-rx_pause) /* no multicast */
reg = ~GM_RXCR_MCF_ENA;
else {
int i;
reg |= GM_RXCR_MCF_ENA;
 
-   for (i = 0; list  i  dev-mc_count; i++, list = list-next) {
-   u32 bit = ether_crc(ETH_ALEN, list-dmi_addr)  0x3f;
-   filter[bit / 8] |= 1  (bit % 8);
-   }
+   if (sky2-rx_pause)
+   sky2_add_filter(filter, pause_mc_addr);
+
+   for (i = 0; list  i  dev-mc_count; i++, list = list-next)
+   sky2_add_filter(filter, list-dmi_addr);
}
 
gma_write16(hw, port, GM_MC_ADDR_H1,

--
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/6] sky2: fix for use on big endian

2007-02-23 Thread Stephen Hemminger
Ben added this for 2.6.18, it allows sky2 to run on big endian.

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

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

--- linux-2.6.16.y.orig/drivers/net/sky2.c  2007-02-23 14:45:34.0 
-0800
+++ linux-2.6.16.y/drivers/net/sky2.c   2007-02-23 14:45:36.0 -0800
@@ -3254,12 +3254,13 @@
spin_lock_init(hw-hw_lock);
 
 #ifdef __BIG_ENDIAN
-   /* byte swap descriptors in hardware */
+   /* The sk98lin vendor driver uses hardware byte swapping but
+* this driver uses software swapping.
+*/
{
u32 reg;
-
reg = sky2_pci_read32(hw, PCI_DEV_REG2);
-   reg |= PCI_REV_DESC;
+   reg = ~PCI_REV_DESC;
sky2_pci_write32(hw, PCI_DEV_REG2, reg);
}
 #endif

--
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 5/6] sky2: add more pci ids

2007-02-23 Thread Stephen Hemminger
Update the pci device id table to match 2.6.20 (except for new 88e807x
that is still experimental).

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

---
 drivers/net/sky2.c |   48 +---
 1 file changed, 29 insertions(+), 19 deletions(-)

--- linux-2.6.16.y.orig/drivers/net/sky2.c  2007-02-23 14:45:39.0 
-0800
+++ linux-2.6.16.y/drivers/net/sky2.c   2007-02-23 14:45:42.0 -0800
@@ -97,25 +97,35 @@
 MODULE_PARM_DESC(copybreak, Receive copy threshold);
 
 static const struct pci_device_id sky2_id_table[] = {
-   { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
-   { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
-   { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) },
-   { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4343) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4344) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4345) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4346) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4347) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4350) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4351) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4362) },
-   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4363) },
+   { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */
+   { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */
+   { 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_DLINK, 0x4B03) },/* DGE-550T */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) }, /* 88E8021 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) }, /* 88E8022 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) }, /* 88E8061 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4343) }, /* 88E8062 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4344) }, /* 88E8021 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4345) }, /* 88E8022 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4346) }, /* 88E8061 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4347) }, /* 88E8062 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4350) }, /* 88E8035 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4351) }, /* 88E8036 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, /* 88E8038 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, /* 88E8052 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4362) }, /* 88E8053 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4363) }, /* 88E8055 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4364) }, /* 88E8056 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4366) }, /* 88EC036 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4367) }, /* 88EC032 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4368) }, /* 88EC034 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */
+   { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */
{ 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


[PATCH 0/6] more sky2 patches for 2.6.16.42-rc1

2007-02-23 Thread Stephen Hemminger
More backport of sky2 stuff.
* [bugfix] ram buffer setup
* [bugfix] listen to pause packets
* [bugfix] big endian

Optional:
* add more statistics (add entries to table)
* add more pci-ids for newer boards
* update version and email address

--
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: [PATCH] [TCP]: Correct reordering detection change (no FRTO case)

2007-02-23 Thread David Miller
From: Ilpo_Järvinen [EMAIL PROTECTED]
Date: Fri, 23 Feb 2007 18:09:10 +0200 (EET)

 The reordering detection must work also when FRTO has not been
 used at all which was the original intention of mine, just the
 expression of the idea was flawed.
 
 Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]

Applied, thank you.

I was specifically looking for logic errors like this, where
non-FRTO was unintentionally changed, but I missed this one.
Good thing you caught it :)
-
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


Is the TCP-code threaded?

2007-02-23 Thread Kristian Evensen

Hello,

I have been looking quite deeply into the TCP-code, but there is one 
thing I simply dont manage to understand. Can the code process more than 
one skb on a socket at the time, or is it strictly one and one?


E.g say that you are going to send something (an skb), and you recieve 
an ack at the same time. Will the kernel finish whatever of the two 
comes first (say, finish sending) or can it, in the middle of treating 
the new packet to send, do a switch and process the ack?


Thanks,
Kristian
-
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: natsemi: Fix detection of vanilla natsemi cards

2007-02-23 Thread Bob Tracy
Mark Brown wrote:
 (Re: vanilla natsemi card detection problem)
 This patch fixes the problem minimally.
 
 Signed-Off-By: Mark Brown [EMAIL PROTECTED]
 
 --- linux.orig/drivers/net/natsemi.c  2007-02-23 11:13:03.0 +
 +++ linux/drivers/net/natsemi.c   2007-02-23 11:12:00.0 +
 @@ -260,7 +260,7 @@
  
  static const struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
   { PCI_VENDOR_ID_NS, 0x0020, 0x12d9, 0x000c, 0, 0, 0 },
 - { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }
 + { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
   { } /* terminate list */
  };
  MODULE_DEVICE_TABLE(pci, natsemi_pci_tbl);
 

ACK except for a missing comma at the end of the line being replaced,
which prevents the patch from applying cleanly.  Otherwise, this fixes
the problem I was having.  Thanks!

-- 
---
Bob Tracy   WTO + WIPO = DMCA? http://www.anti-dmca.org
[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: natsemi: Fix detection of vanilla natsemi cards

2007-02-23 Thread Mark Brown
On Fri, Feb 23, 2007 at 07:47:40AM -0600, Bob Tracy wrote:

 ACK except for a missing comma at the end of the line being replaced,
 which prevents the patch from applying cleanly.  Otherwise, this fixes
 the problem I was having.  Thanks!

Aargh.

--- linux.orig/drivers/net/natsemi.c2007-02-23 11:13:03.0 +
+++ linux/drivers/net/natsemi.c 2007-02-23 11:12:00.0 +
@@ -260,7 +260,7 @@
 
 static const struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, 0x0020, 0x12d9, 0x000c, 0, 0, 0 },
-   { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+   { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
{ } /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, natsemi_pci_tbl);

-- 
You grabbed my hand and we fell into it, like a daydream - or a fever.
-
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] ehea: Optional TX/RX path optimized for SMP

2007-02-23 Thread Jan-Bernd Themann
Hi!

This patch introduces an optional alternative receive processing
functionality (enabled via module load parameter). The ehea adapter
can sort TCP traffic to multiple receive queues to be processed by
the driver in parallel on multiple CPUs. The hardware always puts
packets for an individual tcp stream on the same queue. As the
current NAPI interface does not allow to handle parallel receive
threads for a single adapter (processing on multiple CPUs in parallel)
this patch uses tasklets with a simple fairness algorithm instead. 
On the send side we also take advantage of ehea's multiple send queue
capabilites. A simple hash function in combination with the LL_TX
attribute allows to process tx-packets on multiple CPUs on different
queues. The hash function is needed to guarantee proper TCP packet
ordering. This alternative packet processing functionality leads to 
significant performance improvements with ehea. 

Are there any concerns about this approach?

Regards,
Jan-Bernd

Signed-off-by: Jan-Bernd Themann [EMAIL PROTECTED]
---



diff -Nurp -X dontdiff linux-2.6.21-rc1/drivers/net/ehea/ehea.h 
patched_kernel/drivers/net/ehea/ehea.h
--- linux-2.6.21-rc1/drivers/net/ehea/ehea.h2007-02-23 15:40:42.0 
+0100
+++ patched_kernel/drivers/net/ehea/ehea.h  2007-02-23 16:17:37.0 
+0100
@@ -39,7 +39,7 @@
 #include asm/io.h
 
 #define DRV_NAME   ehea
-#define DRV_VERSIONEHEA_0048
+#define DRV_VERSIONEHEA_0049
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
@@ -375,8 +375,12 @@ struct ehea_port_res {
struct tasklet_struct send_comp_task;
spinlock_t recv_lock;
struct port_state p_state;
+   struct tasklet_struct recv_task;
u64 rx_packets;
u32 poll_counter;
+   u32 spoll_counter;
+   u32 rtcount;
+   u32 stcount;
 };
 
 
@@ -416,7 +420,9 @@ struct ehea_port {
char int_aff_name[EHEA_IRQ_NAME_SIZE];
int allmulti;/* Indicates IFF_ALLMULTI state */
int promisc; /* Indicates IFF_PROMISC state */
+   int num_tx_qps;
int num_add_tx_qps;
+   int num_mcs;
int resets;
u64 mac_addr;
u32 logical_port_id;
diff -Nurp -X dontdiff linux-2.6.21-rc1/drivers/net/ehea/ehea_main.c 
patched_kernel/drivers/net/ehea/ehea_main.c
--- linux-2.6.21-rc1/drivers/net/ehea/ehea_main.c   2007-02-23 
15:40:42.0 +0100
+++ patched_kernel/drivers/net/ehea/ehea_main.c 2007-02-23 16:17:42.0 
+0100
@@ -51,12 +51,14 @@ static int rq1_entries = EHEA_DEF_ENTRIE
 static int rq2_entries = EHEA_DEF_ENTRIES_RQ2;
 static int rq3_entries = EHEA_DEF_ENTRIES_RQ3;
 static int sq_entries = EHEA_DEF_ENTRIES_SQ;
+static int use_mcs = 0;
 
 module_param(msg_level, int, 0);
 module_param(rq1_entries, int, 0);
 module_param(rq2_entries, int, 0);
 module_param(rq3_entries, int, 0);
 module_param(sq_entries, int, 0);
+module_param(use_mcs, int, 0);
 
 MODULE_PARM_DESC(msg_level, msg_level);
 MODULE_PARM_DESC(rq3_entries, Number of entries for Receive Queue 3 
@@ -71,6 +73,8 @@ MODULE_PARM_DESC(rq1_entries, Number of
 MODULE_PARM_DESC(sq_entries,  Number of entries for the Send Queue  
 [2^x - 1], x = [6..14]. Default = 
 __MODULE_STRING(EHEA_DEF_ENTRIES_SQ) ));
+MODULE_PARM_DESC(use_mcs,  0:NAPI, 1:MCS, Default = 0 );
+
 
 void ehea_dump(void *adr, int len, char *msg) {
int x;
@@ -345,10 +349,12 @@ static int ehea_treat_poll_error(struct 
return 0;
 }
 
-static int ehea_poll(struct net_device *dev, int *budget)
+static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev,
+   struct ehea_port_res *pr,
+   int max_packets,
+   int *packet_cnt)
 {
-   struct ehea_port *port = netdev_priv(dev);
-   struct ehea_port_res *pr = port-port_res[0];
+   struct ehea_port *port = pr-port;
struct ehea_qp *qp = pr-qp;
struct ehea_cqe *cqe;
struct sk_buff *skb;
@@ -359,14 +365,12 @@ static int ehea_poll(struct net_device *
int skb_arr_rq2_len = pr-rq2_skba.len;
int skb_arr_rq3_len = pr-rq3_skba.len;
int processed, processed_rq1, processed_rq2, processed_rq3;
-   int wqe_index, last_wqe_index, rq, intreq, my_quota, port_reset;
+   int wqe_index, last_wqe_index, rq, my_quota, port_reset;
 
processed = processed_rq1 = processed_rq2 = processed_rq3 = 0;
last_wqe_index = 0;
-   my_quota = min(*budget, dev-quota);
-   my_quota = min(my_quota, EHEA_POLL_MAX_RWQE);
+   my_quota = max_packets;
 
-   /* rq0 is low latency RQ */
cqe = ehea_poll_rq1(qp, wqe_index);
while ((my_quota  0)  cqe) {
ehea_inc_rq1(qp);
@@ -386,6 +390,7 @@ static int ehea_poll(struct net_device *
if (unlikely(!skb)) {
  

Re: [PATCH] ehea: Optional TX/RX path optimized for SMP

2007-02-23 Thread Roland Dreier
  This patch introduces an optional alternative receive processing
  functionality (enabled via module load parameter). The ehea adapter
  can sort TCP traffic to multiple receive queues to be processed by
  the driver in parallel on multiple CPUs. The hardware always puts
  packets for an individual tcp stream on the same queue. As the
  current NAPI interface does not allow to handle parallel receive
  threads for a single adapter (processing on multiple CPUs in parallel)
  this patch uses tasklets with a simple fairness algorithm instead. 
  On the send side we also take advantage of ehea's multiple send queue
  capabilites. A simple hash function in combination with the LL_TX
  attribute allows to process tx-packets on multiple CPUs on different
  queues. The hash function is needed to guarantee proper TCP packet
  ordering. This alternative packet processing functionality leads to 
  significant performance improvements with ehea. 

Why make this a module option that the user has to set?  Are there any
circumstances when someone wouldn't want significant performance
improvements?  If this approach is just better, then it should just
replace the old code.

Also, as far as the approach of using tasklets, I think it would be
better to use the fake netdev approach to continue to use NAPI.
Basically you create a pseudo-netdev for each receive queue and have
NAPI handle the polling for you -- you could look for
drivers/net/cxgb3 for an example of this.

 - R.
-
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: [tipc-discussion] [RFC: 2.6 patch] net/tipc/: possible cleanups

2007-02-23 Thread Adrian Bunk
On Thu, Jan 25, 2007 at 04:08:08PM +, Jon Maloy wrote:
 Adrian Bunk wrote:
 
 This patch contains the following possible cleanups:
 - make needlessly global functions static
 - #if 0 unused functions
  
 
 Thanks. I think most of those were due for our next release, anyway. But 
 we'll
 get it in, one way or another. 
 
 - remove all EXPORT_SYMBOL's
 
 My impression is that most of this might have users that are not yet 
 submitted for inclusion in the kernel - one year after TIPC was merged.
  
 
 Not quite. The exported symbols belong to a public API for driver 
 programmers.
 We know about several users of this API, and there will be more, but I 
 don't think
 any of them are aspiring to have their code be included in the kernel.
...

Why not?

The goal is to get as many drivers as possible included in the kernel.

cu
Adrian

-- 

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

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


RE: [PATCH 1/2] NET: Multiple queue network device support

2007-02-23 Thread Waskiewicz Jr, Peter P
map_queue will always return 0 in the pfifo_fast Qdisc.  This is because
pfifo_fast is the default scheduler when a device is brought up.  I
didn't want to make any assumptions about a device's functionality, so
using queue 0 seems the least dangerous.

However, in the prio qdisc, there is a small problem with the queue to
band assignment logic.  If you have the same number of bands as queues
(e.g. 4 prio bands and 4 Tx queues), then you will have all bands
assigned to queue 0.  I have a fix for that, which I plan to send when I
finish up a documentation piece for this patch's repost.

Thanks for the feedback,

PJ Waskiewicz

 -Original Message-
 From: Sreenivasa Honnur [mailto:[EMAIL PROTECTED] 
 Sent: Friday, February 23, 2007 1:01 AM
 To: Kok, Auke-jan H; David Miller; Garzik, Jeff; 
 netdev@vger.kernel.org; linux-kernel@vger.kernel.org
 Cc: Waskiewicz Jr, Peter P; Brandeburg, Jesse; Kok, Auke; 
 Ronciak, John
 Subject: RE: [PATCH 1/2] NET: Multiple queue network device support
 
 Fucntion map_queue returns queue index as '0'. There is no 
 support to return different queue indexes.
 
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]
 On Behalf Of Kok, Auke
 Sent: Friday, February 09, 2007 5:40 AM
 To: David Miller; Garzik, Jeff; netdev@vger.kernel.org; 
 linux-kernel@vger.kernel.org
 Cc: Kok, Auke; Peter Waskiewicz Jr; Brandeburg, Jesse; Kok, 
 Auke; Ronciak, John
 Subject: [PATCH 1/2] NET: Multiple queue network device support
 
 
 From: Peter Waskiewicz Jr [EMAIL PROTECTED]
 
 Added an API and associated supporting routines for 
 multiqueue network devices.  This allows network devices 
 supporting multiple TX queues to configure each queue within 
 the netdevice and manage each queue independantly.  Changes 
 to the PRIO Qdisc also allow a user to map multiple flows to 
 individual TX queues, taking advantage of each queue on the device.
 
 Signed-off-by: Peter Waskiewicz Jr [EMAIL PROTECTED]
 Signed-off-by: Auke Kok [EMAIL PROTECTED]
 ---
 
  include/linux/netdevice.h |   73 
  include/net/sch_generic.h |3 +
  net/Kconfig   |   20 
  net/core/dev.c|   51 
  net/sched/sch_generic.c   |  117
 +
  net/sched/sch_prio.c  |  106
 ++---
  6 files changed, 364 insertions(+), 6 deletions(-)
 
 diff --git a/include/linux/netdevice.h 
 b/include/linux/netdevice.h index
 2e37f50..c7f94a8 100644
 --- a/include/linux/netdevice.h
 +++ b/include/linux/netdevice.h
 @@ -106,6 +106,16 @@ struct netpoll_info;  #define MAX_HEADER 
 (LL_MAX_HEADER + 48)  #endif
  
 +#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
 +
 +struct net_device_subqueue
 +{
 + /* Give a lock and a flow control state for each queue */
 + unsigned long   state;
 + spinlock_t  queue_lock cacheline_aligned_in_smp;
 +};
 +#endif
 +
  /*
   *   Network device statistics. Akin to the 2.0 ether stats but
   *   with byte counters.
 @@ -339,6 +349,10 @@ struct net_device
  #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
  #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
  
 +#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
 +#define NETIF_F_MULTI_QUEUE  8192/* Has multiple TX/RX queues */
 +#endif
 +
   struct net_device   *next_sched;
  
   /* Interface index. Unique device identifier*/
 @@ -532,6 +546,19 @@ struct net_device
   struct device   dev;
   /* space for optional statistics and wireless sysfs groups */
   struct attribute_group  *sysfs_groups[3];
 +
 +#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
 + /* To retrieve statistics per subqueue - FOR FUTURE USE */
 + struct net_device_stats* (*get_subqueue_stats)(struct net_device
 *dev,
 + int
 queue_index);
 +
 + /* The TX queue control structures */
 + struct net_device_subqueue  *egress_subqueue;
 + int egress_subqueue_count;
 + int (*hard_start_subqueue_xmit)(struct
 sk_buff *skb,
 + struct
 net_device *dev,
 + int
 queue_index);
 +#endif /* CONFIG_NET_MULTI_QUEUE_DEVICE */
  };
  #define to_net_dev(d) container_of(d, struct net_device, dev)
  
 @@ -673,6 +700,52 @@ static inline int netif_running(const 
 struct net_device *dev)
   return test_bit(__LINK_STATE_START, dev-state);  }
  
 +#ifdef CONFIG_NET_MULTI_QUEUE_DEVICE
 +
 +/*
 + * Routines to manage the subqueues on a device.  We only need start
 + * stop, and a check if it's stopped.  All other device management is
 + * done at the overall netdevice level.
 + * Also test the netif state if we're multi-queue at all.
 + */
 +static inline void netif_start_subqueue(struct net_device *dev, int
 +queue_index) {
 + clear_bit(__LINK_STATE_XOFF,
 

Re: [PATCH 1/2] NET: Multiple queue network device support

2007-02-23 Thread Stephen Hemminger
On Fri, 23 Feb 2007 04:00:55 -0500
Sreenivasa Honnur [EMAIL PROTECTED] wrote:

 Fucntion map_queue returns queue index as '0'. There is no support to
 return different queue indexes.
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 On Behalf Of Kok, Auke
 Sent: Friday, February 09, 2007 5:40 AM
 To: David Miller; Garzik, Jeff; netdev@vger.kernel.org;
 linux-kernel@vger.kernel.org
 Cc: Kok, Auke; Peter Waskiewicz Jr; Brandeburg, Jesse; Kok, Auke;
 Ronciak, John
 Subject: [PATCH 1/2] NET: Multiple queue network device support
 
 
 From: Peter Waskiewicz Jr [EMAIL PROTECTED]
 
 Added an API and associated supporting routines for multiqueue network
 devices.  This allows network devices supporting multiple TX queues to
 configure each queue within the netdevice and manage each queue
 independantly.  Changes to the PRIO Qdisc also allow a user to map
 multiple flows to individual TX queues, taking advantage of each queue
 on the device.
 
 Signed-off-by: Peter Waskiewicz Jr [EMAIL PROTECTED]
 Signed-off-by: Auke Kok [EMAIL PROTECTED]
 ---

  
 +config NET_MULTI_QUEUE_DEVICE
 + bool Multiple queue network device support (EXPERIMENTAL)
 + depends on NET_SCHED  EXPERIMENTAL
 + help
 +   Saying Y here will add support for network devices that have
 more than
 +   one physical TX queue and/or RX queue.
 +
 +   Multiple queue devices will require qdiscs that understand how
 to
 +   queue to multiple targets.  The default packet scheduler will
 default
 +   to the first queue in a device.  In other words, if you need
 the
 +   ability to spread traffic across queues, your queueing
 discipline
 +   needs to know how to do that.
 +
 +   Note that saying Y here will give preferential treatment to
 multiple
 +   queue devices in the network stack.  A slight drop in
 single-queue
 +   device performance may be seen.
 +
 +   Say N here unless you know your network device supports
 multiple
 +   TX and/or RX queues.
 +

This should not be a user visible configuration option.
It should either: always be part of the kernel API
or be selected by drivers that need/want it.

-- 
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: [PATCH 1/2] NET: Multiple queue network device support

2007-02-23 Thread Kok, Auke

Stephen Hemminger wrote:

On Fri, 23 Feb 2007 04:00:55 -0500
Sreenivasa Honnur [EMAIL PROTECTED] wrote:


Fucntion map_queue returns queue index as '0'. There is no support to
return different queue indexes.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Kok, Auke
Sent: Friday, February 09, 2007 5:40 AM
To: David Miller; Garzik, Jeff; netdev@vger.kernel.org;
linux-kernel@vger.kernel.org
Cc: Kok, Auke; Peter Waskiewicz Jr; Brandeburg, Jesse; Kok, Auke;
Ronciak, John
Subject: [PATCH 1/2] NET: Multiple queue network device support


From: Peter Waskiewicz Jr [EMAIL PROTECTED]

Added an API and associated supporting routines for multiqueue network
devices.  This allows network devices supporting multiple TX queues to
configure each queue within the netdevice and manage each queue
independantly.  Changes to the PRIO Qdisc also allow a user to map
multiple flows to individual TX queues, taking advantage of each queue
on the device.

Signed-off-by: Peter Waskiewicz Jr [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
---


 
+config NET_MULTI_QUEUE_DEVICE

+   bool Multiple queue network device support (EXPERIMENTAL)
+   depends on NET_SCHED  EXPERIMENTAL
+   help
+ Saying Y here will add support for network devices that have
more than
+ one physical TX queue and/or RX queue.
+
+ Multiple queue devices will require qdiscs that understand how
to
+ queue to multiple targets.  The default packet scheduler will
default
+ to the first queue in a device.  In other words, if you need
the
+ ability to spread traffic across queues, your queueing
discipline
+ needs to know how to do that.
+
+ Note that saying Y here will give preferential treatment to
multiple
+ queue devices in the network stack.  A slight drop in
single-queue
+ device performance may be seen.
+
+ Say N here unless you know your network device supports
multiple
+ TX and/or RX queues.
+


This should not be a user visible configuration option.
It should either: always be part of the kernel API
or be selected by drivers that need/want it.


perhaps when it's stable, yes, but right now it's definately experimental and 
may result in a slight overhead for single-queue devices as the text reads.



Cheers,

Auke
-
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] 3c59x: Handle pci_enable_device() failure while resuming

2007-02-23 Thread Dmitriy Monakhov
Handle pci_enable_device() failure while resuming, we can safely exit here.
Signed-off-by: Monakhov Dmitriy [EMAIL PROTECTED]
---
 drivers/net/3c59x.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 2b750bd..ea4a78f 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -821,11 +821,17 @@ static int vortex_resume(struct pci_dev *pdev)
 {
struct net_device *dev = pci_get_drvdata(pdev);
struct vortex_private *vp = netdev_priv(dev);
+   int err;
 
if (dev  vp) {
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
-   pci_enable_device(pdev);
+   err = pci_enable_device(pdev);
+   if (err) {
+   printk(KERN_WARNING %s: Could not enable device \n,
+   dev-name);
+   return err;
+   }
pci_set_master(pdev);
if (request_irq(dev-irq, vp-full_bus_master_rx ?
boomerang_interrupt : vortex_interrupt, 
IRQF_SHARED, dev-name, dev)) {
-- 
1.4.4.4


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


Re: [tipc-discussion] [RFC: 2.6 patch] net/tipc/: possible cleanups

2007-02-23 Thread Christoph Hellwig
On Fri, Feb 23, 2007 at 07:06:12PM +0100, Adrian Bunk wrote:
  My impression is that most of this might have users that are not yet 
  submitted for inclusion in the kernel - one year after TIPC was merged.
   
  
  Not quite. The exported symbols belong to a public API for driver 
  programmers.
  We know about several users of this API, and there will be more, but I 
  don't think
  any of them are aspiring to have their code be included in the kernel.
 ...
 
 Why not?
 
 The goal is to get as many drivers as possible included in the kernel.

If we don't have any planned in-tree users for tipc we should simply drop
tipc from the kernel entirely.  No point to make our maintaince work harder
for out of tree freeloaders.
-
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] sk98lin: handle pci_enable_device() return value in skge_resume()

2007-02-23 Thread Dmitriy Monakhov
This thread looks dead but issue was't fixed.

Jiri Kosina [EMAIL PROTECTED] writes:
  -  pci_enable_device(pdev);
  +  ret = pci_enable_device(pdev);
  +  if (ret) {
  +  printk(KERN_ERR sk98lin: Cannot enable PCI device %s during 
  resume\n, 
  +  dev-name);
  +  unregister_netdev(dev);
 This looks rather wrong - skge_exit() will run unregister_netdev() again.

 You are of course right (the problem was also spotted by Russell King). 
 This I believe is the correct one for the sk98lin case.

 [PATCH] fix sk98lin driver, ignoring return value from pci_enable_device()

 add check of return value to _resume() function of sk98lin driver.

 Signed-off-by: Jiri Kosina [EMAIL PROTECTED]

 ---

 --- a/drivers/net/sk98lin/skge.c
 +++ b/drivers/net/sk98lin/skge.c
 @@ -5070,7 +5070,12 @@ static int skge_resume(struct pci_dev *p
  
   pci_set_power_state(pdev, PCI_D0);
   pci_restore_state(pdev);
 - pci_enable_device(pdev);
 + ret = pci_enable_device(pdev);
 + if (ret) {
 + printk(KERN_WARNING sk98lin: unable to enable device %s in 
 resume\n,
 + dev-name);
 + goto out_err;
 + }   
[snip]
 +out_err:
 + pAC-AllocFlag = ~SK_ALLOC_IRQ;
 + dev-irq = 0;
 + pci_disable_device(pdev);
 Ok what happend if we jump here right after pci_disable_device() has 
  failed, but pci_disable_device() was called anyway, this is wrong and 
  may be fatal because pdev-enable_cnt may becomes negative.  
 +
 + return ret;
 +
  }
  #else
  #define skge_suspend NULL
This is reworked Jiri's patch:

[PATCH] sk98lin: handle pci_enable_device() return value in skge_resume()

Signed-off-by: Monakhov Dmitriy [EMAIL PROTECTED]
---
 drivers/net/sk98lin/skge.c |   20 +++-
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index e94ab25..eea753a 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -5125,7 +5125,12 @@ static int skge_resume(struct pci_dev *pdev)
 
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
-   pci_enable_device(pdev);
+   ret = pci_enable_device(pdev);
+   if (ret) {
+   printk(KERN_WARNING sk98lin: unable to enable device %s 
+   in resume\n, dev-name);
+   goto err_out;
+   }   
pci_set_master(pdev);
if (pAC-GIni.GIMacsFound == 2)
ret = request_irq(dev-irq, SkGeIsr, IRQF_SHARED, sk98lin, 
dev);
@@ -5133,10 +5138,8 @@ static int skge_resume(struct pci_dev *pdev)
ret = request_irq(dev-irq, SkGeIsrOnePort, IRQF_SHARED, 
sk98lin, dev);
if (ret) {
printk(KERN_WARNING sk98lin: unable to acquire IRQ %d\n, 
dev-irq);
-   pAC-AllocFlag = ~SK_ALLOC_IRQ;
-   dev-irq = 0;
-   pci_disable_device(pdev);
-   return -EBUSY;
+   ret = -EBUSY;
+   goto err_out_disable_pdev;
}
 
netif_device_attach(dev);
@@ -5153,6 +5156,13 @@ static int skge_resume(struct pci_dev *pdev)
}
 
return 0;
+
+err_out_disable_pdev:
+   pci_disable_device(pdev);
+err_out:
+   pAC-AllocFlag = ~SK_ALLOC_IRQ;
+   dev-irq = 0;
+   return ret;
 }
 #else
 #define skge_suspend NULL
-- 
1.4.4.4



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


[RFC] div64_64 support

2007-02-23 Thread Stephen Hemminger
Since there already two users of full 64 bit division in the kernel,
and other places maybe hiding out as well. Add a full 64/64 bit divide.

Yes this expensive, but there are places where it is necessary.
It is not clear if doing the scaling buys any advantage on 64 bit platforms,
so for them a full divide is done.

---
 include/asm-arm/div64.h  |2 ++
 include/asm-generic/div64.h  |8 
 include/asm-m68k/div64.h |2 ++
 include/asm-mips/div64.h |8 
 include/asm-um/div64.h   |1 +
 include/asm-xtensa/div64.h   |1 +
 lib/div64.c  |   22 ++
 net/ipv4/tcp_cubic.c |   22 --
 net/netfilter/xt_connbytes.c |   16 
 9 files changed, 44 insertions(+), 38 deletions(-)

--- linux-2.6.21-rc1.orig/include/asm-arm/div64.h   2007-02-23 
16:44:41.0 -0800
+++ linux-2.6.21-rc1/include/asm-arm/div64.h2007-02-23 16:57:36.0 
-0800
@@ -221,6 +221,8 @@
__nr;   \
 })
 
+extern uint64_t div64_64(uint64_t dividend, uint64_t divisor);
+
 #endif
 
 #endif
--- linux-2.6.21-rc1.orig/include/asm-generic/div64.h   2007-02-23 
16:35:27.0 -0800
+++ linux-2.6.21-rc1/include/asm-generic/div64.h2007-02-23 
16:56:40.0 -0800
@@ -30,9 +30,17 @@
__rem;  \
  })
 
+/*
+ * div64_64 - Divide two 64 bit numbers
+ */
+static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor)
+{
+   return dividend / divisor;
+}
 #elif BITS_PER_LONG == 32
 
 extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
+extern uint64_t div64_64(uint64_t dividend, uint64_t divisor);
 
 /* The unnecessary pointer compare is there
  * to check for type safety (n must be 64bit)
--- linux-2.6.21-rc1.orig/include/asm-m68k/div64.h  2007-02-23 
16:45:20.0 -0800
+++ linux-2.6.21-rc1/include/asm-m68k/div64.h   2007-02-23 16:56:27.0 
-0800
@@ -23,4 +23,6 @@
__rem;  \
 })
 
+extern uint64_t div64_64(uint64_t dividend, uint64_t divisor);
+
 #endif /* _M68K_DIV64_H */
--- linux-2.6.21-rc1.orig/include/asm-mips/div64.h  2007-02-23 
16:45:25.0 -0800
+++ linux-2.6.21-rc1/include/asm-mips/div64.h   2007-02-23 16:59:52.0 
-0800
@@ -78,6 +78,9 @@
__quot = __quot  32 | __low; \
(n) = __quot; \
__mod; })
+
+extern uint64_t div64_64(uint64_t dividend, uint64_t divisor);
+
 #endif /* (_MIPS_SZLONG == 32) */
 
 #if (_MIPS_SZLONG == 64)
@@ -101,6 +104,11 @@
(n) = __quot; \
__mod; })
 
+static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor)
+{
+   return dividend / divisor;
+}
+
 #endif /* (_MIPS_SZLONG == 64) */
 
 #endif /* _ASM_DIV64_H */
--- linux-2.6.21-rc1.orig/include/asm-um/div64.h2007-02-23 
16:45:37.0 -0800
+++ linux-2.6.21-rc1/include/asm-um/div64.h 2007-02-23 16:58:29.0 
-0800
@@ -3,4 +3,5 @@
 
 #include asm/arch/div64.h
 
+extern uint64_t div64_64(uint64_t dividend, uint64_t divisor);
 #endif
--- linux-2.6.21-rc1.orig/include/asm-xtensa/div64.h2007-02-23 
16:45:43.0 -0800
+++ linux-2.6.21-rc1/include/asm-xtensa/div64.h 2007-02-23 16:58:04.0 
-0800
@@ -16,4 +16,5 @@
n /= (unsigned int) base; \
__res; })
 
+extern uint64_t div64_64(uint64_t dividend, uint64_t divisor);
 #endif
--- linux-2.6.21-rc1.orig/lib/div64.c   2007-02-23 16:50:40.0 -0800
+++ linux-2.6.21-rc1/lib/div64.c2007-02-23 16:54:56.0 -0800
@@ -18,6 +18,7 @@
 
 #include linux/types.h
 #include linux/module.h
+#include asm/bitops.h
 #include asm/div64.h
 
 /* Not needed on 64bit architectures */
@@ -58,4 +59,25 @@
 
 EXPORT_SYMBOL(__div64_32);
 
+/* Use scaling to do a full 64 bit division  */
+uint64_t div64_64(uint64_t dividend, uint64_t divisor)
+{
+   uint32_t d = divisor;
+
+   if (divisor  0xULL) {
+   unsigned int shift = fls(divisor  32);
+
+   d = divisor  shift;
+   dividend = shift;
+   }
+
+   /* avoid 64 bit division if possible */
+   if (dividend  32)
+   do_div(dividend, d);
+   else
+   dividend = (uint32_t) dividend / d;
+
+   return dividend;
+}
+
 #endif /* BITS_PER_LONG == 32 */
--- linux-2.6.21-rc1.orig/net/ipv4/tcp_cubic.c  2007-02-23 16:33:52.0 
-0800
+++ linux-2.6.21-rc1/net/ipv4/tcp_cubic.c   2007-02-23 16:45:50.0 
-0800
@@ -51,7 +51,6 @@
 module_param(tcp_friendliness, int, 0644);
 MODULE_PARM_DESC(tcp_friendliness, turn on/off tcp friendliness);
 
-#include asm/div64.h
 
 /* BIC TCP Parameters */
 struct bictcp {
@@ -93,27 +92,6 @@
tcp_sk(sk)-snd_ssthresh = initial_ssthresh;
 }
 
-/* 64bit divisor, dividend and result. dynamic precision */
-static inline u_int64_t div64_64(u_int64_t dividend, u_int64_t divisor)
-{
-  

Re: [PATCH 2.6.21] iw_cxgb3: Stop the EP Timer on BAD CLOSE.

2007-02-23 Thread Roland Dreier
thanks, queued for 2.6.21
-
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/6] S2IO: Fixes for MSI and MSIX

2007-02-23 Thread Sivakumar Subramani
- Added debug statements to print a debug message if the MSI/MSI-X vector (or)
  data is zero.

- This patch removes the code that will enable NAPI for the case of single 
  ring and MSI-X / MSI case. There are some issue in the enabling NAPI with
  MSI/MSI-X.  So we are turning off NAPI in the case of MSI/MSI-X. 

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
---
diff -urpN orig/drivers/net/s2io.c patch1/drivers/net/s2io.c
--- orig/drivers/net/s2io.c 2007-02-21 12:15:42.0 +0530
+++ patch1/drivers/net/s2io.c   2007-02-21 12:28:59.0 +0530
@@ -6112,7 +6112,7 @@ static int s2io_add_isr(struct s2io_nic 
}
}
if (sp-intr_type == MSI_X) {
-   int i;
+   int i, msix_tx_cnt=0,msix_rx_cnt=0;
 
for (i=1; (sp-s2io_entries[i].in_use == MSIX_FLG); i++) {
if (sp-s2io_entries[i].type == MSIX_FIFO_TYPE) {
@@ -6121,16 +6121,36 @@ static int s2io_add_isr(struct s2io_nic 
err = request_irq(sp-entries[i].vector,
  s2io_msix_fifo_handle, 0, sp-desc[i],
  sp-s2io_entries[i].arg);
-   DBG_PRINT(ERR_DBG, %s @ 0x%llx\n, sp-desc[i],
-   (unsigned long long)sp-msix_info[i].addr);
+   /* If either data or addr is zero print it */
+   if(!(sp-msix_info[i].addr 
+   sp-msix_info[i].data)) {
+   DBG_PRINT(ERR_DBG, %s @ Addr:0x%llx
+   Data:0x%lx\n,sp-desc[i],
+   (unsigned long long)
+   sp-msix_info[i].addr,
+   (unsigned long)
+   ntohl(sp-msix_info[i].data));
+   } else {
+   msix_tx_cnt++;
+   }
} else {
sprintf(sp-desc[i], %s:MSI-X-%d-RX,
dev-name, i);
err = request_irq(sp-entries[i].vector,
  s2io_msix_ring_handle, 0, sp-desc[i],
  sp-s2io_entries[i].arg);
-   DBG_PRINT(ERR_DBG, %s @ 0x%llx\n, sp-desc[i],
-   (unsigned long long)sp-msix_info[i].addr);
+   /* If either data or addr is zero print it */
+   if(!(sp-msix_info[i].addr 
+   sp-msix_info[i].data)) {
+   DBG_PRINT(ERR_DBG, %s @ Addr:0x%llx
+   Data:0x%lx\n,sp-desc[i],
+   (unsigned long long)
+   sp-msix_info[i].addr,
+   (unsigned long)
+   ntohl(sp-msix_info[i].data));
+   } else {
+   msix_rx_cnt++;
+   }
}
if (err) {
DBG_PRINT(ERR_DBG,%s:MSI-X-%d registration 
@@ -6140,6 +6160,8 @@ static int s2io_add_isr(struct s2io_nic 
}
sp-s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
}
+   printk(MSI-X-TX %d entries enabled\n,msix_tx_cnt);
+   printk(MSI-X-RX %d entries enabled\n,msix_rx_cnt);
}
if (sp-intr_type == INTA) {
err = request_irq((int) sp-pdev-irq, s2io_isr, IRQF_SHARED,
@@ -6704,8 +6726,7 @@ static int s2io_verify_parm(struct pci_d
Defaulting to INTA\n);
*dev_intr_type = INTA;
}
-   if ( (rx_ring_num  1)  (*dev_intr_type != INTA) )
-   napi = 0;
+
if (rx_ring_mode  3) {
DBG_PRINT(ERR_DBG, s2io: Requested ring mode not supported\n);
DBG_PRINT(ERR_DBG, s2io: Defaulting to 3-buffer mode\n);

-
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] S2IO: Optimized the delay to wait for command completion

2007-02-23 Thread Sivakumar Subramani
- Optimized delay to wait for command completion so as to reduce the
  initialization wait time.
- Disable differentiated services steering. By default RMAC is configured to
  steer traffic with certain DS codes to other queues. Driver must initialize
  the DS memory to 0 to make sure that DS steering will not be used by default.

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
---
diff -urpN patch1/drivers/net/s2io.c patch2/drivers/net/s2io.c
--- patch1/drivers/net/s2io.c   2007-02-21 12:28:59.0 +0530
+++ patch2/drivers/net/s2io.c   2007-02-21 15:21:14.0 +0530
@@ -1372,6 +1372,16 @@ static int init_nic(struct s2io_nic *nic
}
}
 
+   /* Disable differentiated services steering logic */
+   for (i = 0; i  64; i++) {
+   if (rts_ds_steer(nic, i, 0) == FAILURE) {
+   DBG_PRINT(ERR_DBG, %s: failed rts ds steering,
+   dev-name);
+   DBG_PRINT(ERR_DBG, set on codepoint %d\n, i);
+   return FAILURE;
+   }
+   }
+
/* Program statistics memory */
writeq(mac_control-stats_mem_phy, bar0-stat_addr);
 
@@ -3195,26 +3205,37 @@ static void alarm_intr_handler(struct s2
  *   SUCCESS on success and FAILURE on failure.
  */
 
-static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit)
+static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit,
+   int bit_state)
 {
-   int ret = FAILURE, cnt = 0;
+   int ret = FAILURE, cnt = 0, delay = 1;
u64 val64;
 
-   while (TRUE) {
+   if ((bit_state != S2IO_BIT_RESET)  (bit_state != S2IO_BIT_SET))
+   return FAILURE;
+
+   do {
val64 = readq(addr);
-   if (!(val64  busy_bit)) {
-   ret = SUCCESS;
-   break;
+   if (bit_state == S2IO_BIT_RESET) {
+   if (!(val64  busy_bit)) {
+   ret = SUCCESS;
+   break;
+   }
+   } else {
+   if (!(val64  busy_bit)) {
+   ret = SUCCESS;
+   break;
+   }
}
 
if(in_interrupt())
-   mdelay(50);
+   mdelay(delay);
else
-   msleep(50);
+   msleep(delay);
 
-   if (cnt++  10)
-   break;
-   }
+   if (++cnt = 10)
+   delay = 50;
+   } while (cnt  20);
return ret;
 }
 /*
@@ -4296,7 +4317,8 @@ static void s2io_set_multicast(struct ne
writeq(val64, bar0-rmac_addr_cmd_mem);
/* Wait till command completes */
wait_for_cmd_complete(bar0-rmac_addr_cmd_mem,
- RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING);
+   RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING,
+   S2IO_BIT_RESET);
 
sp-m_cast_flg = 1;
sp-all_multi_pos = MAC_MC_ALL_MC_ADDR_OFFSET;
@@ -4312,7 +4334,8 @@ static void s2io_set_multicast(struct ne
writeq(val64, bar0-rmac_addr_cmd_mem);
/* Wait till command completes */
wait_for_cmd_complete(bar0-rmac_addr_cmd_mem,
- RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING);
+   RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING,
+   S2IO_BIT_RESET);
 
sp-m_cast_flg = 0;
sp-all_multi_pos = 0;
@@ -4378,7 +4401,8 @@ static void s2io_set_multicast(struct ne
 
/* Wait for command completes */
if (wait_for_cmd_complete(bar0-rmac_addr_cmd_mem,
- RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING)) {
+   RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING,
+   S2IO_BIT_RESET)) {
DBG_PRINT(ERR_DBG, %s: Adding ,
  dev-name);
DBG_PRINT(ERR_DBG, Multicasts failed\n);
@@ -4409,7 +4433,8 @@ static void s2io_set_multicast(struct ne
 
/* Wait for command completes */
if (wait_for_cmd_complete(bar0-rmac_addr_cmd_mem,
- RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING)) {
+   RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING,
+   S2IO_BIT_RESET)) {
DBG_PRINT(ERR_DBG, %s: Adding ,
  dev-name);
DBG_PRINT(ERR_DBG, Multicasts failed\n);
@@ 

[PATCH 3/6] S2IO: Added a loadable parameter to enable or disable vlan stripping in frame.

2007-02-23 Thread Sivakumar Subramani
- Added code to not to strip vlan tag when driver is in promiscuous mode
- Added module loadable parameter 'vlan_tag_strip through which user can
  enable or disable vlan stripping irrespective of mode
  ( promiscuous or non-promiscuous ). 

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
---
diff -urpN patch2/drivers/net/s2io.c patch3/drivers/net/s2io.c
--- patch2/drivers/net/s2io.c   2007-02-21 15:21:14.0 +0530
+++ patch3/drivers/net/s2io.c   2007-02-24 11:42:48.0 +0530
@@ -42,6 +42,14 @@
  * Possible values '1' for enable '0' for disable. Default is '0'
  * lro_max_pkts: This parameter defines maximum number of packets can be
  * aggregated as a single large packet
+ * napi: This parameter used to enable/disable NAPI (polling Rx)
+ * Possible values '1' for enable and '0' for disable. Default is '1'
+ * ufo: This parameter used to enable/disable UDP Fragmentation Offload(UFO)
+ *  Possible values '1' for enable and '0' for disable. Default is '0'
+ * vlan_tag_strip: This can be used to enable or disable vlan stripping.
+ * Possible values '1' for enable , '0' for disable.
+ * Default is '2' - which means disable in promisc mode
+ * and enable in non-promiscuous mode.
  /
 
 #include linux/module.h
@@ -293,6 +301,9 @@ static void s2io_vlan_rx_register(struct
spin_unlock_irqrestore(nic-tx_lock, flags);
 }
 
+/* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */
+int vlan_strip_flag;
+
 /* Unregister the vlan */
 static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid)
 {
@@ -404,6 +415,7 @@ S2IO_PARM_INT(indicate_max_pkts, 0);
 
 S2IO_PARM_INT(napi, 1);
 S2IO_PARM_INT(ufo, 0);
+S2IO_PARM_INT(vlan_tag_strip, NO_STRIP_IN_PROMISC);
 
 static unsigned int tx_fifo_len[MAX_TX_FIFOS] =
 {DEFAULT_FIFO_0_LEN, [1 ...(MAX_TX_FIFOS - 1)] = DEFAULT_FIFO_1_7_LEN};
@@ -1371,7 +1383,7 @@ static int init_nic(struct s2io_nic *nic
bar0-rts_frm_len_n[i]);
}
}
-
+   
/* Disable differentiated services steering logic */
for (i = 0; i  64; i++) {
if (rts_ds_steer(nic, i, 0) == FAILURE) {
@@ -1953,6 +1965,13 @@ static int start_nic(struct s2io_nic *ni
writeq(val64, bar0-rx_pa_cfg);
}
 
+   if (vlan_tag_strip == 0) {
+   val64 = readq(bar0-rx_pa_cfg);
+   val64 = ~RX_PA_CFG_STRIP_VLAN_TAG;
+   writeq(val64, bar0-rx_pa_cfg);
+   vlan_strip_flag = 0;
+   }
+
/*
 * Enabling MC-RLDRAM. After enabling the device, we timeout
 * for around 100ms, which is approximately the time required
@@ -4352,6 +4371,13 @@ static void s2io_set_multicast(struct ne
writeq(RMAC_CFG_KEY(0x4C0D), bar0-rmac_cfg_key);
writel((u32) (val64  32), (add + 4));
 
+   if (vlan_tag_strip != 1) {
+   val64 = readq(bar0-rx_pa_cfg);
+   val64 = ~RX_PA_CFG_STRIP_VLAN_TAG;
+   writeq(val64, bar0-rx_pa_cfg);
+   vlan_strip_flag = 0;
+   }
+
val64 = readq(bar0-mac_cfg);
sp-promisc_flg = 1;
DBG_PRINT(INFO_DBG, %s: entered promiscuous mode\n,
@@ -4367,6 +4393,13 @@ static void s2io_set_multicast(struct ne
writeq(RMAC_CFG_KEY(0x4C0D), bar0-rmac_cfg_key);
writel((u32) (val64  32), (add + 4));
 
+   if (vlan_tag_strip != 0) {
+   val64 = readq(bar0-rx_pa_cfg);
+   val64 |= RX_PA_CFG_STRIP_VLAN_TAG;
+   writeq(val64, bar0-rx_pa_cfg);
+   vlan_strip_flag = 1;
+   }
+
val64 = readq(bar0-mac_cfg);
sp-promisc_flg = 0;
DBG_PRINT(INFO_DBG, %s: left promiscuous mode\n,
@@ -6614,7 +6647,8 @@ static int rx_osm_handler(struct ring_in
 
if (!sp-lro) {
skb-protocol = eth_type_trans(skb, dev);
-   if (sp-vlgrp  RXD_GET_VLAN_TAG(rxdp-Control_2)) {
+   if ((sp-vlgrp  RXD_GET_VLAN_TAG(rxdp-Control_2) 
+   vlan_strip_flag)) {
/* Queueing the vlan frame to the upper layer */
if (napi)
vlan_hwaccel_receive_skb(skb, sp-vlgrp,
diff -urpN patch2/drivers/net/s2io.h patch3/drivers/net/s2io.h
--- patch2/drivers/net/s2io.h   2007-02-20 14:47:46.0 +0530
+++ patch3/drivers/net/s2io.h   2007-02-21 14:54:19.0 +0530
@@ -297,6 +297,9 @@ struct stat_block {
struct xpakStat xpak_stat;
 };
 
+/* Default value for 'vlan_strip_tag' configuration parameter */
+#define NO_STRIP_IN_PROMISC 2
+
 /*
  * Structures representing different init time configuration
  * parameters of the NIC.

[PATCH 4/6] S2IO: Making LED off during LINK_DOWN notification.

2007-02-23 Thread Sivakumar Subramani
- Turning off LED for LINK_DOWN notification
- Return from rxd_owner_bit_reset function if call to set_rxd_buffer_pointer
  fails with ENOMEM

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
---
diff -urpN patch3/drivers/net/s2io.c patch4/drivers/net/s2io.c
--- patch3/drivers/net/s2io.c   2007-02-24 11:42:48.0 +0530
+++ patch4/drivers/net/s2io.c   2007-02-21 15:22:13.0 +0530
@@ -4127,6 +4127,11 @@ static void s2io_txpic_intr_handle(struc
val64 = ~GPIO_INT_MASK_LINK_UP;
val64 |= GPIO_INT_MASK_LINK_DOWN;
writeq(val64, bar0-gpio_int_mask);
+
+   /* turn off LED */
+   val64 = readq(bar0-adapter_control);
+   val64 = val64 (~ADAPTER_LED_ON);
+   writeq(val64, bar0-adapter_control);
}
}
val64 = readq(bar0-gpio_int_mask);
@@ -6124,10 +6129,13 @@ static  int rxd_owner_bit_reset(struct s
rx_blocks[j].rxds[k].virt_addr;
if(sp-rxd_mode = RXD_MODE_3A)
ba = mac_control-rings[i].ba[j][k];
-   set_rxd_buffer_pointer(sp, rxdp, ba,
+   if (set_rxd_buffer_pointer(sp, rxdp, ba,
   skb,(u64 *)temp0_64,
   (u64 *)temp1_64,
-  (u64 *)temp2_64, size);
+  (u64 *)temp2_64,
+   size) == ENOMEM) {
+   return 0;
+   }
 
set_rxd_buffer_size(sp, rxdp, size);
wmb();

-
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/6] S2IO: Avoid printing the Enhanced statistics for Xframe I card.

2007-02-23 Thread Sivakumar Subramani
- Enhanced Statistics are supported only for Xframe II (Herculas) card. Add 
  condition check such Enhanced statistics will included only in the case of
  Xframe II card.

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
---
diff -urpN patch4/drivers/net/s2io.c patch5/drivers/net/s2io.c
--- patch4/drivers/net/s2io.c   2007-02-21 15:22:13.0 +0530
+++ patch5/drivers/net/s2io.c   2007-02-21 15:23:00.0 +0530
@@ -139,7 +139,7 @@ static char s2io_gstrings[][ETH_GSTRING_
BIST Test\t(offline)
 };
 
-static char ethtool_stats_keys[][ETH_GSTRING_LEN] = {
+static char ethtool_xena_stats_keys[][ETH_GSTRING_LEN] = {
{tmac_frms},
{tmac_data_octets},
{tmac_drop_frms},
@@ -233,7 +233,10 @@ static char ethtool_stats_keys[][ETH_GST
{rxd_rd_cnt},
{rxd_wr_cnt},
{txf_rd_cnt},
-   {rxf_wr_cnt},
+   {rxf_wr_cnt}
+};
+
+static char ethtool_enhanced_stats_keys[][ETH_GSTRING_LEN] = {
{rmac_ttl_1519_4095_frms},
{rmac_ttl_4096_8191_frms},
{rmac_ttl_8192_max_frms},
@@ -249,7 +252,10 @@ static char ethtool_stats_keys[][ETH_GST
{rmac_red_discard},
{rmac_rts_discard},
{rmac_ingm_full_discard},
-   {link_fault_cnt},
+   {link_fault_cnt}
+};
+
+static char ethtool_driver_stats_keys[][ETH_GSTRING_LEN] = {
{\n DRIVER STATISTICS},
{single_bit_ecc_errs},
{double_bit_ecc_errs},
@@ -277,8 +283,16 @@ static char ethtool_stats_keys[][ETH_GST
(lro_avg_aggr_pkts),
 };
 
-#define S2IO_STAT_LEN sizeof(ethtool_stats_keys)/ ETH_GSTRING_LEN
-#define S2IO_STAT_STRINGS_LEN S2IO_STAT_LEN * ETH_GSTRING_LEN
+#define S2IO_XENA_STAT_LEN sizeof(ethtool_xena_stats_keys)/ ETH_GSTRING_LEN
+#define S2IO_ENHANCED_STAT_LEN sizeof(ethtool_enhanced_stats_keys)/ \
+   ETH_GSTRING_LEN
+#define S2IO_DRIVER_STAT_LEN sizeof(ethtool_driver_stats_keys)/ ETH_GSTRING_LEN
+
+#define XFRAME_I_STAT_LEN (S2IO_XENA_STAT_LEN + S2IO_DRIVER_STAT_LEN )
+#define XFRAME_II_STAT_LEN (XFRAME_I_STAT_LEN + S2IO_ENHANCED_STAT_LEN )
+
+#define XFRAME_I_STAT_STRINGS_LEN ( XFRAME_I_STAT_LEN * ETH_GSTRING_LEN )
+#define XFRAME_II_STAT_STRINGS_LEN ( XFRAME_II_STAT_LEN * ETH_GSTRING_LEN )
 
 #define S2IO_TEST_LEN  sizeof(s2io_gstrings) / ETH_GSTRING_LEN
 #define S2IO_STRINGS_LEN   S2IO_TEST_LEN * ETH_GSTRING_LEN
@@ -4609,7 +4623,11 @@ static void s2io_ethtool_gdrvinfo(struct
info-regdump_len = XENA_REG_SPACE;
info-eedump_len = XENA_EEPROM_SPACE;
info-testinfo_len = S2IO_TEST_LEN;
-   info-n_stats = S2IO_STAT_LEN;
+
+   if (sp-device_type == XFRAME_I_DEVICE)
+   info-n_stats = XFRAME_I_STAT_LEN;
+   else
+   info-n_stats = XFRAME_II_STAT_LEN;
 }
 
 /**
@@ -5631,22 +5649,30 @@ static void s2io_get_ethtool_stats(struc
tmp_stats[i++] = le32_to_cpu(stat_info-rxd_wr_cnt);
tmp_stats[i++] = le32_to_cpu(stat_info-txf_rd_cnt);
tmp_stats[i++] = le32_to_cpu(stat_info-rxf_wr_cnt);
-   tmp_stats[i++] = le64_to_cpu(stat_info-rmac_ttl_1519_4095_frms);
-tmp_stats[i++] = le64_to_cpu(stat_info-rmac_ttl_4096_8191_frms);
-tmp_stats[i++] = le64_to_cpu(stat_info-rmac_ttl_8192_max_frms);
-tmp_stats[i++] = le64_to_cpu(stat_info-rmac_ttl_gt_max_frms);
-tmp_stats[i++] = le64_to_cpu(stat_info-rmac_osized_alt_frms);
-tmp_stats[i++] = le64_to_cpu(stat_info-rmac_jabber_alt_frms);
-tmp_stats[i++] = le64_to_cpu(stat_info-rmac_gt_max_alt_frms);
-tmp_stats[i++] = le64_to_cpu(stat_info-rmac_vlan_frms);
-tmp_stats[i++] = le32_to_cpu(stat_info-rmac_len_discard);
-tmp_stats[i++] = le32_to_cpu(stat_info-rmac_fcs_discard);
-tmp_stats[i++] = le32_to_cpu(stat_info-rmac_pf_discard);
-tmp_stats[i++] = le32_to_cpu(stat_info-rmac_da_discard);
-tmp_stats[i++] = le32_to_cpu(stat_info-rmac_red_discard);
-tmp_stats[i++] = le32_to_cpu(stat_info-rmac_rts_discard);
-tmp_stats[i++] = le32_to_cpu(stat_info-rmac_ingm_full_discard);
-tmp_stats[i++] = le32_to_cpu(stat_info-link_fault_cnt);
+
+   /* Enhanced statistics exist only for Hercules */
+   if(sp-device_type == XFRAME_II_DEVICE) {
+   tmp_stats[i++] =
+   le64_to_cpu(stat_info-rmac_ttl_1519_4095_frms);
+   tmp_stats[i++] =
+   le64_to_cpu(stat_info-rmac_ttl_4096_8191_frms);
+   tmp_stats[i++] =
+   le64_to_cpu(stat_info-rmac_ttl_8192_max_frms);
+   tmp_stats[i++] = le64_to_cpu(stat_info-rmac_ttl_gt_max_frms);
+   tmp_stats[i++] = le64_to_cpu(stat_info-rmac_osized_alt_frms);
+   tmp_stats[i++] = le64_to_cpu(stat_info-rmac_jabber_alt_frms);
+   tmp_stats[i++] = le64_to_cpu(stat_info-rmac_gt_max_alt_frms);
+   tmp_stats[i++] = le64_to_cpu(stat_info-rmac_vlan_frms);
+   tmp_stats[i++] = 

[PATCH 6/6] S2IO: Restoring the mac address in s2io_reset

2007-02-23 Thread Sivakumar Subramani
- Restore in s2io_reset, the mac address assigned during s2io_open.
  Earlier, it was getting overwritten to the factory default (read from the
  eeprom) and subsequently dropping received frames.

- Fixed the typo in calling rtnl_unlock in s2io_set_link function.

Signed-off-by: Sivakumar Subramani [EMAIL PROTECTED]
---
diff -urpN patch5/drivers/net/s2io.c patch6/drivers/net/s2io.c
--- patch5/drivers/net/s2io.c   2007-02-21 15:23:00.0 +0530
+++ patch6/drivers/net/s2io.c   2007-02-21 17:02:48.0 +0530
@@ -84,7 +84,7 @@
 #include s2io.h
 #include s2io-regs.h
 
-#define DRV_VERSION 2.0.16.1
+#define DRV_VERSION 2.0.17.1
 
 /* S2io Driver name  version. */
 static char s2io_driver_name[] = Neterion;
@@ -3394,6 +3394,9 @@ new_way:
writeq(val64, bar0-pcc_err_reg);
}
 
+   /* restore the previously assigned mac address */
+   s2io_set_mac_addr(sp-dev, (u8 *)sp-def_mac_addr[0].mac_addr);
+
sp-device_enabled_once = FALSE;
 }
 
@@ -4512,6 +4515,7 @@ static int s2io_set_mac_addr(struct net_
struct XENA_dev_config __iomem *bar0 = sp-bar0;
register u64 val64, mac_addr = 0;
int i;
+   u64 old_mac_addr = 0;
 
/*
 * Set the new MAC address as the new unicast filter and reflect this
@@ -4521,6 +4525,22 @@ static int s2io_set_mac_addr(struct net_
for (i = 0; i  ETH_ALEN; i++) {
mac_addr = 8;
mac_addr |= addr[i];
+   old_mac_addr = 8;
+   old_mac_addr |= sp-def_mac_addr[0].mac_addr[i];
+   }
+
+   if(0 == mac_addr)
+   return SUCCESS;
+
+   /* Update the internal structure with this new mac address */
+   if(mac_addr != old_mac_addr) {
+   memset(sp-def_mac_addr[0].mac_addr, 0, sizeof(ETH_ALEN));
+   sp-def_mac_addr[0].mac_addr[5] = (u8) (mac_addr);
+   sp-def_mac_addr[0].mac_addr[4] = (u8) (mac_addr  8);
+   sp-def_mac_addr[0].mac_addr[3] = (u8) (mac_addr  16);
+   sp-def_mac_addr[0].mac_addr[2] = (u8) (mac_addr  24);
+   sp-def_mac_addr[0].mac_addr[1] = (u8) (mac_addr  32);
+   sp-def_mac_addr[0].mac_addr[0] = (u8) (mac_addr  40);
}
 
writeq(RMAC_ADDR_DATA0_MEM_ADDR(mac_addr),
@@ -6022,7 +6042,7 @@ static void s2io_set_link(struct work_st
clear_bit(0, (nic-link_state));
 
 out_unlock:
-   rtnl_lock();
+   rtnl_unlock();
 }
 
 static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
@@ -7182,8 +7202,6 @@ s2io_init_nic(struct pci_dev *pdev, cons
mac_down = (u32) tmp64;
mac_up = (u32) (tmp64  32);
 
-   memset(sp-def_mac_addr[0].mac_addr, 0, sizeof(ETH_ALEN));
-
sp-def_mac_addr[0].mac_addr[3] = (u8) (mac_up);
sp-def_mac_addr[0].mac_addr[2] = (u8) (mac_up  8);
sp-def_mac_addr[0].mac_addr[1] = (u8) (mac_up  16);

-
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