* Re: [Fwd: [PATCH] [NIU] VLAN does not work with niu driver]
From: David Miller @ 2009-10-17 0:40 UTC (permalink / raw)
To: Joyce.Yu; +Cc: netdev
In-Reply-To: <4AD89D9A.7090405@Sun.COM>
From: Joyce Yu <Joyce.Yu@Sun.COM>
Date: Fri, 16 Oct 2009 09:21:46 -0700
>
> Can this patch be accepted and integrated to the main tree?
Well, what happened to all of those page fragment modifications?
They all of a sudden are no longer necessary? Why?
I'm not going to apply this patch until you start explaining
why these things are being done, or not done. And you must
add some more text to your commit messages so that you explain
your change sufficiently.
Thank you.
^ permalink raw reply
* Re: [net-next PATCH 0/3] qlge: Size RX buffers based on MTU.
From: David Miller @ 2009-10-17 0:51 UTC (permalink / raw)
To: ron.mercer; +Cc: netdev
In-Reply-To: <1255724136-27264-1-git-send-email-ron.mercer@qlogic.com>
From: Ron Mercer <ron.mercer@qlogic.com>
Date: Fri, 16 Oct 2009 13:15:33 -0700
> These patches are interdependent.
No, Ron, they are absolutely not.
Apply the first patch, and that breaks the build because
you've removed LARGE_BUFFER_SIZE but it's still referenced
in qlge_main.c, and there are tons of other breakages too.
Don't send me garbage like this and then claim it's a set
of independent patches. A trivial build test would have
shown otherwise, but you obviously didn't do that.
This is completely rediculious:
CC [M] drivers/net/qlge/qlge_main.o
drivers/net/qlge/qlge_main.c: In function ‘ql_update_lbq’:
drivers/net/qlge/qlge_main.c:1081: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1085: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1086: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1093: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1098: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1099: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c: In function ‘ql_build_rx_skb’:
drivers/net/qlge/qlge_main.c:1491: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1496: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1518: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1524: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1584: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:1590: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c: In function ‘ql_free_lbq_buffers’:
drivers/net/qlge/qlge_main.c:2313: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:2319: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c:2320: error: ‘union <anonymous>’ has no member named ‘lbq_page’
drivers/net/qlge/qlge_main.c: In function ‘ql_configure_rings’:
drivers/net/qlge/qlge_main.c:3546: error: ‘LARGE_BUFFER_SIZE’ undeclared (first use in this function)
drivers/net/qlge/qlge_main.c:3546: error: (Each undeclared identifier is reported only once
drivers/net/qlge/qlge_main.c:3546: error: for each function it appears in.)
make[3]: *** [drivers/net/qlge/qlge_main.o] Error 1
make[2]: *** [drivers/net/qlge] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
^ permalink raw reply
* Re: [Pv-drivers] [PATCH -next] vmxnet3: use dev_dbg, fix build for CONFIG_BLOCK=n
From: David Miller @ 2009-10-17 0:54 UTC (permalink / raw)
To: bhavesh; +Cc: randy.dunlap, sfr, pv-drivers, netdev, linux-kernel, linux-next
In-Reply-To: <8B1F619C9F5F454E81D90D3C161698D7017DD56435@EXCH-MBX-3.vmware.com>
From: Bhavesh Davda <bhavesh@vmware.com>
Date: Thu, 15 Oct 2009 15:35:02 -0700
> Who ever compiles with CONFIG_BLOCK=n? Just kidding...
Who ever uses block layer debugging facilities in a networking
driver?
> Thanks again for making this change! Ship it!
>
> Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>
Applied, thanks everyone.
^ permalink raw reply
* Re: [PATCH NEXT 1/7] netxen; update version to 4.0.56
From: David Miller @ 2009-10-17 0:56 UTC (permalink / raw)
To: dhananjay; +Cc: netdev
In-Reply-To: <1255673353-31797-2-git-send-email-dhananjay@netxen.com>
From: Dhananjay Phadke <dhananjay@netxen.com>
Date: Thu, 15 Oct 2009 23:09:07 -0700
> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
This doesn't make any sense at all.
You should update the driver version _AFTER_ your set
of changes, not before.
I have never in my entire life seen someone bump the
driver version before the actual changes.
Please respin this properly, thanks.
^ permalink raw reply
* Re: [PATCH net-next-2.6] be2net: Add support for next generation of BladeEngine device.
From: David Miller @ 2009-10-17 1:02 UTC (permalink / raw)
To: ajitk; +Cc: netdev
In-Reply-To: <20091015045654.GA26219@serverengines.com>
From: Ajit Khaparde <ajitk@serverengines.com>
Date: Thu, 15 Oct 2009 10:27:13 +0530
> Add new PCI ids to support next generation of BladeEngine device.
>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Applied.
^ permalink raw reply
* RE: [PATCH NEXT 1/7] netxen; update version to 4.0.56
From: Dhananjay Phadke @ 2009-10-17 1:15 UTC (permalink / raw)
To: David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <20091016.175621.76312736.davem@davemloft.net>
Alright, this was really marker for earlier patch series.
But I will re-spin to even higher rev, use it as marker everything upto this patch series.
Thanks,
Dhananjay
-----Original Message-----
From: David Miller [mailto:davem@davemloft.net]
Sent: Friday, October 16, 2009 5:56 PM
To: Dhananjay Phadke
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH NEXT 1/7] netxen; update version to 4.0.56
From: Dhananjay Phadke <dhananjay@netxen.com>
Date: Thu, 15 Oct 2009 23:09:07 -0700
> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
This doesn't make any sense at all.
You should update the driver version _AFTER_ your set
of changes, not before.
I have never in my entire life seen someone bump the
driver version before the actual changes.
Please respin this properly, thanks.
^ permalink raw reply
* [PATCH NEXT v2 0/7] netxen: changes for future chip revisions
From: Dhananjay Phadke @ 2009-10-17 1:50 UTC (permalink / raw)
To: davem; +Cc: netdev
Update patch series for initial support for next chip revision.
The version is updated 4.0.62 to include all patches in this
series.
Please apply to net-next-2.6 tree.
Thanks,
Dhananjay
^ permalink raw reply
* [PATCH NEXT v2 2/7] netxen: 128 memory controller support
From: Dhananjay Phadke @ 2009-10-17 1:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Amit Kumar Salecha, Amit Kumar Salecha
In-Reply-To: <1255744212-28074-1-git-send-email-dhananjay@netxen.com>
From: Amit Kumar Salecha <amit@qlogic.com>
Future revisions of the chip have 128 bit memory
transactions. Require drivers to implement rmw
in case of sub-128 bit accesses by driver. This
is mostly used by diagnostic tools.
Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic_hdr.h | 8 ++++-
drivers/net/netxen/netxen_nic_hw.c | 55 +++++++++++++++++++++++++++++-----
2 files changed, 53 insertions(+), 10 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h
index 3461350..d40fe33 100644
--- a/drivers/net/netxen/netxen_nic_hdr.h
+++ b/drivers/net/netxen/netxen_nic_hdr.h
@@ -678,10 +678,14 @@ enum {
#define MIU_TEST_AGT_ADDR_HI (0x08)
#define MIU_TEST_AGT_WRDATA_LO (0x10)
#define MIU_TEST_AGT_WRDATA_HI (0x14)
-#define MIU_TEST_AGT_WRDATA(i) (0x10+(4*(i)))
+#define MIU_TEST_AGT_WRDATA_UPPER_LO (0x20)
+#define MIU_TEST_AGT_WRDATA_UPPER_HI (0x24)
+#define MIU_TEST_AGT_WRDATA(i) (0x10+(0x10*((i)>>1))+(4*((i)&1)))
#define MIU_TEST_AGT_RDDATA_LO (0x18)
#define MIU_TEST_AGT_RDDATA_HI (0x1c)
-#define MIU_TEST_AGT_RDDATA(i) (0x18+(4*(i)))
+#define MIU_TEST_AGT_RDDATA_UPPER_LO (0x28)
+#define MIU_TEST_AGT_RDDATA_UPPER_HI (0x2c)
+#define MIU_TEST_AGT_RDDATA(i) (0x18+(0x10*((i)>>1))+(4*((i)&1)))
#define MIU_TEST_AGT_ADDR_MASK 0xfffffff8
#define MIU_TEST_AGT_UPPER_ADDR(off) (0)
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index d067bee..52a2f2d 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -1569,8 +1569,9 @@ static int
netxen_nic_pci_mem_write_2M(struct netxen_adapter *adapter,
u64 off, u64 data)
{
- int j, ret;
+ int i, j, ret;
u32 temp, off8;
+ u64 stride;
void __iomem *mem_crb;
/* Only 64-bit aligned access */
@@ -1597,14 +1598,45 @@ netxen_nic_pci_mem_write_2M(struct netxen_adapter *adapter,
return -EIO;
correct:
- off8 = off & MIU_TEST_AGT_ADDR_MASK;
+ stride = NX_IS_REVISION_P3P(adapter->ahw.revision_id) ? 16 : 8;
+
+ off8 = off & ~(stride-1);
spin_lock(&adapter->ahw.mem_lock);
writel(off8, (mem_crb + MIU_TEST_AGT_ADDR_LO));
writel(0, (mem_crb + MIU_TEST_AGT_ADDR_HI));
- writel(data & 0xffffffff, mem_crb + MIU_TEST_AGT_WRDATA_LO);
- writel((data >> 32) & 0xffffffff, mem_crb + MIU_TEST_AGT_WRDATA_HI);
+
+ i = 0;
+ if (stride == 16) {
+ writel(TA_CTL_ENABLE, (mem_crb + TEST_AGT_CTRL));
+ writel((TA_CTL_START | TA_CTL_ENABLE),
+ (mem_crb + TEST_AGT_CTRL));
+
+ for (j = 0; j < MAX_CTL_CHECK; j++) {
+ temp = readl(mem_crb + TEST_AGT_CTRL);
+ if ((temp & TA_CTL_BUSY) == 0)
+ break;
+ }
+
+ if (j >= MAX_CTL_CHECK) {
+ ret = -EIO;
+ goto done;
+ }
+
+ i = (off & 0xf) ? 0 : 2;
+ writel(readl(mem_crb + MIU_TEST_AGT_RDDATA(i)),
+ mem_crb + MIU_TEST_AGT_WRDATA(i));
+ writel(readl(mem_crb + MIU_TEST_AGT_RDDATA(i+1)),
+ mem_crb + MIU_TEST_AGT_WRDATA(i+1));
+ i = (off & 0xf) ? 2 : 0;
+ }
+
+ writel(data & 0xffffffff,
+ mem_crb + MIU_TEST_AGT_WRDATA(i));
+ writel((data >> 32) & 0xffffffff,
+ mem_crb + MIU_TEST_AGT_WRDATA(i+1));
+
writel((TA_CTL_ENABLE | TA_CTL_WRITE), (mem_crb + TEST_AGT_CTRL));
writel((TA_CTL_START | TA_CTL_ENABLE | TA_CTL_WRITE),
(mem_crb + TEST_AGT_CTRL));
@@ -1623,6 +1655,7 @@ correct:
} else
ret = 0;
+done:
spin_unlock(&adapter->ahw.mem_lock);
return ret;
@@ -1634,7 +1667,7 @@ netxen_nic_pci_mem_read_2M(struct netxen_adapter *adapter,
{
int j, ret;
u32 temp, off8;
- u64 val;
+ u64 val, stride;
void __iomem *mem_crb;
/* Only 64-bit aligned access */
@@ -1663,7 +1696,9 @@ netxen_nic_pci_mem_read_2M(struct netxen_adapter *adapter,
return -EIO;
correct:
- off8 = off & MIU_TEST_AGT_ADDR_MASK;
+ stride = NX_IS_REVISION_P3P(adapter->ahw.revision_id) ? 16 : 8;
+
+ off8 = off & ~(stride-1);
spin_lock(&adapter->ahw.mem_lock);
@@ -1684,9 +1719,13 @@ correct:
"failed to read through agent\n");
ret = -EIO;
} else {
- temp = readl(mem_crb + MIU_TEST_AGT_RDDATA_HI);
+ off8 = MIU_TEST_AGT_RDDATA_LO;
+ if ((stride == 16) && (off & 0xf))
+ off8 = MIU_TEST_AGT_RDDATA_UPPER_LO;
+
+ temp = readl(mem_crb + off8 + 4);
val = (u64)temp << 32;
- val |= readl(mem_crb + MIU_TEST_AGT_RDDATA_LO);
+ val |= readl(mem_crb + off8);
*data = val;
ret = 0;
}
--
1.6.0.2
^ permalink raw reply related
* [PATCH NEXT v2 3/7] netxen: reset sequence changes
From: Dhananjay Phadke @ 2009-10-17 1:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Amit Kumar Salecha, Amit Kumar Salecha
In-Reply-To: <1255744212-28074-1-git-send-email-dhananjay@netxen.com>
From: Amit Kumar Salecha <amit@qlogic.com>
Future revisions need different chip reset sequence
and firmware initialization.
Also clean up some never used debug code.
Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic.h | 2 +-
drivers/net/netxen/netxen_nic_init.c | 41 +++++++++++----------------------
drivers/net/netxen/netxen_nic_main.c | 2 +-
3 files changed, 16 insertions(+), 29 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index a608e25..db28f8a 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -1270,7 +1270,7 @@ int netxen_load_firmware(struct netxen_adapter *adapter);
int netxen_need_fw_reset(struct netxen_adapter *adapter);
void netxen_request_firmware(struct netxen_adapter *adapter);
void netxen_release_firmware(struct netxen_adapter *adapter);
-int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose);
+int netxen_pinit_from_rom(struct netxen_adapter *adapter);
int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp);
int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 83387c7..a524844 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -437,7 +437,7 @@ int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp)
#define NETXEN_BOARDNUM 0x400c
#define NETXEN_CHIPNUM 0x4010
-int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
+int netxen_pinit_from_rom(struct netxen_adapter *adapter)
{
int addr, val;
int i, n, init_delay = 0;
@@ -450,21 +450,6 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
NXWR32(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 0xffffffff);
netxen_rom_unlock(adapter);
- if (verbose) {
- if (netxen_rom_fast_read(adapter, NETXEN_BOARDTYPE, &val) == 0)
- printk("P2 ROM board type: 0x%08x\n", val);
- else
- printk("Could not read board type\n");
- if (netxen_rom_fast_read(adapter, NETXEN_BOARDNUM, &val) == 0)
- printk("P2 ROM board num: 0x%08x\n", val);
- else
- printk("Could not read board number\n");
- if (netxen_rom_fast_read(adapter, NETXEN_CHIPNUM, &val) == 0)
- printk("P2 ROM chip num: 0x%08x\n", val);
- else
- printk("Could not read chip number\n");
- }
-
if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
if (netxen_rom_fast_read(adapter, 0, &n) != 0 ||
(n != 0xcafecafe) ||
@@ -486,11 +471,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
n &= ~0x80000000;
}
- if (n < 1024) {
- if (verbose)
- printk(KERN_DEBUG "%s: %d CRB init values found"
- " in ROM.\n", netxen_nic_driver_name, n);
- } else {
+ if (n >= 1024) {
printk(KERN_ERR "%s:n=0x%x Error! NetXen card flash not"
" initialized.\n", __func__, n);
return -EIO;
@@ -502,6 +483,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
netxen_nic_driver_name);
return -ENOMEM;
}
+
for (i = 0; i < n; i++) {
if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 ||
netxen_rom_fast_read(adapter, 8*i + 4*offset + 4, &addr) != 0) {
@@ -512,11 +494,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
buf[i].addr = addr;
buf[i].data = val;
- if (verbose)
- printk(KERN_DEBUG "%s: PCI: 0x%08x == 0x%08x\n",
- netxen_nic_driver_name,
- (u32)netxen_decode_crb_addr(addr), val);
}
+
for (i = 0; i < n; i++) {
off = netxen_decode_crb_addr(buf[i].addr);
@@ -526,6 +505,10 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
continue;
}
off += NETXEN_PCI_CRBSPACE;
+
+ if (off & 1)
+ continue;
+
/* skipping cold reboot MAGIC */
if (off == NETXEN_CAM_RAM(0x1fc))
continue;
@@ -542,7 +525,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
continue;
if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */
continue;
- if (off == (NETXEN_CRB_PEG_NET_1 + 0x18))
+ if (off == (NETXEN_CRB_PEG_NET_1 + 0x18) &&
+ !NX_IS_REVISION_P3P(adapter->ahw.revision_id))
buf[i].data = 0x1020;
/* skip the function enable register */
if (off == NETXEN_PCIE_REG(PCIE_SETUP_FUNCTION))
@@ -751,7 +735,10 @@ netxen_load_firmware(struct netxen_adapter *adapter)
}
msleep(1);
- if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
+ if (NX_IS_REVISION_P3P(adapter->ahw.revision_id)) {
+ NXWR32(adapter, NETXEN_CRB_PEG_NET_0 + 0x18, 0x1020);
+ NXWR32(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 0x80001e);
+ } else if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
NXWR32(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 0x80001d);
else {
NXWR32(adapter, NETXEN_ROMUSB_GLB_CHIP_CLK_CTRL, 0x3fff);
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 5bc8520..2d772dd 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -810,7 +810,7 @@ netxen_start_firmware(struct netxen_adapter *adapter)
if (first_boot != 0x55555555) {
NXWR32(adapter, CRB_CMDPEG_STATE, 0);
- netxen_pinit_from_rom(adapter, 0);
+ netxen_pinit_from_rom(adapter);
msleep(1);
}
--
1.6.0.2
^ permalink raw reply related
* [PATCH NEXT v2 6/7] netxen: sysfs control for auto firmware recovery
From: Dhananjay Phadke @ 2009-10-17 1:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Narender Kumar
In-Reply-To: <1255744212-28074-1-git-send-email-dhananjay@netxen.com>
From: Narender Kumar <narender.kumar@qlogic.com>
Firmware hang detection and recovery (reset) need to
be disabled for diagnostic tools, which can run
some disruptive tests.
This adds a driver level control to turn off this
feature by diag tools.
Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic.h | 3 ++
drivers/net/netxen/netxen_nic_main.c | 50 +++++++++++++++++++++++++++++++++-
2 files changed, 52 insertions(+), 1 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index db28f8a..fa7511e 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -1044,6 +1044,9 @@ typedef struct {
#define LINKEVENT_LINKSPEED_MBPS 0
#define LINKEVENT_LINKSPEED_ENCODED 1
+#define AUTO_FW_RESET_ENABLED 0xEF10AF12
+#define AUTO_FW_RESET_DISABLED 0xDCBAAF12
+
/* firmware response header:
* 63:58 - message type
* 57:56 - owner
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 30d9afe..1071f09 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -52,6 +52,8 @@ static int use_msi = 1;
static int use_msi_x = 1;
+static unsigned long auto_fw_reset = AUTO_FW_RESET_ENABLED;
+
/* Local functions to NetXen NIC driver */
static int __devinit netxen_nic_probe(struct pci_dev *pdev,
const struct pci_device_id *ent);
@@ -2264,7 +2266,8 @@ netxen_check_health(struct netxen_adapter *adapter)
dev_info(&netdev->dev, "firmware hang detected\n");
detach:
- if (!test_and_set_bit(__NX_RESETTING, &adapter->state))
+ if ((auto_fw_reset == AUTO_FW_RESET_ENABLED) &&
+ !test_and_set_bit(__NX_RESETTING, &adapter->state))
netxen_schedule_work(adapter, netxen_detach_work, 0);
return 1;
}
@@ -2496,6 +2499,41 @@ static struct bin_attribute bin_attr_mem = {
.write = netxen_sysfs_write_mem,
};
+static ssize_t
+netxen_store_auto_fw_reset(struct module_attribute *mattr,
+ struct module *mod, const char *buf, size_t count)
+
+{
+ unsigned long new;
+
+ if (strict_strtoul(buf, 16, &new))
+ return -EINVAL;
+
+ if ((new == AUTO_FW_RESET_ENABLED) || (new == AUTO_FW_RESET_DISABLED)) {
+ auto_fw_reset = new;
+ return count;
+ }
+
+ return -EINVAL;
+}
+
+static ssize_t
+netxen_show_auto_fw_reset(struct module_attribute *mattr,
+ struct module *mod, char *buf)
+
+{
+ if (auto_fw_reset == AUTO_FW_RESET_ENABLED)
+ return sprintf(buf, "enabled\n");
+ else
+ return sprintf(buf, "disabled\n");
+}
+
+static struct module_attribute mod_attr_fw_reset = {
+ .attr = {.name = "auto_fw_reset", .mode = (S_IRUGO | S_IWUSR)},
+ .show = netxen_show_auto_fw_reset,
+ .store = netxen_store_auto_fw_reset,
+};
+
static void
netxen_create_sysfs_entries(struct netxen_adapter *adapter)
{
@@ -2700,6 +2738,8 @@ static struct pci_driver netxen_driver = {
static int __init netxen_init_module(void)
{
+ struct module *mod = THIS_MODULE;
+
printk(KERN_INFO "%s\n", netxen_nic_driver_string);
#ifdef CONFIG_INET
@@ -2707,6 +2747,10 @@ static int __init netxen_init_module(void)
register_inetaddr_notifier(&netxen_inetaddr_cb);
#endif
+ if (sysfs_create_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr))
+ printk(KERN_ERR "%s: Failed to create auto_fw_reset "
+ "sysfs entry.", netxen_nic_driver_name);
+
return pci_register_driver(&netxen_driver);
}
@@ -2714,6 +2758,10 @@ module_init(netxen_init_module);
static void __exit netxen_exit_module(void)
{
+ struct module *mod = THIS_MODULE;
+
+ sysfs_remove_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr);
+
pci_unregister_driver(&netxen_driver);
#ifdef CONFIG_INET
--
1.6.0.2
^ permalink raw reply related
* [PATCH NEXT v2 1/7] netxen: defines for next revision
From: Dhananjay Phadke @ 2009-10-17 1:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Amit Kumar Salecha, Amit Kumar Salecha
In-Reply-To: <1255744212-28074-1-git-send-email-dhananjay@netxen.com>
From: Amit Kumar Salecha <amit@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 1bdb8f4..a608e25 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -117,9 +117,11 @@
#define NX_P3_B0 0x40
#define NX_P3_B1 0x41
#define NX_P3_B2 0x42
+#define NX_P3P_A0 0x50
#define NX_IS_REVISION_P2(REVISION) (REVISION <= NX_P2_C1)
#define NX_IS_REVISION_P3(REVISION) (REVISION >= NX_P3_A0)
+#define NX_IS_REVISION_P3P(REVISION) (REVISION >= NX_P3P_A0)
#define FIRST_PAGE_GROUP_START 0
#define FIRST_PAGE_GROUP_END 0x100000
--
1.6.0.2
^ permalink raw reply related
* [PATCH NEXT v2 4/7] netxen: onchip memory access change
From: Dhananjay Phadke @ 2009-10-17 1:50 UTC (permalink / raw)
To: davem; +Cc: netdev, Amit Kumar Salecha
In-Reply-To: <1255744212-28074-1-git-send-email-dhananjay@netxen.com>
From: Amit Kumar Salecha <amit@netxen.com>
Add support for different windowing scheme for on chip
memory in future chip revisions. This is required by
diagnostic tools.
Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic_hdr.h | 3 +++
drivers/net/netxen/netxen_nic_hw.c | 17 +++++++++--------
drivers/net/netxen/netxen_nic_main.c | 6 +++++-
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h
index d40fe33..7386a7c 100644
--- a/drivers/net/netxen/netxen_nic_hdr.h
+++ b/drivers/net/netxen/netxen_nic_hdr.h
@@ -867,6 +867,9 @@ enum {
(PCIX_SN_WINDOW_F0 + (0x20 * (func))) :\
(PCIX_SN_WINDOW_F4 + (0x10 * ((func)-4))))
+#define PCIX_OCM_WINDOW (0x10800)
+#define PCIX_OCM_WINDOW_REG(func) (PCIX_OCM_WINDOW + 0x20 * (func))
+
#define PCIX_TARGET_STATUS (0x10118)
#define PCIX_TARGET_STATUS_F1 (0x10160)
#define PCIX_TARGET_STATUS_F2 (0x10164)
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 52a2f2d..a633246 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -31,6 +31,7 @@
#define MASK(n) ((1ULL<<(n))-1)
#define MN_WIN(addr) (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff))
#define OCM_WIN(addr) (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff))
+#define OCM_WIN_P3P(addr) (addr & 0xffc0000)
#define MS_WIN(addr) (addr & 0x0ffc0000)
#define GET_MEM_OFFS_2M(addr) (addr & MASK(18))
@@ -1338,7 +1339,7 @@ static int
netxen_nic_pci_set_window_2M(struct netxen_adapter *adapter,
u64 addr, u32 *start)
{
- u32 win_read, window;
+ u32 window;
struct pci_dev *pdev = adapter->pdev;
if ((addr & 0x00ff800) == 0xff800) {
@@ -1347,14 +1348,14 @@ netxen_nic_pci_set_window_2M(struct netxen_adapter *adapter,
return -EIO;
}
- window = OCM_WIN(addr);
+ if (NX_IS_REVISION_P3P(adapter->ahw.revision_id))
+ window = OCM_WIN_P3P(addr);
+ else
+ window = OCM_WIN(addr);
+
writel(window, adapter->ahw.ocm_win_crb);
- win_read = readl(adapter->ahw.ocm_win_crb);
- if ((win_read >> 7) != window) {
- if (printk_ratelimit())
- dev_warn(&pdev->dev, "failed to set OCM window\n");
- return -EIO;
- }
+ /* read back to flush */
+ readl(adapter->ahw.ocm_win_crb);
adapter->ahw.ocm_win = window;
*start = NETXEN_PCI_OCM0_2M + GET_MEM_OFFS_2M(addr);
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 2d772dd..30d9afe 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -649,7 +649,11 @@ netxen_setup_pci_map(struct netxen_adapter *adapter)
adapter->ahw.pci_base1 = mem_ptr1;
adapter->ahw.pci_base2 = mem_ptr2;
- if (!NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
+ if (NX_IS_REVISION_P3P(adapter->ahw.revision_id)) {
+ adapter->ahw.ocm_win_crb = netxen_get_ioaddr(adapter,
+ NETXEN_PCIX_PS_REG(PCIX_OCM_WINDOW_REG(pci_func)));
+
+ } else if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
adapter->ahw.ocm_win_crb = netxen_get_ioaddr(adapter,
NETXEN_PCIX_PS_REG(PCIE_MN_WINDOW_REG(pci_func)));
}
--
1.6.0.2
^ permalink raw reply related
* [PATCH NEXT v2 5/7] netxen: fix error codes in for tools access
From: Dhananjay Phadke @ 2009-10-17 1:50 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1255744212-28074-1-git-send-email-dhananjay@netxen.com>
Use -EIO or -EINVAL as error codes, these can get passed up
to applications (tools).
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic_hw.c | 49 +++++++++++++++++----------------
drivers/net/netxen/netxen_nic_init.c | 6 ++++
2 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index a633246..e43cbbd 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -332,7 +332,7 @@ netxen_pcie_sem_lock(struct netxen_adapter *adapter, int sem, u32 id_reg)
if (done == 1)
break;
if (++timeout >= NETXEN_PCIE_SEM_TIMEOUT)
- return -1;
+ return -EIO;
msleep(1);
}
@@ -1083,7 +1083,7 @@ netxen_nic_pci_set_crbwindow_128M(struct netxen_adapter *adapter,
}
/*
- * Return -1 if off is not valid,
+ * Returns < 0 if off is not valid,
* 1 if window access is needed. 'off' is set to offset from
* CRB space in 128M pci map
* 0 if no window access is needed. 'off' is set to 2M addr
@@ -1096,7 +1096,7 @@ netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, ulong *off)
if (*off >= NETXEN_CRB_MAX)
- return -1;
+ return -EINVAL;
if (*off >= NETXEN_PCI_CAMQM && (*off < NETXEN_PCI_CAMQM_2M_END)) {
*off = (*off - NETXEN_PCI_CAMQM) + NETXEN_PCI_CAMQM_2M_BASE +
@@ -1105,7 +1105,7 @@ netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, ulong *off)
}
if (*off < NETXEN_PCI_CRBSPACE)
- return -1;
+ return -EINVAL;
*off -= NETXEN_PCI_CRBSPACE;
@@ -1220,25 +1220,26 @@ netxen_nic_hw_write_wx_2M(struct netxen_adapter *adapter, ulong off, u32 data)
rv = netxen_nic_pci_get_crb_addr_2M(adapter, &off);
- if (rv == -1) {
- printk(KERN_ERR "%s: invalid offset: 0x%016lx\n",
- __func__, off);
- dump_stack();
- return -1;
+ if (rv == 0) {
+ writel(data, (void __iomem *)off);
+ return 0;
}
- if (rv == 1) {
+ if (rv > 0) {
+ /* indirect access */
write_lock_irqsave(&adapter->ahw.crb_lock, flags);
crb_win_lock(adapter);
netxen_nic_pci_set_crbwindow_2M(adapter, &off);
writel(data, (void __iomem *)off);
crb_win_unlock(adapter);
write_unlock_irqrestore(&adapter->ahw.crb_lock, flags);
- } else
- writel(data, (void __iomem *)off);
-
+ return 0;
+ }
- return 0;
+ dev_err(&adapter->pdev->dev,
+ "%s: invalid offset: 0x%016lx\n", __func__, off);
+ dump_stack();
+ return -EIO;
}
static u32
@@ -1250,24 +1251,24 @@ netxen_nic_hw_read_wx_2M(struct netxen_adapter *adapter, ulong off)
rv = netxen_nic_pci_get_crb_addr_2M(adapter, &off);
- if (rv == -1) {
- printk(KERN_ERR "%s: invalid offset: 0x%016lx\n",
- __func__, off);
- dump_stack();
- return -1;
- }
+ if (rv == 0)
+ return readl((void __iomem *)off);
- if (rv == 1) {
+ if (rv > 0) {
+ /* indirect access */
write_lock_irqsave(&adapter->ahw.crb_lock, flags);
crb_win_lock(adapter);
netxen_nic_pci_set_crbwindow_2M(adapter, &off);
data = readl((void __iomem *)off);
crb_win_unlock(adapter);
write_unlock_irqrestore(&adapter->ahw.crb_lock, flags);
- } else
- data = readl((void __iomem *)off);
+ return data;
+ }
- return data;
+ dev_err(&adapter->pdev->dev,
+ "%s: invalid offset: 0x%016lx\n", __func__, off);
+ dump_stack();
+ return -1;
}
/* window 1 registers only */
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index a524844..d8c4b70 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -832,6 +832,12 @@ void netxen_request_firmware(struct netxen_adapter *adapter)
goto request_fw;
}
+ if (NX_IS_REVISION_P3P(adapter->ahw.revision_id)) {
+ /* No file firmware for the time being */
+ fw_type = NX_FLASH_ROMIMAGE;
+ goto done;
+ }
+
fw_type = netxen_p3_has_mn(adapter) ?
NX_P3_MN_ROMIMAGE : NX_P3_CT_ROMIMAGE;
--
1.6.0.2
^ permalink raw reply related
* [PATCH NEXT v2 7/7] netxen; update version to 4.0.62
From: Dhananjay Phadke @ 2009-10-17 1:50 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1255744212-28074-1-git-send-email-dhananjay@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index fa7511e..e98cfa6 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -53,8 +53,8 @@
#define _NETXEN_NIC_LINUX_MAJOR 4
#define _NETXEN_NIC_LINUX_MINOR 0
-#define _NETXEN_NIC_LINUX_SUBVERSION 50
-#define NETXEN_NIC_LINUX_VERSIONID "4.0.50"
+#define _NETXEN_NIC_LINUX_SUBVERSION 62
+#define NETXEN_NIC_LINUX_VERSIONID "4.0.62"
#define NETXEN_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c))
#define _major(v) (((v) >> 24) & 0xff)
--
1.6.0.2
^ permalink raw reply related
* Re: [net-next PATCH 0/3] qlge: Size RX buffers based on MTU.
From: Ron Mercer @ 2009-10-17 2:22 UTC (permalink / raw)
To: David Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <20091016.175142.52482970.davem@davemloft.net>
On Fri, Oct 16, 2009 at 05:51:42PM -0700, David Miller wrote:
> From: Ron Mercer <ron.mercer@qlogic.com>
> Date: Fri, 16 Oct 2009 13:15:33 -0700
>
> > These patches are interdependent.
>
> No, Ron, they are absolutely not.
>
> Apply the first patch, and that breaks the build because
> you've removed LARGE_BUFFER_SIZE but it's still referenced
> in qlge_main.c, and there are tons of other breakages too.
>
> Don't send me garbage like this and then claim it's a set
> of independent patches. A trivial build test would have
> shown otherwise, but you obviously didn't do that.
>
> This is completely rediculious:
Hi Dave,
Sorry for the confusion. I said they were 'interdependent' patches, meaning
"depending on each other". I was trying to break this up to
make it easier to review. Shall I send it as a single patch?
Thanks,
Ron
^ permalink raw reply
* Re: [PATCH 1/2] alchemy: add au1000-eth platform device
From: Florian Fainelli @ 2009-10-17 8:48 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Ralf Baechle, linux-mips, Manuel Lauss, David Miller, netdev
In-Reply-To: <200908271655.11086.florian@openwrt.org>
Hello,
Please find below and updated version, hopefully addressing most if not all
of your comments.
--
From: Florian Fainelli <florian@openwrt.org>
Subject: [PATCH 1/2] alchemy: add au1000-eth platform device (v3)
This patch makes the board code register the au1000-eth
platform device. The au1000-eth platform data can be
overriden with the au1xxx_override_eth_cfg function
like it has to be done for the Bosporus board which uses
a different MAC/PHY setup.
Changes from v2:
- declared the au1000-eth second driver instance platform_data
- made the override function generic and pass it the port number too
Changes from v1:
- remove per-board platform.c file
- add an override function to pass custom eth0 platform_data PHY settings
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index 195e5b3..167b24e 100644
--- a/arch/mips/alchemy/common/platform.c
+++ b/arch/mips/alchemy/common/platform.c
@@ -19,6 +19,7 @@
#include <asm/mach-au1x00/au1xxx.h>
#include <asm/mach-au1x00/au1xxx_dbdma.h>
#include <asm/mach-au1x00/au1100_mmc.h>
+#include <asm/mach-au1x00/au1xxx_eth.h>
#define PORT(_base, _irq) \
{ \
@@ -324,6 +325,88 @@ static struct platform_device pbdb_smbus_device = {
};
#endif
+/* Macro to help defining the Ethernet MAC resources */
+#define MAC_RES(_base, _enable, _irq) \
+ { \
+ .start = CPHYSADDR(_base), \
+ .end = CPHYSADDR(_base + 0xffff), \
+ .flags = IORESOURCE_MEM, \
+ }, \
+ { \
+ .start = CPHYSADDR(_enable), \
+ .end = CPHYSADDR(_enable + 0x3), \
+ .flags = IORESOURCE_MEM, \
+ }, \
+ { \
+ .start = _irq, \
+ .end = _irq, \
+ .flags = IORESOURCE_IRQ \
+ }
+
+static struct resource au1xxx_eth0_resources[] = {
+#if defined(CONFIG_SOC_AU1000)
+ MAC_RES(AU1000_ETH0_BASE, AU1000_MAC0_ENABLE, AU1000_MAC0_DMA_INT),
+#elif defined(CONFIG_SOC_AU1100)
+ MAC_RES(AU1100_ETH0_BASE, AU1100_MAC0_ENABLE, AU1100_MAC0_DMA_INT),
+#elif defined(CONFIG_SOC_AU1550)
+ MAC_RES(AU1550_ETH0_BASE, AU1550_MAC0_ENABLE, AU1550_MAC0_DMA_INT),
+#elif defined(CONFIG_SOC_AU1500)
+ MAC_RES(AU1500_ETH0_BASE, AU1500_MAC0_ENABLE, AU1500_MAC0_DMA_INT),
+#endif
+};
+
+static struct resource au1xxx_eth1_resources[] = {
+#if defined(CONFIG_SOC_AU1000)
+ MAC_RES(AU1000_ETH1_BASE, AU1000_MAC1_ENABLE, AU1000_MAC1_DMA_INT),
+#elif defined(CONFIG_SOC_AU1550)
+ MAC_RES(AU1550_ETH1_BASE, AU1550_MAC1_ENABLE, AU1550_MAC1_DMA_INT),
+#elif defined(CONFIG_SOC_AU1500)
+ MAC_RES(AU1500_ETH1_BASE, AU1500_MAC1_ENABLE, AU1500_MAC1_DMA_INT),
+#endif
+};
+
+static struct au1000_eth_platform_data au1xxx_eth0_platform_data = {
+ .phy1_search_mac0 = 1,
+};
+
+static struct platform_device au1xxx_eth0_device = {
+ .name = "au1000-eth",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(au1xxx_eth0_resources),
+ .resource = au1xxx_eth0_resources,
+ .dev.platform_data = &au1xxx_eth0_platform_data,
+};
+
+#ifndef CONFIG_SOC_AU1100
+static struct au1000_eth_platform_data au1xxx_eth1_platform_data = {
+ .phy1_search_mac0 = 1,
+};
+
+static struct platform_device au1xxx_eth1_device = {
+ .name = "au1000-eth",
+ .id = 1,
+ .num_resources = ARRAY_SIZE(au1xxx_eth1_resources),
+ .resource = au1xxx_eth1_resources,
+ .dev.platform_data = &au1xxx_eth1_platform_data,
+};
+#endif
+
+void __init au1xxx_override_eth_cfg(unsigned int port,
+ struct au1000_eth_platform_data *eth_data)
+{
+ if (!eth_data || port > 1)
+ return;
+
+ if (port == 0)
+ memcpy(&au1xxx_eth0_platform_data, eth_data,
+ sizeof(struct au1000_eth_platform_data));
+#ifndef CONFIG_SOC_AU1100
+ else
+ memcpy(&au1xxx_eth1_platform_data, eth_data,
+ sizeof(struct au1000_eth_platform_data));
+#endif
+}
+
static struct platform_device *au1xxx_platform_devices[] __initdata = {
&au1xx0_uart_device,
&au1xxx_usb_ohci_device,
@@ -343,6 +426,7 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
#ifdef SMBUS_PSC_BASE
&pbdb_smbus_device,
#endif
+ &au1xxx_eth0_device,
};
static int __init au1xxx_platform_init(void)
@@ -354,6 +438,12 @@ static int __init au1xxx_platform_init(void)
for (i = 0; au1x00_uart_data[i].flags; i++)
au1x00_uart_data[i].uartclk = uartclk;
+#ifndef CONFIG_SOC_AU1100
+ /* Register second MAC if enabled in pinfunc */
+ if (!(au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4)
+ platform_device_register(&au1xxx_eth1_device);
+#endif
+
return platform_add_devices(au1xxx_platform_devices,
ARRAY_SIZE(au1xxx_platform_devices));
}
diff --git a/arch/mips/alchemy/devboards/db1x00/board_setup.c b/arch/mips/alchemy/devboards/db1x00/board_setup.c
index 64eb26f..f938924 100644
--- a/arch/mips/alchemy/devboards/db1x00/board_setup.c
+++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c
@@ -32,6 +32,7 @@
#include <linux/interrupt.h>
#include <asm/mach-au1x00/au1000.h>
+#include <asm/mach-au1x00/au1xxx_eth.h>
#include <asm/mach-db1x00/db1x00.h>
#include <asm/mach-db1x00/bcsr.h>
@@ -101,6 +102,22 @@ void __init board_setup(void)
printk(KERN_INFO "AMD Alchemy Au1100/Db1100 Board\n");
#endif
#ifdef CONFIG_MIPS_BOSPORUS
+ struct au1000_eth_platform_data eth0_pdata;
+
+ /*
+ * Micrel/Kendin 5 port switch attached to MAC0,
+ * MAC0 is associated with PHY address 5 (== WAN port)
+ * MAC1 is not associated with any PHY, since it's connected directly
+ * to the switch.
+ * no interrupts are used
+ */
+ eth0_pdata.phy1_search_mac0 = 0;
+ eth0_pdata.phy_static_config = 1;
+ eth0_pdata.phy_addr = 5;
+ eth0_pdata.phy_busid = 0;
+
+ au1xxx_override_eth_cfg(0, ð0_pdata);
+
printk(KERN_INFO "AMD Alchemy Bosporus Board\n");
#endif
#ifdef CONFIG_MIPS_MIRAGE
diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h b/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h
new file mode 100644
index 0000000..f30529e
--- /dev/null
+++ b/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h
@@ -0,0 +1,18 @@
+#ifndef __AU1X00_ETH_DATA_H
+#define __AU1X00_ETH_DATA_H
+
+/* Platform specific PHY configuration passed to the MAC driver */
+struct au1000_eth_platform_data {
+ int phy_static_config;
+ int phy_search_highest_addr;
+ int phy1_search_mac0;
+ int phy_addr;
+ int phy_busid;
+ int phy_irq;
+};
+
+void __init au1xxx_override_eth_cfg(unsigned port,
+ struct au1000_eth_platform_data *eth_data);
+
+#endif /* __AU1X00_ETH_DATA_H */
+
^ permalink raw reply related
* Oops in net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c::ipv6_confirm(), kernel 2.6.30.8
From: Chuck Ebbert @ 2009-10-17 9:01 UTC (permalink / raw)
To: netfilter-devel; +Cc: netdev
general protection fault: 0000 [#1] SMP
last sysfs file: /sys/devices/system/cpu/sched_mc_power_savings
CPU 0
Modules linked in: tun fuse rfcomm sco bridge stp llc bnep l2cap autofs4
w83627ehf hwmon_vid sunrpc sit tunnel4 nf_nat_sip nf_conntrack_sip nf_nat_ftp
nf_conntrack_ftp ipt_LOG xt_owner iptable_mangle ipt_MASQUERADE iptable_nat
nf_nat xt_limit nf_conntrack_ipv6 xt_mac ip6t_LOG ip6table_filter ip6_tables
p4_clockmod freq_table speedstep_lib squashfs nls_utf8 dm_multipath raid1
kvm_intel kvm uinput ipv6 ppdev snd_hda_codec_realtek snd_hda_intel
snd_hda_codec snd_hwdep snd_pcm nouveau pcspkr i2c_i801 firewire_ohci snd_timer
btusb firewire_core e1000 snd bluetooth drm iTCO_wdt iTCO_vendor_support
crc_itu_t i2c_algo_bit asus_atk0110 i82975x_edac soundcore sky2 edac_core
parport_pc i2c_core floppy hwmon snd_page_alloc parport raid456 raid6_pq
async_xor async_memcpy async_tx xor [last unloaded: freq_table]
Pid: 4104, comm: qemu-kvm Not tainted 2.6.30.8-64.fc11.x86_64.debug #1 System
Product Name
RIP: 0010:[<ffffffffa03624e1>] [<ffffffffa03624e1>] ipv6_confirm+0xd0/0x147
[nf_conntrack_ipv6]
RSP: 0018:ffff880035203668 EFLAGS: 00010212
RAX: 0000000000000030 RBX: ffff8801f90a1080 RCX: 0000000000000002
RDX: ffffffff81783f40 RSI: 0000000000000030 RDI: ffff8801f90a1080
RBP: ffff880035203698 R08: ffffffffa04520ee R09: ffff880035203748
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff81783f40
R13: 6b6b6b6b6b6b6b6b R14: 0000000000000002 R15: 0000000000000004
FS: 00007f944e44b740(0000) GS:ffff880035200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007fffbc54ef60 CR3: 000000020f8d8000 CR4: 00000000000026e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process qemu-kvm (pid: 4104, threadinfo ffff88020f89c000, task
ffff8802104a4760)
Stack:
3a00000000000246 00000000696092b1 0000000080000000 ffff8801f90a1080
ffffffffa04520ee ffffffff81783bd0 ffff880035203708 ffffffff8142b117
ffff8800352036c8 ffff880035203748 ffff880210492060 0000000000000000
Call Trace:
<IRQ> <0> [<ffffffffa04520ee>] ? br_nf_dev_queue_xmit+0x0/0xa1 [bridge]
[<ffffffff8142b117>] nf_iterate+0x5c/0xb3
[<ffffffffa04520ee>] ? br_nf_dev_queue_xmit+0x0/0xa1 [bridge]
[<ffffffff8142b214>] nf_hook_slow+0xa6/0x136
[<ffffffffa04520ee>] ? br_nf_dev_queue_xmit+0x0/0xa1 [bridge]
[<ffffffffa044c29d>] ? br_dev_queue_push_xmit+0x0/0xae [bridge]
[<ffffffffa045263b>] nf_hook_thresh.clone.0+0x4c/0x62 [bridge]
[<ffffffffa0452d92>] br_nf_post_routing+0x1a8/0x1e4 [bridge]
[<ffffffff8142b117>] nf_iterate+0x5c/0xb3
[<ffffffffa044c29d>] ? br_dev_queue_push_xmit+0x0/0xae [bridge]
[<ffffffff8142b214>] nf_hook_slow+0xa6/0x136
[<ffffffffa044c29d>] ? br_dev_queue_push_xmit+0x0/0xae [bridge]
[<ffffffffa044c39d>] nf_hook_thresh.clone.0+0x52/0x68 [bridge]
[<ffffffffa044c3ed>] br_forward_finish+0x3a/0x62 [bridge]
[<ffffffffa0452aaa>] br_nf_forward_finish+0xb3/0xd2 [bridge]
[<ffffffffa045263b>] ? nf_hook_thresh.clone.0+0x4c/0x62 [bridge]
[<ffffffffa045318a>] br_nf_forward_ip+0x1af/0x1de [bridge]
[<ffffffffa044c3b3>] ? br_forward_finish+0x0/0x62 [bridge]
[<ffffffff8142b117>] nf_iterate+0x5c/0xb3
[<ffffffffa044c3b3>] ? br_forward_finish+0x0/0x62 [bridge]
[<ffffffff8142b214>] nf_hook_slow+0xa6/0x136
[<ffffffffa044c3b3>] ? br_forward_finish+0x0/0x62 [bridge]
[<ffffffffa044c415>] ? __br_forward+0x0/0xab [bridge]
[<ffffffffa044c39d>] nf_hook_thresh.clone.0+0x52/0x68 [bridge]
[<ffffffffa044c499>] __br_forward+0x84/0xab [bridge]
[<ffffffffa044c1ca>] br_flood+0x82/0xd9 [bridge]
[<ffffffff814086ee>] ? netif_receive_skb+0x120/0x44c
[<ffffffffa044c249>] br_flood_forward+0x28/0x3e [bridge]
[<ffffffffa044d36a>] br_handle_frame_finish+0x13a/0x167 [bridge]
[<ffffffffa04529da>] br_nf_pre_routing_finish_ipv6+0xb7/0xd4 [bridge]
[<ffffffffa045263b>] ? nf_hook_thresh.clone.0+0x4c/0x62 [bridge]
[<ffffffffa04534e8>] br_nf_pre_routing+0x32f/0x577 [bridge]
[<ffffffffa044d230>] ? br_handle_frame_finish+0x0/0x167 [bridge]
[<ffffffff8142b117>] nf_iterate+0x5c/0xb3
[<ffffffff8123bbf6>] ? kobject_put+0x54/0x6f
[<ffffffffa044d230>] ? br_handle_frame_finish+0x0/0x167 [bridge]
[<ffffffff8142b214>] nf_hook_slow+0xa6/0x136
[<ffffffffa044d230>] ? br_handle_frame_finish+0x0/0x167 [bridge]
[<ffffffffa044d21a>] nf_hook_thresh.clone.0+0x52/0x68 [bridge]
[<ffffffffa044d533>] br_handle_frame+0x19c/0x1d9 [bridge]
[<ffffffff814088fa>] netif_receive_skb+0x32c/0x44c
[<ffffffff814086ee>] ? netif_receive_skb+0x120/0x44c
[<ffffffff81087465>] ? trace_hardirqs_on_caller+0x32/0x173
[<ffffffff81408ac5>] process_backlog+0xab/0xfb
[<ffffffff81060805>] ? _local_bh_enable+0xad/0xd6
[<ffffffff81409348>] net_rx_action+0xc6/0x226
[<ffffffff8140944c>] ? net_rx_action+0x1ca/0x226
[<ffffffff81060900>] __do_softirq+0xd2/0x1d2
[<ffffffff8101328c>] call_softirq+0x1c/0x30
<EOI> <0> [<ffffffff81014bf3>] do_softirq+0x5f/0xd7
[<ffffffff814094dd>] netif_rx_ni+0x35/0x4e
[<ffffffffa049a0b3>] tun_chr_aio_write+0x384/0x3f3 [tun]
[<ffffffffa0499d2f>] ? tun_chr_aio_write+0x0/0x3f3 [tun]
[<ffffffff81124aba>] do_sync_readv_writev+0xf7/0x14a
[<ffffffff81088f33>] ? print_lock_contention_bug+0x2a/0x106
[<ffffffff810745bf>] ? autoremove_wake_function+0x0/0x5f
[<ffffffff811f488c>] ? security_file_permission+0x29/0x3f
[<ffffffff81125b15>] do_readv_writev+0xbf/0x156
[<ffffffff8112630b>] ? fget_light+0x66/0x113
[<ffffffff8124036a>] ? __up_read+0x89/0xaa
[<ffffffff81125c02>] vfs_writev+0x56/0x75
[<ffffffff81125d38>] sys_writev+0x59/0xb6
[<ffffffff81012002>] system_call_fastpath+0x16/0x1b
Code: 2c 75 1d f6 05 1a fc 1c e2 40 74 60 f6 05 17 fc 1c e2 04 74 57 80 3d ad
4d 00 00 00 74 4e eb 62 44 89 f1 4c 89 e2 89 c6 48 89 df <41> ff 55 50 83 f8 01
75 3d 4c 8b a3 88 00 00 00 4d 85 e4 74 2c
RIP [<ffffffffa03624e1>] ipv6_confirm+0xd0/0x147 [nf_conntrack_ipv6]
RSP <ffff880035203668>
---[ end trace 5dc400d9f2f8290b ]---
c: f6 05 17 fc 1c e2 04 testb $0x4,-0x1de303e9(%rip)
13: 74 57 je 0x6c
15: 80 3d ad 4d 00 00 00 cmpb $0x0,0x4dad(%rip)
1c: 74 4e je 0x6c
1e: eb 62 jmp 0x82
20: 44 89 f1 mov %r14d,%ecx
23: 4c 89 e2 mov %r12,%rdx
26: 89 c6 mov %eax,%esi
28: 48 89 df mov %rbx,%rdi
0: 41 ff 55 50 callq *0x50(%r13) <===========
4: 83 f8 01 cmp $0x1,%eax
7: 75 3d jne 0x46
9: 4c 8b a3 88 00 00 00 mov 0x88(%rbx),%r12
10: 4d 85 e4 test %r12,%r12
13: 74 2c je 0x41
R13: 6b6b6b6b6b6b6b6b
Corresponds to:
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c:178:
ret = helper->help(skb, protoff, ct, ctinfo);
^ permalink raw reply
* Re: MAINTAINERS drivers/net cleanups?
From: Krzysztof Halasa @ 2009-10-17 10:55 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev
In-Reply-To: <1255729936.2267.179.camel@Joe-Laptop.home>
Joe Perches <joe@perches.com> writes:
> There are many people described as MAINTAINERS for
> these files that have not had a single sign-off or
> commit in git history.
>
> That's 4+ years.
>
> Here are the files, nominal maintainers, and the
> sections of MAINTAINERS that could be dropped.
>
> Should these individuals be removed from MAINTAINERS
> and added to CREDITS if not already there?
I'm not sure we can do that, esp. with the old ISA drivers. It may just
happen that the drivers are as complete as possible, and occasional
patches resulting from core changes don't necessarily have to be
signed-off-by the maintainer. I don't think we should remove the
MAINTAINERS entries in such cases blindly, at least not before the
driver itself is removed.
How long ago anyone of us used those EExpress, WD8003 or NE2000?
Not this Millennium certainly? :-)
BTW CREDITS is opt-in, isn't it?
--
Krzysztof Halasa
^ permalink raw reply
* Re: TCP_DEFER_ACCEPT is missing counter update
From: Julian Anastasov @ 2009-10-17 11:48 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Willy Tarreau, David Miller, netdev
In-Reply-To: <4AD84D8B.5020103@gmail.com>
Hello,
On Fri, 16 Oct 2009, Eric Dumazet wrote:
> I wonder if tcp_diag should be extented a bit to reflect fact that the ACK was received from client
> (ie forward the inet_rsk(req)->acked information to idiag_rqueue)
It is a good idea.
> diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
> index cb73fde..c172bd4 100644
> --- a/net/ipv4/inet_diag.c
> +++ b/net/ipv4/inet_diag.c
> @@ -589,7 +589,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
> r->id.idiag_src[0] = ireq->loc_addr;
> r->id.idiag_dst[0] = ireq->rmt_addr;
> r->idiag_expires = jiffies_to_msecs(tmo);
> - r->idiag_rqueue = 0;
> + r->idiag_rqueue = ireq->acked;
> r->idiag_wqueue = 0;
> r->idiag_uid = sock_i_uid(sk);
> r->idiag_inode = 0;
I tested both patches. It seems the current algorithm to
convert seconds to retransmissions does not match well the TCP
SYN-ACK timer and sometimes can convert the seconds to
retransmissions which are 1 above the expected. For example,
you set 9 seconds (expecting 2 retrans) but you get 3 retrans,
visible with TCP_SYNCNT=1.
Also, it is limited to period of 32 retransmissions.
The following patch changes the TCP_DEFER_ACCEPT
period calculation to match TCP SYN-ACK retransmissions and to
help those folks who select the seconds with TCP SYN-ACK
timing in mind. It also allows the retransmission threshold
to be up to 255.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
diff -urp v2.6.31/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- v2.6.31/linux/net/ipv4/tcp.c 2009-09-11 10:27:17.000000000 +0300
+++ linux/net/ipv4/tcp.c 2009-10-17 12:34:38.000000000 +0300
@@ -2165,13 +2165,20 @@ static int do_tcp_setsockopt(struct sock
case TCP_DEFER_ACCEPT:
icsk->icsk_accept_queue.rskq_defer_accept = 0;
if (val > 0) {
+ int timeout = TCP_TIMEOUT_INIT / HZ;
+ int period = timeout;
+
/* Translate value in seconds to number of
* retransmits */
- while (icsk->icsk_accept_queue.rskq_defer_accept < 32 &&
- val > ((TCP_TIMEOUT_INIT / HZ) <<
- icsk->icsk_accept_queue.rskq_defer_accept))
+ icsk->icsk_accept_queue.rskq_defer_accept = 1;
+ while (icsk->icsk_accept_queue.rskq_defer_accept < 255 &&
+ val > period) {
icsk->icsk_accept_queue.rskq_defer_accept++;
- icsk->icsk_accept_queue.rskq_defer_accept++;
+ timeout <<= 1;
+ if (timeout > TCP_RTO_MAX / HZ)
+ timeout = TCP_RTO_MAX / HZ;
+ period += timeout;
+ }
}
break;
FYI, the old algorithm selects the following retransmissions
for the configured seconds:
defer_accept=1 retrans for 1-3 secs
defer_accept=2 retrans for 4-6 secs
defer_accept=3 retrans for 7-12 secs
defer_accept=4 retrans for 13-24 secs
defer_accept=5 retrans for 25-48 secs
defer_accept=6 retrans for 49-96 secs
defer_accept=7 retrans for 97-192 secs
defer_accept=8 retrans for 193-384 secs
While the new algorithm is as follows:
defer_accept=1 retrans for 1-3 secs
defer_accept=2 retrans for 4-9 secs
defer_accept=3 retrans for 10-21 secs
defer_accept=4 retrans for 22-45 secs
defer_accept=5 retrans for 46-93 secs
defer_accept=6 retrans for 94-189 secs
defer_accept=7 retrans for 190-309 secs
defer_accept=8 retrans for 310-429 secs
Comments? Next step is to post the 3 patches separately
for final review and applying.
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Re: MAINTAINERS drivers/net cleanups?
From: Denys Fedoryschenko @ 2009-10-17 11:52 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: Joe Perches, netdev
In-Reply-To: <m3vdiep9vt.fsf@intrepid.localdomain>
On Saturday 17 October 2009 13:55:50 Krzysztof Halasa wrote:
> How long ago anyone of us used those EExpress, WD8003 or NE2000?
> Not this Millennium certainly? :-)
>
> BTW CREDITS is opt-in, isn't it?
I guess NE2000 can be used still in some embedded developments and simulators.
^ permalink raw reply
* [PATCH] net: au1000_eth: add missing capability.h
From: Manuel Lauss @ 2009-10-17 12:00 UTC (permalink / raw)
To: netdev; +Cc: Manuel Lauss
fixes the following build failure:
CC drivers/net/au1000_eth.o
/drivers/net/au1000_eth.c: In function 'au1000_set_settings':
/drivers/net/au1000_eth.c:623: error: implicit declaration of function 'capable'
/drivers/net/au1000_eth.c:623: error: 'CAP_NET_ADMIN' undeclared (first use in this function)
/drivers/net/au1000_eth.c:623: error: (Each undeclared identifier is reported only once
/drivers/net/au1000_eth.c:623: error: for each function it appears in.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
---
drivers/net/au1000_eth.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 04f63c7..ce6f1ac 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -34,6 +34,7 @@
*
*
*/
+#include <linux/capability.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/kernel.h>
--
1.6.5.rc2
^ permalink raw reply related
* Re: TCP_DEFER_ACCEPT is missing counter update
From: Eric Dumazet @ 2009-10-17 12:07 UTC (permalink / raw)
To: Julian Anastasov; +Cc: Willy Tarreau, David Miller, netdev
In-Reply-To: <Pine.LNX.4.58.0910171417260.7818@u.domain.uli>
Julian Anastasov a écrit :
>
> I tested both patches. It seems the current algorithm to
> convert seconds to retransmissions does not match well the TCP
> SYN-ACK timer and sometimes can convert the seconds to
> retransmissions which are 1 above the expected. For example,
> you set 9 seconds (expecting 2 retrans) but you get 3 retrans,
> visible with TCP_SYNCNT=1.
>
> Also, it is limited to period of 32 retransmissions.
>
> The following patch changes the TCP_DEFER_ACCEPT
> period calculation to match TCP SYN-ACK retransmissions and to
> help those folks who select the seconds with TCP SYN-ACK
> timing in mind. It also allows the retransmission threshold
> to be up to 255.
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
>
> diff -urp v2.6.31/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
> --- v2.6.31/linux/net/ipv4/tcp.c 2009-09-11 10:27:17.000000000 +0300
> +++ linux/net/ipv4/tcp.c 2009-10-17 12:34:38.000000000 +0300
> @@ -2165,13 +2165,20 @@ static int do_tcp_setsockopt(struct sock
> case TCP_DEFER_ACCEPT:
> icsk->icsk_accept_queue.rskq_defer_accept = 0;
> if (val > 0) {
> + int timeout = TCP_TIMEOUT_INIT / HZ;
> + int period = timeout;
> +
> /* Translate value in seconds to number of
> * retransmits */
> - while (icsk->icsk_accept_queue.rskq_defer_accept < 32 &&
> - val > ((TCP_TIMEOUT_INIT / HZ) <<
> - icsk->icsk_accept_queue.rskq_defer_accept))
> + icsk->icsk_accept_queue.rskq_defer_accept = 1;
> + while (icsk->icsk_accept_queue.rskq_defer_accept < 255 &&
> + val > period) {
> icsk->icsk_accept_queue.rskq_defer_accept++;
> - icsk->icsk_accept_queue.rskq_defer_accept++;
> + timeout <<= 1;
> + if (timeout > TCP_RTO_MAX / HZ)
> + timeout = TCP_RTO_MAX / HZ;
> + period += timeout;
> + }
> }
> break;
>
>
> FYI, the old algorithm selects the following retransmissions
> for the configured seconds:
>
> defer_accept=1 retrans for 1-3 secs
> defer_accept=2 retrans for 4-6 secs
> defer_accept=3 retrans for 7-12 secs
> defer_accept=4 retrans for 13-24 secs
> defer_accept=5 retrans for 25-48 secs
> defer_accept=6 retrans for 49-96 secs
> defer_accept=7 retrans for 97-192 secs
> defer_accept=8 retrans for 193-384 secs
>
> While the new algorithm is as follows:
>
> defer_accept=1 retrans for 1-3 secs
> defer_accept=2 retrans for 4-9 secs
> defer_accept=3 retrans for 10-21 secs
> defer_accept=4 retrans for 22-45 secs
> defer_accept=5 retrans for 46-93 secs
> defer_accept=6 retrans for 94-189 secs
> defer_accept=7 retrans for 190-309 secs
> defer_accept=8 retrans for 310-429 secs
>
> Comments? Next step is to post the 3 patches separately
> for final review and applying.
>
I really like this, but please define helper functions out of do_tcp_setsockopt()
/* Translate value in seconds to number of SYN-ACK retransmits */
static u8 secs_to_retrans(int seconds)
{
u8 res = 0;
if (seconds > 0) {
int timeout = TCP_TIMEOUT_INIT / HZ;
int period = timeout;
res = 1;
while (res < 255 && seconds > period) {
res++;
timeout <<= 1;
if (timeout > TCP_RTO_MAX / HZ)
timeout = TCP_RTO_MAX / HZ;
period += timeout;
}
}
return res;
}
You also need the reverse function for getsockopt()...
^ permalink raw reply
* Re: [PATCH] iputils: ping by mark
From: jamal @ 2009-10-17 12:30 UTC (permalink / raw)
To: Rob.Townley; +Cc: YOSHIFUJI Hideaki, netdev
In-Reply-To: <7e84ed60910161405i2ce46053m9858b7f1c086e6b7@mail.gmail.com>
On Fri, 2009-10-16 at 16:05 -0500, Rob Townley wrote:
> Would this make it easier to ping multiple gateways
yes.
You need to set your policy routing accordingly to have a different
gateway for the same destination and then use the -m to select the
routing table..
> so if one goes
> down, it is taken almost out of the routing table until it comes back
> up.
I am not sure i followed or see any relation to the first part of your
question.
Ive never heard of routing table entries automagically being taken down
until something comes up. You could do it probably by writting a user
space daemon.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 2/8] bitmap: Introduce bitmap_set, bitmap_clear, bitmap_find_next_zero_area
From: FUJITA Tomonori @ 2009-10-17 13:43 UTC (permalink / raw)
To: akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w
Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
fujita.tomonori-Zyj7fXuS5i5L9jVzuh4AOg,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, sparclinux-u79uwXL29TY76Z2rM5mHXA,
benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r,
paulus-eUNUBHrolfbYtjvyW6yDsg,
linuxppc-dev-mnsaURCQ41sdnm+yROfE0A, tglx-hfZtesqFncYOwBW4kG4KsQ,
mingo-H+wXaHxf7aLQT0dZR+AlfA, hpa-YMNOUZJC4hwAvxtiuMwx3w,
x86-DgEjT+Ai2ygdnm+yROfE0A, gregkh-l3A5Bk7waGM,
LW-bxm8fMRDkQLDiMYJYoSAnRvVK+yQ3ZXh,
linux-usb-u79uwXL29TY76Z2rM5mHXA, rolandd-FYB4Gu1CFyUAvxtiuMwx3w,
yevgenyp-VPRAkNaXOzVS1MOuV/RT9w, netdev-u79uwXL29TY76Z2rM5mHXA,
tony.luck-ral2JQCrhuEAvxtiuMwx3w,
fenghua.yu-ral2JQCrhuEAvxtiuMwx3w,
linux-ia64-u79uwXL29TY76Z2rM5mHXA, linux-altix-sJ/iWh9BUns
In-Reply-To: <20091013091017.GA18431-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
On Tue, 13 Oct 2009 18:10:17 +0900
Akinobu Mita <akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> My user space testing exposed off-by-one error find_next_zero_area
> in iommu-helper. Some zero area cannot be found by this bug.
>
> Subject: [PATCH] Fix off-by-one error in find_next_zero_area
>
> Signed-off-by: Akinobu Mita <akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> lib/iommu-helper.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c
> index 75dbda0..afc58bc 100644
> --- a/lib/iommu-helper.c
> +++ b/lib/iommu-helper.c
> @@ -19,7 +19,7 @@ again:
> index = (index + align_mask) & ~align_mask;
>
> end = index + nr;
> - if (end >= size)
> + if (end > size)
I think that this is intentional; the last byte of the limit doesn't
work.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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: TCP_DEFER_ACCEPT is missing counter update
From: Julian Anastasov @ 2009-10-17 14:20 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Willy Tarreau, David Miller, netdev
In-Reply-To: <4AD9B37A.3090606@gmail.com>
Hello,
On Sat, 17 Oct 2009, Eric Dumazet wrote:
> I really like this, but please define helper functions out of do_tcp_setsockopt()
>
> /* Translate value in seconds to number of SYN-ACK retransmits */
> static u8 secs_to_retrans(int seconds)
> {
> u8 res = 0;
>
> if (seconds > 0) {
> int timeout = TCP_TIMEOUT_INIT / HZ;
> int period = timeout;
>
> res = 1;
> while (res < 255 && seconds > period) {
> res++;
> timeout <<= 1;
> if (timeout > TCP_RTO_MAX / HZ)
> timeout = TCP_RTO_MAX / HZ;
> period += timeout;
> }
> }
> return res;
> }
>
> You also need the reverse function for getsockopt()...
Yes, I forgot that. Here is what I tested, should
I split it later to 2 patches? May be it should go somewhere
in net/core/sock.c as extern funcs with EXPORT_SYMBOL to
allow other protocols one day to use it?
Signed-off-by: Julian Anastasov <ja@ssi.bg>
diff -urp v2.6.31/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- v2.6.31/linux/net/ipv4/tcp.c 2009-09-11 10:27:17.000000000 +0300
+++ linux/net/ipv4/tcp.c 2009-10-17 16:37:48.000000000 +0300
@@ -326,6 +326,43 @@ void tcp_enter_memory_pressure(struct so
EXPORT_SYMBOL(tcp_enter_memory_pressure);
+/* Convert seconds to retransmits based on initial and max timeout */
+static u8 secs_to_retrans(int seconds, int timeout, int rto_max)
+{
+ u8 res = 0;
+
+ if (seconds > 0) {
+ int period = timeout;
+
+ res = 1;
+ while (seconds > period && res < 255) {
+ res++;
+ timeout <<= 1;
+ if (timeout > rto_max)
+ timeout = rto_max;
+ period += timeout;
+ }
+ }
+ return res;
+}
+
+/* Convert retransmits to seconds based on initial and max timeout */
+static int retrans_to_secs(u8 retrans, int timeout, int rto_max)
+{
+ int period = 0;
+
+ if (retrans > 0) {
+ period = timeout;
+ while (--retrans) {
+ timeout <<= 1;
+ if (timeout > rto_max)
+ timeout = rto_max;
+ period += timeout;
+ }
+ }
+ return period;
+}
+
/*
* Wait for a TCP event.
*
@@ -2163,16 +2200,10 @@ static int do_tcp_setsockopt(struct sock
break;
case TCP_DEFER_ACCEPT:
- icsk->icsk_accept_queue.rskq_defer_accept = 0;
- if (val > 0) {
- /* Translate value in seconds to number of
- * retransmits */
- while (icsk->icsk_accept_queue.rskq_defer_accept < 32 &&
- val > ((TCP_TIMEOUT_INIT / HZ) <<
- icsk->icsk_accept_queue.rskq_defer_accept))
- icsk->icsk_accept_queue.rskq_defer_accept++;
- icsk->icsk_accept_queue.rskq_defer_accept++;
- }
+ /* Translate value in seconds to number of retransmits */
+ icsk->icsk_accept_queue.rskq_defer_accept =
+ secs_to_retrans(val, TCP_TIMEOUT_INIT / HZ,
+ TCP_RTO_MAX / HZ);
break;
case TCP_WINDOW_CLAMP:
@@ -2353,8 +2384,8 @@ static int do_tcp_getsockopt(struct sock
val = (val ? : sysctl_tcp_fin_timeout) / HZ;
break;
case TCP_DEFER_ACCEPT:
- val = !icsk->icsk_accept_queue.rskq_defer_accept ? 0 :
- ((TCP_TIMEOUT_INIT / HZ) << (icsk->icsk_accept_queue.rskq_defer_accept - 1));
+ val = retrans_to_secs(icsk->icsk_accept_queue.rskq_defer_accept,
+ TCP_TIMEOUT_INIT / HZ, TCP_RTO_MAX / HZ);
break;
case TCP_WINDOW_CLAMP:
val = tp->window_clamp;
Regards
--
Julian Anastasov <ja@ssi.bg>
^ 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