* [PATCH RFC] r8169: minimal rtl8111e-vl support
From: Francois Romieu @ 2011-06-28 21:44 UTC (permalink / raw)
To: Hayes Wang; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 9909 bytes --]
Mostly bits from version 8.023.00 of Realtek's own r8168 driver. It applies
on top of davem's net-next branch + a small, uninteresting attached patch.
I have given it a short testing w/o the new-format rtl8168e-3_0.0.1 firmware
and it is fairly encouraging.
The code is still incomplete :
- WoL needs some care. No difficulty here.
- rtl8168e_2_hw_phy_config imho deserves a few comments similar to those in
rtl8168e_1_hw_phy_config. Hayes, can you take care of it ?
- I have excluded a set of completely unidentified registers / bits
operations, for instance:
- Config5
BIT_0
- Config2
BIT_5
BIT_7
- TxConfig
BIT_7
- 0x1a
BIT_2
BIT_3
- 0x1b
0xf8 / 0x07
- 0xb0,
0xee480010
- 0xd0
BIT_6
- 0xd3
BIT_7
- 0xf2
BIT_6
Either they are not needed or someone will have to name them adequately.
Hayes ?
- Short packets apparently need to be checksummed by the driver (?) but
the work-around seems strange. It is not clear to me what Realtek's
driver is trying to achieve in hard_start_xmit. Hayes, can you elaborate ?
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/net/r8169.c | 254 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 254 insertions(+), 0 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index f5b8d52..1b38a0f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -41,6 +41,7 @@
#define FIRMWARE_8168D_2 "rtl_nic/rtl8168d-2.fw"
#define FIRMWARE_8168E_1 "rtl_nic/rtl8168e-1.fw"
#define FIRMWARE_8168E_2 "rtl_nic/rtl8168e-2.fw"
+#define FIRMWARE_8168E_3 "rtl_nic/rtl8168e-3.fw"
#define FIRMWARE_8105E_1 "rtl_nic/rtl8105e-1.fw"
#ifdef RTL8169_DEBUG
@@ -133,6 +134,7 @@ enum mac_version {
RTL_GIGA_MAC_VER_31,
RTL_GIGA_MAC_VER_32,
RTL_GIGA_MAC_VER_33,
+ RTL_GIGA_MAC_VER_34,
RTL_GIGA_MAC_NONE = 0xff,
};
@@ -217,6 +219,8 @@ static const struct {
_R("RTL8168e/8111e", RTL_TD_1, FIRMWARE_8168E_1),
[RTL_GIGA_MAC_VER_33] =
_R("RTL8168e/8111e", RTL_TD_1, FIRMWARE_8168E_2),
+ [RTL_GIGA_MAC_VER_34] =
+ _R("RTL8168evl/8111evl",RTL_TD_1, FIRMWARE_8168E_3),
};
#undef _R
@@ -715,6 +719,76 @@ static int rtl8169_poll(struct napi_struct *napi, int budget);
static const unsigned int rtl8169_rx_config =
(RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift);
+static void rtl_eri_cmd(void __iomem *ioaddr, int type, int addr, u32 cmd)
+{
+ int i;
+
+ RTL_W32(ERIAR, cmd | type | ERIAR_BYTEEN | addr);
+
+ for (i = 0; i < 10; i++) {
+ udelay(100);
+
+ if ((RTL_R32(ERIAR) ^ cmd) & ERIAR_FLAG)
+ break;
+ }
+}
+
+static u32 eri_data_mask[] = { 0x000000ff, 0x0000ffff, 0x00ffffff, 0xffffffff };
+
+u32 rtl_eri_read(void __iomem *ioaddr, int addr, int len, int type)
+{
+ int done = 0;
+ u32 val = 0;
+
+ BUG_ON((len > 4) || (len <= 0));
+
+ while ((len <= 4) && (len > 0)) {
+ int offset = addr % ERIAR_ADDR_BYTE_ALIGN;
+ int avail = ERIAR_ADDR_BYTE_ALIGN - offset;
+ u32 data;
+
+ addr &= ~(ERIAR_ADDR_BYTE_ALIGN - 1);
+
+ rtl_eri_cmd(ioaddr, type, addr, ERIAR_READ_CMD);
+
+ data = (RTL_R32(ERIDR) >> (8 * offset)) & eri_data_mask[len -1];
+ val |= data << (8 * done);
+ done += min(avail, len);
+ len -= done;
+ addr += ERIAR_ADDR_BYTE_ALIGN;
+ }
+
+ return val;
+}
+
+static void rtl_eri_write(void __iomem *ioaddr, int addr, int len, u32 val,
+ int type)
+{
+ BUG_ON((len > 4) || (len <= 0));
+
+ while ((len <= 4) && (len > 0)) {
+ int offset = addr % ERIAR_ADDR_BYTE_ALIGN;
+ int avail = ERIAR_ADDR_BYTE_ALIGN - offset;
+ u32 data;
+ int done;
+
+ addr &= ~(ERIAR_ADDR_BYTE_ALIGN - 1);
+
+ data = rtl_eri_read(ioaddr, addr, 4, type);
+ data &= ~(eri_data_mask[len - 1] << (8 * offset));
+ data |= val << (8 * offset);
+
+ RTL_W32(ERIDR, data);
+
+ rtl_eri_cmd(ioaddr, type, addr, ERIAR_WRITE_CMD);
+
+ done = min(avail, len);
+ val >>= 8 * done;
+ len -= done;
+ addr += ERIAR_ADDR_BYTE_ALIGN;
+ }
+}
+
static u32 ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
{
void __iomem *ioaddr = tp->mmio_addr;
@@ -1641,6 +1715,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
int mac_version;
} mac_info[] = {
/* 8168E family. */
+ { 0x7cf00000, 0x2c800000, RTL_GIGA_MAC_VER_34 },
{ 0x7cf00000, 0x2c200000, RTL_GIGA_MAC_VER_33 },
{ 0x7cf00000, 0x2c100000, RTL_GIGA_MAC_VER_32 },
{ 0x7c800000, 0x2c000000, RTL_GIGA_MAC_VER_33 },
@@ -2691,6 +2766,109 @@ static void rtl8168e_1_hw_phy_config(struct rtl8169_private *tp)
rtl_writephy(tp, 0x0d, 0x0000);
}
+static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
+{
+ static const struct phy_reg phy_reg_init_1[] = {
+ /* ? */
+ { 0x1f, 0x0001 },
+ { 0x0b, 0x6c14 },
+ { 0x14, 0x7f3d },
+ { 0x1c, 0xfafe },
+ { 0x08, 0x07c5 },
+ { 0x10, 0xf090 },
+ { 0x1f, 0x0003 },
+ { 0x14, 0x641a },
+ { 0x1a, 0x0606 },
+ { 0x12, 0xf480 },
+ { 0x13, 0x0747 },
+ { 0x1f, 0x0000 },
+
+ /* ? */
+ { 0x1f, 0x0004 },
+ { 0x1f, 0x0007 },
+ { 0x1e, 0x0078 },
+ { 0x15, 0xa408 },
+ { 0x17, 0x5100 },
+ { 0x19, 0x0008 },
+ { 0x1f, 0x0002 },
+ { 0x1f, 0x0000 },
+
+ /* ? */
+ { 0x1f, 0x0003 },
+ { 0x0d, 0x0207 },
+ { 0x02, 0x5fd0 },
+ { 0x1f, 0x0000 }
+ }, phy_reg_init_2[] = {
+ /* ? */
+ { 0x1f, 0x0004 },
+ { 0x1f, 0x0007 },
+ { 0x1e, 0x00ac },
+ { 0x18, 0x0006 },
+ { 0x1f, 0x0002 },
+ { 0x1f, 0x0000 },
+
+ /* ? */
+ { 0x1f, 0x0003 },
+ { 0x09, 0xa20f },
+ { 0x1f, 0x0000 },
+
+ /* ? */
+ { 0x1f, 0x0005 },
+ { 0x05, 0x8b5b },
+ { 0x06, 0x9222 },
+ { 0x05, 0x8b6d },
+ { 0x06, 0x8000 },
+ { 0x05, 0x8b76 },
+ { 0x06, 0x8000 },
+ { 0x1f, 0x0000 }
+ };
+
+ rtl_apply_firmware(tp);
+
+ /* ? */
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x8b80);
+ rtl_w1w0_phy(tp, 0x06, 0x0006, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* ? */
+ rtl_writephy(tp, 0x1f, 0x0004);
+ rtl_writephy(tp, 0x1f, 0x0007);
+ rtl_writephy(tp, 0x1e, 0x002d);
+ rtl_w1w0_phy(tp, 0x18, 0x0010, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0002);
+ rtl_writephy(tp, 0x1f, 0x0000);
+ rtl_w1w0_phy(tp, 0x14, 0x8000, 0x0000);
+
+ rtl_writephy(tp, 0x1f, 0x0000);
+ rtl_writephy(tp, 0x15, 0x1006);
+
+ rtl_writephy(tp, 0x1f, 0x0005);
+ rtl_writephy(tp, 0x05, 0x8b86);
+ rtl_w1w0_phy(tp, 0x06, 0x0001, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ rtl_writephy_batch(tp, phy_reg_init_1, ARRAY_SIZE(phy_reg_init_1));
+
+ /* ? */
+ rtl_writephy(tp, 0x1f, 0x0004);
+ rtl_writephy(tp, 0x1f, 0x0007);
+ rtl_writephy(tp, 0x1e, 0x00a1);
+ rtl_w1w0_phy(tp, 0x1a, 0x0000, 0x0004);
+ rtl_writephy(tp, 0x1f, 0x0002);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* ? */
+ rtl_writephy(tp, 0x1f, 0x0004);
+ rtl_writephy(tp, 0x1f, 0x0007);
+ rtl_writephy(tp, 0x1e, 0x002d);
+ rtl_w1w0_phy(tp, 0x16, 0x0020, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0002);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ rtl_writephy_batch(tp, phy_reg_init_2, ARRAY_SIZE(phy_reg_init_2));
+}
+
static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
{
static const struct phy_reg phy_reg_init[] = {
@@ -2812,6 +2990,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
case RTL_GIGA_MAC_VER_33:
rtl8168e_1_hw_phy_config(tp);
break;
+ case RTL_GIGA_MAC_VER_34:
+ rtl8168e_2_hw_phy_config(tp);
+ break;
default:
break;
@@ -3170,6 +3351,7 @@ static void r8168_phy_power_down(struct rtl8169_private *tp)
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_32:
case RTL_GIGA_MAC_VER_33:
+ case RTL_GIGA_MAC_VER_34:
rtl_writephy(tp, MII_BMCR, BMCR_ANENABLE | BMCR_PDOWN);
break;
@@ -3926,6 +4108,20 @@ static void rtl_csi_access_enable_2(void __iomem *ioaddr)
rtl_csi_access_enable(ioaddr, 0x27000000);
}
+struct ephy_reg {
+ u16 offset;
+ u16 val;
+};
+
+static void rtl_write_ephy_batch(void __iomem *ioaddr,
+ const struct ephy_reg *regs, int len)
+{
+ while (len-- > 0) {
+ rtl_ephy_write(ioaddr, regs->offset, regs->val);
+ regs++;
+ }
+}
+
struct ephy_info {
unsigned int offset;
u16 mask;
@@ -4184,6 +4380,60 @@ static void rtl_hw_start_8168e_1(void __iomem *ioaddr, struct pci_dev *pdev)
RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en);
}
+struct eri_reg {
+ u16 addr;
+ u16 len;
+ u32 data;
+};
+
+static void rtl_write_eri_batch(void __iomem * ioaddr,
+ const struct eri_reg *regs, int len, int type)
+{
+ while (len-- > 0) {
+ rtl_eri_write(ioaddr, regs->addr, regs->len, regs->data, type);
+ regs++;
+ }
+}
+
+static void rtl_hw_start_8168e_2(void __iomem *ioaddr, struct pci_dev *pdev)
+{
+ static const struct ephy_reg ephy_reg_init[] = {
+ { 0x06, 0xf020 },
+ { 0x07, 0x01ff },
+ { 0x00, 0x5027 },
+ { 0x01, 0x0003 },
+ { 0x02, 0x2d16 },
+ { 0x03, 0x6d49 },
+ { 0x08, 0x0006 },
+ { 0x0a, 0x00c8 },
+ };
+ static const struct ephy_info e_info_8168e[] = {
+ { 0x09, 0x0000, 0x0080 },
+ { 0x19, 0x0000, 0x0224 }
+ };
+ static const struct eri_reg eri_reg_init[] = {
+ { 0xd5, 1, 0x0000000c },
+ { 0xc0, 2, 0x00000000 },
+ { 0xb8, 2, 0x00000000 },
+ { 0xc8, 4, 0x00100002 },
+ { 0xe8, 4, 0x00100006 }
+ };
+
+ rtl_csi_access_enable_1(ioaddr);
+ rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
+ RTL_W8(MaxTxPacketSize, TxPacketMax);
+
+ rtl_write_eri_batch(ioaddr, eri_reg_init, ARRAY_SIZE(eri_reg_init),
+ ERIAR_EXGMAC);
+
+ rtl_eri_write(ioaddr, 0x01dc, 1, 0x64, ERIAR_EXGMAC);
+
+ rtl_write_ephy_batch(ioaddr, ephy_reg_init, ARRAY_SIZE(ephy_reg_init));
+ rtl_ephy_init(ioaddr, e_info_8168e, ARRAY_SIZE(e_info_8168e));
+
+ rtl_disable_clock_request(pdev);
+}
+
static void rtl_hw_start_8168(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
@@ -4275,6 +4525,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
rtl_hw_start_8168e_1(ioaddr, pdev);
break;
+ case RTL_GIGA_MAC_VER_34:
+ rtl_hw_start_8168e_2(ioaddr, pdev);
+ break;
+
default:
printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
dev->name, tp->mac_version);
--
1.7.4.4
[-- Attachment #2: 0001-r8169-noise-redux.patch --]
[-- Type: text/plain, Size: 3375 bytes --]
>From d777443c097b65b06f1d0e7da37db1368185db8e Mon Sep 17 00:00:00 2001
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Tue, 28 Jun 2011 17:01:29 +0200
Subject: [PATCH 1/3] r8169: noise redux.
- insert an empty record in rtl_chip_infos for future chipsets.
NB: the array is only accessed through the RTL_GIGA_MAC_VER_xy enum.
- ready-to-use ERIAR bits definitions. Those were not used.
- ERIDR / ERIAR confusion. This one is already in Linus's tree. I'll
remove it before the final submission.
- make room for different 8168e hw_phy_config and hw_start methods.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/net/r8169.c | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index fbd6838..f5b8d52 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -216,7 +216,7 @@ static const struct {
[RTL_GIGA_MAC_VER_32] =
_R("RTL8168e/8111e", RTL_TD_1, FIRMWARE_8168E_1),
[RTL_GIGA_MAC_VER_33] =
- _R("RTL8168e/8111e", RTL_TD_1, FIRMWARE_8168E_2)
+ _R("RTL8168e/8111e", RTL_TD_1, FIRMWARE_8168E_2),
};
#undef _R
@@ -351,12 +351,12 @@ enum rtl8168_registers {
#define ERIAR_WRITE_CMD 0x80000000
#define ERIAR_READ_CMD 0x00000000
#define ERIAR_ADDR_BYTE_ALIGN 4
-#define ERIAR_EXGMAC 0
-#define ERIAR_MSIX 1
-#define ERIAR_ASF 2
#define ERIAR_TYPE_SHIFT 16
-#define ERIAR_BYTEEN 0x0f
+#define ERIAR_EXGMAC (0x00 << ERIAR_TYPE_SHIFT)
+#define ERIAR_MSIX (0x01 << ERIAR_TYPE_SHIFT)
+#define ERIAR_ASF (0x02 << ERIAR_TYPE_SHIFT)
#define ERIAR_BYTEEN_SHIFT 12
+#define ERIAR_BYTEEN (0x0f << ERIAR_BYTEEN_SHIFT)
EPHY_RXER_NUM = 0x7c,
OCPDR = 0xb0, /* OCP GPHY access */
#define OCPDR_WRITE_CMD 0x80000000
@@ -749,11 +749,12 @@ static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
int i;
RTL_W8(ERIDR, cmd);
- RTL_W32(ERIAR, 0x800010e8);
+ /* Could 0x10e8 be replaced with (ERIAR_BYTEEN | 0x00e8) ? */
+ RTL_W32(ERIAR, ERIAR_WRITE_CMD | ERIAR_EXGMAC | 0x10e8);
msleep(2);
for (i = 0; i < 5; i++) {
udelay(100);
- if (!(RTL_R32(ERIDR) & ERIAR_FLAG))
+ if (!(RTL_R32(ERIAR) & ERIAR_FLAG))
break;
}
@@ -2617,7 +2618,7 @@ static void rtl8168d_4_hw_phy_config(struct rtl8169_private *tp)
rtl_patchphy(tp, 0x0d, 1 << 5);
}
-static void rtl8168e_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168e_1_hw_phy_config(struct rtl8169_private *tp)
{
static const struct phy_reg phy_reg_init[] = {
/* Enable Delay cap */
@@ -2809,7 +2810,7 @@ static void rtl_hw_phy_config(struct net_device *dev)
break;
case RTL_GIGA_MAC_VER_32:
case RTL_GIGA_MAC_VER_33:
- rtl8168e_hw_phy_config(tp);
+ rtl8168e_1_hw_phy_config(tp);
break;
default:
@@ -4148,7 +4149,7 @@ static void rtl_hw_start_8168d_4(void __iomem *ioaddr, struct pci_dev *pdev)
rtl_enable_clock_request(pdev);
}
-static void rtl_hw_start_8168e(void __iomem *ioaddr, struct pci_dev *pdev)
+static void rtl_hw_start_8168e_1(void __iomem *ioaddr, struct pci_dev *pdev)
{
static const struct ephy_info e_info_8168e[] = {
{ 0x00, 0x0200, 0x0100 },
@@ -4271,7 +4272,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
case RTL_GIGA_MAC_VER_32:
case RTL_GIGA_MAC_VER_33:
- rtl_hw_start_8168e(ioaddr, pdev);
+ rtl_hw_start_8168e_1(ioaddr, pdev);
break;
default:
--
1.7.4.4
^ permalink raw reply related
* Re: [PATCH] net/core: Convert to current logging forms
From: Joe Perches @ 2011-06-28 21:55 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Ben Hutchings, netdev, David S. Miller, Neil Horman, linux-kernel
In-Reply-To: <20110628144923.2bdac9f9@nehalam.ftrdhcpuser.net>
On Tue, 2011-06-28 at 14:49 -0700, Stephen Hemminger wrote:
> Does this actually create useful benefit or just create more bug possibilities?
Probably not the bug possibilities.
It's pretty trivial.
> Those messages are mostly self explanatory as is.
It also has some utility for the cases in drivers
between the alloc_netdev and register_netdev[ice]
where printk/pr_<level> currently has to be used.
Beyond that, (foolish?) consistency only.
cheers, Joe
^ permalink raw reply
* Re: [PATCH] net/core: Convert to current logging forms
From: Stephen Hemminger @ 2011-06-28 21:49 UTC (permalink / raw)
To: Joe Perches
Cc: Ben Hutchings, netdev, David S. Miller, Neil Horman, linux-kernel
In-Reply-To: <1309297068.29598.26.camel@Joe-Laptop>
On Tue, 28 Jun 2011 14:37:48 -0700
Joe Perches <joe@perches.com> wrote:
> On Tue, 2011-06-28 at 21:36 +0100, Ben Hutchings wrote:
> > On Tue, 2011-06-28 at 13:31 -0700, Joe Perches wrote:
> > > On Tue, 2011-06-28 at 21:21 +0100, Ben Hutchings wrote:
> > > > On Tue, 2011-06-28 at 12:40 -0700, Joe Perches wrote:
> > > > > Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
> > > > > Coalesce long formats.
> > > > [...]
> > > > > --- a/net/core/dev.c
> > > > > +++ b/net/core/dev.c
> > > > > @@ -72,6 +72,8 @@
> > > > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > > > [...]
> > > > KBUILD_MODNAME is presumably going to be "dev".
> > > 'tis.
> > > > That's not very meaningful.
> > > I think it's not useless though.
> > > Anything else you think it should be?
> > > Maybe "net_core_device:" or some such like that?
> > "netdev"
> > > Here are the format strings now prefaced by "dev:"
> > > $ strings net/core/built-in.o |grep "^<.>dev:"
> > > <6>dev: netif_stop_queue() cannot be called before register_netdev()
> > > <4>dev: dev_remove_pack: %p not found
> > > <3>dev: Loading kernel module for a network device with CAP_SYS_MODULE (deprecated)
> > > <0>dev: %s: failed to move %s to init_net: %d
> > > <3>dev: alloc_netdev: Unable to allocate device with zero queues
> > > <3>dev: alloc_netdev: Unable to allocate device with zero RX queues
> > > <3>dev: alloc_netdev: Unable to allocate device
> > Many of these refer to a specific device and should be formatted with
> > one of the netdev_* logging functions.
>
> Perhaps another way to do this is like this:
>
> As soon as alloc_netdev is called, netdev_<level> can
> be used, but the netdev_name() function can contain
> printf formatting control codes like %d.
>
> Use pr_fmt(fmt) "netdev: " fmt in net/core/dev.c
> Add netdev_is_registered() to netdevice.h
> Extend uses of netdev_name() with netdev_is_registered()
> to show "(unregistered)" as may be necessary.
> Move setting of dev->name in alloc_netdev_mqs to just
> after allocation instead of at end of function.
>
> (on top of the original patch, will respin if wanted)
>
> Thoughts?
Does this actually create useful benefit or just create more bug possibilities?
Those messages are mostly self explanatory as is.
^ permalink raw reply
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: David Lamparter @ 2011-06-28 21:46 UTC (permalink / raw)
To: Nick Carter; +Cc: David Lamparter, Stephen Hemminger, netdev, davem
In-Reply-To: <BANLkTikN_TPPcyywVT5W9CrGAFJX8qQiyQ@mail.gmail.com>
On Tue, Jun 28, 2011 at 10:22:53PM +0100, Nick Carter wrote:
> > I beg to differ, there very much is. You never ever ever want to be
> > running STP with 802.1X packets passing through... some client will shut
> > down your upstream port, your STP will break and you will die in a fire.
> >
> > The general idea, though, is that a STP-enabled switch is an intelligent
> > switch. And an intelligent switch can speak all those pesky small
> > side-dish protocols.
[...]
> >> > (Some quick googling reveals that hardware switch chips special-drop
> >> > 01:80:c2:00:00:01 [802.3x/pause] and :02 [802.3ad/lacp] and nothing
> >> > else - for the dumb ones anyway. It also seems like the match for pause
> >> > frames usually works on the address, not on the protocol field like we
> >> > do it...)
> >> 'Enterprise' switches drop :03 [802.1x]
> >
> > They also speak STP, see above about never STP+1X :)
> But if you turn off STP they wont start forwarding 802.1x.
Yes, hence my suggestion to have a knob for all of the link-local
ethernet groups. (Which I'm still not actually endorsing, just placing
the idea)
> Also having STP on and forwarding 802.1x would be useful (but
> non-standard) in some cheap redundant periphery switches, connecting
> to a couple of 'core' switches acting as 802.1x authenticators.
That wouldn't really make much sense since those central 802.1X
authenticators wouldn't be able switch the client-facing ports on and
off. Instead, you now have to (1) disable the port switching to make
sure your upstreams stay on and (2) deal with 802.1X clients being
re"routed" by STP to different authenticators that don't know them.
-David
^ permalink raw reply
* Re: [PATCH] net/core: Convert to current logging forms
From: Joe Perches @ 2011-06-28 21:37 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, David S. Miller, Neil Horman, linux-kernel
In-Reply-To: <1309293416.2771.50.camel@bwh-desktop>
On Tue, 2011-06-28 at 21:36 +0100, Ben Hutchings wrote:
> On Tue, 2011-06-28 at 13:31 -0700, Joe Perches wrote:
> > On Tue, 2011-06-28 at 21:21 +0100, Ben Hutchings wrote:
> > > On Tue, 2011-06-28 at 12:40 -0700, Joe Perches wrote:
> > > > Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
> > > > Coalesce long formats.
> > > [...]
> > > > --- a/net/core/dev.c
> > > > +++ b/net/core/dev.c
> > > > @@ -72,6 +72,8 @@
> > > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > > [...]
> > > KBUILD_MODNAME is presumably going to be "dev".
> > 'tis.
> > > That's not very meaningful.
> > I think it's not useless though.
> > Anything else you think it should be?
> > Maybe "net_core_device:" or some such like that?
> "netdev"
> > Here are the format strings now prefaced by "dev:"
> > $ strings net/core/built-in.o |grep "^<.>dev:"
> > <6>dev: netif_stop_queue() cannot be called before register_netdev()
> > <4>dev: dev_remove_pack: %p not found
> > <3>dev: Loading kernel module for a network device with CAP_SYS_MODULE (deprecated)
> > <0>dev: %s: failed to move %s to init_net: %d
> > <3>dev: alloc_netdev: Unable to allocate device with zero queues
> > <3>dev: alloc_netdev: Unable to allocate device with zero RX queues
> > <3>dev: alloc_netdev: Unable to allocate device
> Many of these refer to a specific device and should be formatted with
> one of the netdev_* logging functions.
Perhaps another way to do this is like this:
As soon as alloc_netdev is called, netdev_<level> can
be used, but the netdev_name() function can contain
printf formatting control codes like %d.
Use pr_fmt(fmt) "netdev: " fmt in net/core/dev.c
Add netdev_is_registered() to netdevice.h
Extend uses of netdev_name() with netdev_is_registered()
to show "(unregistered)" as may be necessary.
Move setting of dev->name in alloc_netdev_mqs to just
after allocation instead of at end of function.
(on top of the original patch, will respin if wanted)
Thoughts?
---
include/linux/netdevice.h | 29 ++++++++++++++++++++++-------
net/core/dev.c | 18 ++++++++++--------
2 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 011eb89..4b6c4e2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2625,11 +2625,16 @@ static inline u32 dev_ethtool_get_flags(struct net_device *dev)
static inline const char *netdev_name(const struct net_device *dev)
{
- if (dev->reg_state != NETREG_REGISTERED)
- return "(unregistered net_device)";
+ if (!dev)
+ return "NULL net_device";
return dev->name;
}
+static inline bool netdev_is_registered(const struct net_device *dev)
+{
+ return dev && dev->reg_state == NETREG_REGISTERED;
+}
+
extern int netdev_printk(const char *level, const struct net_device *dev,
const char *format, ...)
__attribute__ ((format (printf, 3, 4)));
@@ -2657,8 +2662,11 @@ extern int netdev_info(const struct net_device *dev, const char *format, ...)
#elif defined(CONFIG_DYNAMIC_DEBUG)
#define netdev_dbg(__dev, format, args...) \
do { \
- dynamic_dev_dbg((__dev)->dev.parent, "%s: " format, \
- netdev_name(__dev), ##args); \
+ dynamic_dev_dbg((__dev)->dev.parent, "%s%s: " format, \
+ netdev_name(__dev), \
+ netdev_is_registered(__dev) \
+ ? "" : " (unregistered)", \
+ ##args); \
} while (0)
#else
#define netdev_dbg(__dev, format, args...) \
@@ -2687,7 +2695,11 @@ do { \
* file/line information and a backtrace.
*/
#define netdev_WARN(dev, format, args...) \
- WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args);
+ WARN(1, "netdevice: %s%s\n" format, \
+ netdev_name(dev), \
+ netdev_is_registered(dev) \
+ ? "" : " (unregistered)", \
+ ##args);
/* netif printk helpers, similar to netdev_printk */
@@ -2726,8 +2738,11 @@ do { \
do { \
if (netif_msg_##type(priv)) \
dynamic_dev_dbg((netdev)->dev.parent, \
- "%s: " format, \
- netdev_name(netdev), ##args); \
+ "%s%s: " format, \
+ netdev_name(netdev), \
+ netdev_is_registered(netdev) \
+ ? "" : " (unregistered)", \
+ ##args); \
} while (0)
#else
#define netif_dbg(priv, type, dev, format, args...) \
diff --git a/net/core/dev.c b/net/core/dev.c
index 3401227..44e2646 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -72,7 +72,7 @@
* - netif_rx() feedback
*/
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt) "netdev: " fmt
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -5803,13 +5803,13 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
BUG_ON(strlen(name) >= sizeof(dev->name));
if (txqs < 1) {
- pr_err("alloc_netdev: Unable to allocate device with zero queues\n");
+ pr_err("Unable to allocate device with zero queues\n");
return NULL;
}
#ifdef CONFIG_RPS
if (rxqs < 1) {
- pr_err("alloc_netdev: Unable to allocate device with zero RX queues\n");
+ pr_err("Unable to allocate device with zero RX queues\n");
return NULL;
}
#endif
@@ -5825,13 +5825,15 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
p = kzalloc(alloc_size, GFP_KERNEL);
if (!p) {
- pr_err("alloc_netdev: Unable to allocate device\n");
+ pr_err("Unable to allocate device\n");
return NULL;
}
dev = PTR_ALIGN(p, NETDEV_ALIGN);
dev->padded = (char *)dev - (char *)p;
+ strcpy(dev->name, name);
+
dev->pcpu_refcnt = alloc_percpu(int);
if (!dev->pcpu_refcnt)
goto free_p;
@@ -5864,7 +5866,6 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
goto free_all;
#endif
- strcpy(dev->name, name);
dev->group = INIT_NETDEV_GROUP;
return dev;
@@ -6270,10 +6271,11 @@ static int __netdev_printk(const char *level, const struct net_device *dev,
if (dev && dev->dev.parent)
r = dev_printk(level, dev->dev.parent, "%s: %pV",
netdev_name(dev), vaf);
- else if (dev)
- r = printk("%s%s: %pV", level, netdev_name(dev), vaf);
else
- r = printk("%s(NULL net_device): %pV", level, vaf);
+ r = printk("%s%s%s: %pV",
+ level, netdev_name(dev),
+ netdev_is_registered(dev) ? "" : " (unregistered)",
+ vaf);
return r;
}
^ permalink raw reply related
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: Nick Carter @ 2011-06-28 21:22 UTC (permalink / raw)
To: David Lamparter; +Cc: Stephen Hemminger, netdev, davem
In-Reply-To: <20110628210434.GD2121496@jupiter.n2.diac24.net>
On 28 June 2011 22:04, David Lamparter <equinox@diac24.net> wrote:
> On Tue, Jun 28, 2011 at 09:54:01PM +0100, Nick Carter wrote:
>> > 'reinject' isn't possible when it hits that code path - which is pretty
>> > much why I'm saying we should be forwarding everything in the non-STP
>> > case.
>> I'm not sure I like this turn off STP and suddenly start forwarding
>> random groups. There is no connection between wanting STP on / off
>> and forwarding pae on / off.
>
> I beg to differ, there very much is. You never ever ever want to be
> running STP with 802.1X packets passing through... some client will shut
> down your upstream port, your STP will break and you will die in a fire.
>
> The general idea, though, is that a STP-enabled switch is an intelligent
> switch. And an intelligent switch can speak all those pesky small
> side-dish protocols.
>
> With STP disabled on the other hand, it depends on site policy. Now
> policy...
>
>> There is no dependencies between the protocols.
>> Also on reflection I think a knob per mac group would be better.
>
> .... policy can be done nice and good with ebtables. You can match the
> groups you want, or the protocols, or the phase of the moon.
>
>> We are only interested in 3 and if I enable pae forwarding so I can
>> connect virtual machine supplicants, i don't then want to turn on LDP
>> forwarding which will needlessly hit my virtual machines.
>> So how about sysfs
>> ../bridge/pae_forwarding
>> ../bridge/ldp_forwarding
>> ../bridge/mvrp_forwarding
>
> It's not like either LLDP or MVRP will trash your VMs. Those protocols
> send a packet once per a few seconds.
>
> MVRP is interesting for the STP-enabled case though. I'm not aware of
> any userspace *VRP implementations, and dropping *VRP without an
> userspace daemon to speak it on our behalf means we're creating a *VRP
> border/break.
>
> I would however say that doing an userspace *VRP implementation is a
> better solution than kernel hacks for this particular case.
>
>> > (Some quick googling reveals that hardware switch chips special-drop
>> > 01:80:c2:00:00:01 [802.3x/pause] and :02 [802.3ad/lacp] and nothing
>> > else - for the dumb ones anyway. It also seems like the match for pause
>> > frames usually works on the address, not on the protocol field like we
>> > do it...)
>> 'Enterprise' switches drop :03 [802.1x]
>
> They also speak STP, see above about never STP+1X :)
But if you turn off STP they wont start forwarding 802.1x.
Also having STP on and forwarding 802.1x would be useful (but
non-standard) in some cheap redundant periphery switches, connecting
to a couple of 'core' switches acting as 802.1x authenticators.
Nick
>
> -David
>
>
^ permalink raw reply
* [RFC PATCH] asix: drop rx skb if header length is invalid
From: maksim.rayskiy @ 2011-06-28 21:21 UTC (permalink / raw)
To: netdev; +Cc: Maksim Rayskiy
From: Maksim Rayskiy <mrayskiy@broadcom.com>
Signed-off-by: Maksim Rayskiy <mrayskiy@broadcom.com>
---
I am using AX88772 usbnet dongle, and sometimes after system resume I am seeing
corrupt rx packets which generate infinite number of
asix_rx_fixup() Bad Header Length
messages.
Looking at asix_rx_fixup() I see that depending on what junk you get in skb you
may end up with never breaking the while loop. Would not it be safer to bail out
as soon as incorrect header length was detected?
drivers/net/usb/asix.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 6998aa6..9d7a6ec 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -317,6 +317,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
if ((short)(header & 0x0000ffff) !=
~((short)((header & 0xffff0000) >> 16))) {
netdev_err(dev->net, "asix_rx_fixup() Bad Header Length\n");
+ return 0;
}
/* get the packet length */
size = (u16) (header & 0x0000ffff);
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: David Lamparter @ 2011-06-28 21:04 UTC (permalink / raw)
To: Nick Carter; +Cc: David Lamparter, Stephen Hemminger, netdev, davem
In-Reply-To: <BANLkTim1owW7iMS3hgKhm7DzTzE4X-jxHA@mail.gmail.com>
On Tue, Jun 28, 2011 at 09:54:01PM +0100, Nick Carter wrote:
> > 'reinject' isn't possible when it hits that code path - which is pretty
> > much why I'm saying we should be forwarding everything in the non-STP
> > case.
> I'm not sure I like this turn off STP and suddenly start forwarding
> random groups. There is no connection between wanting STP on / off
> and forwarding pae on / off.
I beg to differ, there very much is. You never ever ever want to be
running STP with 802.1X packets passing through... some client will shut
down your upstream port, your STP will break and you will die in a fire.
The general idea, though, is that a STP-enabled switch is an intelligent
switch. And an intelligent switch can speak all those pesky small
side-dish protocols.
With STP disabled on the other hand, it depends on site policy. Now
policy...
> There is no dependencies between the protocols.
> Also on reflection I think a knob per mac group would be better.
.... policy can be done nice and good with ebtables. You can match the
groups you want, or the protocols, or the phase of the moon.
> We are only interested in 3 and if I enable pae forwarding so I can
> connect virtual machine supplicants, i don't then want to turn on LDP
> forwarding which will needlessly hit my virtual machines.
> So how about sysfs
> ../bridge/pae_forwarding
> ../bridge/ldp_forwarding
> ../bridge/mvrp_forwarding
It's not like either LLDP or MVRP will trash your VMs. Those protocols
send a packet once per a few seconds.
MVRP is interesting for the STP-enabled case though. I'm not aware of
any userspace *VRP implementations, and dropping *VRP without an
userspace daemon to speak it on our behalf means we're creating a *VRP
border/break.
I would however say that doing an userspace *VRP implementation is a
better solution than kernel hacks for this particular case.
> > (Some quick googling reveals that hardware switch chips special-drop
> > 01:80:c2:00:00:01 [802.3x/pause] and :02 [802.3ad/lacp] and nothing
> > else - for the dumb ones anyway. It also seems like the match for pause
> > frames usually works on the address, not on the protocol field like we
> > do it...)
> 'Enterprise' switches drop :03 [802.1x]
They also speak STP, see above about never STP+1X :)
-David
^ permalink raw reply
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: Nick Carter @ 2011-06-28 20:54 UTC (permalink / raw)
To: David Lamparter; +Cc: Stephen Hemminger, netdev, davem
In-Reply-To: <20110628202200.GB2121496@jupiter.n2.diac24.net>
On 28 June 2011 21:22, David Lamparter <equinox@diac24.net> wrote:
> On Tue, Jun 28, 2011 at 09:00:16PM +0100, Nick Carter wrote:
>> >> /* If STP is turned off, then forward */
>> >> - if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
>> >> + if (p->br->stp_enabled == BR_NO_STP &&
>> >> + (dest[5] == 0 || skb->protocol == htons(ETH_P_PAE)))
>> >> goto forward;
>> >> Nick
>> >
>> > That code actually looks quite wrong to me, we should be forwarding all of
>> > the 01:80:C2:00:00:0x groups in non-STP mode, especially :0E and :0D.
>> > (LLDP and GVRP/MVRP)
>> >
>> > Pause frames are the one exception that makes the rule, but as the
>> > comment a few lines above states, "Pause frames shouldn't be passed up by
>> > driver anyway".
>> >
>> > Btw, what might make sense is a general knob for forwarding those
>> > link-local groups, split off from the STP switch so the STP switch
>> > controls only the :00 (STP) group. That way you can decide separately
>> > whether you want to be LLDP/GVRP/802.1X/... transparent and whether you
>> > want to run STP.
>>
>> Sounds good to me. So we go for :03, :0D, and :0E. We cant touch :02 see:
>> commit f01cb5fbea1c1613621f9f32f385e12c1a29dde0
>> Revert "bridge: Forward reserved group addresses if !STP"
>>
>> > Not sure if it's needed, it can always be done with ebtables...
>> What would be the ebtables rules to achieve the forwarding of :03 ? I
>> asked this question on the netfilter list and the only response I got
>> said ebtables was a filter and could not do this. :03 is hitting
>> NF_BR_LOCAL_IN. How would you 'reinject' it so it is forwarded ?
>
> 'reinject' isn't possible when it hits that code path - which is pretty
> much why I'm saying we should be forwarding everything in the non-STP
> case.
I'm not sure I like this turn off STP and suddenly start forwarding
random groups. There is no connection between wanting STP on / off
and forwarding pae on / off. There is no dependencies between the
protocols.
Also on reflection I think a knob per mac group would be better. We
are only interested in 3 and if I enable pae forwarding so I can
connect virtual machine supplicants, i don't then want to turn on LDP
forwarding which will needlessly hit my virtual machines.
So how about sysfs
../bridge/pae_forwarding
../bridge/ldp_forwarding
../bridge/mvrp_forwarding
>
> I have to read up on the bonding interactions, but to my understanding
> the only reasonable usage case is to have the bond below the bridge like
> eth0 \
> |- bond0 - br0
> eth1 /
> then the bonding should receive (and consume) the packets before they
> reach the bridge.
>
> (Some quick googling reveals that hardware switch chips special-drop
> 01:80:c2:00:00:01 [802.3x/pause] and :02 [802.3ad/lacp] and nothing
> else - for the dumb ones anyway. It also seems like the match for pause
> frames usually works on the address, not on the protocol field like we
> do it...)
'Enterprise' switches drop :03 [802.1x]
Nick
>
>
> -David
>
>
^ permalink raw reply
* Re: [PATCH] net/core: Convert to current logging forms
From: Joe Perches @ 2011-06-28 20:40 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, David S. Miller, Neil Horman, linux-kernel
In-Reply-To: <1309293416.2771.50.camel@bwh-desktop>
On Tue, 2011-06-28 at 21:36 +0100, Ben Hutchings wrote:
> On Tue, 2011-06-28 at 13:31 -0700, Joe Perches wrote:
> > On Tue, 2011-06-28 at 21:21 +0100, Ben Hutchings wrote:
> > > On Tue, 2011-06-28 at 12:40 -0700, Joe Perches wrote:
> > > > Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
> > > > Coalesce long formats.
> > > [...]
> > > > --- a/net/core/dev.c
[]
> > > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > > [...]
> > > KBUILD_MODNAME is presumably going to be "dev".
> > 'tis.
> > > That's not very meaningful.
> > Anything else you think it should be?
> > Maybe "net_core_device:" or some such like that?
> "netdev"
Maybe. David? Got an opinion?
> > Here are the format strings now prefaced by "dev:"
> >
> > $ strings net/core/built-in.o |grep "^<.>dev:"
> > <6>dev: netif_stop_queue() cannot be called before register_netdev()
> > <4>dev: dev_remove_pack: %p not found
> > <3>dev: Loading kernel module for a network device with CAP_SYS_MODULE (deprecated)
> > <0>dev: %s: failed to move %s to init_net: %d
> > <3>dev: alloc_netdev: Unable to allocate device with zero queues
> > <3>dev: alloc_netdev: Unable to allocate device with zero RX queues
> > <3>dev: alloc_netdev: Unable to allocate device
> Many of these refer to a specific device and should be formatted with
> one of the netdev_* logging functions.
Not true.
These are in the alloc_netdev function where
netdev_<level> can not yet be successfully used.
^ permalink raw reply
* Re: [PATCH] net/core: Convert to current logging forms
From: Ben Hutchings @ 2011-06-28 20:36 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev, David S. Miller, Neil Horman, linux-kernel
In-Reply-To: <1309293068.29598.14.camel@Joe-Laptop>
On Tue, 2011-06-28 at 13:31 -0700, Joe Perches wrote:
> On Tue, 2011-06-28 at 21:21 +0100, Ben Hutchings wrote:
> > On Tue, 2011-06-28 at 12:40 -0700, Joe Perches wrote:
> > > Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
> > > Coalesce long formats.
> > [...]
> > > --- a/net/core/dev.c
> > > +++ b/net/core/dev.c
> > > @@ -72,6 +72,8 @@
> > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > [...]
> > KBUILD_MODNAME is presumably going to be "dev".
>
> 'tis.
>
> > That's not very meaningful.
>
> I think it's not useless though.
>
> Anything else you think it should be?
> Maybe "net_core_device:" or some such like that?
"netdev"
> Here are the format strings now prefaced by "dev:"
>
> $ strings net/core/built-in.o |grep "^<.>dev:"
> <6>dev: netif_stop_queue() cannot be called before register_netdev()
> <4>dev: dev_remove_pack: %p not found
> <3>dev: Loading kernel module for a network device with CAP_SYS_MODULE (deprecated)
> <0>dev: %s: failed to move %s to init_net: %d
> <3>dev: alloc_netdev: Unable to allocate device with zero queues
> <3>dev: alloc_netdev: Unable to allocate device with zero RX queues
> <3>dev: alloc_netdev: Unable to allocate device
Many of these refer to a specific device and should be formatted with
one of the netdev_* logging functions.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [RFC 43/72] a2065/ariadne: Move the a2065/ariadne drivers
From: Geert Uytterhoeven @ 2011-06-28 20:33 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: davem, netdev
In-Reply-To: <1309010363-22750-44-git-send-email-jeffrey.t.kirsher@intel.com>
On Sat, Jun 25, 2011 at 15:58, Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> --- a/drivers/net/ethernet/Kconfig
> +++ b/drivers/net/ethernet/Kconfig
> @@ -12,8 +12,31 @@ menuconfig ETHERNET
> if ETHERNET
>
> source "drivers/net/ethernet/3com/Kconfig"
> +
> +config A2065
> + tristate "A2065 support"
> + depends on ZORRO
> + select CRC32
> + ---help---
> + If you have a Commodore A2065 Ethernet adapter, say Y. Otherwise,
> + say N.
> +
> + To compile this driver as a module, choose M here: the module
> + will be called a2065.
> +
> source "drivers/net/ethernet/amd/Kconfig"
> source "drivers/net/ethernet/apple/Kconfig"
> +
> +config ARIADNE
> + tristate "Ariadne support"
> + depends on ZORRO
> + ---help---
> + If you have a Village Tronic Ariadne Ethernet adapter, say Y.
> + Otherwise, say N.
> +
> + To compile this driver as a module, choose M here: the module
> + will be called ariadne.
> +
> source "drivers/net/ethernet/arm/Kconfig"
> source "drivers/net/ethernet/atheros/Kconfig"
What's the rationale behind this "restructuring"?
FWIW, both the A2065 and Ariadne drivers are for AMD LANCE variants
(that is Am7990 and Am79C960)?
And (in some other patch) 82596.c is an Intel driver, not a Motorola driver.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH] net/core: Convert to current logging forms
From: Joe Perches @ 2011-06-28 20:31 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, David S. Miller, Neil Horman, linux-kernel
In-Reply-To: <1309292501.2771.48.camel@bwh-desktop>
On Tue, 2011-06-28 at 21:21 +0100, Ben Hutchings wrote:
> On Tue, 2011-06-28 at 12:40 -0700, Joe Perches wrote:
> > Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
> > Coalesce long formats.
> [...]
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -72,6 +72,8 @@
> > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> [...]
> KBUILD_MODNAME is presumably going to be "dev".
'tis.
> That's not very meaningful.
I think it's not useless though.
Anything else you think it should be?
Maybe "net_core_device:" or some such like that?
Here are the format strings now prefaced by "dev:"
$ strings net/core/built-in.o |grep "^<.>dev:"
<6>dev: netif_stop_queue() cannot be called before register_netdev()
<4>dev: dev_remove_pack: %p not found
<3>dev: Loading kernel module for a network device with CAP_SYS_MODULE (deprecated)
<0>dev: %s: failed to move %s to init_net: %d
<3>dev: alloc_netdev: Unable to allocate device with zero queues
<3>dev: alloc_netdev: Unable to allocate device with zero RX queues
<3>dev: alloc_netdev: Unable to allocate device
^ permalink raw reply
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: David Lamparter @ 2011-06-28 20:22 UTC (permalink / raw)
To: Nick Carter; +Cc: David Lamparter, Stephen Hemminger, netdev, davem
In-Reply-To: <BANLkTi=goXU4SpP6dxX9C+YeLcVMEkcKHw@mail.gmail.com>
On Tue, Jun 28, 2011 at 09:00:16PM +0100, Nick Carter wrote:
> >> /* If STP is turned off, then forward */
> >> - if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
> >> + if (p->br->stp_enabled == BR_NO_STP &&
> >> + (dest[5] == 0 || skb->protocol == htons(ETH_P_PAE)))
> >> goto forward;
> >> Nick
> >
> > That code actually looks quite wrong to me, we should be forwarding all of
> > the 01:80:C2:00:00:0x groups in non-STP mode, especially :0E and :0D.
> > (LLDP and GVRP/MVRP)
> >
> > Pause frames are the one exception that makes the rule, but as the
> > comment a few lines above states, "Pause frames shouldn't be passed up by
> > driver anyway".
> >
> > Btw, what might make sense is a general knob for forwarding those
> > link-local groups, split off from the STP switch so the STP switch
> > controls only the :00 (STP) group. That way you can decide separately
> > whether you want to be LLDP/GVRP/802.1X/... transparent and whether you
> > want to run STP.
>
> Sounds good to me. So we go for :03, :0D, and :0E. We cant touch :02 see:
> commit f01cb5fbea1c1613621f9f32f385e12c1a29dde0
> Revert "bridge: Forward reserved group addresses if !STP"
>
> > Not sure if it's needed, it can always be done with ebtables...
> What would be the ebtables rules to achieve the forwarding of :03 ? I
> asked this question on the netfilter list and the only response I got
> said ebtables was a filter and could not do this. :03 is hitting
> NF_BR_LOCAL_IN. How would you 'reinject' it so it is forwarded ?
'reinject' isn't possible when it hits that code path - which is pretty
much why I'm saying we should be forwarding everything in the non-STP
case.
I have to read up on the bonding interactions, but to my understanding
the only reasonable usage case is to have the bond below the bridge like
eth0 \
|- bond0 - br0
eth1 /
then the bonding should receive (and consume) the packets before they
reach the bridge.
(Some quick googling reveals that hardware switch chips special-drop
01:80:c2:00:00:01 [802.3x/pause] and :02 [802.3ad/lacp] and nothing
else - for the dumb ones anyway. It also seems like the match for pause
frames usually works on the address, not on the protocol field like we
do it...)
-David
^ permalink raw reply
* Re: [PATCH] net/core: Convert to current logging forms
From: Ben Hutchings @ 2011-06-28 20:21 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev, David S. Miller, Neil Horman, linux-kernel
In-Reply-To: <385ebf7e98e377e6e6c384beb961b65d4a95fb18.1309289792.git.joe@perches.com>
On Tue, 2011-06-28 at 12:40 -0700, Joe Perches wrote:
> Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
>
> Coalesce long formats.
[...]
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -72,6 +72,8 @@
> * - netif_rx() feedback
> */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
[...]
KBUILD_MODNAME is presumably going to be "dev". That's not very
meaningful.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* UNCLAIMED 1,650,000.00MILLION GBP STERLINGS!
From: BLACKBERRY 2011 EMAIL AWARDS @ 2011-06-28 19:09 UTC (permalink / raw)
Claims Agent/Lottery Attorney,
Barr. Mike Brown,
BlackBerry® Prize Claims Unit,
Regent Mayfair Building,
4th Floor, 153-155 Street,
London W1B 4JE, UK
Email:www-BlackBerry2011@live.com
phone: +44-70-4573-9682
Congratulations Dear Winner from the BLACKBERRY® Management and Staff.
Your email address was randomly selected by the BlackBerry Smart
Device (RASK) from an
Exclusive List of 21,000,000 Million internet users' e-mail addresses of
individuals and corporate entities cutting accross the globe, on 28th
June, 2011.
Your email address has been awarded the star-prize of
1,650,000.00 Million GBP(1 Million-6-Hundred-And-Fifty-Great Britain
Pounds Sterlings)
among the other consolation prize-winners.
Note:No tickets were sold! Your Winning No is: UK-094517-BB; Bonus NO
is: BB-0446-MP, Ticket No is :BB5050
File for your Claims today by forwarding the below details to:
www-blackberry2011@live.com to process your winning funds:::
Full Name.....................
Sex...........................
Winning Number................UK-094517-BB
Age.......................
Occupation....................
Mobile No.....................
Email Address.......
Residential Contact...........
Marital Status................
State and Nationality.........
...Congratulations from the BLACKBERRY® LOTTERY PRIZE PAYMENT UNIT,UK...
...Terms and Conditions apply...
CopyRight © 2011 BLACKBERRY® CORPORATION
^ permalink raw reply
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: Nick Carter @ 2011-06-28 20:00 UTC (permalink / raw)
To: David Lamparter; +Cc: Stephen Hemminger, netdev, davem
In-Reply-To: <20110628185811.GA2121496@jupiter.n2.diac24.net>
On 28 June 2011 19:58, David Lamparter <equinox@diac24.net> wrote:
> On Tue, Jun 28, 2011 at 07:34:57PM +0100, Nick Carter wrote:
>> > Yes, the default is a dumb hub (IMHO correctly so). And a dumb hub will
>> > forward 802.1X packets (IMHO also correctly so).
>> >
>> > Why should we specifically add a knob for EAPOL? Next we're adding one
>> > for STP itself, then one for LLDP, then one for Cisco's deprecated
>> > crap (CDP, DTP, ...) etc.
>> >
>> > If you want a dumb hub that drops EAPOL, use ebtables.
>> >
>> > -David
>> >
>> >
>> If we are not going to have an EAPOL knob, but we are going to act as
>> a repeater when STP is off then we still need these diffs to forward
>> the PAE group address.
>> (In fact we cant just act as a repeater because of the recent ethernet
>> bonding regression)
>>
>> diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
>> index 90e985b..267f581 100644
>> --- a/net/bridge/br_input.c
>> +++ b/net/bridge/br_input.c
>> @@ -163,7 +163,8 @@ struct sk_buff *br_handle_frame(struct sk_buff *skb)
>> goto drop;
>>
>> /* If STP is turned off, then forward */
>> - if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
>> + if (p->br->stp_enabled == BR_NO_STP &&
>> + (dest[5] == 0 || skb->protocol == htons(ETH_P_PAE)))
>> goto forward;
>> Nick
>
> That code actually looks quite wrong to me, we should be forwarding all of
> the 01:80:C2:00:00:0x groups in non-STP mode, especially :0E and :0D.
> (LLDP and GVRP/MVRP)
>
> Pause frames are the one exception that makes the rule, but as the
> comment a few lines above states, "Pause frames shouldn't be passed up by
> driver anyway".
>
> Btw, what might make sense is a general knob for forwarding those
> link-local groups, split off from the STP switch so the STP switch
> controls only the :00 (STP) group. That way you can decide separately
> whether you want to be LLDP/GVRP/802.1X/... transparent and whether you
> want to run STP.
Sounds good to me. So we go for :03, :0D, and :0E. We cant touch :02 see:
commit f01cb5fbea1c1613621f9f32f385e12c1a29dde0
Revert "bridge: Forward reserved group addresses if !STP"
> Not sure if it's needed, it can always be done with ebtables...
What would be the ebtables rules to achieve the forwarding of :03 ? I
asked this question on the netfilter list and the only response I got
said ebtables was a filter and could not do this. :03 is hitting
NF_BR_LOCAL_IN. How would you 'reinject' it so it is forwarded ?
Thanks
Nick
>
>
> -David
>
>
^ permalink raw reply
* [PATCH] net/core: Convert to current logging forms
From: Joe Perches @ 2011-06-28 19:40 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Neil Horman, linux-kernel
Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
Coalesce long formats.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/core/dev.c | 121 +++++++++++++++++++---------------------------
net/core/drop_monitor.c | 10 ++--
net/core/neighbour.c | 15 +++---
net/core/net_namespace.c | 6 ++-
net/core/netpoll.c | 60 +++++++++++-----------
net/core/pktgen.c | 27 +++++-----
net/core/rtnetlink.c | 9 ++--
net/core/skbuff.c | 24 ++++------
net/core/sock.c | 21 ++++----
9 files changed, 136 insertions(+), 157 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 6b6ef14..3401227 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -72,6 +72,8 @@
* - netif_rx() feedback
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/bitops.h>
@@ -433,7 +435,7 @@ void __dev_remove_pack(struct packet_type *pt)
}
}
- printk(KERN_WARNING "dev_remove_pack: %p not found.\n", pt);
+ pr_warn("dev_remove_pack: %p not found\n", pt);
out:
spin_unlock(&ptype_lock);
}
@@ -1026,9 +1028,8 @@ rollback:
memcpy(dev->name, oldname, IFNAMSIZ);
goto rollback;
} else {
- printk(KERN_ERR
- "%s: name change rollback failed: %d.\n",
- dev->name, ret);
+ netdev_err(dev, "name change rollback failed: %d\n",
+ ret);
}
}
@@ -1126,9 +1127,10 @@ void dev_load(struct net *net, const char *name)
no_module = request_module("netdev-%s", name);
if (no_module && capable(CAP_SYS_MODULE)) {
if (!request_module("%s", name))
- pr_err("Loading kernel module for a network device "
-"with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s "
-"instead\n", name);
+ pr_err(
+"Loading kernel module for a network device with CAP_SYS_MODULE (deprecated)\n"
+"Use CAP_NET_ADMIN and alias netdev-%s instead\n",
+ name);
}
}
EXPORT_SYMBOL(dev_load);
@@ -1569,10 +1571,8 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
if (skb_network_header(skb2) < skb2->data ||
skb2->network_header > skb2->tail) {
if (net_ratelimit())
- printk(KERN_CRIT "protocol %04x is "
- "buggy, dev %s\n",
- ntohs(skb2->protocol),
- dev->name);
+ netdev_crit(dev, "protocol %04x is buggy\n",
+ ntohs(skb2->protocol));
skb_reset_network_header(skb2);
}
@@ -1605,9 +1605,7 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq)
/* If TC0 is invalidated disable TC mapping */
if (tc->offset + tc->count > txq) {
- pr_warning("Number of in use tx queues changed "
- "invalidating tc mappings. Priority "
- "traffic classification disabled!\n");
+ netdev_warn(dev, "Number of in use tx queues changed invalidating tc mappings. Priority traffic classification disabled!\n");
dev->num_tc = 0;
return;
}
@@ -1618,11 +1616,8 @@ static void netif_setup_tc(struct net_device *dev, unsigned int txq)
tc = &dev->tc_to_txq[q];
if (tc->offset + tc->count > txq) {
- pr_warning("Number of in use tx queues "
- "changed. Priority %i to tc "
- "mapping %i is no longer valid "
- "setting map to 0\n",
- i, q);
+ netdev_warn(dev, "Number of in use tx queues changed. Priority %i to tc mapping %i is no longer valid. Setting map to 0.\n",
+ i, q);
netdev_set_prio_tc_map(dev, i, 0);
}
}
@@ -1919,8 +1914,7 @@ EXPORT_SYMBOL(skb_gso_segment);
void netdev_rx_csum_fault(struct net_device *dev)
{
if (net_ratelimit()) {
- printk(KERN_ERR "%s: hw csum failure.\n",
- dev ? dev->name : "<unknown>");
+ netdev_err(dev, "hw csum failure\n");
dump_stack();
}
}
@@ -2233,9 +2227,8 @@ static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index)
{
if (unlikely(queue_index >= dev->real_num_tx_queues)) {
if (net_ratelimit()) {
- pr_warning("%s selects TX queue %d, but "
- "real number of TX queues is %d\n",
- dev->name, queue_index, dev->real_num_tx_queues);
+ netdev_warn(dev, "selects TX queue %d, but real number of TX queues is %d\n",
+ queue_index, dev->real_num_tx_queues);
}
return 0;
}
@@ -2465,16 +2458,14 @@ int dev_queue_xmit(struct sk_buff *skb)
}
HARD_TX_UNLOCK(dev, txq);
if (net_ratelimit())
- printk(KERN_CRIT "Virtual device %s asks to "
- "queue packet!\n", dev->name);
+ netdev_crit(dev, "Virtual device asks to queue packet!\n");
} else {
/* Recursion is detected! It is possible,
* unfortunately
*/
recursion_alert:
if (net_ratelimit())
- printk(KERN_CRIT "Dead loop on virtual device "
- "%s, fix it urgently!\n", dev->name);
+ netdev_crit(dev, "Dead loop on virtual device, fix it urgently!\n");
}
}
@@ -2996,8 +2987,8 @@ static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq)
if (unlikely(MAX_RED_LOOP < ttl++)) {
if (net_ratelimit())
- pr_warning( "Redir loop detected Dropping packet (%d->%d)\n",
- skb->skb_iif, dev->ifindex);
+ netdev_warn(dev, "Redir loop detected - Dropping packet (%d->%d)\n",
+ skb->skb_iif, dev->ifindex);
return TC_ACT_SHOT;
}
@@ -4366,16 +4357,13 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc)
dev->flags &= ~IFF_PROMISC;
else {
dev->promiscuity -= inc;
- printk(KERN_WARNING "%s: promiscuity touches roof, "
- "set promiscuity failed, promiscuity feature "
- "of device might be broken.\n", dev->name);
+ netdev_warn(dev, "promiscuity touches roof, set promiscuity failed, promiscuity feature of device might be broken\n");
return -EOVERFLOW;
}
}
if (dev->flags != old_flags) {
- printk(KERN_INFO "device %s %s promiscuous mode\n",
- dev->name, (dev->flags & IFF_PROMISC) ? "entered" :
- "left");
+ netdev_info(dev, "%s promiscuous mode\n",
+ (dev->flags & IFF_PROMISC) ? "entered" : "left");
if (audit_enabled) {
current_uid_gid(&uid, &gid);
audit_log(current->audit_context, GFP_ATOMIC,
@@ -4448,9 +4436,7 @@ int dev_set_allmulti(struct net_device *dev, int inc)
dev->flags &= ~IFF_ALLMULTI;
else {
dev->allmulti -= inc;
- printk(KERN_WARNING "%s: allmulti touches roof, "
- "set allmulti failed, allmulti feature of "
- "device might be broken.\n", dev->name);
+ netdev_warn(dev, "allmulti touches roof, set allmulti failed, allmulti feature of device might be broken\n");
return -EOVERFLOW;
}
}
@@ -5127,8 +5113,8 @@ static void rollback_registered_many(struct list_head *head)
* devices and proceed with the remaining.
*/
if (dev->reg_state == NETREG_UNINITIALIZED) {
- pr_debug("unregister_netdevice: device %s/%p never "
- "was registered\n", dev->name, dev);
+ netdev_dbg(dev, "unregister_netdevice: (%p) device never was registered\n",
+ dev);
WARN_ON(1);
list_del(&dev->unreg_list);
@@ -5204,27 +5190,26 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
/* Fix illegal checksum combinations */
if ((features & NETIF_F_HW_CSUM) &&
(features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
- netdev_warn(dev, "mixed HW and IP checksum settings.\n");
+ netdev_warn(dev, "mixed HW and IP checksum settings\n");
features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM);
}
if ((features & NETIF_F_NO_CSUM) &&
(features & (NETIF_F_HW_CSUM|NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
- netdev_warn(dev, "mixed no checksumming and other settings.\n");
+ netdev_warn(dev, "mixed no checksumming and other settings\n");
features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM);
}
/* Fix illegal SG+CSUM combinations. */
if ((features & NETIF_F_SG) &&
!(features & NETIF_F_ALL_CSUM)) {
- netdev_dbg(dev,
- "Dropping NETIF_F_SG since no checksum feature.\n");
+ netdev_dbg(dev, "Dropping NETIF_F_SG since no checksum feature\n");
features &= ~NETIF_F_SG;
}
/* TSO requires that SG is present as well. */
if ((features & NETIF_F_ALL_TSO) && !(features & NETIF_F_SG)) {
- netdev_dbg(dev, "Dropping TSO features since no SG feature.\n");
+ netdev_dbg(dev, "Dropping TSO features since no SG feature\n");
features &= ~NETIF_F_ALL_TSO;
}
@@ -5234,7 +5219,7 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
/* Software GSO depends on SG. */
if ((features & NETIF_F_GSO) && !(features & NETIF_F_SG)) {
- netdev_dbg(dev, "Dropping NETIF_F_GSO since no SG feature.\n");
+ netdev_dbg(dev, "Dropping NETIF_F_GSO since no SG feature\n");
features &= ~NETIF_F_GSO;
}
@@ -5244,14 +5229,12 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
if (!((features & NETIF_F_GEN_CSUM) ||
(features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))
== (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
- netdev_dbg(dev,
- "Dropping NETIF_F_UFO since no checksum offload features.\n");
+ netdev_dbg(dev, "Dropping NETIF_F_UFO since no checksum offload features\n");
features &= ~NETIF_F_UFO;
}
if (!(features & NETIF_F_SG)) {
- netdev_dbg(dev,
- "Dropping NETIF_F_UFO since no NETIF_F_SG feature.\n");
+ netdev_dbg(dev, "Dropping NETIF_F_UFO since no NETIF_F_SG feature\n");
features &= ~NETIF_F_UFO;
}
}
@@ -5279,15 +5262,14 @@ int __netdev_update_features(struct net_device *dev)
return 0;
netdev_dbg(dev, "Features changed: 0x%08x -> 0x%08x\n",
- dev->features, features);
+ dev->features, features);
if (dev->netdev_ops->ndo_set_features)
err = dev->netdev_ops->ndo_set_features(dev, features);
if (unlikely(err < 0)) {
- netdev_err(dev,
- "set_features() failed (%d); wanted 0x%08x, left 0x%08x\n",
- err, features, dev->features);
+ netdev_err(dev, "set_features() failed (%d); wanted 0x%08x, left 0x%08x\n",
+ err, features, dev->features);
return -1;
}
@@ -5366,7 +5348,8 @@ static int netif_alloc_rx_queues(struct net_device *dev)
rx = kcalloc(count, sizeof(struct netdev_rx_queue), GFP_KERNEL);
if (!rx) {
- pr_err("netdev: Unable to allocate %u rx queues.\n", count);
+ netdev_err(dev, "netdev: Unable to allocate %u rx queues\n",
+ count);
return -ENOMEM;
}
dev->_rx = rx;
@@ -5397,8 +5380,8 @@ static int netif_alloc_netdev_queues(struct net_device *dev)
tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL);
if (!tx) {
- pr_err("netdev: Unable to allocate %u tx queues.\n",
- count);
+ netdev_err(dev, "netdev: Unable to allocate %u tx queues\n",
+ count);
return -ENOMEM;
}
dev->_tx = tx;
@@ -5658,10 +5641,8 @@ static void netdev_wait_allrefs(struct net_device *dev)
refcnt = netdev_refcnt_read(dev);
if (time_after(jiffies, warning_time + 10 * HZ)) {
- printk(KERN_EMERG "unregister_netdevice: "
- "waiting for %s to become free. Usage "
- "count = %d\n",
- dev->name, refcnt);
+ netdev_emerg(dev, "unregister_netdevice: waiting to become free. Usage count = %d\n",
+ refcnt);
warning_time = jiffies;
}
}
@@ -5706,8 +5687,8 @@ void netdev_run_todo(void)
list_del(&dev->todo_list);
if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) {
- printk(KERN_ERR "network todo '%s' but state %d\n",
- dev->name, dev->reg_state);
+ netdev_err(dev, "network todo but state %d\n",
+ dev->reg_state);
dump_stack();
continue;
}
@@ -5822,15 +5803,13 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
BUG_ON(strlen(name) >= sizeof(dev->name));
if (txqs < 1) {
- pr_err("alloc_netdev: Unable to allocate device "
- "with zero queues.\n");
+ pr_err("alloc_netdev: Unable to allocate device with zero queues\n");
return NULL;
}
#ifdef CONFIG_RPS
if (rxqs < 1) {
- pr_err("alloc_netdev: Unable to allocate device "
- "with zero RX queues.\n");
+ pr_err("alloc_netdev: Unable to allocate device with zero RX queues\n");
return NULL;
}
#endif
@@ -5846,7 +5825,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
p = kzalloc(alloc_size, GFP_KERNEL);
if (!p) {
- printk(KERN_ERR "alloc_netdev: Unable to allocate device.\n");
+ pr_err("alloc_netdev: Unable to allocate device\n");
return NULL;
}
@@ -6380,8 +6359,8 @@ static void __net_exit default_device_exit(struct net *net)
snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex);
err = dev_change_net_namespace(dev, &init_net, fb_name);
if (err) {
- printk(KERN_EMERG "%s: failed to move %s to init_net: %d\n",
- __func__, dev->name, err);
+ pr_emerg("%s: failed to move %s to init_net: %d\n",
+ __func__, dev->name, err);
BUG();
}
}
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 7f36b38..b1677c4 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -4,6 +4,8 @@
* Copyright (C) 2009 Neil Horman <nhorman@tuxdriver.com>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/string.h>
@@ -342,10 +344,10 @@ static int __init init_net_drop_monitor(void)
struct per_cpu_dm_data *data;
int cpu, rc;
- printk(KERN_INFO "Initializing network drop monitor service\n");
+ pr_info("Initializing network drop monitor service\n");
if (sizeof(void *) > 8) {
- printk(KERN_ERR "Unable to store program counters on this arch, Drop monitor failed\n");
+ pr_err("Unable to store program counters on this arch, Drop monitor failed\n");
return -ENOSPC;
}
@@ -353,13 +355,13 @@ static int __init init_net_drop_monitor(void)
dropmon_ops,
ARRAY_SIZE(dropmon_ops));
if (rc) {
- printk(KERN_ERR "Could not create drop monitor netlink family\n");
+ pr_err("Could not create drop monitor netlink family\n");
return rc;
}
rc = register_netdevice_notifier(&dropmon_net_notifier);
if (rc < 0) {
- printk(KERN_CRIT "Failed to register netdevice notifier\n");
+ pr_crit("Failed to register netdevice notifier\n");
goto out_unreg;
}
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index ceb505b..adcf198 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -15,6 +15,8 @@
* Harald Welte Add neighbour cache statistics like rtstat
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -693,14 +695,13 @@ void neigh_destroy(struct neighbour *neigh)
NEIGH_CACHE_STAT_INC(neigh->tbl, destroys);
if (!neigh->dead) {
- printk(KERN_WARNING
- "Destroying alive neighbour %p\n", neigh);
+ pr_warn("Destroying alive neighbour %p\n", neigh);
dump_stack();
return;
}
if (neigh_del_timer(neigh))
- printk(KERN_WARNING "Impossible event.\n");
+ pr_warn("Impossible event\n");
while ((hh = neigh->hh) != NULL) {
neigh->hh = hh->hh_next;
@@ -882,7 +883,7 @@ static void neigh_timer_handler(unsigned long arg)
if (!(state & NUD_IN_TIMER)) {
#ifndef CONFIG_SMP
- printk(KERN_WARNING "neigh: timer & !nud_in_timer\n");
+ pr_warn("timer & !nud_in_timer\n");
#endif
goto out;
}
@@ -1575,8 +1576,8 @@ void neigh_table_init(struct neigh_table *tbl)
write_unlock(&neigh_tbl_lock);
if (unlikely(tmp)) {
- printk(KERN_ERR "NEIGH: Registering multiple tables for "
- "family %d\n", tbl->family);
+ pr_err("Registering multiple tables for family %d\n",
+ tbl->family);
dump_stack();
}
}
@@ -1592,7 +1593,7 @@ int neigh_table_clear(struct neigh_table *tbl)
pneigh_queue_purge(&tbl->proxy_queue);
neigh_ifdown(tbl, NULL);
if (atomic_read(&tbl->entries))
- printk(KERN_CRIT "neighbour leakage\n");
+ pr_crit("neighbour leakage\n");
write_lock(&neigh_tbl_lock);
for (tp = &neigh_tables; *tp; tp = &(*tp)->next) {
if (*tp == tbl) {
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index ea489db..95ac0de 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/workqueue.h>
#include <linux/rtnetlink.h>
#include <linux/cache.h>
@@ -202,8 +204,8 @@ static void net_free(struct net *net)
{
#ifdef NETNS_REFCNT_DEBUG
if (unlikely(atomic_read(&net->use_count) != 0)) {
- printk(KERN_EMERG "network namespace not free! Usage: %d\n",
- atomic_read(&net->use_count));
+ pr_emerg("network namespace not free! Usage: %d\n",
+ atomic_read(&net->use_count));
return;
}
#endif
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 18d9cbd..25e9af5 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -9,6 +9,8 @@
* Copyright (C) 2002 Red Hat, Inc.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/moduleparam.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
@@ -629,18 +631,18 @@ out:
void netpoll_print_options(struct netpoll *np)
{
- printk(KERN_INFO "%s: local port %d\n",
- np->name, np->local_port);
- printk(KERN_INFO "%s: local IP %pI4\n",
- np->name, &np->local_ip);
- printk(KERN_INFO "%s: interface '%s'\n",
- np->name, np->dev_name);
- printk(KERN_INFO "%s: remote port %d\n",
- np->name, np->remote_port);
- printk(KERN_INFO "%s: remote IP %pI4\n",
- np->name, &np->remote_ip);
- printk(KERN_INFO "%s: remote ethernet address %pM\n",
- np->name, np->remote_mac);
+ pr_info("%s: local port %d\n",
+ np->name, np->local_port);
+ pr_info("%s: local IP %pI4\n",
+ np->name, &np->local_ip);
+ pr_info("%s: interface '%s'\n",
+ np->name, np->dev_name);
+ pr_info("%s: remote port %d\n",
+ np->name, np->remote_port);
+ pr_info("%s: remote IP %pI4\n",
+ np->name, &np->remote_ip);
+ pr_info("%s: remote ethernet address %pM\n",
+ np->name, np->remote_mac);
}
EXPORT_SYMBOL(netpoll_print_options);
@@ -682,8 +684,8 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
goto parse_failed;
*delim = 0;
if (*cur == ' ' || *cur == '\t')
- printk(KERN_INFO "%s: warning: whitespace"
- "is not allowed\n", np->name);
+ pr_info("%s: warning: whitespace is not allowed\n",
+ np->name);
np->remote_port = simple_strtol(cur, NULL, 10);
cur = delim;
}
@@ -707,8 +709,8 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
return 0;
parse_failed:
- printk(KERN_INFO "%s: couldn't parse config at '%s'!\n",
- np->name, cur);
+ pr_info("%s: couldn't parse config at '%s'!\n",
+ np->name, cur);
return -1;
}
EXPORT_SYMBOL(netpoll_parse_options);
@@ -723,7 +725,7 @@ int __netpoll_setup(struct netpoll *np)
if ((ndev->priv_flags & IFF_DISABLE_NETPOLL) ||
!ndev->netdev_ops->ndo_poll_controller) {
- printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n",
+ pr_err("%s: %s doesn't support polling, aborting\n",
np->name, np->dev_name);
err = -ENOTSUPP;
goto out;
@@ -787,13 +789,13 @@ int netpoll_setup(struct netpoll *np)
if (np->dev_name)
ndev = dev_get_by_name(&init_net, np->dev_name);
if (!ndev) {
- printk(KERN_ERR "%s: %s doesn't exist, aborting.\n",
+ pr_err("%s: %s doesn't exist, aborting\n",
np->name, np->dev_name);
return -ENODEV;
}
if (ndev->master) {
- printk(KERN_ERR "%s: %s is a slave device, aborting.\n",
+ pr_err("%s: %s is a slave device, aborting\n",
np->name, np->dev_name);
err = -EBUSY;
goto put;
@@ -802,15 +804,15 @@ int netpoll_setup(struct netpoll *np)
if (!netif_running(ndev)) {
unsigned long atmost, atleast;
- printk(KERN_INFO "%s: device %s not up yet, forcing it\n",
- np->name, np->dev_name);
+ pr_info("%s: device %s not up yet, forcing it\n",
+ np->name, np->dev_name);
rtnl_lock();
err = dev_open(ndev);
rtnl_unlock();
if (err) {
- printk(KERN_ERR "%s: failed to open %s\n",
+ pr_err("%s: failed to open %s\n",
np->name, ndev->name);
goto put;
}
@@ -819,9 +821,8 @@ int netpoll_setup(struct netpoll *np)
atmost = jiffies + carrier_timeout * HZ;
while (!netif_carrier_ok(ndev)) {
if (time_after(jiffies, atmost)) {
- printk(KERN_NOTICE
- "%s: timeout waiting for carrier\n",
- np->name);
+ pr_notice("%s: timeout waiting for carrier\n",
+ np->name);
break;
}
msleep(1);
@@ -833,9 +834,8 @@ int netpoll_setup(struct netpoll *np)
*/
if (time_before(jiffies, atleast)) {
- printk(KERN_NOTICE "%s: carrier detect appears"
- " untrustworthy, waiting 4 seconds\n",
- np->name);
+ pr_notice("%s: carrier detect appears untrustworthy, waiting 4 seconds\n",
+ np->name);
msleep(4000);
}
}
@@ -846,7 +846,7 @@ int netpoll_setup(struct netpoll *np)
if (!in_dev || !in_dev->ifa_list) {
rcu_read_unlock();
- printk(KERN_ERR "%s: no IP address for %s, aborting\n",
+ pr_err("%s: no IP address for %s, aborting\n",
np->name, np->dev_name);
err = -EDESTADDRREQ;
goto put;
@@ -854,7 +854,7 @@ int netpoll_setup(struct netpoll *np)
np->local_ip = in_dev->ifa_list->ifa_local;
rcu_read_unlock();
- printk(KERN_INFO "%s: local IP %pI4\n", np->name, &np->local_ip);
+ pr_info("%s: local IP %pI4\n", np->name, &np->local_ip);
}
np->dev = ndev;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index f76079c..be6224c 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -505,7 +505,7 @@ static ssize_t pgctrl_write(struct file *file, const char __user *buf,
pktgen_reset_all_threads();
else
- pr_warning("Unknown command: %s\n", data);
+ pr_warn("Unknown command: %s\n", data);
err = count;
@@ -855,14 +855,14 @@ static ssize_t pktgen_if_write(struct file *file,
pg_result = &(pkt_dev->result[0]);
if (count < 1) {
- pr_warning("wrong command format\n");
+ pr_warn("wrong command format\n");
return -EINVAL;
}
max = count;
tmp = count_trail_chars(user_buffer, max);
if (tmp < 0) {
- pr_warning("illegal format\n");
+ pr_warn("illegal format\n");
return tmp;
}
i = tmp;
@@ -2020,15 +2020,15 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
ntxq = pkt_dev->odev->real_num_tx_queues;
if (ntxq <= pkt_dev->queue_map_min) {
- pr_warning("WARNING: Requested queue_map_min (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n",
- pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq,
- pkt_dev->odevname);
+ pr_warn("WARNING: Requested queue_map_min (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n",
+ pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq,
+ pkt_dev->odevname);
pkt_dev->queue_map_min = ntxq - 1;
}
if (pkt_dev->queue_map_max >= ntxq) {
- pr_warning("WARNING: Requested queue_map_max (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n",
- pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq,
- pkt_dev->odevname);
+ pr_warn("WARNING: Requested queue_map_max (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n",
+ pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq,
+ pkt_dev->odevname);
pkt_dev->queue_map_max = ntxq - 1;
}
@@ -3159,8 +3159,7 @@ static int pktgen_stop_device(struct pktgen_dev *pkt_dev)
int nr_frags = pkt_dev->skb ? skb_shinfo(pkt_dev->skb)->nr_frags : -1;
if (!pkt_dev->running) {
- pr_warning("interface: %s is already stopped\n",
- pkt_dev->odevname);
+ pr_warn("interface: %s is already stopped\n", pkt_dev->odevname);
return -EINVAL;
}
@@ -3675,7 +3674,7 @@ static int pktgen_remove_device(struct pktgen_thread *t,
pr_debug("remove_device pkt_dev=%p\n", pkt_dev);
if (pkt_dev->running) {
- pr_warning("WARNING: trying to remove a running interface, stopping it now\n");
+ pr_warn("WARNING: trying to remove a running interface, stopping it now\n");
pktgen_stop_device(pkt_dev);
}
@@ -3729,8 +3728,8 @@ static int __init pg_init(void)
err = pktgen_create_thread(cpu);
if (err)
- pr_warning("WARNING: Cannot create thread for cpu %d (%d)\n",
- cpu, err);
+ pr_warn("WARNING: Cannot create thread for cpu %d (%d)\n",
+ cpu, err);
}
if (list_empty(&pktgen_threads)) {
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index a798fc6..53fc9f6 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -16,6 +16,8 @@
* Vitaly E. Lavrov RTA_OK arithmetics was wrong.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/types.h>
@@ -1468,10 +1470,9 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
errout:
if (err < 0 && modified && net_ratelimit())
- printk(KERN_WARNING "A link change request failed with "
- "some changes committed already. Interface %s may "
- "have been left with an inconsistent configuration, "
- "please check.\n", dev->name);
+ netdev_warn(dev,
+"A link change request failed with some changes committed already.\n"
+"Interface may have been left with an inconsistent configuration, please check.\n");
if (send_addr_notify)
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 46cbd28..e67b4a4 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -120,11 +120,9 @@ static const struct pipe_buf_operations sock_pipe_buf_ops = {
*/
static void skb_over_panic(struct sk_buff *skb, int sz, void *here)
{
- printk(KERN_EMERG "skb_over_panic: text:%p len:%d put:%d head:%p "
- "data:%p tail:%#lx end:%#lx dev:%s\n",
- here, skb->len, sz, skb->head, skb->data,
- (unsigned long)skb->tail, (unsigned long)skb->end,
- skb->dev ? skb->dev->name : "<NULL>");
+ netdev_emerg(skb->dev, "skb_over_panic: text:%p len:%d put:%d head:%p data:%p tail:%#lx end:%#lx\n",
+ here, skb->len, sz, skb->head, skb->data,
+ (unsigned long)skb->tail, (unsigned long)skb->end);
BUG();
}
@@ -139,11 +137,9 @@ static void skb_over_panic(struct sk_buff *skb, int sz, void *here)
static void skb_under_panic(struct sk_buff *skb, int sz, void *here)
{
- printk(KERN_EMERG "skb_under_panic: text:%p len:%d put:%d head:%p "
- "data:%p tail:%#lx end:%#lx dev:%s\n",
- here, skb->len, sz, skb->head, skb->data,
- (unsigned long)skb->tail, (unsigned long)skb->end,
- skb->dev ? skb->dev->name : "<NULL>");
+ netdev_emerg(skb->dev, "skb_under_panic: text:%p len:%d put:%d head:%p data:%p tail:%#lx end:%#lx\n",
+ here, skb->len, sz, skb->head, skb->data,
+ (unsigned long)skb->tail, (unsigned long)skb->end);
BUG();
}
@@ -3061,9 +3057,8 @@ bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off)
if (unlikely(start > skb_headlen(skb)) ||
unlikely((int)start + off > skb_headlen(skb) - 2)) {
if (net_ratelimit())
- printk(KERN_WARNING
- "bad partial csum: csum=%u/%u len=%u\n",
- start, off, skb_headlen(skb));
+ netdev_warn(skb->dev, "bad partial csum: csum=%u/%u len=%u\n",
+ start, off, skb_headlen(skb));
return false;
}
skb->ip_summed = CHECKSUM_PARTIAL;
@@ -3076,7 +3071,6 @@ EXPORT_SYMBOL_GPL(skb_partial_csum_set);
void __skb_warn_lro_forwarding(const struct sk_buff *skb)
{
if (net_ratelimit())
- pr_warning("%s: received packets cannot be forwarded"
- " while LRO is enabled\n", skb->dev->name);
+ netdev_warn(skb->dev, "received packets cannot be forwarded while LRO is enabled\n");
}
EXPORT_SYMBOL(__skb_warn_lro_forwarding);
diff --git a/net/core/sock.c b/net/core/sock.c
index 76c4031..26254ca 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -89,6 +89,8 @@
* 2 of the License, or (at your option) any later version.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/types.h>
@@ -243,8 +245,7 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen)
*timeo_p = 0;
if (warned < 10 && net_ratelimit()) {
warned++;
- printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) "
- "tries to set negative timeout\n",
+ pr_info("sock_set_timeout: `%s' (pid %d) tries to set negative timeout\n",
current->comm, task_pid_nr(current));
}
return 0;
@@ -263,8 +264,8 @@ static void sock_warn_obsolete_bsdism(const char *name)
static char warncomm[TASK_COMM_LEN];
if (strcmp(warncomm, current->comm) && warned < 5) {
strcpy(warncomm, current->comm);
- printk(KERN_WARNING "process `%s' is using obsolete "
- "%s SO_BSDCOMPAT\n", warncomm, name);
+ pr_warn("process `%s' is using obsolete %s SO_BSDCOMPAT\n",
+ warncomm, name);
warned++;
}
}
@@ -1165,7 +1166,7 @@ static void __sk_free(struct sock *sk)
sock_disable_timestamp(sk, SOCK_TIMESTAMPING_RX_SOFTWARE);
if (atomic_read(&sk->sk_omem_alloc))
- printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected.\n",
+ printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected\n",
__func__, atomic_read(&sk->sk_omem_alloc));
if (sk->sk_peer_cred)
@@ -2336,7 +2337,7 @@ static void assign_proto_idx(struct proto *prot)
prot->inuse_idx = find_first_zero_bit(proto_inuse_idx, PROTO_INUSE_NR);
if (unlikely(prot->inuse_idx == PROTO_INUSE_NR - 1)) {
- printk(KERN_ERR "PROTO_INUSE_NR exhausted\n");
+ pr_err("PROTO_INUSE_NR exhausted\n");
return;
}
@@ -2366,8 +2367,8 @@ int proto_register(struct proto *prot, int alloc_slab)
NULL);
if (prot->slab == NULL) {
- printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n",
- prot->name);
+ pr_crit("%s: Can't create sock SLAB cache!\n",
+ prot->name);
goto out;
}
@@ -2381,8 +2382,8 @@ int proto_register(struct proto *prot, int alloc_slab)
SLAB_HWCACHE_ALIGN, NULL);
if (prot->rsk_prot->slab == NULL) {
- printk(KERN_CRIT "%s: Can't create request sock SLAB cache!\n",
- prot->name);
+ pr_crit("%s: Can't create request sock SLAB cache!\n",
+ prot->name);
goto out_free_request_sock_slab_name;
}
}
--
1.7.6.rc1
^ permalink raw reply related
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: David Lamparter @ 2011-06-28 18:58 UTC (permalink / raw)
To: Nick Carter; +Cc: David Lamparter, Stephen Hemminger, netdev, davem
In-Reply-To: <BANLkTikDqjErqBmfwrN6SJPgPjmmMfJw7g@mail.gmail.com>
On Tue, Jun 28, 2011 at 07:34:57PM +0100, Nick Carter wrote:
> > Yes, the default is a dumb hub (IMHO correctly so). And a dumb hub will
> > forward 802.1X packets (IMHO also correctly so).
> >
> > Why should we specifically add a knob for EAPOL? Next we're adding one
> > for STP itself, then one for LLDP, then one for Cisco's deprecated
> > crap (CDP, DTP, ...) etc.
> >
> > If you want a dumb hub that drops EAPOL, use ebtables.
> >
> > -David
> >
> >
> If we are not going to have an EAPOL knob, but we are going to act as
> a repeater when STP is off then we still need these diffs to forward
> the PAE group address.
> (In fact we cant just act as a repeater because of the recent ethernet
> bonding regression)
>
> diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
> index 90e985b..267f581 100644
> --- a/net/bridge/br_input.c
> +++ b/net/bridge/br_input.c
> @@ -163,7 +163,8 @@ struct sk_buff *br_handle_frame(struct sk_buff *skb)
> goto drop;
>
> /* If STP is turned off, then forward */
> - if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
> + if (p->br->stp_enabled == BR_NO_STP &&
> + (dest[5] == 0 || skb->protocol == htons(ETH_P_PAE)))
> goto forward;
> Nick
That code actually looks quite wrong to me, we should be forwarding all of
the 01:80:C2:00:00:0x groups in non-STP mode, especially :0E and :0D.
(LLDP and GVRP/MVRP)
Pause frames are the one exception that makes the rule, but as the
comment a few lines above states, "Pause frames shouldn't be passed up by
driver anyway".
Btw, what might make sense is a general knob for forwarding those
link-local groups, split off from the STP switch so the STP switch
controls only the :00 (STP) group. That way you can decide separately
whether you want to be LLDP/GVRP/802.1X/... transparent and whether you
want to run STP.
Not sure if it's needed, it can always be done with ebtables...
-David
^ permalink raw reply
* [PATCH] [v3][net][bna] Fix call trace when interrupts are disabled while sleeping function kzalloc is called
From: Shyam Iyer @ 2011-06-28 18:58 UTC (permalink / raw)
To: netdev; +Cc: rmody, ddutt, huangj, davem, Shyam Iyer
request_threaded irq will call kzalloc that can sleep. Initializing the flags variable outside of spin_lock_irqsave/restore in bnad_mbox_irq_alloc will avoid call traces like below.
Jun 27 08:15:24 home-t710 kernel: [11735.634550] Brocade 10G Ethernet driver
Jun 27 08:15:24 home-t710 kernel: [11735.634590] bnad_pci_probe : (0xffff880427f3d000, 0xffffffffa020f3e0) PCI Func : (2)
Jun 27 08:15:24 home-t710 kernel: [11735.637677] bna 0000:82:00.2: PCI INT A -> GSI 66 (level, low) -> IRQ 66
Jun 27 08:15:24 home-t710 kernel: [11735.638290] bar0 mapped to ffffc90014980000, len 262144
Jun 27 08:15:24 home-t710 kernel: [11735.638732] BUG: sleeping function called from invalid context at mm/slub.c:847
Jun 27 08:15:24 home-t710 kernel: [11735.638736] in_atomic(): 0, irqs_disabled(): 1, pid: 11243, name: insmod
Jun 27 08:15:24 home-t710 kernel: [11735.638740] Pid: 11243, comm: insmod Not tainted 3.0.0-rc4+ #6
Jun 27 08:15:24 home-t710 kernel: [11735.638743] Call Trace:
Jun 27 08:15:24 home-t710 kernel: [11735.638755] [<ffffffff81046427>] __might_sleep+0xeb/0xf0
Jun 27 08:15:24 home-t710 kernel: [11735.638766] [<ffffffffa01fe469>] ? netif_wake_queue+0x3d/0x3d [bna]
Jun 27 08:15:24 home-t710 kernel: [11735.638773] [<ffffffff8111201c>] kmem_cache_alloc_trace+0x43/0xd8
Jun 27 08:15:24 home-t710 kernel: [11735.638782] [<ffffffffa01fe469>] ? netif_wake_queue+0x3d/0x3d [bna]
Jun 27 08:15:24 home-t710 kernel: [11735.638787] [<ffffffff810ab791>] request_threaded_irq+0xa1/0x113
Jun 27 08:15:24 home-t710 kernel: [11735.638798] [<ffffffffa020f0c0>] bnad_pci_probe+0x612/0x8e5 [bna]
Jun 27 08:15:24 home-t710 kernel: [11735.638807] [<ffffffffa01fe469>] ? netif_wake_queue+0x3d/0x3d [bna]
Jun 27 08:15:24 home-t710 kernel: [11735.638816] [<ffffffff81482ef4>] ? _raw_spin_unlock_irqrestore+0x17/0x19
Jun 27 08:15:24 home-t710 kernel: [11735.638822] [<ffffffff8124d17a>] local_pci_probe+0x44/0x75
Jun 27 08:15:24 home-t710 kernel: [11735.638826] [<ffffffff8124dc06>] pci_device_probe+0xd0/0xff
Jun 27 08:15:24 home-t710 kernel: [11735.638832] [<ffffffff812ef8ab>] driver_probe_device+0x131/0x213
Jun 27 08:15:24 home-t710 kernel: [11735.638836] [<ffffffff812ef9e7>] __driver_attach+0x5a/0x7e
Jun 27 08:15:24 home-t710 kernel: [11735.638840] [<ffffffff812ef98d>] ? driver_probe_device+0x213/0x213
Jun 27 08:15:24 home-t710 kernel: [11735.638844] [<ffffffff812ee933>] bus_for_each_dev+0x53/0x89
Jun 27 08:15:24 home-t710 kernel: [11735.638848] [<ffffffff812ef48a>] driver_attach+0x1e/0x20
Jun 27 08:15:24 home-t710 kernel: [11735.638852] [<ffffffff812ef0ae>] bus_add_driver+0xd1/0x224
Jun 27 08:15:24 home-t710 kernel: [11735.638858] [<ffffffffa01b8000>] ? 0xffffffffa01b7fff
Jun 27 08:15:24 home-t710 kernel: [11735.638862] [<ffffffff812efe57>] driver_register+0x98/0x105
Jun 27 08:15:24 home-t710 kernel: [11735.638866] [<ffffffffa01b8000>] ? 0xffffffffa01b7fff
Jun 27 08:15:24 home-t710 kernel: [11735.638871] [<ffffffff8124e4c9>] __pci_register_driver+0x56/0xc1
Jun 27 08:15:24 home-t710 kernel: [11735.638875] [<ffffffffa01b8000>] ? 0xffffffffa01b7fff
Jun 27 08:15:24 home-t710 kernel: [11735.638884] [<ffffffffa01b8040>] bnad_module_init+0x40/0x60 [bna]
Jun 27 08:15:24 home-t710 kernel: [11735.638892] [<ffffffff81002099>] do_one_initcall+0x7f/0x136
Jun 27 08:15:24 home-t710 kernel: [11735.638899] [<ffffffff8108608b>] sys_init_module+0x88/0x1d0
Jun 27 08:15:24 home-t710 kernel: [11735.638906] [<ffffffff81489682>] system_call_fastpath+0x16/0x1b
Jun 27 08:15:24 home-t710 kernel: [11735.639642] bnad_pci_probe : (0xffff880427f3e000, 0xffffffffa020f3e0) PCI Func : (3)
Jun 27 08:15:24 home-t710 kernel: [11735.639665] bna 0000:82:00.3: PCI INT A -> GSI 66 (level, low) -> IRQ 66
Jun 27 08:15:24 home-t710 kernel: [11735.639735] bar0 mapped to ffffc90014400000, len 262144
Signed-off-by: Shyam Iyer <shyam_iyer@dell.com>
---
drivers/net/bna/bnad.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index 7d25a97..44e219c 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -1111,7 +1111,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
struct bna_intr_info *intr_info)
{
int err = 0;
- unsigned long flags;
+ unsigned long irq_flags = 0, flags;
u32 irq;
irq_handler_t irq_handler;
@@ -1125,18 +1125,17 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
if (bnad->cfg_flags & BNAD_CF_MSIX) {
irq_handler = (irq_handler_t)bnad_msix_mbox_handler;
irq = bnad->msix_table[bnad->msix_num - 1].vector;
- flags = 0;
intr_info->intr_type = BNA_INTR_T_MSIX;
intr_info->idl[0].vector = bnad->msix_num - 1;
} else {
irq_handler = (irq_handler_t)bnad_isr;
irq = bnad->pcidev->irq;
- flags = IRQF_SHARED;
+ irq_flags = IRQF_SHARED;
intr_info->intr_type = BNA_INTR_T_INTX;
/* intr_info->idl.vector = 0 ? */
}
spin_unlock_irqrestore(&bnad->bna_lock, flags);
-
+ flags = irq_flags;
sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME);
/*
--
1.7.5.4
^ permalink raw reply related
* RE: [PATCH] [net][bna] Fix call trace when interrupts are disabled while sleeping function kzalloc is called
From: Shyam_Iyer @ 2011-06-28 18:48 UTC (permalink / raw)
To: rmody, davem, shyam.iyer.t; +Cc: netdev, ddutt, huangj
In-Reply-To: <E5313AF6F2BFD14293E5FD0F94750F86A82D66F5E5@HQ1-EXCH01.corp.brocade.com>
> -----Original Message-----
> From: Rasesh Mody [mailto:rmody@brocade.com]
> Sent: Tuesday, June 28, 2011 1:28 PM
> To: Iyer, Shyam; davem@davemloft.net; shyam.iyer.t@gmail.com
> Cc: netdev@vger.kernel.org; Debashis Dutt; Jing Huang
> Subject: RE: [PATCH] [net][bna] Fix call trace when interrupts are
> disabled while sleeping function kzalloc is called
>
> >From: Shyam_Iyer@Dell.com [mailto:Shyam_Iyer@Dell.com]
> >Sent: Tuesday, June 28, 2011 9:30 AM
> >
> >Here is try 2.
> >
> >I found that I had to initialize the flags variable outside the
> >spin_lock_irqsave in the following way to fix the problem. The
> sleeping
> >kzalloc function is in fact in the request_threaded_irq call which
> >allocates the irq handler function and its flags arguments.
> >
> >Attached patch fixes the issue.
>
> The attached patch may fix the issue in MSIX mode, however we'll
> continue to see the issue in INTX mode. Using a separate irq_flags may
> be a good idea.
You are right.. Resending another version.
-Shyam
^ permalink raw reply
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: Nick Carter @ 2011-06-28 18:34 UTC (permalink / raw)
To: David Lamparter; +Cc: Stephen Hemminger, netdev, davem
In-Reply-To: <20110628160018.GC126252@jupiter.n2.diac24.net>
On 28 June 2011 17:00, David Lamparter <equinox@diac24.net> wrote:
> On Tue, Jun 28, 2011 at 08:10:15AM -0700, Stephen Hemminger wrote:
>> On Tue, 28 Jun 2011 17:02:57 +0200
>> David Lamparter <equinox@diac24.net> wrote:
>> > > if (skb) {
>> > > + /* Prevent Crosstalk where a Supplicant on one Port attempts to
>> > > + * interfere with authentications occurring on another Port.
>> > > + * (IEEE Std 802.1X-2001 C.3.3)
>> > > + */
>> > > + if (unlikely(!br->pae_forward &&
>> > > + skb->protocol == htons(ETH_P_PAE)))
>> >
>> > No, please don't.
>> >
>> > Linux bridging has two "grand" modes: dumb and STP enabled.
>> >
>> > If we're running a dumb bridge, we behave like an ethernet hub without
>> > any intelligence, and in that case we should absolutely forward 802.1X
>> > frames. We may have (e.g. VM) client(s) that want to authenticate with a
>> > physical switch.
>> > (For the spec, this counts as "repeater", not "bridge"/"switch")
>> >
>> > If we're running with STP enabled, then 802.1X traffic should already be
>> > caught by the general ethernet link-local multicast drop (which applies
>> > to 01:80:c2:/24 and therefore catches 802.1X too.)
>>
>> The problem is that STP is not enabled by default, and most people don't
>> know how to enable it.
>
> Yes, the default is a dumb hub (IMHO correctly so). And a dumb hub will
> forward 802.1X packets (IMHO also correctly so).
>
> Why should we specifically add a knob for EAPOL? Next we're adding one
> for STP itself, then one for LLDP, then one for Cisco's deprecated
> crap (CDP, DTP, ...) etc.
>
> If you want a dumb hub that drops EAPOL, use ebtables.
>
> -David
>
>
If we are not going to have an EAPOL knob, but we are going to act as
a repeater when STP is off then we still need these diffs to forward
the PAE group address.
(In fact we cant just act as a repeater because of the recent ethernet
bonding regression)
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 90e985b..267f581 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -163,7 +163,8 @@ struct sk_buff *br_handle_frame(struct sk_buff *skb)
goto drop;
/* If STP is turned off, then forward */
- if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
+ if (p->br->stp_enabled == BR_NO_STP &&
+ (dest[5] == 0 || skb->protocol == htons(ETH_P_PAE)))
goto forward;
Nick
^ permalink raw reply related
* Re: linux-next: build failure after merge of the wireless tree
From: Gustavo F. Padovan @ 2011-06-28 18:11 UTC (permalink / raw)
To: Stephen Rothwell
Cc: John W. Linville, linux-next, linux-kernel, Anderson Briglia,
Anderson Lizardo, Bruna Moreira, Vinicius Costa Gomes,
Alexey Dobriyan, David Miller, netdev
In-Reply-To: <20110623130317.b3a6085e.sfr@canb.auug.org.au>
Hi John,
* Stephen Rothwell <sfr@canb.auug.org.au> [2011-06-23 13:03:17 +1000]:
> Hi John,
>
> After merging the wireless tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> net/bluetooth/smp.c: In function 'smp_e':
> net/bluetooth/smp.c:49:21: error: storage size of 'sg' isn't known
> net/bluetooth/smp.c:67:2: error: implicit declaration of function 'sg_init_one'
> net/bluetooth/smp.c:49:21: warning: unused variable 'sg'
>
> Caused by commit d22ef0bc83c5 ("Bluetooth: Add LE SMP Cryptoolbox
> functions"). Missing include file, presumably. This batch has been in
> the bluetooth tree since June 14, so it may have been exposed by the
> removal of linux/mm.h from netdevice.h ...
>
> I have added the following patch as a merge fix up for today.
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu, 23 Jun 2011 12:58:55 +1000
> Subject: [PATCH] Bluetooth: include scatterlist.h where needed
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> net/bluetooth/smp.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
> index 52e9ec2..a36f870 100644
> --- a/net/bluetooth/smp.c
> +++ b/net/bluetooth/smp.c
> @@ -25,6 +25,7 @@
> #include <net/bluetooth/l2cap.h>
> #include <net/bluetooth/smp.h>
> #include <linux/crypto.h>
> +#include <linux/scatterlist.h>
> #include <crypto/b128ops.h>
Thanks for pick this patch to wireless tree ;)
Gustavo
^ permalink raw reply
* Re: [PATCH] Bluetooth: Prevent buffer overflow in l2cap config request
From: Gustavo F. Padovan @ 2011-06-28 17:59 UTC (permalink / raw)
To: Dan Rosenberg
Cc: marcel-kz+m5ild9QBg9hUCZPvPmw, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
security-DgEjT+Ai2ygdnm+yROfE0A
In-Reply-To: <1308919085.5295.11.camel@dan>
Hi Dan,
* Dan Rosenberg <drosenberg-PiUznwcHFHrqlBn2x/YWAg@public.gmane.org> [2011-06-24 08:38:05 -0400]:
> A remote user can provide a small value for the command size field in
> the command header of an l2cap configuration request, resulting in an
> integer underflow when subtracting the size of the configuration request
> header. This results in copying a very large amount of data via
> memcpy() and destroying the kernel heap. Check for underflow.
>
> Signed-off-by: Dan Rosenberg <drosenberg-PiUznwcHFHrqlBn2x/YWAg@public.gmane.org>
> Cc: stable <stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> net/bluetooth/l2cap_core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Gustavo
^ permalink raw reply
* RE: [PATCH] [net][bna] Fix call trace when interrupts are disabled while sleeping function kzalloc is called
From: Rasesh Mody @ 2011-06-28 17:27 UTC (permalink / raw)
To: Shyam_Iyer@Dell.com, davem@davemloft.net, shyam.iyer.t@gmail.com
Cc: netdev@vger.kernel.org, Debashis Dutt, Jing Huang
In-Reply-To: <DBFB1B45AF80394ABD1C807E9F28D1570453626FF0@BLRX7MCDC203.AMER.DELL.COM>
>From: Shyam_Iyer@Dell.com [mailto:Shyam_Iyer@Dell.com]
>Sent: Tuesday, June 28, 2011 9:30 AM
>
>Here is try 2.
>
>I found that I had to initialize the flags variable outside the
>spin_lock_irqsave in the following way to fix the problem. The sleeping
>kzalloc function is in fact in the request_threaded_irq call which
>allocates the irq handler function and its flags arguments.
>
>Attached patch fixes the issue.
The attached patch may fix the issue in MSIX mode, however we'll continue to see the issue in INTX mode. Using a separate irq_flags may be a good idea.
^ 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