* Re: [PATCH 2.6.17-rc1] Fix RtNetlink ENCODE security permissions
From: Jean Tourrilhes @ 2006-04-14 18:06 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: linville, netdev, stable
In-Reply-To: <20060414105913.0222a8a6.rdunlap@xenotime.net>
On Fri, Apr 14, 2006 at 10:59:13AM -0700, Randy.Dunlap wrote:
> On Fri, 14 Apr 2006 10:47:26 -0700 Jean Tourrilhes wrote:
>
> > Hi John,
> >
> > I've just realised that the RtNetlink code does not check the
> > permission for SIOCGIWENCODE and SIOCGIWENCODEEXT, which means that
> > any user can read the encryption keys. The fix is trivial and should
> > go in 2.6.17 alonside the two other patch I sent you last week.
> > Fully tested on 2.6.17-rc1.
>
> and for -stable ??
The RtNetlink code (WE-20) was only included in 2.6.17-rc1 and
therefore is not available in 2.6.16.
Jean
^ permalink raw reply
* Re: [stable] Re: [PATCH 2.6.17-rc1] Fix RtNetlink ENCODE security permissions
From: Greg KH @ 2006-04-14 18:06 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: jt, netdev, linville, stable
In-Reply-To: <20060414105913.0222a8a6.rdunlap@xenotime.net>
On Fri, Apr 14, 2006 at 10:59:13AM -0700, Randy.Dunlap wrote:
> On Fri, 14 Apr 2006 10:47:26 -0700 Jean Tourrilhes wrote:
>
> > Hi John,
> >
> > I've just realised that the RtNetlink code does not check the
> > permission for SIOCGIWENCODE and SIOCGIWENCODEEXT, which means that
> > any user can read the encryption keys. The fix is trivial and should
> > go in 2.6.17 alonside the two other patch I sent you last week.
> > Fully tested on 2.6.17-rc1.
>
> and for -stable ??
At first glance, I'd agree with this. Jean?
thanks,
greg k-h
^ permalink raw reply
* [PATCH] sir: switch to a workqueue
From: Christoph Hellwig @ 2006-04-14 18:20 UTC (permalink / raw)
To: info, jt; +Cc: netdev
sir_kthread.c pretty much duplicates the workqueue functionality.
Switch it to use a workqueue instead. It could probably use
schedule_work/schedule_delayed_work instead of having it's own
waitqueue, but I'd rather leave that to the maintainer. The file
should probably get a name that still makes sense or merged into
sir-dev.c now, but again that's up to the maintainer.
Note: I don't have the hardware so this is just compile-tested.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/drivers/net/irda/sir-dev.h
===================================================================
--- linux-2.6.orig/drivers/net/irda/sir-dev.h 2006-01-31 12:23:36.000000000 +0100
+++ linux-2.6/drivers/net/irda/sir-dev.h 2006-04-14 15:08:14.000000000 +0200
@@ -15,23 +15,15 @@
#define IRDA_SIR_H
#include <linux/netdevice.h>
+#include <linux/workqueue.h>
#include <net/irda/irda.h>
#include <net/irda/irda_device.h> // iobuff_t
-/* FIXME: unify irda_request with sir_fsm! */
-
-struct irda_request {
- struct list_head lh_request;
- unsigned long pending;
- void (*func)(void *);
- void *data;
- struct timer_list timer;
-};
struct sir_fsm {
struct semaphore sem;
- struct irda_request rq;
+ struct work_struct work;
unsigned state, substate;
int param;
int result;
Index: linux-2.6/drivers/net/irda/sir_dev.c
===================================================================
--- linux-2.6.orig/drivers/net/irda/sir_dev.c 2006-04-14 15:02:46.000000000 +0200
+++ linux-2.6/drivers/net/irda/sir_dev.c 2006-04-14 15:03:15.000000000 +0200
@@ -619,10 +619,6 @@
spin_lock_init(&dev->tx_lock);
init_MUTEX(&dev->fsm.sem);
- INIT_LIST_HEAD(&dev->fsm.rq.lh_request);
- dev->fsm.rq.pending = 0;
- init_timer(&dev->fsm.rq.timer);
-
dev->drv = drv;
dev->netdev = ndev;
Index: linux-2.6/drivers/net/irda/sir_kthread.c
===================================================================
--- linux-2.6.orig/drivers/net/irda/sir_kthread.c 2006-04-14 14:54:08.000000000 +0200
+++ linux-2.6/drivers/net/irda/sir_kthread.c 2006-04-14 15:10:56.000000000 +0200
@@ -14,159 +14,14 @@
#include <linux/module.h>
#include <linux/kernel.h>
-#include <linux/version.h>
#include <linux/init.h>
-#include <linux/smp_lock.h>
-#include <linux/completion.h>
#include <linux/delay.h>
-
#include <net/irda/irda.h>
#include "sir-dev.h"
-/**************************************************************************
- *
- * kIrDAd kernel thread and config state machine
- *
- */
-
-struct irda_request_queue {
- struct list_head request_list;
- spinlock_t lock;
- task_t *thread;
- struct completion exit;
- wait_queue_head_t kick, done;
- atomic_t num_pending;
-};
-
-static struct irda_request_queue irda_rq_queue;
-
-static int irda_queue_request(struct irda_request *rq)
-{
- int ret = 0;
- unsigned long flags;
-
- if (!test_and_set_bit(0, &rq->pending)) {
- spin_lock_irqsave(&irda_rq_queue.lock, flags);
- list_add_tail(&rq->lh_request, &irda_rq_queue.request_list);
- wake_up(&irda_rq_queue.kick);
- atomic_inc(&irda_rq_queue.num_pending);
- spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
- ret = 1;
- }
- return ret;
-}
-
-static void irda_request_timer(unsigned long data)
-{
- struct irda_request *rq = (struct irda_request *)data;
- unsigned long flags;
-
- spin_lock_irqsave(&irda_rq_queue.lock, flags);
- list_add_tail(&rq->lh_request, &irda_rq_queue.request_list);
- wake_up(&irda_rq_queue.kick);
- spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
-}
-
-static int irda_queue_delayed_request(struct irda_request *rq, unsigned long delay)
-{
- int ret = 0;
- struct timer_list *timer = &rq->timer;
- if (!test_and_set_bit(0, &rq->pending)) {
- timer->expires = jiffies + delay;
- timer->function = irda_request_timer;
- timer->data = (unsigned long)rq;
- atomic_inc(&irda_rq_queue.num_pending);
- add_timer(timer);
- ret = 1;
- }
- return ret;
-}
-
-static void run_irda_queue(void)
-{
- unsigned long flags;
- struct list_head *entry, *tmp;
- struct irda_request *rq;
-
- spin_lock_irqsave(&irda_rq_queue.lock, flags);
- list_for_each_safe(entry, tmp, &irda_rq_queue.request_list) {
- rq = list_entry(entry, struct irda_request, lh_request);
- list_del_init(entry);
- spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
-
- clear_bit(0, &rq->pending);
- rq->func(rq->data);
-
- if (atomic_dec_and_test(&irda_rq_queue.num_pending))
- wake_up(&irda_rq_queue.done);
-
- spin_lock_irqsave(&irda_rq_queue.lock, flags);
- }
- spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
-}
-
-static int irda_thread(void *startup)
-{
- DECLARE_WAITQUEUE(wait, current);
-
- daemonize("kIrDAd");
-
- irda_rq_queue.thread = current;
-
- complete((struct completion *)startup);
-
- while (irda_rq_queue.thread != NULL) {
-
- /* We use TASK_INTERRUPTIBLE, rather than
- * TASK_UNINTERRUPTIBLE. Andrew Morton made this
- * change ; he told me that it is safe, because "signal
- * blocking is now handled in daemonize()", he added
- * that the problem is that "uninterruptible sleep
- * contributes to load average", making user worry.
- * Jean II */
- set_task_state(current, TASK_INTERRUPTIBLE);
- add_wait_queue(&irda_rq_queue.kick, &wait);
- if (list_empty(&irda_rq_queue.request_list))
- schedule();
- else
- __set_task_state(current, TASK_RUNNING);
- remove_wait_queue(&irda_rq_queue.kick, &wait);
-
- /* make swsusp happy with our thread */
- try_to_freeze();
-
- run_irda_queue();
- }
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,35)
- reparent_to_init();
-#endif
- complete_and_exit(&irda_rq_queue.exit, 0);
- /* never reached */
- return 0;
-}
-
-
-static void flush_irda_queue(void)
-{
- if (atomic_read(&irda_rq_queue.num_pending)) {
-
- DECLARE_WAITQUEUE(wait, current);
-
- if (!list_empty(&irda_rq_queue.request_list))
- run_irda_queue();
-
- set_task_state(current, TASK_UNINTERRUPTIBLE);
- add_wait_queue(&irda_rq_queue.done, &wait);
- if (atomic_read(&irda_rq_queue.num_pending))
- schedule();
- else
- __set_task_state(current, TASK_RUNNING);
- remove_wait_queue(&irda_rq_queue.done, &wait);
- }
-}
+static struct workqueue_struct *irda_wq;
/* substate handler of the config-fsm to handle the cases where we want
* to wait for transmit completion before changing the port configuration
@@ -413,7 +268,7 @@
fsm->state = next_state;
} while(!delay);
- irda_queue_delayed_request(&fsm->rq, msecs_to_jiffies(delay));
+ queue_delayed_work(irda_wq, &fsm->work, msecs_to_jiffies(delay));
}
/* schedule some device configuration task for execution by kIrDAd
@@ -424,7 +279,6 @@
int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned param)
{
struct sir_fsm *fsm = &dev->fsm;
- int xmit_was_down;
IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param);
@@ -443,7 +297,6 @@
return -ESTALE; /* or better EPIPE? */
}
- xmit_was_down = netif_queue_stopped(dev->netdev);
netif_stop_queue(dev->netdev);
atomic_set(&dev->enable_rx, 0);
@@ -451,58 +304,27 @@
fsm->param = param;
fsm->result = 0;
- INIT_LIST_HEAD(&fsm->rq.lh_request);
- fsm->rq.pending = 0;
- fsm->rq.func = irda_config_fsm;
- fsm->rq.data = dev;
-
- if (!irda_queue_request(&fsm->rq)) { /* returns 0 on error! */
- atomic_set(&dev->enable_rx, 1);
- if (!xmit_was_down)
- netif_wake_queue(dev->netdev);
- up(&fsm->sem);
- return -EAGAIN;
- }
+ INIT_WORK(&fsm->work, irda_config_fsm, dev);
+ queue_work(irda_wq, &fsm->work);
return 0;
}
-static int __init irda_thread_create(void)
+static int __init irda_thread_init(void)
{
- struct completion startup;
- int pid;
-
- spin_lock_init(&irda_rq_queue.lock);
- irda_rq_queue.thread = NULL;
- INIT_LIST_HEAD(&irda_rq_queue.request_list);
- init_waitqueue_head(&irda_rq_queue.kick);
- init_waitqueue_head(&irda_rq_queue.done);
- atomic_set(&irda_rq_queue.num_pending, 0);
-
- init_completion(&startup);
- pid = kernel_thread(irda_thread, &startup, CLONE_FS|CLONE_FILES);
- if (pid <= 0)
- return -EAGAIN;
- else
- wait_for_completion(&startup);
-
+ irda_wq = create_singlethread_workqueue("irda_wq");
+ if (!irda_wq)
+ return -ENOMEM;
return 0;
}
-static void __exit irda_thread_join(void)
+static void __exit irda_thread_exit(void)
{
- if (irda_rq_queue.thread) {
- flush_irda_queue();
- init_completion(&irda_rq_queue.exit);
- irda_rq_queue.thread = NULL;
- wake_up(&irda_rq_queue.kick);
- wait_for_completion(&irda_rq_queue.exit);
- }
+ destroy_workqueue(irda_wq);
}
-module_init(irda_thread_create);
-module_exit(irda_thread_join);
+module_init(irda_thread_init);
+module_exit(irda_thread_exit);
MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>");
MODULE_DESCRIPTION("IrDA SIR core");
MODULE_LICENSE("GPL");
-
^ permalink raw reply
* Re: [PATCH] sir: switch to a workqueue
From: Jean Tourrilhes @ 2006-04-14 18:22 UTC (permalink / raw)
To: Christoph Hellwig, Samuel Ortiz; +Cc: netdev
In-Reply-To: <20060414182015.GA20662@lst.de>
On Fri, Apr 14, 2006 at 08:20:15PM +0200, Christoph Hellwig wrote:
> sir_kthread.c pretty much duplicates the workqueue functionality.
> Switch it to use a workqueue instead. It could probably use
> schedule_work/schedule_delayed_work instead of having it's own
> waitqueue, but I'd rather leave that to the maintainer. The file
> should probably get a name that still makes sense or merged into
> sir-dev.c now, but again that's up to the maintainer.
>
> Note: I don't have the hardware so this is just compile-tested.
>
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Samuel Ortiz is in charge and has some shiny new Actisys
dongles ;-)
Jean
> Index: linux-2.6/drivers/net/irda/sir-dev.h
> ===================================================================
> --- linux-2.6.orig/drivers/net/irda/sir-dev.h 2006-01-31 12:23:36.000000000 +0100
> +++ linux-2.6/drivers/net/irda/sir-dev.h 2006-04-14 15:08:14.000000000 +0200
> @@ -15,23 +15,15 @@
> #define IRDA_SIR_H
>
> #include <linux/netdevice.h>
> +#include <linux/workqueue.h>
>
> #include <net/irda/irda.h>
> #include <net/irda/irda_device.h> // iobuff_t
>
> -/* FIXME: unify irda_request with sir_fsm! */
> -
> -struct irda_request {
> - struct list_head lh_request;
> - unsigned long pending;
> - void (*func)(void *);
> - void *data;
> - struct timer_list timer;
> -};
>
> struct sir_fsm {
> struct semaphore sem;
> - struct irda_request rq;
> + struct work_struct work;
> unsigned state, substate;
> int param;
> int result;
> Index: linux-2.6/drivers/net/irda/sir_dev.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/irda/sir_dev.c 2006-04-14 15:02:46.000000000 +0200
> +++ linux-2.6/drivers/net/irda/sir_dev.c 2006-04-14 15:03:15.000000000 +0200
> @@ -619,10 +619,6 @@
> spin_lock_init(&dev->tx_lock);
> init_MUTEX(&dev->fsm.sem);
>
> - INIT_LIST_HEAD(&dev->fsm.rq.lh_request);
> - dev->fsm.rq.pending = 0;
> - init_timer(&dev->fsm.rq.timer);
> -
> dev->drv = drv;
> dev->netdev = ndev;
>
> Index: linux-2.6/drivers/net/irda/sir_kthread.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/irda/sir_kthread.c 2006-04-14 14:54:08.000000000 +0200
> +++ linux-2.6/drivers/net/irda/sir_kthread.c 2006-04-14 15:10:56.000000000 +0200
> @@ -14,159 +14,14 @@
>
> #include <linux/module.h>
> #include <linux/kernel.h>
> -#include <linux/version.h>
> #include <linux/init.h>
> -#include <linux/smp_lock.h>
> -#include <linux/completion.h>
> #include <linux/delay.h>
> -
> #include <net/irda/irda.h>
>
> #include "sir-dev.h"
>
> -/**************************************************************************
> - *
> - * kIrDAd kernel thread and config state machine
> - *
> - */
> -
> -struct irda_request_queue {
> - struct list_head request_list;
> - spinlock_t lock;
> - task_t *thread;
> - struct completion exit;
> - wait_queue_head_t kick, done;
> - atomic_t num_pending;
> -};
> -
> -static struct irda_request_queue irda_rq_queue;
> -
> -static int irda_queue_request(struct irda_request *rq)
> -{
> - int ret = 0;
> - unsigned long flags;
> -
> - if (!test_and_set_bit(0, &rq->pending)) {
> - spin_lock_irqsave(&irda_rq_queue.lock, flags);
> - list_add_tail(&rq->lh_request, &irda_rq_queue.request_list);
> - wake_up(&irda_rq_queue.kick);
> - atomic_inc(&irda_rq_queue.num_pending);
> - spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
> - ret = 1;
> - }
> - return ret;
> -}
> -
> -static void irda_request_timer(unsigned long data)
> -{
> - struct irda_request *rq = (struct irda_request *)data;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&irda_rq_queue.lock, flags);
> - list_add_tail(&rq->lh_request, &irda_rq_queue.request_list);
> - wake_up(&irda_rq_queue.kick);
> - spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
> -}
> -
> -static int irda_queue_delayed_request(struct irda_request *rq, unsigned long delay)
> -{
> - int ret = 0;
> - struct timer_list *timer = &rq->timer;
>
> - if (!test_and_set_bit(0, &rq->pending)) {
> - timer->expires = jiffies + delay;
> - timer->function = irda_request_timer;
> - timer->data = (unsigned long)rq;
> - atomic_inc(&irda_rq_queue.num_pending);
> - add_timer(timer);
> - ret = 1;
> - }
> - return ret;
> -}
> -
> -static void run_irda_queue(void)
> -{
> - unsigned long flags;
> - struct list_head *entry, *tmp;
> - struct irda_request *rq;
> -
> - spin_lock_irqsave(&irda_rq_queue.lock, flags);
> - list_for_each_safe(entry, tmp, &irda_rq_queue.request_list) {
> - rq = list_entry(entry, struct irda_request, lh_request);
> - list_del_init(entry);
> - spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
> -
> - clear_bit(0, &rq->pending);
> - rq->func(rq->data);
> -
> - if (atomic_dec_and_test(&irda_rq_queue.num_pending))
> - wake_up(&irda_rq_queue.done);
> -
> - spin_lock_irqsave(&irda_rq_queue.lock, flags);
> - }
> - spin_unlock_irqrestore(&irda_rq_queue.lock, flags);
> -}
> -
> -static int irda_thread(void *startup)
> -{
> - DECLARE_WAITQUEUE(wait, current);
> -
> - daemonize("kIrDAd");
> -
> - irda_rq_queue.thread = current;
> -
> - complete((struct completion *)startup);
> -
> - while (irda_rq_queue.thread != NULL) {
> -
> - /* We use TASK_INTERRUPTIBLE, rather than
> - * TASK_UNINTERRUPTIBLE. Andrew Morton made this
> - * change ; he told me that it is safe, because "signal
> - * blocking is now handled in daemonize()", he added
> - * that the problem is that "uninterruptible sleep
> - * contributes to load average", making user worry.
> - * Jean II */
> - set_task_state(current, TASK_INTERRUPTIBLE);
> - add_wait_queue(&irda_rq_queue.kick, &wait);
> - if (list_empty(&irda_rq_queue.request_list))
> - schedule();
> - else
> - __set_task_state(current, TASK_RUNNING);
> - remove_wait_queue(&irda_rq_queue.kick, &wait);
> -
> - /* make swsusp happy with our thread */
> - try_to_freeze();
> -
> - run_irda_queue();
> - }
> -
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,35)
> - reparent_to_init();
> -#endif
> - complete_and_exit(&irda_rq_queue.exit, 0);
> - /* never reached */
> - return 0;
> -}
> -
> -
> -static void flush_irda_queue(void)
> -{
> - if (atomic_read(&irda_rq_queue.num_pending)) {
> -
> - DECLARE_WAITQUEUE(wait, current);
> -
> - if (!list_empty(&irda_rq_queue.request_list))
> - run_irda_queue();
> -
> - set_task_state(current, TASK_UNINTERRUPTIBLE);
> - add_wait_queue(&irda_rq_queue.done, &wait);
> - if (atomic_read(&irda_rq_queue.num_pending))
> - schedule();
> - else
> - __set_task_state(current, TASK_RUNNING);
> - remove_wait_queue(&irda_rq_queue.done, &wait);
> - }
> -}
> +static struct workqueue_struct *irda_wq;
>
> /* substate handler of the config-fsm to handle the cases where we want
> * to wait for transmit completion before changing the port configuration
> @@ -413,7 +268,7 @@
> fsm->state = next_state;
> } while(!delay);
>
> - irda_queue_delayed_request(&fsm->rq, msecs_to_jiffies(delay));
> + queue_delayed_work(irda_wq, &fsm->work, msecs_to_jiffies(delay));
> }
>
> /* schedule some device configuration task for execution by kIrDAd
> @@ -424,7 +279,6 @@
> int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned param)
> {
> struct sir_fsm *fsm = &dev->fsm;
> - int xmit_was_down;
>
> IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param);
>
> @@ -443,7 +297,6 @@
> return -ESTALE; /* or better EPIPE? */
> }
>
> - xmit_was_down = netif_queue_stopped(dev->netdev);
> netif_stop_queue(dev->netdev);
> atomic_set(&dev->enable_rx, 0);
>
> @@ -451,58 +304,27 @@
> fsm->param = param;
> fsm->result = 0;
>
> - INIT_LIST_HEAD(&fsm->rq.lh_request);
> - fsm->rq.pending = 0;
> - fsm->rq.func = irda_config_fsm;
> - fsm->rq.data = dev;
> -
> - if (!irda_queue_request(&fsm->rq)) { /* returns 0 on error! */
> - atomic_set(&dev->enable_rx, 1);
> - if (!xmit_was_down)
> - netif_wake_queue(dev->netdev);
> - up(&fsm->sem);
> - return -EAGAIN;
> - }
> + INIT_WORK(&fsm->work, irda_config_fsm, dev);
> + queue_work(irda_wq, &fsm->work);
> return 0;
> }
>
> -static int __init irda_thread_create(void)
> +static int __init irda_thread_init(void)
> {
> - struct completion startup;
> - int pid;
> -
> - spin_lock_init(&irda_rq_queue.lock);
> - irda_rq_queue.thread = NULL;
> - INIT_LIST_HEAD(&irda_rq_queue.request_list);
> - init_waitqueue_head(&irda_rq_queue.kick);
> - init_waitqueue_head(&irda_rq_queue.done);
> - atomic_set(&irda_rq_queue.num_pending, 0);
> -
> - init_completion(&startup);
> - pid = kernel_thread(irda_thread, &startup, CLONE_FS|CLONE_FILES);
> - if (pid <= 0)
> - return -EAGAIN;
> - else
> - wait_for_completion(&startup);
> -
> + irda_wq = create_singlethread_workqueue("irda_wq");
> + if (!irda_wq)
> + return -ENOMEM;
> return 0;
> }
>
> -static void __exit irda_thread_join(void)
> +static void __exit irda_thread_exit(void)
> {
> - if (irda_rq_queue.thread) {
> - flush_irda_queue();
> - init_completion(&irda_rq_queue.exit);
> - irda_rq_queue.thread = NULL;
> - wake_up(&irda_rq_queue.kick);
> - wait_for_completion(&irda_rq_queue.exit);
> - }
> + destroy_workqueue(irda_wq);
> }
>
> -module_init(irda_thread_create);
> -module_exit(irda_thread_join);
> +module_init(irda_thread_init);
> +module_exit(irda_thread_exit);
>
> MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>");
> MODULE_DESCRIPTION("IrDA SIR core");
> MODULE_LICENSE("GPL");
> -
^ permalink raw reply
* [PATCH] stir4200" switch to the kthread API
From: Christoph Hellwig @ 2006-04-14 18:23 UTC (permalink / raw)
To: shemminger; +Cc: netdev
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/drivers/net/irda/stir4200.c
===================================================================
--- linux-2.6.orig/drivers/net/irda/stir4200.c 2006-04-14 20:12:37.000000000 +0200
+++ linux-2.6/drivers/net/irda/stir4200.c 2006-04-14 20:21:29.000000000 +0200
@@ -50,6 +50,7 @@
#include <linux/delay.h>
#include <linux/usb.h>
#include <linux/crc32.h>
+#include <linux/kthread.h>
#include <net/irda/irda.h>
#include <net/irda/irlap.h>
#include <net/irda/irda_device.h>
@@ -173,9 +174,7 @@
struct qos_info qos;
unsigned speed; /* Current speed */
- wait_queue_head_t thr_wait; /* transmit thread wakeup */
- struct completion thr_exited;
- pid_t thr_pid;
+ struct task_struct *thread; /* transmit thread */
struct sk_buff *tx_pending;
void *io_buf; /* transmit/receive buffer */
@@ -577,7 +576,7 @@
SKB_LINEAR_ASSERT(skb);
skb = xchg(&stir->tx_pending, skb);
- wake_up(&stir->thr_wait);
+ wake_up_process(stir->thread);
/* this should never happen unless stop/wakeup problem */
if (unlikely(skb)) {
@@ -753,13 +752,7 @@
struct net_device *dev = stir->netdev;
struct sk_buff *skb;
- daemonize("%s", dev->name);
- allow_signal(SIGTERM);
-
- while (netif_running(dev)
- && netif_device_present(dev)
- && !signal_pending(current))
- {
+ while (!kthread_should_stop()) {
#ifdef CONFIG_PM
/* if suspending, then power off and wait */
if (unlikely(freezing(current))) {
@@ -813,10 +806,11 @@
}
/* sleep if nothing to send */
- wait_event_interruptible(stir->thr_wait, stir->tx_pending);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule();
}
- complete_and_exit (&stir->thr_exited, 0);
+ return 0;
}
@@ -859,7 +853,7 @@
warn("%s: usb receive submit error: %d",
stir->netdev->name, err);
stir->receiving = 0;
- wake_up(&stir->thr_wait);
+ wake_up_process(stir->thread);
}
}
@@ -928,10 +922,10 @@
}
/** Start kernel thread for transmit. */
- stir->thr_pid = kernel_thread(stir_transmit_thread, stir,
- CLONE_FS|CLONE_FILES);
- if (stir->thr_pid < 0) {
- err = stir->thr_pid;
+ stir->thread = kthread_run(stir_transmit_thread, stir,
+ "%s", stir->netdev->name);
+ if (IS_ERR(stir->thread)) {
+ err = PTR_ERR(stir->thread);
err("stir4200: unable to start kernel thread");
goto err_out6;
}
@@ -968,8 +962,7 @@
netif_stop_queue(netdev);
/* Kill transmit thread */
- kill_proc(stir->thr_pid, SIGTERM, 1);
- wait_for_completion(&stir->thr_exited);
+ kthread_stop(stir->thread);
kfree(stir->fifo_status);
/* Mop up receive urb's */
@@ -1084,9 +1077,6 @@
stir->qos.min_turn_time.bits &= qos_mtt_bits;
irda_qos_bits_to_value(&stir->qos);
- init_completion (&stir->thr_exited);
- init_waitqueue_head (&stir->thr_wait);
-
/* Override the network functions we need to use */
net->hard_start_xmit = stir_hard_xmit;
net->open = stir_net_open;
----- End forwarded message -----
^ permalink raw reply
* Re: [PATCH] stir4200" switch to the kthread API
From: Stephen Hemminger @ 2006-04-14 18:28 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: netdev
In-Reply-To: <20060414182307.GA20862@lst.de>
Has this been tested?
^ permalink raw reply
* Re: [PATCH] stir4200" switch to the kthread API
From: Christoph Hellwig @ 2006-04-14 18:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Christoph Hellwig, netdev
In-Reply-To: <20060414112853.43b35443@localhost.localdomain>
On Fri, Apr 14, 2006 at 11:28:53AM -0700, Stephen Hemminger wrote:
> Has this been tested?
-ENOHARDWARE, so no.
^ permalink raw reply
* [PATCH 00/10] e1000: Driver fixes and update to 7.0.38-k2
From: Kok, Auke @ 2006-04-14 18:34 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
Hi,
This patch series implements two fixes, a series of cleanups and
two optimization patches.
The version of the driver was bumped to 7.0.38-k2. Year changes to 2006.
As I'm taking over patch duties from Jeff Kirsher, I added myself
to the MAINTAINERS file.
These changes are available through git.
Jeff, please pull from:
git://63.64.152.142/~ahkok/git/netdev-2.6 e1000-7.0.38-k2
Cheers,
Auke Kok
---
01/10: [FIX] Remove PM warning DPRINTKs breaking 2.4.x kernels
02/10: [FIX] Esb2 wol link cycle bug and uninitialized registers
03/10: [PATCH] De-inline functions to benefit from compiler smartness
04/10: [PATCH] Made an adapter struct variable into a local (txb2b)
05/10: [PATCH] Update truesize with the length of the packet for
packet split
06/10: [PATCH] Dead variable cleanup
07/10: [PATCH] Buffer optimizations for small MTU
08/10: [PATCH] implement more efficient tx queue locking
09/10: [DOC] Version bump, contact fix, year string change
10/10: [MAINTAINERS] {e100{,0},ixgb}: Add Auke Kok as new patch maintainer
for e{100,1000} and ixgb
---
MAINTAINERS | 6 +
drivers/net/e1000/Makefile | 1
drivers/net/e1000/e1000.h | 6 -
drivers/net/e1000/e1000_ethtool.c | 3
drivers/net/e1000/e1000_hw.c | 3
drivers/net/e1000/e1000_hw.h | 3
drivers/net/e1000/e1000_main.c | 198 ++++++++++++++++++--------------------
drivers/net/e1000/e1000_osdep.h | 3
drivers/net/e1000/e1000_param.c | 3
9 files changed, 118 insertions(+), 108 deletions(-)
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply
* [PATCH 02/10] e1000: Esb2 wol link cycle bug and uninitialized registers
From: Kok, Auke @ 2006-04-14 18:36 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
Esb2 link didn't return after wol disable. The code previously assumed
that writing reset to PHY_CTRL phy register turned the phy back on.
In the ESB2 phy case that didn't occur.
Add ESB2 to acquire/release_hw functions upon review it was
discovered that esb2 was skipped on these functions
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/e1000_main.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index ac1e838..8de9f9a 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -359,6 +359,7 @@ e1000_release_hw_control(struct e1000_ad
switch (adapter->hw.mac_type) {
case e1000_82571:
case e1000_82572:
+ case e1000_80003es2lan:
ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD);
@@ -392,6 +393,7 @@ e1000_get_hw_control(struct e1000_adapte
switch (adapter->hw.mac_type) {
case e1000_82571:
case e1000_82572:
+ case e1000_80003es2lan:
ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);
E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
@@ -419,7 +421,7 @@ e1000_up(struct e1000_adapter *adapter)
uint16_t mii_reg;
e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg);
if (mii_reg & MII_CR_POWER_DOWN)
- e1000_phy_reset(&adapter->hw);
+ e1000_phy_hw_reset(&adapter->hw);
}
e1000_set_multi(netdev);
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 03/10] e1000: De-inline functions to benefit from compiler smartness
From: Kok, Auke @ 2006-04-14 18:36 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
De-inline functions to benefit from compiler smartness
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/e1000_main.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 8de9f9a..5e7b4ee 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -208,8 +208,8 @@ static void e1000_leave_82542_rst(struct
static void e1000_tx_timeout(struct net_device *dev);
static void e1000_reset_task(struct net_device *dev);
static void e1000_smartspeed(struct e1000_adapter *adapter);
-static inline int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
- struct sk_buff *skb);
+static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
+ struct sk_buff *skb);
static void e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp);
static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
@@ -291,7 +291,7 @@ module_exit(e1000_exit_module);
* @adapter: board private structure
**/
-static inline void
+static void
e1000_irq_disable(struct e1000_adapter *adapter)
{
atomic_inc(&adapter->irq_sem);
@@ -305,7 +305,7 @@ e1000_irq_disable(struct e1000_adapter *
* @adapter: board private structure
**/
-static inline void
+static void
e1000_irq_enable(struct e1000_adapter *adapter)
{
if (likely(atomic_dec_and_test(&adapter->irq_sem))) {
@@ -349,7 +349,7 @@ e1000_update_mng_vlan(struct e1000_adapt
*
**/
-static inline void
+static void
e1000_release_hw_control(struct e1000_adapter *adapter)
{
uint32_t ctrl_ext;
@@ -384,7 +384,7 @@ e1000_release_hw_control(struct e1000_ad
*
**/
-static inline void
+static void
e1000_get_hw_control(struct e1000_adapter *adapter)
{
uint32_t ctrl_ext;
@@ -1181,7 +1181,7 @@ e1000_close(struct net_device *netdev)
* @start: address of beginning of memory
* @len: length of memory
**/
-static inline boolean_t
+static boolean_t
e1000_check_64k_bound(struct e1000_adapter *adapter,
void *start, unsigned long len)
{
@@ -1807,7 +1807,7 @@ e1000_free_all_tx_resources(struct e1000
e1000_free_tx_resources(adapter, &adapter->tx_ring[i]);
}
-static inline void
+static void
e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
struct e1000_buffer *buffer_info)
{
@@ -2400,7 +2400,7 @@ e1000_watchdog_task(struct e1000_adapter
#define E1000_TX_FLAGS_VLAN_MASK 0xffff0000
#define E1000_TX_FLAGS_VLAN_SHIFT 16
-static inline int
+static int
e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
struct sk_buff *skb)
{
@@ -2480,7 +2480,7 @@ e1000_tso(struct e1000_adapter *adapter,
return FALSE;
}
-static inline boolean_t
+static boolean_t
e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
struct sk_buff *skb)
{
@@ -2516,7 +2516,7 @@ e1000_tx_csum(struct e1000_adapter *adap
#define E1000_MAX_TXD_PWR 12
#define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR)
-static inline int
+static int
e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
struct sk_buff *skb, unsigned int first, unsigned int max_per_txd,
unsigned int nr_frags, unsigned int mss)
@@ -2625,7 +2625,7 @@ e1000_tx_map(struct e1000_adapter *adapt
return count;
}
-static inline void
+static void
e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
int tx_flags, int count)
{
@@ -2689,7 +2689,7 @@ e1000_tx_queue(struct e1000_adapter *ada
#define E1000_FIFO_HDR 0x10
#define E1000_82547_PAD_LEN 0x3E0
-static inline int
+static int
e1000_82547_fifo_workaround(struct e1000_adapter *adapter, struct sk_buff *skb)
{
uint32_t fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head;
@@ -2716,7 +2716,7 @@ no_fifo_stall_required:
}
#define MINIMUM_DHCP_PACKET_SIZE 282
-static inline int
+static int
e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
{
struct e1000_hw *hw = &adapter->hw;
@@ -3445,7 +3445,7 @@ e1000_clean_tx_irq(struct e1000_adapter
* @sk_buff: socket buffer with received data
**/
-static inline void
+static void
e1000_rx_checksum(struct e1000_adapter *adapter,
uint32_t status_err, uint32_t csum,
struct sk_buff *skb)
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 01/10] e1000: Remove PM warning DPRINTKs breaking 2.4.x kernels
From: Kok, Auke @ 2006-04-14 18:36 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
remove DPRINTKs that were printing warnings about power management on
2.4 kernels. Since we really don't react differently these printk
statements are not needed. This code was originally added to fix
some compile time warnings that got fixed by newer kernels.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/e1000_main.c | 42 ++++++++++------------------------------
1 files changed, 10 insertions(+), 32 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index add8dc4..ac1e838 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4515,21 +4515,13 @@ e1000_suspend(struct pci_dev *pdev, pm_m
E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN);
E1000_WRITE_REG(&adapter->hw, WUFC, wufc);
- retval = pci_enable_wake(pdev, PCI_D3hot, 1);
- if (retval)
- DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
- retval = pci_enable_wake(pdev, PCI_D3cold, 1);
- if (retval)
- DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
+ pci_enable_wake(pdev, PCI_D3hot, 1);
+ pci_enable_wake(pdev, PCI_D3cold, 1);
} else {
E1000_WRITE_REG(&adapter->hw, WUC, 0);
E1000_WRITE_REG(&adapter->hw, WUFC, 0);
- retval = pci_enable_wake(pdev, PCI_D3hot, 0);
- if (retval)
- DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
- retval = pci_enable_wake(pdev, PCI_D3cold, 0);
- if (retval)
- DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
+ pci_enable_wake(pdev, PCI_D3hot, 0);
+ pci_enable_wake(pdev, PCI_D3cold, 0);
}
if (adapter->hw.mac_type >= e1000_82540 &&
@@ -4538,13 +4530,8 @@ e1000_suspend(struct pci_dev *pdev, pm_m
if (manc & E1000_MANC_SMBUS_EN) {
manc |= E1000_MANC_ARP_EN;
E1000_WRITE_REG(&adapter->hw, MANC, manc);
- retval = pci_enable_wake(pdev, PCI_D3hot, 1);
- if (retval)
- DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
- retval = pci_enable_wake(pdev, PCI_D3cold, 1);
- if (retval)
- DPRINTK(PROBE, ERR,
- "Error enabling D3 cold wake\n");
+ pci_enable_wake(pdev, PCI_D3hot, 1);
+ pci_enable_wake(pdev, PCI_D3cold, 1);
}
}
@@ -4554,9 +4541,7 @@ e1000_suspend(struct pci_dev *pdev, pm_m
pci_disable_device(pdev);
- retval = pci_set_power_state(pdev, pci_choose_state(pdev, state));
- if (retval)
- DPRINTK(PROBE, ERR, "Error in setting power state\n");
+ pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
@@ -4567,22 +4552,15 @@ e1000_resume(struct pci_dev *pdev)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
- int retval;
uint32_t manc, ret_val;
- retval = pci_set_power_state(pdev, PCI_D0);
- if (retval)
- DPRINTK(PROBE, ERR, "Error in setting power state\n");
+ pci_set_power_state(pdev, PCI_D0);
e1000_pci_restore_state(adapter);
ret_val = pci_enable_device(pdev);
pci_set_master(pdev);
- retval = pci_enable_wake(pdev, PCI_D3hot, 0);
- if (retval)
- DPRINTK(PROBE, ERR, "Error enabling D3 wake\n");
- retval = pci_enable_wake(pdev, PCI_D3cold, 0);
- if (retval)
- DPRINTK(PROBE, ERR, "Error enabling D3 cold wake\n");
+ pci_enable_wake(pdev, PCI_D3hot, 0);
+ pci_enable_wake(pdev, PCI_D3cold, 0);
e1000_reset(adapter);
E1000_WRITE_REG(&adapter->hw, WUS, ~0);
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 04/10] e1000: Made an adapter struct variable into a local (txb2b)
From: Kok, Auke @ 2006-04-14 18:36 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
Made an adapter struct variable into a local (txb2b)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/e1000.h | 1 -
drivers/net/e1000/e1000_main.c | 10 +++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 281de41..764808f 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -334,7 +334,6 @@ struct e1000_adapter {
boolean_t have_msi;
#endif
/* to not mess up cache alignment, always add to the bottom */
- boolean_t txb2b;
#ifdef NETIF_F_TSO
boolean_t tso_force;
#endif
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 5e7b4ee..2cc9955 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2247,6 +2247,7 @@ e1000_watchdog_task(struct e1000_adapter
if (link) {
if (!netif_carrier_ok(netdev)) {
+ boolean_t txb2b = 1;
e1000_get_speed_and_duplex(&adapter->hw,
&adapter->link_speed,
&adapter->link_duplex);
@@ -2260,23 +2261,22 @@ e1000_watchdog_task(struct e1000_adapter
* and adjust the timeout factor */
netdev->tx_queue_len = adapter->tx_queue_len;
adapter->tx_timeout_factor = 1;
- adapter->txb2b = 1;
switch (adapter->link_speed) {
case SPEED_10:
- adapter->txb2b = 0;
+ txb2b = 0;
netdev->tx_queue_len = 10;
adapter->tx_timeout_factor = 8;
break;
case SPEED_100:
- adapter->txb2b = 0;
+ txb2b = 0;
netdev->tx_queue_len = 100;
/* maybe add some timeout factor ? */
break;
}
- if ((adapter->hw.mac_type == e1000_82571 ||
+ if ((adapter->hw.mac_type == e1000_82571 ||
adapter->hw.mac_type == e1000_82572) &&
- adapter->txb2b == 0) {
+ txb2b == 0) {
#define SPEED_MODE_BIT (1 << 21)
uint32_t tarc0;
tarc0 = E1000_READ_REG(&adapter->hw, TARC0);
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 05/10] e1000: Update truesize with the length of the packet for packet split
From: Kok, Auke @ 2006-04-14 18:36 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
Update skb with the real packet size.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/e1000_main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 2cc9955..7ba1b16 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3770,6 +3770,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
ps_page->ps_page[j] = NULL;
skb->len += length;
skb->data_len += length;
+ skb->truesize += length;
}
copydone:
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 06/10] e1000: Dead variable cleanup
From: Kok, Auke @ 2006-04-14 18:37 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
Removal of unused rx_dropped counter.
Removed reference to E1000_CTRL_EXT_CANC which is no longer valid,
replaced with E1000_CTRL_EXT_INT_TIMER_CLR
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/e1000_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 7ba1b16..6d7ba0b 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1715,7 +1715,7 @@ e1000_configure_rx(struct e1000_adapter
if (hw->mac_type >= e1000_82571) {
ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
/* Reset delay timers after every interrupt */
- ctrl_ext |= E1000_CTRL_EXT_CANC;
+ ctrl_ext |= E1000_CTRL_EXT_INT_TIMER_CLR;
#ifdef CONFIG_E1000_NAPI
/* Auto-Mask interrupts upon ICR read. */
ctrl_ext |= E1000_CTRL_EXT_IAME;
@@ -3165,7 +3165,6 @@ e1000_update_stats(struct e1000_adapter
adapter->stats.crcerrs + adapter->stats.algnerrc +
adapter->stats.ruc + adapter->stats.roc +
adapter->stats.cexterr;
- adapter->net_stats.rx_dropped = 0;
adapter->net_stats.rx_length_errors = adapter->stats.ruc +
adapter->stats.roc;
adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 07/10] e1000: Buffer optimizations for small MTU
From: Kok, Auke @ 2006-04-14 18:37 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
Remove multi-descriptor support from legacy recieve path
Add memory usage efficiency by using more correct size descriptors for
small MTU sizes and optimize using LPE for <= 1522 byte frame sizes
An extra performance fix that effected our TCP window size growth
as a receiver. Set our initial buffer to be 128 bytes instead of 256
to prevent over-socket charge when truesize is computed in the stack.
old way: truesize = 256 + l1 = 256 + 1460 = 1716
new way: truesize = 128 + l1 = 128 + 1460 = 1588
The magic value that we can't cross is 1648.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/e1000.h | 2 +
drivers/net/e1000/e1000_main.c | 87 +++++++++++++++++++++++-----------------
2 files changed, 52 insertions(+), 37 deletions(-)
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 764808f..2dfabdb 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -114,6 +114,8 @@ struct e1000_adapter;
/* Supported Rx Buffer Sizes */
#define E1000_RXBUFFER_128 128 /* Used for packet split */
#define E1000_RXBUFFER_256 256 /* Used for packet split */
+#define E1000_RXBUFFER_512 512
+#define E1000_RXBUFFER_1024 1024
#define E1000_RXBUFFER_2048 2048
#define E1000_RXBUFFER_4096 4096
#define E1000_RXBUFFER_8192 8192
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 6d7ba0b..f604a1d 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -972,8 +972,8 @@ e1000_sw_init(struct e1000_adapter *adap
pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
- adapter->rx_buffer_len = E1000_RXBUFFER_2048;
- adapter->rx_ps_bsize0 = E1000_RXBUFFER_256;
+ adapter->rx_buffer_len = MAXIMUM_ETHERNET_FRAME_SIZE;
+ adapter->rx_ps_bsize0 = E1000_RXBUFFER_128;
hw->max_frame_size = netdev->mtu +
ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
@@ -1599,14 +1599,21 @@ e1000_setup_rctl(struct e1000_adapter *a
rctl |= E1000_RCTL_LPE;
/* Setup buffer sizes */
- if (adapter->hw.mac_type >= e1000_82571) {
- /* We can now specify buffers in 1K increments.
- * BSIZE and BSEX are ignored in this case. */
- rctl |= adapter->rx_buffer_len << 0x11;
- } else {
- rctl &= ~E1000_RCTL_SZ_4096;
- rctl |= E1000_RCTL_BSEX;
- switch (adapter->rx_buffer_len) {
+ rctl &= ~E1000_RCTL_SZ_4096;
+ rctl |= E1000_RCTL_BSEX;
+ switch (adapter->rx_buffer_len) {
+ case E1000_RXBUFFER_256:
+ rctl |= E1000_RCTL_SZ_256;
+ rctl &= ~E1000_RCTL_BSEX;
+ break;
+ case E1000_RXBUFFER_512:
+ rctl |= E1000_RCTL_SZ_512;
+ rctl &= ~E1000_RCTL_BSEX;
+ break;
+ case E1000_RXBUFFER_1024:
+ rctl |= E1000_RCTL_SZ_1024;
+ rctl &= ~E1000_RCTL_BSEX;
+ break;
case E1000_RXBUFFER_2048:
default:
rctl |= E1000_RCTL_SZ_2048;
@@ -1621,7 +1628,6 @@ e1000_setup_rctl(struct e1000_adapter *a
case E1000_RXBUFFER_16384:
rctl |= E1000_RCTL_SZ_16384;
break;
- }
}
#ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT
@@ -2982,8 +2988,7 @@ e1000_change_mtu(struct net_device *netd
/* Adapter-specific max frame size limits. */
switch (adapter->hw.mac_type) {
- case e1000_82542_rev2_0:
- case e1000_82542_rev2_1:
+ case e1000_undefined ... e1000_82542_rev2_1:
if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n");
return -EINVAL;
@@ -3017,27 +3022,32 @@ e1000_change_mtu(struct net_device *netd
break;
}
-
- if (adapter->hw.mac_type > e1000_82547_rev_2) {
- adapter->rx_buffer_len = max_frame;
- E1000_ROUNDUP(adapter->rx_buffer_len, 1024);
- } else {
- if(unlikely((adapter->hw.mac_type < e1000_82543) &&
- (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE))) {
- DPRINTK(PROBE, ERR, "Jumbo Frames not supported "
- "on 82542\n");
- return -EINVAL;
- } else {
- if(max_frame <= E1000_RXBUFFER_2048)
- adapter->rx_buffer_len = E1000_RXBUFFER_2048;
- else if(max_frame <= E1000_RXBUFFER_4096)
- adapter->rx_buffer_len = E1000_RXBUFFER_4096;
- else if(max_frame <= E1000_RXBUFFER_8192)
- adapter->rx_buffer_len = E1000_RXBUFFER_8192;
- else if(max_frame <= E1000_RXBUFFER_16384)
- adapter->rx_buffer_len = E1000_RXBUFFER_16384;
- }
- }
+ /* NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
+ * means we reserve 2 more, this pushes us to allocate from the next
+ * larger slab size
+ * i.e. RXBUFFER_2048 --> size-4096 slab */
+
+ if (max_frame <= E1000_RXBUFFER_256)
+ adapter->rx_buffer_len = E1000_RXBUFFER_256;
+ else if (max_frame <= E1000_RXBUFFER_512)
+ adapter->rx_buffer_len = E1000_RXBUFFER_512;
+ else if (max_frame <= E1000_RXBUFFER_1024)
+ adapter->rx_buffer_len = E1000_RXBUFFER_1024;
+ else if (max_frame <= E1000_RXBUFFER_2048)
+ adapter->rx_buffer_len = E1000_RXBUFFER_2048;
+ else if (max_frame <= E1000_RXBUFFER_4096)
+ adapter->rx_buffer_len = E1000_RXBUFFER_4096;
+ else if (max_frame <= E1000_RXBUFFER_8192)
+ adapter->rx_buffer_len = E1000_RXBUFFER_8192;
+ else if (max_frame <= E1000_RXBUFFER_16384)
+ adapter->rx_buffer_len = E1000_RXBUFFER_16384;
+
+ /* adjust allocation if LPE protects us, and we aren't using SBP */
+#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
+ if (!adapter->hw.tbi_compatibility_on &&
+ ((max_frame == MAXIMUM_ETHERNET_FRAME_SIZE) ||
+ (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)))
+ adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
netdev->mtu = new_mtu;
@@ -3568,10 +3578,12 @@ e1000_clean_rx_irq(struct e1000_adapter
flags);
length--;
} else {
- dev_kfree_skb_irq(skb);
+ /* recycle */
+ buffer_info->skb = skb;
goto next_desc;
}
- }
+ } else
+ skb_put(skb, length);
/* code added for copybreak, this should improve
* performance for small packets with large amounts
@@ -3676,6 +3688,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
i = rx_ring->next_to_clean;
rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
staterr = le32_to_cpu(rx_desc->wb.middle.status_error);
+ buffer_info = &rx_ring->buffer_info[i];
while (staterr & E1000_RXD_STAT_DD) {
buffer_info = &rx_ring->buffer_info[i];
@@ -3736,7 +3749,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
/* page alloc/put takes too long and effects small packet
* throughput, so unsplit small packets and save the alloc/put*/
- if (l1 && ((length + l1) < E1000_CB_LENGTH)) {
+ if (l1 && ((length + l1) <= adapter->rx_ps_bsize0)) {
u8 *vaddr;
/* there is no documentation about how to call
* kmap_atomic, so we can't hold the mapping
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 08/10] e1000: implement more efficient tx queue locking
From: Kok, Auke @ 2006-04-14 18:37 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
Implement more efficient locking (avoid the lock) when checking for
a stopped queue. Also don't wake the queue unless the threshold is
reached to avoid queue on/off thrash.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/e1000_main.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index f604a1d..3c37c40 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3400,13 +3400,15 @@ e1000_clean_tx_irq(struct e1000_adapter
tx_ring->next_to_clean = i;
- spin_lock(&tx_ring->tx_lock);
-
+#define TX_WAKE_THRESHOLD 32
if (unlikely(cleaned && netif_queue_stopped(netdev) &&
- netif_carrier_ok(netdev)))
- netif_wake_queue(netdev);
-
- spin_unlock(&tx_ring->tx_lock);
+ netif_carrier_ok(netdev))) {
+ spin_lock(&tx_ring->tx_lock);
+ if (netif_queue_stopped(netdev) &&
+ (E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD))
+ netif_wake_queue(netdev);
+ spin_unlock(&tx_ring->tx_lock);
+ }
if (adapter->detect_tx_hung) {
/* Detect a transmit hang in hardware, this serializes the
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 09/10] e1000: Version bump, contact fix, year string change
From: Kok, Auke @ 2006-04-14 18:37 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
Add the sourceforge project mailinglist to the contact information.
Bump version to 7.0.38-k2
Update copyright string with the new year.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/e1000/Makefile | 1 +
drivers/net/e1000/e1000.h | 3 ++-
drivers/net/e1000/e1000_ethtool.c | 3 ++-
drivers/net/e1000/e1000_hw.c | 3 ++-
drivers/net/e1000/e1000_hw.h | 3 ++-
drivers/net/e1000/e1000_main.c | 7 ++++---
drivers/net/e1000/e1000_osdep.h | 3 ++-
drivers/net/e1000/e1000_param.c | 3 ++-
8 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index ca9f895..92823ac 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -22,6 +22,7 @@
#
# Contact Information:
# Linux NICS <linux.nics@intel.com>
+# e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
#
################################################################################
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 2dfabdb..2bc34fb 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -1,7 +1,7 @@
/*******************************************************************************
- Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+ Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
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 the Free
@@ -22,6 +22,7 @@
Contact Information:
Linux NICS <linux.nics@intel.com>
+ e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index ecccca3..e48dc57 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1,7 +1,7 @@
/*******************************************************************************
- Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+ Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
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 the Free
@@ -22,6 +22,7 @@
Contact Information:
Linux NICS <linux.nics@intel.com>
+ e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 523c2c9..4c796e5 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -1,7 +1,7 @@
/*******************************************************************************
- Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+ Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
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 the Free
@@ -22,6 +22,7 @@
Contact Information:
Linux NICS <linux.nics@intel.com>
+ e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 150e45e..03d07eb 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1,7 +1,7 @@
/*******************************************************************************
- Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+ Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
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 the Free
@@ -22,6 +22,7 @@
Contact Information:
Linux NICS <linux.nics@intel.com>
+ e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 3c37c40..82d443b 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1,7 +1,7 @@
/*******************************************************************************
- Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+ Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
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 the Free
@@ -22,6 +22,7 @@
Contact Information:
Linux NICS <linux.nics@intel.com>
+ e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
@@ -74,9 +75,9 @@ static char e1000_driver_string[] = "Int
#else
#define DRIVERNAPI "-NAPI"
#endif
-#define DRV_VERSION "7.0.33-k2"DRIVERNAPI
+#define DRV_VERSION "7.0.38-k2"DRIVERNAPI
char e1000_driver_version[] = DRV_VERSION;
-static char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
+static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
/* e1000_pci_tbl - PCI Device ID Table
*
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index 9790db9..048d052 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -1,7 +1,7 @@
/*******************************************************************************
- Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+ Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
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 the Free
@@ -22,6 +22,7 @@
Contact Information:
Linux NICS <linux.nics@intel.com>
+ e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index e0a4d37..e55f896 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -1,7 +1,7 @@
/*******************************************************************************
- Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+ Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
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 the Free
@@ -22,6 +22,7 @@
Contact Information:
Linux NICS <linux.nics@intel.com>
+ e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 10/10] {e100{,0},ixgb}: Add Auke Kok as new patch maintainer for e{100,1000} and ixgb
From: Kok, Auke @ 2006-04-14 18:37 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
This adds Auke Kok to the list of maintainers for the Intel NICs.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
MAINTAINERS | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index d00dea5..6424267 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1395,6 +1395,8 @@ P: Jesse Brandeburg
M: jesse.brandeburg@intel.com
P: Jeff Kirsher
M: jeffrey.t.kirsher@intel.com
+P: Auke Kok
+M: auke-jan.h.kok@intel.com
W: http://sourceforge.net/projects/e1000/
S: Supported
@@ -1407,6 +1409,8 @@ P: Jesse Brandeburg
M: jesse.brandeburg@intel.com
P: Jeff Kirsher
M: jeffrey.t.kirsher@intel.com
+P: Auke Kok
+M: auke-jan.h.kok@intel.com
W: http://sourceforge.net/projects/e1000/
S: Supported
@@ -1419,6 +1423,8 @@ P: John Ronciak
M: john.ronciak@intel.com
P: Jesse Brandeburg
M: jesse.brandeburg@intel.com
+P: Auke Kok
+M: auke-jan.h.kok@intel.com
W: http://sourceforge.net/projects/e1000/
S: Supported
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* Re: [PATCH 00/10] e1000: Driver fixes and update to 7.0.38-k2
From: Jeff Garzik @ 2006-04-14 19:01 UTC (permalink / raw)
To: Kok, Auke
Cc: netdev, Miller, David, Ronciak, John, Brandeburg, Jesse,
Kirsher, Jeff, Kok, Auke
In-Reply-To: <20060414183423.3461.32772.stgit@gitlost.site>
Kok, Auke wrote:
> Hi,
>
> This patch series implements two fixes, a series of cleanups and
> two optimization patches.
>
> The version of the driver was bumped to 7.0.38-k2. Year changes to 2006.
>
> As I'm taking over patch duties from Jeff Kirsher, I added myself
> to the MAINTAINERS file.
>
> These changes are available through git.
>
> Jeff, please pull from:
>
> git://63.64.152.142/~ahkok/git/netdev-2.6 e1000-7.0.38-k2
>
>
> Cheers,
>
> Auke Kok
>
>
> ---
> 01/10: [FIX] Remove PM warning DPRINTKs breaking 2.4.x kernels
> 02/10: [FIX] Esb2 wol link cycle bug and uninitialized registers
> 03/10: [PATCH] De-inline functions to benefit from compiler smartness
> 04/10: [PATCH] Made an adapter struct variable into a local (txb2b)
> 05/10: [PATCH] Update truesize with the length of the packet for
> packet split
> 06/10: [PATCH] Dead variable cleanup
> 07/10: [PATCH] Buffer optimizations for small MTU
> 08/10: [PATCH] implement more efficient tx queue locking
> 09/10: [DOC] Version bump, contact fix, year string change
> 10/10: [MAINTAINERS] {e100{,0},ixgb}: Add Auke Kok as new patch maintainer
These 10 patches look OK, but since the current kernel version is
2.6.17-rc1, that means we are in "bug fix only" mode right now.
Should I (a) apply these all to netdev2-.6.git#upstream, queueing them
for 2.6.18, or (b) let you split the submission into two parts, bug
fixes only and everything else?
Jeff
^ permalink raw reply
* Re: [PATCH 00/10] e1000: Driver fixes and update to 7.0.38-k2
From: Auke Kok @ 2006-04-14 19:32 UTC (permalink / raw)
To: Jeff Garzik
Cc: netdev, Miller, David, Ronciak, John, Brandeburg, Jesse,
Kirsher, Jeff, Kok, Auke
In-Reply-To: <443FF1A1.4000204@pobox.com>
Jeff Garzik wrote:
> Kok, Auke wrote:
>> 01/10: [FIX] Remove PM warning DPRINTKs breaking 2.4.x kernels
>> 02/10: [FIX] Esb2 wol link cycle bug and uninitialized registers
>> 03/10: [PATCH] De-inline functions to benefit from compiler smartness
>> 04/10: [PATCH] Made an adapter struct variable into a local (txb2b)
>> 05/10: [PATCH] Update truesize with the length of the packet for
>> packet split
>> 06/10: [PATCH] Dead variable cleanup
>> 07/10: [PATCH] Buffer optimizations for small MTU
>> 08/10: [PATCH] implement more efficient tx queue locking
>> 09/10: [DOC] Version bump, contact fix, year string change
>> 10/10: [MAINTAINERS] {e100{,0},ixgb}: Add Auke Kok as new patch
>> maintainer
>
> These 10 patches look OK, but since the current kernel version is
> 2.6.17-rc1, that means we are in "bug fix only" mode right now.
>
> Should I (a) apply these all to netdev2-.6.git#upstream, queueing them
> for 2.6.18, or (b) let you split the submission into two parts, bug
> fixes only and everything else?
jeff,
The two fixes are for low-impact bugs with workarounds, not justifying
applying them to 2.6.17-rc1 or stable@.
Please apply to netdev-2.6.git#upstream and queue them for 2.6.18. (a).
Cheers,
Auke
^ permalink raw reply
* Re: [RFC] Geographical/regulatory information for ieee80211
From: Larry Finger @ 2006-04-14 20:01 UTC (permalink / raw)
To: Jouni Malinen; +Cc: netdev
In-Reply-To: <20060414152715.GC29461@instant802.com>
Jouni Malinen wrote:
> The maximum power would be quite useful--I would say required--part of
> regulatory domain information.. In other words, I would like to see the
> groups created in a way that would take differences in power limits into
> account. Without this, the groups will need to be re-created at some
> point in the future when IEEE 802.11d and IEEE 802.11h would like to use
> the same table.. In addition, flag of specifying indoor/outdoor/both
> would be a nice addition.
>
> It would be useful to have a text file with all the information in an
> easily parseable format. I would like to be able to add a user space
> tool that uses this file to take care of channel/TX power policies. The
> needed parameters would then be configured for the kernel side 802.11
> whenever needed.
Good idea to include power and indoor etc. flags. I will also include flags to indicate that
scanning should be passive on a given channel.
Have you any thoughts on the structure of the text file for parsing?
Larry
^ permalink raw reply
* Re: [e1000 debug] KERNEL: assertion (!sk_forward_alloc) failed...
From: Jesse Brandeburg @ 2006-04-14 20:28 UTC (permalink / raw)
To: Boris B. Zhmurov, Herbert Xu
Cc: Phil Oester, Mark Nipper, David S. Miller, jrlundgren, cat,
djani22, yoseph.basri, mykleb, olel, michal, chris, netdev,
jesse.brandeburg, E1000-devel, Andi Kleen, Jeff Garzik
In-Reply-To: <44350056.80501@kernelpanic.ru>
Boris B. Zhmurov wrote:
> Hello, Jesse Brandeburg.
>
> On 06.04.2006 04:42 you said the following:
>
>> I built and tested the driver with patches on 2.6.16, with pci-x
>> adapters. I removed some workarounds for PCIe adapters, but I dont
>> think anyone having this problem has a PCIe adapter anyway. I saw no
>> TX hangs and ran some bi-directional tests, so i think the driver
>> should work okay. Just warning you I did minimal testing.
>>
>> *********************
>> e1000: transmit the old fashioned way
>>
>> It seems back in the day of 2.6.11, there were no sk_forward_alloc
>> asserions. Forward port that transmit code to see if it fixes the
>> issues
>> in today's kernel. Unfortunately it doesn't have all the bug fixes that
>> the current code has, but if we get transmit timeouts we can add in
>> workarounds appropriately.
>>
>> this changes only the e1000_tso function
>
> With this one still having:
>
> TCP: Treason uncloaked! Peer 80.72.16.78:11460/80 shrinks window
> 2223569515:2223569516. Repaired.
> KERNEL: assertion (!sk->sk_forward_alloc) failed at net/core/stream.c
> (283)
> KERNEL: assertion (!sk->sk_forward_alloc) failed at net/ipv4/af_inet.c
> (150)
This is a very important result. It shows that the changes to the
driver to call pskb_expand_head for TSO operations are not the cause of
this problem.
We also have some new data from the last couple of days. First, I think
that this problem is likely not just E1000's fault. We have multiple
reports both in bugzilla.kernel.org and from a distro that show this
problem has occurred on (at least) tg3 driven adapters as well as e1000.
I've been able to reliably reproduce this issue in house (finally)
thanks to one of our testers. The test is using the tbench application
from the dbench package at samba.org.
on the server, start tbench_srv
on the machine you're trying to repro the issue on, start tbench 500
<server ip>, on another client start tbench 50 <server ip>
I've seen sk_forward_alloc assertions on both server and client both
running 2.6.16. We're trying to figure out where there might be a stale
pointer to an sk that accesses the data after free. something seems to
write ff ff ff ff 00 00 00 00 to memory after it is freed maybe?
It does seem that the load (the 500 threads) is important to this
failure. I've also seen a report that a memory poisoning kernel caught
the failure.
Any investigation hints for me?
>> e1000: implement old xmit_frame
>>
>> It seems back in the day of 2.6.11, there were no sk_forward_alloc
>> asserions. Forward port that transmit code to see if it fixes the
>> issues
>> in today's kernel. Unfortunately it doesn't have all the bug fixes that
>> the current code has, but if we get transmit timeouts we can add in
>> workarounds appropriately.
>>
>> this changes the e1000_xmit_frame function, and some ancilliaries
>>
>> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
>
>
> Can't apply this one:
>
> [zhmurov@builds linux-2.6.16]$ patch -p1 <
> ../../../SOURCES/linux-2.6.16-e1000-implement_old_xmit_frame.patch
> patching file drivers/net/e1000/e1000_main.c
> Hunk #1 succeeded at 2620 (offset -105 lines).
> Hunk #2 FAILED at 2695.
> Hunk #4 FAILED at 2837.
> Hunk #5 FAILED at 2868.
> Hunk #6 FAILED at 2899.
> 4 out of 6 hunks FAILED -- saving rejects to file
> drivers/net/e1000/e1000_main.c.rej
well that seems kind of lame, but I think we got the data that we needed
from the first patch.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply
* Re: [PATCH] net: expose vlan structure to user space
From: David S. Miller @ 2006-04-14 20:55 UTC (permalink / raw)
To: dacker; +Cc: netdev
In-Reply-To: <443FA08A.8040900@roinet.com>
From: David Acker <dacker@roinet.com>
Date: Fri, 14 Apr 2006 09:15:54 -0400
> David S. Miller wrote:
> > I think this really belongs in a portable header file
> > in glibc somewhere.
>
> David, while I can try to work with the glibc folks, I don't understand
> how this patch would be different from what if_ether.h exposes to user
> space today. Why is one appropriate and the other not? I am not trying
> to be a pain; I am just trying to understand the rationale so that I can
> explain it to others.
Doing stupid things in the past does not equate to being a reason
to keep doing so in the future.
^ permalink raw reply
* Re: [e1000 debug] KERNEL: assertion (!sk_forward_alloc) failed...
From: David S. Miller @ 2006-04-14 21:02 UTC (permalink / raw)
To: jesse.brandeburg
Cc: bb, herbert, kernel, nipsy, jrlundgren, cat, djani22,
yoseph.basri, mykleb, olel, michal, chris, netdev,
jesse.brandeburg, E1000-devel, ak, jgarzik
In-Reply-To: <444005DA.4090606@intel.com>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
Date: Fri, 14 Apr 2006 13:28:10 -0700
> We also have some new data from the last couple of days. First, I think
> that this problem is likely not just E1000's fault. We have multiple
> reports both in bugzilla.kernel.org and from a distro that show this
> problem has occurred on (at least) tg3 driven adapters as well as e1000.
That's interesting since tg3 does not enable TSO by default for any
chip until very recent versions of the tg3 driver. And even with
those recent tg3 drivers which will enable TSO by default, it is only
done for a very specific selection of chip revisions.
Where are these reports that precisely implicate tg3?
Note that there were legitimate TSO retransmit bugs in the 2.6.14
timeframe that triggered those messages and did get fixed. And yes
some of those reports were with tg3.
^ permalink raw reply
* Re: [PATCH] net: expose vlan structure to user space
From: David Acker @ 2006-04-14 21:10 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20060414.135556.91849056.davem@davemloft.net>
David S. Miller wrote:
> From: David Acker <dacker@roinet.com>
> Date: Fri, 14 Apr 2006 09:15:54 -0400
>
>
>>David S. Miller wrote:
>> > I think this really belongs in a portable header file
>> > in glibc somewhere.
>>
>>David, while I can try to work with the glibc folks, I don't understand
>>how this patch would be different from what if_ether.h exposes to user
>>space today. Why is one appropriate and the other not? I am not trying
>>to be a pain; I am just trying to understand the rationale so that I can
>>explain it to others.
>
>
> Doing stupid things in the past does not equate to being a reason
> to keep doing so in the future.
>
>
Understood. I will see what I can do in glibc land instead.
-Ack
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox