* Re: [Uclinux-dist-devel] [PATCH 1/5] netdev: bfin_mac: push settings to platform resources
From: Mike Frysinger @ 2010-10-26 1:54 UTC (permalink / raw)
To: David Miller; +Cc: netdev, uclinux-dist-devel
In-Reply-To: <AANLkTik6C2tbir0hKJJ2kErha-JJD_yx927qw=3t7=Xu@mail.gmail.com>
On Sun, Oct 24, 2010 at 19:51, Mike Frysinger wrote:
> On Sun, Oct 24, 2010 at 19:45, David Miller wrote:
>> From: Mike Frysinger
>>> and i have the Blackfin changes waiting for you to merge this patch.
>>> i can squash them into this change and have you merge the result, or i
>>> can merge it. i dont really care either way.
>>
>> Why don't you just apply this to your tree then. Feel free to add my:
>
> thanks, i'll do that
Linus has taken this via my tree now. are you going to merge the
other patches ? or do i need to resend them ?
-mike
^ permalink raw reply
* Re: [PATCH] Enhance AF_PACKET implementation to not require high order contiguous memory allocation
From: Neil Horman @ 2010-10-26 1:58 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, netdev, jpirko
In-Reply-To: <20101025.164646.104054845.davem@davemloft.net>
On Mon, Oct 25, 2010 at 04:46:46PM -0700, David Miller wrote:
> From: Neil Horman <nhorman@tuxdriver.com>
> Date: Mon, 25 Oct 2010 19:35:58 -0400
>
> > On Tue, Oct 26, 2010 at 12:30:56AM +0200, Eric Dumazet wrote:
> >> I would try a two level thing : Try to get high order pages, and
> >> fallback on low order pages, but normally libpcap does this for us ?
> >>
> >>
> > It does, but it tries them in that order, which causes the problem I'm
> > describing, which is to say that attempting to get a large high order allocation
> > causes the system to dig into swap and become unresponsive while it tries to
> > assemble those allocations. I would suggest a vmalloc, with a backoff to high
> > order allocation if that fails.
>
> I think that logic should be maintained, except that one of the GFP_*
> flags should be specified so that it doesn't go all swap crazy on us,
> and instead fails a high order allocation earlier.
>
I suppose we can do that. Specifically we can add __GFP_NORETRY so that we
don't continually drive I/O or swap to get pages freed, but I think that all
that will result in is earlier failures. No matter how you look at it, order 4
allocations are hard to come by, and we can make it work with non-contigous
pages (the vmalloc case). Given that each of the cases can fail, I can see this
being a workable fallback set:
1) get_free_pages (GFP_KERNEL|...+|__GFP_NORETRY)
2) vmalloc
3) get_free_pages (GFP_KERNEL|...)
Theres no reason to fail af_packet socket options just because the system is
under presure. My only concern is that, since af_packet is typically used for
debugging/tracing, I'd rather not have its memory allocation adversely affect
system behavio.
^ permalink raw reply
* [PATCH] ipv6: addrconf: clear IPv6 addresses and routes when losing link
From: Lorenzo Colitti @ 2010-10-26 2:08 UTC (permalink / raw)
To: netdev
When roaming between different networks (e.g., changing wireless
SSIDs, or plugging in to different wired networks), IPv6 addresses and
routes are not cleared. If the two networks have different IPv6
subnets assigned, the host maintains both the old and new IPv6
addresses and gateways, but only the new ones works. If the host
chooses the wrong source address or gateway, or if the new network
does not have IPv6 but the old one did, IPv6 connections time out,
leading to long delays when trying to connect to IPv6 hosts.
Fix this by ensuring that autoconfigured IPv6 addresses and routes are
purged when link is lost, not only when the interface goes down.
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
--- a/net/ipv6/addrconf.c 2010-10-20 13:30:22.000000000 -0700
+++ b/net/ipv6/addrconf.c 2010-10-25 13:55:15.000000000 -0700
@@ -2524,6 +2524,14 @@
} else {
if (!addrconf_qdisc_ok(dev)) {
/* device is still not ready. */
+ if (idev && (idev->if_flags & IF_READY)) {
+ /* Link lost. Clear addresses and
+ routes, the device might come back
+ on a link where they are no longer
+ valid. */
+ addrconf_ifdown(dev, 0);
+ idev->if_flags &= ~IF_READY;
+ }
break;
}
^ permalink raw reply
* Re: [PATCH] Add support for new VLAN acceleration model
From: Jesse Gross @ 2010-10-26 2:22 UTC (permalink / raw)
To: David Dillow; +Cc: netdev, jgarzik, davem
In-Reply-To: <1287951880-25321-1-git-send-email-dave@thedillows.org>
On Sun, Oct 24, 2010 at 1:24 PM, David Dillow <dave@thedillows.org> wrote:
> Signed-off-by: David Dillow <dave@thedillows.org>
> ---
> I used this during testing of the typhoon conversion.
Oops, I have a nearly identical patch that I should have sent out
earlier to make everyone's lives easier. The only differences in mine
are some man page updates and grouping the vlan settings a little more
closely with the other forms of offloading (as opposed to
filtering/hashing). I guess I'll post my version as well (since we
should at least be sure to update the man page) in case that is more
convenient. I don't mean to steal the credit though.
^ permalink raw reply
* [PATCH] ethtool: Add support for vlan accleration.
From: Jesse Gross @ 2010-10-26 2:22 UTC (permalink / raw)
To: jgarzik; +Cc: netdev
The kernel now has support for enabling and disabling vlan
acceleration, similar to other forms of offloading. This
adds the complementary userspace support.
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
ethtool-copy.h | 2 ++
ethtool.8 | 8 ++++++++
ethtool.c | 21 ++++++++++++++++++---
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 894f1da..557425e 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -308,6 +308,8 @@ struct ethtool_perm_addr {
* flag differs from the read-only value.
*/
enum ethtool_flags {
+ ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
+ ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
ETH_FLAG_RXHASH = (1 << 28),
diff --git a/ethtool.8 b/ethtool.8
index 3ca403c..7801797 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -170,6 +170,8 @@ ethtool \- Display or change ethernet card settings
.B2 gso on off
.B2 gro on off
.B2 lro on off
+.B2 rxvlan on off
+.B2 txvlan on off
.B2 rxhash on off
.B ethtool \-p|\-\-identify
@@ -377,6 +379,12 @@ Specifies whether generic receive offload should be enabled
.A2 lro on off
Specifies whether large receive offload should be enabled
.TP
+.A2 rxvlan on off
+Specifies whether RX VLAN acceleration should be enabled
+.TP
+.A2 txvlan on off
+Specifies whether TX VLAN acceleration should be enabled
+.TP
.A2 rxhash on off
Specifies whether receive hashing offload should be enabled
.TP
diff --git a/ethtool.c b/ethtool.c
index 6b2b7c8..3d24d58 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -200,6 +200,8 @@ static struct option {
" [ gso on|off ]\n"
" [ gro on|off ]\n"
" [ lro on|off ]\n"
+ " [ rxvlan on|off ]\n"
+ " [ txvlan on|off ]\n"
" [ ntuple on|off ]\n"
" [ rxhash on|off ]\n"
},
@@ -435,6 +437,10 @@ static struct cmdline_info cmdline_offload[] = {
{ "lro", CMDL_FLAG, &off_flags_wanted, NULL,
ETH_FLAG_LRO, &off_flags_unwanted },
{ "gro", CMDL_BOOL, &off_gro_wanted, NULL },
+ { "rxvlan", CMDL_FLAG, &off_flags_wanted, NULL,
+ ETH_FLAG_RXVLAN, &off_flags_unwanted },
+ { "txvlan", CMDL_FLAG, &off_flags_wanted, NULL,
+ ETH_FLAG_TXVLAN, &off_flags_unwanted },
{ "ntuple", CMDL_FLAG, &off_flags_wanted, NULL,
ETH_FLAG_NTUPLE, &off_flags_unwanted },
{ "rxhash", CMDL_FLAG, &off_flags_wanted, NULL,
@@ -1732,7 +1738,8 @@ static int dump_coalesce(void)
}
static int dump_offload(int rx, int tx, int sg, int tso, int ufo, int gso,
- int gro, int lro, int ntuple, int rxhash)
+ int gro, int lro, int rxvlan, int txvlan, int ntuple,
+ int rxhash)
{
fprintf(stdout,
"rx-checksumming: %s\n"
@@ -1743,6 +1750,8 @@ static int dump_offload(int rx, int tx, int sg, int tso, int ufo, int gso,
"generic-segmentation-offload: %s\n"
"generic-receive-offload: %s\n"
"large-receive-offload: %s\n"
+ "rx-vlan-offload: %s\n"
+ "tx-vlan-offload: %s\n"
"ntuple-filters: %s\n"
"receive-hashing: %s\n",
rx ? "on" : "off",
@@ -1753,6 +1762,8 @@ static int dump_offload(int rx, int tx, int sg, int tso, int ufo, int gso,
gso ? "on" : "off",
gro ? "on" : "off",
lro ? "on" : "off",
+ rxvlan ? "on" : "off",
+ txvlan ? "on" : "off",
ntuple ? "on" : "off",
rxhash ? "on" : "off");
@@ -2075,7 +2086,8 @@ static int do_goffload(int fd, struct ifreq *ifr)
{
struct ethtool_value eval;
int err, allfail = 1, rx = 0, tx = 0, sg = 0;
- int tso = 0, ufo = 0, gso = 0, gro = 0, lro = 0, ntuple = 0, rxhash = 0;
+ int tso = 0, ufo = 0, gso = 0, gro = 0, lro = 0, rxvlan = 0, txvlan = 0,
+ ntuple = 0, rxhash = 0;
fprintf(stdout, "Offload parameters for %s:\n", devname);
@@ -2146,6 +2158,8 @@ static int do_goffload(int fd, struct ifreq *ifr)
perror("Cannot get device flags");
} else {
lro = (eval.data & ETH_FLAG_LRO) != 0;
+ rxvlan = (eval.data & ETH_FLAG_RXVLAN) != 0;
+ txvlan = (eval.data & ETH_FLAG_TXVLAN) != 0;
ntuple = (eval.data & ETH_FLAG_NTUPLE) != 0;
rxhash = (eval.data & ETH_FLAG_RXHASH) != 0;
allfail = 0;
@@ -2166,7 +2180,8 @@ static int do_goffload(int fd, struct ifreq *ifr)
return 83;
}
- return dump_offload(rx, tx, sg, tso, ufo, gso, gro, lro, ntuple, rxhash);
+ return dump_offload(rx, tx, sg, tso, ufo, gso, gro, lro, rxvlan, txvlan,
+ ntuple, rxhash);
}
static int do_soffload(int fd, struct ifreq *ifr)
--
1.7.1
^ permalink raw reply related
* [PATCH 00/10] Remove multiple uses of KERN_<level>
From: Joe Perches @ 2010-10-26 2:44 UTC (permalink / raw)
To: Jiri Kosina
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
x86-DgEjT+Ai2ygdnm+yROfE0A, Chas Williams, Jiri Kosina,
Tom Tucker, Steve Wise, Roland Dreier, Sean Hefty, Hal Rosenstock,
Alessandro Rubini, Dmitry Torokhov, Mauro Carvalho Chehab,
James E.J. Bottomley, David Brown, Daniel Walker, Bryan Huntsman,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-atm-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-media-u79uwXL29TY76Z2rM5mHXA, linux-s
Found using strings vmlinux | grep "^<.>.*<.>"
and a couple of other cleanups of logging message format strings.
Joe Perches (10):
arch/x86/kernel/apic/io_apic.c: Typo fix WARNING
drivers/atm/eni.c: Remove multiple uses of KERN_<level>
drivers/hid/hid-input.c: Remove KERN_DEBUG from dbg_hid use
drivers/infiniband: Remove unnecessary KERN_<level> uses
drivers/input/mouse/appletouch.c: Remove KERN_DEBUG use from dprintk
drivers/input/serio/i8042: Use pr_<level>, pr_fmt. Fix dbg and __FILE__ use
drivers/media: Removed unnecessary KERN_<level>s from dprintk uses
drivers/scsi:mvsas/mv_sas.c: Remove KERN_DEBUG from mv_dprintk use
drivers/video/msm/mddi.c: Remove multiple KERN_<level> uses
fs/proc/vmcore.c: Use pr_<level> and pr_<fmt>
arch/x86/kernel/apic/io_apic.c | 2 +-
drivers/atm/eni.c | 7 +-
drivers/hid/hid-input.c | 2 +-
drivers/infiniband/hw/amso1100/c2_intr.c | 4 +-
drivers/infiniband/hw/cxgb3/iwch_cm.c | 4 +-
drivers/infiniband/hw/cxgb4/cm.c | 4 +-
drivers/input/mouse/appletouch.c | 2 +-
drivers/input/serio/i8042.c | 94 ++++++++++++-------------
drivers/input/serio/i8042.h | 19 +++--
drivers/media/common/tuners/max2165.c | 10 +--
drivers/media/dvb/frontends/atbm8830.c | 8 +--
drivers/media/dvb/frontends/lgs8gxx.c | 11 +--
drivers/media/video/saa7134/saa7134-input.c | 2 +-
drivers/media/video/saa7134/saa7134-tvaudio.c | 12 ++--
drivers/scsi/mvsas/mv_sas.c | 2 +-
drivers/video/msm/mddi.c | 5 +-
fs/proc/vmcore.c | 16 ++---
17 files changed, 97 insertions(+), 107 deletions(-)
--
1.7.3.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 02/10] drivers/atm/eni.c: Remove multiple uses of KERN_<level>
From: Joe Perches @ 2010-10-26 2:44 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Chas Williams, linux-atm-general, netdev, linux-kernel
In-Reply-To: <cover.1288059486.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/atm/eni.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 80f9f36..97c5898 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -1736,9 +1736,10 @@ static int __devinit eni_do_init(struct atm_dev *dev)
eprom = (base+EPROM_SIZE-sizeof(struct midway_eprom));
if (readl(&eprom->magic) != ENI155_MAGIC) {
printk("\n");
- printk(KERN_ERR KERN_ERR DEV_LABEL "(itf %d): bad "
- "magic - expected 0x%x, got 0x%x\n",dev->number,
- ENI155_MAGIC,(unsigned) readl(&eprom->magic));
+ printk(KERN_ERR DEV_LABEL
+ "(itf %d): bad magic - expected 0x%x, got 0x%x\n",
+ dev->number, ENI155_MAGIC,
+ (unsigned)readl(&eprom->magic));
error = -EINVAL;
goto unmap;
}
--
1.7.3.dirty
^ permalink raw reply related
* Re: [PATCH] Add support for new VLAN acceleration model
From: David Dillow @ 2010-10-26 2:48 UTC (permalink / raw)
To: Jesse Gross; +Cc: netdev, jgarzik, davem
In-Reply-To: <AANLkTi=kYH2NLMChuzd=OF6TPyn8FPJaRLfBg7z1gcYq@mail.gmail.com>
On Mon, 2010-10-25 at 19:22 -0700, Jesse Gross wrote:
> On Sun, Oct 24, 2010 at 1:24 PM, David Dillow <dave@thedillows.org> wrote:
> > Signed-off-by: David Dillow <dave@thedillows.org>
> > ---
> > I used this during testing of the typhoon conversion.
>
> Oops, I have a nearly identical patch that I should have sent out
> earlier to make everyone's lives easier.
Would have saved me a few minutes, but don't sweat it -- it took me
forever to figure out that my WRT54G was stripping VLAN tags, making it
look like the driver had been broken for quite some time...
As for the credit, I'm not at all concerned; I think I like your patch
better anyway.
^ permalink raw reply
* [PATCH 36/43] MN10300: ASB2364: Add support for SMSC911X and SMC911X
From: David Howells @ 2010-10-26 2:56 UTC (permalink / raw)
To: linux-am33-list
Cc: steve.glendinning, netdev, linux-kernel, Akira Takeuchi,
Kiyoshi Owada
In-Reply-To: <20101026025301.23512.24525.stgit@warthog.procyon.org.uk>
From: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Add support for SMSC911X and SMC911X for the ASB2364 unit.
Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: steve.glendinning@smsc.com
cc: netdev@vger.kernel.org
---
arch/mn10300/Kconfig | 1
arch/mn10300/include/asm/smsc911x.h | 1
arch/mn10300/unit-asb2364/Makefile | 2
arch/mn10300/unit-asb2364/include/unit/smsc911x.h | 198 +++++++++++++++++++++
arch/mn10300/unit-asb2364/smsc911x.c | 58 ++++++
drivers/net/Kconfig | 12 +
drivers/net/smsc911x.c | 7 +
drivers/net/smsc911x.h | 17 ++
8 files changed, 292 insertions(+), 4 deletions(-)
create mode 100644 arch/mn10300/include/asm/smsc911x.h
create mode 100644 arch/mn10300/unit-asb2364/include/unit/smsc911x.h
create mode 100644 arch/mn10300/unit-asb2364/smsc911x.c
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 81e2781..88901a2 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -96,6 +96,7 @@ config MN10300_UNIT_ASB2305
config MN10300_UNIT_ASB2364
bool "ASB2364"
+ select SMSC911X_ARCH_HOOKS if SMSC911X
endchoice
diff --git a/arch/mn10300/include/asm/smsc911x.h b/arch/mn10300/include/asm/smsc911x.h
new file mode 100644
index 0000000..2fcd108
--- /dev/null
+++ b/arch/mn10300/include/asm/smsc911x.h
@@ -0,0 +1 @@
+#include <unit/smsc911x.h>
diff --git a/arch/mn10300/unit-asb2364/Makefile b/arch/mn10300/unit-asb2364/Makefile
index 6dd27d6..2fdd99b 100644
--- a/arch/mn10300/unit-asb2364/Makefile
+++ b/arch/mn10300/unit-asb2364/Makefile
@@ -7,4 +7,4 @@
#
# Note 2! The CFLAGS definitions are now in the main makefile...
-obj-y := unit-init.o leds.o
+obj-y := unit-init.o leds.o smsc911x.o
diff --git a/arch/mn10300/unit-asb2364/include/unit/smsc911x.h b/arch/mn10300/unit-asb2364/include/unit/smsc911x.h
new file mode 100644
index 0000000..1d3bcdf
--- /dev/null
+++ b/arch/mn10300/unit-asb2364/include/unit/smsc911x.h
@@ -0,0 +1,198 @@
+/* Support for the SMSC911x NIC
+ *
+ * Copyright (C) 2006 Matsushita Electric Industrial Co., Ltd.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#ifndef _ASM_UNIT_SMSC911X_H
+#define _ASM_UNIT_SMSC911X_H
+
+#include <linux/netdevice.h>
+#include <proc/irq.h>
+#include <unit/fpga-regs.h>
+
+#define MN10300_USE_EXT_EEPROM
+
+
+#define SMSC911X_BASE 0xA8000000UL
+#define SMSC911X_BASE_END 0xA8000100UL
+#define SMSC911X_IRQ XIRQ1
+
+/*
+ * Control the FPGA PIC control regs for the SMSC911x chipset
+ */
+#undef SMSC_INITIALIZE
+#undef SMSC_CHECK_INTERRUPT
+#undef SMSC_CLEAR_INTERRUPT
+#undef SMSC_SET_INTERRUPT_MASK
+#undef SMSC_CLEAR_INTERRUPT_MASK
+
+#define SMSC_INITIALIZE() \
+do { \
+ /* release reset */ \
+ ASB2364_FPGA_REG_RESET_LAN = 0x0001; \
+ SyncExBus(); \
+} while (0)
+
+#define SMSC_CHECK_INTERRUPT() \
+do { \
+ if ((ASB2364_FPGA_REG_IRQ_LAN & 0x0001) == 0x0001) \
+ return IRQ_NONE; \
+} while (0)
+
+#define SMSC_CLEAR_INTERRUPT() \
+do { \
+ ASB2364_FPGA_REG_IRQ_LAN = 0x0001; \
+ SyncExBus(); \
+} while (0)
+
+#define SMSC_SET_INTERRUPT_MASK() \
+do { \
+ ASB2364_FPGA_REG_MASK_LAN = 0x0001; \
+ SyncExBus(); \
+} while (0)
+
+#define SMSC_CLEAR_INTERRUPT_MASK() \
+do { \
+ ASB2364_FPGA_REG_MASK_LAN = 0x0000; \
+ SyncExBus(); \
+} while (0)
+
+
+#ifdef MN10300_USE_EXT_EEPROM
+#include <linux/delay.h>
+#include <unit/clock.h>
+
+#define EEPROM_ADDRESS 0xA0
+#define MAC_OFFSET 0x0008
+#define USE_IIC_CH 0 /* 0 or 1 */
+#define IIC_OFFSET (0x80000 * USE_IIC_CH)
+#define IIC_DTRM __SYSREG(0xd8400000 + IIC_OFFSET, u32)
+#define IIC_DREC __SYSREG(0xd8400004 + IIC_OFFSET, u32)
+#define IIC_MYADD __SYSREG(0xd8400008 + IIC_OFFSET, u32)
+#define IIC_CLK __SYSREG(0xd840000c + IIC_OFFSET, u32)
+#define IIC_BRST __SYSREG(0xd8400010 + IIC_OFFSET, u32)
+#define IIC_HOLD __SYSREG(0xd8400014 + IIC_OFFSET, u32)
+#define IIC_BSTS __SYSREG(0xd8400018 + IIC_OFFSET, u32)
+#define IIC_ICR __SYSREG(0xd4000080 + 4 * USE_IIC_CH, u16)
+
+#define IIC_CLK_PLS ((unsigned short)(MN10300_IOCLK / 100000 - 1))
+#define IIC_CLK_LOW ((unsigned short)(IIC_CLK_PLS / 2))
+
+#define SYS_IIC_DTRM_Bit_STA ((unsigned short)0x0400)
+#define SYS_IIC_DTRM_Bit_STO ((unsigned short)0x0200)
+#define SYS_IIC_DTRM_Bit_ACK ((unsigned short)0x0100)
+#define SYS_IIC_DTRM_Bit_DATA ((unsigned short)0x00FF)
+
+static inline void POLL_INT_REQ(volatile u16 *icr)
+{
+ unsigned long flags;
+ u16 tmp;
+
+ while (!(*icr & GxICR_REQUEST))
+ ;
+ flags = arch_local_cli_save();
+ tmp = *icr;
+ *icr = (tmp & GxICR_LEVEL) | GxICR_DETECT;
+ tmp = *icr;
+ arch_local_irq_restore(flags);
+}
+
+#undef smsc_get_mac
+static inline int smsc_get_mac(struct net_device *dev)
+{
+ unsigned char *mac_buf = dev->dev_addr;
+ int i;
+ unsigned short value;
+ unsigned int data;
+ int mac_length = 6;
+ int check;
+ u16 orig_gicr, tmp;
+ unsigned long flags;
+
+ /* save original GnICR and clear GnICR.IE */
+ flags = arch_local_cli_save();
+ orig_gicr = IIC_ICR;
+ IIC_ICR = orig_gicr & GxICR_LEVEL;
+ tmp = IIC_ICR;
+ arch_local_irq_restore(flags);
+
+ IIC_MYADD = 0x00000008;
+ IIC_CLK = (IIC_CLK_LOW << 16) + (IIC_CLK_PLS);
+ /* bus hung recovery */
+
+ while (1) {
+ check = 0;
+ for (i = 0; i < 3; i++) {
+ if ((IIC_BSTS & 0x00000003) == 0x00000003)
+ check++;
+ udelay(3);
+ }
+
+ if (check == 3) {
+ IIC_BRST = 0x00000003;
+ break;
+ } else {
+ for (i = 0; i < 3; i++) {
+ IIC_BRST = 0x00000002;
+ udelay(8);
+ IIC_BRST = 0x00000003;
+ udelay(8);
+ }
+ }
+ }
+
+ IIC_BRST = 0x00000002;
+ IIC_BRST = 0x00000003;
+
+ value = SYS_IIC_DTRM_Bit_STA | SYS_IIC_DTRM_Bit_ACK;
+ value |= (((unsigned short)EEPROM_ADDRESS & SYS_IIC_DTRM_Bit_DATA) |
+ (unsigned short)0x0000);
+ IIC_DTRM = value;
+ POLL_INT_REQ(&IIC_ICR);
+
+ /** send offset of MAC address in EEPROM **/
+ IIC_DTRM = (unsigned char)((MAC_OFFSET & 0xFF00) >> 8);
+ POLL_INT_REQ(&IIC_ICR);
+
+ IIC_DTRM = (unsigned char)(MAC_OFFSET & 0x00FF);
+ POLL_INT_REQ(&IIC_ICR);
+
+ udelay(1000);
+
+ value = SYS_IIC_DTRM_Bit_STA;
+ value |= (((unsigned short)EEPROM_ADDRESS & SYS_IIC_DTRM_Bit_DATA) |
+ (unsigned short)0x0001);
+ IIC_DTRM = value;
+ POLL_INT_REQ(&IIC_ICR);
+
+ IIC_DTRM = 0x00000000;
+ while (mac_length > 0) {
+ POLL_INT_REQ(&IIC_ICR);
+
+ data = IIC_DREC;
+ mac_length--;
+ if (mac_length == 0)
+ value = 0x00000300; /* stop IIC bus */
+ else if (mac_length == 1)
+ value = 0x00000100; /* no ack */
+ else
+ value = 0x00000000; /* ack */
+ IIC_DTRM = value;
+ *mac_buf++ = (unsigned char)(data & 0xff);
+ }
+
+ /* restore GnICR.LV and GnICR.IE */
+ flags = arch_local_cli_save();
+ IIC_ICR = (orig_gicr & (GxICR_LEVEL | GxICR_ENABLE));
+ tmp = IIC_ICR;
+ arch_local_irq_restore(flags);
+
+ return 0;
+}
+#endif /* MN10300_USE_EXT_EEPROM */
+#endif /* _ASM_UNIT_SMSC911X_H */
diff --git a/arch/mn10300/unit-asb2364/smsc911x.c b/arch/mn10300/unit-asb2364/smsc911x.c
new file mode 100644
index 0000000..544a73e
--- /dev/null
+++ b/arch/mn10300/unit-asb2364/smsc911x.c
@@ -0,0 +1,58 @@
+/* Specification for the SMSC911x NIC
+ *
+ * Copyright (C) 2006 Matsushita Electric Industrial Co., Ltd.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/smsc911x.h>
+#include <unit/smsc911x.h>
+
+static struct smsc911x_platform_config smsc911x_config = {
+ .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+ .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+ .flags = SMSC911X_USE_32BIT,
+};
+
+static struct resource smsc911x_resources[] = {
+ [0] = {
+ .start = SMSC911X_BASE,
+ .end = SMSC911X_BASE_END,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = SMSC911X_IRQ,
+ .end = SMSC911X_IRQ,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device smsc911x_device = {
+ .name = "smsc911x",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(smsc911x_resources),
+ .resource = smsc911x_resources,
+ .dev = {
+ .platform_data = &smsc911x_config,
+ }
+};
+
+/*
+ * add platform devices
+ */
+static int __init unit_device_init(void)
+{
+ platform_device_register(&smsc911x_device);
+ return 0;
+}
+
+device_initcall(unit_device_init);
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 86fe67f..9334539 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1041,7 +1041,7 @@ config SMC911X
tristate "SMSC LAN911[5678] support"
select CRC32
select MII
- depends on ARM || SUPERH
+ depends on ARM || SUPERH || MN10300
help
This is a driver for SMSC's LAN911x series of Ethernet chipsets
including the new LAN9115, LAN9116, LAN9117, and LAN9118.
@@ -1055,7 +1055,7 @@ config SMC911X
config SMSC911X
tristate "SMSC LAN911x/LAN921x families embedded ethernet support"
- depends on ARM || SUPERH || BLACKFIN || MIPS
+ depends on ARM || SUPERH || BLACKFIN || MIPS || MN10300
select CRC32
select MII
select PHYLIB
@@ -1067,6 +1067,14 @@ config SMSC911X
<file:Documentation/networking/net-modules.txt>. The module
will be called smsc911x.
+config SMSC911X_ARCH_HOOKS
+ def_bool n
+ depends on SMSC911X
+ help
+ If the arch enables this, it allows the arch to implement various
+ hooks for more comprehensive interrupt control and also to override
+ the source of the MAC address.
+
config NET_VENDOR_RACAL
bool "Racal-Interlan (Micom) NI cards"
depends on ISA
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index a8e5856..54b55c1 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1456,6 +1456,7 @@ static irqreturn_t smsc911x_irqhandler(int irq, void *dev_id)
int serviced = IRQ_NONE;
u32 temp;
+ SMSC_CHECK_INTERRUPT();
if (unlikely(intsts & inten & INT_STS_SW_INT_)) {
temp = smsc911x_reg_read(pdata, INT_EN);
temp &= (~INT_EN_SW_INT_EN_);
@@ -1506,6 +1507,7 @@ static irqreturn_t smsc911x_irqhandler(int irq, void *dev_id)
serviced = IRQ_HANDLED;
}
+ SMSC_CLEAR_INTERRUPT();
return serviced;
}
@@ -1931,6 +1933,7 @@ static int __devexit smsc911x_drv_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
unregister_netdev(dev);
+ SMSC_SET_INTERRUPT_MASK();
free_irq(dev->irq, dev);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"smsc911x-memory");
@@ -2042,6 +2045,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
"Unable to claim requested irq: %d", dev->irq);
goto out_unmap_io_3;
}
+ SMSC_CLEAR_INTERRUPT_MASK();
platform_set_drvdata(pdev, dev);
@@ -2075,7 +2079,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
} else {
/* Try reading mac address from device. if EEPROM is present
* it will already have been set */
- smsc911x_read_mac_address(dev);
+ smsc_get_mac(dev);
if (is_valid_ether_addr(dev->dev_addr)) {
/* eeprom values are valid so use them */
@@ -2176,6 +2180,7 @@ static struct platform_driver smsc911x_driver = {
/* Entry point for loading the module */
static int __init smsc911x_init_module(void)
{
+ SMSC_INITIALIZE();
return platform_driver_register(&smsc911x_driver);
}
diff --git a/drivers/net/smsc911x.h b/drivers/net/smsc911x.h
index 016360c..14a7087 100644
--- a/drivers/net/smsc911x.h
+++ b/drivers/net/smsc911x.h
@@ -394,4 +394,21 @@
#define LPA_PAUSE_ALL (LPA_PAUSE_CAP | \
LPA_PAUSE_ASYM)
+/*
+ * Provide hooks to let the arch implement more comprehensive interrupt control
+ * and to override the source of the MAC address.
+ */
+#define SMSC_INITIALIZE() do {} while (0)
+#define SMSC_CHECK_INTERRUPT() do {} while (0)
+#define SMSC_CLEAR_INTERRUPT() do {} while (0)
+#define SMSC_SET_INTERRUPT_MASK() do {} while (0)
+#define SMSC_CLEAR_INTERRUPT_MASK() do {} while (0)
+#define smsc_get_mac(dev) smsc911x_read_mac_address((dev))
+
+#ifdef CONFIG_SMSC911X_ARCH_HOOKS
+#include <asm/smsc911x.h>
+#endif
+
+
+
#endif /* __SMSC911X_H__ */
^ permalink raw reply related
* [PATCH] net/unix: Allow Unix sockets to be treated like normal files.
From: Jeff Hansen @ 2010-10-26 4:21 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jeff Hansen
This allows Unix sockets to be opened, written, read, and closed, like
normal files. This can be especially handy from, for example, a shell
script that wants to send a short message to a Unix socket, but doesn't
want to and/or cannot create the socket itself.
This will try to open the Unix socket first in SOCK_DGRAM mode, then
SOCK_STREAM mode if that fails.
Signed-off-by: Jeff Hansen <x@jeffhansen.com>
---
net/unix/Kconfig | 10 +++++
net/unix/af_unix.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 123 insertions(+), 0 deletions(-)
diff --git a/net/unix/Kconfig b/net/unix/Kconfig
index 5a69733..68df4f1 100644
--- a/net/unix/Kconfig
+++ b/net/unix/Kconfig
@@ -19,3 +19,13 @@ config UNIX
Say Y unless you know what you are doing.
+config UNIX_FOPS
+ boolean "Allow Unix sockets to be treated like normal files"
+ depends on UNIX
+ ---help---
+ If you say Y here, Unix sockets may be opened, written, read, and
+ closed, like normal files. This is handy for sending short commands
+ to Unix sockets (i.e. from shell scripts), without having to create
+ a Unix socket.
+
+ Say Y unless you know what you are doing.
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 0ebc777..b5a6655 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -798,6 +798,114 @@ fail:
return NULL;
}
+#ifdef CONFIG_UNIX_FOPS
+static int unix_open(struct inode *inode, struct file *filp)
+{
+ int err;
+ struct socket *sock = NULL;
+ struct dentry *dentry = filp->f_dentry;
+ struct sockaddr_un sunaddr = { 0 };
+ char *p;
+
+ if (!filp)
+ return -ENXIO;
+ dentry = filp->f_dentry;
+
+ if (!dentry || !dentry->d_parent)
+ return -ENXIO;
+
+ if (filp->private_data)
+ return -EBUSY;
+
+ sunaddr.sun_family = AF_UNIX;
+ p = d_path(&filp->f_path, sunaddr.sun_path, sizeof(sunaddr.sun_path));
+ if (IS_ERR(p))
+ return PTR_ERR(p);
+ memmove(sunaddr.sun_path, p, p[sizeof(sunaddr.sun_path) - 1] ?
+ sizeof(sunaddr.sun_path) : strlen(p));
+
+ err = sock_create(PF_UNIX, SOCK_DGRAM, 0, &sock);
+ if (err)
+ return err;
+
+ err = unix_dgram_connect(sock, (struct sockaddr *)&sunaddr,
+ sizeof(sunaddr), 0);
+ if (err) {
+ sock_release(sock);
+
+ err = sock_create(PF_UNIX, SOCK_STREAM, 0, &sock);
+ if (err)
+ return err;
+
+ err = unix_stream_connect(sock, (struct sockaddr *)&sunaddr,
+ sizeof(sunaddr), 0);
+
+ if (err)
+ return err;
+ }
+ filp->private_data = sock;
+
+ return err;
+}
+
+static int unix_frelease(struct inode *inode, struct file *filp)
+{
+ if (!filp->private_data)
+ return -ENXIO;
+
+ sock_release(filp->private_data);
+ filp->private_data = NULL;
+ return 0;
+}
+
+static ssize_t unix_readwrite(struct file *filp, void *buf,
+ size_t _len, loff_t *ppos, int do_write)
+{
+ struct socket *sock = filp->private_data;
+ int len = (int)_len, err;
+ struct kvec iov = {
+ .iov_base = buf,
+ .iov_len = len,
+ };
+ struct msghdr msg = {
+ /* NB: struct iovec and kvec are equal */
+ .msg_iov = (struct iovec *)&iov,
+ .msg_iovlen = 1,
+ };
+
+ if (!sock)
+ return -ENXIO;
+ if (_len > 0xffffffffLL)
+ return -E2BIG;
+
+ err = do_write ? sock_sendmsg(sock, &msg, len) :
+ sock_recvmsg(sock, &msg, len, 0);
+ if (err > 0 && ppos)
+ *ppos += err;
+
+ return err;
+}
+
+static ssize_t unix_write(struct file *filp, const char __user *buf,
+ size_t _len, loff_t *ppos)
+{
+ return unix_readwrite(filp, (void *)buf, _len, ppos, 0);
+}
+
+static ssize_t unix_read(struct file *filp, const char __user *buf,
+ size_t _len, loff_t *ppos)
+{
+ return unix_readwrite(filp, (void *)buf, _len, ppos, 0);
+}
+
+const struct file_operations unix_sock_fops = {
+ .owner = THIS_MODULE,
+ .open = unix_open,
+ .release = unix_frelease,
+ .write = unix_write,
+ .read = unix_read,
+};
+#endif /* CONFIG_UNIX_FOPS */
static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
@@ -874,6 +982,11 @@ out_mknod_drop_write:
mnt_drop_write(nd.path.mnt);
if (err)
goto out_mknod_dput;
+
+#ifdef CONFIG_UNIX_FOPS
+ dentry->d_inode->i_fop = &unix_sock_fops;
+#endif
+
mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
dput(nd.path.dentry);
nd.path.dentry = dentry;
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] ipv6: addrconf: clear IPv6 addresses and routes when losing link
From: Stephen Hemminger @ 2010-10-26 4:38 UTC (permalink / raw)
To: Lorenzo Colitti; +Cc: netdev
In-Reply-To: <AANLkTikC4pv8aOODM2pOg2bKQGL69wivcUU3f9ZziPhe@mail.gmail.com>
On Mon, 25 Oct 2010 19:08:27 -0700
Lorenzo Colitti <lorenzo@google.com> wrote:
> When roaming between different networks (e.g., changing wireless
> SSIDs, or plugging in to different wired networks), IPv6 addresses and
> routes are not cleared. If the two networks have different IPv6
> subnets assigned, the host maintains both the old and new IPv6
> addresses and gateways, but only the new ones works. If the host
> chooses the wrong source address or gateway, or if the new network
> does not have IPv6 but the old one did, IPv6 connections time out,
> leading to long delays when trying to connect to IPv6 hosts.
>
> Fix this by ensuring that autoconfigured IPv6 addresses and routes are
> purged when link is lost, not only when the interface goes down.
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
>
> --- a/net/ipv6/addrconf.c 2010-10-20 13:30:22.000000000 -0700
> +++ b/net/ipv6/addrconf.c 2010-10-25 13:55:15.000000000 -0700
> @@ -2524,6 +2524,14 @@
> } else {
> if (!addrconf_qdisc_ok(dev)) {
> /* device is still not ready. */
> + if (idev && (idev->if_flags & IF_READY)) {
> + /* Link lost. Clear addresses and
> + routes, the device might come back
> + on a link where they are no longer
> + valid. */
> + addrconf_ifdown(dev, 0);
> + idev->if_flags &= ~IF_READY;
> + }
> break;
> }
This is incorrect. When link is lost, routes and address should not be
flushed. They should be marked as tentative and then go through DAD again
on the new network.
If you do it this way, you break routing protocols when link is brought
down and back up.
^ permalink raw reply
* [net-next] stmmac: enable/disable rx/tx in the core with a single write.
From: Giuseppe CAVALLARO @ 2010-10-26 4:58 UTC (permalink / raw)
To: netdev; +Cc: avisconti
From: avisconti <armando.visconti@st.com>
This patch enables and disables the rx and tx bits in the MAC control reg
by using a single write operation.
This also solves a possible problem (spotted on SPEAr platforms) at 10Mbps
where two consecutive writes to a MAC control register can take more than
4 phy_clk cycles.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/stmmac/stmmac_main.c | 40 +++++++++----------------------------
1 files changed, 10 insertions(+), 30 deletions(-)
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index 823b9e6..06bc603 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -337,33 +337,19 @@ static int stmmac_init_phy(struct net_device *dev)
return 0;
}
-static inline void stmmac_mac_enable_rx(void __iomem *ioaddr)
+static inline void stmmac_enable_mac(void __iomem *ioaddr)
{
u32 value = readl(ioaddr + MAC_CTRL_REG);
- value |= MAC_RNABLE_RX;
- /* Set the RE (receive enable bit into the MAC CTRL register). */
- writel(value, ioaddr + MAC_CTRL_REG);
-}
-static inline void stmmac_mac_enable_tx(void __iomem *ioaddr)
-{
- u32 value = readl(ioaddr + MAC_CTRL_REG);
- value |= MAC_ENABLE_TX;
- /* Set the TE (transmit enable bit into the MAC CTRL register). */
+ value |= MAC_RNABLE_RX | MAC_ENABLE_TX;
writel(value, ioaddr + MAC_CTRL_REG);
}
-static inline void stmmac_mac_disable_rx(void __iomem *ioaddr)
+static inline void stmmac_disable_mac(void __iomem *ioaddr)
{
u32 value = readl(ioaddr + MAC_CTRL_REG);
- value &= ~MAC_RNABLE_RX;
- writel(value, ioaddr + MAC_CTRL_REG);
-}
-static inline void stmmac_mac_disable_tx(void __iomem *ioaddr)
-{
- u32 value = readl(ioaddr + MAC_CTRL_REG);
- value &= ~MAC_ENABLE_TX;
+ value &= ~(MAC_ENABLE_TX | MAC_RNABLE_RX);
writel(value, ioaddr + MAC_CTRL_REG);
}
@@ -857,8 +843,7 @@ static int stmmac_open(struct net_device *dev)
writel(0xffffffff, priv->ioaddr + MMC_LOW_INTR_MASK);
/* Enable the MAC Rx/Tx */
- stmmac_mac_enable_rx(priv->ioaddr);
- stmmac_mac_enable_tx(priv->ioaddr);
+ stmmac_enable_mac(priv->ioaddr);
/* Set the HW DMA mode and the COE */
stmmac_dma_operation_mode(priv);
@@ -928,9 +913,8 @@ static int stmmac_release(struct net_device *dev)
/* Release and free the Rx/Tx resources */
free_dma_desc_resources(priv);
- /* Disable the MAC core */
- stmmac_mac_disable_tx(priv->ioaddr);
- stmmac_mac_disable_rx(priv->ioaddr);
+ /* Disable the MAC Rx/Tx */
+ stmmac_disable_mac(priv->ioaddr);
netif_carrier_off(dev);
@@ -1787,8 +1771,7 @@ static int stmmac_dvr_remove(struct platform_device *pdev)
priv->hw->dma->stop_rx(priv->ioaddr);
priv->hw->dma->stop_tx(priv->ioaddr);
- stmmac_mac_disable_rx(priv->ioaddr);
- stmmac_mac_disable_tx(priv->ioaddr);
+ stmmac_disable_mac(priv->ioaddr);
netif_carrier_off(ndev);
@@ -1839,13 +1822,11 @@ static int stmmac_suspend(struct platform_device *pdev, pm_message_t state)
dis_ic);
priv->hw->desc->init_tx_desc(priv->dma_tx, priv->dma_tx_size);
- stmmac_mac_disable_tx(priv->ioaddr);
-
/* Enable Power down mode by programming the PMT regs */
if (device_can_wakeup(priv->device))
priv->hw->mac->pmt(priv->ioaddr, priv->wolopts);
else
- stmmac_mac_disable_rx(priv->ioaddr);
+ stmmac_disable_mac(priv->ioaddr);
} else {
priv->shutdown = 1;
/* Although this can appear slightly redundant it actually
@@ -1886,8 +1867,7 @@ static int stmmac_resume(struct platform_device *pdev)
netif_device_attach(dev);
/* Enable the MAC and DMA */
- stmmac_mac_enable_rx(priv->ioaddr);
- stmmac_mac_enable_tx(priv->ioaddr);
+ stmmac_enable_mac(priv->ioaddr);
priv->hw->dma->start_tx(priv->ioaddr);
priv->hw->dma->start_rx(priv->ioaddr);
--
1.5.5.6
^ permalink raw reply related
* Re: linux-next: Tree for October 25 (netfilter/xt_socket)
From: David Miller @ 2010-10-26 5:02 UTC (permalink / raw)
To: randy.dunlap; +Cc: sfr, netdev, linux-next, linux-kernel, netfilter-devel
In-Reply-To: <20101025165407.74b0c0a0.randy.dunlap@oracle.com>
From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Mon, 25 Oct 2010 16:54:07 -0700
> xt_socket.c:(.text+0x39ff8): undefined reference to `ipv6_find_hdr'
> xt_socket.c:(.init.text+0x1703): undefined reference to `nf_defrag_ipv6_enable'
This ought to be fixed in net-2.6 already, by:
commit f6318e558806c925029dc101f14874be9f9fa78f
Author: KOVACS Krisztian <hidden@balabit.hu>
Date: Sun Oct 24 23:38:32 2010 +0000
netfilter: fix module dependency issues with IPv6 defragmentation, ip6tables and xt_TPROXY
One of the previous tproxy related patches split IPv6 defragmentation and
connection tracking, but did not correctly add Kconfig stanzas to handle the
new dependencies correctly. This patch fixes that by making the config options
mirror the setup we have for IPv4: a distinct config option for defragmentation
that is automatically selected by both connection tracking and
xt_TPROXY/xt_socket.
The patch also changes the #ifdefs enclosing IPv6 specific code in xt_socket
and xt_TPROXY: we only compile these in case we have ip6tables support enabled.
Signed-off-by: KOVACS Krisztian <hidden@balabit.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: linux-next: Tree for October 25 (netfilter/nf_conntrack_reasm)
From: David Miller @ 2010-10-26 5:03 UTC (permalink / raw)
To: randy.dunlap; +Cc: sfr, netfilter-devel, netdev, linux-next, linux-kernel
In-Reply-To: <20101025165529.9cedfeac.randy.dunlap@oracle.com>
From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Mon, 25 Oct 2010 16:55:29 -0700
> On Mon, 25 Oct 2010 14:58:34 +1100 Stephen Rothwell wrote:
>
>> Hi all,
>>
>> Reminder: do not add 2.6.38 destined stuff to linux-next until after
>> 2.6.37-rc1 is released.
>
> net/ipv6/netfilter/nf_conntrack_reasm.c:628: error: 'nf_ct_frag6_sysctl_header' undeclared (first use in this function)
> net/ipv6/netfilter/nf_conntrack_reasm.c:628: error: 'nf_net_netfilter_sysctl_path' undeclared (first use in this function)
> net/ipv6/netfilter/nf_conntrack_reasm.c:629: error: 'nf_ct_frag6_sysctl_table' undeclared (first use in this function)
> net/ipv6/netfilter/nf_conntrack_reasm.c:640: error: 'nf_ct_frag6_sysctl_header' undeclared (first use in this function)
>
>
> config file is attached.
Should also be fixed by the commit I just pointed you to.
^ permalink raw reply
* ath9k crashing the kernel
From: Jaswinder Singh @ 2010-10-26 5:06 UTC (permalink / raw)
To: Linux Kernel Mailing List, linux-wireless, netdev, ath9k-devel
Hello,
ath9k is crashing the kernel :
[ 21.276554] BUG: spinlock bad magic on CPU#1, NetworkManager/1056
[ 21.277015] lock: f5be80a8, .magic: 00000000, .owner: <none>/-1,
.owner_cpu: 0
[ 21.277015] Pid: 1056, comm: NetworkManager Not tainted 2.6.36-netbook+ #20
[ 21.277015] Call Trace:
[ 21.277015] [<c14767a7>] ? printk+0xf/0x11
[ 21.277015] [<c117b823>] spin_bug+0x7c/0x87
[ 21.301365] [<c117b8bd>] do_raw_spin_lock+0x1e/0x125
[ 21.301365] [<c1478d0a>] ? _raw_spin_unlock_bh+0x1a/0x1c
[ 21.301365] [<c1478dc3>] _raw_spin_lock_irqsave+0x17/0x1c
[ 21.318857] [<c1288a74>] ath9k_config+0x255/0x38b
[ 21.318857] [<c1447bdb>] ieee80211_hw_config+0x10a/0x114
[ 21.328034] [<c1453545>] ieee80211_do_open+0x3de/0x4cf
[ 21.328034] [<c1452206>] ? ieee80211_check_concurrent_iface+0x21/0x13a
[ 21.328034] [<c104c470>] ? raw_notifier_call_chain+0xc/0xe
[ 21.328034] [<c1453691>] ieee80211_open+0x5b/0x5e
[ 21.328034] [<c13947cf>] __dev_open+0x80/0xa9
[ 21.328034] [<c13920bb>] __dev_change_flags+0xa1/0x116
[ 21.328034] [<c1394723>] dev_change_flags+0x13/0x3f
[ 21.328034] [<c139d568>] do_setlink+0x226/0x507
[ 21.328034] [<c139d917>] rtnl_setlink+0xce/0xd4
[ 21.328034] [<c11786d2>] ? copy_to_user+0x3a/0x118
[ 21.328034] [<c139d849>] ? rtnl_setlink+0x0/0xd4
[ 21.328034] [<c139df4d>] rtnetlink_rcv_msg+0x17e/0x194
[ 21.328034] [<c139ddcf>] ? rtnetlink_rcv_msg+0x0/0x194
[ 21.328034] [<c13a59c4>] netlink_rcv_skb+0x30/0x76
[ 21.328034] [<c139ddc8>] rtnetlink_rcv+0x1b/0x22
[ 21.328034] [<c13a5772>] netlink_unicast+0x1aa/0x20b
[ 21.328034] [<c13a5eac>] netlink_sendmsg+0x22c/0x27a
[ 21.328034] [<c13862b8>] sock_sendmsg+0xa5/0xbb
[ 21.328034] [<c13862b8>] ? sock_sendmsg+0xa5/0xbb
[ 21.328034] [<c138e05b>] ? verify_iovec+0x3e/0x6b
[ 21.328034] [<c1386ab2>] sys_sendmsg+0x149/0x196
[ 21.328034] [<c10826f5>] ? unlock_page+0x40/0x43
[ 21.328034] [<c10952d5>] ? __do_fault+0x367/0x393
[ 21.328034] [<c1096b8e>] ? handle_mm_fault+0x3bd/0x77a
[ 21.328034] [<c10b6fb3>] ? destroy_inode+0x1f/0x30
[ 21.328034] [<c138694e>] ? sys_recvmsg+0x2b/0x46
[ 21.328034] [<c1387c00>] sys_socketcall+0x146/0x18b
[ 21.328034] [<c1002850>] sysenter_do_call+0x12/0x26
[ 21.344846] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 21.487994] atl1c 0000:03:00.0: irq 42 for MSI/MSI-X
[ 21.543870] ADDRCONF(NETDEV_UP): eth0: link is not ready
Linux 2.6.36 f6f94e2ab1 is good
and
229aebb873e2972 is bad
I am trying to bisect it but I am getting compilation error :
LD .tmp_vmlinux1
drivers/built-in.o: In function `ath_do_set_opmode':
/home/jaswinder/jaswinder-git/linux-2.6/drivers/net/wireless/ath/ath5k/base.c:567:
undefined reference to `ath_opmode_to_string'
/home/jaswinder/jaswinder-git/linux-2.6/drivers/net/wireless/ath/ath5k/base.c:568:
undefined reference to `ath_opmode_to_string'
make: *** [.tmp_vmlinux1] Error 1
[jaswinder@ linux-2.6]$
Thanks,
--
Jaswinder Singh.
^ permalink raw reply
* Re: [Uclinux-dist-devel] [PATCH 1/5] netdev: bfin_mac: push settings to platform resources
From: David Miller @ 2010-10-26 5:07 UTC (permalink / raw)
To: vapier; +Cc: netdev, uclinux-dist-devel
In-Reply-To: <AANLkTi=jfho4yd_gSMfKywBPkD_=smgnP_yLtRh=00jv@mail.gmail.com>
From: Mike Frysinger <vapier@gentoo.org>
Date: Mon, 25 Oct 2010 21:54:48 -0400
> On Sun, Oct 24, 2010 at 19:51, Mike Frysinger wrote:
>> On Sun, Oct 24, 2010 at 19:45, David Miller wrote:
>>> From: Mike Frysinger
>>>> and i have the Blackfin changes waiting for you to merge this patch.
>>>> i can squash them into this change and have you merge the result, or i
>>>> can merge it. i dont really care either way.
>>>
>>> Why don't you just apply this to your tree then. Feel free to add my:
>>
>> thanks, i'll do that
>
> Linus has taken this via my tree now. are you going to merge the
> other patches ? or do i need to resend them ?
Please resend them, thanks.
^ permalink raw reply
* Re: [v3 RFC PATCH 0/4] Implement multiqueue virtio-net
From: Krishna Kumar2 @ 2010-10-26 5:10 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: anthony, arnd, avi, davem, eric.dumazet, kvm, netdev, rusty
In-Reply-To: <20101025161718.GA19559@redhat.com>
"Michael S. Tsirkin" <mst@redhat.com> wrote on 10/25/2010 09:47:18 PM:
> > Any feedback, comments, objections, issues or bugs about the
> > patches? Please let me know if something needs to be done.
>
> I am trying to wrap my head around kernel/user interface here.
> E.g., will we need another incompatible change when we add multiple RX
> queues?
Though I added a 'mq' option to qemu, there shouldn't be
any incompatibility between old and new qemu's wrt vhost
and virtio-net drivers. So the old qemu will run new host
and new guest without issues, and new qemu can also run
old host and old guest. Multiple RXQ will also not add
any incompatibility.
With MQ RX, I will be able to remove the hueristic (idea
from David Stevens). The idea is: Guest sends out packets
on, say TXQ#2, vhost#2 processes the packets but packets
going out from host to guest might be sent out on a
different RXQ, say RXQ#4. Guest receives the packet on
RXQ#4, and all future responses on that connection are sent
on TXQ#4. Now vhost#4 processes both RX and TX packets for
this connection. Without needing to hash on the connection,
guest can make sure that the same vhost thread will handle
a single connection.
> Also need to think about how robust our single stream heuristic is,
> e.g. what are the chances it will misdetect a bidirectional
> UDP stream as a single TCP?
I think it should not happen. The hueristic code gets
called for handling just the transmit packets, packets
that vhost sends out to the guest skip this path.
I tested unidirectional and bidirectional UDP to confirm:
8 iterations of iperf tests, each iteration of 15 secs,
result is the sum of all 8 iterations in Gbits/sec
__________________________________________
Uni-directional Bi-directional
Org New Org New
__________________________________________
71.78 71.77 71.74 72.07
__________________________________________
Thanks,
- KK
^ permalink raw reply
* RE: [PATCH net-next-2.6 1/2] be2net: Adding an option to use INTx instead of MSI-X
From: Somnath.Kotur @ 2010-10-26 5:24 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20101025.162535.226782713.davem@davemloft.net>
Dave,
Could you pls ignore this patch and apply the next patch in the series ?
( PATCH 2/2] be2net: Schedule/Destroy worker thread in probe()/remove() rather than open()/close()
Thanks
Som
________________________________________
From: David Miller [davem@davemloft.net]
Sent: Tuesday, October 26, 2010 4:55 AM
To: bhutchings@solarflare.com
Cc: Kotur, Somnath; netdev@vger.kernel.org; linux-pci@vger.kernel.org
Subject: Re: [PATCH net-next-2.6 1/2] be2net: Adding an option to use INTx instead of MSI-X
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 25 Oct 2010 23:38:53 +0100
> David Miller wrote:
>> From: Somnath Kotur <somnath.kotur@emulex.com>
>> Date: Mon, 25 Oct 2010 16:42:35 +0530
>>
>> > By default, be2net uses MSIx wherever possible.
>> > Adding a module parameter to use INTx for users who do not want to use MSIx.
>> >
>> > Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
>>
>> Either add a new ethtool flag, or use the PCI subsystem facilities
>> for tweaking things to implement this.
>>
>> Do not use a module option, otherwise every other networking driver
>> author will get the same "cool" idea, give the module option
>> different names, and the resulting user experience is terrible.
>
> This has already happened, sadly. So far as I can see it's mostly done
> to allow users to work around systems with broken MSIs; I'm not aware of
> any other reason to prefer legacy interrupts. However, the PCI subsystem
> already implements a blacklist and a kernel parameter for disabling MSIs
> on these systems.
The PCI subsystem bits I'm totally fine with.
But in the drivers themselves, that's what I don't want.
^ permalink raw reply
* Re: [PATCH] ipv6: addrconf: clear IPv6 addresses and routes when losing link
From: Lorenzo Colitti @ 2010-10-26 5:44 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20101025213841.635b9a15@nehalam>
On Mon, Oct 25, 2010 at 9:38 PM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> This is incorrect. When link is lost, routes and address should not be
> flushed. They should be marked as tentative and then go through DAD again
> on the new network.
That won't help the case I am trying to fix, which is the case where
the new link has a global prefix different than the old link. Marking
the addresses as tentative will simply make them pass DAD and come
back as soon as link comes back. But since they don't match the prefix
that is assigned to the new link, they are unusable, because packets
can't be routed back to them.
> If you do it this way, you break routing protocols when link is brought
> down and back up.
The only addresses and routes flushed in this way should be ones that
aren't manually configured, i.e., the ones created by autoconf
(addrconf.c:2720 onwards). These won't be used by routing protocols,
except for link-local addresses. So I assume you're talking about
link-local here.
Link-local addresses are immediately recreated in a tentative state as
soon as link comes back, because on NETDEV_UP addrconf_notify calls
addrconf_dev_config. So, this patch only makes it so that they become
tentative when link goes away and comes back. In that time, the router
that temporarily loses link is unable to send packets for the brief
period of time that the link is performing DAD, but if the router has
lost link, it will also fail to send the packet while link is lost.
What's the additional failure scenario? Will it help if I make it so
that link-local addresses aren't touched at all?
^ permalink raw reply
* [PATCH] e1000e: add netpoll support for MSI/MSI-X IRQ modes
From: Dongdong Deng @ 2010-10-26 5:54 UTC (permalink / raw)
To: davem, jesse, jeffrey.t.kirsher, bruce.w.allan
Cc: alexander.h.duyck, carolyn.wyborny, donald.c.skidmore,
gregory.v.rose, peter.p.waskiewicz.jr, john.ronciak,
dongdong.deng, e1000-devel, netdev
With enabling CONFIG_PCI_MSI, e1000e could work in MSI/MSI-X IRQ mode,
and netpoll controller didn't deal with those IRQ modes on e1000e.
This patch add the handling MSI/MSI-X IRQ modes to netpoll controller,
so that netconsole could work with those IRQ modes.
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
---
drivers/net/e1000e/netdev.c | 49 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index e561d15..36992ba 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -5369,6 +5369,36 @@ static void e1000_shutdown(struct pci_dev *pdev)
}
#ifdef CONFIG_NET_POLL_CONTROLLER
+
+static irqreturn_t e1000_intr_msix(int irq, void *data)
+{
+ struct net_device *netdev = data;
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ int vector, msix_irq;
+
+ if (adapter->msix_entries) {
+ vector = 0;
+ msix_irq = adapter->msix_entries[vector].vector;
+ disable_irq(msix_irq);
+ e1000_intr_msix_rx(msix_irq, netdev);
+ enable_irq(msix_irq);
+
+ vector++;
+ msix_irq = adapter->msix_entries[vector].vector;
+ disable_irq(msix_irq);
+ e1000_intr_msix_tx(msix_irq, netdev);
+ enable_irq(msix_irq);
+
+ vector++;
+ msix_irq = adapter->msix_entries[vector].vector;
+ disable_irq(msix_irq);
+ e1000_msix_other(msix_irq, netdev);
+ enable_irq(msix_irq);
+ }
+
+ return IRQ_HANDLED;
+}
+
/*
* Polling 'interrupt' - used by things like netconsole to send skbs
* without having to re-enable interrupts. It's not called while
@@ -5378,10 +5408,21 @@ static void e1000_netpoll(struct net_device *netdev)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
- disable_irq(adapter->pdev->irq);
- e1000_intr(adapter->pdev->irq, netdev);
-
- enable_irq(adapter->pdev->irq);
+ switch (adapter->int_mode) {
+ case E1000E_INT_MODE_MSIX:
+ e1000_intr_msix(adapter->pdev->irq, netdev);
+ break;
+ case E1000E_INT_MODE_MSI:
+ disable_irq(adapter->pdev->irq);
+ e1000_intr_msi(adapter->pdev->irq, netdev);
+ enable_irq(adapter->pdev->irq);
+ break;
+ default: /* E1000E_INT_MODE_LEGACY */
+ disable_irq(adapter->pdev->irq);
+ e1000_intr(adapter->pdev->irq, netdev);
+ enable_irq(adapter->pdev->irq);
+ break;
+ }
}
#endif
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH 1/2 v3] xps: Improvements in TX queue selection
From: Helmut Schaa @ 2010-10-26 6:18 UTC (permalink / raw)
To: Tom Herbert; +Cc: davem, netdev, eric.dumazet
In-Reply-To: <alpine.DEB.1.00.1010211303390.30535@pokey.mtv.corp.google.com>
Hi,
Am Donnerstag 21 Oktober 2010 schrieb Tom Herbert:
> In dev_pick_tx, don't do work in calculating queue index or setting
> the index in the sock unless the device has more than one queue. This
> allows the sock to be set only with a queue index of a multi-queue
> device which is desirable if device are stacked like in a tunnel.
>
> We also allow the mapping of a socket to queue to be changed. To
> maintain in order packet transmission a flag (ooo_okay) has been
> added to the sk_buff structure. If a transport layer sets this flag
> on a packet, the transmit queue can be changed for the socket.
> Presumably, the transport would set this if there was no possbility
> of creating OOO packets (for instance, there are no packets in flight
> for the socket). This patch includes the modification in TCP output
> for setting this flag.
>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
[...]
> diff --git a/net/core/dev.c b/net/core/dev.c
> index b2269ac..a538ed5 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2123,28 +2123,32 @@ static struct netdev_queue *dev_pick_tx(struct net_device *dev,
> struct sk_buff *skb)
> {
> int queue_index;
> - const struct net_device_ops *ops = dev->netdev_ops;
>
> - if (ops->ndo_select_queue) {
> - queue_index = ops->ndo_select_queue(dev, skb);
> - queue_index = dev_cap_txqueue(dev, queue_index);
> - } else {
> + if (dev->real_num_tx_queues > 1) {
> struct sock *sk = skb->sk;
> +
> queue_index = sk_tx_queue_get(sk);
> - if (queue_index < 0) {
>
> - queue_index = 0;
> - if (dev->real_num_tx_queues > 1)
> + if (queue_index < 0 || skb->ooo_okay ||
> + queue_index >= dev->real_num_tx_queues) {
> + const struct net_device_ops *ops = dev->netdev_ops;
> + int old_index = queue_index;
> +
> + if (ops->ndo_select_queue) {
> + queue_index = ops->ndo_select_queue(dev, skb);
> + queue_index = dev_cap_txqueue(dev, queue_index);
> + } else
> queue_index = skb_tx_hash(dev, skb);
Wouldn't that break mac80211 QoS again for bridged AP mode interfaces (see
commit deabc772f39405054a438d711f408d2d94d26d96, "net: fix tx queue selection
for bridged devices implementing select_queue")?
Helmut
^ permalink raw reply
* Re: [PATCH net-next-2.6 1/2] be2net: Adding an option to use INTx instead of MSI-X
From: Michael Ellerman @ 2010-10-26 6:52 UTC (permalink / raw)
To: David Miller; +Cc: bhutchings, somnath.kotur, netdev, linux-pci
In-Reply-To: <20101025.162535.226782713.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 5022 bytes --]
On Mon, 2010-10-25 at 16:25 -0700, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Mon, 25 Oct 2010 23:38:53 +0100
>
> > David Miller wrote:
> >> From: Somnath Kotur <somnath.kotur@emulex.com>
> >> Date: Mon, 25 Oct 2010 16:42:35 +0530
> >>
> >> > By default, be2net uses MSIx wherever possible.
> >> > Adding a module parameter to use INTx for users who do not want to use MSIx.
> >> >
> >> > Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
> >>
> >> Either add a new ethtool flag, or use the PCI subsystem facilities
> >> for tweaking things to implement this.
> >>
> >> Do not use a module option, otherwise every other networking driver
> >> author will get the same "cool" idea, give the module option
> >> different names, and the resulting user experience is terrible.
> >
> > This has already happened, sadly. So far as I can see it's mostly done
> > to allow users to work around systems with broken MSIs; I'm not aware of
> > any other reason to prefer legacy interrupts. However, the PCI subsystem
> > already implements a blacklist and a kernel parameter for disabling MSIs
> > on these systems.
>
> The PCI subsystem bits I'm totally fine with.
>
> But in the drivers themselves, that's what I don't want.
That horse has really really bolted, it's gawn.
I count 26 drivers with "disable MSI/X" parameters. Some even have more
than one.
11 of them are network drivers, 9 scsi, 3 ata.
I agree it's a mess for users, but it's probably preferable to a
non-working driver.
Ethtool would be nice, but only for network drivers. Is there a generic
solution, quirks are obviously not keeping people happy.
cheers
MSI:
Param "msi", 10 users:
drivers/ata/sata_mv.c:MODULE_PARM_DESC(msi, "Enable use of PCI MSI (0=off, 1=on)");
drivers/ata/sata_nv.c:MODULE_PARM_DESC(msi, "Enable use of MSI (Default: false)");
drivers/ata/sata_sil24.c:MODULE_PARM_DESC(msi, "Enable MSI (Default: false)");
drivers/net/cxgb3/cxgb3_main.c:MODULE_PARM_DESC(msi, "whether to use MSI or MSI-X");
drivers/net/cxgb4/cxgb4_main.c:MODULE_PARM_DESC(msi, "whether to use INTx (0), MSI (1) or MSI-X (2)");
drivers/net/cxgb4vf/cxgb4vf_main.c:MODULE_PARM_DESC(msi, "whether to use MSI-X or MSI");
drivers/net/forcedeth.c:MODULE_PARM_DESC(msi, "MSI interrupts are enabled by setting to 1 and disabled by setting to 0.");
drivers/net/qla3xxx.c:MODULE_PARM_DESC(msi, "Turn on Message Signaled Interrupts.");
drivers/scsi/aacraid/aachba.c:MODULE_PARM_DESC(msi, "IRQ handling."
drivers/scsi/stex.c:MODULE_PARM_DESC(msi, "Enable Message Signaled Interrupts(0=off, 1=on)");
Param "use_msi", 4 users:
drivers/net/qlcnic/qlcnic_main.c:MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled");
drivers/scsi/3w-9xxx.c:MODULE_PARM_DESC(use_msi, "Use Message Signaled Interrupts. Default: 0");
drivers/scsi/3w-sas.c:MODULE_PARM_DESC(use_msi, "Use Message Signaled Interrupts. Default: 0");
drivers/scsi/aic94xx/aic94xx_init.c:MODULE_PARM_DESC(use_msi, "\n"
Param "disable_msi", 4 users:
drivers/scsi/vmw_pvscsi.c:MODULE_PARM_DESC(disable_msi, "Disable MSI use in driver - (default=0)");
drivers/net/bnx2.c:MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
drivers/net/chelsio/cxgb2.c:MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
drivers/net/sky2.c:MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
Misc:
sound/pci/hda/hda_intel.c:MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)");
drivers/message/fusion/mptbase.c:MODULE_PARM_DESC(mpt_msi_enable_spi, " Enable MSI Support for SPI \
drivers/message/fusion/mptbase.c:MODULE_PARM_DESC(mpt_msi_enable_fc, " Enable MSI Support for FC \
drivers/message/fusion/mptbase.c:MODULE_PARM_DESC(mpt_msi_enable_sas, " Enable MSI Support for SAS \
drivers/net/myri10ge/myri10ge.c:MODULE_PARM_DESC(myri10ge_msi, "Enable Message Signalled Interrupts");
MSI-X:
Param "msi_x", 2 users:
drivers/infiniband/hw/mthca/mthca_main.c:MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero");
drivers/net/mlx4/main.c:MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero");
Misc:
drivers/net/forcedeth.c:MODULE_PARM_DESC(msix, "MSIX interrupts are enabled by setting to 1 and disabled by setting to 0.");
drivers/net/qlcnic/qlcnic_main.c:MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled");
drivers/scsi/bfa/bfad_intr.c:MODULE_PARM_DESC(msix_disable_cb, "Disable MSIX for Brocade-415/425/815/825"
drivers/scsi/bfa/bfad_intr.c:MODULE_PARM_DESC(msix_disable_ct, "Disable MSIX for Brocade-1010/1020/804"
drivers/scsi/mpt2sas/mpt2sas_base.c:MODULE_PARM_DESC(msix_disable, " disable msix routed interrupts (default=0)");
drivers/scsi/qla4xxx/ql4_os.c:MODULE_PARM_DESC(ql4xenablemsix,
drivers/scsi/vmw_pvscsi.c:MODULE_PARM_DESC(disable_msix, "Disable MSI-X use in driver - (default=0)");
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* [PATCH] tunnels: add __rcu annotations
From: Eric Dumazet @ 2010-10-26 7:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Add __rcu annotations to :
(struct ip_tunnel)->prl
(struct ip_tunnel_prl_entry)->next
(struct xfrm_tunnel)->next
struct xfrm_tunnel *tunnel4_handlers
struct xfrm_tunnel *tunnel64_handlers
And use appropriate rcu primitives to reduce sparse warnings if
CONFIG_SPARSE_RCU_POINTER=y
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/net/ipip.h | 4 ++--
include/net/xfrm.h | 2 +-
net/ipv4/tunnel4.c | 29 +++++++++++++++++++----------
3 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/include/net/ipip.h b/include/net/ipip.h
index 0403fe4..a32654d 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -34,12 +34,12 @@ struct ip_tunnel {
#ifdef CONFIG_IPV6_SIT_6RD
struct ip_tunnel_6rd_parm ip6rd;
#endif
- struct ip_tunnel_prl_entry *prl; /* potential router list */
+ struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */
unsigned int prl_count; /* # of entries in PRL */
};
struct ip_tunnel_prl_entry {
- struct ip_tunnel_prl_entry *next;
+ struct ip_tunnel_prl_entry __rcu *next;
__be32 addr;
u16 flags;
struct rcu_head rcu_head;
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index ffcd478..bcfb6b2 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1264,7 +1264,7 @@ struct xfrm_tunnel {
int (*handler)(struct sk_buff *skb);
int (*err_handler)(struct sk_buff *skb, u32 info);
- struct xfrm_tunnel *next;
+ struct xfrm_tunnel __rcu *next;
int priority;
};
diff --git a/net/ipv4/tunnel4.c b/net/ipv4/tunnel4.c
index 9a17bd2..ac3b3ee 100644
--- a/net/ipv4/tunnel4.c
+++ b/net/ipv4/tunnel4.c
@@ -14,27 +14,32 @@
#include <net/protocol.h>
#include <net/xfrm.h>
-static struct xfrm_tunnel *tunnel4_handlers __read_mostly;
-static struct xfrm_tunnel *tunnel64_handlers __read_mostly;
+static struct xfrm_tunnel __rcu *tunnel4_handlers __read_mostly;
+static struct xfrm_tunnel __rcu *tunnel64_handlers __read_mostly;
static DEFINE_MUTEX(tunnel4_mutex);
-static inline struct xfrm_tunnel **fam_handlers(unsigned short family)
+static inline struct xfrm_tunnel __rcu **fam_handlers(unsigned short family)
{
return (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
}
int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family)
{
- struct xfrm_tunnel **pprev;
+ struct xfrm_tunnel __rcu **pprev;
+ struct xfrm_tunnel *t;
+
int ret = -EEXIST;
int priority = handler->priority;
mutex_lock(&tunnel4_mutex);
- for (pprev = fam_handlers(family); *pprev; pprev = &(*pprev)->next) {
- if ((*pprev)->priority > priority)
+ for (pprev = fam_handlers(family);
+ (t = rcu_dereference_protected(*pprev,
+ lockdep_is_held(&tunnel4_mutex))) != NULL;
+ pprev = &t->next) {
+ if (t->priority > priority)
break;
- if ((*pprev)->priority == priority)
+ if (t->priority == priority)
goto err;
}
@@ -52,13 +57,17 @@ EXPORT_SYMBOL(xfrm4_tunnel_register);
int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family)
{
- struct xfrm_tunnel **pprev;
+ struct xfrm_tunnel __rcu **pprev;
+ struct xfrm_tunnel *t;
int ret = -ENOENT;
mutex_lock(&tunnel4_mutex);
- for (pprev = fam_handlers(family); *pprev; pprev = &(*pprev)->next) {
- if (*pprev == handler) {
+ for (pprev = fam_handlers(family);
+ (t = rcu_dereference_protected(*pprev,
+ lockdep_is_held(&tunnel4_mutex))) != NULL;
+ pprev = &t->next) {
+ if (t == handler) {
*pprev = handler->next;
ret = 0;
break;
^ permalink raw reply related
* [PATCH] ipv4: add __rcu annotations to routes.c
From: Eric Dumazet @ 2010-10-26 7:02 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Add __rcu annotations to :
(struct dst_entry)->rt_next
(struct rt_hash_bucket)->chain
And use appropriate rcu primitives to reduce sparse warnings if
CONFIG_SPARSE_RCU_POINTER=y
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/net/dst.h | 2 -
net/ipv4/route.c | 75 ++++++++++++++++++++++++++------------------
2 files changed, 47 insertions(+), 30 deletions(-)
diff --git a/include/net/dst.h b/include/net/dst.h
index a217c83..ffe9cb7 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -95,7 +95,7 @@ struct dst_entry {
unsigned long lastuse;
union {
struct dst_entry *next;
- struct rtable *rt_next;
+ struct rtable __rcu *rt_next;
struct rt6_info *rt6_next;
struct dn_route *dn_next;
};
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d6cb2bf..987bf9a 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -198,7 +198,7 @@ const __u8 ip_tos2prio[16] = {
*/
struct rt_hash_bucket {
- struct rtable *chain;
+ struct rtable __rcu *chain;
};
#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || \
@@ -280,7 +280,7 @@ static struct rtable *rt_cache_get_first(struct seq_file *seq)
struct rtable *r = NULL;
for (st->bucket = rt_hash_mask; st->bucket >= 0; --st->bucket) {
- if (!rt_hash_table[st->bucket].chain)
+ if (!rcu_dereference_raw(rt_hash_table[st->bucket].chain))
continue;
rcu_read_lock_bh();
r = rcu_dereference_bh(rt_hash_table[st->bucket].chain);
@@ -300,17 +300,17 @@ static struct rtable *__rt_cache_get_next(struct seq_file *seq,
{
struct rt_cache_iter_state *st = seq->private;
- r = r->dst.rt_next;
+ r = rcu_dereference_bh(r->dst.rt_next);
while (!r) {
rcu_read_unlock_bh();
do {
if (--st->bucket < 0)
return NULL;
- } while (!rt_hash_table[st->bucket].chain);
+ } while (!rcu_dereference_raw(rt_hash_table[st->bucket].chain));
rcu_read_lock_bh();
- r = rt_hash_table[st->bucket].chain;
+ r = rcu_dereference_bh(rt_hash_table[st->bucket].chain);
}
- return rcu_dereference_bh(r);
+ return r;
}
static struct rtable *rt_cache_get_next(struct seq_file *seq,
@@ -721,19 +721,23 @@ static void rt_do_flush(int process_context)
for (i = 0; i <= rt_hash_mask; i++) {
if (process_context && need_resched())
cond_resched();
- rth = rt_hash_table[i].chain;
+ rth = rcu_dereference_raw(rt_hash_table[i].chain);
if (!rth)
continue;
spin_lock_bh(rt_hash_lock_addr(i));
#ifdef CONFIG_NET_NS
{
- struct rtable ** prev, * p;
+ struct rtable __rcu **prev;
+ struct rtable *p;
- rth = rt_hash_table[i].chain;
+ rth = rcu_dereference_protected(rt_hash_table[i].chain,
+ lockdep_is_held(rt_hash_lock_addr(i)));
/* defer releasing the head of the list after spin_unlock */
- for (tail = rth; tail; tail = tail->dst.rt_next)
+ for (tail = rth; tail;
+ tail = rcu_dereference_protected(tail->dst.rt_next,
+ lockdep_is_held(rt_hash_lock_addr(i))))
if (!rt_is_expired(tail))
break;
if (rth != tail)
@@ -741,8 +745,12 @@ static void rt_do_flush(int process_context)
/* call rt_free on entries after the tail requiring flush */
prev = &rt_hash_table[i].chain;
- for (p = *prev; p; p = next) {
- next = p->dst.rt_next;
+ for (p = rcu_dereference_protected(*prev,
+ lockdep_is_held(rt_hash_lock_addr(i)));
+ p != NULL;
+ p = next) {
+ next = rcu_dereference_protected(p->dst.rt_next,
+ lockdep_is_held(rt_hash_lock_addr(i)));
if (!rt_is_expired(p)) {
prev = &p->dst.rt_next;
} else {
@@ -752,14 +760,15 @@ static void rt_do_flush(int process_context)
}
}
#else
- rth = rt_hash_table[i].chain;
- rt_hash_table[i].chain = NULL;
+ rth = rcu_dereference_protected(rt_hash_table[i].chain,
+ lockdep_is_held(rt_hash_lock_addr(i)));
+ rcu_assign_pointer(rt_hash_table[i].chain, NULL);
tail = NULL;
#endif
spin_unlock_bh(rt_hash_lock_addr(i));
for (; rth != tail; rth = next) {
- next = rth->dst.rt_next;
+ next = rcu_dereference_protected(rth->dst.rt_next, 1);
rt_free(rth);
}
}
@@ -790,7 +799,7 @@ static int has_noalias(const struct rtable *head, const struct rtable *rth)
while (aux != rth) {
if (compare_hash_inputs(&aux->fl, &rth->fl))
return 0;
- aux = aux->dst.rt_next;
+ aux = rcu_dereference_protected(aux->dst.rt_next, 1);
}
return ONE;
}
@@ -799,7 +808,8 @@ static void rt_check_expire(void)
{
static unsigned int rover;
unsigned int i = rover, goal;
- struct rtable *rth, **rthp;
+ struct rtable *rth;
+ struct rtable __rcu **rthp;
unsigned long samples = 0;
unsigned long sum = 0, sum2 = 0;
unsigned long delta;
@@ -825,11 +835,12 @@ static void rt_check_expire(void)
samples++;
- if (*rthp == NULL)
+ if (rcu_dereference_raw(*rthp) == NULL)
continue;
length = 0;
spin_lock_bh(rt_hash_lock_addr(i));
- while ((rth = *rthp) != NULL) {
+ while ((rth = rcu_dereference_protected(*rthp,
+ lockdep_is_held(rt_hash_lock_addr(i)))) != NULL) {
prefetch(rth->dst.rt_next);
if (rt_is_expired(rth)) {
*rthp = rth->dst.rt_next;
@@ -941,7 +952,8 @@ static int rt_garbage_collect(struct dst_ops *ops)
static unsigned long last_gc;
static int rover;
static int equilibrium;
- struct rtable *rth, **rthp;
+ struct rtable *rth;
+ struct rtable __rcu **rthp;
unsigned long now = jiffies;
int goal;
int entries = dst_entries_get_fast(&ipv4_dst_ops);
@@ -995,7 +1007,8 @@ static int rt_garbage_collect(struct dst_ops *ops)
k = (k + 1) & rt_hash_mask;
rthp = &rt_hash_table[k].chain;
spin_lock_bh(rt_hash_lock_addr(k));
- while ((rth = *rthp) != NULL) {
+ while ((rth = rcu_dereference_protected(*rthp,
+ lockdep_is_held(rt_hash_lock_addr(k)))) != NULL) {
if (!rt_is_expired(rth) &&
!rt_may_expire(rth, tmo, expire)) {
tmo >>= 1;
@@ -1071,7 +1084,7 @@ static int slow_chain_length(const struct rtable *head)
while (rth) {
length += has_noalias(head, rth);
- rth = rth->dst.rt_next;
+ rth = rcu_dereference_protected(rth->dst.rt_next, 1);
}
return length >> FRACT_BITS;
}
@@ -1079,9 +1092,9 @@ static int slow_chain_length(const struct rtable *head)
static int rt_intern_hash(unsigned hash, struct rtable *rt,
struct rtable **rp, struct sk_buff *skb, int ifindex)
{
- struct rtable *rth, **rthp;
+ struct rtable *rth, *cand;
+ struct rtable __rcu **rthp, **candp;
unsigned long now;
- struct rtable *cand, **candp;
u32 min_score;
int chain_length;
int attempts = !in_softirq();
@@ -1128,7 +1141,8 @@ restart:
rthp = &rt_hash_table[hash].chain;
spin_lock_bh(rt_hash_lock_addr(hash));
- while ((rth = *rthp) != NULL) {
+ while ((rth = rcu_dereference_protected(*rthp,
+ lockdep_is_held(rt_hash_lock_addr(hash)))) != NULL) {
if (rt_is_expired(rth)) {
*rthp = rth->dst.rt_next;
rt_free(rth);
@@ -1324,12 +1338,14 @@ EXPORT_SYMBOL(__ip_select_ident);
static void rt_del(unsigned hash, struct rtable *rt)
{
- struct rtable **rthp, *aux;
+ struct rtable __rcu **rthp;
+ struct rtable *aux;
rthp = &rt_hash_table[hash].chain;
spin_lock_bh(rt_hash_lock_addr(hash));
ip_rt_put(rt);
- while ((aux = *rthp) != NULL) {
+ while ((aux = rcu_dereference_protected(*rthp,
+ lockdep_is_held(rt_hash_lock_addr(hash)))) != NULL) {
if (aux == rt || rt_is_expired(aux)) {
*rthp = aux->dst.rt_next;
rt_free(aux);
@@ -1346,7 +1362,8 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
{
int i, k;
struct in_device *in_dev = __in_dev_get_rcu(dev);
- struct rtable *rth, **rthp;
+ struct rtable *rth;
+ struct rtable __rcu **rthp;
__be32 skeys[2] = { saddr, 0 };
int ikeys[2] = { dev->ifindex, 0 };
struct netevent_redirect netevent;
@@ -1379,7 +1396,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
unsigned hash = rt_hash(daddr, skeys[i], ikeys[k],
rt_genid(net));
- rthp=&rt_hash_table[hash].chain;
+ rthp = &rt_hash_table[hash].chain;
while ((rth = rcu_dereference(*rthp)) != NULL) {
struct rtable *rt;
^ permalink raw reply related
* [PATCH] net: add __rcu annotations to protocol
From: Eric Dumazet @ 2010-10-26 7:02 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Add __rcu annotations to :
struct net_protocol *inet_protos
struct net_protocol *inet6_protos
And use appropriate casts to reduce sparse warnings if
CONFIG_SPARSE_RCU_POINTER=y
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/net/protocol.h | 4 ++--
net/ipv4/protocol.c | 8 +++++---
net/ipv6/protocol.c | 8 +++++---
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/include/net/protocol.h b/include/net/protocol.h
index f1effdd..dc07495 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -89,10 +89,10 @@ struct inet_protosw {
#define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */
#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */
-extern const struct net_protocol *inet_protos[MAX_INET_PROTOS];
+extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS];
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
-extern const struct inet6_protocol *inet6_protos[MAX_INET_PROTOS];
+extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
#endif
extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num);
diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
index 65699c2..9ae5c01 100644
--- a/net/ipv4/protocol.c
+++ b/net/ipv4/protocol.c
@@ -28,7 +28,7 @@
#include <linux/spinlock.h>
#include <net/protocol.h>
-const struct net_protocol *inet_protos[MAX_INET_PROTOS] __read_mostly;
+const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS] __read_mostly;
/*
* Add a protocol handler to the hash tables
@@ -38,7 +38,8 @@ int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol)
{
int hash = protocol & (MAX_INET_PROTOS - 1);
- return !cmpxchg(&inet_protos[hash], NULL, prot) ? 0 : -1;
+ return !cmpxchg((const struct net_protocol **)&inet_protos[hash],
+ NULL, prot) ? 0 : -1;
}
EXPORT_SYMBOL(inet_add_protocol);
@@ -50,7 +51,8 @@ int inet_del_protocol(const struct net_protocol *prot, unsigned char protocol)
{
int ret, hash = protocol & (MAX_INET_PROTOS - 1);
- ret = (cmpxchg(&inet_protos[hash], prot, NULL) == prot) ? 0 : -1;
+ ret = (cmpxchg((const struct net_protocol **)&inet_protos[hash],
+ prot, NULL) == prot) ? 0 : -1;
synchronize_net();
diff --git a/net/ipv6/protocol.c b/net/ipv6/protocol.c
index 9bb936a..9a7978f 100644
--- a/net/ipv6/protocol.c
+++ b/net/ipv6/protocol.c
@@ -25,13 +25,14 @@
#include <linux/spinlock.h>
#include <net/protocol.h>
-const struct inet6_protocol *inet6_protos[MAX_INET_PROTOS] __read_mostly;
+const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS] __read_mostly;
int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char protocol)
{
int hash = protocol & (MAX_INET_PROTOS - 1);
- return !cmpxchg(&inet6_protos[hash], NULL, prot) ? 0 : -1;
+ return !cmpxchg((const struct inet6_protocol **)&inet6_protos[hash],
+ NULL, prot) ? 0 : -1;
}
EXPORT_SYMBOL(inet6_add_protocol);
@@ -43,7 +44,8 @@ int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char protocol
{
int ret, hash = protocol & (MAX_INET_PROTOS - 1);
- ret = (cmpxchg(&inet6_protos[hash], prot, NULL) == prot) ? 0 : -1;
+ ret = (cmpxchg((const struct inet6_protocol **)&inet6_protos[hash],
+ prot, NULL) == prot) ? 0 : -1;
synchronize_net();
^ permalink raw reply related
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