* Re: [PATCH] net: add Faraday FTMAC100 10/100 Ethernet driver
From: Po-Yu Chuang @ 2011-01-14 6:56 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, linux-kernel, Po-Yu Chuang
In-Reply-To: <1294928559.3570.130.camel@edumazet-laptop>
Dear Eric,
On Thu, Jan 13, 2011 at 10:22 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le jeudi 13 janvier 2011 à 19:49 +0800, Po-Yu Chuang a écrit :
>> From: Po-Yu Chuang <ratbert@faraday-tech.com>
>>
>> FTMAC100 Ethernet Media Access Controller supports 10/100 Mbps and
>> MII. This driver has been working on some ARM/NDS32 SoC including
>> Faraday A320 and Andes AG101.
>>
>> Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>
> Hi
>
> 1) please use netdev_alloc_skb_ip_align() instead of dev_alloc_skb() +
> skb_reserve(skb, NET_IP_ALIGN);
OK, fixed.
> 2) Dont include a "struct net_device_stats stats" in struct ftmac100,
> you can use the one included in struct net_device
> (You can then remove ftmac100_get_stats())
OK, fixed.
> 3) Dont "netdev->last_rx = jiffies;" : This is not driver job.
> Ditto for trans_start
OK, fixed.
> 4) You must comment why wmb() is needed in ftmac100_xmit()
OK, comment added.
> 5) Why isnt NAPI used too for TX completions ?
> BTW, I am not sure we want a define. All new drivers must use NAPI.
I'll study how to do that
> 6) Use is_valid_ether_addr() instead of is_zero_ether_addr() in
> ftmac100_probe()
OK, fixed.
> 7) "static struct ethtool_ops ftmac100_ethtool_ops" should be const :
> "static const struct ethtool_ops ftmac100_ethtool_ops"
> Ditto for :
> "static struct net_device_ops ftmac100_netdev_ops"
OK, both fixed.
> 8) Why an interrupt handler (ftmac100_interrupt()) needs to block
> interrupts with spin_lock_irqsave(&priv->hw_lock, flags); ?
Fixed. Not a problem anymore since hw_lock is removed now.
> 9) Instead of dev_info(&netdev->dev ...) , please consider netdev_info()
OK, fixed.
Thanks a lot for your detailed review. I'll submit a new version ASAP.
Thanks,
Po-Yu Chuang
^ permalink raw reply
* Re: [PATCH v5] ARM: mx28: add the second fec device registration
From: Shawn Guo @ 2011-01-14 7:04 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: s.hauer, davem, gerg, baruch, eric, bryan.wu, r64343, B32542, lw,
w.sang, jamie, jamie, netdev, linux-arm-kernel
In-Reply-To: <20110113144900.GT24920@pengutronix.de>
Hi Uwe,
On Thu, Jan 13, 2011 at 03:49:00PM +0100, Uwe Kleine-König wrote:
> On Tue, Jan 11, 2011 at 08:09:24PM +0800, Shawn Guo wrote:
> > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > ---
> > Changes for v5:
> > - Do not use CONFIG_FEC2 which is a fec driver configration
> >
> > arch/arm/mach-mxs/mach-mx28evk.c | 26 +++++++++++++++++++++++---
> > 1 files changed, 23 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
> > index d162e95..8e2c597 100644
> > --- a/arch/arm/mach-mxs/mach-mx28evk.c
> > +++ b/arch/arm/mach-mxs/mach-mx28evk.c
> > @@ -57,6 +57,19 @@ static const iomux_cfg_t mx28evk_pads[] __initconst = {
> > (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > MX28_PAD_ENET_CLK__CLKCTRL_ENET |
> > (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + /* fec1 */
> > + MX28_PAD_ENET0_CRS__ENET1_RX_EN |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_RXD2__ENET1_RXD0 |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_RXD3__ENET1_RXD1 |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_COL__ENET1_TX_EN |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_TXD2__ENET1_TXD0 |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_TXD3__ENET1_TXD1 |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > /* phy power line */
> > MX28_PAD_SSP1_DATA3__GPIO_2_15 |
> > (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
> > @@ -106,8 +119,14 @@ static void __init mx28evk_fec_reset(void)
> > gpio_set_value(MX28EVK_FEC_PHY_RESET, 1);
> > }
> >
> > -static const struct fec_platform_data mx28_fec_pdata __initconst = {
> > - .phy = PHY_INTERFACE_MODE_RMII,
> > +static struct fec_platform_data mx28_fec_pdata[] = {
> this can still be initdata, doesn't it?
>
Sascha has merged the patch. This one line change may not deserve
a separate patch, so I will take care of it when updating the file
with new version of ocotp patch.
--
Regards,
Shawn
^ permalink raw reply
* [PATCH v5 08/10] ARM: mxs: add ocotp read function
From: Shawn Guo @ 2011-01-14 7:24 UTC (permalink / raw)
To: davem, gerg, baruch, eric, bryan.wu, r64343, B32542, lw; +Cc: Shawn Guo
In-Reply-To: <1294297998-26930-1-git-send-email-shawn.guo@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/Kconfig | 4 ++
arch/arm/mach-mxs/Makefile | 3 +
arch/arm/mach-mxs/include/mach/common.h | 1 +
arch/arm/mach-mxs/ocotp.c | 90 +++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-mxs/ocotp.c
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 8bfc8df..cd2fbdf 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -2,6 +2,9 @@ if ARCH_MXS
source "arch/arm/mach-mxs/devices/Kconfig"
+config MXS_OCOTP
+ bool
+
config SOC_IMX23
bool
select CPU_ARM926T
@@ -26,6 +29,7 @@ config MACH_MX28EVK
select SOC_IMX28
select MXS_HAVE_AMBA_DUART
select MXS_HAVE_PLATFORM_FEC
+ select MXS_OCOTP
default y
help
Include support for MX28EVK platform. This includes specific
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
index 39d3f9c..623899b 100644
--- a/arch/arm/mach-mxs/Makefile
+++ b/arch/arm/mach-mxs/Makefile
@@ -1,6 +1,9 @@
# Common support
obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
+obj-$(CONFIG_PM) += pm.o
+obj-$(CONFIG_MXS_OCOTP) += ocotp.o
+
obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o
obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index 59133eb..635bb5d 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -13,6 +13,7 @@
struct clk;
+extern const u32 *mxs_get_ocotp(void);
extern int mxs_reset_block(void __iomem *);
extern void mxs_timer_init(struct clk *, int);
diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
new file mode 100644
index 0000000..eb2eab7
--- /dev/null
+++ b/arch/arm/mach-mxs/ocotp.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/mutex.h>
+
+#include <mach/mxs.h>
+
+#define OCOTP_WORD_OFFSET 0x20
+#define OCOTP_WORD_COUNT 0x20
+
+#define BM_OCOTP_CTRL_BUSY (1 << 8)
+#define BM_OCOTP_CTRL_ERROR (1 << 9)
+#define BM_OCOTP_CTRL_RD_BANK_OPEN (1 << 12)
+
+static DEFINE_MUTEX(ocotp_mutex);
+static u32 ocotp_words[OCOTP_WORD_COUNT];
+
+const u32 *mxs_get_ocotp(void)
+{
+ void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
+ int timeout = 0x400;
+ size_t i;
+ static int once = 0;
+
+ if (once)
+ return ocotp_words;
+
+ mutex_lock(&ocotp_mutex);
+
+ /*
+ * clk_enable(hbus_clk) for ocotp can be skipped
+ * as it must be on when system is running.
+ */
+
+ /* try to clear ERROR bit */
+ __mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
+
+ /* check both BUSY and ERROR cleared */
+ while ((__raw_readl(ocotp_base) &
+ (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
+ cpu_relax();
+
+ if (unlikely(!timeout))
+ goto error_unlock;
+
+ /* open OCOTP banks for read */
+ __mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
+
+ /* approximately wait 32 hclk cycles */
+ udelay(1);
+
+ /* poll BUSY bit becoming cleared */
+ timeout = 0x400;
+ while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
+ cpu_relax();
+
+ if (unlikely(!timeout))
+ goto error_unlock;
+
+ for (i = 0; i < OCOTP_WORD_COUNT; i++)
+ ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
+ i * 0x10);
+
+ /* close banks for power saving */
+ __mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
+
+ mutex_unlock(&ocotp_mutex);
+
+ once = 1;
+
+ return ocotp_words;
+
+error_unlock:
+ mutex_unlock(&ocotp_mutex);
+ pr_err("%s: timeout in reading OCOTP\n", __func__);
+ return NULL;
+}
--
1.7.1
^ permalink raw reply related
* [PATCH v5 09/10] ARM: mxs/mx28evk: read fec mac address from ocotp
From: Shawn Guo @ 2011-01-14 7:25 UTC (permalink / raw)
To: davem, gerg, baruch, eric, bryan.wu, r64343, B32542, lw; +Cc: Shawn Guo
In-Reply-To: <1294297998-26930-1-git-send-email-shawn.guo@freescale.com>
Read fec mac address from ocotp and save it into fec_platform_data
mac field for fec driver to use.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/mach-mx28evk.c | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index 8e2c597..e8db99f 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -119,7 +119,7 @@ static void __init mx28evk_fec_reset(void)
gpio_set_value(MX28EVK_FEC_PHY_RESET, 1);
}
-static struct fec_platform_data mx28_fec_pdata[] = {
+static struct fec_platform_data mx28_fec_pdata[] __initdata = {
{
/* fec0 */
.phy = PHY_INTERFACE_MODE_RMII,
@@ -129,12 +129,45 @@ static struct fec_platform_data mx28_fec_pdata[] = {
},
};
+static int __init mx28evk_fec_get_mac(void)
+{
+ int i;
+ u32 val;
+ const u32 *ocotp = mxs_get_ocotp();
+
+ if (!ocotp)
+ goto error;
+
+ /*
+ * OCOTP only stores the last 4 octets for each mac address,
+ * so hard-code Freescale OUI (00:04:9f) here.
+ */
+ for (i = 0; i < 2; i++) {
+ val = ocotp[i * 4];
+ mx28_fec_pdata[i].mac[0] = 0x00;
+ mx28_fec_pdata[i].mac[1] = 0x04;
+ mx28_fec_pdata[i].mac[2] = 0x9f;
+ mx28_fec_pdata[i].mac[3] = (val >> 16) & 0xff;
+ mx28_fec_pdata[i].mac[4] = (val >> 8) & 0xff;
+ mx28_fec_pdata[i].mac[5] = (val >> 0) & 0xff;
+ }
+
+ return 0;
+
+error:
+ pr_err("%s: timeout when reading fec mac from OCOTP\n", __func__);
+ return -ETIMEDOUT;
+}
+
static void __init mx28evk_init(void)
{
mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads));
mx28_add_duart();
+ if (mx28evk_fec_get_mac())
+ pr_warn("%s: failed on fec mac setup\n", __func__);
+
mx28evk_fec_reset();
mx28_add_fec(0, &mx28_fec_pdata[0]);
mx28_add_fec(1, &mx28_fec_pdata[1]);
--
1.7.1
^ permalink raw reply related
* Re: [PATCH 02/10] GRETH: added option to disable a device node from bootloader.
From: Daniel Hellstrom @ 2011-01-14 7:45 UTC (permalink / raw)
To: David Miller; +Cc: netdev, kristoffer
In-Reply-To: <20110113.221238.97339127.davem@davemloft.net>
David Miller wrote:
>From: Daniel Hellstrom <daniel@gaisler.com>
>Date: Thu, 13 Jan 2011 09:25:27 +0100
>
>
>
>>Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
>>
>>
>
>This is not how you do this.
>
>Simply not present the device in the OpenFirmware tree at all. If you
>can make this special properly appear, you can also toss the device
>node away completely.
>
>There is zero reason whatsoever to create a special hack-job
>non-standardized device node properly to do this.
>
>
I agree, I will remove it. The optional parameter should be a setting
for a particular device rather that a "disable device" parameter.
Thanks,
Daniel
^ permalink raw reply
* [PATCH] net/irda/sh_irda: return to RX mode when TX error
From: Kuninori Morimoto @ 2011-01-14 7:47 UTC (permalink / raw)
To: netdev; +Cc: Samuel Ortiz, David S. Miller
sh_irda can not use RX/TX in same time,
but this driver didn't return to RX mode when TX error occurred.
This patch care xmit error case to solve this issue.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
drivers/net/irda/sh_irda.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/irda/sh_irda.c b/drivers/net/irda/sh_irda.c
index 9e3f4f5..4488bd5 100644
--- a/drivers/net/irda/sh_irda.c
+++ b/drivers/net/irda/sh_irda.c
@@ -635,7 +635,7 @@ static int sh_irda_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
ret = sh_irda_set_baudrate(self, speed);
if (ret < 0)
- return ret;
+ goto sh_irda_hard_xmit_end;
self->tx_buff.len = 0;
if (skb->len) {
@@ -652,11 +652,21 @@ static int sh_irda_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
sh_irda_write(self, IRTFLR, self->tx_buff.len);
sh_irda_write(self, IRTCTR, ARMOD | TE);
- }
+ } else
+ goto sh_irda_hard_xmit_end;
dev_kfree_skb(skb);
return 0;
+
+sh_irda_hard_xmit_end:
+ sh_irda_set_baudrate(self, 9600);
+ netif_wake_queue(self->ndev);
+ sh_irda_rcv_ctrl(self, 1);
+ dev_kfree_skb(skb);
+
+ return ret;
+
}
static int sh_irda_ioctl(struct net_device *ndev, struct ifreq *ifreq, int cmd)
--
1.7.1
^ permalink raw reply related
* Re: [PATCH V9 08/13] posix clocks: cleanup the CLOCK_DISPTACH macro
From: Richard Cochran @ 2011-01-14 7:48 UTC (permalink / raw)
To: Thomas Gleixner
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
Alan Cox, Arnd Bergmann, Christoph Lameter, David Miller,
John Stultz, Krzysztof Halasa, Peter Zijlstra, Rodolfo Giometti
In-Reply-To: <alpine.LFD.2.00.1101131745400.2678-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
On Thu, Jan 13, 2011 at 06:03:24PM +0100, Thomas Gleixner wrote:
> On Thu, 13 Jan 2011, Richard Cochran wrote:
> > int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts);
> > int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts);
> > -int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts);
> > +int posix_cpu_clock_set(const clockid_t which_clock, struct timespec *ts);
>
> Shouldn't we change the clock_set function to have *ts const in all places ?
Yes, your are right.
> > @@ -293,6 +261,11 @@ static __init int init_posix_timers(void)
> > .clock_adj = do_posix_clock_noadjtime,
> > .timer_create = no_timer_create,
> > .nsleep = no_nsleep,
> > + /* defaults: */
> > + .nsleep_restart = common_nsleep_restart,
> > + .timer_del = common_timer_del,
> > + .timer_get = common_timer_get,
> > + .timer_set = common_timer_set,
>
> Hmm, we do not need to set functional entries for clocks which neither
> implement timer_create nor nsleep.
I know, but I wanted to be really pendantic about what the previous
code was, and what the new code does.
Before: By leaving the k_clock function pointer NULL, the clock
selects common_xyz. This common function may or may make
sense for that clock.
After: By leaving the k_clock function pointer NULL, the clock will
return EINVAL for that syscall.
Maybe it would be better to leave the cleaning up of the common crud
as a follow up patch. What do you think?
Richard
^ permalink raw reply
* Re: [PATCH 03/10] GRETH: added no_gbit option
From: Daniel Hellstrom @ 2011-01-14 7:51 UTC (permalink / raw)
To: David Miller; +Cc: netdev, kristoffer
In-Reply-To: <20110113.221324.82807816.davem@davemloft.net>
David Miller wrote:
>From: Daniel Hellstrom <daniel@gaisler.com>
>Date: Thu, 13 Jan 2011 09:25:28 +0100
>
>
>
>>For debug only. The driver does not report that it is GBit capable, instead
>>it will report 10/100 mode to the generic PHY layer.
>>
>>Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
>>
>>
>
>You may not add special purpose module parameters to your ethernet driver.
>
>Instead, users can use ethtool to control what speeds the device will
>try to advertise for during auto-negotiation, or use with a fixed
>link configuration.
>
>
Ok, I will remove this patch.
Daniel
^ permalink raw reply
* Re: [PATCH v4 05/10] net/fec: add dual fec support for mx28
From: Uwe Kleine-König @ 2011-01-14 7:52 UTC (permalink / raw)
To: Shawn Guo
Cc: davem, gerg, baruch, eric, bryan.wu, r64343, B32542, lw, w.sang,
s.hauer, jamie, jamie, netdev, linux-arm-kernel
In-Reply-To: <20110114054838.GA14491@freescale.com>
On Fri, Jan 14, 2011 at 01:48:40PM +0800, Shawn Guo wrote:
> Hi Uwe,
>
> On Thu, Jan 13, 2011 at 03:48:05PM +0100, Uwe Kleine-König wrote:
>
> [...]
>
> > > +/* Controller is ENET-MAC */
> > > +#define FEC_QUIRK_ENET_MAC (1 << 0)
> > does this really qualify to be a quirk?
> >
> My understanding is that ENET-MAC is a type of "quirky" FEC
> controller.
>
> > > +/* Controller needs driver to swap frame */
> > > +#define FEC_QUIRK_SWAP_FRAME (1 << 1)
> > IMHO this is a bit misnamed. FEC_QUIRK_NEEDS_BE_DATA or similar would
> > be more accurate.
> >
> When your make this change, you may want to pick a better name for
> function swap_buffer too.
>
> [...]
>
> > > +static void *swap_buffer(void *bufaddr, int len)
> > > +{
> > > + int i;
> > > + unsigned int *buf = bufaddr;
> > > +
> > > + for (i = 0; i < (len + 3) / 4; i++, buf++)
> > > + *buf = cpu_to_be32(*buf);
> > if len isn't a multiple of 4 this accesses bytes behind len. Is this
> > generally OK here? (E.g. because skbs always have a length that is a
> > multiple of 4?)
> The len may not be a multiple of 4. But I believe bufaddr is always
> a buffer allocated in a length that is a multiple of 4, and the 1~3
> bytes exceeding the len very likely has no data that matters. But
> yes, it deserves a safer implementation.
Did you test what happens if bufaddr isn't aligned? Does it work at all
then?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Kernel 2.6.37-git10 build failure: cassini.c
From: Anca Emanuel @ 2011-01-14 8:09 UTC (permalink / raw)
To: LKML
Cc: netdev, Grant Likely, David S. Miller, Eric Dumazet, Joe Perches,
Christoph Egger, Jiri Pirko
drivers/net/cassini.c: In function ‘cas_get_vpd_info’:
drivers/net/cassini.c:3358: error: implicit declaration of function
‘of_get_property’
drivers/net/cassini.c:3358: warning: assignment makes pointer from
integer without a cast
drivers/net/cassini.c: In function ‘cas_init_one’:
drivers/net/cassini.c:5035: error: implicit declaration of function
‘pci_device_to_OF_node’
drivers/net/cassini.c:5035: warning: assignment makes pointer from
integer without a cast
make[3]: *** [drivers/net/cassini.o] Error 1
make[2]: *** [drivers/net] Error 2
The first part can be solved with:
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 7206ab2..fe3795e 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -94,6 +94,7 @@
#include <linux/tcp.h>
#include <linux/mutex.h>
#include <linux/firmware.h>
+#include <linux/of.h>
#include <net/checksum.h>
^ permalink raw reply related
* Re: [PATCH 04/10] GRETH: added greth_compat_mode module parameter
From: Daniel Hellstrom @ 2011-01-14 8:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev, kristoffer
In-Reply-To: <20110113.221454.149673942.davem@davemloft.net>
David Miller wrote:
>From: Daniel Hellstrom <daniel@gaisler.com>
>Date: Thu, 13 Jan 2011 09:25:29 +0100
>
>
>
>>The greth_compat_mode option can be used to set a GRETH GBit capable MAC
>>in operate as if the GRETH 10/100 device was found. The GRETH GBit supports
>>TCP/UDP checksum offloading, unaligned frame buffers, scatter gather etc.
>>Enabling this mode allows the developer to test the GRETH 10/100 device
>>without all features mentioned above on a GBit MAC capable of the above.
>>
>>Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
>>
>>
>
>No special device specific module parameters please.
>
>What if every single driver author added something like this and they
>all named it something different or made it behave in slightly differing
>ways?
>
>What kind of user experience would that result in?
>
>It would result in a sucky one, which is why we avoid adding all kinds
>of hacky driver specific module options.
>
>Find a generic way to provide this functionality.
>
>
I understand, it was not ment to be a user-experience, rather a
developer debugging option. I will probably need an option like this in
the future to avoid searching a very long time for very old hardware, I
will try to find an other solution for it in the future.
I will remove the 3 GRETH patches and resubmit the others.
Thanks,
Daniel
^ permalink raw reply
* [PATCH net-next] net: cleanup unused macros in net directory
From: Shan Wei @ 2011-01-14 8:19 UTC (permalink / raw)
To: David Miller, sjur.brandeland, andy.grover, ericvh, jvrao,
aneesh.kumar, joe, Chang
Clean up some unused macros in net/*.
1. be left for code change. e.g. PGV_FROM_VMALLOC, PGV_FROM_VMALLOC, KMEM_SAFETYZONE.
2. never be used since introduced to kernel.
e.g. P9_RDMA_MAX_SGE, UTIL_CTRL_PKT_SIZE.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/9p/trans_rdma.c | 1 -
net/caif/cfcnfg.c | 2 --
net/caif/cfdgml.c | 1 -
net/caif/cfserl.c | 1 -
net/caif/cfutill.c | 2 +-
net/caif/cfveil.c | 2 +-
net/decnet/dn_table.c | 1 -
net/packet/af_packet.c | 1 -
net/rds/rds.h | 1 -
net/wanrouter/wanmain.c | 2 --
10 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 17c5ba7..29a54cc 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -59,7 +59,6 @@
* safely advertise a maxsize
* of 64k */
-#define P9_RDMA_MAX_SGE (P9_RDMA_MAXSIZE >> PAGE_SHIFT)
/**
* struct p9_trans_rdma - RDMA transport instance
*
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
index 21ede14..ed3cfda 100644
--- a/net/caif/cfcnfg.c
+++ b/net/caif/cfcnfg.c
@@ -23,10 +23,8 @@
#include <asm/atomic.h>
#define MAX_PHY_LAYERS 7
-#define PHY_NAME_LEN 20
#define container_obj(layr) container_of(layr, struct cfcnfg, layer)
-#define RFM_FRAGMENT_SIZE 4030
/* Information about CAIF physical interfaces held by Config Module in order
* to manage physical interfaces
diff --git a/net/caif/cfdgml.c b/net/caif/cfdgml.c
index d3ed264..27dab26 100644
--- a/net/caif/cfdgml.c
+++ b/net/caif/cfdgml.c
@@ -18,7 +18,6 @@
#define DGM_CMD_BIT 0x80
#define DGM_FLOW_OFF 0x81
#define DGM_FLOW_ON 0x80
-#define DGM_CTRL_PKT_SIZE 1
#define DGM_MTU 1500
static int cfdgml_receive(struct cflayer *layr, struct cfpkt *pkt);
diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c
index 9297f7d..8303fe3 100644
--- a/net/caif/cfserl.c
+++ b/net/caif/cfserl.c
@@ -25,7 +25,6 @@ struct cfserl {
spinlock_t sync;
bool usestx;
};
-#define STXLEN(layr) (layr->usestx ? 1 : 0)
static int cfserl_receive(struct cflayer *layr, struct cfpkt *pkt);
static int cfserl_transmit(struct cflayer *layr, struct cfpkt *pkt);
diff --git a/net/caif/cfutill.c b/net/caif/cfutill.c
index efad410..315c0d6 100644
--- a/net/caif/cfutill.c
+++ b/net/caif/cfutill.c
@@ -20,7 +20,7 @@
#define UTIL_REMOTE_SHUTDOWN 0x82
#define UTIL_FLOW_OFF 0x81
#define UTIL_FLOW_ON 0x80
-#define UTIL_CTRL_PKT_SIZE 1
+
static int cfutill_receive(struct cflayer *layr, struct cfpkt *pkt);
static int cfutill_transmit(struct cflayer *layr, struct cfpkt *pkt);
diff --git a/net/caif/cfveil.c b/net/caif/cfveil.c
index 3b425b1..c3b1dec 100644
--- a/net/caif/cfveil.c
+++ b/net/caif/cfveil.c
@@ -17,7 +17,7 @@
#define VEI_FLOW_OFF 0x81
#define VEI_FLOW_ON 0x80
#define VEI_SET_PIN 0x82
-#define VEI_CTRL_PKT_SIZE 1
+
#define container_obj(layr) container_of(layr, struct cfsrvl, layer)
static int cfvei_receive(struct cflayer *layr, struct cfpkt *pkt);
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index f2abd37..b66600b 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -59,7 +59,6 @@ struct dn_hash
};
#define dz_key_0(key) ((key).datum = 0)
-#define dz_prefix(key,dz) ((key).datum)
#define for_nexthops(fi) { int nhsel; const struct dn_fib_nh *nh;\
for(nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; nh++, nhsel++)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 91cb1d7..4b87237 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -164,7 +164,6 @@ struct packet_mreq_max {
static int packet_set_ring(struct sock *sk, struct tpacket_req *req,
int closing, int tx_ring);
-#define PGV_FROM_VMALLOC 1
struct pgv {
char *buffer;
};
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 9542449..da8adac 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -50,7 +50,6 @@ rdsdebug(char *fmt, ...)
#define RDS_FRAG_SIZE ((unsigned int)(1 << RDS_FRAG_SHIFT))
#define RDS_CONG_MAP_BYTES (65536 / 8)
-#define RDS_CONG_MAP_LONGS (RDS_CONG_MAP_BYTES / sizeof(unsigned long))
#define RDS_CONG_MAP_PAGES (PAGE_ALIGN(RDS_CONG_MAP_BYTES) / PAGE_SIZE)
#define RDS_CONG_MAP_PAGE_BITS (PAGE_SIZE * 8)
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 74944a2..788a12c 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -59,8 +59,6 @@
#include <asm/uaccess.h> /* copy_to/from_user */
#include <linux/init.h> /* __initfunc et al. */
-#define KMEM_SAFETYZONE 8
-
#define DEV_TO_SLAVE(dev) (*((struct net_device **)netdev_priv(dev)))
/*
--
1.7.0.1
^ permalink raw reply related
* Re: [PATCH v4 08/10] ARM: mxs: add ocotp read function
From: Sascha Hauer @ 2011-01-14 8:33 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Shawn Guo, gerg, B32542, netdev, jamie, baruch, w.sang, r64343,
eric, bryan.wu, jamie, davem, linux-arm-kernel, lw
In-Reply-To: <20110113151939.GX24920@pengutronix.de>
On Thu, Jan 13, 2011 at 04:19:39PM +0100, Uwe Kleine-König wrote:
> On Thu, Jan 06, 2011 at 03:13:16PM +0800, Shawn Guo wrote:
> > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > ---
> > Changes for v4:
> > - Call cpu_relax() during polling
> >
> > Changes for v2:
> > - Add mutex locking for mxs_read_ocotp()
> > - Use type size_t for count and i
> > - Add comment for clk_enable/disable skipping
> > - Add ERROR bit clearing and polling step
> >
> > arch/arm/mach-mxs/Makefile | 2 +-
> > arch/arm/mach-mxs/include/mach/common.h | 1 +
> > arch/arm/mach-mxs/ocotp.c | 79 +++++++++++++++++++++++++++++++
> > 3 files changed, 81 insertions(+), 1 deletions(-)
> > create mode 100644 arch/arm/mach-mxs/ocotp.c
> >
> > diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
> > index 39d3f9c..f23ebbd 100644
> > --- a/arch/arm/mach-mxs/Makefile
> > +++ b/arch/arm/mach-mxs/Makefile
> > @@ -1,5 +1,5 @@
> > # Common support
> > -obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
> > +obj-y := clock.o devices.o gpio.o icoll.o iomux.o ocotp.o system.o timer.o
> is it worth to make ocotp optional? (and let evk select
> CONFIG_MXS_OCOTP)
I think not.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH] ARM: mxs: pass fec device name via platform data
From: Uwe Kleine-König @ 2011-01-14 8:38 UTC (permalink / raw)
To: Shawn Guo
Cc: davem, gerg, baruch, eric, bryan.wu, r64343, B32542, lw, w.sang,
s.hauer, jamie, jamie, netdev, linux-arm-kernel
In-Reply-To: <1294988000-20232-1-git-send-email-shawn.guo@freescale.com>
On Fri, Jan 14, 2011 at 02:53:20PM +0800, Shawn Guo wrote:
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> arch/arm/mach-mxs/devices/platform-fec.c | 11 ++++++-----
> arch/arm/mach-mxs/include/mach/devices-common.h | 1 +
> 2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c
> index c42dff7..75eb26b 100644
> --- a/arch/arm/mach-mxs/devices/platform-fec.c
> +++ b/arch/arm/mach-mxs/devices/platform-fec.c
> @@ -10,20 +10,21 @@
> #include <mach/mx28.h>
> #include <mach/devices-common.h>
>
> -#define mxs_fec_data_entry_single(soc, _id) \
> +#define mxs_fec_data_entry_single(soc, _devid, _id) \
> { \
> + .devid = _devid, \
> .id = _id, \
> .iobase = soc ## _ENET_MAC ## _id ## _BASE_ADDR, \
> .irq = soc ## _INT_ENET_MAC ## _id, \
> }
>
> -#define mxs_fec_data_entry(soc, _id) \
> - [_id] = mxs_fec_data_entry_single(soc, _id)
> +#define mxs_fec_data_entry(soc, _devid, _id) \
> + [_id] = mxs_fec_data_entry_single(soc, _devid, _id)
>
> #ifdef CONFIG_SOC_IMX28
> const struct mxs_fec_data mx28_fec_data[] __initconst = {
> #define mx28_fec_data_entry(_id) \
> - mxs_fec_data_entry(MX28, _id)
> + mxs_fec_data_entry(MX28, "imx28-fec", _id)
> mx28_fec_data_entry(0),
> mx28_fec_data_entry(1),
> };
> @@ -45,6 +46,6 @@ struct platform_device *__init mxs_add_fec(
> },
> };
>
> - return mxs_add_platform_device("imx28-fec", data->id,
> + return mxs_add_platform_device(data->devid, data->id,
> res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
> }
> diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h
> index 6c3d1a1..10fbcfd 100644
> --- a/arch/arm/mach-mxs/include/mach/devices-common.h
> +++ b/arch/arm/mach-mxs/include/mach/devices-common.h
> @@ -33,6 +33,7 @@ int __init mxs_add_duart(const struct amba_device *dev);
> /* fec */
> #include <linux/fec.h>
> struct mxs_fec_data {
> + const char *devid;
> int id;
> resource_size_t iobase;
> resource_size_t iosize;
> --
> 1.7.1
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH v5 08/10] ARM: mxs: add ocotp read function
From: Sascha Hauer @ 2011-01-14 8:40 UTC (permalink / raw)
To: Shawn Guo
Cc: davem, gerg, baruch, eric, bryan.wu, r64343, B32542, lw, w.sang,
jamie, jamie, netdev, linux-arm-kernel
In-Reply-To: <1294989894-20780-1-git-send-email-shawn.guo@freescale.com>
On Fri, Jan 14, 2011 at 03:24:54PM +0800, Shawn Guo wrote:
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
> arch/arm/mach-mxs/Kconfig | 4 ++
> arch/arm/mach-mxs/Makefile | 3 +
> arch/arm/mach-mxs/include/mach/common.h | 1 +
> arch/arm/mach-mxs/ocotp.c | 90 +++++++++++++++++++++++++++++++
> 4 files changed, 98 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-mxs/ocotp.c
>
> diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
> index 8bfc8df..cd2fbdf 100644
> --- a/arch/arm/mach-mxs/Kconfig
> +++ b/arch/arm/mach-mxs/Kconfig
> @@ -2,6 +2,9 @@ if ARCH_MXS
>
> source "arch/arm/mach-mxs/devices/Kconfig"
>
> +config MXS_OCOTP
> + bool
> +
> config SOC_IMX23
> bool
> select CPU_ARM926T
> @@ -26,6 +29,7 @@ config MACH_MX28EVK
> select SOC_IMX28
> select MXS_HAVE_AMBA_DUART
> select MXS_HAVE_PLATFORM_FEC
> + select MXS_OCOTP
> default y
> help
> Include support for MX28EVK platform. This includes specific
> diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
> index 39d3f9c..623899b 100644
> --- a/arch/arm/mach-mxs/Makefile
> +++ b/arch/arm/mach-mxs/Makefile
> @@ -1,6 +1,9 @@
> # Common support
> obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
>
> +obj-$(CONFIG_PM) += pm.o
> +obj-$(CONFIG_MXS_OCOTP) += ocotp.o
> +
> obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o
> obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o
>
> diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
> index 59133eb..635bb5d 100644
> --- a/arch/arm/mach-mxs/include/mach/common.h
> +++ b/arch/arm/mach-mxs/include/mach/common.h
> @@ -13,6 +13,7 @@
>
> struct clk;
>
> +extern const u32 *mxs_get_ocotp(void);
> extern int mxs_reset_block(void __iomem *);
> extern void mxs_timer_init(struct clk *, int);
>
> diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
> new file mode 100644
> index 0000000..eb2eab7
> --- /dev/null
> +++ b/arch/arm/mach-mxs/ocotp.c
> @@ -0,0 +1,90 @@
> +/*
> + * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/err.h>
> +#include <linux/mutex.h>
> +
> +#include <mach/mxs.h>
> +
> +#define OCOTP_WORD_OFFSET 0x20
> +#define OCOTP_WORD_COUNT 0x20
> +
> +#define BM_OCOTP_CTRL_BUSY (1 << 8)
> +#define BM_OCOTP_CTRL_ERROR (1 << 9)
> +#define BM_OCOTP_CTRL_RD_BANK_OPEN (1 << 12)
> +
> +static DEFINE_MUTEX(ocotp_mutex);
> +static u32 ocotp_words[OCOTP_WORD_COUNT];
> +
> +const u32 *mxs_get_ocotp(void)
> +{
> + void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
> + int timeout = 0x400;
> + size_t i;
> + static int once = 0;
> +
> + if (once)
> + return ocotp_words;
> +
> + mutex_lock(&ocotp_mutex);
> +
> + /*
> + * clk_enable(hbus_clk) for ocotp can be skipped
> + * as it must be on when system is running.
> + */
> +
> + /* try to clear ERROR bit */
> + __mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
> +
> + /* check both BUSY and ERROR cleared */
> + while ((__raw_readl(ocotp_base) &
> + (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
> + cpu_relax();
> +
> + if (unlikely(!timeout))
> + goto error_unlock;
> +
> + /* open OCOTP banks for read */
> + __mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
> +
> + /* approximately wait 32 hclk cycles */
> + udelay(1);
> +
> + /* poll BUSY bit becoming cleared */
> + timeout = 0x400;
> + while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
> + cpu_relax();
> +
> + if (unlikely(!timeout))
> + goto error_unlock;
> +
> + for (i = 0; i < OCOTP_WORD_COUNT; i++)
> + ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
> + i * 0x10);
> +
> + /* close banks for power saving */
> + __mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
> +
> + mutex_unlock(&ocotp_mutex);
> +
> + once = 1;
> +
> + return ocotp_words;
> +
> +error_unlock:
> + mutex_unlock(&ocotp_mutex);
> + pr_err("%s: timeout in reading OCOTP\n", __func__);
> + return NULL;
> +}
EXPORT_SYMBOL?
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH v5 08/10] ARM: mxs: add ocotp read function
From: Uwe Kleine-König @ 2011-01-14 8:42 UTC (permalink / raw)
To: Shawn Guo
Cc: davem, gerg, baruch, eric, bryan.wu, r64343, B32542, lw, w.sang,
s.hauer, jamie, jamie, netdev, linux-arm-kernel
In-Reply-To: <1294989894-20780-1-git-send-email-shawn.guo@freescale.com>
On Fri, Jan 14, 2011 at 03:24:54PM +0800, Shawn Guo wrote:
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
> arch/arm/mach-mxs/Kconfig | 4 ++
> arch/arm/mach-mxs/Makefile | 3 +
> arch/arm/mach-mxs/include/mach/common.h | 1 +
> arch/arm/mach-mxs/ocotp.c | 90 +++++++++++++++++++++++++++++++
> 4 files changed, 98 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-mxs/ocotp.c
>
> diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
> index 8bfc8df..cd2fbdf 100644
> --- a/arch/arm/mach-mxs/Kconfig
> +++ b/arch/arm/mach-mxs/Kconfig
> @@ -2,6 +2,9 @@ if ARCH_MXS
>
> source "arch/arm/mach-mxs/devices/Kconfig"
>
> +config MXS_OCOTP
> + bool
> +
> config SOC_IMX23
> bool
> select CPU_ARM926T
> @@ -26,6 +29,7 @@ config MACH_MX28EVK
> select SOC_IMX28
> select MXS_HAVE_AMBA_DUART
> select MXS_HAVE_PLATFORM_FEC
> + select MXS_OCOTP
> default y
> help
> Include support for MX28EVK platform. This includes specific
> diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
> index 39d3f9c..623899b 100644
> --- a/arch/arm/mach-mxs/Makefile
> +++ b/arch/arm/mach-mxs/Makefile
> @@ -1,6 +1,9 @@
> # Common support
> obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
>
> +obj-$(CONFIG_PM) += pm.o
this line doesn't belong here.
> +obj-$(CONFIG_MXS_OCOTP) += ocotp.o
> +
> obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o
> obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o
>
> diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
> index 59133eb..635bb5d 100644
> --- a/arch/arm/mach-mxs/include/mach/common.h
> +++ b/arch/arm/mach-mxs/include/mach/common.h
> @@ -13,6 +13,7 @@
>
> struct clk;
>
> +extern const u32 *mxs_get_ocotp(void);
> extern int mxs_reset_block(void __iomem *);
> extern void mxs_timer_init(struct clk *, int);
>
> diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
> new file mode 100644
> index 0000000..eb2eab7
> --- /dev/null
> +++ b/arch/arm/mach-mxs/ocotp.c
> @@ -0,0 +1,90 @@
> +/*
> + * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/err.h>
> +#include <linux/mutex.h>
> +
> +#include <mach/mxs.h>
> +
> +#define OCOTP_WORD_OFFSET 0x20
> +#define OCOTP_WORD_COUNT 0x20
> +
> +#define BM_OCOTP_CTRL_BUSY (1 << 8)
> +#define BM_OCOTP_CTRL_ERROR (1 << 9)
> +#define BM_OCOTP_CTRL_RD_BANK_OPEN (1 << 12)
> +
> +static DEFINE_MUTEX(ocotp_mutex);
> +static u32 ocotp_words[OCOTP_WORD_COUNT];
> +
> +const u32 *mxs_get_ocotp(void)
> +{
> + void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
> + int timeout = 0x400;
> + size_t i;
> + static int once = 0;
> +
> + if (once)
> + return ocotp_words;
> +
> + mutex_lock(&ocotp_mutex);
> +
> + /*
> + * clk_enable(hbus_clk) for ocotp can be skipped
> + * as it must be on when system is running.
> + */
> +
> + /* try to clear ERROR bit */
> + __mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
> +
> + /* check both BUSY and ERROR cleared */
> + while ((__raw_readl(ocotp_base) &
> + (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
> + cpu_relax();
> +
> + if (unlikely(!timeout))
> + goto error_unlock;
> +
> + /* open OCOTP banks for read */
> + __mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
> +
> + /* approximately wait 32 hclk cycles */
> + udelay(1);
> +
> + /* poll BUSY bit becoming cleared */
> + timeout = 0x400;
> + while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
> + cpu_relax();
> +
> + if (unlikely(!timeout))
> + goto error_unlock;
> +
> + for (i = 0; i < OCOTP_WORD_COUNT; i++)
> + ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
> + i * 0x10);
> +
> + /* close banks for power saving */
> + __mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
> +
> + mutex_unlock(&ocotp_mutex);
> +
> + once = 1;
once needs to be protected by the mutex, too.
Best regards
Uwe
> +
> + return ocotp_words;
> +
> +error_unlock:
> + mutex_unlock(&ocotp_mutex);
> + pr_err("%s: timeout in reading OCOTP\n", __func__);
> + return NULL;
> +}
> --
> 1.7.1
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH V9 08/13] posix clocks: cleanup the CLOCK_DISPTACH macro
From: Thomas Gleixner @ 2011-01-14 9:31 UTC (permalink / raw)
To: Richard Cochran
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
Alan Cox, Arnd Bergmann, Christoph Lameter, David Miller,
John Stultz, Krzysztof Halasa, Peter Zijlstra, Rodolfo Giometti
In-Reply-To: <20110114074837.GA8077-7KxsofuKt4IfAd9E5cN8NEzG7cXyKsk/@public.gmane.org>
On Fri, 14 Jan 2011, Richard Cochran wrote:
> On Thu, Jan 13, 2011 at 06:03:24PM +0100, Thomas Gleixner wrote:
> > On Thu, 13 Jan 2011, Richard Cochran wrote:
> > > int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts);
> > > int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts);
> > > -int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts);
> > > +int posix_cpu_clock_set(const clockid_t which_clock, struct timespec *ts);
> >
> > Shouldn't we change the clock_set function to have *ts const in all places ?
>
> Yes, your are right.
>
> > > @@ -293,6 +261,11 @@ static __init int init_posix_timers(void)
> > > .clock_adj = do_posix_clock_noadjtime,
> > > .timer_create = no_timer_create,
> > > .nsleep = no_nsleep,
> > > + /* defaults: */
> > > + .nsleep_restart = common_nsleep_restart,
> > > + .timer_del = common_timer_del,
> > > + .timer_get = common_timer_get,
> > > + .timer_set = common_timer_set,
> >
> > Hmm, we do not need to set functional entries for clocks which neither
> > implement timer_create nor nsleep.
>
> I know, but I wanted to be really pendantic about what the previous
> code was, and what the new code does.
>
> Before: By leaving the k_clock function pointer NULL, the clock
> selects common_xyz. This common function may or may make
> sense for that clock.
>
> After: By leaving the k_clock function pointer NULL, the clock will
> return EINVAL for that syscall.
>
> Maybe it would be better to leave the cleaning up of the common crud
> as a follow up patch. What do you think?
Fair enough.
^ permalink raw reply
* [PULL] vhost-net: 2.6.38 fix
From: Michael S. Tsirkin @ 2011-01-14 9:33 UTC (permalink / raw)
To: David Miller; +Cc: kvm, virtualization, netdev, linux-kernel
Please pull the following for 2.6.38.
Thanks!
The following changes since commit 0c21e3aaf6ae85bee804a325aa29c325209180fd:
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/hfsplus (2011-01-07 17:16:27 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-net
Michael S. Tsirkin (1):
vhost: fix signed/unsigned comparison
drivers/vhost/vhost.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
^ permalink raw reply
* [PATCH v3 0/2] net: add device groups
From: Vlad Dogaru @ 2011-01-14 9:38 UTC (permalink / raw)
To: netdev, netdev; +Cc: Vlad Dogaru, jamal, Octavian Purdila
This patchset implements network device grouping and simple manipulation
of groups. Netlink has been updated to provide group information and
means of applying changes to members of a specific group via a single
message.
The patchset has a corresponding one for iproute2, which implements the
new functionality in userspace.
Some basic testing, using 1024 dummy network interfaces (all of them in
group 0):
# time { for i in `seq 0 1023`; do ip l s dev dummy$i up; done }
real 0m7.70s
user 0m0.36s
sys 0m4.85s
# time ip l s devgroup 0 up
real 0m0.14s
user 0m0.00s
sys 0m0.14s
# time { for i in `seq 0 1023`; do ip l s dev dummy$i mtu 2000; done }
real 0m7.43s
user 0m0.48s
sys 0m4.72s
# time ip l s devgroup 0 mtu 2000
real 0m0.02s
user 0m0.00s
sys 0m0.02s
Improvement stems both from less user-kernel communication and from less
processes being created.
Changes since version 2:
* fix net_device field type (should be int, not unsigned int).
* fix typo in commit message.
Changes since version 1:
* we avoid adding a new attribute type by using the following
convention: if no device name is specified, the interface index is
negative, and there is a group specified, we change parameters for
the whole group.
* the dummy module is no longer modified to include an initial group
for the devices it creates. The user is responsible for moving them
to a different group by means of the provided netlink interface.
Vlad Dogaru (2):
net_device: add support for network device groups
netlink: support setting devgroup parameters
include/linux/if_link.h | 1 +
include/linux/netdevice.h | 7 +++++++
net/core/dev.c | 12 ++++++++++++
net/core/rtnetlink.c | 38 ++++++++++++++++++++++++++++++++++----
4 files changed, 54 insertions(+), 4 deletions(-)
^ permalink raw reply
* [PATCH v3 1/2] net_device: add support for network device groups
From: Vlad Dogaru @ 2011-01-14 9:38 UTC (permalink / raw)
To: netdev, netdev; +Cc: Vlad Dogaru, jamal, Octavian Purdila
In-Reply-To: <1294997911-13866-1-git-send-email-ddvlad@rosedu.org>
Net devices can now be grouped, enabling simpler manipulation from
userspace. This patch adds a group field to the net_device structure, as
well as rtnetlink support to query and modify it.
Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
---
include/linux/if_link.h | 1 +
include/linux/netdevice.h | 7 +++++++
net/core/dev.c | 12 ++++++++++++
net/core/rtnetlink.c | 6 ++++++
4 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 6485d2a..f4a2e6b 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -135,6 +135,7 @@ enum {
IFLA_VF_PORTS,
IFLA_PORT_SELF,
IFLA_AF_SPEC,
+ IFLA_GROUP, /* Group the device belongs to */
__IFLA_MAX
};
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0f6b1c9..2a3e1da 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -75,6 +75,9 @@ struct wireless_dev;
#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
#define NET_RX_DROP 1 /* packet dropped */
+/* Initial net device group. All devices belong to group 0 by default. */
+#define INIT_NETDEV_GROUP 0
+
/*
* Transmit return codes: transmit return codes originate from three different
* namespaces:
@@ -1156,6 +1159,9 @@ struct net_device {
/* phy device may attach itself for hardware timestamping */
struct phy_device *phydev;
+
+ /* group the device belongs to */
+ int group;
};
#define to_net_dev(d) container_of(d, struct net_device, dev)
@@ -1847,6 +1853,7 @@ extern int dev_set_alias(struct net_device *, const char *, size_t);
extern int dev_change_net_namespace(struct net_device *,
struct net *, const char *);
extern int dev_set_mtu(struct net_device *, int);
+extern void dev_set_group(struct net_device *, int);
extern int dev_set_mac_address(struct net_device *,
struct sockaddr *);
extern int dev_hard_start_xmit(struct sk_buff *skb,
diff --git a/net/core/dev.c b/net/core/dev.c
index a215269..6cf0cd2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4573,6 +4573,17 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
EXPORT_SYMBOL(dev_set_mtu);
/**
+ * dev_set_group - Change group this device belongs to
+ * @dev: device
+ * @new_group: group this device should belong to
+ */
+void dev_set_group(struct net_device *dev, int new_group)
+{
+ dev->group = new_group;
+}
+EXPORT_SYMBOL(dev_set_group);
+
+/**
* dev_set_mac_address - Change Media Access Control Address
* @dev: device
* @sa: new address
@@ -5698,6 +5709,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
dev->priv_flags = IFF_XMIT_DST_RELEASE;
setup(dev);
strcpy(dev->name, name);
+ dev->group = INIT_NETDEV_GROUP;
return dev;
free_pcpu:
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 750db57..012b0f0 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -868,6 +868,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
netif_running(dev) ? dev->operstate : IF_OPER_DOWN);
NLA_PUT_U8(skb, IFLA_LINKMODE, dev->link_mode);
NLA_PUT_U32(skb, IFLA_MTU, dev->mtu);
+ NLA_PUT_U32(skb, IFLA_GROUP, dev->group);
if (dev->ifindex != dev->iflink)
NLA_PUT_U32(skb, IFLA_LINK, dev->iflink);
@@ -1265,6 +1266,11 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
modified = 1;
}
+ if (tb[IFLA_GROUP]) {
+ dev_set_group(dev, nla_get_u32(tb[IFLA_GROUP]));
+ modified = 1;
+ }
+
/*
* Interface selected by interface index but interface
* name provided implies that a name change has been
--
1.7.1
^ permalink raw reply related
* [PATCH v3 2/2] netlink: support setting devgroup parameters
From: Vlad Dogaru @ 2011-01-14 9:38 UTC (permalink / raw)
To: netdev, netdev; +Cc: Vlad Dogaru, jamal, Octavian Purdila
In-Reply-To: <1294997911-13866-1-git-send-email-ddvlad@rosedu.org>
If a rtnetlink request specifies a negative or zero ifindex and has no
interface name attribute, but has a group attribute, then the chenges
are made to all the interfaces belonging to the specified group.
Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
---
net/core/rtnetlink.c | 32 ++++++++++++++++++++++++++++----
1 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 012b0f0..f208397 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1558,6 +1558,24 @@ err:
}
EXPORT_SYMBOL(rtnl_create_link);
+static int rtnl_group_changelink(struct net *net, int group,
+ struct ifinfomsg *ifm,
+ struct nlattr **tb)
+{
+ struct net_device *dev;
+ int err;
+
+ for_each_netdev(net, dev) {
+ if (dev->group == group) {
+ err = do_setlink(dev, ifm, tb, NULL, 0);
+ if (err < 0)
+ return err;
+ }
+ }
+
+ return 0;
+}
+
static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
{
struct net *net = sock_net(skb->sk);
@@ -1585,10 +1603,16 @@ replay:
ifm = nlmsg_data(nlh);
if (ifm->ifi_index > 0)
dev = __dev_get_by_index(net, ifm->ifi_index);
- else if (ifname[0])
- dev = __dev_get_by_name(net, ifname);
- else
- dev = NULL;
+ else {
+ if (ifname[0])
+ dev = __dev_get_by_name(net, ifname);
+ else if (tb[IFLA_GROUP])
+ return rtnl_group_changelink(net,
+ nla_get_u32(tb[IFLA_GROUP]),
+ ifm, tb);
+ else
+ dev = NULL;
+ }
err = validate_linkmsg(dev, tb);
if (err < 0)
--
1.7.1
^ permalink raw reply related
* Re: [PATCH v5 08/10] ARM: mxs: add ocotp read function
From: Uwe Kleine-König @ 2011-01-14 9:48 UTC (permalink / raw)
To: Sascha Hauer
Cc: Shawn Guo, gerg, B32542, netdev, jamie, baruch, w.sang, r64343,
eric, bryan.wu, jamie, davem, linux-arm-kernel, lw
In-Reply-To: <20110114084009.GL26617@pengutronix.de>
Hello Sascha,
On Fri, Jan 14, 2011 at 09:40:09AM +0100, Sascha Hauer wrote:
> On Fri, Jan 14, 2011 at 03:24:54PM +0800, Shawn Guo wrote:
> > +const u32 *mxs_get_ocotp(void)
> > +{
> > + [...]
> > +}
>
> EXPORT_SYMBOL?
I don't think this should be necessary. mxs_get_ocotp should only be
called from platform code that cannot (ot at least should not) be
modular. I suggest to skip it for now and if we really need it later
only add it then.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: STMMAC driver: NFS Problem on 2.6.37
From: deepaksi @ 2011-01-14 9:56 UTC (permalink / raw)
To: Armando VISCONTI
Cc: Chuck Lever, Trond.Myklebust@netapp.com, netdev@vger.kernel.org,
linux-nfs@vger.kernel.org, Shiraz HASHIM, Viresh KUMAR,
Peppe CAVALLARO, Amit GOEL
In-Reply-To: <4D2F4453.4040400@st.com>
Hi All,
On 1/13/2011 11:58 PM, Armando VISCONTI wrote:
> Chuck Lever wrote:
>
>> On Jan 13, 2011, at 4:09 AM, deepaksi wrote:
>>
>>
>>
>>> Hi
>>>
>>> I am facing a problem related to nfs boot, while using the stmmac driver
>>> ported on 2.6.37 kernel. When we use a JFFS2 file system and mount the kernel,
>>> the network driver works fine.
>>>
>>> I have been following the mailing list and could find some issues with NFS
>>> on 2.6.37 but I am not too sure whether the kernel crash I am getting is
>>> related to that.
>>>
>>> The driver worked fine on 2.6.32 kernel, but while booting the 2.6.37
>>> kernel I get the following log messages:
>>>
>>> stmmac: Rx Checksum Offload Engine supported
>>> TX Checksum insertion supported
>>> IP-Config: Complete:
>>> device=eth0, addr=192.168.1.10, mask=255.255.255.0, gw=255.255.255.255,
>>> host=192.168.1.10, domain=, nis-domain=(none),
>>> bootserver=192.168.1.1, rootserver=192.168.1.1, rootpath=
>>>
>>>
>> Why is rootpath left undefined?
>>
>>
>
Even with dhcp server, we get the same log for rootpath. It never
appears over there.
> Yes, Chuck.
> Good catch.
>
> Deepak,
> Can you possibly verify your bootargs?
>
> I see exactly your same problem with kernel 2.6.32 (rc6.3) on my
> board, where the bootargs is defined like this:
>
> bootargs=console=ttyAMA0,115200 mem=128M root=/dev/nfs
> ip=192.168.1.10:192.168.1
> .1:192.168.1.1:255.255.255.0 nfsroot=192.168.1.1:/home/guest/armv7/target
>
> In fact, rootpath is undefined also in my case...
>
> But if I get the network info from my DHCP server the system is booting
> correctly.
> (i.e. console=ttyAMA0,115200 mem=128M root=/dev/nfs ip=dhcp)
>
> So, why do we have rootpath undefined in our bootargs?
> I guess we screwed up something someway...
>
> Let's see it tomorrow.
>
> Ciao,
> Arm
>
>
>
>
The nfs work fine when you use the dhcp server, but still it is a
totally different proposition. The problem comes when we assign a static
IP in the bootargs, and then try to boot the system using NFS. here is
the bootargs setting at the u-boot.
bootargs = console=ttyAMA0,115200 mem=128M root=/dev/nfs
nfsroot=192.168.1.1:/opt/STM/STLinux-2.3/devkit/arm/target
ip=192.168.1.10:192.168.1.1:192.168.1.1:255.255.255.0::eth0
These settings have been working fine for earlier kernels. The tcp dump
while doing the nfs boot is quite different between the 2.6.32 and
2.6.37 kernels.
Regards
Deepak
> .
>
>
^ permalink raw reply
* Re: net 00/05: routing based send-to-self implementation
From: Kirill Smelkov @ 2011-01-14 10:18 UTC (permalink / raw)
To: Patrick McHardy; +Cc: davem, netdev, Jonathan Corbet, Boris Kocherov
In-Reply-To: <20091203112550.15100.86217.sendpatchset@x2.localnet>
[ Cc'ing Jonathan Corbet and a friend of mine ]
On Thu, Dec 03, 2009 at 12:25:52PM +0100, Patrick McHardy wrote:
> These patches are yet another attempt at adding "send-to-self" functionality,
> allowing to send packets between two local interfaces over the wire. Unlike
> the approaches I've seen so far, this one is purely routing based.
> Especially the oif classification should also be useful for different setups.
>
> The patchset consists of three parts:
>
> - the first three patches add oif classification to fib_rules. This can be
> used create special routing tables for sockets bound to an interface.
>
> - the fourth patch changes IPv4 and IPv6 to allow to delete the local rule
> with priority 0. This allows to re-create it using a lower priority and
> insert new rules below it to force packets with a local destination out
> on the wire.
>
> - the fifth patch adds a devinet sysctl to accept packets with local source
> addresses in fib_validate_source(). This one unfortunately seems to be
> necessary, I couldn't come up with a method based purely on adding more
> routes to fool fib_validate_source() into accepting those packets.
>
> Usage example:
>
> # move local routing rule to lower priority
> ip rule add pref 1000 lookup local
> ip rule del pref 0
>
> # only reply to ARP requests for addresses configured on the device
> echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
>
> # configure device and force packets of bound sockets out on eth1
> ip address add dev eth1 10.0.0.1/24
> echo 1 > /proc/sys/net/ipv4/conf/eth1/accept_local
> ip link set eth1 up
> ip rule add pref 500 oif eth1 lookup 500
> ip route add default dev eth1 table 500
>
> # configure device and force packets of bound sockets out on eth2
> ip address add dev eth2 10.0.0.2/24
> echo 1 > /proc/sys/net/ipv4/conf/eth2/accept_local
> ip link set eth2 up
> ip rule add pref 501 oif eth2 lookup 501
> ip route add default dev eth2 table 501
>
> At this point packets between sockets bound to eth1/eth2 will go over the wire.
Patrick, thanks a lot for doing this!
Just a small follow-up: it is possible to setup such loops without
requiring sockets to be bound to devices. The idea is to setup rules
like
$ ip rule add pref 100 to <ip-on-eth1> lookup 100
$ ip route add default dev eth0 table 100
so that on TX, packets go through appropriate interfaces.
And for RX, another rules like
$ ip rule add pref 10 iif eth0 lookup local
so that packets can be received at all.
I've spent several days to find this, debugging and tracing kernel and
trying various variants on how to do it, so I though I'd better share
the info for poor souls like me :)
For completeness, here is the script which will setup tap0/tap1 loop
through virtual vde_switch.
( Jonathan, I though something like this could be useful for LDD4 in
revised snull not needing to play dirty tricks with IP addresses anymore )
---- 8< (mk-tap-loop.sh) ----
#!/bin/sh -e
# reset interfaces
ip link del tap0 2>/dev/null || :
ip link del tap1 2>/dev/null || :
# create interfaces
vde_tunctl -t tap0
vde_tunctl -t tap1
# assign addresses
ip addr add 192.168.23.10/24 dev tap0
ip addr add 192.168.23.11/24 dev tap1
# put ifs up
ip link set tap0 up
ip link set tap1 up
# lower priority of kernel local table to 500
ip rule del pref 0 lookup local 2>/dev/null || :
ip rule del pref 500 lookup local 2>/dev/null || :
ip rule add pref 500 lookup local
# on rx side handle packets by local table, so we can receive them
echo 1 >/proc/sys/net/ipv4/conf/tap0/accept_local
echo 1 >/proc/sys/net/ipv4/conf/tap1/accept_local
ip rule del pref 10 2>/dev/null || :
ip rule del pref 11 2>/dev/null || :
ip rule add pref 10 iif tap0 lookup local
ip rule add pref 11 iif tap1 lookup local
# tx
ip rule del pref 100 2>/dev/null || :
ip rule del pref 101 2>/dev/null || :
ip rule add pref 100 to 192.168.23.10 lookup 100 # tap0 <- tap1
ip rule add pref 101 to 192.168.23.11 lookup 101 # tap1 <- tap0
ip route flush table 100
ip route flush table 101
ip route add default dev tap1 table 100
ip route add default dev tap0 table 101
# ensure (visually) we've set up it ok
echo
echo " >>> rules:"
ip rule
echo
echo " >>> tap(0|1) routing table:"
#routel | grep '\<tap\(0\|1\)\>'
ip route show table all | grep '\<tap\(0\|1\)\>'
# tx path
echo
echo " >>> checking routing for tx path:"
ip route get 192.168.23.10 connected
ip route get 192.168.23.11 connected
# rx path
echo
echo " >>> checking routing for rx path:"
ip route get from 192.168.23.10 to 192.168.23.11 iif tap1
ip route get from 192.168.23.11 to 192.168.23.10 iif tap0
# start switch and connect switch-tap0 and switch-tap1
echo
echo " >>> ready to start vde_switch and connect wires..."
read
screen sh -c 'screen sh -cx "sleep 4; vde_plug2tap tap0"; screen sh -cx "sleep 4; vde_plug2tap tap1"; sh -cx vde_switch'
# now e.g. ping 192.168.23.11 sends packets to tap0 which are received
# on tap1 and ICMP-ECHO'ed by kernel on tap1 and received on tap0.
^ permalink raw reply
* Re: [PATCH] CHOKe flow scheduler (0.8)
From: Eric Dumazet @ 2011-01-14 11:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev
In-Reply-To: <1294977498.3403.127.camel@edumazet-laptop>
Le vendredi 14 janvier 2011 à 04:58 +0100, Eric Dumazet a écrit :
> Le vendredi 14 janvier 2011 à 04:34 +0100, Eric Dumazet a écrit :
>
> > Hmm, please wait a bit, I had another crash when I stopped my
> > bench/stress
>
> I am not sure p->qavg is correctly computed.
>
> Crash happened because choke_peek_random() was called while no packet
> was in queue.
>
> With my params (min=10833 max=32500 burst=18055 limit=130000) this
> implies qavg was very big while qlen==0 !
>
> qdisc choke 11: dev ifb0 parent 1:11 limit 130000b min 10833b max 32500b ewma 13 Plog 21 Scell_log 30
> Sent 200857857 bytes 365183 pkt (dropped 1010937, overlimits 557577 requeues 0)
> rate 32253Kbit 7330pps backlog 17875996b 32505p requeues 0
> marked 0 early 557577 pdrop 0 other 0 matched 226680
Moving the qdisc_bstats_update(sch, skb); out of choke_enqueue() to
choke_dequeue(), I get nicer rate values (because packets that are
enqueued but CHOKed dont artificialy raise the packet/byte rates)
Now, rate properly matches my 10Mbit CBQ bandwidth :
qdisc choke 11: parent 1:11 limit 130000b min 10833b max 32500b ewma 13 Plog 21 Scell_log 30
Sent 86470970 bytes 157418 pkt (dropped 127451, overlimits 48275 requeues 0)
rate 9947Kbit 2264pps backlog 17759368b 32288p requeues 0
marked 0 early 48275 pdrop 0 other 0 matched 39588
For other qdiscs, it is less easy because qdisc_bstats_update() call is
integrated in __qdisc_enqueue_tail() / qdisc_enqueue_tail(), so all
users shall be updated at once.
^ 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