Netdev List
 help / color / mirror / Atom feed
* Re: [patch 3/4] net: Percpufy frequently used variables -- proto.sockets_allocated
From: Benjamin LaHaise @ 2006-01-29 19:52 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Andrew Morton, kiran, davem, linux-kernel, shai, netdev, pravins
In-Reply-To: <43DC6691.9000001@cosmosbay.com>

On Sun, Jan 29, 2006 at 07:54:09AM +0100, Eric Dumazet wrote:
> Well, I think that might be doable, maybe RCU magic ?
> 
> 1) local_t are not that nice on all archs.

It is for the users that matter, and the hooks are there if someone finds 
it to be a performance problem.

> 2) The consolidation phase (summing all the cpus local offset to 
> consolidate the central counter) might be more difficult to do (we would 
> need kind of 2 counters per cpu, and a index that can be changed by the cpu 
> that wants a consolidation (still 'expensive'))

For the vast majority of these sorts of statistics counters, we don't 
need 100% accurate counts.  And I think it should be possible to choose 
between a lightweight implementation and the expensive implementation.  
On a chip like the Core Duo the cost of bouncing between the two cores 
is minimal, so all the extra code and data is a waste.

> 3) Are the locked ops so expensive if done on a cache line that is mostly 
> in exclusive state in cpu cache ?

Yes.  What happens on the P4 is that it forces outstanding memory 
transactions in the reorder buffer to be flushed so that the memory barrier 
semantics of the lock prefix are observed.  This can take a long time as
there can be over a hundred instructions in flight.

		-ben
-- 
"Ladies and gentlemen, I'm sorry to interrupt, but the police are here 
and they've asked us to stop the party."  Don't Email: <dont@kvack.org>.

^ permalink raw reply

* [PATCH 4/4]  pktgen: Fix Initialization fail leak.
From: Luiz Fernando Capitulino @ 2006-01-30  1:21 UTC (permalink / raw)
  To: davem; +Cc: lkml, netdev, robert.olsson


 Even if pktgen's thread initialization fails for all CPUs, the module
will be successfully loaded.

 This patch changes that behaivor, by returning error on module load time,
and also freeing all the resources allocated. It also prints a warning if a
thread initialization has failed.

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>


---

 net/core/pktgen.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

909df2e921dabd2f43f80f4fe067bf3b86fbc3cd
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index af310e5..3806068 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3136,11 +3136,24 @@ static int __init pg_init(void)
 	register_netdevice_notifier(&pktgen_notifier_block);
 
 	for_each_online_cpu(cpu) {
+		int err;
 		char buf[30];
 
 		sprintf(buf, "kpktgend_%i", cpu);
-		pktgen_create_thread(buf, cpu);
+		err = pktgen_create_thread(buf, cpu);
+		if (err)
+			printk("pktgen: WARNING: Cannot create thread for cpu %d (%d)\n",
+					cpu, err);
 	}
+
+	if (list_empty(&pktgen_threads)) {
+		printk("pktgen: ERROR: Initialization failed for all threads\n");
+		unregister_netdevice_notifier(&pktgen_notifier_block);
+		remove_proc_entry(PGCTRL, pg_proc_dir);
+		proc_net_remove(PG_PROC_DIR);
+		return -ENODEV;
+	}
+
 	return 0;
 }
 
-- 
1.1.5.g3480


-- 
Luiz Fernando N. Capitulino

^ permalink raw reply related

* [PATCH 3/4]  pktgen: Fix kernel_thread() fail leak.
From: Luiz Fernando Capitulino @ 2006-01-30  1:21 UTC (permalink / raw)
  To: davem; +Cc: lkml, netdev, robert.olsson


 Leak fix: free all the alocated resources if kernel_thread() call fails.

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>


---

 net/core/pktgen.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

59115e7981073430cfcaaaabcde20840ec926cca
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b9dea09..af310e5 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3002,6 +3002,7 @@ static struct pktgen_thread *__init pktg
 
 static int __init pktgen_create_thread(const char *name, int cpu)
 {
+	int err;
 	struct pktgen_thread *t = NULL;
 	struct proc_dir_entry *pe;
 
@@ -3040,9 +3041,15 @@ static int __init pktgen_create_thread(c
 
 	t->removed = 0;
 
-	if (kernel_thread((void *)pktgen_thread_worker, (void *)t,
-			  CLONE_FS | CLONE_FILES | CLONE_SIGHAND) < 0)
+	err = kernel_thread((void *)pktgen_thread_worker, (void *)t,
+			  CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+	if (err < 0) {
 		printk("pktgen: kernel_thread() failed for cpu %d\n", t->cpu);
+		remove_proc_entry(t->name, pg_proc_dir);
+		list_del(&t->th_list);
+		kfree(t);
+		return err;
+	}
 
 	return 0;
 }
-- 
1.1.5.g3480


-- 
Luiz Fernando N. Capitulino

^ permalink raw reply related

* [PATCH 2/4]  pktgen: Ports thread list to Kernel list implementation.
From: Luiz Fernando Capitulino @ 2006-01-30  1:21 UTC (permalink / raw)
  To: davem; +Cc: lkml, netdev, robert.olsson


 Ports the thread list to use the Linux Kernel linked list implementation.
The final result is a simpler and smaller code.

 Note that I'm adding a new member in the struct pktgen_thread called
'removed'. The reason is that I didn't find a better wait condition to be
used in the place of the replaced one. Suggestions are very welcome.

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>


---

 net/core/pktgen.c |   96 +++++++++++++++++++++++------------------------------
 1 files changed, 41 insertions(+), 55 deletions(-)

3679f7d860ed28c86f0c8e1d6c1b4d9ee1e716d7
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index a6a45b9..b9dea09 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -125,6 +125,7 @@
 #include <linux/capability.h>
 #include <linux/delay.h>
 #include <linux/timer.h>
+#include <linux/list.h>
 #include <linux/init.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
@@ -327,7 +328,8 @@ struct pktgen_hdr {
 struct pktgen_thread {
 	spinlock_t if_lock;
 	struct pktgen_dev *if_list;	/* All device here */
-	struct pktgen_thread *next;
+	struct list_head th_list;
+	int removed;
 	char name[32];
 	char result[512];
 	u32 max_before_softirq;	/* We'll call do_softirq to prevent starvation. */
@@ -489,7 +491,7 @@ static int pg_clone_skb_d;
 static int debug;
 
 static DECLARE_MUTEX(pktgen_sem);
-static struct pktgen_thread *pktgen_threads = NULL;
+static LIST_HEAD(pktgen_threads);
 
 static struct notifier_block pktgen_notifier_block = {
 	.notifier_call = pktgen_device_event,
@@ -1522,9 +1524,7 @@ static struct pktgen_dev *__pktgen_NN_th
 	struct pktgen_thread *t;
 	struct pktgen_dev *pkt_dev = NULL;
 
-	t = pktgen_threads;
-
-	while (t) {
+	list_for_each_entry(t, &pktgen_threads, th_list) {
 		pkt_dev = pktgen_find_dev(t, ifname);
 		if (pkt_dev) {
 			if (remove) {
@@ -1534,7 +1534,6 @@ static struct pktgen_dev *__pktgen_NN_th
 			}
 			break;
 		}
-		t = t->next;
 	}
 	return pkt_dev;
 }
@@ -2422,15 +2421,15 @@ static void pktgen_run(struct pktgen_thr
 
 static void pktgen_stop_all_threads_ifs(void)
 {
-	struct pktgen_thread *t = pktgen_threads;
+	struct pktgen_thread *t;
 
 	PG_DEBUG(printk("pktgen: entering pktgen_stop_all_threads.\n"));
 
 	thread_lock();
-	while (t) {
+
+	list_for_each_entry(t, &pktgen_threads, th_list)
 		pktgen_stop(t);
-		t = t->next;
-	}
+
 	thread_unlock();
 }
 
@@ -2472,40 +2471,36 @@ signal:
 
 static int pktgen_wait_all_threads_run(void)
 {
-	struct pktgen_thread *t = pktgen_threads;
+	struct pktgen_thread *t;
 	int sig = 1;
 
-	while (t) {
+	thread_lock();
+
+	list_for_each_entry(t, &pktgen_threads, th_list) {
 		sig = pktgen_wait_thread_run(t);
 		if (sig == 0)
 			break;
-		thread_lock();
-		t = t->next;
-		thread_unlock();
 	}
-	if (sig == 0) {
-		thread_lock();
-		while (t) {
+
+	if (sig == 0)
+		list_for_each_entry(t, &pktgen_threads, th_list)
 			t->control |= (T_STOP);
-			t = t->next;
-		}
-		thread_unlock();
-	}
+
+	thread_unlock();
 	return sig;
 }
 
 static void pktgen_run_all_threads(void)
 {
-	struct pktgen_thread *t = pktgen_threads;
+	struct pktgen_thread *t;
 
 	PG_DEBUG(printk("pktgen: entering pktgen_run_all_threads.\n"));
 
 	thread_lock();
 
-	while (t) {
+	list_for_each_entry(t, &pktgen_threads, th_list)
 		t->control |= (T_RUN);
-		t = t->next;
-	}
+
 	thread_unlock();
 
 	schedule_timeout_interruptible(msecs_to_jiffies(125));	/* Propagate thread->control  */
@@ -2625,24 +2620,12 @@ static void pktgen_rem_thread(struct pkt
 {
 	/* Remove from the thread list */
 
-	struct pktgen_thread *tmp = pktgen_threads;
-
 	remove_proc_entry(t->name, pg_proc_dir);
 
 	thread_lock();
 
-	if (tmp == t)
-		pktgen_threads = tmp->next;
-	else {
-		while (tmp) {
-			if (tmp->next == t) {
-				tmp->next = t->next;
-				t->next = NULL;
-				break;
-			}
-			tmp = tmp->next;
-		}
-	}
+	list_del(&t->th_list);
+
 	thread_unlock();
 }
 
@@ -2890,6 +2873,8 @@ static void pktgen_thread_worker(struct 
 
 	PG_DEBUG(printk("pktgen: %s removing thread.\n", t->name));
 	pktgen_rem_thread(t);
+
+	t->removed = 1;
 }
 
 static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
@@ -3001,19 +2986,18 @@ static int pktgen_add_device(struct pktg
 
 static struct pktgen_thread *__init pktgen_find_thread(const char *name)
 {
-	struct pktgen_thread *t = NULL;
+	struct pktgen_thread *t;
 
 	thread_lock();
 
-	t = pktgen_threads;
-	while (t) {
-		if (strcmp(t->name, name) == 0)
-			break;
+	list_for_each_entry(t, &pktgen_threads, th_list)
+		if (strcmp(t->name, name) == 0) {
+			thread_unlock();
+			return t;
+		}
 
-		t = t->next;
-	}
 	thread_unlock();
-	return t;
+	return NULL;
 }
 
 static int __init pktgen_create_thread(const char *name, int cpu)
@@ -3052,8 +3036,9 @@ static int __init pktgen_create_thread(c
 	pe->proc_fops = &pktgen_thread_fops;
 	pe->data = t;
 
-	t->next = pktgen_threads;
-	pktgen_threads = t;
+	list_add_tail(&t->th_list, &pktgen_threads);
+
+	t->removed = 0;
 
 	if (kernel_thread((void *)pktgen_thread_worker, (void *)t,
 			  CLONE_FS | CLONE_FILES | CLONE_SIGHAND) < 0)
@@ -3154,17 +3139,18 @@ static int __init pg_init(void)
 
 static void __exit pg_cleanup(void)
 {
+	struct pktgen_thread *t;
+	struct list_head *q, *n;
 	wait_queue_head_t queue;
 	init_waitqueue_head(&queue);
 
 	/* Stop all interfaces & threads */
 
-	while (pktgen_threads) {
-		struct pktgen_thread *t = pktgen_threads;
-		pktgen_threads->control |= (T_TERMINATE);
+	list_for_each_safe(q, n, &pktgen_threads) {
+		t = list_entry(q, struct pktgen_thread, th_list);
+		t->control |= (T_TERMINATE);
 
-		wait_event_interruptible_timeout(queue, (t != pktgen_threads),
-						 HZ);
+		wait_event_interruptible_timeout(queue, (t->removed == 1), HZ);
 	}
 
 	/* Un-register us from receiving netdevice events */
-- 
1.1.5.g3480


-- 
Luiz Fernando N. Capitulino

^ permalink raw reply related

* [PATCH 1/4]  pktgen: Lindent run.
From: Luiz Fernando Capitulino @ 2006-01-30  1:21 UTC (permalink / raw)
  To: davem; +Cc: lkml, netdev, robert.olsson


 This patch is not in-lined because it's 120K bytes long, you can found it at:

http://www.cpu.eti.br/patches/0001-pktgen-Lindent-run.patch

-- 
Luiz Fernando N. Capitulino

^ permalink raw reply

* [PATCH 0/4] - pktgen: refinements and small fixes (V2).
From: Luiz Fernando Capitulino @ 2006-01-30  1:23 UTC (permalink / raw)
  To: davem; +Cc: lkml, netdev, robert.olsson


 Hi!

 I'm sending again the following patches for pktgen:

[PATCH 1/4]  pktgen: Lindent run.
[PATCH 2/4]  pktgen: Ports thread list to Kernel list implementation.
[PATCH 3/4]  pktgen: Fix kernel_thread() fail leak.
[PATCH 4/4]  pktgen: Fix Initialization fail leak.

 The changes from V1 are:

 1. More fixes made by hand after Lindent run
 2. Re-diffed agains't Dave's net-2.6.17 tree
 
  All the patches were tested with QEMU, emulating a machine with 4 CPUs
and 4 ethernet cards.

-- 
Luiz Fernando N. Capitulino

^ permalink raw reply

* net/tipc/bcast.c:tipc_bcbearer_send() stack usage
From: Adrian Bunk @ 2006-01-30  2:47 UTC (permalink / raw)
  To: per.liden, jon.maloy, allan.stephens
  Cc: tipc-discussion, netdev, linux-kernel

>From net/tipc/bcast.c:

<--  snip  -->

...
int tipc_bcbearer_send(struct sk_buff *buf,
                       struct tipc_bearer *unused1,
                       struct tipc_media_addr *unused2)
{
        static int send_count = 0;

        struct node_map remains;
        struct node_map remains_new;
...

<--  snip  -->


You've just allocated 2*516 Bytes for the two structs from a stack that 
might only be 4 kB altogether.

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

^ permalink raw reply

* Re: [PATH] acxsm: Move WEP code into softmac
From: Denis Vlasenko @ 2006-01-30  7:18 UTC (permalink / raw)
  To: acx100-devel; +Cc: Carlos Martín, netdev
In-Reply-To: <200601291526.09333.carlos@cmartin.tk>

On Sunday 29 January 2006 16:26, Carlos Martín wrote:
> Hi,
> 
>  This patch moves the WEP handling code to use the softmac layer and 
> implements acx_e_ieee80211_set_security(), based on the rt2x00 project's one.

Applied, thanks!
 
>  I do have a couple of questions though:
> 
> 1) adev->wep_restricted = 0 is the same as an open auth system, and 
> adev->wep_restricted = 1 is the same as having a shared key auth system, 
> right?
> 
> 2) What is the purpose of the index field in key_struct_t? I've assumed it is 
> the same as adev->wep_current_index, but I'm not sure this is correct.

To be honest, I did not pay much attention to inner WEP workings...
--
vda


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642

^ permalink raw reply

* [PATCH 0/4] - pktgen: refinements and small fixes (V2).
From: Robert Olsson @ 2006-01-30 11:18 UTC (permalink / raw)
  To: davem; +Cc: Luiz Fernando Capitulino, lkml, netdev, robert.olsson
In-Reply-To: <20060129232342.1e481f9a@localhost>


Luiz Fernando Capitulino writes:

 > [PATCH 1/4]  pktgen: Lindent run.
 > [PATCH 2/4]  pktgen: Ports thread list to Kernel list implementation.
 > [PATCH 3/4]  pktgen: Fix kernel_thread() fail leak.
 > [PATCH 4/4]  pktgen: Fix Initialization fail leak.
 > 
 >  The changes from V1 are:
 > 
 >  1. More fixes made by hand after Lindent run
 >  2. Re-diffed agains't Dave's net-2.6.17 tree

 Should be fine I've used the previous version of the patches for a
 couple of days now. Thanks.

 Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>

 Cheers.	
					--ro

^ permalink raw reply

* Re: [PATCH 0/4] - pktgen: refinements and small fixes (V2).
From: Luiz Fernando Capitulino @ 2006-01-30 12:15 UTC (permalink / raw)
  To: Robert Olsson; +Cc: davem, linux-kernel, netdev, robert.olsson
In-Reply-To: <17373.62964.203852.42375@robur.slu.se>

On Mon, 30 Jan 2006 12:18:12 +0100
Robert Olsson <Robert.Olsson@data.slu.se> wrote:

| 
| Luiz Fernando Capitulino writes:
| 
|  > [PATCH 1/4]  pktgen: Lindent run.
|  > [PATCH 2/4]  pktgen: Ports thread list to Kernel list implementation.
|  > [PATCH 3/4]  pktgen: Fix kernel_thread() fail leak.
|  > [PATCH 4/4]  pktgen: Fix Initialization fail leak.
|  > 
|  >  The changes from V1 are:
|  > 
|  >  1. More fixes made by hand after Lindent run
|  >  2. Re-diffed agains't Dave's net-2.6.17 tree
| 
|  Should be fine I've used the previous version of the patches for a
|  couple of days now. Thanks.

 Ok Robert, I'll try to finish the interface list port this week.

| 
|  Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
| 
|  Cheers.	
| 					--ro

-- 
Luiz Fernando N. Capitulino

^ permalink raw reply

* Re: [GIT PULL] bcm43xx update
From: John W. Linville @ 2006-01-30 13:17 UTC (permalink / raw)
  To: Michael Buesch
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, bcm43xx-dev-0fE9KPoRgkgATYTw5x5z8w
In-Reply-To: <200601291138.56241.mbuesch-KuiJ5kEpwI6ELgA04lAiVw@public.gmane.org>

On Sun, Jan 29, 2006 at 11:38:56AM +0100, Michael Buesch wrote:
> On Friday 27 January 2006 18:42, you wrote:
> > Please do a
> > git pull git://bu3sch.de/bcm43xx.git master-upstream
> > to pull the bcm43xx-softmac branch.
> > 
> > Please do a
> > git pull git://bu3sch.de/bcm43xx.git dscape-upstream
> > to pull the bcm43xx-dscape branch.
> 
> Did you already pull? I did not see it in your git logs.
> I have to do some maintainance work on my public repository
> and I am waiting for your pull, before I shut down the server.

I have it now.  Sorry for being slow!

John
-- 
John W. Linville
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org

^ permalink raw reply

* Re: [PATH] acxsm: Move WEP code into softmac
From: Carlos Martín @ 2006-01-30 15:46 UTC (permalink / raw)
  To: Denis Vlasenko; +Cc: acx100-devel, netdev
In-Reply-To: <200601300918.28664.vda@ilport.com.ua>

On Monday 30 January 2006 08:18, Denis Vlasenko wrote:
> 
> To be honest, I did not pay much attention to inner WEP workings...

That's alright then, it can always be fixed later.

   cmn
-- 
Carlos Martín       http://www.cmartin.tk

"Erdbeben? Sicherlich etwas, das mit Erdberen zu tun hat." -- me, paraphrased


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642

^ permalink raw reply

* [PATCH] RealTek RTL-8169 Full Duplex Patch
From: Andy Gospodarek @ 2006-01-30 16:10 UTC (permalink / raw)
  To: netdev, romieu; +Cc: linux-kernel


Allow the r8129 driver to set devices to be full-duplex only when
auto-negotiate is disabled.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---

 r8169.c |    3 +++
 1 files changed, 3 insertions(+)

--- 2.6/drivers/net/r8169.c.orig	2006-01-23 12:55:19.224875000 -0600
+++ 2.6/drivers/net/r8169.c	2006-01-23 13:29:54.967655000 -0600
@@ -677,6 +677,9 @@
 
 		if (duplex == DUPLEX_HALF)
 			auto_nego &= ~(PHY_Cap_10_Full | PHY_Cap_100_Full);
+
+		if (duplex == DUPLEX_FULL)
+			auto_nego &= ~(PHY_Cap_10_Half | PHY_Cap_100_Half);
 	}
 
 	tp->phy_auto_nego_reg = auto_nego;

^ permalink raw reply

* [2.6.15 patch] wireless/airo: add IWENCODEEXT and IWAUTH support
From: Dan Williams @ 2006-01-30 16:58 UTC (permalink / raw)
  To: breed; +Cc: netdev, jgarzik, John W. Linville, networkmanager-list

This patch adds IWENCODEEXT and IWAUTH support to the airo driver for
WEP and unencrypted operation.  No WPA though.  It allows the driver to
operate more willingly with wpa_supplicant and NetworkManager.

Signed-off-by: Dan Williams <dcbw@redhat.com>

--- a/drivers/net/wireless/airo.c	2006-01-30 10:14:23.000000000 -0500
+++ b/drivers/net/wireless/airo.c	2006-01-30 11:05:15.000000000 -0500
@@ -5802,11 +5802,13 @@ static int airo_set_wap(struct net_devic
 	Cmd cmd;
 	Resp rsp;
 	APListRid APList_rid;
-	static const unsigned char bcast[ETH_ALEN] = { 255, 255, 255, 255, 255, 255 };
+	static const u8 any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+	static const u8 off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
 	if (awrq->sa_family != ARPHRD_ETHER)
 		return -EINVAL;
-	else if (!memcmp(bcast, awrq->sa_data, ETH_ALEN)) {
+	else if (!memcmp(any, awrq->sa_data, ETH_ALEN) ||
+	         !memcmp(off, awrq->sa_data, ETH_ALEN)) {
 		memset(&cmd, 0, sizeof(cmd));
 		cmd.cmd=CMD_LOSE_SYNC;
 		if (down_interruptible(&local->sem))
@@ -6297,6 +6299,267 @@ static int airo_get_encode(struct net_de
 
 /*------------------------------------------------------------------*/
 /*
+ * Wireless Handler : set extended Encryption parameters
+ */
+static int airo_set_encodeext(struct net_device *dev,
+			   struct iw_request_info *info,
+			    union iwreq_data *wrqu,
+			    char *extra)
+{
+	struct airo_info *local = dev->priv;
+	struct iw_point *encoding = &wrqu->encoding;
+	struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
+	CapabilityRid cap_rid;		/* Card capability info */
+	int perm = ( encoding->flags & IW_ENCODE_TEMP ? 0 : 1 );
+	u16 currentAuthType = local->config.authType;
+	int idx, key_len, alg = ext->alg;	/* Check encryption mode */
+	wep_key_t key;
+
+	/* Is WEP supported ? */
+	readCapabilityRid(local, &cap_rid, 1);
+	/* Older firmware doesn't support this...
+	if(!(cap_rid.softCap & 2)) {
+		return -EOPNOTSUPP;
+	} */
+	readConfigRid(local, 1);
+
+	/* Determine and validate the key index */
+	idx = encoding->flags & IW_ENCODE_INDEX;
+	if (idx) {
+		if (idx < 1 || idx > ((cap_rid.softCap & 0x80) ? 4:1))
+			return -EINVAL;
+		idx--;
+	} else
+		idx = get_wep_key(local, 0xffff);
+
+	if (encoding->flags & IW_ENCODE_DISABLED)
+		alg = IW_ENCODE_ALG_NONE;
+
+	/* Just setting the transmit key? */
+	if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
+		set_wep_key(local, idx, NULL, 0, perm, 1);
+	} else {
+		/* Set the requested key first */
+		memset(key.key, 0, MAX_KEY_SIZE);
+		switch (alg) {
+		case IW_ENCODE_ALG_NONE:
+			key.len = 0;
+			break;
+		case IW_ENCODE_ALG_WEP:
+			if (ext->key_len > MIN_KEY_SIZE) {
+				key.len = MAX_KEY_SIZE;
+			} else if (ext->key_len > 0) {
+				key.len = MIN_KEY_SIZE;
+			} else {
+				return -EINVAL;
+			}
+			key_len = min (ext->key_len, key.len);
+			memcpy(key.key, ext->key, key_len);
+			break;
+		default:
+			return -EINVAL;
+		}
+		/* Send the key to the card */
+		set_wep_key(local, idx, key.key, key.len, perm, 1);
+	}
+
+	/* Read the flags */
+	if(encoding->flags & IW_ENCODE_DISABLED)
+		local->config.authType = AUTH_OPEN;	// disable encryption
+	if(encoding->flags & IW_ENCODE_RESTRICTED)
+		local->config.authType = AUTH_SHAREDKEY;	// Only Both
+	if(encoding->flags & IW_ENCODE_OPEN)
+		local->config.authType = AUTH_ENCRYPT;	// Only Wep
+	/* Commit the changes to flags if needed */
+	if (local->config.authType != currentAuthType)
+		set_bit (FLAG_COMMIT, &local->flags);
+
+	return -EINPROGRESS;
+}
+
+
+/*------------------------------------------------------------------*/
+/*
+ * Wireless Handler : get extended Encryption parameters
+ */
+static int airo_get_encodeext(struct net_device *dev,
+			    struct iw_request_info *info,
+			    union iwreq_data *wrqu,
+			    char *extra)
+{
+	struct airo_info *local = dev->priv;
+	struct iw_point *encoding = &wrqu->encoding;
+	struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
+	CapabilityRid cap_rid;		/* Card capability info */
+	int idx, max_key_len;
+
+	/* Is it supported ? */
+	readCapabilityRid(local, &cap_rid, 1);
+	if(!(cap_rid.softCap & 2)) {
+		return -EOPNOTSUPP;
+	}
+	readConfigRid(local, 1);
+
+	max_key_len = encoding->length - sizeof(*ext);
+	if (max_key_len < 0)
+		return -EINVAL;
+
+	idx = encoding->flags & IW_ENCODE_INDEX;
+	if (idx) {
+		if (idx < 1 || idx > ((cap_rid.softCap & 0x80) ? 4:1))
+			return -EINVAL;
+		idx--;
+	} else
+		idx = get_wep_key(local, 0xffff);
+
+	encoding->flags = idx + 1;
+	memset(ext, 0, sizeof(*ext));
+
+	/* Check encryption mode */
+	switch(local->config.authType) {
+		case AUTH_ENCRYPT:
+			encoding->flags = IW_ENCODE_ALG_WEP | IW_ENCODE_ENABLED;
+			break;
+		case AUTH_SHAREDKEY:
+			encoding->flags = IW_ENCODE_ALG_WEP | IW_ENCODE_ENABLED;
+			break;
+		default:
+		case AUTH_OPEN:
+			encoding->flags = IW_ENCODE_ALG_NONE | IW_ENCODE_DISABLED;
+			break;
+	}
+	/* We can't return the key, so set the proper flag and return zero */
+	encoding->flags |= IW_ENCODE_NOKEY;
+	memset(extra, 0, 16);
+	
+	/* Copy the key to the user buffer */
+	ext->key_len = get_wep_key(local, idx);
+	if (ext->key_len > 16) {
+		ext->key_len=0;
+	}
+
+	return 0;
+}
+
+
+/*------------------------------------------------------------------*/
+/*
+ * Wireless Handler : set extended authentication parameters
+ */
+static int airo_set_auth(struct net_device *dev,
+			       struct iw_request_info *info,
+			       union iwreq_data *wrqu, char *extra)
+{
+	struct airo_info *local = dev->priv;
+	struct iw_param *param = &wrqu->param;
+	u16 currentAuthType = local->config.authType;
+
+	switch (param->flags & IW_AUTH_INDEX) {
+	case IW_AUTH_WPA_VERSION:
+	case IW_AUTH_CIPHER_PAIRWISE:
+	case IW_AUTH_CIPHER_GROUP:
+	case IW_AUTH_KEY_MGMT:
+	case IW_AUTH_RX_UNENCRYPTED_EAPOL:
+	case IW_AUTH_PRIVACY_INVOKED:
+		/*
+		 * airo does not use these parameters
+		 */
+		break;
+
+	case IW_AUTH_DROP_UNENCRYPTED:
+		if (param->value) {
+			/* Only change auth type if unencrypted */
+			if (currentAuthType == AUTH_OPEN)
+				local->config.authType = AUTH_ENCRYPT;
+		} else {
+			local->config.authType = AUTH_OPEN;
+		}
+
+		/* Commit the changes to flags if needed */
+		if (local->config.authType != currentAuthType)
+			set_bit (FLAG_COMMIT, &local->flags);
+		break;
+
+	case IW_AUTH_80211_AUTH_ALG: {
+			/* FIXME: What about AUTH_OPEN?  This API seems to
+			 * disallow setting our auth to AUTH_OPEN.
+			 */
+			if (param->value & IW_AUTH_ALG_SHARED_KEY) {
+				local->config.authType = AUTH_SHAREDKEY;
+			} else if (param->value & IW_AUTH_ALG_OPEN_SYSTEM) {
+				local->config.authType = AUTH_ENCRYPT;
+			} else
+				return -EINVAL;
+			break;
+
+			/* Commit the changes to flags if needed */
+			if (local->config.authType != currentAuthType)
+				set_bit (FLAG_COMMIT, &local->flags);
+		}
+
+	case IW_AUTH_WPA_ENABLED:
+		/* Silently accept disable of WPA */
+		if (param->value > 0)
+			return -EOPNOTSUPP;
+		break;
+
+	default:
+		return -EOPNOTSUPP;
+	}
+	return -EINPROGRESS;
+}
+
+
+/*------------------------------------------------------------------*/
+/*
+ * Wireless Handler : get extended authentication parameters
+ */
+static int airo_get_auth(struct net_device *dev,
+			       struct iw_request_info *info,
+			       union iwreq_data *wrqu, char *extra)
+{
+	struct airo_info *local = dev->priv;
+	struct iw_param *param = &wrqu->param;
+	u16 currentAuthType = local->config.authType;
+
+	switch (param->flags & IW_AUTH_INDEX) {
+	case IW_AUTH_DROP_UNENCRYPTED:
+		switch (currentAuthType) {
+		case AUTH_SHAREDKEY:
+		case AUTH_ENCRYPT:
+			param->value = 1;
+			break;
+		default:
+			param->value = 0;
+			break;
+		}
+		break;
+
+	case IW_AUTH_80211_AUTH_ALG:
+		switch (currentAuthType) {
+		case AUTH_SHAREDKEY:
+			param->value = IW_AUTH_ALG_SHARED_KEY;
+			break;
+		case AUTH_ENCRYPT:
+		default:
+			param->value = IW_AUTH_ALG_OPEN_SYSTEM;
+			break;
+		}
+		break;
+
+	case IW_AUTH_WPA_ENABLED:
+		param->value = 0;
+		break;
+
+	default:
+		return -EOPNOTSUPP;
+	}
+	return 0;
+}
+
+
+/*------------------------------------------------------------------*/
+/*
  * Wireless Handler : set Tx-Power
  */
 static int airo_set_txpow(struct net_device *dev,
@@ -7051,6 +7314,15 @@ static const iw_handler		airo_handler[] 
 	(iw_handler) airo_get_encode,		/* SIOCGIWENCODE */
 	(iw_handler) airo_set_power,		/* SIOCSIWPOWER */
 	(iw_handler) airo_get_power,		/* SIOCGIWPOWER */
+	(iw_handler) NULL,			/* -- hole -- */
+	(iw_handler) NULL,			/* -- hole -- */
+	(iw_handler) NULL,			/* SIOCSIWGENIE */
+	(iw_handler) NULL,			/* SIOCGIWGENIE */
+	(iw_handler) airo_set_auth,		/* SIOCSIWAUTH */
+	(iw_handler) airo_get_auth,		/* SIOCGIWAUTH */
+	(iw_handler) airo_set_encodeext,	/* SIOCSIWENCODEEXT */
+	(iw_handler) airo_get_encodeext,	/* SIOCGIWENCODEEXT */
+	(iw_handler) NULL,			/* SIOCSIWPMKSA */
 };
 
 /* Note : don't describe AIROIDIFC and AIROOLDIDIFC in here.

^ permalink raw reply

* [2.6 patch] drivers/net/e1000/: proper prototypes
From: Adrian Bunk @ 2006-01-30 17:20 UTC (permalink / raw)
  To: cramerj, john.ronciak, ganesh.venkatesan; +Cc: jgarzik, netdev, linux-kernel

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


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

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

--- linux-2.6.16-rc1-mm4-full/drivers/net/e1000/e1000.h.old	2006-01-30 02:51:02.000000000 +0100
+++ linux-2.6.16-rc1-mm4-full/drivers/net/e1000/e1000.h	2006-01-30 03:12:13.000000000 +0100
@@ -362,4 +362,26 @@
 	boolean_t have_msi;
 #endif
 };
+
+
+/*  e1000_main.c  */
+extern char e1000_driver_name[];
+extern char e1000_driver_version[];
+int e1000_up(struct e1000_adapter *adapter);
+void e1000_down(struct e1000_adapter *adapter);
+void e1000_reset(struct e1000_adapter *adapter);
+int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
+void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
+int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
+void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
+void e1000_update_stats(struct e1000_adapter *adapter);
+int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
+
+/*  e1000_ethtool.c  */
+void e1000_set_ethtool_ops(struct net_device *netdev);
+
+/*  e1000_param.c  */
+void e1000_check_options(struct e1000_adapter *adapter);
+
+
 #endif /* _E1000_H_ */
--- linux-2.6.16-rc1-mm4-full/drivers/net/e1000/e1000_ethtool.c.old	2006-01-30 02:50:11.000000000 +0100
+++ linux-2.6.16-rc1-mm4-full/drivers/net/e1000/e1000_ethtool.c	2006-01-30 02:50:21.000000000 +0100
@@ -32,19 +32,6 @@
 
 #include <asm/uaccess.h>
 
-extern char e1000_driver_name[];
-extern char e1000_driver_version[];
-
-extern int e1000_up(struct e1000_adapter *adapter);
-extern void e1000_down(struct e1000_adapter *adapter);
-extern void e1000_reset(struct e1000_adapter *adapter);
-extern int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
-extern int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
-extern int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
-extern void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
-extern void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
-extern void e1000_update_stats(struct e1000_adapter *adapter);
-
 struct e1000_stats {
 	char stat_string[ETH_GSTRING_LEN];
 	int sizeof_stat;
--- linux-2.6.16-rc1-mm4-full/drivers/net/e1000/e1000_main.c.old	2006-01-30 02:51:48.000000000 +0100
+++ linux-2.6.16-rc1-mm4-full/drivers/net/e1000/e1000_main.c	2006-01-30 03:16:55.000000000 +0100
@@ -166,14 +166,6 @@
 
 MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
 
-int e1000_up(struct e1000_adapter *adapter);
-void e1000_down(struct e1000_adapter *adapter);
-void e1000_reset(struct e1000_adapter *adapter);
-int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
-int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
-int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
-void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
-void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
 static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
 				    struct e1000_tx_ring *txdr);
 static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
@@ -182,7 +174,6 @@
 				    struct e1000_tx_ring *tx_ring);
 static void e1000_free_rx_resources(struct e1000_adapter *adapter,
 				    struct e1000_rx_ring *rx_ring);
-void e1000_update_stats(struct e1000_adapter *adapter);
 
 /* Local Function Prototypes */
 
@@ -241,7 +232,6 @@
 static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
 static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
 			   int cmd);
-void e1000_set_ethtool_ops(struct net_device *netdev);
 static void e1000_enter_82542_rst(struct e1000_adapter *adapter);
 static void e1000_leave_82542_rst(struct e1000_adapter *adapter);
 static void e1000_tx_timeout(struct net_device *dev);
@@ -270,10 +260,6 @@
 void e1000_rx_schedule(void *data);
 #endif
 
-/* Exported from other modules */
-
-extern void e1000_check_options(struct e1000_adapter *adapter);
-
 static struct pci_driver e1000_driver = {
 	.name     = e1000_driver_name,
 	.id_table = e1000_pci_tbl,

^ permalink raw reply

* Can I do a regular read to simulate prefetch instruction?
From: John Smith @ 2006-01-30 17:25 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel
In-Reply-To: <4807377b0601271404w6dbfcff6s4de1c3f785dded9f@mail.gmail.com>

Hi,

I find out some network card drivers (e.g. e1000 driver) use prefetch 
instruction
to reduce memory access latency and speed up data operation. My question is:
Support we want to pre-read a skb buffer into the cache, what is the 
difference
between the following two methods, i.e. what is the different when using 
prefetch
and using a regular read opertation?
1. use prefetch instruction to stimulate a pre-fetch of the skb address,
    e.g. prefetch(skb);
2. use an assignment statement to stimulate a pre-fetch of the skb address,
    e.g. skb1 = skb;

I was told the data will be prefetched into a so-called prefetching queue 
only by
using prefetching instruction? Is this true?

Thanks,

John

^ permalink raw reply

* 2.6.16-rc1-mm4: ACX=y, ACX_USB=n compile error
From: Adrian Bunk @ 2006-01-30 18:10 UTC (permalink / raw)
  To: Gabriel C., Denis Vlasenko, linville; +Cc: linux-kernel, da.crew, netdev
In-Reply-To: <20060130133833.7b7a3f8e@zwerg>

On Mon, Jan 30, 2006 at 01:38:33PM +0100, Gabriel C. wrote:

> Hello,

Hi Gabriel,

> I got this compile error with 2.6.16-rc1-mm4 , config attached. 
> 
> 
>   LD      .tmp_vmlinux1
> drivers/built-in.o: In function
> `acx_l_transmit_authen1':common.c:(.text+0x6cd62): undefined reference
> to `acxusb_l_alloc_tx' :common.c:(.text+0x6cd74): undefined reference
> to `acxusb_l_get_txbuf' :common.c:(.text+0x6cdeb): undefined reference
> to `acxusb_l_tx_data' drivers/built-in.o: In function
> `acx_s_configure_debug': undefined reference to
> `acxusb_s_issue_cmd_timeo_debug' drivers/built-in.o: In function
> [many more]
>...

Thanks for your report.

@Denis:
The problem seems to be CONFIG_ACX=y, CONFIG_ACX_USB=n.

> Gabriel 

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

^ permalink raw reply

* [2.6 patch] PCMCIA=m, HOSTAP_CS=y is not a legal configuration
From: Adrian Bunk @ 2006-01-30 18:23 UTC (permalink / raw)
  To: Gabriel C., linville; +Cc: linux-kernel, da.crew, netdev
In-Reply-To: <20060130133833.7b7a3f8e@zwerg>

On Mon, Jan 30, 2006 at 01:38:33PM +0100, Gabriel C. wrote:

> Hello,

Hallo Gabriel,

> I got this compile error with 2.6.16-rc1-mm4 , config attached. 
> 
> 
>   LD      .tmp_vmlinux1
>...
> `sandisk_set_iobase':hostap_cs.c:(.text+0x801ad): undefined reference
> to `pcmcia_access_configuration_register' :hostap_cs.c:(.text+0x801f3):
> undefined reference to `pcmcia_access_configuration_register'
> drivers/built-in.o: In function
> `prism2_pccard_cor_sreset':hostap_cs.c:(.text+0x80254): undefined
> reference to
> `pcmcia_access_configuration_register' :hostap_cs.c:(.text+0x80289):
> undefined reference to
> `pcmcia_access_configuration_register' :hostap_cs.c:(.text+0x80325):
> undefined reference to `pcmcia_access_configuration_register'
> [more errors]
>...

thanks for your report, a patch is below.

> Gabriel 

cu
Adrian


<--  snip  -->


CONFIG_PCMCIA=m, CONFIG_HOSTAP_CS=y doesn't compile.

Reported by "Gabriel C." <crazy@pimpmylinux.org>.


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.16-rc1-mm4/drivers/net/wireless/hostap/Kconfig.old	2006-01-30 19:00:44.000000000 +0100
+++ linux-2.6.16-rc1-mm4/drivers/net/wireless/hostap/Kconfig	2006-01-30 19:01:04.000000000 +0100
@@ -75,7 +75,7 @@
 
 config HOSTAP_CS
 	tristate "Host AP driver for Prism2/2.5/3 PC Cards"
-	depends on PCMCIA!=n && HOSTAP
+	depends on PCMCIA && HOSTAP
 	---help---
 	Host AP driver's version for Prism2/2.5/3 PC Cards.
 

^ permalink raw reply

* Re: [2.6 patch] drivers/net/e1000/: proper prototypes
From: John Ronciak @ 2006-01-30 18:46 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: cramerj, john.ronciak, ganesh.venkatesan, jgarzik, netdev,
	linux-kernel
In-Reply-To: <20060130172047.GB3655@stusta.de>

I ACK this patch.

Jeff please apply.

--
Cheers,
John

^ permalink raw reply

* Re: [2.6.15 patch] wireless/airo: add IWENCODEEXT and IWAUTH support
From: Robert Love @ 2006-01-30 19:04 UTC (permalink / raw)
  To: Dan Williams
  Cc: jgarzik, netdev, breed, networkmanager-list, John W. Linville
In-Reply-To: <1138640281.12551.5.camel@dhcp83-115.boston.redhat.com>

On Mon, 2006-01-30 at 11:58 -0500, Dan Williams wrote:

> This patch adds IWENCODEEXT and IWAUTH support to the airo driver for
> WEP and unencrypted operation.  No WPA though.  It allows the driver to
> operate more willingly with wpa_supplicant and NetworkManager.
> 
> Signed-off-by: Dan Williams <dcbw@redhat.com>

Tested on my airo and works.

Acked-by: Robert Love <rml@novell.com>

	Robert Love

^ permalink raw reply

* [BUG] 8139too fails for ip autoconfig and nfsroot
From: Knut Petersen @ 2006-01-30 19:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, jgarzik

I have a number of systems equipped with:

0000:05:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. 
RTL-8139/8139C/8139C+ (rev 10)
        Subsystem: Realtek Semiconductor Co., Ltd. RT8139
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 32 (8000ns min, 16000ns max)
        Interrupt: pin A routed to IRQ 177
        Region 0: I/O ports at d000 [size=1027M]
        Region 1: Memory at d0320000 (32-bit, non-prefetchable) [size=256]
        Expansion ROM at 00020000 [disabled]
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA 
PME(D0-,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Those cards have PXE boot roms.

There are no problems in normal operation, but something is totaly wrong 
when I
try to use those cards for network booting:

I compiled a kernel for nfsroot and dhcp ip autoconfiguration, 
configured the server and tried
to boot. Well, booting memtest and booting msdos works perfectly fine. 
Loading the kernel
is also no problem, but at the point of ip autoconfiguration (ip=dhcp) 
the kernel loops sending
DHCPDISCOVER packets. Those packets arrive at the server, and the server 
responds appropiately.
ic_bootp_recv() never gets called (checked by a printk). I suspected a 
server malconfiguration,
but found none. Skipping ip autoconfig is no solution, the kernel then 
fails trying rpc lookup.

Then I tried to netboot another system with the same kernel + via rhine 
driver, same server
config. Voila, dhcp ip autoconfig and rpc port lookup is not a problem 
on this system.

During my search for a solution I tried some recent kernels, the oldest 
2.6.14. All fail with 8139too.

Any ideas?

cu,
 Knut

^ permalink raw reply

* Re: [2.6 patch] PCMCIA=m, HOSTAP_CS=y is not a legal configuration
From: Gabriel C. @ 2006-01-30 20:30 UTC (permalink / raw)
  To: linux-kernel, linville; +Cc: netdev, Adrian Bunk, da.crew
In-Reply-To: <20060130182317.GD3655@stusta.de>

On Mon, 30 Jan 2006 19:23:17 +0100
Adrian Bunk <bunk@stusta.de> wrote:

> On Mon, Jan 30, 2006 at 01:38:33PM +0100, Gabriel C. wrote:
> 
> > Hello,
> 
> Hallo Gabriel,
> 
> > I got this compile error with 2.6.16-rc1-mm4 , config attached. 
> > 
> > 
> >   LD      .tmp_vmlinux1
> >...
> > `sandisk_set_iobase':hostap_cs.c:(.text+0x801ad): undefined
> > reference to
> > `pcmcia_access_configuration_register' :hostap_cs.c:(.text+0x801f3):
> > undefined reference to `pcmcia_access_configuration_register'
> > drivers/built-in.o: In function
> > `prism2_pccard_cor_sreset':hostap_cs.c:(.text+0x80254): undefined
> > reference to
> > `pcmcia_access_configuration_register' :hostap_cs.c:(.text+0x80289):
> > undefined reference to
> > `pcmcia_access_configuration_register' :hostap_cs.c:(.text+0x80325):
> > undefined reference to `pcmcia_access_configuration_register' [more
> > errors]
> >...
> 
> thanks for your report, a patch is below.
> > Gabriel 
> 
> cu
> Adrian
> 
> 
> <--  snip  -->
> 
> 
> CONFIG_PCMCIA=m, CONFIG_HOSTAP_CS=y doesn't compile.
> 
> Reported by "Gabriel C." <crazy@pimpmylinux.org>.
> 
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> ---
> linux-2.6.16-rc1-mm4/drivers/net/wireless/hostap/Kconfig.old
> 2006-01-30 19:00:44.000000000 +0100 +++
> linux-2.6.16-rc1-mm4/drivers/net/wireless/hostap/Kconfig
> 2006-01-30 19:01:04.000000000 +0100 @@ -75,7 +75,7 @@ config HOSTAP_CS
>  	tristate "Host AP driver for Prism2/2.5/3 PC Cards"
> -	depends on PCMCIA!=n && HOSTAP
> +	depends on PCMCIA && HOSTAP
>  	---help---
>  	Host AP driver's version for Prism2/2.5/3 PC Cards.
>  
> 

Hi Adrian,

Your patch works fine,  thanks :)

Gabriel

^ permalink raw reply

* skge bridge & hw csum failure (Was: Re: [BUG] sky2 broken for Yukon PCI-E Gigabit Ethernet Controller 11ab:4362 (rev 19))
From: Pekka Pietikainen @ 2006-01-30 23:16 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Knut Petersen, shemminger, netdev, linux-kernel, David S. Miller

On Fri, Jan 27, 2006 at 11:22:42PM +1100, Herbert Xu wrote:
> OK, although we can't rule out sky2/netfilter from the enquiry, I've
> identified two bugs in ppp/pppoe that may be responsible for what you
> are seeing.  So please try the following patch and let us know if the
> problem still exists (or deteriorates/improves).
Borrowing this thread for a related problem, I'm getting lots of those on a
bridge device (this one running skge, rmmod skge; modprobe sk98lin actually
seemed to do it too, I've disabled rx checksums with ethtool for now). 
Kernel is a 2.6.15.1-ish Fedora one.

skge:

bridge-cd: hw csum failure.
 [<c02c8fd8>] __skb_checksum_complete+0x56/0x5c     [<f8a5f833>]
icmp_error+0xbf/0x1af [ip_conntrack]
 [<c012073a>] __wake_up+0x32/0x43     [<f8a5f774>] icmp_error+0x0/0x1af
[ip_conntrack]
 [<f8a5cb57>] ip_conntrack_in+0x95/0x2d6 [ip_conntrack]     [<c01393c7>]
__wake_up_bit+0x2e/0x33
 [<c016b6d9>] end_buffer_async_write+0xbf/0x12a     [<c02e26fd>]
nf_iterate+0x60/0x84
 [<f8a8208d>] br_nf_pre_routing_finish+0x0/0x320 [bridge]     [<c02e276e>]
nf_hook_slow+0x4d/0xf9
 [<f8a8208d>] br_nf_pre_routing_finish+0x0/0x320 [bridge]     [<f8a829ec>]
br_nf_pre_routing+0x2f5/0x431 [bridge]
 [<f8a8208d>] br_nf_pre_routing_finish+0x0/0x320 [bridge]     [<c02e26fd>]
nf_iterate+0x60/0x84
 [<f8a7e8f9>] br_handle_frame_finish+0x0/0xe9 [bridge]     [<c02e276e>]
nf_hook_slow+0x4d/0xf9
 [<f8a7e8f9>] br_handle_frame_finish+0x0/0xe9 [bridge]     [<f8a7eb46>]
br_handle_frame+0x164/0x23e [bridge]
 [<f8a7e8f9>] br_handle_frame_finish+0x0/0xe9 [bridge]     [<c02cbbe5>]
netif_receive_skb+0x1ac/0x325
 [<f88d5975>] skge_poll+0x3b6/0x4be [skge]     [<c012dca4>]
__mod_timer+0x85/0xa0
 [<c02cbf3e>] net_rx_action+0xb7/0x1bb     [<c012a2f2>]
__do_softirq+0x72/0xdc
 [<c0106393>] do_softirq+0x4b/0x4f
 =======================
 [<c0106275>] do_IRQ+0x55/0x86     [<c0119d81>]
smp_apic_timer_interrupt+0xc1/0xca
 [<c0104a8e>] common_interrupt+0x1a/0x20     [<c0102287>]
mwait_idle+0x2a/0x34
 [<c01020ef>] cpu_idle+0x6c/0xa7     [<c040187f>] start_kernel+0x173/0x1ca
 [<c0401304>] unknown_bootoption+0x0/0x1b6


and sk98lin 
bridge-cd: hw csum failure.
 [<c02c8fd8>] __skb_checksum_complete+0x56/0x5c     [<f8a5f833>]
icmp_error+0xbf/0x1af [ip_conntrack]
 [<c01393c7>] __wake_up_bit+0x2e/0x33     [<f8a5f774>] icmp_error+0x0/0x1af
[ip_conntrack]
 [<f8a5cb57>] ip_conntrack_in+0x95/0x2d6 [ip_conntrack]     [<c014d4a2>]
mempool_free+0x3a/0x73
 [<c016dfad>] end_bio_bh_io_sync+0x0/0x4f     [<c016dfad>]
end_bio_bh_io_sync+0x0/0x4f
 [<c02e26fd>] nf_iterate+0x60/0x84     [<f8a8208d>]
br_nf_pre_routing_finish+0x0/0x320 [bridge]
 [<c02e276e>] nf_hook_slow+0x4d/0xf9     [<f8a8208d>]
br_nf_pre_routing_finish+0x0/0x320 [bridge]
 [<f8a829ec>] br_nf_pre_routing+0x2f5/0x431 [bridge]     [<f8a8208d>]
br_nf_pre_routing_finish+0x0/0x320 [bridge]
 [<c02e26fd>] nf_iterate+0x60/0x84     [<f8a7e8f9>]
br_handle_frame_finish+0x0/0xe9 [bridge]
 [<c02e276e>] nf_hook_slow+0x4d/0xf9     [<f8a7e8f9>]
br_handle_frame_finish+0x0/0xe9 [bridge]
 [<f8a7eb46>] br_handle_frame+0x164/0x23e [bridge]     [<f8a7e8f9>]
br_handle_frame_finish+0x0/0xe9 [bridge]
 [<c02cbbe5>] netif_receive_skb+0x1ac/0x325     [<c02cbde1>]
process_backlog+0x83/0x129
 [<c02cbf3e>] net_rx_action+0xb7/0x1bb     [<c012a2f2>]
__do_softirq+0x72/0xdc
 [<c0106393>] do_softirq+0x4b/0x4f
 =======================
 [<c0106275>] do_IRQ+0x55/0x86     [<c0104a8e>] common_interrupt+0x1a/0x20
 [<c014a162>] page_waitqueue+0x5/0x32     [<c014a217>] unlock_page+0x1d/0x27
 [<c016c7e8>] __block_write_full_page+0x1e7/0x354     [<f8985176>]
ext3_get_block+0x0/0x90 [ext3]
 [<c016df49>] block_write_full_page+0xe3/0x109     [<f8985176>]
ext3_get_block+0x0/0x90 [ext3]
 [<f8985cea>] ext3_ordered_writepage+0xe5/0x183 [ext3]     [<f8985be5>]
bget_one+0x0/0x7 [ext3]
 [<c018cfdb>] mpage_writepages+0x222/0x3ee     [<f8985c05>]
ext3_ordered_writepage+0x0/0x183 [ext3]
 [<c0149c78>] __filemap_fdatawrite_range+0x66/0x72     [<c0149ca7>]
filemap_fdatawrite+0x23/0x27
 [<c016b2e9>] do_fsync+0x55/0xc8     [<c0104049>] syscall_call+0x7/0xb

iptables forward chain is just ACCEPT...

^ permalink raw reply

* [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack
From: Harald Welte @ 2006-01-30 23:22 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1781 bytes --]

Hi Dave!

Please apply this humble little step towards ip_conntrack shrinking,
thanks!

[NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack

This patch reduces the size of 'struct ip_conntrack' on systems with NAT
by eight bytes.  The sequence number delta values can be int16_t, since
we only support one sequence number modification per window anyway, and
one such modification is not going to exceed 32kB ;)

Signed-off-by: Harald Welte <laforge@netfilter.org>

---
commit 94d3d40c84672b74e59ea5252f61602610e1513e
tree 63e5ae5174af9f982be6d8d1bbe11e750e4ace32
parent e3c7a1f99300fbd6de35a40fcd9c4dc1b0fbfee2
author Harald Welte <laforge@netfilter.org> Fri, 27 Jan 2006 16:03:45 +0100
committer Harald Welte <laforge@netfilter.org> Fri, 27 Jan 2006 16:03:45 +0100

 include/linux/netfilter_ipv4/ip_nat.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index 41a107d..e9f5ed1 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -23,7 +23,7 @@ struct ip_nat_seq {
 	 * modification (if any) */
 	u_int32_t correction_pos;
 	/* sequence number offset before and after last modification */
-	int32_t offset_before, offset_after;
+	int16_t offset_before, offset_after;
 };
 
 /* Single range specification. */
-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related

* [PATCH] [NETFILTER] nfnetlink_log: add sequence numbers for log events
From: Harald Welte @ 2006-01-30 23:23 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 6290 bytes --]

Hi Dave,

please apply, thanks!

[NETFILTER] nfnetlink_log: add sequence numbers for log events

By using a sequence number for every logged netfilter event, we can
determine from userspace whether logging information was lots somewhere
downstream.

The user has a choice of either having per-instance local sequence
counters, or using a global sequence counter, or both.

Signed-off-by: Harald Welte <laforge@netfilter.org>

---
commit e3c7a1f99300fbd6de35a40fcd9c4dc1b0fbfee2
tree fa0df65edd0ec729af8033c0605b19dc49c1a688
parent 1259fffe55307fa41e932a594442aa78e1e37cfd
author Harald Welte <laforge@netfilter.org> Thu, 26 Jan 2006 15:05:29 +0100
committer Harald Welte <laforge@netfilter.org> Thu, 26 Jan 2006 15:05:29 +0100

 include/linux/netfilter/nfnetlink_log.h |    6 ++++
 net/netfilter/nfnetlink_log.c           |   46 +++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h
index b04b038..a7497c7 100644
--- a/include/linux/netfilter/nfnetlink_log.h
+++ b/include/linux/netfilter/nfnetlink_log.h
@@ -47,6 +47,8 @@ enum nfulnl_attr_type {
 	NFULA_PAYLOAD,			/* opaque data payload */
 	NFULA_PREFIX,			/* string prefix */
 	NFULA_UID,			/* user id of socket */
+	NFULA_SEQ,			/* instance-local sequence number */
+	NFULA_SEQ_GLOBAL,		/* global sequence number */
 
 	__NFULA_MAX
 };
@@ -77,6 +79,7 @@ enum nfulnl_attr_config {
 	NFULA_CFG_NLBUFSIZ,		/* u_int32_t buffer size */
 	NFULA_CFG_TIMEOUT,		/* u_int32_t in 1/100 s */
 	NFULA_CFG_QTHRESH,		/* u_int32_t */
+	NFULA_CFG_FLAGS,		/* u_int16_t */
 	__NFULA_CFG_MAX
 };
 #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1)
@@ -85,4 +88,7 @@ enum nfulnl_attr_config {
 #define NFULNL_COPY_META	0x01
 #define NFULNL_COPY_PACKET	0x02
 
+#define NFULNL_CFG_F_SEQ	0x0001
+#define NFULNL_CFG_F_SEQ_GLOBAL	0x0002
+
 #endif /* _NFNETLINK_LOG_H */
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index e10512e..a98d0b7 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -11,6 +11,10 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  *
+ * 2006-01-26 Harald Welte <laforge@netfilter.org>
+ * 	- Add optional local and global sequence number to detect lost 
+ * 	  events from userspace
+ *
  */
 #include <linux/module.h>
 #include <linux/skbuff.h>
@@ -68,11 +72,14 @@ struct nfulnl_instance {
 	unsigned int nlbufsiz;		/* netlink buffer allocation size */
 	unsigned int qthreshold;	/* threshold of the queue */
 	u_int32_t copy_range;
+	u_int32_t seq;			/* instance-local sequential counter */
 	u_int16_t group_num;		/* number of this queue */
+	u_int16_t flags;
 	u_int8_t copy_mode;	
 };
 
 static DEFINE_RWLOCK(instances_lock);
+static atomic_t global_seq;
 
 #define INSTANCE_BUCKETS	16
 static struct hlist_head instance_table[INSTANCE_BUCKETS];
@@ -310,6 +317,16 @@ nfulnl_set_qthresh(struct nfulnl_instanc
 	return 0;
 }
 
+static int
+nfulnl_set_flags(struct nfulnl_instance *inst, u_int16_t flags)
+{
+	spin_lock_bh(&inst->lock);
+	inst->flags = ntohs(flags);
+	spin_unlock_bh(&inst->lock);
+
+	return 0;
+}
+
 static struct sk_buff *nfulnl_alloc_skb(unsigned int inst_size, 
 					unsigned int pkt_size)
 {
@@ -373,6 +390,8 @@ static void nfulnl_timer(unsigned long d
 	spin_unlock_bh(&inst->lock);
 }
 
+/* This is an inline function, we don't really care about a long
+ * list of arguments */
 static inline int 
 __build_packet_message(struct nfulnl_instance *inst,
 			const struct sk_buff *skb, 
@@ -511,6 +530,17 @@ __build_packet_message(struct nfulnl_ins
 			read_unlock_bh(&skb->sk->sk_callback_lock);
 	}
 
+	/* local sequence number */
+	if (inst->flags & NFULNL_CFG_F_SEQ) {
+		tmp_uint = htonl(inst->seq++);
+		NFA_PUT(inst->skb, NFULA_SEQ, sizeof(tmp_uint), &tmp_uint);
+	}
+	/* global sequence number */
+	if (inst->flags & NFULNL_CFG_F_SEQ_GLOBAL) {
+		tmp_uint = atomic_inc_return(&global_seq);
+		NFA_PUT(inst->skb, NFULA_SEQ_GLOBAL, sizeof(tmp_uint), &tmp_uint);
+	}
+
 	if (data_len) {
 		struct nfattr *nfa;
 		int size = NFA_LENGTH(data_len);
@@ -603,6 +633,11 @@ nfulnl_log_packet(unsigned int pf,
 
 	spin_lock_bh(&inst->lock);
 
+	if (inst->flags & NFULNL_CFG_F_SEQ)
+		size += NFA_SPACE(sizeof(u_int32_t));
+	if (inst->flags & NFULNL_CFG_F_SEQ_GLOBAL)
+		size += NFA_SPACE(sizeof(u_int32_t));
+
 	qthreshold = inst->qthreshold;
 	/* per-rule qthreshold overrides per-instance */
 	if (qthreshold > li->u.ulog.qthreshold)
@@ -732,10 +767,14 @@ static const int nfula_min[NFULA_MAX] = 
 	[NFULA_TIMESTAMP-1]	= sizeof(struct nfulnl_msg_packet_timestamp),
 	[NFULA_IFINDEX_INDEV-1]	= sizeof(u_int32_t),
 	[NFULA_IFINDEX_OUTDEV-1]= sizeof(u_int32_t),
+	[NFULA_IFINDEX_PHYSINDEV-1]	= sizeof(u_int32_t),
+	[NFULA_IFINDEX_PHYSOUTDEV-1]	= sizeof(u_int32_t),
 	[NFULA_HWADDR-1]	= sizeof(struct nfulnl_msg_packet_hw),
 	[NFULA_PAYLOAD-1]	= 0,
 	[NFULA_PREFIX-1]	= 0,
 	[NFULA_UID-1]		= sizeof(u_int32_t),
+	[NFULA_SEQ-1]		= sizeof(u_int32_t),
+	[NFULA_SEQ_GLOBAL-1]	= sizeof(u_int32_t),
 };
 
 static const int nfula_cfg_min[NFULA_CFG_MAX] = {
@@ -744,6 +783,7 @@ static const int nfula_cfg_min[NFULA_CFG
 	[NFULA_CFG_TIMEOUT-1]	= sizeof(u_int32_t),
 	[NFULA_CFG_QTHRESH-1]	= sizeof(u_int32_t),
 	[NFULA_CFG_NLBUFSIZ-1]	= sizeof(u_int32_t),
+	[NFULA_CFG_FLAGS-1]	= sizeof(u_int16_t),
 };
 
 static int
@@ -855,6 +895,12 @@ nfulnl_recv_config(struct sock *ctnl, st
 		nfulnl_set_qthresh(inst, ntohl(qthresh));
 	}
 
+	if (nfula[NFULA_CFG_FLAGS-1]) {
+		u_int16_t flags =
+			*(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]);
+		nfulnl_set_flags(inst, ntohl(flags));
+	}
+
 out_put:
 	instance_put(inst);
 	return ret;
-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox