* Re: pull request: wireless-2.6 2011-06-30
From: David Miller @ 2011-07-01 8:52 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20110630173223.GA12963@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Thu, 30 Jun 2011 13:32:25 -0400
> Here is a batch of fixes intended for 3.0. Arik gives us a fix for a
> potential NULL dereference in mac80211. Emmanuel gives us a fix for a
> regression introduced by "iwlagn: support multiple TBs per command" that
> can corrupt memory. Eugene (and Bob) gives a memory leak fix for ath5k.
> Evgeni gives us a preprocessor-related fix that makes modinfo output
> make more sense for iwlagn. Johannes gives us a trio of fixes, all
> isolated to the bowels of iwlagn. I overlayed a fixup on top of one of
> Johannes's patches, since there was some confusion between DMA and PCI
> API usage. Finally, Rajkumar gives us an ath9k fix to ensure the chip
> is properly awakened even if there is no active interface when the
> resume occurs.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* [PATCH] gianfar: code cleanups
From: Sebastian Pöhn @ 2011-07-01 9:00 UTC (permalink / raw)
To: Linux Netdev; +Cc: Joe Perches, Sebastian Pöhn
This patch:
# moves if_vlan.h include from gianfar.c to gianfar.h
# improves readability of some gianfar nfc code
Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com>
---
drivers/net/gianfar.c | 1 -
drivers/net/gianfar.h | 2 +
drivers/net/gianfar_ethtool.c | 51 +++++++++++++++++++++-------------------
3 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 3321d71..d55cdf2 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -76,7 +76,6 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#include <linux/if_vlan.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/of_mdio.h>
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 76f14d0..9c0e56c 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -38,6 +38,7 @@
#include <linux/mm.h>
#include <linux/mii.h>
#include <linux/phy.h>
+#include <linux/if_vlan.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -409,6 +410,7 @@ extern const char gfar_driver_version[];
#define RQFCR_HASHTBL_2 0x00060000
#define RQFCR_HASHTBL_3 0x00080000
#define RQFCR_HASH 0x00010000
+#define RQFCR_QUEUE 0x0000FC00
#define RQFCR_CLE 0x00000200
#define RQFCR_RJE 0x00000100
#define RQFCR_AND 0x00000080
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c
index 2ecdc9a..da856ba 100644
--- a/drivers/net/gianfar_ethtool.c
+++ b/drivers/net/gianfar_ethtool.c
@@ -883,7 +883,7 @@ static void gfar_set_attribute(u32 value, u32 mask, u32 flag,
struct filer_table *tab)
{
switch (flag) {
- /* 3bit */
+ /* 3bit */
case RQFCR_PID_PRI:
if (!(value | mask))
return;
@@ -1051,17 +1051,17 @@ static int gfar_convert_to_filer(struct ethtool_rx_flow_spec *rule,
vlan_mask = RQFPR_VLN;
/* Separate the fields */
- id = rule->h_ext.vlan_tci & 0xFFF;
- id_mask = rule->m_ext.vlan_tci & 0xFFF;
- cfi = (rule->h_ext.vlan_tci >> 12) & 1;
- cfi_mask = (rule->m_ext.vlan_tci >> 12) & 1;
- prio = (rule->h_ext.vlan_tci >> 13) & 0x7;
- prio_mask = (rule->m_ext.vlan_tci >> 13) & 0x7;
-
- if (cfi == 1 && cfi_mask == 1) {
+ id = rule->h_ext.vlan_tci & VLAN_VID_MASK;
+ id_mask = rule->m_ext.vlan_tci & VLAN_VID_MASK;
+ cfi = rule->h_ext.vlan_tci & VLAN_CFI_MASK;
+ cfi_mask = rule->m_ext.vlan_tci & VLAN_CFI_MASK;
+ prio = (rule->h_ext.vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
+ prio_mask = (rule->m_ext.vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
+
+ if (cfi == VLAN_TAG_PRESENT && cfi_mask == VLAN_TAG_PRESENT) {
vlan |= RQFPR_CFI;
vlan_mask |= RQFPR_CFI;
- } else if (cfi == 0 && cfi_mask == 1) {
+ } else if (cfi != VLAN_TAG_PRESENT && cfi_mask == VLAN_TAG_PRESENT) {
vlan_mask |= RQFPR_CFI;
}
}
@@ -1262,21 +1262,21 @@ static void gfar_cluster_filer(struct filer_table *tab)
}
}
-/* Swaps the 0xFF80 masked bits of a1<>a2 and b1<>b2 */
-static void gfar_swap_ff80_bits(struct gfar_filer_entry *a1,
+/* Swaps the masked bits of a1<>a2 and b1<>b2 */
+static void gfar_swap_bits(struct gfar_filer_entry *a1,
struct gfar_filer_entry *a2, struct gfar_filer_entry *b1,
- struct gfar_filer_entry *b2)
+ struct gfar_filer_entry *b2, u32 mask)
{
u32 temp[4];
- temp[0] = a1->ctrl & 0xFF80;
- temp[1] = a2->ctrl & 0xFF80;
- temp[2] = b1->ctrl & 0xFF80;
- temp[3] = b2->ctrl & 0xFF80;
+ temp[0] = a1->ctrl & mask;
+ temp[1] = a2->ctrl & mask;
+ temp[2] = b1->ctrl & mask;
+ temp[3] = b2->ctrl & mask;
- a1->ctrl &= ~0xFF80;
- a2->ctrl &= ~0xFF80;
- b1->ctrl &= ~0xFF80;
- b2->ctrl &= ~0xFF80;
+ a1->ctrl &= ~mask;
+ a2->ctrl &= ~mask;
+ b1->ctrl &= ~mask;
+ b2->ctrl &= ~mask;
a1->ctrl |= temp[1];
a2->ctrl |= temp[0];
@@ -1305,7 +1305,7 @@ static u32 gfar_generate_mask_table(struct gfar_mask_entry *mask_table,
mask_table[and_index - 1].end = i - 1;
and_index++;
}
- /* cluster starts will be separated because they should
+ /* cluster starts and ends will be separated because they should
* hold their position */
if (tab->fe[i].ctrl & RQFCR_CLE)
block_index++;
@@ -1356,10 +1356,13 @@ static void gfar_sort_mask_table(struct gfar_mask_entry *mask_table,
new_first = mask_table[start].start + 1;
new_last = mask_table[i - 1].end;
- gfar_swap_ff80_bits(&temp_table->fe[new_first],
+ gfar_swap_bits(&temp_table->fe[new_first],
&temp_table->fe[old_first],
&temp_table->fe[new_last],
- &temp_table->fe[old_last]);
+ &temp_table->fe[old_last],
+ RQFCR_QUEUE | RQFCR_CLE |
+ RQFCR_RJE | RQFCR_AND
+ );
start = i;
size = 0;
^ permalink raw reply related
* Regarding sumbiting a new NIC driver to kernel.
From: Ren, Cloud @ 2011-07-01 9:09 UTC (permalink / raw)
To: 'davem@davemloft.net', Huang, Xiong; +Cc: netdev@vger.kernel.org
Dear David S. Miller
I am working for Qualcomm(Atheros) as an engineer. Recently, we are developing a new Linux driver, "alx" , that supports AR8131, AR8151, AR8152 , AR8161 and etc. AR8161 is our new NIC that will be released soon.
As we know, there is a linux driver "atl1c" in the kernel. It can also support AR8131, AR8152, AR8151. So "alx" at functionality is a little repeated with "atl1c". Now, we hope to push the new "alx" into linux kernel and remove the old "atl1c".
Would you have any advices to us? If this is possible, how do I submit the new driver and remove the old driver? Can you give me a doc how to submit the driver to kernel or any hints?
Btw, why do we need to develop the new driver?
The most important reason is for convenience on maintenance 1. we need to make HW operations uniform on all supported OS, such as WinXP, Win7 and Linux.
2. As our company is continuous to release new NICs, there are more and more drivers to support those NICs. It's a pity to develop and maintain so many drivers. So we have developed the driver, "alx". We will use it to support as many NICs as possible, including NICs released in future.
Thanks
Cloud
^ permalink raw reply
* [PATCH] net/fec: gasket needs to be enabled for some i.mx
From: Shawn Guo @ 2011-07-01 10:11 UTC (permalink / raw)
To: netdev
Cc: linux-arm-kernel, u.kleine-koenig, LW, Shawn Guo, Troy Kisky,
David S. Miller, Sascha Hauer
In-Reply-To: <20110630161935.GA7977@S2100-06.ap.freescale.net>
On the recent i.mx (mx25/50/53), there is a gasket inside fec
controller which needs to be enabled no matter phy works in MII
or RMII mode.
The current code enables the gasket only when phy interface is RMII.
It's broken when the driver works with a MII phy. The patch uses
platform_device_id to distinguish the SoCs that have the gasket and
enables it on these SoCs for both MII and RMII mode.
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/clock-imx25.c | 2 +-
arch/arm/mach-imx/clock-imx27.c | 2 +-
arch/arm/mach-imx/clock-imx35.c | 2 +-
arch/arm/mach-mx5/clock-mx51-mx53.c | 4 +-
arch/arm/plat-mxc/devices/platform-fec.c | 17 ++++++++-------
arch/arm/plat-mxc/include/mach/devices-common.h | 1 +
drivers/net/fec.c | 26 ++++++++++++++++++++--
7 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/arch/arm/mach-imx/clock-imx25.c b/arch/arm/mach-imx/clock-imx25.c
index a65838f..5527fff 100644
--- a/arch/arm/mach-imx/clock-imx25.c
+++ b/arch/arm/mach-imx/clock-imx25.c
@@ -294,7 +294,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
_REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk)
_REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk)
- _REGISTER_CLOCK("fec.0", NULL, fec_clk)
+ _REGISTER_CLOCK("imx25-fec.0", NULL, fec_clk)
_REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk)
_REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
_REGISTER_CLOCK("imx2-wdt.0", NULL, wdt_clk)
diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c
index 583f251..d197df2 100644
--- a/arch/arm/mach-imx/clock-imx27.c
+++ b/arch/arm/mach-imx/clock-imx27.c
@@ -662,7 +662,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK(NULL, "brom", brom_clk)
_REGISTER_CLOCK(NULL, "emma", emma_clk)
_REGISTER_CLOCK(NULL, "slcdc", slcdc_clk)
- _REGISTER_CLOCK("fec.0", NULL, fec_clk)
+ _REGISTER_CLOCK("imx27-fec.0", NULL, fec_clk)
_REGISTER_CLOCK(NULL, "emi", emi_clk)
_REGISTER_CLOCK(NULL, "sahara2", sahara2_clk)
_REGISTER_CLOCK(NULL, "ata", ata_clk)
diff --git a/arch/arm/mach-imx/clock-imx35.c b/arch/arm/mach-imx/clock-imx35.c
index 5a4cc1e..fb4007b 100644
--- a/arch/arm/mach-imx/clock-imx35.c
+++ b/arch/arm/mach-imx/clock-imx35.c
@@ -461,7 +461,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk)
_REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk)
_REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_clk)
- _REGISTER_CLOCK("fec.0", NULL, fec_clk)
+ _REGISTER_CLOCK("imx35-fec.0", NULL, fec_clk)
_REGISTER_CLOCK(NULL, "gpio", gpio1_clk)
_REGISTER_CLOCK(NULL, "gpio", gpio2_clk)
_REGISTER_CLOCK(NULL, "gpio", gpio3_clk)
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index 699b0d2..04c5a01 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1426,7 +1426,7 @@ static struct clk_lookup mx51_lookups[] = {
_REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
_REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
_REGISTER_CLOCK(NULL, "gpt", gpt_clk)
- _REGISTER_CLOCK("fec.0", NULL, fec_clk)
+ _REGISTER_CLOCK("imx51-fec.0", NULL, fec_clk)
_REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk)
_REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk)
_REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
@@ -1475,7 +1475,7 @@ static struct clk_lookup mx53_lookups[] = {
_REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk)
_REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk)
_REGISTER_CLOCK(NULL, "gpt", gpt_clk)
- _REGISTER_CLOCK("fec.0", NULL, fec_clk)
+ _REGISTER_CLOCK("imx53-fec.0", NULL, fec_clk)
_REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
_REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
_REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c
index ccc789e..3790c59 100644
--- a/arch/arm/plat-mxc/devices/platform-fec.c
+++ b/arch/arm/plat-mxc/devices/platform-fec.c
@@ -10,40 +10,41 @@
#include <mach/hardware.h>
#include <mach/devices-common.h>
-#define imx_fec_data_entry_single(soc) \
+#define imx_fec_data_entry_single(soc, _devid) \
{ \
+ .devid = _devid, \
.iobase = soc ## _FEC_BASE_ADDR, \
.irq = soc ## _INT_FEC, \
}
#ifdef CONFIG_SOC_IMX25
const struct imx_fec_data imx25_fec_data __initconst =
- imx_fec_data_entry_single(MX25);
+ imx_fec_data_entry_single(MX25, "imx25-fec");
#endif /* ifdef CONFIG_SOC_IMX25 */
#ifdef CONFIG_SOC_IMX27
const struct imx_fec_data imx27_fec_data __initconst =
- imx_fec_data_entry_single(MX27);
+ imx_fec_data_entry_single(MX27, "imx27-fec");
#endif /* ifdef CONFIG_SOC_IMX27 */
#ifdef CONFIG_SOC_IMX35
const struct imx_fec_data imx35_fec_data __initconst =
- imx_fec_data_entry_single(MX35);
+ imx_fec_data_entry_single(MX35, "imx35-fec");
#endif
#ifdef CONFIG_SOC_IMX50
const struct imx_fec_data imx50_fec_data __initconst =
- imx_fec_data_entry_single(MX50);
+ imx_fec_data_entry_single(MX50, "imx50-fec");
#endif
#ifdef CONFIG_SOC_IMX51
const struct imx_fec_data imx51_fec_data __initconst =
- imx_fec_data_entry_single(MX51);
+ imx_fec_data_entry_single(MX51, "imx51-fec");
#endif
#ifdef CONFIG_SOC_IMX53
const struct imx_fec_data imx53_fec_data __initconst =
- imx_fec_data_entry_single(MX53);
+ imx_fec_data_entry_single(MX53, "imx53-fec");
#endif
struct platform_device *__init imx_add_fec(
@@ -62,7 +63,7 @@ struct platform_device *__init imx_add_fec(
},
};
- return imx_add_platform_device_dmamask("fec", 0,
+ return imx_add_platform_device_dmamask(data->devid, 0,
res, ARRAY_SIZE(res),
pdata, sizeof(*pdata), DMA_BIT_MASK(32));
}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index bf93820..6ac2450 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -30,6 +30,7 @@ static inline struct platform_device *imx_add_platform_device(
#include <linux/fec.h>
struct imx_fec_data {
+ const char *devid;
resource_size_t iobase;
resource_size_t irq;
};
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 885d8ba..9161a82 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -66,14 +66,31 @@
#define FEC_QUIRK_ENET_MAC (1 << 0)
/* Controller needs driver to swap frame */
#define FEC_QUIRK_SWAP_FRAME (1 << 1)
+/* Controller uses gasket */
+#define FEC_QUIRK_USE_GASKET (1 << 2)
static struct platform_device_id fec_devtype[] = {
{
- .name = DRIVER_NAME,
+ .name = "imx25-fec",
+ .driver_data = FEC_QUIRK_USE_GASKET,
+ }, {
+ .name = "imx27-fec",
.driver_data = 0,
}, {
.name = "imx28-fec",
.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME,
+ }, {
+ .name = "imx35-fec",
+ .driver_data = 0,
+ }, {
+ .name = "imx50-fec",
+ .driver_data = FEC_QUIRK_USE_GASKET,
+ }, {
+ .name = "imx51-fec",
+ .driver_data = 0,
+ }, {
+ .name = "imx53-fec",
+ .driver_data = FEC_QUIRK_USE_GASKET,
},
{ }
};
@@ -425,7 +442,7 @@ fec_restart(struct net_device *ndev, int duplex)
} else {
#ifdef FEC_MIIGSK_ENR
- if (fep->phy_interface == PHY_INTERFACE_MODE_RMII) {
+ if (id_entry->driver_data & FEC_QUIRK_USE_GASKET) {
/* disable the gasket and wait */
writel(0, fep->hwp + FEC_MIIGSK_ENR);
while (readl(fep->hwp + FEC_MIIGSK_ENR) & 4)
@@ -434,8 +451,11 @@ fec_restart(struct net_device *ndev, int duplex)
/*
* configure the gasket:
* RMII, 50 MHz, no loopback, no echo
+ * MII, 25 MHz, no loopback, no echo
*/
- writel(1, fep->hwp + FEC_MIIGSK_CFGR);
+ writel((fep->phy_interface == PHY_INTERFACE_MODE_RMII) ?
+ 1 : 0, fep->hwp + FEC_MIIGSK_CFGR);
+
/* re-enable the gasket */
writel(2, fep->hwp + FEC_MIIGSK_ENR);
--
1.7.4.1
^ permalink raw reply related
* Re: possible bridge regression in "bridge: implement [add/del]_slave ops"?
From: David Lamparter @ 2011-07-01 10:08 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Alexander Stein, David S. Miller, bridge, netdev
In-Reply-To: <20110630100819.0e4b536f@nehalam.ftrdhcpuser.net>
On Thu, Jun 30, 2011 at 10:08:19AM -0700, Stephen Hemminger wrote:
> On Thu, 30 Jun 2011 10:33:23 +0200
> Alexander Stein <alexander.stein@systec-electronic.com> wrote:
>
> > * echo $(pgrep rstpd) > /var/run/rstpd.pid
> > * brctl addbr br1
> > * echo 1 > /sys/class/net/br1/bridge/stp_state
>
> This bogus. You are running both kernel and spanning
> tree daemon at the same time!
>
> Doing the echo of 1 to stp_state forces kernel spanning
> tree. You want 2 which is what is supposed to be use for user
> mode spanning tree.
I just tested this on my box, you can't echo 2 into that sysfs file (it
reads back as 1).
That you can change this variable at all when an userspace stp
implementation is running is a bug anyway, IMHO. rstpd should do all the
required settings and the kernel should prevent them from being changed
while rstpd has the bridge under its control.
-David
^ permalink raw reply
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: David Lamparter @ 2011-07-01 10:16 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Nick Carter, David Lamparter, netdev, davem
In-Reply-To: <20110629163423.1d73b0ef@nehalam.ftrdhcpuser.net>
On Wed, Jun 29, 2011 at 04:34:23PM -0700, Stephen Hemminger wrote:
> The problem is that the damn 802.1 committees keep loading up protocols
> on the same multicast address range. Trying to solve a design committee
> problem in the kernel is not going to make anybody happy.
>
> I am happy with the simple solution of:
> no STP == Hub
> STP == Bridge
> These are both well know configurations and are blessed by standards.
I agree, that is how we should behave by default, and we'll match most
admin's expectations.
Regarding multicast groups, I would summarise like this:
1. any multicast gets forwarded by default,
2. unless it is 01:80:c2:00:00:01 or :02 (pause/bonding)
(this rule applies regardless of STP state)
3. if STP is on:
4. 01:80:c2:00:00:00 (STP) never gets forwarded
5. 01:80:c2:00:00:03-0f don't get forwarded by default
What we can do is add a switch to disable the #5 rule. The way I see it
is that that switch would remove an exception from the rule and turn it
back to the default #1; that's acceptable for making a new knob in my
eyes.
(Adding an 802.1X knob would be an exception to the exception for me,
which is why I'm against it.)
I'll cook up a patch in a few minutes, we really need to get rule #2
right anyway. We _MUST_NOT_ pass bonding frames in any case, but we
currently do that if STP is off. (cf. my earlier patch 1/2)
-David
^ permalink raw reply
* Re: Regarding sumbiting a new NIC driver to kernel.
From: Marius Kotsbak @ 2011-07-01 11:13 UTC (permalink / raw)
To: Ren, Cloud
Cc: 'davem@davemloft.net', Huang, Xiong,
netdev@vger.kernel.org
In-Reply-To: <6349D7A510622448B1BA0967850A843801163B91@nasanexd02d.na.qualcomm.com>
Den 01. juli 2011 11:09, skrev Ren, Cloud:
> Would you have any advices to us? If this is possible, how do I submit the new driver and remove the old driver? Can you give me a doc how to submit the driver to kernel or any hints?
All should be explained in:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/SubmittingPatches;h=569f3532e1383cb3e67dcba7b77990b5f18a1411;hb=HEAD
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/SubmittingDrivers;h=319baa8b60dd727d82c5e8fa062c13e3bb3126d5;hb=HEAD
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/SubmitChecklist;h=da0382daa39556939dcc94717b658b5917e4009f;hb=HEAD
--
Marius
^ permalink raw reply
* [PATCH] bridge: revisit IEEE 802 local multicast groups
From: David Lamparter @ 2011-07-01 11:12 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Nick Carter, David Lamparter
this first and foremost fixes handling of bonding frames, which were
incorrectly forwarded until now. they need to never cross a bridge.
it also introduces a new switch to control handling of the other
not-that-special groups; if you want them forwarded despite having
STP running, there's a sysfs knob for that. you can implement your
local policy with ebtables then.
in the end, we now match hardware switch behaviour rather closely, but
still additionally allow playing tricks on things like 802.1X.
Signed-off-by: David Lamparter <equinox@diac24.net>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Nick Carter <ncarter100@gmail.com>
---
net/bridge/br_device.c | 1 +
net/bridge/br_input.c | 25 ++++++++++++++++++-------
net/bridge/br_private.h | 2 ++
net/bridge/br_sysfs_br.c | 24 ++++++++++++++++++++++++
4 files changed, 45 insertions(+), 7 deletions(-)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index c188c80..4a01a3e 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -359,6 +359,7 @@ void br_dev_setup(struct net_device *dev)
memcpy(br->group_addr, br_group_address, ETH_ALEN);
br->stp_enabled = BR_NO_STP;
+ br->stp_forward_802local = 0;
br->designated_root = br->bridge_id;
br->bridge_max_age = br->max_age = 20 * HZ;
br->bridge_hello_time = br->hello_time = 2 * HZ;
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index f3ac1e8..0060b10 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -160,13 +160,24 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
p = br_port_get_rcu(skb->dev);
if (unlikely(is_link_local(dest))) {
- /* Pause frames shouldn't be passed up by driver anyway */
- if (skb->protocol == htons(ETH_P_PAUSE))
- goto drop;
-
- /* If STP is turned off, then forward */
- if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
- goto forward;
+ switch (dest[5]) {
+ /* Pause/3x frames shouldn't be passed up by driver anyway
+ * LACP/3ad can never be allowed to cross even a dumb hub
+ */
+ case 0x01: /* pause */
+ case 0x02: /* bonding */
+ break;
+
+ case 0x00: /* STP */
+ if (p->br->stp_enabled == BR_NO_STP)
+ goto forward;
+ break;
+
+ default:
+ if (p->br->stp_enabled == BR_NO_STP
+ || p->br->stp_forward_802local)
+ goto forward;
+ }
if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
NULL, br_handle_local_finish)) {
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 54578f2..909814f 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -213,6 +213,8 @@ struct net_bridge
BR_USER_STP, /* new RSTP in userspace */
} stp_enabled;
+ bool stp_forward_802local;
+
unsigned char topology_change;
unsigned char topology_change_detected;
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 68b893e..8004bf7 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -149,6 +149,29 @@ static ssize_t store_stp_state(struct device *d,
static DEVICE_ATTR(stp_state, S_IRUGO | S_IWUSR, show_stp_state,
store_stp_state);
+static ssize_t show_stp_forward_802local(struct device *d,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct net_bridge *br = to_bridge(d);
+ return sprintf(buf, "%d\n", br->stp_forward_802local);
+}
+
+static int set_stp_forward_802local(struct net_bridge *br, unsigned long val)
+{
+ br->stp_forward_802local = !!val;
+ return 0;
+}
+
+static ssize_t store_stp_forward_802local(struct device *d,
+ struct device_attribute *attr,
+ const char *buf, size_t len)
+{
+ return store_bridge_parm(d, buf, len, set_stp_forward_802local);
+}
+static DEVICE_ATTR(stp_forward_802local, S_IRUGO | S_IWUSR,
+ show_stp_forward_802local, store_stp_forward_802local);
+
static ssize_t show_priority(struct device *d, struct device_attribute *attr,
char *buf)
{
@@ -652,6 +675,7 @@ static struct attribute *bridge_attrs[] = {
&dev_attr_max_age.attr,
&dev_attr_ageing_time.attr,
&dev_attr_stp_state.attr,
+ &dev_attr_stp_forward_802local.attr,
&dev_attr_priority.attr,
&dev_attr_bridge_id.attr,
&dev_attr_root_id.attr,
--
1.7.5.3
^ permalink raw reply related
* coding style question on indentation
From: Sathya.Perla @ 2011-07-01 11:20 UTC (permalink / raw)
To: netdev
Hi,
Which of the following styling is preferable when a function invocation spans more than one line:
a) Aligning the next line with the first argument by inserting a few spaces after the tabs - as in:
dma_unmap_page(&adapter->pdev->dev,
dma_unmap_addr(rx_page_info, bus),
adapter->big_page_size, DMA_FROM_DEVICE);
Documentation/CodingStyle says "spaces are never used for indentation", but I see
scripts/Lindent inserting spaces after tabs for alignment.
OR
b) Just using tabs without needing to align as above:
dma_unmap_page(&adapter->pdev->dev,
dma_unmap_addr(rx_page_info, bus),
adapter->big_page_size, DMA_FROM_DEVICE);
thanks,
-Sathya
^ permalink raw reply
* [PATCH] Disable router anycast address for /127 prefixes
From: Bjørn Mork @ 2011-07-01 11:22 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Herbert Xu, Bjørn Mork
In-Reply-To: <20110630104713.52e085dd@nehalam.ftrdhcpuser.net>
RFC 6164 requires that routers MUST disable Subnet-Router anycast
for the prefix when /127 prefixes are used.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
How about something like this?
net/ipv6/addrconf.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 498b927..179c0f4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1470,6 +1470,8 @@ void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr)
static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
{
struct in6_addr addr;
+ if (ifp->prefix_len == 127) /* RFC 6164 */
+ return;
ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
if (ipv6_addr_any(&addr))
return;
@@ -1479,6 +1481,8 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
static void addrconf_leave_anycast(struct inet6_ifaddr *ifp)
{
struct in6_addr addr;
+ if (ifp->prefix_len == 127) /* RFC 6164 */
+ return;
ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
if (ipv6_addr_any(&addr))
return;
--
1.7.2.5
^ permalink raw reply related
* Re: Regarding sumbiting a new NIC driver to kernel.
From: Francois Romieu @ 2011-07-01 11:33 UTC (permalink / raw)
To: Ren, Cloud
Cc: 'davem@davemloft.net', Huang, Xiong,
netdev@vger.kernel.org
In-Reply-To: <6349D7A510622448B1BA0967850A843801163B91@nasanexd02d.na.qualcomm.com>
(insert the usual "only speaking on behalf of myself" here)
Ren, Cloud <cjren@qca.qualcomm.com> :
[...]
> Would you have any advices to us ? If this is possible, how do I submit the
> new driver and remove the old driver? Can you give me a doc how to submit
> the driver to kernel or any hints ?
Advices:
- publish early for review and comments. Code is reviewed here, on netdev.
- work with the current atl* in-kernel drivers maintainers.
- provide a big-bang free migration path.
- read netdev. http://vger.kernel.org/vger-lists.html lists some archive.
- don't expect the convenience on maintenance to materialize immediately.
(old farts may appreciate shorter lines - somewhere between 72 and 80
chars - too)
If you have not done so yet, please consider reading:
- Documentation/CodingStyle
- Documentation/SubmittingPatches
Documentation/SubmittingDrivers is imho irrelevant here.
> Btw, why do we need to develop the new driver?
> The most important reason is for convenience on maintenance 1. we need to
> make HW operations uniform on all supported OS, such as WinXP, Win7 and Linux.
> 2. As our company is continuous to release new NICs, there are more and more
> drivers to support those NICs. It's a pity to develop and maintain so many
> drivers. So we have developed the driver, "alx". We will use it to support
> as many NICs as possible, including NICs released in future.
Platform neutral does not necessarily bode good things... :o/
Don't be shy, show the code.
--
Ueimor
^ permalink raw reply
* Re: coding style question on indentation
From: Ben Hutchings @ 2011-07-01 11:52 UTC (permalink / raw)
To: Sathya.Perla; +Cc: netdev
In-Reply-To: <3367B80B08154D42A3B2BC708B5D41F63F87EF145E@EXMAIL.ad.emulex.com>
On Fri, 2011-07-01 at 04:20 -0700, Sathya.Perla@Emulex.Com wrote:
> Hi,
> Which of the following styling is preferable when a function
> invocation spans more than one line:
>
> a) Aligning the next line with the first argument by inserting a few
> spaces after the tabs - as in:
>
> dma_unmap_page(&adapter->pdev->dev,
> dma_unmap_addr(rx_page_info, bus),
> adapter->big_page_size, DMA_FROM_DEVICE);
My preference, for what it's worth.
> Documentation/CodingStyle says "spaces are never used for indentation", but I see
> scripts/Lindent inserting spaces after tabs for alignment.
I think that's meant to apply to indentation at the start of a statement
or declaration, not when wrapping.
> OR
>
> b) Just using tabs without needing to align as above:
>
> dma_unmap_page(&adapter->pdev->dev,
> dma_unmap_addr(rx_page_info, bus),
> adapter->big_page_size, DMA_FROM_DEVICE);
Popular but ugly in my opinion.
Some people also use a single extra tab to indent after wrapping,
whether or not the line break is within a parenthesised expression or
argument list.
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: IEEE 802.1ag / 802.1x / Y1731
From: Satendra... @ 2011-07-01 12:12 UTC (permalink / raw)
To: Balaji G; +Cc: netdev
In-Reply-To: <BANLkTim1VwXRiWdO6PWN6coDeOswQqSOXA@mail.gmail.com>
Hi Balaji,
You mean CFM OAM 802.1ag can not be supported under linux yet.
I mean there are many routers which are running linux and if they want
to support CFM OAM on
their routers they will have to make changes in Linux networking stack?
Could you please tell about the support of Y.1731 / 802.1ah / 802.1x
in the linux networking
stack ?
Thanks,
Satendra
On 1 July 2011 15:51, Balaji G <balajig.foss@gmail.com> wrote:
>>Could anyone please tell me whether there is any support in Linux
>>networking stack for 802.1ag ? If yes please mention the linux version.
> Linux Kernel does not support 802.1ag
> Thanks,
> Cheers,
> - Balaji
>
>
>
> On Fri, Jul 1, 2011 at 1:46 PM, Satendra... <satendra.pratap@gmail.com>
> wrote:
>>
>> Hello All,
>> Could anyone please tell me whether there is any support in Linux
>> networking stack
>> for 802.1ag ? If yes please mention the linux version.
>> What I need to do is to use CFM OAM (802.1ag) open source client on
>> our routers running linux
>> on them. Open source client to be used is dot1ag utils.
>>
>> Thanks,
>> Satendra
>>
>> On 24 June 2011 17:36, Satendra... <satendra.pratap@gmail.com> wrote:
>> > Hi,
>> > Could someone please tell me which version of linux has got support
>> > for below (all three) protocols:
>> > - IEEE 802.1ag
>> > - 802.1x
>> > - Y1731
>> >
>> > Thanks,
>> > Satendra
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply
* Re: IEEE 802.1ag / 802.1x / Y1731
From: David Lamparter @ 2011-07-01 12:25 UTC (permalink / raw)
To: Satendra...; +Cc: Balaji G, netdev
In-Reply-To: <BANLkTino1iUe3r3dmA5DraBZo6bYSSQ7Kg@mail.gmail.com>
On Fri, Jul 01, 2011 at 05:42:41PM +0530, Satendra... wrote:
> You mean CFM OAM 802.1ag can not be supported under linux yet.
> I mean there are many routers which are running linux and if they want
> to support CFM OAM on
> their routers they will have to make changes in Linux networking stack?
> Could you please tell about the support of Y.1731 / 802.1ah / 802.1x
> in the linux networking
> stack ?
Hi,
i'm working on a part of the 802.1ah standard, namely the mac-in-mac
encapsulation. I'll see if i can push it out soon.
Note that that only gets you a quarter of the job done since you need
PBB bridge behaviour as well, which is somewhat more complex to do than
the encapsulation. It will probably require some extensions to the
kernel<>userspace STP interface.
802.1X is supported by hostapd. (http://hostap.epitest.fi) with the
"wired" driver. There's nothing needed from kernel side for this.
802.1ag you can maybe implement in userspace, i don't know the spec to
tell.
-David
^ permalink raw reply
* Re: [RFC patch net-next-2.6] net: allow multiple rx_handler registration
From: Jiri Pirko @ 2011-07-01 12:48 UTC (permalink / raw)
To: netdev
Cc: davem, shemminger, kaber, fubar, eric.dumazet, nicolas.2p.debian,
andy
In-Reply-To: <1309447009-8898-1-git-send-email-jpirko@redhat.com>
btw I measured the performance using LNST and recipe added by following
commit:
http://git.fedorahosted.org/git/?p=lnst.git;a=commitdiff;h=d3293bf2d0da59a2f7956d3356f4bb0f0ea9cd33
Thu, Jun 30, 2011 at 05:16:49PM CEST, jpirko@redhat.com wrote:
>For some net topos it is necessary to have multiple "soft-net-devices"
>hooked on one netdev. For example very common is to have
>eth<->(br+vlan). Vlan is not using rh_handler (yet) but also for example
>macvlan would be useful to have hooked on same netdev as br.
>
>This patch introduces rx_handler list. size struct net_device stays
>intact. Measured performance regression on eth-br topo is ~1% (on received
>pkts generated by pktgen) and on eth-bond topo it is ~0.25%
>
>On br I think that the performance can be brought back maybe by using per-cpu
>variables to store port in rx_path (I must check this)
>
>Please comment.
>
>Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>---
> drivers/net/bonding/bond_main.c | 14 ++++---
> drivers/net/bonding/bonding.h | 9 +++-
> drivers/net/macvlan.c | 35 +++++++++++-----
> include/linux/netdevice.h | 63 +++++++++++++++++++++++++---
> net/bridge/br_if.c | 5 +-
> net/bridge/br_input.c | 5 +-
> net/bridge/br_private.h | 28 ++++++++++---
> net/core/dev.c | 87 +++++++++++++++++++++++++++++++--------
> 8 files changed, 193 insertions(+), 53 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 61265f7..f18af47 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1482,7 +1482,8 @@ static bool bond_should_deliver_exact_match(struct sk_buff *skb,
> return false;
> }
>
>-static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
>+static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb,
>+ struct rx_handler *rx_handler)
> {
> struct sk_buff *skb = *pskb;
> struct slave *slave;
>@@ -1494,7 +1495,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
>
> *pskb = skb;
>
>- slave = bond_slave_get_rcu(skb->dev);
>+ slave = bond_slave_get(rx_handler);
> bond = slave->bond;
>
> if (bond->params.arp_interval)
>@@ -1897,8 +1898,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
> if (res)
> goto err_close;
>
>- res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
>- new_slave);
>+ res = netdev_rx_handler_register(slave_dev, &new_slave->rx_handler,
>+ bond_handle_frame,
>+ RX_HANDLER_PRIO_BOND);
> if (res) {
> pr_debug("Error %d calling netdev_rx_handler_register\n", res);
> goto err_dest_symlinks;
>@@ -1988,7 +1990,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
> /* unregister rx_handler early so bond_handle_frame wouldn't be called
> * for this slave anymore.
> */
>- netdev_rx_handler_unregister(slave_dev);
>+ netdev_rx_handler_unregister(slave_dev, &slave->rx_handler);
> write_unlock_bh(&bond->lock);
> synchronize_net();
> write_lock_bh(&bond->lock);
>@@ -2189,7 +2191,7 @@ static int bond_release_all(struct net_device *bond_dev)
> /* unregister rx_handler early so bond_handle_frame wouldn't
> * be called for this slave anymore.
> */
>- netdev_rx_handler_unregister(slave_dev);
>+ netdev_rx_handler_unregister(slave_dev, &slave->rx_handler);
> synchronize_net();
>
> if (bond_is_lb(bond)) {
>diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
>index 2936171..e732e16 100644
>--- a/drivers/net/bonding/bonding.h
>+++ b/drivers/net/bonding/bonding.h
>@@ -172,6 +172,7 @@ struct vlan_entry {
>
> struct slave {
> struct net_device *dev; /* first - useful for panic debug */
>+ struct rx_handler rx_handler;
> struct slave *next;
> struct slave *prev;
> struct bonding *bond; /* our master */
>@@ -196,6 +197,11 @@ struct slave {
> #endif
> };
>
>+#define bond_slave_get(rx_handler) \
>+ netdev_rx_handler_get_priv(rx_handler, \
>+ struct slave, \
>+ rx_handler)
>+
> /*
> * Link pseudo-state only used internally by monitors
> */
>@@ -253,9 +259,6 @@ struct bonding {
> #endif /* CONFIG_DEBUG_FS */
> };
>
>-#define bond_slave_get_rcu(dev) \
>- ((struct slave *) rcu_dereference(dev->rx_handler_data))
>-
> /**
> * Returns NULL if the net_device does not belong to any of the bond's slaves
> *
>diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
>index cc67cbe..49ca58b 100644
>--- a/drivers/net/macvlan.c
>+++ b/drivers/net/macvlan.c
>@@ -34,19 +34,28 @@
> #define MACVLAN_HASH_SIZE (1 << BITS_PER_BYTE)
>
> struct macvlan_port {
>+ struct rx_handler rx_handler;
> struct net_device *dev;
> struct hlist_head vlan_hash[MACVLAN_HASH_SIZE];
> struct list_head vlans;
> struct rcu_head rcu;
>- bool passthru;
>+ bool passthru;
> int count;
> };
>
>+#define macvlan_port_get(rx_handler) \
>+ netdev_rx_handler_get_priv(rx_handler, \
>+ struct macvlan_port, \
>+ rx_handler)
>+
>+#define macvlan_port_get_by_dev(dev) \
>+ netdev_rx_handler_get_priv_by_prio(dev, \
>+ RX_HANDLER_PRIO_MACVLAN, \
>+ struct macvlan_port, \
>+ rx_handler)
>+
> static void macvlan_port_destroy(struct net_device *dev);
>
>-#define macvlan_port_get_rcu(dev) \
>- ((struct macvlan_port *) rcu_dereference(dev->rx_handler_data))
>-#define macvlan_port_get(dev) ((struct macvlan_port *) dev->rx_handler_data)
> #define macvlan_port_exists(dev) (dev->priv_flags & IFF_MACVLAN_PORT)
>
> static struct macvlan_dev *macvlan_hash_lookup(const struct macvlan_port *port,
>@@ -156,7 +165,8 @@ static void macvlan_broadcast(struct sk_buff *skb,
> }
>
> /* called under rcu_read_lock() from netif_receive_skb */
>-static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
>+static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb,
>+ struct rx_handler *rx_handler)
> {
> struct macvlan_port *port;
> struct sk_buff *skb = *pskb;
>@@ -167,7 +177,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
> unsigned int len = 0;
> int ret = NET_RX_DROP;
>
>- port = macvlan_port_get_rcu(skb->dev);
>+ port = macvlan_port_get(rx_handler);
> if (is_multicast_ether_addr(eth->h_dest)) {
> src = macvlan_hash_lookup(port, eth->h_source);
> if (!src)
>@@ -617,7 +627,9 @@ static int macvlan_port_create(struct net_device *dev)
> for (i = 0; i < MACVLAN_HASH_SIZE; i++)
> INIT_HLIST_HEAD(&port->vlan_hash[i]);
>
>- err = netdev_rx_handler_register(dev, macvlan_handle_frame, port);
>+ err = netdev_rx_handler_register(dev, &port->rx_handler,
>+ macvlan_handle_frame,
>+ RX_HANDLER_PRIO_MACVLAN);
> if (err)
> kfree(port);
> else
>@@ -627,10 +639,11 @@ static int macvlan_port_create(struct net_device *dev)
>
> static void macvlan_port_destroy(struct net_device *dev)
> {
>- struct macvlan_port *port = macvlan_port_get(dev);
>+ struct macvlan_dev *vlan = netdev_priv(dev);
>+ struct macvlan_port *port = vlan->port;
>
> dev->priv_flags &= ~IFF_MACVLAN_PORT;
>- netdev_rx_handler_unregister(dev);
>+ netdev_rx_handler_unregister(dev, &port->rx_handler);
> kfree_rcu(port, rcu);
> }
>
>@@ -696,7 +709,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
> if (err < 0)
> return err;
> }
>- port = macvlan_port_get(lowerdev);
>+ port = macvlan_port_get_by_dev(lowerdev);
>
> /* Only 1 macvlan device can be created in passthru mode */
> if (port->passthru)
>@@ -818,7 +831,7 @@ static int macvlan_device_event(struct notifier_block *unused,
> if (!macvlan_port_exists(dev))
> return NOTIFY_DONE;
>
>- port = macvlan_port_get(dev);
>+ port = macvlan_port_get_by_dev(dev);
>
> switch (event) {
> case NETDEV_CHANGE:
>diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>index 011eb89..126cd07 100644
>--- a/include/linux/netdevice.h
>+++ b/include/linux/netdevice.h
>@@ -437,7 +437,51 @@ enum rx_handler_result {
> RX_HANDLER_PASS,
> };
> typedef enum rx_handler_result rx_handler_result_t;
>-typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb);
>+
>+struct rx_handler;
>+typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb,
>+ struct rx_handler *rx_handler);
>+
>+enum rx_handler_prio {
>+ RX_HANDLER_PRIO_BRIDGE,
>+ RX_HANDLER_PRIO_BOND,
>+ RX_HANDLER_PRIO_MACVLAN,
>+};
>+
>+/*
>+ * struct rx_handler should be embedded into
>+ * private struct used by rx_handler
>+ */
>+struct rx_handler {
>+ struct list_head list;
>+ rx_handler_func_t *callback;
>+ unsigned int prio;
>+};
>+
>+/**
>+ * netdev_rx_handler_get_priv - get containing private structure of given
>+ * receive handler
>+ * @rx_handler: receive_handler
>+ * @type: the type of the container struct this is embedded in
>+ * @member: the name of the member within the struct
>+ */
>+#define netdev_rx_handler_get_priv(rx_handler, type, member) \
>+ container_of(rx_handler, type, member)
>+
>+/**
>+ * netdev_rx_handler_get_priv_by_prio, netdev_rx_handler_get_priv_by_prio_rcu
>+ * - get containing private structure of given receive handler priority
>+ * @dev: netdevice
>+ * @type: the type of the container struct this is embedded in
>+ * @member: the name of the member within the struct
>+ */
>+#define netdev_rx_handler_get_priv_by_prio(dev, prio, type, member) \
>+ netdev_rx_handler_get_priv(netdev_rx_handler_get_by_prio(dev, prio), \
>+ type, member)
>+
>+#define netdev_rx_handler_get_priv_by_prio_rcu(dev, prio, type, member) \
>+ netdev_rx_handler_get_priv(netdev_rx_handler_get_by_prio_rcu(dev, prio),\
>+ type, member)
>
> extern void __napi_schedule(struct napi_struct *n);
>
>@@ -1238,8 +1282,7 @@ struct net_device {
> #endif
> #endif
>
>- rx_handler_func_t __rcu *rx_handler;
>- void __rcu *rx_handler_data;
>+ struct list_head rx_handler_list;
>
> struct netdev_queue __rcu *ingress_queue;
>
>@@ -2082,10 +2125,18 @@ static inline void napi_free_frags(struct napi_struct *napi)
> napi->skb = NULL;
> }
>
>+extern struct rx_handler *
>+netdev_rx_handler_get_by_prio(const struct net_device *dev,
>+ unsigned int prio);
>+extern struct rx_handler *
>+netdev_rx_handler_get_by_prio_rcu(const struct net_device *dev,
>+ unsigned int prio);
> extern int netdev_rx_handler_register(struct net_device *dev,
>- rx_handler_func_t *rx_handler,
>- void *rx_handler_data);
>-extern void netdev_rx_handler_unregister(struct net_device *dev);
>+ struct rx_handler *rx_handler,
>+ rx_handler_func_t *callback,
>+ unsigned int prio);
>+extern void netdev_rx_handler_unregister(struct net_device *dev,
>+ struct rx_handler *rx_handler);
>
> extern int dev_valid_name(const char *name);
> extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
>diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
>index 1bacca4..4ee5d78 100644
>--- a/net/bridge/br_if.c
>+++ b/net/bridge/br_if.c
>@@ -146,7 +146,7 @@ static void del_nbp(struct net_bridge_port *p)
>
> dev->priv_flags &= ~IFF_BRIDGE_PORT;
>
>- netdev_rx_handler_unregister(dev);
>+ netdev_rx_handler_unregister(dev, &p->rx_handler);
> synchronize_net();
>
> netdev_set_master(dev, NULL);
>@@ -365,7 +365,8 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
> if (err)
> goto err3;
>
>- err = netdev_rx_handler_register(dev, br_handle_frame, p);
>+ err = netdev_rx_handler_register(dev, &p->rx_handler, br_handle_frame,
>+ RX_HANDLER_PRIO_BRIDGE);
> if (err)
> goto err4;
>
>diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
>index f3ac1e8..5f396d8 100644
>--- a/net/bridge/br_input.c
>+++ b/net/bridge/br_input.c
>@@ -140,7 +140,8 @@ static inline int is_link_local(const unsigned char *dest)
> * Return NULL if skb is handled
> * note: already called with rcu_read_lock
> */
>-rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
>+rx_handler_result_t br_handle_frame(struct sk_buff **pskb,
>+ struct rx_handler *rx_handler)
> {
> struct net_bridge_port *p;
> struct sk_buff *skb = *pskb;
>@@ -157,7 +158,7 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
> if (!skb)
> return RX_HANDLER_CONSUMED;
>
>- p = br_port_get_rcu(skb->dev);
>+ p = br_port_get(rx_handler);
>
> if (unlikely(is_link_local(dest))) {
> /* Pause frames shouldn't be passed up by driver anyway */
>diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
>index 54578f2..1a1ea40 100644
>--- a/net/bridge/br_private.h
>+++ b/net/bridge/br_private.h
>@@ -108,6 +108,7 @@ struct net_bridge_mdb_htable
>
> struct net_bridge_port
> {
>+ struct rx_handler rx_handler;
> struct net_bridge *br;
> struct net_device *dev;
> struct list_head list;
>@@ -152,18 +153,32 @@ struct net_bridge_port
> #endif
> };
>
>+#define br_port_get(rx_handler) \
>+ netdev_rx_handler_get_priv(rx_handler, \
>+ struct net_bridge_port, \
>+ rx_handler)
>+
> #define br_port_exists(dev) (dev->priv_flags & IFF_BRIDGE_PORT)
>
>-static inline struct net_bridge_port *br_port_get_rcu(const struct net_device *dev)
>+static inline struct net_bridge_port *
>+br_port_get_rcu(const struct net_device *dev)
> {
>- struct net_bridge_port *port = rcu_dereference(dev->rx_handler_data);
>- return br_port_exists(dev) ? port : NULL;
>+ if (unlikely(!br_port_exists(dev)))
>+ return NULL;
>+ return netdev_rx_handler_get_priv_by_prio_rcu(dev,
>+ RX_HANDLER_PRIO_BRIDGE,
>+ struct net_bridge_port,
>+ rx_handler);
> }
>
> static inline struct net_bridge_port *br_port_get_rtnl(struct net_device *dev)
> {
>- return br_port_exists(dev) ?
>- rtnl_dereference(dev->rx_handler_data) : NULL;
>+ if (unlikely(!br_port_exists(dev)))
>+ return NULL;
>+ return netdev_rx_handler_get_priv_by_prio(dev,
>+ RX_HANDLER_PRIO_BRIDGE,
>+ struct net_bridge_port,
>+ rx_handler);
> }
>
> struct br_cpu_netstats {
>@@ -382,7 +397,8 @@ extern u32 br_features_recompute(struct net_bridge *br, u32 features);
>
> /* br_input.c */
> extern int br_handle_frame_finish(struct sk_buff *skb);
>-extern rx_handler_result_t br_handle_frame(struct sk_buff **pskb);
>+extern rx_handler_result_t br_handle_frame(struct sk_buff **pskb,
>+ struct rx_handler *rx_handler);
>
> /* br_ioctl.c */
> extern int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
>diff --git a/net/core/dev.c b/net/core/dev.c
>index 6b6ef14..92d9007 100644
>--- a/net/core/dev.c
>+++ b/net/core/dev.c
>@@ -3043,10 +3043,55 @@ out:
> #endif
>
> /**
>+ * netdev_rx_handler_get_by_prio - get receive handler struct by priority
>+ * @dev: net device
>+ * @prio: receive handler priority
>+ *
>+ * Find and return receive handler for given priority.
>+ *
>+ * The caller must hold the rtnl_mutex.
>+ */
>+struct rx_handler *
>+netdev_rx_handler_get_by_prio(const struct net_device *dev, unsigned int prio)
>+{
>+ struct rx_handler *rx_handler;
>+
>+ ASSERT_RTNL();
>+ list_for_each_entry(rx_handler, &dev->rx_handler_list, list)
>+ if (rx_handler->prio == prio)
>+ return rx_handler;
>+ return NULL;
>+}
>+EXPORT_SYMBOL_GPL(netdev_rx_handler_get_by_prio);
>+
>+/**
>+ * netdev_rx_handler_get_by_prio_rcu - get receive handler struct by priority
>+ * @dev: net device
>+ * @prio: receive handler priority
>+ *
>+ * RCU variant to find and return receive handler for given priority.
>+ *
>+ * The caller must hold the rcu_read_lock.
>+ */
>+struct rx_handler *
>+netdev_rx_handler_get_by_prio_rcu(const struct net_device *dev,
>+ unsigned int prio)
>+{
>+ struct rx_handler *rx_handler;
>+
>+ list_for_each_entry_rcu(rx_handler, &dev->rx_handler_list, list)
>+ if (rx_handler->prio == prio)
>+ return rx_handler;
>+ return NULL;
>+}
>+EXPORT_SYMBOL_GPL(netdev_rx_handler_get_by_prio_rcu);
>+
>+/**
> * netdev_rx_handler_register - register receive handler
> * @dev: device to register a handler for
>- * @rx_handler: receive handler to register
>- * @rx_handler_data: data pointer that is used by rx handler
>+ * @rx_handler: receive handler structure to register
>+ * @callback: receive handler callback function to register
>+ * @prio: receive handler priority
> *
> * Register a receive hander for a device. This handler will then be
> * called from __netif_receive_skb. A negative errno code is returned
>@@ -3057,17 +3102,24 @@ out:
> * For a general description of rx_handler, see enum rx_handler_result.
> */
> int netdev_rx_handler_register(struct net_device *dev,
>- rx_handler_func_t *rx_handler,
>- void *rx_handler_data)
>+ struct rx_handler *rx_handler,
>+ rx_handler_func_t *callback, unsigned int prio)
> {
>- ASSERT_RTNL();
>+ struct list_head *pos;
>
>- if (dev->rx_handler)
>+ ASSERT_RTNL();
>+ if (netdev_rx_handler_get_by_prio(dev, prio))
> return -EBUSY;
>+ list_for_each(pos, &dev->rx_handler_list) {
>+ struct rx_handler *entry;
>
>- rcu_assign_pointer(dev->rx_handler_data, rx_handler_data);
>- rcu_assign_pointer(dev->rx_handler, rx_handler);
>-
>+ entry = list_entry(pos, struct rx_handler, list);
>+ if (prio > entry->prio)
>+ break;
>+ }
>+ rx_handler->callback = callback;
>+ rx_handler->prio = prio;
>+ list_add_rcu(&rx_handler->list, pos);
> return 0;
> }
> EXPORT_SYMBOL_GPL(netdev_rx_handler_register);
>@@ -3075,24 +3127,24 @@ EXPORT_SYMBOL_GPL(netdev_rx_handler_register);
> /**
> * netdev_rx_handler_unregister - unregister receive handler
> * @dev: device to unregister a handler from
>+ * @prio: handler priority
> *
> * Unregister a receive hander from a device.
> *
> * The caller must hold the rtnl_mutex.
> */
>-void netdev_rx_handler_unregister(struct net_device *dev)
>+void netdev_rx_handler_unregister(struct net_device *dev,
>+ struct rx_handler *rx_handler)
> {
>-
> ASSERT_RTNL();
>- rcu_assign_pointer(dev->rx_handler, NULL);
>- rcu_assign_pointer(dev->rx_handler_data, NULL);
>+ list_del_rcu(&rx_handler->list);
> }
> EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
>
> static int __netif_receive_skb(struct sk_buff *skb)
> {
> struct packet_type *ptype, *pt_prev;
>- rx_handler_func_t *rx_handler;
>+ struct rx_handler *rx_handler;
> struct net_device *orig_dev;
> struct net_device *null_or_dev;
> bool deliver_exact = false;
>@@ -3152,13 +3204,12 @@ another_round:
> ncls:
> #endif
>
>- rx_handler = rcu_dereference(skb->dev->rx_handler);
>- if (rx_handler) {
>+ list_for_each_entry_rcu(rx_handler, &skb->dev->rx_handler_list, list) {
> if (pt_prev) {
> ret = deliver_skb(skb, pt_prev, orig_dev);
> pt_prev = NULL;
> }
>- switch (rx_handler(&skb)) {
>+ switch (rx_handler->callback(&skb, rx_handler)) {
> case RX_HANDLER_CONSUMED:
> goto out;
> case RX_HANDLER_ANOTHER:
>@@ -5870,6 +5921,8 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
> INIT_LIST_HEAD(&dev->napi_list);
> INIT_LIST_HEAD(&dev->unreg_list);
> INIT_LIST_HEAD(&dev->link_watch_list);
>+ INIT_LIST_HEAD(&dev->rx_handler_list);
>+
> dev->priv_flags = IFF_XMIT_DST_RELEASE;
> setup(dev);
>
>--
>1.7.5.4
>
^ permalink raw reply
* Re: [AX25] inconsistent lock state
From: Bernard F6BVP @ 2011-07-01 13:00 UTC (permalink / raw)
To: Ralf Baechle DL5RB
Cc: Arnd Bergmann, linux-kernel, Linux Netdev List, linux-hams
In-Reply-To: <20110625163942.GB20976@linux-mips.org>
Hi all,
Now, who is going to commit this mkiss patch and the equivalent one for
sixpack.c ?
Bernard, f6bvp
Le 25/06/2011 18:39, Ralf Baechle DL5RB a écrit :
> On Sat, Jun 25, 2011 at 05:51:39PM +0200, f6bvp wrote:
>
>> I applied the patch and since then I could not reproduce the
>> inconsistent lock state.
>> Thus mkiss patch fixed it.
>
> I also think the patch is the right thing, so
>
> Acked-by: Ralf Baechle<ralf@linux-mips.org>
>
> Ralf
--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Skipping past TCP lost packet in userspace
From: Neil Horman @ 2011-07-01 13:37 UTC (permalink / raw)
To: Josh Lehan
Cc: janardhan.iyengar, Janardhan Iyengar, rick.jones2, Yuchung Cheng,
netdev, Bryan Ford
In-Reply-To: <4E0D87B6.8090108@krellan.com>
On Fri, Jul 01, 2011 at 01:39:18AM -0700, Josh Lehan wrote:
> On 06/30/2011 07:36 AM, Neil Horman wrote:
> > I'll leave the rest of this alone, since its pretty obvious that no one is going
> > to break TCP for you, but just so that you're aware, The only reason you have to
>
> That's the fundamental disconnect we've been trying to communicate: TCP
> *won't break*. None of the rules of TCP are broken, from the wire's
> point of view. The OS merely gets a richer API, from the application's
> point of view, to optimize the TCP protocol implementation to serve a
> wider variety of needs.
>
I get what you're saying, but a API change that is only available on linux is
still a break. I get that its not an on-wire change, but API differences that
make code non-portable go unused, for exactly that reason - people don't write
apps that can only work on linux, they write standard apps that comply to
specifications. Deviations from those standards go unused.
I suppose it comes down to a difference of opinion about what "broken" amounts
to. Either way, if you want to see this happen, I'm certain it will start with
you presenting code and illustrating its benefit. No one else is going to write
this for you.
> > use the 2-Wire gateway that AT&T provides is because there are no commercially
> > available routers that support the uplink interface (which I expect will change
>
> That would be good to give the customer a choice of access devices with
> which to get on the network, and let the market device what is best,
> instead of AT&T dictating what's allowed. I'm getting deja vu of a
> famous legal case from 27 years ago.
>
> > eventually). In the time being, if you want to use a different router, place
> > the RG in bridge mode by selecting a host as your DMZ device. That will assign
> > the wan address to that connected device via DHCP and allow you to pass whatever
> > traffic you want through it. I use it to pass SCTP and IPv6 traffice all the
> > time, works great.
>
> Wow, that's news to me, that it allows this.
>
> http://www.ka9q.net/Uverse/
>
> Have the limitations in these documents been addressed? If so, kudos to
> AT&T.
>
The limitations are overstated in the link above. NAT is mandatory, but only
over the HPNA interface. The idea is to prevent your set-top box that AT&T
communicates with from having a public ip address (to maintain quality of
service to the TV and prevent outside attacks). They have one or two ports
forwarded from the public ip address to the private address of the set top box
In comparison the RJ-45 interfaces can be made wide open. Specifically you can
attach a single device and mark it as the DMZ for the Residential gateway.
anything not forwarded to the set top box gets passed to the DMZ device.
So its not 100% NAT free. Its wide open, minus a single port to allow AT&T to
push content to your set top box.
It works pretty well. I marked v6rotuer.think-freely.org as my DMZ device and
use it to do my own internal NAT-ing for IPv4 as well as serve as the tunnel
enpoint and router for my IPv6 network.
Neil
> Josh Lehan
>
^ permalink raw reply
* Re: [PATCH 1/2] nfnetlink: add RCU in nfnetlink_rcv_msg()
From: Florian Westphal @ 2011-07-01 14:11 UTC (permalink / raw)
To: Eric Dumazet
Cc: Florian Westphal, Patrick McHardy, Eric Leblond, sclark46,
Kuzin Andrey, Anders Nilsson Plymoth, netfilter-devel, netdev
In-Reply-To: <1309534078.2599.25.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le vendredi 01 juillet 2011 à 09:49 +0200, Florian Westphal a écrit :
> > But I guess even having to grab a refcount would be
> > a huge win as opposed to holding on to the nfnl mutex...
> >
> > We'd also need to audit all ->call implementations; most
> > of them assume the nfnl_mutex is being hold.
>
> We can do another way : Introduce a new ->call_rcu() implementation
> and convert places where we prefer not holding nfnf_mutex.
> If/when all places are converted, remove the ->call() field for good.
Sounds reasonable to me.
Both patches look great, thanks a lot for doing this Eric!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] Disable router anycast address for /127 prefixes
From: Brian Haley @ 2011-07-01 14:45 UTC (permalink / raw)
To: Bjørn Mork; +Cc: netdev, Stephen Hemminger, Herbert Xu
In-Reply-To: <1309519330-16649-1-git-send-email-bjorn@mork.no>
On 07/01/2011 07:22 AM, Bjørn Mork wrote:
> RFC 6164 requires that routers MUST disable Subnet-Router anycast
> for the prefix when /127 prefixes are used.
>
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
> ---
> @@ -1479,6 +1481,8 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
> static void addrconf_leave_anycast(struct inet6_ifaddr *ifp)
> {
> struct in6_addr addr;
> + if (ifp->prefix_len == 127) /* RFC 6164 */
> + return;
> ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
> if (ipv6_addr_any(&addr))
> return;
I'm not sure you'd need this part as there shouldn't be a /127 in the list to remove.
-Brian
^ permalink raw reply
* Re: [RFC patch net-next-2.6] net: allow multiple rx_handler registration
From: Nicolas de Pesloüan @ 2011-07-01 14:57 UTC (permalink / raw)
To: Michał Mirosław
Cc: Jiri Pirko, Stephen Hemminger, netdev, davem, kaber, fubar,
eric.dumazet, andy
In-Reply-To: <BANLkTik6mj=8zvYPN-NNvHP-GPcTNHo31Q@mail.gmail.com>
Le 01/07/2011 08:36, Michał Mirosław a écrit :
> 2011/6/30 Jiri Pirko<jpirko@redhat.com>:
>> Thu, Jun 30, 2011 at 06:27:12PM CEST, shemminger@vyatta.com wrote:
>>> On Thu, 30 Jun 2011 17:16:49 +0200
>>> Jiri Pirko<jpirko@redhat.com> wrote:
>>>
>>>> For some net topos it is necessary to have multiple "soft-net-devices"
>>>> hooked on one netdev. For example very common is to have
>>>> eth<->(br+vlan). Vlan is not using rh_handler (yet) but also for example
>>>> macvlan would be useful to have hooked on same netdev as br.
>>>>
>>>> This patch introduces rx_handler list. size struct net_device stays
>>>> intact. Measured performance regression on eth-br topo is ~1% (on received
>>>> pkts generated by pktgen) and on eth-bond topo it is ~0.25%
>>>>
>>>> On br I think that the performance can be brought back maybe by using per-cpu
>>>> variables to store port in rx_path (I must check this)
>>>>
>>>> Please comment.
>>>>
>>>> Signed-off-by: Jiri Pirko<jpirko@redhat.com>
>>>
>>> I am ok with the infrastructure, but why should Vlan use rh_handle.
>>
>> Well why it shoudln't. It would fit into what rx_handler is here for - the
>> code would be more unified. Also net_device struct would lose struct
>> vlan_group __rcu *vlgrp pointer (and reducing net_device size is always
>> good thing).
>>
>>> It is wrong to allow macvlan and bridge to share same device.
>>> Right now the code blocks users from doing lots of stupid things.
>>
>> Right, this is since rx_handler was introduced. Before that all these
>> stupid configs were allowed. It's possible easily to forbid unwanted
>> configs by checking priv flags.
>
> We could introduce a catch-all macvlan/vlan device that would take
> addresses/VLANs which are not covered by other configured
> macvlans/vlans. This would allow clearer configuration and would make
> the evaluation order explicit. As a bonus, this will give another
> device to put tcpdump on. ;-)
'Sounds like what I had in mind in http://marc.info/?l=linux-netdev&m=130622112921245&w=2 .
Nicolas.
^ permalink raw reply
* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: Michał Mirosław @ 2011-07-01 14:58 UTC (permalink / raw)
To: David Lamparter; +Cc: Stephen Hemminger, Nick Carter, netdev, davem
In-Reply-To: <20110701101625.GB3988422@jupiter.n2.diac24.net>
2011/7/1 David Lamparter <equinox@diac24.net>:
> On Wed, Jun 29, 2011 at 04:34:23PM -0700, Stephen Hemminger wrote:
>> The problem is that the damn 802.1 committees keep loading up protocols
>> on the same multicast address range. Trying to solve a design committee
>> problem in the kernel is not going to make anybody happy.
>>
>> I am happy with the simple solution of:
>> no STP == Hub
>> STP == Bridge
>> These are both well know configurations and are blessed by standards.
>
> I agree, that is how we should behave by default, and we'll match most
> admin's expectations.
>
> Regarding multicast groups, I would summarise like this:
> 1. any multicast gets forwarded by default,
> 2. unless it is 01:80:c2:00:00:01 or :02 (pause/bonding)
> (this rule applies regardless of STP state)
> 3. if STP is on:
> 4. 01:80:c2:00:00:00 (STP) never gets forwarded
> 5. 01:80:c2:00:00:03-0f don't get forwarded by default
>
> What we can do is add a switch to disable the #5 rule. The way I see it
> is that that switch would remove an exception from the rule and turn it
> back to the default #1; that's acceptable for making a new knob in my
> eyes.
>
> (Adding an 802.1X knob would be an exception to the exception for me,
> which is why I'm against it.)
>
> I'll cook up a patch in a few minutes, we really need to get rule #2
> right anyway. We _MUST_NOT_ pass bonding frames in any case, but we
> currently do that if STP is off. (cf. my earlier patch 1/2)
If you use linux box as a (invisible) L2 network tap, then you want to
pass everything in the hub mode (including LACP/whatever).
Best Regards,
Michał Mirosław
^ permalink raw reply
* Re: [RFC patch net-next-2.6] net: allow multiple rx_handler registration
From: Jiri Pirko @ 2011-07-01 15:00 UTC (permalink / raw)
To: Nicolas de Pesloüan
Cc: Michał Mirosław, Stephen Hemminger, netdev, davem,
kaber, fubar, eric.dumazet, andy
In-Reply-To: <4E0DE043.4030701@gmail.com>
Fri, Jul 01, 2011 at 04:57:07PM CEST, nicolas.2p.debian@gmail.com wrote:
>Le 01/07/2011 08:36, Michał Mirosław a écrit :
>>2011/6/30 Jiri Pirko<jpirko@redhat.com>:
>>>Thu, Jun 30, 2011 at 06:27:12PM CEST, shemminger@vyatta.com wrote:
>>>>On Thu, 30 Jun 2011 17:16:49 +0200
>>>>Jiri Pirko<jpirko@redhat.com> wrote:
>>>>
>>>>>For some net topos it is necessary to have multiple "soft-net-devices"
>>>>>hooked on one netdev. For example very common is to have
>>>>>eth<->(br+vlan). Vlan is not using rh_handler (yet) but also for example
>>>>>macvlan would be useful to have hooked on same netdev as br.
>>>>>
>>>>>This patch introduces rx_handler list. size struct net_device stays
>>>>>intact. Measured performance regression on eth-br topo is ~1% (on received
>>>>>pkts generated by pktgen) and on eth-bond topo it is ~0.25%
>>>>>
>>>>>On br I think that the performance can be brought back maybe by using per-cpu
>>>>>variables to store port in rx_path (I must check this)
>>>>>
>>>>>Please comment.
>>>>>
>>>>>Signed-off-by: Jiri Pirko<jpirko@redhat.com>
>>>>
>>>>I am ok with the infrastructure, but why should Vlan use rh_handle.
>>>
>>>Well why it shoudln't. It would fit into what rx_handler is here for - the
>>>code would be more unified. Also net_device struct would lose struct
>>>vlan_group __rcu *vlgrp pointer (and reducing net_device size is always
>>>good thing).
>>>
>>>>It is wrong to allow macvlan and bridge to share same device.
>>>>Right now the code blocks users from doing lots of stupid things.
>>>
>>>Right, this is since rx_handler was introduced. Before that all these
>>>stupid configs were allowed. It's possible easily to forbid unwanted
>>>configs by checking priv flags.
>>
>>We could introduce a catch-all macvlan/vlan device that would take
>>addresses/VLANs which are not covered by other configured
>>macvlans/vlans. This would allow clearer configuration and would make
>>the evaluation order explicit. As a bonus, this will give another
>>device to put tcpdump on. ;-)
>
>'Sounds like what I had in mind in http://marc.info/?l=linux-netdev&m=130622112921245&w=2 .
Looks useful. I'm goint to look at how to implement this.
Thanks.
>
> Nicolas.
>
^ permalink raw reply
* Re: [RFC patch net-next-2.6] net: allow multiple rx_handler registration
From: Michał Mirosław @ 2011-07-01 15:01 UTC (permalink / raw)
To: Nicolas de Pesloüan
Cc: Jiri Pirko, Stephen Hemminger, netdev, davem, kaber, fubar,
eric.dumazet, andy
In-Reply-To: <4E0DE043.4030701@gmail.com>
W dniu 1 lipca 2011 16:57 użytkownik Nicolas de Pesloüan
<nicolas.2p.debian@gmail.com> napisał:
> Le 01/07/2011 08:36, Michał Mirosław a écrit :
>>
>> 2011/6/30 Jiri Pirko<jpirko@redhat.com>:
>>>
>>> Thu, Jun 30, 2011 at 06:27:12PM CEST, shemminger@vyatta.com wrote:
>>>>
>>>> On Thu, 30 Jun 2011 17:16:49 +0200
>>>> Jiri Pirko<jpirko@redhat.com> wrote:
>>>>
>>>>> For some net topos it is necessary to have multiple "soft-net-devices"
>>>>> hooked on one netdev. For example very common is to have
>>>>> eth<->(br+vlan). Vlan is not using rh_handler (yet) but also for
>>>>> example
>>>>> macvlan would be useful to have hooked on same netdev as br.
>>>>>
>>>>> This patch introduces rx_handler list. size struct net_device stays
>>>>> intact. Measured performance regression on eth-br topo is ~1% (on
>>>>> received
>>>>> pkts generated by pktgen) and on eth-bond topo it is ~0.25%
>>>>>
>>>>> On br I think that the performance can be brought back maybe by using
>>>>> per-cpu
>>>>> variables to store port in rx_path (I must check this)
>>>>>
>>>>> Please comment.
>>>>>
>>>>> Signed-off-by: Jiri Pirko<jpirko@redhat.com>
>>>>
>>>> I am ok with the infrastructure, but why should Vlan use rh_handle.
>>>
>>> Well why it shoudln't. It would fit into what rx_handler is here for -
>>> the
>>> code would be more unified. Also net_device struct would lose struct
>>> vlan_group __rcu *vlgrp pointer (and reducing net_device size is always
>>> good thing).
>>>
>>>> It is wrong to allow macvlan and bridge to share same device.
>>>> Right now the code blocks users from doing lots of stupid things.
>>>
>>> Right, this is since rx_handler was introduced. Before that all these
>>> stupid configs were allowed. It's possible easily to forbid unwanted
>>> configs by checking priv flags.
>>
>> We could introduce a catch-all macvlan/vlan device that would take
>> addresses/VLANs which are not covered by other configured
>> macvlans/vlans. This would allow clearer configuration and would make
>> the evaluation order explicit. As a bonus, this will give another
>> device to put tcpdump on. ;-)
>
> 'Sounds like what I had in mind in
> http://marc.info/?l=linux-netdev&m=130622112921245&w=2 .
Almost. My idea assumes that eth0.any won't strip VLAN headers (so its
just looks like a filtered eth0).
Best Regards,
Michał Mirosław
^ permalink raw reply
* bridge vs. bonding/pause frames (was: Forward EAPOL...)
From: David Lamparter @ 2011-07-01 15:16 UTC (permalink / raw)
To: Michał Mirosław
Cc: David Lamparter, Stephen Hemminger, Nick Carter, netdev, davem
In-Reply-To: <BANLkTimjnP87CAA7JVAe5hqeP08Hd7766g@mail.gmail.com>
On Fri, Jul 01, 2011 at 04:58:56PM +0200, Michał Mirosław wrote:
[...]
> > We _MUST_NOT_ pass bonding frames in any case, but we
> > currently do that if STP is off. (cf. my earlier patch 1/2)
>
> If you use linux box as a (invisible) L2 network tap, then you want to
> pass everything in the hub mode (including LACP/whatever).
We must not do that by default, this breaks bridges with bonding devices
as ports. I'm actively band-aiding that problem with ebtables on one of
my boxes currently.
How about I change "stp_forward_802local" to "forward_802local" and it
gets 3 values like:
- 0 (default) behave like a switch, if STP is on then drop all 16
groups, if STP is off then drop :01 and :02
- 1 forward regular groups - drop :01 and :02, forward everything else
- 2 forward everything ("invisible tap mode")
optional:
- -1 drop all 16 groups even if STP is off (not needed, can be done with
ebtables...)
btw, since the drivers should eat up pause frames, you're not a fully
invisible L2 tap anyway.
-David
^ permalink raw reply
* Re: coding style question on indentation
From: Joe Perches @ 2011-07-01 15:23 UTC (permalink / raw)
To: Sathya.Perla; +Cc: netdev
In-Reply-To: <3367B80B08154D42A3B2BC708B5D41F63F87EF145E@EXMAIL.ad.emulex.com>
On Fri, 2011-07-01 at 04:20 -0700, Sathya.Perla@Emulex.Com wrote:
> a) Aligning the next line with the first argument by inserting a few spaces after the tabs - as in:
>
> dma_unmap_page(&adapter->pdev->dev,
> dma_unmap_addr(rx_page_info, bus),
> adapter->big_page_size, DMA_FROM_DEVICE);
My preference as well, but your example may not be correct.
I think this better:
1 2 3 4 5 6 7 8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
dma_unmap_page(&adapter->pdev->dev, dma_unmap_addr(rx_page_info, bus),
adapter->big_page_size, DMA_FROM_DEVICE);
maximally fill to 80 cols, then wrap with maximal tabs using spaces
if necessary to align args after opening parenthesis.
In this case, 2 tabs, 7 spaces.
It is your code though, do what you think best.
^ 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