Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] Net / pktgen: Fix freezing problem
From: David Miller @ 2010-02-04 22:00 UTC (permalink / raw)
  To: rjw; +Cc: linux-kernel, netdev, linux-pm, akpm, ciprian.craciun
In-Reply-To: <201002042250.58944.rjw@sisk.pl>

From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Thu, 4 Feb 2010 22:50:58 +0100

> From: Rafael J. Wysocki <rjw@sisk.pl>
> Subject: Net / pktgen: Fix freezing problem
> 
> Add missing try_to_freeze() to one of the pktgen_thread_worker() code
> paths so that it doesn't block suspend/hibernation.
> 
> Fixes http://bugzilla.kernel.org/show_bug.cgi?id=15006
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> Reported-and-tested-by: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>

Applied, thanks a lot.

^ permalink raw reply

* Re: [RFC Patch] net: reserve ports for applications using fixed port numbers
From: David Miller @ 2010-02-04 21:56 UTC (permalink / raw)
  To: penguin-kernel-JPay3/Yim36HaxMnTkn67Xf5DAMn2ifp
  Cc: opurdila-+zzKsuq53OdBDgjK7y7TUQ, amwang-H+wXaHxf7aLQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	nhorman-2XuSBdqkA4R54TAoqtyWWQ, linux-sctp-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <201002050645.CEC95380.MLOtOVFFHSFOQJ-JPay3/Yim36HaxMnTkn67Xf5DAMn2ifp@public.gmane.org>

From: Tetsuo Handa <penguin-kernel-JPay3/Yim36HaxMnTkn67Xf5DAMn2ifp@public.gmane.org>
Date: Fri, 5 Feb 2010 06:45:28 +0900

> Octavian Purdila wrote:
>> 
>> int inet_is_reserved_local_port(int port)
>> {
>> 	if (test_bit(port, reserved_ports))
>> 		return 1;
>> 	return 0;
>> }
>> 
> Above check is exactly what I'm doing in the LSM hook.

But his version can be done inline in 2 or 3 instructions.

An LSM hook will result in an indirect function call,
all live registers spilled to the stack, then all of
those reloaded when the function returns.

It will be much more expensive.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] Net / pktgen: Fix freezing problem
From: Rafael J. Wysocki @ 2010-02-04 21:50 UTC (permalink / raw)
  To: LKML; +Cc: NetDev, pm list, Andrew Morton, David Miller,
	Ciprian Dorin Craciun

From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: Net / pktgen: Fix freezing problem

Add missing try_to_freeze() to one of the pktgen_thread_worker() code
paths so that it doesn't block suspend/hibernation.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=15006

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-and-tested-by: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
---
 net/core/pktgen.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6/net/core/pktgen.c
===================================================================
--- linux-2.6.orig/net/core/pktgen.c
+++ linux-2.6/net/core/pktgen.c
@@ -3524,6 +3524,7 @@ static int pktgen_thread_worker(void *ar
 			wait_event_interruptible_timeout(t->queue,
 							 t->control != 0,
 							 HZ/10);
+			try_to_freeze();
 			continue;
 		}
 

^ permalink raw reply

* Re: [RFC Patch] net: reserve ports for applications using fixed port numbers
From: Tetsuo Handa @ 2010-02-04 21:45 UTC (permalink / raw)
  To: opurdila-+zzKsuq53OdBDgjK7y7TUQ, davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: amwang-H+wXaHxf7aLQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	nhorman-2XuSBdqkA4R54TAoqtyWWQ, linux-sctp-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <201002042015.51092.opurdila-+zzKsuq53OdBDgjK7y7TUQ@public.gmane.org>

Octavian Purdila wrote:
> 
> int inet_is_reserved_local_port(int port)
> {
> 	if (test_bit(port, reserved_ports))
> 		return 1;
> 	return 0;
> }
> 
Above check is exactly what I'm doing in the LSM hook.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] doc: document IPv6 parameters
From: David Miller @ 2010-02-04 21:37 UTC (permalink / raw)
  To: brian.haley; +Cc: netdev, greg
In-Reply-To: <4B6B32E8.6070408@hp.com>

From: Brian Haley <brian.haley@hp.com>
Date: Thu, 04 Feb 2010 15:49:44 -0500

> Can you take these in net-next-2.6?  I haven't heard boo from anyone
> on linux-doc or lkml.

Sure, applied, thanks Brian.

^ permalink raw reply

* Re: [net-next PATCH 3/3] qlge: Add watchdog timer.
From: David Miller @ 2010-02-04 21:32 UTC (permalink / raw)
  To: ron.mercer; +Cc: netdev
In-Reply-To: <20100204211929.GC9938@linux-ox1b.qlogic.org>

From: Ron Mercer <ron.mercer@qlogic.com>
Date: Thu, 4 Feb 2010 13:19:29 -0800

>> Did the timer every fire more than once in your testing?
>> 
>> Don't you need to re-setup the expiration period before
>> adding it again?
> 
> It does fire repeatedly but I should have put in the new expiration
> period.  I added some prints to the timer and without resetting the
> expiration the timer would pop faster, but still less than 5 seconds.
> I've added the expiration here and see very even pops on 5 second
> intervals.

Of course it pops faster, if you don't reset the expiration
period it is "right now". :-)

I'll apply this new version, thanks.

^ permalink raw reply

* Re: [net-next PATCH 3/3] qlge: Add watchdog timer.
From: Ron Mercer @ 2010-02-04 21:19 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <20100204.122931.189315763.davem@davemloft.net>

> Did the timer every fire more than once in your testing?
> 
> Don't you need to re-setup the expiration period before
> adding it again?

It does fire repeatedly but I should have put in the new expiration
period.  I added some prints to the timer and without resetting the
expiration the timer would pop faster, but still less than 5 seconds.
I've added the expiration here and see very even pops on 5 second
intervals.

>From 4637fe181eda8440282b6a3acc0bc2c5aefbd7ea Mon Sep 17 00:00:00 2001
From: Ron Mercer <ron.mercer@qlogic.com>
Date: Thu, 4 Feb 2010 13:11:43 -0800
Subject: [net-next PATCH 1/1] qlge: Add watchdog timer.

Add periodic heartbeat register read to trigger the eeh
recovery process.
We see cases where an eeh error was injected and the slot was
suspended.  An asic access attempt is required to flush the recovery process,
but without interrupts the process can stall.
Adding this periodic register read causes the recovery process to begin.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
 drivers/net/qlge/qlge.h      |    1 +
 drivers/net/qlge/qlge_main.c |   30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index 780a387..ebfd177 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -2145,6 +2145,7 @@ struct ql_adapter {
 	struct completion ide_completion;
 	struct nic_operations *nic_ops;
 	u16 device_id;
+	struct timer_list timer;
 	atomic_t lb_count;
 };
 
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 7e00029..87a40d1 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4574,6 +4574,21 @@ static const struct net_device_ops qlge_netdev_ops = {
 	.ndo_vlan_rx_kill_vid	= qlge_vlan_rx_kill_vid,
 };
 
+static void ql_timer(unsigned long data)
+{
+	struct ql_adapter *qdev = (struct ql_adapter *)data;
+	u32 var = 0;
+
+	var = ql_read32(qdev, STS);
+	if (pci_channel_offline(qdev->pdev)) {
+		QPRINTK(qdev, IFUP, ERR, "EEH STS = 0x%.08x.\n", var);
+		return;
+	}
+
+	qdev->timer.expires = jiffies + (5*HZ);
+	add_timer(&qdev->timer);
+}
+
 static int __devinit qlge_probe(struct pci_dev *pdev,
 				const struct pci_device_id *pci_entry)
 {
@@ -4625,6 +4640,14 @@ static int __devinit qlge_probe(struct pci_dev *pdev,
 		pci_disable_device(pdev);
 		return err;
 	}
+	/* Start up the timer to trigger EEH if
+	 * the bus goes dead
+	 */
+	init_timer_deferrable(&qdev->timer);
+	qdev->timer.data = (unsigned long)qdev;
+	qdev->timer.function = ql_timer;
+	qdev->timer.expires = jiffies + (5*HZ);
+	add_timer(&qdev->timer);
 	ql_link_off(qdev);
 	ql_display_dev_info(ndev);
 	atomic_set(&qdev->lb_count, 0);
@@ -4645,6 +4668,8 @@ int ql_clean_lb_rx_ring(struct rx_ring *rx_ring, int budget)
 static void __devexit qlge_remove(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
+	struct ql_adapter *qdev = netdev_priv(ndev);
+	del_timer_sync(&qdev->timer);
 	unregister_netdev(ndev);
 	ql_release_all(pdev);
 	pci_disable_device(pdev);
@@ -4757,6 +4782,8 @@ static void qlge_io_resume(struct pci_dev *pdev)
 		QPRINTK(qdev, IFUP, ERR,
 			"Device was not running prior to EEH.\n");
 	}
+	qdev->timer.expires = jiffies + (5*HZ);
+	add_timer(&qdev->timer);
 	netif_device_attach(ndev);
 }
 
@@ -4773,6 +4800,7 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state)
 	int err;
 
 	netif_device_detach(ndev);
+	del_timer_sync(&qdev->timer);
 
 	if (netif_running(ndev)) {
 		err = ql_adapter_down(qdev);
@@ -4817,6 +4845,8 @@ static int qlge_resume(struct pci_dev *pdev)
 			return err;
 	}
 
+	qdev->timer.expires = jiffies + (5*HZ);
+	add_timer(&qdev->timer);
 	netif_device_attach(ndev);
 
 	return 0;
-- 
1.6.0.2


^ permalink raw reply related

* Re: [net-next-2.6 PATCH v2 1/3] ethtool: Introduce n-tuple filter programming support
From: Waskiewicz Jr, Peter P @ 2010-02-04 21:26 UTC (permalink / raw)
  To: David Miller
  Cc: Kirsher, Jeffrey T, netdev@vger.kernel.org, gospo@redhat.com,
	Waskiewicz Jr, Peter P
In-Reply-To: <20100204.091854.24215476.davem@davemloft.net>

On Thu, 4 Feb 2010, David Miller wrote:

> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Wed, 03 Feb 2010 23:48:13 -0800
> 
> > +#define ETHTOOL_RXNTUPLE_ACTION_DROP -1
> > +	struct list_head list;
> > +};
> 
> You can't do this.
> 
> You put the list_head here in the kernel header, which BTW can
> be used by userspace too, and then you elide it in the
> ethtool utility copy of the header.
> 
> Use an encapsulator if you must inside of the kernel, but keep the
> userspace visible data structure clean of RCU and list_head
> kernel datastructures.

Ok.  I'll respin this asap.  Thanks for the quick review Dave.

-PJ

^ permalink raw reply

* [PATCH] doc: document IPv6 parameters
From: Brian Haley @ 2010-02-04 20:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, greg

Dave,

Can you take these in net-next-2.6?  I haven't heard boo from anyone on linux-doc or lkml.

-Brian


Update documentation to describe IPv6 parameters.
Reported by <greg@enjellic.com>.

Signed-off-by: Brian Haley <brian.haley@hp.com>
---

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 736d456..3ca7f8f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -54,6 +54,7 @@ parameter is applicable:
 	IMA     Integrity measurement architecture is enabled.
 	IOSCHED	More than one I/O scheduler is enabled.
 	IP_PNP	IP DHCP, BOOTP, or RARP is enabled.
+	IPV6	IPv6 support is enabled.
 	ISAPNP	ISA PnP code is enabled.
 	ISDN	Appropriate ISDN support is enabled.
 	JOY	Appropriate joystick support is enabled.
@@ -347,6 +348,9 @@ and is between 256 and 4096 characters. It is defined in the file
 			Change the amount of debugging information output
 			when initialising the APIC and IO-APIC components.
 
+	autoconf=	[IPV6]
+			See Documentation/networking/ipv6.txt.
+
 	show_lapic=	[APIC,X86] Advanced Programmable Interrupt Controller
 			Limit apic dumping. The parameter defines the maximal
 			number of local apics being dumped. Also it is possible
@@ -629,6 +633,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			See drivers/char/README.epca and
 			Documentation/serial/digiepca.txt.
 
+	disable=	[IPV6]
+			See Documentation/networking/ipv6.txt.
+
+	disable_ipv6=	[IPV6]
+			See Documentation/networking/ipv6.txt.
+
 	disable_mtrr_cleanup [X86]
 			The kernel tries to adjust MTRR layout from continuous
 			to discrete, to make X server driver able to add WB


^ permalink raw reply related

* Re: [net-next PATCH 3/3] qlge: Add watchdog timer.
From: David Miller @ 2010-02-04 20:29 UTC (permalink / raw)
  To: ron.mercer; +Cc: netdev
In-Reply-To: <20100204200603.GB9938@linux-ox1b.qlogic.org>

From: Ron Mercer <ron.mercer@qlogic.com>
Date: Thu, 4 Feb 2010 12:06:03 -0800

> +static void ql_timer(unsigned long data)
> +{
> +	struct ql_adapter *qdev = (struct ql_adapter *)data;
> +	u32 var = 0;
> +
> +	var = ql_read32(qdev, STS);
> +	if (pci_channel_offline(qdev->pdev)) {
> +		QPRINTK(qdev, IFUP, ERR, "EEH STS = 0x%.08x.\n", var);
> +		return;
> +	}
> +
> +	add_timer(&qdev->timer);
> +}
> +

Did the timer every fire more than once in your testing?

Don't you need to re-setup the expiration period before
adding it again?

Same goes for all of those sequences where you go:

	del_timer_sync(&qdev->timer);

	...

	add_timer(&qdev->timer);

in the patch.

^ permalink raw reply

* Re: [PATCH for 2.6.33] conntrack: restrict runtime hashsize modifications
From: Jon Masters @ 2010-02-04 20:23 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: Patrick McHardy, davem, eric.dumazet, netdev, netfilter-devel
In-Reply-To: <20100204194744.GA4185@x200>

On Thu, 2010-02-04 at 21:47 +0200, Alexey Dobriyan wrote:
> On Thu, Feb 04, 2010 at 06:04:34PM +0100, Patrick McHardy wrote:
> > Patrick McHardy wrote:
> > > Alexey Dobriyan wrote:

> > Additionally I removed reinitializing the hash random value when
> > changing the hash size since that also requires to rehash in all
> > namespaces.
> 
> I'm not fond of this, because we're not even closely going to allow changing
> hashtable size per-netns. As such having actual per-netns hashtable size
> just slows down everything.

Are you sure, as compared with a shared global size that this is really
going to slow things down all that much? We already need to poke in that
struct to pull out various things just hash. I haven't profiled to see.

Jon.



^ permalink raw reply

* Re: [PATCH for 2.6.33] conntrack: restrict runtime hashsize modifications
From: Jon Masters @ 2010-02-04 20:20 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Alexey Dobriyan, davem, eric.dumazet, netdev, netfilter-devel
In-Reply-To: <4B6AFE22.20304@trash.net>

On Thu, 2010-02-04 at 18:04 +0100, Patrick McHardy wrote:
> Patrick McHardy wrote:
> > Alexey Dobriyan wrote:
> >> Jon Masters correctly points out that conntrack hash sizes
> >> (nf_conntrack_htable_size) are global (not per-netns) and
> >> modifiable at runtime via /sys/module/nf_conntrack/hashsize .
> >>
> >> Steps to reproduce:
> >> 	clone(CLONE_NEWNET)
> >> 	[grow /sys/module/nf_conntrack/hashsize]
> >> 	exit()
> >>
> >> At netns exit we are going to scan random memory for conntracks to be killed.
> >>
> >> Apparently there is a code which deals with hashtable resize for
> >> init_net (and it was there befode netns conntrack code), so prohibit
> >> hashsize modification if there is more than one netns exists.
> >>
> >> To change hashtable sizes, you need to reload module.
> >>
> >> Expectation hashtable size was simply glued to a variable with no code
> >> to rehash expectations, so it was a bug to allow writing to it.
> >> Make "expect_hashsize" readonly.
> >>
> >> This is temporarily until we figure out what to do.
> > 
> > How about alternatively moving nf_conntrack_hsize into the
> > per-namespace struct? It doesn't look more complicated or
> > intrusive and would allow to still change the init_net
> > hashsize. Also seems less hackish :)
> 
> How about this (so far untested) patch? The htable_size is moved into
> the per-namespace struct and initialized from the current (global)
> value of nf_conntrack_htable_size. Changes through sysfs are still
> permitted, but only affect the init namespace and newly created ones.

I moved the random seed into the per-ns context aswell. I think that's
better than having a global one, and you don't need to rehash all.

Jon.



^ permalink raw reply

* Re: [PATCH for 2.6.33] conntrack: restrict runtime hashsize modifications
From: Jon Masters @ 2010-02-04 20:18 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Alexey Dobriyan, davem, eric.dumazet, netdev, netfilter-devel
In-Reply-To: <4B6AF58A.202@trash.net>

On Thu, 2010-02-04 at 17:27 +0100, Patrick McHardy wrote:
> Patrick McHardy wrote:
> > Alexey Dobriyan wrote:
> >> Jon Masters correctly points out that conntrack hash sizes
> >> (nf_conntrack_htable_size) are global (not per-netns) and
> >> modifiable at runtime via /sys/module/nf_conntrack/hashsize .
> >>
> >> Steps to reproduce:
> >> 	clone(CLONE_NEWNET)
> >> 	[grow /sys/module/nf_conntrack/hashsize]
> >> 	exit()
> >>
> >> At netns exit we are going to scan random memory for conntracks to be killed.
> >>
> >> Apparently there is a code which deals with hashtable resize for
> >> init_net (and it was there befode netns conntrack code), so prohibit
> >> hashsize modification if there is more than one netns exists.
> >>
> >> To change hashtable sizes, you need to reload module.
> >>
> >> Expectation hashtable size was simply glued to a variable with no code
> >> to rehash expectations, so it was a bug to allow writing to it.
> >> Make "expect_hashsize" readonly.
> >>
> >> This is temporarily until we figure out what to do.
> > 
> > How about alternatively moving nf_conntrack_hsize into the
> > per-namespace struct? It doesn't look more complicated or
> > intrusive and would allow to still change the init_net
> > hashsize. Also seems less hackish :)
> 
> Just to avoid duplicate work, I'm currently trying that.

Bah. I already worked a set of patches to do that as I mentioned, but
you've probably done it by now - can clean up and post if not :)

Jon.



^ permalink raw reply

* [PATCH 2/2] qlge: Code clean up
From: leitao @ 2010-02-04 20:11 UTC (permalink / raw)
  To: ron.mercer; +Cc: netdev, Breno Leitao
In-Reply-To: <48284d15bf68cb154cf3948f3fd0b8ea11981ff3.1265314112.git.root@sanx1002.austin.ibm.com>

Just reordering this assignment that doesn't depend on any
condition.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
---
 drivers/net/qlge/qlge_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index c583fb5..0d6e6f8 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4129,12 +4129,12 @@ static int qlge_change_mtu(struct net_device *ndev, int new_mtu)
 	queue_delayed_work(qdev->workqueue,
 			&qdev->mpi_port_cfg_work, 3*HZ);
 
+	ndev->mtu = new_mtu;
+
 	if (!netif_running(qdev->ndev)) {
-		ndev->mtu = new_mtu;
 		return 0;
 	}
 
-	ndev->mtu = new_mtu;
 	status = ql_change_rx_buffers(qdev);
 	if (status) {
 		QPRINTK(qdev, IFUP, ERR,
-- 
1.6.0.2


^ permalink raw reply related

* [PATCH 1/2] qlge: removing unreachable block of code
From: leitao @ 2010-02-04 20:11 UTC (permalink / raw)
  To: ron.mercer; +Cc: netdev, Breno Leitao

Currently the qlge_change_mtu() is never called if the new_mtu is
equal current MTU, due this condition on dev_set_mtu():

        if (new_mtu == dev->mtu)
                return 0;

So, this block of code is never reached and is being removed.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
---
 drivers/net/qlge/qlge_main.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 7e00029..c583fb5 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4123,9 +4123,6 @@ static int qlge_change_mtu(struct net_device *ndev, int new_mtu)
 		QPRINTK(qdev, IFUP, ERR, "Changing to jumbo MTU.\n");
 	} else if (ndev->mtu == 9000 && new_mtu == 1500) {
 		QPRINTK(qdev, IFUP, ERR, "Changing to normal MTU.\n");
-	} else if ((ndev->mtu == 1500 && new_mtu == 1500) ||
-		   (ndev->mtu == 9000 && new_mtu == 9000)) {
-		return 0;
 	} else
 		return -EINVAL;
 
-- 
1.6.0.2


^ permalink raw reply related

* Re: [net-next PATCH 3/3] qlge: Add watchdog timer.
From: Ron Mercer @ 2010-02-04 20:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <20100203.193222.64773800.davem@davemloft.net>

>From 81cc7ea1ce2b906a29ad250daeb120101b70f4f1 Mon Sep 17 00:00:00 2001
From: Ron Mercer <ron.mercer@qlogic.com>
Date: Thu, 4 Feb 2010 11:54:37 -0800
Subject: [net-next PATCH 1/1] qlge: Add watchdog timer.

Add deferred timer for 5-second periodic heartbeat register read to
trigger the eeh recovery process.
We see cases where an eeh error was injected and the slot was
suspended.  An asic access attempt is required to flush the recovery process,
but without interrupts the process can stall.
Adding this periodic register read causes the recovery process to begin.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
 drivers/net/qlge/qlge.h      |    1 +
 drivers/net/qlge/qlge_main.c |   27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index 780a387..ebfd177 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -2145,6 +2145,7 @@ struct ql_adapter {
 	struct completion ide_completion;
 	struct nic_operations *nic_ops;
 	u16 device_id;
+	struct timer_list timer;
 	atomic_t lb_count;
 };
 
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 7e00029..f1fc3a8 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4574,6 +4574,20 @@ static const struct net_device_ops qlge_netdev_ops = {
 	.ndo_vlan_rx_kill_vid	= qlge_vlan_rx_kill_vid,
 };
 
+static void ql_timer(unsigned long data)
+{
+	struct ql_adapter *qdev = (struct ql_adapter *)data;
+	u32 var = 0;
+
+	var = ql_read32(qdev, STS);
+	if (pci_channel_offline(qdev->pdev)) {
+		QPRINTK(qdev, IFUP, ERR, "EEH STS = 0x%.08x.\n", var);
+		return;
+	}
+
+	add_timer(&qdev->timer);
+}
+
 static int __devinit qlge_probe(struct pci_dev *pdev,
 				const struct pci_device_id *pci_entry)
 {
@@ -4625,6 +4639,14 @@ static int __devinit qlge_probe(struct pci_dev *pdev,
 		pci_disable_device(pdev);
 		return err;
 	}
+	/* Start up the timer to trigger EEH if
+	 * the bus goes dead
+	 */
+	init_timer_deferrable(&qdev->timer);
+	qdev->timer.data = (unsigned long)qdev;
+	qdev->timer.function = ql_timer;
+	qdev->timer.expires = jiffies + (5*HZ);
+	add_timer(&qdev->timer);
 	ql_link_off(qdev);
 	ql_display_dev_info(ndev);
 	atomic_set(&qdev->lb_count, 0);
@@ -4645,6 +4667,8 @@ int ql_clean_lb_rx_ring(struct rx_ring *rx_ring, int budget)
 static void __devexit qlge_remove(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
+	struct ql_adapter *qdev = netdev_priv(ndev);
+	del_timer_sync(&qdev->timer);
 	unregister_netdev(ndev);
 	ql_release_all(pdev);
 	pci_disable_device(pdev);
@@ -4757,6 +4781,7 @@ static void qlge_io_resume(struct pci_dev *pdev)
 		QPRINTK(qdev, IFUP, ERR,
 			"Device was not running prior to EEH.\n");
 	}
+	add_timer(&qdev->timer);
 	netif_device_attach(ndev);
 }
 
@@ -4773,6 +4798,7 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state)
 	int err;
 
 	netif_device_detach(ndev);
+	del_timer_sync(&qdev->timer);
 
 	if (netif_running(ndev)) {
 		err = ql_adapter_down(qdev);
@@ -4817,6 +4843,7 @@ static int qlge_resume(struct pci_dev *pdev)
 			return err;
 	}
 
+	add_timer(&qdev->timer);
 	netif_device_attach(ndev);
 
 	return 0;
-- 
1.6.0.2


^ permalink raw reply related

* Re: [PATCH 9/9] net: move am79c961's probe function to .devinit.text
From: Uwe Kleine-König @ 2010-02-04 20:06 UTC (permalink / raw)
  To: David Miller; +Cc: gregkh, linux-kernel, 12o3l, rmk+kernel, netdev, akpm
In-Reply-To: <20100204.120501.110961896.davem@davemloft.net>

On Thu, Feb 04, 2010 at 12:05:01PM -0800, David Miller wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Date: Thu,  4 Feb 2010 20:56:57 +0100
> 
> > @David Miller: this patch is in patchwork with State: Not Applicable.
> > Does that mean that netdev isn't the right tree for this patch?
> 
> I was under the impression that someone would pick up the
> whole set as a unit.
Ah, OK.  I hope Greg does exactly that now.

Thanks
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply

* Re: [PATCH 9/9] net: move am79c961's probe function to .devinit.text
From: David Miller @ 2010-02-04 20:05 UTC (permalink / raw)
  To: u.kleine-koenig; +Cc: gregkh, linux-kernel, 12o3l, rmk+kernel, netdev, akpm
In-Reply-To: <1265313417-5568-9-git-send-email-u.kleine-koenig@pengutronix.de>

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Thu,  4 Feb 2010 20:56:57 +0100

> @David Miller: this patch is in patchwork with State: Not Applicable.
> Does that mean that netdev isn't the right tree for this patch?

I was under the impression that someone would pick up the
whole set as a unit.

If you want me to take it into net-next-2.6 I can.

^ permalink raw reply

* [PATCH 9/9] net: move am79c961's probe function to .devinit.text
From: Uwe Kleine-König @ 2010-02-04 19:56 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Roel Kluin, Russell King, netdev, Andrew Morton
In-Reply-To: <20100203150850.GA28815@kroah.com>

A pointer to am79c961_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: netdev@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
---
Hello,

@David Miller: this patch is in patchwork with State: Not Applicable.
Does that mean that netdev isn't the right tree for this patch?

Best regards
Uwe

 drivers/net/arm/am79c961a.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 164b37e..1c3c1f9 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -680,7 +680,7 @@ static const struct net_device_ops am79c961_netdev_ops = {
 #endif
 };
 
-static int __init am79c961_probe(struct platform_device *pdev)
+static int __devinit am79c961_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *dev;
-- 
1.6.6

^ permalink raw reply related

* Re: [PATCH for 2.6.33] conntrack: restrict runtime hashsize modifications
From: Alexey Dobriyan @ 2010-02-04 19:47 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: davem, jonathan, eric.dumazet, netdev, netfilter-devel
In-Reply-To: <4B6AFE22.20304@trash.net>

On Thu, Feb 04, 2010 at 06:04:34PM +0100, Patrick McHardy wrote:
> Patrick McHardy wrote:
> > Alexey Dobriyan wrote:
> >> Jon Masters correctly points out that conntrack hash sizes
> >> (nf_conntrack_htable_size) are global (not per-netns) and
> >> modifiable at runtime via /sys/module/nf_conntrack/hashsize .
> >>
> >> Steps to reproduce:
> >> 	clone(CLONE_NEWNET)
> >> 	[grow /sys/module/nf_conntrack/hashsize]
> >> 	exit()
> >>
> >> At netns exit we are going to scan random memory for conntracks to be killed.
> >>
> >> Apparently there is a code which deals with hashtable resize for
> >> init_net (and it was there befode netns conntrack code), so prohibit
> >> hashsize modification if there is more than one netns exists.
> >>
> >> To change hashtable sizes, you need to reload module.
> >>
> >> Expectation hashtable size was simply glued to a variable with no code
> >> to rehash expectations, so it was a bug to allow writing to it.
> >> Make "expect_hashsize" readonly.
> >>
> >> This is temporarily until we figure out what to do.
> > 
> > How about alternatively moving nf_conntrack_hsize into the
> > per-namespace struct? It doesn't look more complicated or
> > intrusive and would allow to still change the init_net
> > hashsize. Also seems less hackish :)
> 
> How about this (so far untested) patch? The htable_size is moved into
> the per-namespace struct and initialized from the current (global)
> value of nf_conntrack_htable_size. Changes through sysfs are still
> permitted, but only affect the init namespace and newly created ones.

No matter what we do, it's a hack!

> Additionally I removed reinitializing the hash random value when
> changing the hash size since that also requires to rehash in all
> namespaces.

I'm not fond of this, because we're not even closely going to allow changing
hashtable size per-netns. As such having actual per-netns hashtable size
just slows down everything.

^ permalink raw reply

* Re: netfilter/iptables and network interface names
From: Jan Engelhardt @ 2010-02-04 18:44 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Thomas Woerner, netdev, Netfilter Developer Mailing List
In-Reply-To: <4B6AFAA1.5080703@trash.net>


On Thursday 2010-02-04 17:49, Patrick McHardy wrote:
>Jan Engelhardt wrote:
>>> The kernel also forbids ".".
>> 
>> My first thought was the same, but:
>> 
>> a) Interestingly, it does not prohibit '.'
>> 
>> 	ip tunnel add foo0.3 mode sit local 1.2.3.4 remote 5.6.7.8
>> 
>> b) The '.' is to be seen as valid as far as xtables.c goes, so
>>    as to match VLAN interfaces.
>
>Ah of course, its only invalid at the beginning of the name.
>
Nope:

19:44 borg:/home/jengelh # ip tunnel add .3 mode sit local 1.2.3.6 remote
5.6.7.7
19:44 borg:/home/jengelh # ip a
17: .3: <POINTOPOINT,NOARP> mtu 1480 qdisc noop state DOWN 
    link/sit 1.2.3.6 peer 5.6.7.7

^ permalink raw reply

* Re: [PATCH net-next-2.6] libphy: add phy_find_first function
From: David Miller @ 2010-02-04 18:23 UTC (permalink / raw)
  To: jpirko; +Cc: netdev
In-Reply-To: <20100203153430.GB9266@psychotron.lab.eng.brq.redhat.com>

From: Jiri Pirko <jpirko@redhat.com>
Date: Wed, 3 Feb 2010 16:34:31 +0100

> Many drivers do this in them manually. Now they can use this function.
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next-2.6] net: use helpers to access mc list V2
From: David Miller @ 2010-02-04 18:22 UTC (permalink / raw)
  To: jpirko; +Cc: netdev
In-Reply-To: <20100203125942.GA9266@psychotron.lab.eng.brq.redhat.com>

From: Jiri Pirko <jpirko@redhat.com>
Date: Wed, 3 Feb 2010 13:59:43 +0100

> This patch introduces the similar helpers as those already done for uc list.
> However multicast lists are no list_head lists but "mademanually". The three
> macros added by this patch will make the transition of mc_list to list_head
> smooth in two steps:
> 
> 1) convert all drivers to use these macros (with the original iterator of type
>    "struct dev_mc_list")
> 2) once all drivers are converted, convert list type and iterators to "struct
>    netdev_hw_addr" in one patch.
> 
>>From now on, drivers can (and should) use "netdev_for_each_mc_addr" to iterate
> over the addresses with iterator of type "struct netdev_hw_addr". Also macros
> "netdev_mc_count" and "netdev_mc_empty" to read list's length. This is the state
> which should be reached in all drivers.
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>

Applied, thanks Jiri.

^ permalink raw reply

* Re: [RFC Patch] net: reserve ports for applications using fixed port numbers
From: David Miller @ 2010-02-04 18:21 UTC (permalink / raw)
  To: opurdila-+zzKsuq53OdBDgjK7y7TUQ
  Cc: amwang-H+wXaHxf7aLQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	nhorman-2XuSBdqkA4R54TAoqtyWWQ, linux-sctp-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <201002042015.51092.opurdila-+zzKsuq53OdBDgjK7y7TUQ@public.gmane.org>

From: Octavian Purdila <opurdila-+zzKsuq53OdBDgjK7y7TUQ@public.gmane.org>
Date: Thu, 4 Feb 2010 20:15:51 +0200

> int inet_is_reserved_local_port(int port)
> {
> 	if (test_bit(port, reserved_ports))
> 		return 1;
> 	return 0;
> }
> 
> In theory it might be slower because of the reserved_ports bitmap will have a 
> larger memory footprint than just a min/max, especially with random port 
> allocation. But is this an issue in practice?

No need to speculate, some simple benchmarks would confirm or deny
this.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [RFC Patch] net: reserve ports for applications using fixed port numbers
From: Octavian Purdila @ 2010-02-04 18:15 UTC (permalink / raw)
  To: David Miller
  Cc: amwang-H+wXaHxf7aLQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	nhorman-2XuSBdqkA4R54TAoqtyWWQ, linux-sctp-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20100204.094110.64247447.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

On Thursday 04 February 2010 19:41:10 you wrote:

> From: Octavian Purdila <opurdila-+zzKsuq53OdBDgjK7y7TUQ@public.gmane.org>
> Date: Thu, 4 Feb 2010 14:44:01 +0200
> 
> > My concern is that we can have multiple applications that require a
> > fixed port and if those ports are significantly apart we will
> > decrease the port range available for connect. And that will hurt
> > the rate of which new connections can be opened.
> 
> I'm already uneasy about adding the simple check every time
> we loop around in the bind port allocator.
> 
> Adding an LSM hook to this spot?  I absolutely refuse to allow
> that, it will completely kill bind performance.
> 

I think Tetsuo was proposing the LSM hook, so I'll leave him the daunting task 
of convincing you of the benefit of that :) - I have no opinion on this due to 
massive lack of knowledge.

I was just proposing to use a discrete set of ports instead of a range. The 
check in the current patch:

int inet_is_reserved_local_port(int port)
{
       int min, max;

       inet_get_local_reserved_ports(&min, &max);
       if (min && max)
               return (port >= min && port <= max);
       return 0;
}

would become:

int inet_is_reserved_local_port(int port)
{
	if (test_bit(port, reserved_ports))
		return 1;
	return 0;
}

In theory it might be slower because of the reserved_ports bitmap will have a 
larger memory footprint than just a min/max, especially with random port 
allocation. But is this an issue in practice?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply


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