* Re: [ethtool 2/2] ethtool: allow setting MDI-X state
From: Jeff Kirsher @ 2012-09-06 20:57 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Jesse Brandeburg, netdev, gospo, sassmann
In-Reply-To: <1346955923.2714.26.camel@bwh-desktop.uk.solarflarecom.com>
[-- Attachment #1: Type: text/plain, Size: 3085 bytes --]
On Thu, 2012-09-06 at 19:25 +0100, Ben Hutchings wrote:
> On Tue, 2012-08-21 at 01:37 -0700, Jeff Kirsher wrote:
> > From: Jesse Brandeburg <jesse.brandeburg@intel.com>
> >
> > A bit ago ethtool added support for reading MDI-X state, this
> > patch finishes the implementation, adding the complementary write
> > command.
> [...]
>
> Applied. I also commited the following changes:
>
> ---
> Subject: ethtool.8: Mark-up mdix arguments properly
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> ethtool.8.in | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/ethtool.8.in b/ethtool.8.in
> index 3208d38..2799e25 100644
> --- a/ethtool.8.in
> +++ b/ethtool.8.in
> @@ -523,11 +523,12 @@ Sets full or half duplex mode.
> Selects device port.
> .TP
> .A3 mdix auto on off
> -Selects MDI-X mode for port. May be used to override the automatic detection
> -feature of most adapters. Auto means automatic detection of MDI status, on
> -forces MDI-X (crossover) mode, while off means MDI (straight through) mode.
> -The driver should guarantee that this command takes effect immediately, and
> -if necessary may reset the link to cause the change to take effect.
> +Selects MDI-X mode for port. May be used to override the automatic
> +detection feature of most adapters. An argument of \fBauto\fR means
> +automatic detection of MDI status, \fBon\fR forces MDI-X (crossover)
> +mode, while \fBoff\fR means MDI (straight through) mode. The driver
> +should guarantee that this command takes effect immediately, and if
> +necessary may reset the link to cause the change to take effect.
> .TP
> .A2 autoneg on off
> Specifies whether autonegotiation should be enabled. Autonegotiation
> ---
> Subject: test-cmdline: Test -s mdix keyword
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> test-cmdline.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/test-cmdline.c b/test-cmdline.c
> index 6a60ed4..85b4ce0 100644
> --- a/test-cmdline.c
> +++ b/test-cmdline.c
> @@ -22,12 +22,14 @@ static struct test_case {
> { 1, "16_char_devname!" },
> /* Argument parsing for -s is specialised */
> { 0, "-s devname" },
> - { 0, "--change devname speed 100 duplex half" },
> + { 0, "--change devname speed 100 duplex half mdix auto" },
> { 1, "-s devname speed foo" },
> { 1, "--change devname speed" },
> { 0, "-s devname duplex half" },
> { 1, "--change devname duplex foo" },
> { 1, "-s devname duplex" },
> + { 1, "--change devname mdix foo" },
> + { 1, "-s devname mdix" },
> { 0, "--change devname port tp" },
> { 1, "-s devname port foo" },
> { 1, "--change devname port" },
> ---
>
> Please include at least basic test cases like this for any new feature.
> I did it this time because I've already kept you waiting and didn't
> think it would be fair to request changes.
>
> Ben.
>
Thanks Ben, I will make sure that we cover that with any new features
going forward.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH v2 2/6] net: pxaficp_ir: add irq resources
From: David Miller @ 2012-09-06 20:46 UTC (permalink / raw)
To: robherring2
Cc: linux-arm-kernel, linux, arnd, olof, linus.walleij, rob.herring,
samuel, eric.y.miao, haojian.zhuang, netdev
In-Reply-To: <1346960563-18689-3-git-send-email-robherring2@gmail.com>
From: Rob Herring <robherring2@gmail.com>
Date: Thu, 6 Sep 2012 14:42:39 -0500
> From: Rob Herring <rob.herring@calxeda.com>
>
> In order to remove dependency on mach/irqs.h, add platform device
> resources for irqs.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Feel free to put this in via the ARM tree.
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* [PATCH v2 2/6] net: pxaficp_ir: add irq resources
From: Rob Herring @ 2012-09-06 19:42 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Russell King, Arnd Bergmann, Olof Johansson, Linus Walleij,
Rob Herring, Samuel Ortiz, Eric Miao, Haojian Zhuang, netdev
In-Reply-To: <1346960563-18689-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
In order to remove dependency on mach/irqs.h, add platform device
resources for irqs.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: netdev@vger.kernel.org
---
arch/arm/mach-pxa/devices.c | 15 +++++++++++++++
drivers/net/irda/pxaficp_ir.c | 28 +++++++++++++++++-----------
2 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 166eee5..339eb2a 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -384,9 +384,24 @@ struct platform_device pxa_device_asoc_platform = {
static u64 pxaficp_dmamask = ~(u32)0;
+static struct resource pxa_ir_resources[] = {
+ [0] = {
+ .start = IRQ_STUART,
+ .end = IRQ_STUART,
+ .flags = IORESOURCE_IRQ,
+ },
+ [1] = {
+ .start = IRQ_ICP,
+ .end = IRQ_ICP,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
struct platform_device pxa_device_ficp = {
.name = "pxa2xx-ir",
.id = -1,
+ .num_resources = ARRAY_SIZE(pxa_ir_resources),
+ .resource = pxa_ir_resources,
.dev = {
.dma_mask = &pxaficp_dmamask,
.coherent_dma_mask = 0xffffffff,
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index 8d54767..cb0a5d3 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -29,8 +29,8 @@
#include <mach/dma.h>
#include <mach/irda.h>
-#include <mach/regs-uart.h>
#include <mach/regs-ost.h>
+#include <mach/regs-uart.h>
#define FICP __REG(0x40800000) /* Start of FICP area */
#define ICCR0 __REG(0x40800000) /* ICP Control Register 0 */
@@ -112,6 +112,9 @@ struct pxa_irda {
int txdma;
int rxdma;
+ int uart_irq;
+ int icp_irq;
+
struct irlap_cb *irlap;
struct qos_info qos;
@@ -672,19 +675,19 @@ static int pxa_irda_start(struct net_device *dev)
si->speed = 9600;
- err = request_irq(IRQ_STUART, pxa_irda_sir_irq, 0, dev->name, dev);
+ err = request_irq(si->uart_irq, pxa_irda_sir_irq, 0, dev->name, dev);
if (err)
goto err_irq1;
- err = request_irq(IRQ_ICP, pxa_irda_fir_irq, 0, dev->name, dev);
+ err = request_irq(si->icp_irq, pxa_irda_fir_irq, 0, dev->name, dev);
if (err)
goto err_irq2;
/*
* The interrupt must remain disabled for now.
*/
- disable_irq(IRQ_STUART);
- disable_irq(IRQ_ICP);
+ disable_irq(si->uart_irq);
+ disable_irq(si->icp_irq);
err = -EBUSY;
si->rxdma = pxa_request_dma("FICP_RX",DMA_PRIO_LOW, pxa_irda_fir_dma_rx_irq, dev);
@@ -720,8 +723,8 @@ static int pxa_irda_start(struct net_device *dev)
/*
* Now enable the interrupt and start the queue
*/
- enable_irq(IRQ_STUART);
- enable_irq(IRQ_ICP);
+ enable_irq(si->uart_irq);
+ enable_irq(si->icp_irq);
netif_start_queue(dev);
printk(KERN_DEBUG "pxa_ir: irda driver opened\n");
@@ -738,9 +741,9 @@ err_dma_rx_buff:
err_tx_dma:
pxa_free_dma(si->rxdma);
err_rx_dma:
- free_irq(IRQ_ICP, dev);
+ free_irq(si->icp_irq, dev);
err_irq2:
- free_irq(IRQ_STUART, dev);
+ free_irq(si->uart_irq, dev);
err_irq1:
return err;
@@ -760,8 +763,8 @@ static int pxa_irda_stop(struct net_device *dev)
si->irlap = NULL;
}
- free_irq(IRQ_STUART, dev);
- free_irq(IRQ_ICP, dev);
+ free_irq(si->uart_irq, dev);
+ free_irq(si->icp_irq, dev);
pxa_free_dma(si->rxdma);
pxa_free_dma(si->txdma);
@@ -851,6 +854,9 @@ static int pxa_irda_probe(struct platform_device *pdev)
si->dev = &pdev->dev;
si->pdata = pdev->dev.platform_data;
+ si->uart_irq = platform_get_irq(pdev, 0);
+ si->icp_irq = platform_get_irq(pdev, 1);
+
si->sir_clk = clk_get(&pdev->dev, "UARTCLK");
si->fir_clk = clk_get(&pdev->dev, "FICPCLK");
if (IS_ERR(si->sir_clk) || IS_ERR(si->fir_clk)) {
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v2] ethtool: don't overwrite useful bits in advertising bitfield
From: Ben Hutchings @ 2012-09-06 19:05 UTC (permalink / raw)
To: Johan Gunnarsson; +Cc: netdev
In-Reply-To: <1345807965-16236-1-git-send-email-johangu@axis.com>
On Fri, 2012-08-24 at 13:32 +0200, Johan Gunnarsson wrote:
> There are bits in this bitfield that we want to leave untouched (PAUSE
> and ASYM_PAUSE bits) when changing other bits (speed and duplex bits.)
> Previously, these were always overwritten to zero when running commands
> like "ethtool -s eth0 speed 10 duplex full autoneg off".
>
> Signed-off-by: Johan Gunnarsson <johangu@axis.com>
[...]
Applied, thanks. I made some minor fixes to spelling and formatting.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 0/5] dev_<level> and dynamic_debug cleanups
From: Joe Perches @ 2012-09-06 18:43 UTC (permalink / raw)
To: Jason Baron
Cc: Andrew Morton, netdev, Greg Kroah-Hartman, David S. Miller,
Jim Cromie, Kay Sievers, linux-kernel
In-Reply-To: <20120906175158.GB9786@redhat.com>
On Thu, 2012-09-06 at 13:51 -0400, Jason Baron wrote:
> On Sun, Aug 26, 2012 at 04:25:25AM -0700, Joe Perches wrote:
> > The recent commit to fix dynamic_debug was a bit unclean.
> > Neaten the style for dynamic_debug.
> > Reduce the stack use of message logging that uses netdev_printk
> > Add utility functions dev_printk_emit and dev_vprintk_emit for /dev/kmsg.
> >
> > Joe Perches (5):
> > dev_dbg/dynamic_debug: Update to use printk_emit, optimize stack
> > netdev_printk/dynamic_netdev_dbg: Directly call printk_emit
> > netdev_printk/netif_printk: Remove a superfluous logging colon
> > dev: Add dev_vprintk_emit and dev_printk_emit
> > device and dynamic_debug: Use dev_vprintk_emit and dev_printk_emit
> >
>
> Looks Good.
>
> The one thing that is bothering me though, is that for
> __dynamic_dev_dbg(), __dynamic_netdev_dbg(), we are copying much of the core
> logic of __dev_printk(), __netdev_printk(), respectively. I would prefer
> have this in one place. Can we add a 'prefix' argument to __dev_printk(),
> and __netdev_printk() that dynamic debug can use, but is simply empty
> for dev_printk() and netdev_printk().
I don't think that's an improvement actually.
Why don't you try it.
^ permalink raw reply
* Re: [ethtool 2/2] ethtool: allow setting MDI-X state
From: Ben Hutchings @ 2012-09-06 18:25 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: Jesse Brandeburg, netdev, gospo, sassmann
In-Reply-To: <1345538236-1636-2-git-send-email-jeffrey.t.kirsher@intel.com>
On Tue, 2012-08-21 at 01:37 -0700, Jeff Kirsher wrote:
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
> A bit ago ethtool added support for reading MDI-X state, this
> patch finishes the implementation, adding the complementary write
> command.
[...]
Applied. I also commited the following changes:
---
Subject: ethtool.8: Mark-up mdix arguments properly
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
ethtool.8.in | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/ethtool.8.in b/ethtool.8.in
index 3208d38..2799e25 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -523,11 +523,12 @@ Sets full or half duplex mode.
Selects device port.
.TP
.A3 mdix auto on off
-Selects MDI-X mode for port. May be used to override the automatic detection
-feature of most adapters. Auto means automatic detection of MDI status, on
-forces MDI-X (crossover) mode, while off means MDI (straight through) mode.
-The driver should guarantee that this command takes effect immediately, and
-if necessary may reset the link to cause the change to take effect.
+Selects MDI-X mode for port. May be used to override the automatic
+detection feature of most adapters. An argument of \fBauto\fR means
+automatic detection of MDI status, \fBon\fR forces MDI-X (crossover)
+mode, while \fBoff\fR means MDI (straight through) mode. The driver
+should guarantee that this command takes effect immediately, and if
+necessary may reset the link to cause the change to take effect.
.TP
.A2 autoneg on off
Specifies whether autonegotiation should be enabled. Autonegotiation
---
Subject: test-cmdline: Test -s mdix keyword
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
test-cmdline.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/test-cmdline.c b/test-cmdline.c
index 6a60ed4..85b4ce0 100644
--- a/test-cmdline.c
+++ b/test-cmdline.c
@@ -22,12 +22,14 @@ static struct test_case {
{ 1, "16_char_devname!" },
/* Argument parsing for -s is specialised */
{ 0, "-s devname" },
- { 0, "--change devname speed 100 duplex half" },
+ { 0, "--change devname speed 100 duplex half mdix auto" },
{ 1, "-s devname speed foo" },
{ 1, "--change devname speed" },
{ 0, "-s devname duplex half" },
{ 1, "--change devname duplex foo" },
{ 1, "-s devname duplex" },
+ { 1, "--change devname mdix foo" },
+ { 1, "-s devname mdix" },
{ 0, "--change devname port tp" },
{ 1, "-s devname port foo" },
{ 1, "--change devname port" },
---
Please include at least basic test cases like this for any new feature.
I did it this time because I've already kept you waiting and didn't
think it would be fair to request changes.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* Re: [PATCH net-next] tcp: fix TFO regression
From: David Miller @ 2012-09-06 18:23 UTC (permalink / raw)
To: ncardwell
Cc: eric.dumazet, fengguang.wu, mkl, hkchu, ebiederm, netdev,
linux-can
In-Reply-To: <CADVnQykCJJdM3PfN=_1yyzizao2T6XQJGzC=3uwx5_oazaBicA@mail.gmail.com>
From: Neal Cardwell <ncardwell@google.com>
Date: Thu, 6 Sep 2012 14:15:38 -0400
> On Thu, Sep 6, 2012 at 2:07 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> Fengguang Wu reported various panics and bisected to commit
>> 8336886f786fdac (tcp: TCP Fast Open Server - support TFO listeners)
>>
>> Fix this by making sure socket is a TCP socket before accessing TFO data
>> structures.
>>
> ...
>>
>> Reported-by: Fengguang Wu <wfg@linux.intel.com>
>> Tested-by: Fengguang Wu <wfg@linux.intel.com>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Cc: "H.K. Jerry Chu" <hkchu@google.com>
>
> Acked-by: Neal Cardwell <ncardwell@google.com>
Applied, thanks everyone.
^ permalink raw reply
* Re: [PATCH net-next] tcp: fix TFO regression
From: Jerry Chu @ 2012-09-06 18:18 UTC (permalink / raw)
To: Eric Dumazet
Cc: Fengguang Wu, David Miller, Marc Kleine-Budde, Eric W. Biederman,
networking, linux-can
In-Reply-To: <1346954833.2484.50.camel@edumazet-glaptop>
On Thu, Sep 6, 2012 at 11:07 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Fengguang Wu reported various panics and bisected to commit
> 8336886f786fdac (tcp: TCP Fast Open Server - support TFO listeners)
>
> Fix this by making sure socket is a TCP socket before accessing TFO data
> structures.
>
> [ 233.046014] kfree_debugcheck: out of range ptr ea6000000bb8h.
> [ 233.047399] ------------[ cut here ]------------
> [ 233.048393] kernel BUG at /c/kernel-tests/src/stable/mm/slab.c:3074!
> [ 233.048393] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
> [ 233.048393] Modules linked in:
> [ 233.048393] CPU 0
> [ 233.048393] Pid: 3929, comm: trinity-watchdo Not tainted 3.6.0-rc3+
> #4192 Bochs Bochs
> [ 233.048393] RIP: 0010:[<ffffffff81169653>] [<ffffffff81169653>]
> kfree_debugcheck+0x27/0x2d
> [ 233.048393] RSP: 0018:ffff88000facbca8 EFLAGS: 00010092
> [ 233.048393] RAX: 0000000000000031 RBX: 0000ea6000000bb8 RCX:
> 00000000a189a188
> [ 233.048393] RDX: 000000000000a189 RSI: ffffffff8108ad32 RDI:
> ffffffff810d30f9
> [ 233.048393] RBP: ffff88000facbcb8 R08: 0000000000000002 R09:
> ffffffff843846f0
> [ 233.048393] R10: ffffffff810ae37c R11: 0000000000000908 R12:
> 0000000000000202
> [ 233.048393] R13: ffffffff823dbd5a R14: ffff88000ec5bea8 R15:
> ffffffff8363c780
> [ 233.048393] FS: 00007faa6899c700(0000) GS:ffff88001f200000(0000)
> knlGS:0000000000000000
> [ 233.048393] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [ 233.048393] CR2: 00007faa6841019c CR3: 0000000012c82000 CR4:
> 00000000000006f0
> [ 233.048393] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [ 233.048393] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
> 0000000000000400
> [ 233.048393] Process trinity-watchdo (pid: 3929, threadinfo
> ffff88000faca000, task ffff88000faec600)
> [ 233.048393] Stack:
> [ 233.048393] 0000000000000000 0000ea6000000bb8 ffff88000facbce8
> ffffffff8116ad81
> [ 233.048393] ffff88000ff588a0 ffff88000ff58850 ffff88000ff588a0
> 0000000000000000
> [ 233.048393] ffff88000facbd08 ffffffff823dbd5a ffffffff823dbcb0
> ffff88000ff58850
> [ 233.048393] Call Trace:
> [ 233.048393] [<ffffffff8116ad81>] kfree+0x5f/0xca
> [ 233.048393] [<ffffffff823dbd5a>] inet_sock_destruct+0xaa/0x13c
> [ 233.048393] [<ffffffff823dbcb0>] ? inet_sk_rebuild_header
> +0x319/0x319
> [ 233.048393] [<ffffffff8231c307>] __sk_free+0x21/0x14b
> [ 233.048393] [<ffffffff8231c4bd>] sk_free+0x26/0x2a
> [ 233.048393] [<ffffffff825372db>] sctp_close+0x215/0x224
> [ 233.048393] [<ffffffff810d6835>] ? lock_release+0x16f/0x1b9
> [ 233.048393] [<ffffffff823daf12>] inet_release+0x7e/0x85
> [ 233.048393] [<ffffffff82317d15>] sock_release+0x1f/0x77
> [ 233.048393] [<ffffffff82317d94>] sock_close+0x27/0x2b
> [ 233.048393] [<ffffffff81173bbe>] __fput+0x101/0x20a
> [ 233.048393] [<ffffffff81173cd5>] ____fput+0xe/0x10
> [ 233.048393] [<ffffffff810a3794>] task_work_run+0x5d/0x75
> [ 233.048393] [<ffffffff8108da70>] do_exit+0x290/0x7f5
> [ 233.048393] [<ffffffff82707415>] ? retint_swapgs+0x13/0x1b
> [ 233.048393] [<ffffffff8108e23f>] do_group_exit+0x7b/0xba
> [ 233.048393] [<ffffffff8108e295>] sys_exit_group+0x17/0x17
> [ 233.048393] [<ffffffff8270de10>] tracesys+0xdd/0xe2
> [ 233.048393] Code: 59 01 5d c3 55 48 89 e5 53 41 50 0f 1f 44 00 00 48
> 89 fb e8 d4 b0 f0 ff 84 c0 75 11 48 89 de 48 c7 c7 fc fa f7 82 e8 0d 0f
> 57 01 <0f> 0b 5f 5b 5d c3 55 48 89 e5 0f 1f 44 00 00 48 63 87 d8 00 00
> [ 233.048393] RIP [<ffffffff81169653>] kfree_debugcheck+0x27/0x2d
> [ 233.048393] RSP <ffff88000facbca8>
>
> Reported-by: Fengguang Wu <wfg@linux.intel.com>
> Tested-by: Fengguang Wu <wfg@linux.intel.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: "H.K. Jerry Chu" <hkchu@google.com>
> ---
> net/ipv4/af_inet.c | 7 ++-----
> net/ipv4/inet_connection_sock.c | 4 ++--
> 2 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> index 4f70ef0..845372b 100644
> --- a/net/ipv4/af_inet.c
> +++ b/net/ipv4/af_inet.c
> @@ -149,11 +149,8 @@ void inet_sock_destruct(struct sock *sk)
> pr_err("Attempt to release alive inet socket %p\n", sk);
> return;
> }
> - if (sk->sk_type == SOCK_STREAM) {
> - struct fastopen_queue *fastopenq =
> - inet_csk(sk)->icsk_accept_queue.fastopenq;
> - kfree(fastopenq);
> - }
> + if (sk->sk_protocol == IPPROTO_TCP)
> + kfree(inet_csk(sk)->icsk_accept_queue.fastopenq);
>
> WARN_ON(atomic_read(&sk->sk_rmem_alloc));
> WARN_ON(atomic_read(&sk->sk_wmem_alloc));
> diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
> index 8464b79..f0c5b9c 100644
> --- a/net/ipv4/inet_connection_sock.c
> +++ b/net/ipv4/inet_connection_sock.c
> @@ -314,7 +314,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err)
> newsk = req->sk;
>
> sk_acceptq_removed(sk);
> - if (sk->sk_type == SOCK_STREAM && queue->fastopenq != NULL) {
> + if (sk->sk_protocol == IPPROTO_TCP && queue->fastopenq != NULL) {
> spin_lock_bh(&queue->fastopenq->lock);
> if (tcp_rsk(req)->listener) {
> /* We are still waiting for the final ACK from 3WHS
> @@ -775,7 +775,7 @@ void inet_csk_listen_stop(struct sock *sk)
>
> percpu_counter_inc(sk->sk_prot->orphan_count);
>
> - if (sk->sk_type == SOCK_STREAM && tcp_rsk(req)->listener) {
> + if (sk->sk_protocol == IPPROTO_TCP && tcp_rsk(req)->listener) {
> BUG_ON(tcp_sk(child)->fastopen_rsk != req);
> BUG_ON(sk != tcp_rsk(req)->listener);
>
>
>
Thanks, Eric.
Acked-by: H.K. Jerry Chu <hkchu@google.com>
^ permalink raw reply
* Re: [PATCH net-next] tcp: fix TFO regression
From: Neal Cardwell @ 2012-09-06 18:15 UTC (permalink / raw)
To: Eric Dumazet
Cc: Fengguang Wu, David Miller, Marc Kleine-Budde, H.K. Jerry Chu,
Eric W. Biederman, networking, linux-can
In-Reply-To: <1346954833.2484.50.camel@edumazet-glaptop>
On Thu, Sep 6, 2012 at 2:07 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Fengguang Wu reported various panics and bisected to commit
> 8336886f786fdac (tcp: TCP Fast Open Server - support TFO listeners)
>
> Fix this by making sure socket is a TCP socket before accessing TFO data
> structures.
>
...
>
> Reported-by: Fengguang Wu <wfg@linux.intel.com>
> Tested-by: Fengguang Wu <wfg@linux.intel.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: "H.K. Jerry Chu" <hkchu@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
neal
^ permalink raw reply
* Re: [PATCH] sctp: check dst validity after IPsec operations
From: David Miller @ 2012-09-06 18:10 UTC (permalink / raw)
To: nicolas.dichtel; +Cc: vyasevich, sri, linux-sctp, netdev
In-Reply-To: <1346953229-3825-1-git-send-email-nicolas.dichtel@6wind.com>
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Thu, 6 Sep 2012 13:40:29 -0400
> dst stored in struct sctp_transport needs to be recalculated when ipsec policy
> are updated. We use flow_cache_genid for that.
>
> For example, if a SCTP connection is established and then an IPsec policy is
> set, the old SCTP flow will not be updated and thus will not use the new
> IPsec policy.
>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
I don't like that SCTP need to perform special DST validation.
The normal DST validation mechanism already in place should be
sufficient.
Otherwise this problem must exist in other protocols too, and
fixing a tree wide issue privately inside of one protocol is
not acceptable.
^ permalink raw reply
* [PATCH net-next] tcp: fix TFO regression
From: Eric Dumazet @ 2012-09-06 18:07 UTC (permalink / raw)
To: Fengguang Wu, David Miller
Cc: Marc Kleine-Budde, H.K. Jerry Chu, Eric W. Biederman, networking,
linux-can
In-Reply-To: <20120906045452.GA18181@localhost>
From: Eric Dumazet <edumazet@google.com>
Fengguang Wu reported various panics and bisected to commit
8336886f786fdac (tcp: TCP Fast Open Server - support TFO listeners)
Fix this by making sure socket is a TCP socket before accessing TFO data
structures.
[ 233.046014] kfree_debugcheck: out of range ptr ea6000000bb8h.
[ 233.047399] ------------[ cut here ]------------
[ 233.048393] kernel BUG at /c/kernel-tests/src/stable/mm/slab.c:3074!
[ 233.048393] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
[ 233.048393] Modules linked in:
[ 233.048393] CPU 0
[ 233.048393] Pid: 3929, comm: trinity-watchdo Not tainted 3.6.0-rc3+
#4192 Bochs Bochs
[ 233.048393] RIP: 0010:[<ffffffff81169653>] [<ffffffff81169653>]
kfree_debugcheck+0x27/0x2d
[ 233.048393] RSP: 0018:ffff88000facbca8 EFLAGS: 00010092
[ 233.048393] RAX: 0000000000000031 RBX: 0000ea6000000bb8 RCX:
00000000a189a188
[ 233.048393] RDX: 000000000000a189 RSI: ffffffff8108ad32 RDI:
ffffffff810d30f9
[ 233.048393] RBP: ffff88000facbcb8 R08: 0000000000000002 R09:
ffffffff843846f0
[ 233.048393] R10: ffffffff810ae37c R11: 0000000000000908 R12:
0000000000000202
[ 233.048393] R13: ffffffff823dbd5a R14: ffff88000ec5bea8 R15:
ffffffff8363c780
[ 233.048393] FS: 00007faa6899c700(0000) GS:ffff88001f200000(0000)
knlGS:0000000000000000
[ 233.048393] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 233.048393] CR2: 00007faa6841019c CR3: 0000000012c82000 CR4:
00000000000006f0
[ 233.048393] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[ 233.048393] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[ 233.048393] Process trinity-watchdo (pid: 3929, threadinfo
ffff88000faca000, task ffff88000faec600)
[ 233.048393] Stack:
[ 233.048393] 0000000000000000 0000ea6000000bb8 ffff88000facbce8
ffffffff8116ad81
[ 233.048393] ffff88000ff588a0 ffff88000ff58850 ffff88000ff588a0
0000000000000000
[ 233.048393] ffff88000facbd08 ffffffff823dbd5a ffffffff823dbcb0
ffff88000ff58850
[ 233.048393] Call Trace:
[ 233.048393] [<ffffffff8116ad81>] kfree+0x5f/0xca
[ 233.048393] [<ffffffff823dbd5a>] inet_sock_destruct+0xaa/0x13c
[ 233.048393] [<ffffffff823dbcb0>] ? inet_sk_rebuild_header
+0x319/0x319
[ 233.048393] [<ffffffff8231c307>] __sk_free+0x21/0x14b
[ 233.048393] [<ffffffff8231c4bd>] sk_free+0x26/0x2a
[ 233.048393] [<ffffffff825372db>] sctp_close+0x215/0x224
[ 233.048393] [<ffffffff810d6835>] ? lock_release+0x16f/0x1b9
[ 233.048393] [<ffffffff823daf12>] inet_release+0x7e/0x85
[ 233.048393] [<ffffffff82317d15>] sock_release+0x1f/0x77
[ 233.048393] [<ffffffff82317d94>] sock_close+0x27/0x2b
[ 233.048393] [<ffffffff81173bbe>] __fput+0x101/0x20a
[ 233.048393] [<ffffffff81173cd5>] ____fput+0xe/0x10
[ 233.048393] [<ffffffff810a3794>] task_work_run+0x5d/0x75
[ 233.048393] [<ffffffff8108da70>] do_exit+0x290/0x7f5
[ 233.048393] [<ffffffff82707415>] ? retint_swapgs+0x13/0x1b
[ 233.048393] [<ffffffff8108e23f>] do_group_exit+0x7b/0xba
[ 233.048393] [<ffffffff8108e295>] sys_exit_group+0x17/0x17
[ 233.048393] [<ffffffff8270de10>] tracesys+0xdd/0xe2
[ 233.048393] Code: 59 01 5d c3 55 48 89 e5 53 41 50 0f 1f 44 00 00 48
89 fb e8 d4 b0 f0 ff 84 c0 75 11 48 89 de 48 c7 c7 fc fa f7 82 e8 0d 0f
57 01 <0f> 0b 5f 5b 5d c3 55 48 89 e5 0f 1f 44 00 00 48 63 87 d8 00 00
[ 233.048393] RIP [<ffffffff81169653>] kfree_debugcheck+0x27/0x2d
[ 233.048393] RSP <ffff88000facbca8>
Reported-by: Fengguang Wu <wfg@linux.intel.com>
Tested-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: "H.K. Jerry Chu" <hkchu@google.com>
---
net/ipv4/af_inet.c | 7 ++-----
net/ipv4/inet_connection_sock.c | 4 ++--
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 4f70ef0..845372b 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -149,11 +149,8 @@ void inet_sock_destruct(struct sock *sk)
pr_err("Attempt to release alive inet socket %p\n", sk);
return;
}
- if (sk->sk_type == SOCK_STREAM) {
- struct fastopen_queue *fastopenq =
- inet_csk(sk)->icsk_accept_queue.fastopenq;
- kfree(fastopenq);
- }
+ if (sk->sk_protocol == IPPROTO_TCP)
+ kfree(inet_csk(sk)->icsk_accept_queue.fastopenq);
WARN_ON(atomic_read(&sk->sk_rmem_alloc));
WARN_ON(atomic_read(&sk->sk_wmem_alloc));
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 8464b79..f0c5b9c 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -314,7 +314,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err)
newsk = req->sk;
sk_acceptq_removed(sk);
- if (sk->sk_type == SOCK_STREAM && queue->fastopenq != NULL) {
+ if (sk->sk_protocol == IPPROTO_TCP && queue->fastopenq != NULL) {
spin_lock_bh(&queue->fastopenq->lock);
if (tcp_rsk(req)->listener) {
/* We are still waiting for the final ACK from 3WHS
@@ -775,7 +775,7 @@ void inet_csk_listen_stop(struct sock *sk)
percpu_counter_inc(sk->sk_prot->orphan_count);
- if (sk->sk_type == SOCK_STREAM && tcp_rsk(req)->listener) {
+ if (sk->sk_protocol == IPPROTO_TCP && tcp_rsk(req)->listener) {
BUG_ON(tcp_sk(child)->fastopen_rsk != req);
BUG_ON(sk != tcp_rsk(req)->listener);
^ permalink raw reply related
* Re: [PATCH 1/4] slab: do ClearSlabPfmemalloc() for all pages of slab
From: JoonSoo Kim @ 2012-09-06 18:05 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, LKML, David Miller,
Chuck Lever, Pekka Enberg, David Rientjes, Christoph Lameter
In-Reply-To: <CAAmzW4M_3hVBfjqFLG=7iydkXeQPdCXRbRmkqUJD4vwo0eWVWQ@mail.gmail.com>
Correct Pekka's mail address and resend.
Sorry.
Add "Cc" to "Christoph Lameter" <cl@linux.com>
2012/9/5 Mel Gorman <mgorman@suse.de>:
> Right now, we call ClearSlabPfmemalloc() for first page of slab when we
> clear SlabPfmemalloc flag. This is fine for most swap-over-network use
> cases as it is expected that order-0 pages are in use. Unfortunately it
> is possible that that __ac_put_obj() checks SlabPfmemalloc on a tail page
> and while this is harmless, it is sloppy. This patch ensures that the head
> page is always used.
>
> This problem was originally identified by Joonsoo Kim.
>
> [js1304@gmail.com: Original implementation and problem identification]
> Signed-off-by: Mel Gorman <mgorman@suse.de>
> ---
> mm/slab.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index 811af03..d34a903 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -1000,7 +1000,7 @@ static void *__ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac,
> l3 = cachep->nodelists[numa_mem_id()];
> if (!list_empty(&l3->slabs_free) && force_refill) {
> struct slab *slabp = virt_to_slab(objp);
> - ClearPageSlabPfmemalloc(virt_to_page(slabp->s_mem));
> + ClearPageSlabPfmemalloc(virt_to_head_page(slabp->s_mem));
> clear_obj_pfmemalloc(&objp);
> recheck_pfmemalloc_active(cachep, ac);
> return objp;
We assume that slabp->s_mem's address is always in head page, so
"virt_to_head_page" is not needed.
> @@ -1032,7 +1032,7 @@ static void *__ac_put_obj(struct kmem_cache *cachep, struct array_cache *ac,
> {
> if (unlikely(pfmemalloc_active)) {
> /* Some pfmemalloc slabs exist, check if this is one */
> - struct page *page = virt_to_page(objp);
> + struct page *page = virt_to_head_page(objp);
> if (PageSlabPfmemalloc(page))
> set_obj_pfmemalloc(&objp);
> }
> --
> 1.7.9.2
>
If we always use head page, following suggestion is more good to me.
How about you?
diff --git a/mm/slab.c b/mm/slab.c
index f8b0d53..ce70989 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1032,7 +1032,7 @@ static void *__ac_put_obj(struct kmem_cache
*cachep, struct array_cache *ac,
{
if (unlikely(pfmemalloc_active)) {
/* Some pfmemalloc slabs exist, check if this is one */
- struct page *page = virt_to_page(objp);
+ struct page *page = virt_to_head_page(objp);
if (PageSlabPfmemalloc(page))
set_obj_pfmemalloc(&objp);
}
@@ -1921,10 +1921,9 @@ static void *kmem_getpages(struct kmem_cache
*cachep, gfp_t flags, int nodeid)
NR_SLAB_UNRECLAIMABLE, nr_pages);
for (i = 0; i < nr_pages; i++) {
__SetPageSlab(page + i);
-
- if (page->pfmemalloc)
- SetPageSlabPfmemalloc(page + i);
}
+ if (page->pfmemalloc)
+ SetPageSlabPfmemalloc(page);
if (kmemcheck_enabled && !(cachep->flags & SLAB_NOTRACK)) {
kmemcheck_alloc_shadow(page, cachep->gfporder, flags, nodeid);
@@ -1943,26 +1942,26 @@ static void *kmem_getpages(struct kmem_cache
*cachep, gfp_t flags, int nodeid)
*/
static void kmem_freepages(struct kmem_cache *cachep, void *addr)
{
- unsigned long i = (1 << cachep->gfporder);
+ int nr_pages = (1 << cachep->gfporder);
+ int i;
struct page *page = virt_to_page(addr);
- const unsigned long nr_freed = i;
kmemcheck_free_shadow(page, cachep->gfporder);
if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
sub_zone_page_state(page_zone(page),
- NR_SLAB_RECLAIMABLE, nr_freed);
+ NR_SLAB_RECLAIMABLE, nr_pages);
else
sub_zone_page_state(page_zone(page),
- NR_SLAB_UNRECLAIMABLE, nr_freed);
- while (i--) {
- BUG_ON(!PageSlab(page));
- __ClearPageSlabPfmemalloc(page);
- __ClearPageSlab(page);
- page++;
+ NR_SLAB_UNRECLAIMABLE, nr_pages);
+ for (i = 0; i < nr_pages; i++) {
+ BUG_ON(!PageSlab(page + i));
+ __ClearPageSlab(page + i);
}
+ __ClearPageSlabPfmemalloc(page);
+
if (current->reclaim_state)
- current->reclaim_state->reclaimed_slab += nr_freed;
+ current->reclaim_state->reclaimed_slab += nr_pages;
free_pages((unsigned long)addr, cachep->gfporder);
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* Re: [PATCH] Fix "ip -6 route add ... nexthop"
From: Vincent Bernat @ 2012-09-06 17:53 UTC (permalink / raw)
To: netdev
In-Reply-To: <1346952649-5716-2-git-send-email-bernat@luffy.cx>
❦ 6 septembre 2012 19:30 CEST, Vincent Bernat <bernat@luffy.cx> :
> IPv6 multipath routes were not accepted by "ip route" because an IPv4
> address was expected for each gateway. Use `get_addr()` instead of
> `get_addr32()`.
Well, looking at the kernel, I have just discovered that there is no
support for IPv6 multipath. This explains a lot of things for me and
this patch is therefore useless (but could still be applied for future
purposes?).
--
panic("CPU too expensive - making holiday in the ANDES!");
2.2.16 /usr/src/linux/arch/mips/kernel/traps.c
^ permalink raw reply
* Re: changing usbnet's API to better deal with cdc-ncm
From: Oliver Neukum @ 2012-09-06 17:56 UTC (permalink / raw)
To: Ming Lei; +Cc: Bjørn Mork, alexey.orishko, netdev, linux-usb
In-Reply-To: <CACVXFVMYmTFLamWzTL2gTtu31eQg6bpLA4NapJehPoROF4t3dw@mail.gmail.com>
On Friday 07 September 2012 00:09:13 Ming Lei wrote:
> On Thu, Sep 6, 2012 at 4:30 PM, Bjørn Mork <bjorn@mork.no> wrote:
> > Ming Lei <tom.leiming@gmail.com> writes:
> >> Looks the introduced .tx_bundle is not necessary since .tx_fixup is OK.
> >
> > The minidriver does not have any information about tx in progress. The
>
> Inside .tx_fixup, the low level driver will get the tx progress information.
That information changes after tx_fixup
> > strategy above, which is what cdc_ncm uses today, is fine as long as you
> > always want to wait as long as you always want to fill as many frames as
> > possible in each packet. But what if the queue is empty and the device
>
> For cdc_ncm, the wait time is controlled by cdc_ncm driver, see
> cdc_ncm_tx_timeout_start().
Well, that is the mistake. Using a timer is a bad idea.
> If we can abstract some common things about aggregation, it should be
> meaningful. As far as I know, most of aggregation protocol is very different,
> so almost all aggregation work is only done by low level driver, such as
> cdc_ncm.
>
> If we want to implement some aggregation framework, maybe below is
> one solution, correct me if it is wrong.
It isn't so much wrong as incomplete.
It seems to me we can have
- can queue, buffer not full -> do nothing more
- can queue, buffer full -> transmit
- cannot queue, buffer full -> transmit and then try again to queue
and an error case
- cannot queue, buffer not full
And that's the way I coded it.
Regards
Oliver
^ permalink raw reply
* Re: [PATCH 1/4] slab: do ClearSlabPfmemalloc() for all pages of slab
From: JoonSoo Kim @ 2012-09-06 17:57 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, LKML, David Miller,
Chuck Lever, Pekka, "Enberg <penberg", David Rientjes,
Christoph Lameter
In-Reply-To: <1346779479-1097-2-git-send-email-mgorman@suse.de>
Add "Cc" to "Christoph Lameter" <cl@linux.com>
2012/9/5 Mel Gorman <mgorman@suse.de>:
> Right now, we call ClearSlabPfmemalloc() for first page of slab when we
> clear SlabPfmemalloc flag. This is fine for most swap-over-network use
> cases as it is expected that order-0 pages are in use. Unfortunately it
> is possible that that __ac_put_obj() checks SlabPfmemalloc on a tail page
> and while this is harmless, it is sloppy. This patch ensures that the head
> page is always used.
>
> This problem was originally identified by Joonsoo Kim.
>
> [js1304@gmail.com: Original implementation and problem identification]
> Signed-off-by: Mel Gorman <mgorman@suse.de>
> ---
> mm/slab.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index 811af03..d34a903 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -1000,7 +1000,7 @@ static void *__ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac,
> l3 = cachep->nodelists[numa_mem_id()];
> if (!list_empty(&l3->slabs_free) && force_refill) {
> struct slab *slabp = virt_to_slab(objp);
> - ClearPageSlabPfmemalloc(virt_to_page(slabp->s_mem));
> + ClearPageSlabPfmemalloc(virt_to_head_page(slabp->s_mem));
> clear_obj_pfmemalloc(&objp);
> recheck_pfmemalloc_active(cachep, ac);
> return objp;
We assume that slabp->s_mem's address is always in head page, so
"virt_to_head_page" is not needed.
> @@ -1032,7 +1032,7 @@ static void *__ac_put_obj(struct kmem_cache *cachep, struct array_cache *ac,
> {
> if (unlikely(pfmemalloc_active)) {
> /* Some pfmemalloc slabs exist, check if this is one */
> - struct page *page = virt_to_page(objp);
> + struct page *page = virt_to_head_page(objp);
> if (PageSlabPfmemalloc(page))
> set_obj_pfmemalloc(&objp);
> }
> --
> 1.7.9.2
>
If we always use head page, following suggestion is more good to me.
How about you?
diff --git a/mm/slab.c b/mm/slab.c
index f8b0d53..ce70989 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1032,7 +1032,7 @@ static void *__ac_put_obj(struct kmem_cache
*cachep, struct array_cache *ac,
{
if (unlikely(pfmemalloc_active)) {
/* Some pfmemalloc slabs exist, check if this is one */
- struct page *page = virt_to_page(objp);
+ struct page *page = virt_to_head_page(objp);
if (PageSlabPfmemalloc(page))
set_obj_pfmemalloc(&objp);
}
@@ -1921,10 +1921,9 @@ static void *kmem_getpages(struct kmem_cache
*cachep, gfp_t flags, int nodeid)
NR_SLAB_UNRECLAIMABLE, nr_pages);
for (i = 0; i < nr_pages; i++) {
__SetPageSlab(page + i);
-
- if (page->pfmemalloc)
- SetPageSlabPfmemalloc(page + i);
}
+ if (page->pfmemalloc)
+ SetPageSlabPfmemalloc(page);
if (kmemcheck_enabled && !(cachep->flags & SLAB_NOTRACK)) {
kmemcheck_alloc_shadow(page, cachep->gfporder, flags, nodeid);
@@ -1943,26 +1942,26 @@ static void *kmem_getpages(struct kmem_cache
*cachep, gfp_t flags, int nodeid)
*/
static void kmem_freepages(struct kmem_cache *cachep, void *addr)
{
- unsigned long i = (1 << cachep->gfporder);
+ int nr_pages = (1 << cachep->gfporder);
+ int i;
struct page *page = virt_to_page(addr);
- const unsigned long nr_freed = i;
kmemcheck_free_shadow(page, cachep->gfporder);
if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
sub_zone_page_state(page_zone(page),
- NR_SLAB_RECLAIMABLE, nr_freed);
+ NR_SLAB_RECLAIMABLE, nr_pages);
else
sub_zone_page_state(page_zone(page),
- NR_SLAB_UNRECLAIMABLE, nr_freed);
- while (i--) {
- BUG_ON(!PageSlab(page));
- __ClearPageSlabPfmemalloc(page);
- __ClearPageSlab(page);
- page++;
+ NR_SLAB_UNRECLAIMABLE, nr_pages);
+ for (i = 0; i < nr_pages; i++) {
+ BUG_ON(!PageSlab(page + i));
+ __ClearPageSlab(page + i);
}
+ __ClearPageSlabPfmemalloc(page);
+
if (current->reclaim_state)
- current->reclaim_state->reclaimed_slab += nr_freed;
+ current->reclaim_state->reclaimed_slab += nr_pages;
free_pages((unsigned long)addr, cachep->gfporder);
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* Re: [PATCH 0/5] dev_<level> and dynamic_debug cleanups
From: Jason Baron @ 2012-09-06 17:53 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jim Cromie, Kay Sievers, Joe Perches, Andrew Morton, netdev,
David S. Miller, linux-kernel
In-Reply-To: <20120906161359.GC23641@kroah.com>
On Thu, Sep 06, 2012 at 09:13:59AM -0700, Greg Kroah-Hartman wrote:
> On Thu, Aug 30, 2012 at 09:48:12PM -0600, Jim Cromie wrote:
> > On Thu, Aug 30, 2012 at 11:43 AM, Jim Cromie <jim.cromie@gmail.com> wrote:
> > > On Sun, Aug 26, 2012 at 5:25 AM, Joe Perches <joe@perches.com> wrote:
> > >> The recent commit to fix dynamic_debug was a bit unclean.
> > >> Neaten the style for dynamic_debug.
> > >> Reduce the stack use of message logging that uses netdev_printk
> > >> Add utility functions dev_printk_emit and dev_vprintk_emit for /dev/kmsg.
> > >>
> > >> Joe Perches (5):
> > >> dev_dbg/dynamic_debug: Update to use printk_emit, optimize stack
> > >> netdev_printk/dynamic_netdev_dbg: Directly call printk_emit
> > >> netdev_printk/netif_printk: Remove a superfluous logging colon
> > >> dev: Add dev_vprintk_emit and dev_printk_emit
> > >> device and dynamic_debug: Use dev_vprintk_emit and dev_printk_emit
> > >>
> > >
> > > Ive tested this on 2 builds differing only by DYNAMIC_DEBUG
> > > It works for me on x86-64
> > >
> > > However, I just booted a non-dyndbg build on x86-32, and got this.
> > >
> >
> > Ok, transient error, went away with a clean build.
> >
> > tested-by: Jim Cromie <jim.cromie@gmail.com>
>
> Jason, any ACK on these, or any of the other random dynamic debug
> patches floating around? What am I supposed to be applying here?
>
Hi Greg,
I just posted some follow up comments to Joe, so let's see where that
discussion goes.
Thanks,
-Jason
^ permalink raw reply
* Re: [PATCH 0/5] dev_<level> and dynamic_debug cleanups
From: Jason Baron @ 2012-09-06 17:51 UTC (permalink / raw)
To: Joe Perches
Cc: Andrew Morton, netdev, Greg Kroah-Hartman, David S. Miller,
Jim Cromie, Kay Sievers, linux-kernel
In-Reply-To: <cover.1345978012.git.joe@perches.com>
On Sun, Aug 26, 2012 at 04:25:25AM -0700, Joe Perches wrote:
> The recent commit to fix dynamic_debug was a bit unclean.
> Neaten the style for dynamic_debug.
> Reduce the stack use of message logging that uses netdev_printk
> Add utility functions dev_printk_emit and dev_vprintk_emit for /dev/kmsg.
>
> Joe Perches (5):
> dev_dbg/dynamic_debug: Update to use printk_emit, optimize stack
> netdev_printk/dynamic_netdev_dbg: Directly call printk_emit
> netdev_printk/netif_printk: Remove a superfluous logging colon
> dev: Add dev_vprintk_emit and dev_printk_emit
> device and dynamic_debug: Use dev_vprintk_emit and dev_printk_emit
>
Looks Good.
The one thing that is bothering me though, is that for
__dynamic_dev_dbg(), __dynamic_netdev_dbg(), we are copying much of the core
logic of __dev_printk(), __netdev_printk(), respectively. I would prefer
have this in one place. Can we add a 'prefix' argument to __dev_printk(),
and __netdev_printk() that dynamic debug can use, but is simply empty
for dev_printk() and netdev_printk().
Thanks,
-Jason
^ permalink raw reply
* Re: [PATCH 11/12] qlcnic: 83xx adpater ethtool
From: Ben Hutchings @ 2012-09-06 17:49 UTC (permalink / raw)
To: Sony Chacko; +Cc: davem, netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1346912529-17406-12-git-send-email-sony.chacko@qlogic.com>
On Thu, 2012-09-06 at 02:22 -0400, Sony Chacko wrote:
> From: Sony Chacko <sony.chacko@qlogic.com>
>
> 83xx ethtool interface routines
>
> Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
> Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
> Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
> Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
> Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
> Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
> ---
> .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 583 +++++++++++++-------
> 1 files changed, 374 insertions(+), 209 deletions(-)
>
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
> index 4625253..b0d21ac 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
[...]
> @@ -146,6 +188,12 @@ static const u32 diag_registers[] = {
> QLCNIC_PEG_ALIVE_COUNTER,
> QLCNIC_PEG_HALT_STATUS1,
> QLCNIC_PEG_HALT_STATUS2,
> + -1
> +};
> +
> +static const u32 ext_diag_registers[] = {
> + CRB_XG_STATE_P3P,
> + ISR_INT_STATE_REG,
> QLCNIC_CRB_PEG_NET_0+0x3c,
> QLCNIC_CRB_PEG_NET_1+0x3c,
> QLCNIC_CRB_PEG_NET_2+0x3c,
> @@ -154,12 +202,19 @@ static const u32 diag_registers[] = {
> };
>
> #define QLCNIC_MGMT_API_VERSION 2
> -#define QLCNIC_DEV_INFO_SIZE 1
> #define QLCNIC_ETHTOOL_REGS_VER 2
I think QLCNIC_ETHTOOL_REGS_VER needs to be changed, as you appear to be
dumping more registers from the existing hardware as well.
> +
> static int qlcnic_get_regs_len(struct net_device *dev)
> {
> - return sizeof(diag_registers) + QLCNIC_RING_REGS_LEN +
> - QLCNIC_DEV_INFO_SIZE + 1;
> + struct qlcnic_adapter *adapter = netdev_priv(dev);
> + u32 len;
> +
> + if (QLCNIC_IS_83XX(adapter))
> + len = qlcnic_83xx_get_regs_len(adapter);
> + else
> + len = sizeof(ext_diag_registers) + sizeof(diag_registers);
> +
> + return QLCNIC_RING_REGS_LEN + len + QLCNIC_DEV_INFO_SIZE + 1;
> }
>
> static int qlcnic_get_eeprom_len(struct net_device *dev)
[...]
> @@ -509,25 +613,6 @@ qlcnic_set_ringparam(struct net_device *dev,
> return qlcnic_reset_context(adapter);
> }
>
> -static void qlcnic_get_channels(struct net_device *dev,
> - struct ethtool_channels *channel)
> -{
> - struct qlcnic_adapter *adapter = netdev_priv(dev);
> -
> - channel->max_rx = rounddown_pow_of_two(min_t(int,
> - adapter->ahw->max_rx_ques, num_online_cpus()));
> - channel->max_tx = adapter->ahw->max_tx_ques;
> -
> - channel->rx_count = adapter->max_sds_rings;
> - channel->tx_count = adapter->ahw->max_tx_ques;
> -}
> -
> -static int qlcnic_set_channels(struct net_device *dev,
> - struct ethtool_channels *channel)
> -{
> - return 0;
> -}
> -
> static void
> qlcnic_get_pauseparam(struct net_device *netdev,
> struct ethtool_pauseparam *pause)
[...]
> +static void qlcnic_get_channels(struct net_device *dev,
> + struct ethtool_channels *channel)
> +{
> + struct qlcnic_adapter *adapter = netdev_priv(dev);
> +
> + channel->max_rx = rounddown_pow_of_two(min_t(int,
> + adapter->ahw->max_rx_ques,
> + num_online_cpus()));
> + channel->max_tx = adapter->ahw->max_tx_ques;
> +
> + channel->rx_count = adapter->max_sds_rings;
> + channel->tx_count = adapter->ahw->max_tx_ques;
> +}
> +
> +static int qlcnic_set_channels(struct net_device *dev,
> + struct ethtool_channels *channel)
> +{
> + struct qlcnic_adapter *adapter = netdev_priv(dev);
> + int err;
> +
> + if (channel->other_count || channel->combined_count ||
> + channel->tx_count != channel->max_tx)
> + return -EINVAL;
> +
> + err = qlcnic_validate_max_rss(channel->max_rx, channel->rx_count);
> + if (err)
> + return err;
> +
> + err = qlcnic_set_max_rss(adapter, channel->rx_count, 0);
> + netdev_info(dev, "allocated 0x%x sds rings\n",
> + adapter->max_sds_rings);
> + return err;
> +}
So you removed the body of qlcnic_set_channels() in an earlier patch,
and now you're moving it and putting the body back how it was... Please
clean up the patch series so it doesn't have noise like this in it.
[...]
> +static int
> +qlcnic_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
> +{
> + int err;
> + struct qlcnic_adapter *adapter = netdev_priv(dev);
> + u32 wol_cfg;
> +
> + if (QLCNIC_IS_83XX(adapter))
> + return -EOPNOTSUPP;
> + if (wol->wolopts & ~WAKE_MAGIC)
> + return -EOPNOTSUPP;
Should be -EINVAL in the second error case (the device supports the
operation, but not the mode requested).
> + wol_cfg = QLCRD32(adapter, QLCNIC_WOL_CONFIG_NV, &err);
> + if (!(wol_cfg & (1 << adapter->portnum)))
> + return -EOPNOTSUPP;
> +
> + wol_cfg = QLCRD32(adapter, QLCNIC_WOL_CONFIG, &err);
> + if (wol->wolopts & WAKE_MAGIC)
> + wol_cfg |= 1UL << adapter->portnum;
> + else
> + wol_cfg &= ~(1UL << adapter->portnum);
> +
> + QLCWR32(adapter, QLCNIC_WOL_CONFIG, wol_cfg);
> +
> + return 0;
> }
>
> static int qlcnic_set_led(struct net_device *dev,
[...]
> @@ -1081,50 +1297,6 @@ static int qlcnic_set_led(struct net_device *dev,
> return err;
> }
>
> -static void
> -qlcnic_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
> -{
> - int err;
> - struct qlcnic_adapter *adapter = netdev_priv(dev);
> - u32 wol_cfg;
> -
> - wol->supported = 0;
> - wol->wolopts = 0;
> -
> - wol_cfg = QLCRD32(adapter, QLCNIC_WOL_CONFIG_NV, &err);
> - if (wol_cfg & (1UL << adapter->portnum))
> - wol->supported |= WAKE_MAGIC;
> -
> - wol_cfg = QLCRD32(adapter, QLCNIC_WOL_CONFIG, &err);
> - if (wol_cfg & (1UL << adapter->portnum))
> - wol->wolopts |= WAKE_MAGIC;
> -}
> -
> -static int
> -qlcnic_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
> -{
> - int err;
> - struct qlcnic_adapter *adapter = netdev_priv(dev);
> - u32 wol_cfg;
> -
> - if (wol->wolopts & ~WAKE_MAGIC)
> - return -EOPNOTSUPP;
> -
> - wol_cfg = QLCRD32(adapter, QLCNIC_WOL_CONFIG_NV, &err);
> - if (!(wol_cfg & (1 << adapter->portnum)))
> - return -EOPNOTSUPP;
> -
> - wol_cfg = QLCRD32(adapter, QLCNIC_WOL_CONFIG, &err);
> - if (wol->wolopts & WAKE_MAGIC)
> - wol_cfg |= 1UL << adapter->portnum;
> - else
> - wol_cfg &= ~(1UL << adapter->portnum);
> -
> - QLCWR32(adapter, QLCNIC_WOL_CONFIG, wol_cfg);
> -
> - return 0;
> -}
[...]
Again you've moved functions around for no obvious reason.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH] Fix "ip -6 route add ... nexthop"
From: Vincent Bernat @ 2012-09-06 17:30 UTC (permalink / raw)
To: netdev; +Cc: Vincent Bernat
In-Reply-To: <1346952649-5716-1-git-send-email-bernat@luffy.cx>
IPv6 multipath routes were not accepted by "ip route" because an IPv4
address was expected for each gateway. Use `get_addr()` instead of
`get_addr32()`.
Signed-off-by: Vincent Bernat <bernat@luffy.cx>
---
ip/iproute.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index 522dd28..c78d4f7 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -624,16 +624,20 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
}
-int parse_one_nh(struct rtattr *rta, struct rtnexthop *rtnh, int *argcp, char ***argvp)
+int parse_one_nh(struct rtmsg *r, struct rtattr *rta, struct rtnexthop *rtnh, int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
while (++argv, --argc > 0) {
if (strcmp(*argv, "via") == 0) {
+ inet_prefix addr;
NEXT_ARG();
- rta_addattr32(rta, 4096, RTA_GATEWAY, get_addr32(*argv));
- rtnh->rtnh_len += sizeof(struct rtattr) + 4;
+ get_addr(&addr, *argv, r->rtm_family);
+ if (r->rtm_family == AF_UNSPEC)
+ r->rtm_family = addr.family;
+ rta_addattr_l(rta, 4096, RTA_GATEWAY, &addr.data, addr.bytelen);
+ rtnh->rtnh_len += sizeof(struct rtattr) + addr.bytelen;
} else if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
if ((rtnh->rtnh_ifindex = ll_name_to_index(*argv)) == 0) {
@@ -685,7 +689,7 @@ int parse_nexthops(struct nlmsghdr *n, struct rtmsg *r, int argc, char **argv)
memset(rtnh, 0, sizeof(*rtnh));
rtnh->rtnh_len = sizeof(*rtnh);
rta->rta_len += rtnh->rtnh_len;
- parse_one_nh(rta, rtnh, &argc, &argv);
+ parse_one_nh(r, rta, rtnh, &argc, &argv);
rtnh = RTNH_NEXT(rtnh);
}
--
1.7.10.4
^ permalink raw reply related
* IPv6 multipath routes
From: Vincent Bernat @ 2012-09-06 17:30 UTC (permalink / raw)
To: netdev
Hi!
It appears that "ip -6 route add" expects IPv4 addresses with nexthop directives:
$ ip -6 route add to 2a01:c9c0:a1:982::/64 proto bird \
nexthop via fe80::ea39:35ff:febd:f9e dev bai2.2008 weight 1 \
nexthop via fe80::ea39:35ff:febd:fd6 dev bai1.2009 weight 1
Error: an IP address is expected rather than "fe80::ea39:35ff:febd:f9e"
The following patch fix this problem. However, it does not work. I now have:
RTNETLINK answers: No such device
I have little knowledge of netlink so it is likely that my patch is
buggy. However, I have found this problem by trying to debug what
appears to be a valid netlink message refused by the kernel with the
same error. Therefore, I suspect that there is also a bug in the kernel.
^ permalink raw reply
* Re: [PATCH net-next] ipv6: Export nd_tbl to allow modules to support IPv6
From: David Miller @ 2012-09-06 17:47 UTC (permalink / raw)
To: tgraf; +Cc: netdev
In-Reply-To: <20120906085102.GA14711@canuck.infradead.org>
From: Thomas Graf <tgraf@suug.ch>
Date: Thu, 6 Sep 2012 04:51:02 -0400
> On Wed, Sep 05, 2012 at 01:06:36PM -0400, David Miller wrote:
>> So if one of our goals is to move towards a situation where all neigh
>> accesses are refcount'less, having those external users makes that
>> nearly impossible.
>>
>> Instead, I'd rather see patches that mark arp_tbl as being exported
>> only for internal usage inside of the tree, so that we can reach that
>> goal.
>>
>> I'm not applying this, sorry.
>
> Fair enough
>
> Does that mean you dismiss neighbour lookups by external users in
> general in order to get rid of the refcnt?
>
> Assuming that lookups would still be ok, would an ipv6 version of
> __ipv4_neigh_lookup() be an acceptable API for external users?
> (Yes there is __ipv6_neigh_lookup() already but unlike the ipv4 version
> it takes the table as first argument)
Right now we're in a transition period where ipv4 is mostly refcount'less
and ipv6 is not.
This is part of the reason I don't want to expose these things, the
calling convention and locking requirements are going to be fluid for
any interface you might propose.
arp_tbl was exported only for in-tree users, and I therefore say that
we should only export nd_tbl for in-tree users as well, since that's
the only way we can audit and update all the referencing callers as
the semantics radically change.
^ permalink raw reply
* Re: [PATCH 08/10] net/macb: macb_get_drvinfo: add GEM/MACB suffix to differentiate revision
From: David Miller @ 2012-09-06 17:42 UTC (permalink / raw)
To: nicolas.ferre
Cc: bhutchings, netdev, linux-arm-kernel, havard, plagnioj, jamie,
linux-kernel, patrice.vilchez
In-Reply-To: <5048ACBE.2030205@atmel.com>
From: Nicolas Ferre <nicolas.ferre@atmel.com>
Date: Thu, 6 Sep 2012 16:01:34 +0200
> Absolutely, I will do this.
Please, when you receive feedback on your patches, you need to
resubmit the whole patch series for review not just the patches where
changes were asked for.
^ permalink raw reply
* Re: [PATCH 10/12] qlcnic: register dump utility
From: Ben Hutchings @ 2012-09-06 17:38 UTC (permalink / raw)
To: Sony Chacko; +Cc: davem, netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1346912529-17406-11-git-send-email-sony.chacko@qlogic.com>
On Thu, 2012-09-06 at 02:22 -0400, Sony Chacko wrote:
> From: Sony Chacko <sony.chacko@qlogic.com>
>
> Modify 82xx driver to support new adapter - Qlogic 83XX CNA
> Common register dump utility for 82xx and 83xx adapters
[...]
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
> @@ -525,21 +525,7 @@ static void qlcnic_get_channels(struct net_device *dev,
> static int qlcnic_set_channels(struct net_device *dev,
> struct ethtool_channels *channel)
> {
> - struct qlcnic_adapter *adapter = netdev_priv(dev);
> - int err;
> -
> - if (channel->other_count || channel->combined_count ||
> - channel->tx_count != channel->max_tx)
> - return -EINVAL;
> -
> - err = qlcnic_validate_max_rss(dev, channel->max_rx, channel->rx_count);
> - if (err)
> - return err;
> -
> - err = qlcnic_set_max_rss(adapter, channel->rx_count);
> - netdev_info(dev, "allocated 0x%x sds rings\n",
> - adapter->max_sds_rings);
> - return err;
> + return 0;
> }
[...]
No, I don't think so. If you're going to remove support for this
operation then delete the function entirely. And don't put it in a
patch that's supposed to do something unrelated.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 06/12] qlcnic: 83xx data path and HW interfaces routines
From: Ben Hutchings @ 2012-09-06 17:33 UTC (permalink / raw)
To: Sony Chacko; +Cc: davem, netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1346912529-17406-7-git-send-email-sony.chacko@qlogic.com>
On Thu, 2012-09-06 at 02:22 -0400, Sony Chacko wrote:
> From: Sony Chacko <sony.chacko@qlogic.com>
>
> Modify 82xx driver to support new adapter - Qlogic 83XX CNA
> Create 83xx adapter data path and hardware interface routines
[...]
> --- /dev/null
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
[...]
> +int qlcnic_83xx_set_settings(struct qlcnic_adapter *adapter,
> + struct ethtool_cmd *ecmd)
> +{
> + int status = 0;
> + u32 config = adapter->ahw->port_config;
> +
> + if (ecmd->autoneg)
> + adapter->ahw->port_config |= BIT_15;
> +
> + switch (ethtool_cmd_speed(ecmd)) {
> + case SPEED_10:
> + adapter->ahw->port_config |= BIT_8;
> + break;
> + case SPEED_100:
> + adapter->ahw->port_config |= BIT_9;
> + break;
> + case SPEED_1000:
> + adapter->ahw->port_config |= BIT_10;
> + break;
> + case SPEED_10000:
> + adapter->ahw->port_config |= BIT_11;
> + break;
> + default:
> + return -EIO;
Should be -EINVAL.
> + }
> +
> + status = qlcnic_83xx_set_port_config(adapter);
> + if (status) {
> + dev_info(&adapter->pdev->dev,
> + "Faild to Set Link Speed and autoneg.\n");
> + adapter->ahw->port_config = config;
> + }
> + return status;
> +}
[...]
> +static u64*
> +qlcnic_83xx_fill_stats(struct qlcnic_adapter *adapter,
> + struct qlcnic_cmd_args *cmd, u64 *data, int type,
> + int *ret)
> +{
> + int err, k, total_regs;
> +
> + *ret = 0;
> + err = qlcnic_issue_cmd(adapter, cmd);
> + if (err != QLCNIC_RCODE_SUCCESS) {
> + dev_info(&adapter->pdev->dev,
> + "Error in get statistics mailbox command\n");
> + *ret = -EIO;
> + return data;
> + }
> + total_regs = cmd->rsp.num;
> + switch (type) {
[...]
> + default:
> + dev_info(&adapter->pdev->dev, "Unknown get statistics mode\n");
It seems like this default case can only be reached in case of a driver
bug, so WARN would be more appropriate.
> + *ret = -EIO;
> + }
> + return data;
> +}
[...]
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH v3 01/17] hashtable: introduce a small and naive hashtable
From: Steven Rostedt @ 2012-09-06 17:15 UTC (permalink / raw)
To: Sasha Levin
Cc: Josh Triplett, Mathieu Desnoyers, Pedro Alves, Tejun Heo,
torvalds, akpm, linux-kernel, linux-mm, paul.gortmaker, davem,
mingo, ebiederm, aarcange, ericvh, netdev, eric.dumazet, axboe,
agk, dm-devel, neilb, ccaulfie, teigland, Trond.Myklebust,
bfields, fweisbec, jesse, venkat.x.venkatsubra, ejt, snitzer,
edumazet, linux-nfs, dev, rds-devel, lw
In-Reply-To: <5048CDA2.10300@gmail.com>
On Thu, 2012-09-06 at 18:21 +0200, Sasha Levin wrote:
> On 09/06/2012 06:00 PM, Steven Rostedt wrote:
> >> > I think that that code doesn't make sense. The users of hlist_for_each_* aren't
> >> > supposed to be changing the loop cursor.
> > I totally agree. Modifying the 'node' pointer is just asking for issues.
> > Yes that is error prone, but not due to the double loop. It's due to the
> > modifying of the node pointer that is used internally by the loop
> > counter. Don't do that :-)
>
> While we're on this subject, I haven't actually seen hlist_for_each_entry() code
> that even *touches* 'pos'.
>
> Will people yell at me loudly if I change the prototype of those macros to be:
>
> hlist_for_each_entry(tpos, head, member)
>
> (Dropping the 'pos' parameter), and updating anything that calls those macros to
> drop it as well?
If 'pos' is no longer used in the macro, I don't see any reason for
keeping it around.
-- Steve
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ 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