* [net-next PATCH] net: netprio_cgroup: make net_prio_subsys static
From: John Fastabend @ 2011-12-08 5:17 UTC (permalink / raw)
To: davem, nhorman; +Cc: netdev
net_prio_subsys can be made static this removes the sparse
warning it was throwing.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
net/core/netprio_cgroup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index 3a9fd48..ea16c8f 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -28,7 +28,7 @@ static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss,
static void cgrp_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp);
-struct cgroup_subsys net_prio_subsys = {
+static struct cgroup_subsys net_prio_subsys = {
.name = "net_prio",
.create = cgrp_create,
.destroy = cgrp_destroy,
^ permalink raw reply related
* Re: [Patch V2 ] net: doc: cleanup Documentation/networking/scaling.txt
From: Shan Wei @ 2011-12-08 5:32 UTC (permalink / raw)
To: Ben Hutchings
Cc: David Miller, rdunlap, willemb, benjamin.poirier, therbert,
linux-doc, netdev
In-Reply-To: <1323316878.18450.60.camel@deadeye>
Ben Hutchings said, at 2011/12/8 12:01:
> UTF-8 is the standard character encoding under Linux and those quotes
> will be displayed correctly on most Linux terminals today. If you must
> set your terminal to some other encoding you can use e.g.:
>
> recode UTF-8 < Documentation/networking/scaling.txt | less
Thanks for your suggestion, i will set terminal with UTF-8.
And resubmit new version patch that only fixes typos.
--
Best Regards
Shan Wei
^ permalink raw reply
* [patch] sock_diag: off by one checks
From: Dan Carpenter @ 2011-12-08 6:49 UTC (permalink / raw)
To: David S. Miller; +Cc: Pavel Emelyanov, netdev, kernel-janitors
These tests are off by one because sock_diag_handlers[] only has AF_MAX
elements.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
index fbaf01c..9c27bcd 100644
--- a/net/core/sock_diag.c
+++ b/net/core/sock_diag.c
@@ -32,7 +32,7 @@ int sock_diag_register(struct sock_diag_handler *hndl)
{
int err = 0;
- if (hndl->family > AF_MAX)
+ if (hndl->family >= AF_MAX)
return -EINVAL;
mutex_lock(&sock_diag_table_mutex);
@@ -50,7 +50,7 @@ void sock_diag_unregister(struct sock_diag_handler *hnld)
{
int family = hnld->family;
- if (family > AF_MAX)
+ if (family >= AF_MAX)
return;
mutex_lock(&sock_diag_table_mutex);
^ permalink raw reply related
* Re: [PATCH v2 0/8][NET] fec.c: several cleanups and bugfixes
From: Lothar Waßmann @ 2011-12-08 7:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel, shawn.guo
In-Reply-To: <20111207.133800.1403774147364781100.davem@davemloft.net>
Hi,
David Miller writes:
> From: Lothar Waßmann <LW@KARO-electronics.de>
> Date: Wed, 7 Dec 2011 14:37:12 +0100
>
> > The following set of patches provides some cleanup and bugfixes for
> > drivers/net/ethernet/freescale/fec.c and makes the driver buildable as
> > a module.
>
> 1) I said to use a subject prefix of "fec: " not "fec.c: "
>
OK.
> 2) You did not integrate Shawn's "Acked-by: " tags, I'm not going to
> go sifting through the previous patch postings to collect them up,
> that's your job.
>
I still got no Ack from Shawn for patches 3 and 5 and only Tested-by
for patches 6 thru 8. Should I wait for Shawn's Ack for those patches
too, or should I resent now?
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
^ permalink raw reply
* Re: [PATCH v2 0/8][NET] fec.c: several cleanups and bugfixes
From: Shawn Guo @ 2011-12-08 7:05 UTC (permalink / raw)
To: Lothar Waßmann; +Cc: David Miller, netdev, linux-kernel
In-Reply-To: <20192.24749.652755.425707@ipc1.ka-ro>
On 8 December 2011 15:01, Lothar Waßmann <LW@karo-electronics.de> wrote:
> Hi,
>
> David Miller writes:
>> From: Lothar Waßmann <LW@KARO-electronics.de>
>> Date: Wed, 7 Dec 2011 14:37:12 +0100
>>
>> > The following set of patches provides some cleanup and bugfixes for
>> > drivers/net/ethernet/freescale/fec.c and makes the driver buildable as
>> > a module.
>>
>> 1) I said to use a subject prefix of "fec: " not "fec.c: "
>>
> OK.
To be consistent with existing commits, I would suggest use "net/fec:
" as the subject prefix.
>
>> 2) You did not integrate Shawn's "Acked-by: " tags, I'm not going to
>> go sifting through the previous patch postings to collect them up,
>> that's your job.
>>
> I still got no Ack from Shawn for patches 3 and 5 and only Tested-by
> for patches 6 thru 8. Should I wait for Shawn's Ack for those patches
> too, or should I resent now?
>
For the whole series,
Acked-by: Shawn Guo <shawn.guo@linaro.org>
--
Regards,
Shawn
^ permalink raw reply
* Re: [PATCH] powerpc: Add TBI PHY node to first MDIO bus
From: Kumar Gala @ 2011-12-08 7:23 UTC (permalink / raw)
To: Andy Fleming; +Cc: David Miller, netdev, linuxppc-dev
In-Reply-To: <1323287457-6085-1-git-send-email-afleming@freescale.com>
On Dec 7, 2011, at 1:50 PM, Andy Fleming wrote:
> Systems which use the fsl_pq_mdio driver need to specify an
> address for TBI PHY transactions such that the address does
> not conflict with any PHYs on the bus (all transactions to
> that address are directed to the onboard TBI PHY). The driver
> used to scan for a free address if no address was specified,
> however this ran into issues when the PHY Lib was fixed so
> that all MDIO transactions were protected by a mutex. As it
> is, the code was meant to serve as a transitional tool until
> the device trees were all updated to specify the TBI address.
>
> The best fix for the mutex issue was to remove the scanning code,
> but it turns out some of the newer SoCs have started to omit
> the tbi-phy node when SGMII is not being used. As such, these
> devices will now fail unless we add a tbi-phy node to the first
> mdio controller.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
>
> This requires fsl_pq_mdio: Clean up tbi address configuration from
> the net tree in order to achieve its full effect.
>
> This needs to go into 3.2.
>
> arch/powerpc/boot/dts/p1010rdb.dts | 5 +++++
> arch/powerpc/boot/dts/p1020rdb.dts | 5 +++++
> arch/powerpc/boot/dts/p1020rdb_camp_core0.dts | 5 +++++
> arch/powerpc/boot/dts/p1021mds.dts | 4 ++++
> arch/powerpc/boot/dts/p1022ds.dts | 4 ++++
> arch/powerpc/boot/dts/p2020rdb.dts | 8 ++++++--
> arch/powerpc/boot/dts/p2020rdb_camp_core0.dts | 4 ++++
> 7 files changed, 33 insertions(+), 2 deletions(-)
applied to merge
- k
^ permalink raw reply
* [PATCH v3 0/8] net/fec: several cleanups and bugfixes
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
The following set of patches provides some cleanup and bugfixes for
drivers/net/ethernet/freescale/fec.c and makes the driver buildable as
a module.
Changes wrt v2:
- subject prefix changed to be in sync with existing commits
- added Acked-by:
Lothar WaÃmann (8):
misc cleanups
set con_id in clk_get() call to NULL
prevent dobule restart of interface on FDX/HDX change
don't request invalid IRQ
don't munge MAC address from platform data
preserve MII/RMII setting in fec_stop()
fix the .remove code
make FEC driver buildable as module
drivers/net/ethernet/freescale/Kconfig | 2 +-
drivers/net/ethernet/freescale/fec.c | 63 ++++++++++++++++++++++----------
2 files changed, 44 insertions(+), 21 deletions(-)
^ permalink raw reply
* [PATCH v3 1/8] net/fec: misc cleanups
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
- remove some bogus whitespace
- remove line wraps from printk messages
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 1124ce0..f224e58 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -99,7 +99,7 @@ static struct platform_device_id fec_devtype[] = {
MODULE_DEVICE_TABLE(platform, fec_devtype);
enum imx_fec_type {
- IMX25_FEC = 1, /* runs on i.mx25/50/53 */
+ IMX25_FEC = 1, /* runs on i.mx25/50/53 */
IMX27_FEC, /* runs on i.mx27/35/51 */
IMX28_FEC,
IMX6Q_FEC,
@@ -132,7 +132,7 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address");
#elif defined (CONFIG_M5272C3)
#define FEC_FLASHMAC (0xffe04000 + 4)
#elif defined(CONFIG_MOD5272)
-#define FEC_FLASHMAC 0xffc0406b
+#define FEC_FLASHMAC 0xffc0406b
#else
#define FEC_FLASHMAC 0
#endif
@@ -972,8 +972,9 @@ static int fec_enet_mii_probe(struct net_device *ndev)
}
if (phy_id >= PHY_MAX_ADDR) {
- printk(KERN_INFO "%s: no PHY, assuming direct connection "
- "to switch\n", ndev->name);
+ printk(KERN_INFO
+ "%s: no PHY, assuming direct connection to switch\n",
+ ndev->name);
strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE);
phy_id = 0;
}
@@ -998,8 +999,9 @@ static int fec_enet_mii_probe(struct net_device *ndev)
fep->link = 0;
fep->full_duplex = 0;
- printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
- "(mii_bus:phy_addr=%s, irq=%d)\n", ndev->name,
+ printk(KERN_INFO
+ "%s: Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
+ ndev->name,
fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
fep->phy_dev->irq);
--
1.5.6.5
^ permalink raw reply related
* [PATCH v3 2/8] net/fec: set con_id in clk_get() call to NULL
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
The con_id is actually not needed for clk_get().
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index f224e58..65ee506 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1585,7 +1585,7 @@ fec_probe(struct platform_device *pdev)
}
}
- fep->clk = clk_get(&pdev->dev, "fec_clk");
+ fep->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(fep->clk)) {
ret = PTR_ERR(fep->clk);
goto failed_clk;
--
1.5.6.5
^ permalink raw reply related
* [PATCH v3 3/8] net/fec: prevent dobule restart of interface on FDX/HDX change
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
Upon detection of a FDX/HDX change the interface is restarted twice.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 65ee506..7ef408f 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -865,6 +865,8 @@ static void fec_enet_adjust_link(struct net_device *ndev)
if (phy_dev->link) {
if (fep->full_duplex != phy_dev->duplex) {
fec_restart(ndev, phy_dev->duplex);
+ /* prevent unnecessary second fec_restart() below */
+ fep->link = phy_dev->link;
status_change = 1;
}
}
--
1.5.6.5
^ permalink raw reply related
* [PATCH v3 4/8] net/fec: don't request invalid IRQ
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
prevent calling request_irq() with a known invalid IRQ number and
preserve the return value of the platform_get_irq() function
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 7ef408f..e2b5ce6 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1575,8 +1575,12 @@ fec_probe(struct platform_device *pdev)
for (i = 0; i < FEC_IRQ_NUM; i++) {
irq = platform_get_irq(pdev, i);
- if (i && irq < 0)
- break;
+ if (irq < 0) {
+ if (i)
+ break;
+ ret = irq;
+ goto failed_irq;
+ }
ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
if (ret) {
while (--i >= 0) {
--
1.5.6.5
^ permalink raw reply related
* [PATCH v3 5/8] net/fec: don't munge MAC address from platform data
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
When the MAC address is supplied via platform_data it should be OK as
it is and should not be modified in case of a dual FEC setup.
Also copying the MAC from platform_data to the single 'macaddr'
variable will overwrite the MAC for the first interface in case of a
dual FEC setup.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index e2b5ce6..11534b9 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -818,7 +818,7 @@ static void __inline__ fec_get_mac(struct net_device *ndev)
iap = (unsigned char *)FEC_FLASHMAC;
#else
if (pdata)
- memcpy(iap, pdata->mac, ETH_ALEN);
+ iap = (unsigned char *)&pdata->mac;
#endif
}
--
1.5.6.5
^ permalink raw reply related
* [PATCH v3 6/8] net/fec: preserve MII/RMII setting in fec_stop()
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
Additionally to setting the ETHER_EN bit in FEC_ECNTRL the MII/RMII
setting in FEC_R_CNTRL needs to be preserved to keep the MII interface
functional.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 11534b9..ab0afb5 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -515,6 +515,7 @@ fec_stop(struct net_device *ndev)
struct fec_enet_private *fep = netdev_priv(ndev);
const struct platform_device_id *id_entry =
platform_get_device_id(fep->pdev);
+ u32 rmii_mode = readl(fep->hwp + FEC_R_CNTRL) & (1 << 8);
/* We cannot expect a graceful transmit stop without link !!! */
if (fep->link) {
@@ -531,8 +532,10 @@ fec_stop(struct net_device *ndev)
writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
/* We have to keep ENET enabled to have MII interrupt stay working */
- if (id_entry->driver_data & FEC_QUIRK_ENET_MAC)
+ if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
writel(2, fep->hwp + FEC_ECNTRL);
+ writel(rmii_mode, fep->hwp + FEC_R_CNTRL);
+ }
}
--
1.5.6.5
^ permalink raw reply related
* [PATCH v3 7/8] net/fec: fix the .remove code
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
The .remove code is broken in several ways.
- mdiobus_unregister() is called twice for the same object in case of dual FEC
- phy_disconnect() is being called when the PHY is already disconnected
- the requested IRQ(s) are not freed
- fec_stop() is being called with the inteface already stopped
All of those lead to kernel crashes if the remove function is actually used.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index ab0afb5..01ee9cc 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -259,6 +259,8 @@ struct fec_enet_private {
/* Transmitter timeout */
#define TX_TIMEOUT (2 * HZ)
+static int mii_cnt;
+
static void *swap_buffer(void *bufaddr, int len)
{
int i;
@@ -1040,8 +1042,12 @@ static int fec_enet_mii_init(struct platform_device *pdev)
*/
if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) {
/* fec1 uses fec0 mii_bus */
- fep->mii_bus = fec0_mii_bus;
- return 0;
+ if (mii_cnt && fec0_mii_bus) {
+ fep->mii_bus = fec0_mii_bus;
+ mii_cnt++;
+ return 0;
+ }
+ return -ENOENT;
}
fep->mii_timeout = 0;
@@ -1086,6 +1092,8 @@ static int fec_enet_mii_init(struct platform_device *pdev)
if (mdiobus_register(fep->mii_bus))
goto err_out_free_mdio_irq;
+ mii_cnt++;
+
/* save fec0 mii_bus */
if (id_entry->driver_data & FEC_QUIRK_ENET_MAC)
fec0_mii_bus = fep->mii_bus;
@@ -1102,11 +1110,11 @@ err_out:
static void fec_enet_mii_remove(struct fec_enet_private *fep)
{
- if (fep->phy_dev)
- phy_disconnect(fep->phy_dev);
- mdiobus_unregister(fep->mii_bus);
- kfree(fep->mii_bus->irq);
- mdiobus_free(fep->mii_bus);
+ if (--mii_cnt == 0) {
+ mdiobus_unregister(fep->mii_bus);
+ kfree(fep->mii_bus->irq);
+ mdiobus_free(fep->mii_bus);
+ }
}
static int fec_enet_get_settings(struct net_device *ndev,
@@ -1646,13 +1654,18 @@ fec_drv_remove(struct platform_device *pdev)
struct net_device *ndev = platform_get_drvdata(pdev);
struct fec_enet_private *fep = netdev_priv(ndev);
struct resource *r;
+ int i;
- fec_stop(ndev);
+ unregister_netdev(ndev);
fec_enet_mii_remove(fep);
+ for (i = 0; i < FEC_IRQ_NUM; i++) {
+ int irq = platform_get_irq(pdev, i);
+ if (irq > 0)
+ free_irq(irq, ndev);
+ }
clk_disable(fep->clk);
clk_put(fep->clk);
iounmap(fep->hwp);
- unregister_netdev(ndev);
free_netdev(ndev);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
--
1.5.6.5
^ permalink raw reply related
* [PATCH v3 8/8] net/fec: make FEC driver buildable as module
From: Lothar Waßmann @ 2011-12-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: David Miller, linux-kernel, Shawn Guo, Lothar Waßmann
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
index c520cfd..b02e315 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -21,7 +21,7 @@ config NET_VENDOR_FREESCALE
if NET_VENDOR_FREESCALE
config FEC
- bool "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
+ tristate "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \
ARCH_MXC || ARCH_MXS)
select PHYLIB
--
1.5.6.5
^ permalink raw reply related
* Fwd: ICMP-REDIRECT paquet & Host ARP TABLE corruption. verified on fedora kernel 3.1.0-7 and ubuntu 11.10 3.0.0
From: Cedric Lagneau @ 2011-12-08 8:20 UTC (permalink / raw)
To: netdev; +Cc: Dan Carpenter
In-Reply-To: <7ff1ebee-b784-4e01-97fa-d8f2dab8de34@zimbra2.corp.accelance.fr>
original mail:
> hi all,
>
> Since kernel => 3.0 we've found some strange behavior with kernel >=3.0 on our architecture. Some host cannot acces some network anymore after using this Kernel. Verified on ubuntu 11.10 and fedora fc16.
>
>
> Explaination:
>
> Host with simple ip
> default install
> default sysctl.conf :
> net.ipv4.conf.all.accept_redirects=1
> net.ipv4.conf.default.accept_redirects=1
> no netfilter
>
> A forged icmp type 5 redirect code 0 or 1 to this host from another host on the same network corrupt the ARP table with entry for non-local network
>
> sample:
> hostA ip 192.168.2.192/24
> gw 192.168.2.254
>
> arp -an
> 192.168.2.254 at 00:00:5e:00:01:60
>
>
> then from a B host , i forge an icmp-redirect paquet like this:
> 192.168.2.254 > 192.168.2.192: ICMP redirect 87.106.170.240 to net 192.168.10.10
>
> after that on hostA i do a simple icmp ping to 87.106.170.240 , sent arp from hostB and ARP table of hostA is corrupted:
>
> arp -an
> 192.168.2.254 at 00:00:5e:00:01:60
> 192.168.10.10 at <incomplete>
>
>
> if i put hostB ip as icmp-redirect gw, hostB receive paquet.
>
>
> Best regards,
>
>
> Cédric Lagneau
Then :
> So I downloaded an arp forger from:
> http://insecure.org/sploits/arp.games.html
>
> ./icmp_redir 192.168.1.1 192.168.1.101 153.104.63.227 192.168.4.8
> (gw) (3.0 system) (random ip) (not on my lan)
>
> I was able to make 153.104.63.227 unroutable on 2.6.39 and higher
> but not on 2.6.38. The new ip 192.168.4.8 does show up in arp -n
> but it gets cleaned out much faster.
>
>regards,
>dan carpenter
thanks, don't know this tools, i was using python-scarpy to forge icmp paquet.
for me bad arp entry is never cleaned and i need to reboot host. arp -d "ip" say this:
SIOCDARP(priv): Network is unreachable
This can cause problems on some architecture like this simplified version:
----backbone--- "Public network" with multiple gateways to reach multiple networks. Icmp-redirect allowed.
|
Firewall with outgoing NAT 192.168.2.0/24 -> IP from "public network". icmp-redirect blocked on fw to protect internal LAN.
|
-----LAN------ 192.168.2.0/24 gateway : Firewall
When a lan host want to reach non-local networks , its ip is natted through firewall,then session putted inside a state table.
On some firewall like OpenBSD with PF (http://openbsd.org/faq/pf/filter.html) ICMP-REDIRECT paquet pass through state table nat session.(this is a feature on openbsd, i've not tested for moment with linux). No way to block icmp paquet on the firewall because the state table is before PF...In this case no other choice to use sysctl on all internal host because host insert bad gateway from "public network" provided by icmp-redirect.
"
Another advantage of keeping state is that corresponding ICMP traffic will be passed through the firewall. For example, if a TCP connection passing through the firewall is being tracked statefully and an ICMP source-quench message referring to this TCP connection arrives, it will be matched to the appropriate state entry and passed through the firewall.
"
I know it's a bad idea to use a backbone ip for nat and allow icmp-redirect on a simple host (man in middle inside own network from others host like you say) but this can happend and this is an example.
regards,
--
Cédric Lagneau
^ permalink raw reply
* Re: [patch] sock_diag: off by one checks
From: Pavel Emelyanov @ 2011-12-08 9:07 UTC (permalink / raw)
To: Dan Carpenter
Cc: David S. Miller, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
In-Reply-To: <20111208064938.GB16735@elgon.mountain>
On 12/08/2011 10:49 AM, Dan Carpenter wrote:
> These tests are off by one because sock_diag_handlers[] only has AF_MAX
> elements.
Oops :(
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
> diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
> index fbaf01c..9c27bcd 100644
> --- a/net/core/sock_diag.c
> +++ b/net/core/sock_diag.c
> @@ -32,7 +32,7 @@ int sock_diag_register(struct sock_diag_handler *hndl)
> {
> int err = 0;
>
> - if (hndl->family > AF_MAX)
> + if (hndl->family >= AF_MAX)
> return -EINVAL;
>
> mutex_lock(&sock_diag_table_mutex);
> @@ -50,7 +50,7 @@ void sock_diag_unregister(struct sock_diag_handler *hnld)
> {
> int family = hnld->family;
>
> - if (family > AF_MAX)
> + if (family >= AF_MAX)
> return;
>
> mutex_lock(&sock_diag_table_mutex);
>
^ permalink raw reply
* IPv6 defrag question ?
From: Hans Schillstrom @ 2011-12-08 9:12 UTC (permalink / raw)
To: Patrick McHardy
Cc: Hans Schillstrom, pablo@netfilter.org, jengelh@medozas.de,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <4ED763EA.50307@trash.net>
Hi
While testing HMARK and IPv6 with nf_defrag_ipv6 (and nf_conntrack_ipv6 loaded) I can't see the defrag ?
>From what I can see nf_conntrack_reasm goes into PREROUTING with prio -400
and HMARK in PREROUTING with prio -150
I was expecting that the reasaembled packet whould reach HMARK not the fragments.
(Debug print from hmark)
HMARK() mark:489, hash:4d04eaa1, frag:1, nhoffs:30 plen:1408 (2008::10 - 1000::1)
HMARK() mark:489, hash:4d04eaa1, frag:1, nhoffs:0 plen:86 (2008::10 - 1000::1)
IPv4 do reassm. the packets not IPv6...
--
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>
^ permalink raw reply
* Re: [PATCH] add netpoll support for 802.1q vlans
From: WANG Cong @ 2011-12-08 9:14 UTC (permalink / raw)
To: netdev
In-Reply-To: <20111207010424.GA16496@kvack.org>
On Tue, 06 Dec 2011 20:04:24 -0500, Benjamin LaHaise wrote:
> Add netpoll support to 802.1q vlan devices. Based on the netpoll
> support in the bridging code. Tested on a forced_eth device with
> netconsole.
>
> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
You also need to handle DEL_VLAN_CMD case.
^ permalink raw reply
* Re: [RFC] iproute2: split up ip man page?
From: Petr Šabata @ 2011-12-08 9:15 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20111207131514.6815f813@nehalam.linuxnetplumber.net>
[-- Attachment #1: Type: text/plain, Size: 562 bytes --]
On Wed, Dec 07, 2011 at 01:15:14PM -0800, Stephen Hemminger wrote:
> The current ip man page is both incomplete and so big that
> the actual functions get lost easily.
I totally agree.
> I propose splitting the the pages for the subfunction
> into sub pages. The man command appears
> to be smart enough to handle:
> man tc htb
>
> and pickup the manpage for /usr/share/man/man1/tc-htb.8.gz
> Why not do the same thing for ip command?
>
> The base ip page would just be a place holder that covered the
> generic arguments.
+1
-- Petr
[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply
* Re: [PATCH] macvtap: Fix macvtap_get_queue to use rxhash first
From: Jason Wang @ 2011-12-08 9:46 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: krkumar2, arnd, netdev, virtualization, levinsasha928,
David Miller
In-Reply-To: <20111207161001.GD23845@redhat.com>
On 12/08/2011 12:10 AM, Michael S. Tsirkin wrote:
> On Fri, Nov 25, 2011 at 01:35:52AM -0500, David Miller wrote:
>> From: Krishna Kumar2<krkumar2@in.ibm.com>
>> Date: Fri, 25 Nov 2011 09:39:11 +0530
>>
>>> Jason Wang<jasowang@redhat.com> wrote on 11/25/2011 08:51:57 AM:
>>>> My description is not clear again :(
>>>> I mean the same vhost thead:
>>>>
>>>> vhost thread #0 transmits packets of flow A on processor M
>>>> ...
>>>> vhost thread #0 move to another process N and start to transmit packets
>>>> of flow A
>>> Thanks for clarifying. Yes, binding vhosts to CPU's
>>> makes the incoming packet go to the same vhost each
>>> time. BTW, are you doing any binding and/or irqbalance
>>> when you run your tests? I am not running either at
>>> this time, but thought both might be useful.
>> So are we going with this patch or are we saying that vhost binding
>> is a requirement?
> OK we didn't come to a conclusion so I would be inclined
> to merge this patch as is for 3.2, and revisit later.
> One question though: do these changes affect userspace
> in any way? For example, will this commit us to
> ensure that a single flow gets a unique hash even
> for strange configurations that transmit the same flow
> from multiple cpus?
>
The hash were generated by either host kernel or host nic, so I think
it's unique except for the nic that would provide different hashes for a
flow. I wonder whether there's a such nic.
^ permalink raw reply
* Re: [net-next RFC PATCH 0/5] Series short description
From: Jason Wang @ 2011-12-08 10:06 UTC (permalink / raw)
To: Ben Hutchings; +Cc: krkumar2, kvm, mst, netdev, virtualization, levinsasha928
In-Reply-To: <1323277324.2728.34.camel@bwh-desktop>
On 12/08/2011 01:02 AM, Ben Hutchings wrote:
> On Wed, 2011-12-07 at 19:31 +0800, Jason Wang wrote:
>> On 12/07/2011 03:30 PM, Rusty Russell wrote:
>>> On Mon, 05 Dec 2011 16:58:37 +0800, Jason Wang<jasowang@redhat.com> wrote:
>>>> multiple queue virtio-net: flow steering through host/guest cooperation
>>>>
>>>> Hello all:
>>>>
>>>> This is a rough series adds the guest/host cooperation of flow
>>>> steering support based on Krish Kumar's multiple queue virtio-net
>>>> driver patch 3/3 (http://lwn.net/Articles/467283/).
>>> Is there a real (physical) device which does this kind of thing? How do
>>> they do it? Can we copy them?
>>>
>>> Cheers,
>>> Rusty.
>> As far as I see, ixgbe and sfc have similar but much more sophisticated
>> mechanism.
>>
>> The idea was originally suggested by Ben and it was just borrowed form
>> those real physical nic cards who can dispatch packets based on their
>> hash. All of theses cards can filter the flow based on the hash of
>> L2/L3/L4 header and the stack would tell the card which queue should
>> this flow goes.
> Solarflare controllers (sfc driver) have 8192 perfect filters for
> TCP/IPv4 and UDP/IPv4 which can be used for flow steering. (The filters
> are organised as a hash table, but matched based on 5-tuples.) I
> implemented the 'accelerated RFS' interface in this driver.
>
> I believe the Intel 82599 controllers (ixgbe driver) have both
> hash-based and perfect filter modes and the driver can be configured to
> use one or the other. The driver has its own independent mechanism for
> steering RX and TX flows which predates RFS; I don't know whether it
> uses hash-based or perfect filters.
As far as I see, their driver predates RFS by binding the TX queue and
RX queue to the same CPU and adding hash based filter during packet
transmission.
> Most multi-queue controllers could support a kind of hash-based
> filtering for TCP/IP by adjusting the RSS indirection table. However,
> this table is usually quite small (64-256 entries). This means that
> hash collisions will be quite common and this can result in reordering.
> The same applies to the small table Jason has proposed for virtio-net.
>
Thanks for the clarification. Consider the hash were provided by host
nic or host kernel, the collision rate is not fixed. Perfect filter is
more suitable then.
>> So in host, a simple hash to queue table were introduced in tap/macvtap
>> and in guest, the guest driver would tell the desired queue of a flow
>> through changing this table.
> I don't think accelerated RFS can work well without the use of perfect
> filtering or hash-based filtering with a very low rate of collisions.
>
> Ben.
>
^ permalink raw reply
* Re: [PATCH] ipip, sit: copy parms.name after register_netdevice
From: Ted Feng @ 2011-12-08 10:46 UTC (permalink / raw)
To: David Miller; +Cc: jpirko, jwboyer, netdev, linux-kernel
In-Reply-To: <20111207.235602.1465915988125994516.davem@davemloft.net>
From: Ted Feng <artisdom@gmail.com>
Same fix as 731abb9cb2 for ipip and sit tunnel.
Commit 1c5cae815d removed an explicit call to dev_alloc_name in
ipip_tunnel_locate and ipip6_tunnel_locate, because register_netdevice
will now create a valid name, however the tunnel keeps a copy of the
name in the private parms structure. Fix this by copying the name back
after register_netdevice has successfully returned.
This shows up if you do a simple tunnel add, followed by a tunnel show:
$ sudo ip tunnel add mode ipip remote 10.2.20.211
$ ip tunnel
tunl0: ip/ip remote any local any ttl inherit nopmtudisc
tunl%d: ip/ip remote 10.2.20.211 local any ttl inherit
$ sudo ip tunnel add mode sit remote 10.2.20.212
$ ip tunnel
sit0: ipv6/ip remote any local any ttl 64 nopmtudisc 6rd-prefix 2002::/16
sit%d: ioctl 89f8 failed: No such device
sit%d: ipv6/ip remote 10.2.20.212 local any ttl inherit
Cc: stable@vger.kernel.org
Signed-off-by: Ted Feng <artisdom@gmail.com>
---
net/ipv4/ipip.c | 7 ++++++-
net/ipv6/sit.c | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 065effd..0b2e732 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -285,6 +285,8 @@ static struct ip_tunnel * ipip_tunnel_locate(struct net *net,
if (register_netdevice(dev) < 0)
goto failed_free;
+ strcpy(nt->parms.name, dev->name);
+
dev_hold(dev);
ipip_tunnel_link(ipn, nt);
return nt;
@@ -759,7 +761,6 @@ static int ipip_tunnel_init(struct net_device *dev)
struct ip_tunnel *tunnel = netdev_priv(dev);
tunnel->dev = dev;
- strcpy(tunnel->parms.name, dev->name);
memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
@@ -825,6 +826,7 @@ static void ipip_destroy_tunnels(struct ipip_net *ipn, struct list_head *head)
static int __net_init ipip_init_net(struct net *net)
{
struct ipip_net *ipn = net_generic(net, ipip_net_id);
+ struct ip_tunnel *t;
int err;
ipn->tunnels[0] = ipn->tunnels_wc;
@@ -848,6 +850,9 @@ static int __net_init ipip_init_net(struct net *net)
if ((err = register_netdev(ipn->fb_tunnel_dev)))
goto err_reg_dev;
+ t = netdev_priv(ipn->fb_tunnel_dev);
+
+ strcpy(t->parms.name, ipn->fb_tunnel_dev->name);
return 0;
err_reg_dev:
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index a7a1860..96f3623 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -263,6 +263,8 @@ static struct ip_tunnel *ipip6_tunnel_locate(struct net *net,
if (register_netdevice(dev) < 0)
goto failed_free;
+ strcpy(nt->parms.name, dev->name);
+
dev_hold(dev);
ipip6_tunnel_link(sitn, nt);
@@ -1144,7 +1146,6 @@ static int ipip6_tunnel_init(struct net_device *dev)
struct ip_tunnel *tunnel = netdev_priv(dev);
tunnel->dev = dev;
- strcpy(tunnel->parms.name, dev->name);
memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
@@ -1207,6 +1208,7 @@ static void __net_exit sit_destroy_tunnels(struct sit_net *sitn, struct list_hea
static int __net_init sit_init_net(struct net *net)
{
struct sit_net *sitn = net_generic(net, sit_net_id);
+ struct ip_tunnel *t;
int err;
sitn->tunnels[0] = sitn->tunnels_wc;
@@ -1231,6 +1233,9 @@ static int __net_init sit_init_net(struct net *net)
if ((err = register_netdev(sitn->fb_tunnel_dev)))
goto err_reg_dev;
+ t = netdev_priv(sitn->fb_tunnel_dev);
+
+ strcpy(t->parms.name, sitn->fb_tunnel_dev->name);
return 0;
err_reg_dev:
^ permalink raw reply related
* Re: IPv6 defrag question ?
From: Patrick McHardy @ 2011-12-08 11:10 UTC (permalink / raw)
To: Hans Schillstrom
Cc: Hans Schillstrom, pablo@netfilter.org, jengelh@medozas.de,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <201112081012.13065.hans.schillstrom@ericsson.com>
On 12/08/2011 10:12 AM, Hans Schillstrom wrote:
> Hi
> While testing HMARK and IPv6 with nf_defrag_ipv6 (and nf_conntrack_ipv6 loaded) I can't see the defrag ?
>
> From what I can see nf_conntrack_reasm goes into PREROUTING with prio -400
> and HMARK in PREROUTING with prio -150
>
> I was expecting that the reasaembled packet whould reach HMARK not the fragments.
>
> (Debug print from hmark)
> HMARK() mark:489, hash:4d04eaa1, frag:1, nhoffs:30 plen:1408 (2008::10 - 1000::1)
> HMARK() mark:489, hash:4d04eaa1, frag:1, nhoffs:0 plen:86 (2008::10 - 1000::1)
>
> IPv4 do reassm. the packets not IPv6...
Yeah, IPv6 currently only passes the defragmented packet through conntrack,
then associates the conntrack information with the individual fragments and
passes those on. I'll post patches for IPv6 NAT which will change this
to behave similar to IPv4 soon.
^ permalink raw reply
* [PATCH] be2net: netpoll support
From: Ivan Vecera @ 2011-12-08 11:31 UTC (permalink / raw)
To: netdev; +Cc: sathya.perla, subbu.seetharaman, ajit.khaparde
Add missing netpoll support.
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 7236280..3854fb0 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2666,6 +2666,19 @@ err:
return status;
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void be_netpoll(struct net_device *netdev)
+{
+ struct be_adapter *adapter = netdev_priv(netdev);
+ struct be_rx_obj *rxo;
+ int i;
+
+ event_handle(adapter, &adapter->tx_eq, false);
+ for_all_rx_queues(adapter, rxo, i)
+ event_handle(adapter, &rxo->rx_eq, true);
+}
+#endif
+
#define FW_FILE_HDR_SIGN "ServerEngines Corp. "
static bool be_flash_redboot(struct be_adapter *adapter,
const u8 *p, u32 img_start, int image_size,
@@ -3014,7 +3027,10 @@ static struct net_device_ops be_netdev_ops = {
.ndo_set_vf_mac = be_set_vf_mac,
.ndo_set_vf_vlan = be_set_vf_vlan,
.ndo_set_vf_tx_rate = be_set_vf_tx_rate,
- .ndo_get_vf_config = be_get_vf_config
+ .ndo_get_vf_config = be_get_vf_config,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = be_netpoll,
+#endif
};
static void be_netdev_init(struct net_device *netdev)
--
1.7.3.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox