* Re: Re: Kernel panic in fib_rules_lookup (kernel 2.6.32)
From: "Oleg A. Arkhangelsky" @ 2010-03-09 17:21 UTC (permalink / raw)
To: netdev
Hello, Eric
> > Mar 9 10:08:55 bras-1 kernel:
> > Mar 9 10:08:55 bras-1 kernel: Pid: 0, comm: swapper Not tainted (2.6.32 #3)
>
> Is it an unpatched kernel ?
Yes. Vanilla 2.6.32. We saw the same issue on at least 2.6.30.1 (as far as I know).
>
> Could you send us your .config ?
>
Here it is: http://www.progtech.ru/~oleg/config.txt
> gcc -v ?
Reading specs from /usr/lib/gcc/i486-slackware-linux/4.3.3/specs
Target: i486-slackware-linux
Configured with: ../gcc-4.3.3/configure --prefix=/usr --libdir=/usr/lib --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --with-gnu-ld --verbose --with-arch=i486 --target=i486-slackware-linux --build=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 4.3.3 (GCC)
--
wbr, Oleg.
^ permalink raw reply
* Re: [PATCH] ar9170: fix for driver-core ABI change
From: Stefan Richter @ 2010-03-09 18:00 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: David Miller, netdev, John W. Linville, LKML, linux-next
In-Reply-To: <20100309125245.c25e5ca4.sfr@canb.auug.org.au>
Stephen Rothwell wrote:
> Greg tells me that the semaphore to mutex change didn't go into Linus'
> tree. However, this patch can still be applied as the device_lock/unlock
> primitives did go in. I guess that the include of mutex.h is not needed.
An #include <linux/device.h> seems to be in order though. It is pulled
in via linux/usb.h and this is surely not bound to change anytime soon,
but still.
--
Stefan Richter
-=====-==-=- --== -=--=
http://arcgraph.de/sr/
^ permalink raw reply
* Re: Kernel panic in fib_rules_lookup (kernel 2.6.32)
From: Stephen Hemminger @ 2010-03-09 18:22 UTC (permalink / raw)
To: \"Oleg A. Arkhangelsky\; +Cc: netdev
In-Reply-To: <76131268155285@webmail84.yandex.ru>
----- "\"Oleg A. Arkhangelsky\"" <sysoleg@yandex.ru> wrote:
> Hello, Eric
>
> > > Mar 9 10:08:55 bras-1 kernel:
> > > Mar 9 10:08:55 bras-1 kernel: Pid: 0, comm: swapper Not tainted
> (2.6.32 #3)
> >
> > Is it an unpatched kernel ?
>
> Yes. Vanilla 2.6.32. We saw the same issue on at least 2.6.30.1 (as
> far as I know).
>
iptables NETFLOW and ISG modules aren't in standard kernel (yet)
http://www.progtech.ru/~oleg/lISG/
^ permalink raw reply
* Re: Re: Kernel panic in fib_rules_lookup (kernel 2.6.32)
From: "Oleg A. Arkhangelsky" @ 2010-03-09 18:39 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <9847503.232911268158922219.JavaMail.root@tahiti.vyatta.com>
Hello, Stephen
09.03.10, 10:22, "Stephen Hemminger" <stephen.hemminger@vyatta.com>:
> > Yes. Vanilla 2.6.32. We saw the same issue on at least 2.6.30.1 (as
> > far as I know).
> >
>
>
> iptables NETFLOW and ISG modules aren't in standard kernel (yet)
> http://www.progtech.ru/~oleg/lISG/
Agreed. But they are only iptables modules, not patches. How can they
be related to functionality of routing (especially routing rules) subsystem?
Thank you.
P.S.: By the way, we're not using rules at all on this router:
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
--
wbr, Oleg.
^ permalink raw reply
* RE: [2.6.34-rc1] CPU stalls when closing TCP sockets.
From: Tantilov, Emil S @ 2010-03-09 18:58 UTC (permalink / raw)
To: Eric Dumazet, Tetsuo Handa, David Miller
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
paulmck@linux.vnet.ibm.com, Stephen Hemminger
In-Reply-To: <1268150156.3113.12.camel@edumazet-laptop>
Eric Dumazet wrote:
> Le mardi 09 mars 2010 à 15:54 +0900, Tetsuo Handa a écrit :
>> Eric Dumazet wrote:
>>> Nothing comes to my mind, I'll try to reproduce this here.
>>
>> When stopped at (8), Ctrl-C doesn't work.
>>
>>> Is 2.6.33 OK ?
>>
>> Yes. 2.6.33 and earlier are OK.
>
> OK thanks !
>
> I believe commit d218d11133d888f9745802146a50255a4781d37a
> (tcp: Generalized TTL Security Mechanism) might be the bug origin.
>
> I am testing following patch, based on latest net-2.6 tree (including
> the LINUX_MIB_TCPMINTTLDROP bit)
>
> [PATCH] tcp: Fix tcp_v4_rcv()
>
> Commit d218d111 (tcp: Generalized TTL Security Mechanism) added a bug
> for TIMEWAIT sockets. We should not test min_ttl for TW sockets.
>
> Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 8d51d39..70df409 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1651,15 +1651,15 @@ int tcp_v4_rcv(struct sk_buff *skb)
> if (!sk)
> goto no_tcp_socket;
>
> +process:
> + if (sk->sk_state == TCP_TIME_WAIT)
> + goto do_time_wait;
> +
> if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
> NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
> goto discard_and_relse;
> }
>
> -process:
> - if (sk->sk_state == TCP_TIME_WAIT)
> - goto do_time_wait;
> -
> if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb))
> goto discard_and_relse;
> nf_reset(skb);
This patch fixes hangs with ftp and rsh sessions I have been experiencing for some time now with the net-next tree. Hundreds of iterations passed without problems.
Thanks!
Emil
^ permalink raw reply
* [PATCH] NET: Support clause 45 MDIO commands at the MDIO bus level
From: Jason Gunthorpe @ 2010-03-09 19:17 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
IEEE 802.3ae clause 45 specifies a somewhat modified MDIO protocol
for use by 10GIGE phys. The main change is a 21 bit address split into
a 5 bit device ID and a 16 bit register offset. The definition is designed
so that normal and extended devices can run on the same MDIO bus.
Extend mdio-bitbang to do the new protocol. At the MDIO bus level the
protocol is requested by or'ing MII_ADDR_C45 into the register offset.
Make phy_read/phy_write/etc pass a full 32 bit register offset.
This does not attempt to make the phy layer support C45 style PHYs, just
to provide the MDIO bus support.
Tested against a Broadcom 10GE phy with ID 0x206034, and several
Broadcom 10/100/1000 Phys in normal mode.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
drivers/net/phy/mdio-bitbang.c | 60 ++++++++++++++++++++++++++++++++++------
drivers/net/phy/mdio_bus.c | 4 +-
include/linux/phy.h | 12 +++++--
3 files changed, 61 insertions(+), 15 deletions(-)
diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c
index 2576055..0ff0661 100644
--- a/drivers/net/phy/mdio-bitbang.c
+++ b/drivers/net/phy/mdio-bitbang.c
@@ -23,8 +23,13 @@
#include <linux/types.h>
#include <linux/delay.h>
-#define MDIO_READ 1
-#define MDIO_WRITE 0
+#define MDIO_READ 2
+#define MDIO_WRITE 1
+
+#define MDIO_C45 (1<<15)
+#define MDIO_C45_ADDR (MDIO_C45 | 0)
+#define MDIO_C45_READ (MDIO_C45 | 3)
+#define MDIO_C45_WRITE (MDIO_C45 | 1)
#define MDIO_SETUP_TIME 10
#define MDIO_HOLD_TIME 10
@@ -90,7 +95,7 @@ static u16 mdiobb_get_num(struct mdiobb_ctrl *ctrl, int bits)
/* Utility to send the preamble, address, and
* register (common to read and write).
*/
-static void mdiobb_cmd(struct mdiobb_ctrl *ctrl, int read, u8 phy, u8 reg)
+static void mdiobb_cmd(struct mdiobb_ctrl *ctrl, int op, u8 phy, u8 reg)
{
const struct mdiobb_ops *ops = ctrl->ops;
int i;
@@ -109,23 +114,56 @@ static void mdiobb_cmd(struct mdiobb_ctrl *ctrl, int read, u8 phy, u8 reg)
for (i = 0; i < 32; i++)
mdiobb_send_bit(ctrl, 1);
- /* send the start bit (01) and the read opcode (10) or write (10) */
+ /* send the start bit (01) and the read opcode (10) or write (10).
+ Clause 45 operation uses 00 for the start and 11, 10 for
+ read/write */
mdiobb_send_bit(ctrl, 0);
- mdiobb_send_bit(ctrl, 1);
- mdiobb_send_bit(ctrl, read);
- mdiobb_send_bit(ctrl, !read);
+ if (op & MDIO_C45)
+ mdiobb_send_bit(ctrl, 0);
+ else
+ mdiobb_send_bit(ctrl, 1);
+ mdiobb_send_bit(ctrl, (op >> 1) & 1);
+ mdiobb_send_bit(ctrl, (op >> 0) & 1);
mdiobb_send_num(ctrl, phy, 5);
mdiobb_send_num(ctrl, reg, 5);
}
+/* In clause 45 mode all commands are prefixed by MDIO_ADDR to specify the
+ lower 16 bits of the 21 bit address. This transfer is done identically to a
+ MDIO_WRITE except for a different code. To enable clause 45 mode or
+ MII_ADDR_C45 into the address. Theoretically clause 45 and normal devices
+ can exist on the same bus. Normal devices should ignore the MDIO_ADDR
+ phase. */
+static int mdiobb_cmd_addr(struct mdiobb_ctrl *ctrl, int phy, u32 addr)
+{
+ unsigned int dev_addr = (addr >> 16) & 0x1F;
+ unsigned int reg = addr & 0xFFFF;
+ mdiobb_cmd(ctrl, MDIO_C45_ADDR, phy, dev_addr);
+
+ /* send the turnaround (10) */
+ mdiobb_send_bit(ctrl, 1);
+ mdiobb_send_bit(ctrl, 0);
+
+ mdiobb_send_num(ctrl, reg, 16);
+
+ ctrl->ops->set_mdio_dir(ctrl, 0);
+ mdiobb_get_bit(ctrl);
+
+ return dev_addr;
+}
static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
{
struct mdiobb_ctrl *ctrl = bus->priv;
int ret, i;
- mdiobb_cmd(ctrl, MDIO_READ, phy, reg);
+ if (reg & MII_ADDR_C45) {
+ reg = mdiobb_cmd_addr(ctrl, phy, reg);
+ mdiobb_cmd(ctrl, MDIO_C45_READ, phy, reg);
+ } else
+ mdiobb_cmd(ctrl, MDIO_READ, phy, reg);
+
ctrl->ops->set_mdio_dir(ctrl, 0);
/* check the turnaround bit: the PHY should be driving it to zero */
@@ -148,7 +186,11 @@ static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val)
{
struct mdiobb_ctrl *ctrl = bus->priv;
- mdiobb_cmd(ctrl, MDIO_WRITE, phy, reg);
+ if (reg & MII_ADDR_C45) {
+ reg = mdiobb_cmd_addr(ctrl, phy, reg);
+ mdiobb_cmd(ctrl, MDIO_C45_WRITE, phy, reg);
+ } else
+ mdiobb_cmd(ctrl, MDIO_WRITE, phy, reg);
/* send the turnaround (10) */
mdiobb_send_bit(ctrl, 1);
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index e17b702..6a6b819 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -208,7 +208,7 @@ EXPORT_SYMBOL(mdiobus_scan);
* because the bus read/write functions may wait for an interrupt
* to conclude the operation.
*/
-int mdiobus_read(struct mii_bus *bus, int addr, u16 regnum)
+int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum)
{
int retval;
@@ -233,7 +233,7 @@ EXPORT_SYMBOL(mdiobus_read);
* because the bus read/write functions may wait for an interrupt
* to conclude the operation.
*/
-int mdiobus_write(struct mii_bus *bus, int addr, u16 regnum, u16 val)
+int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val)
{
int err;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 6a7eb40..5069739 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -81,6 +81,10 @@ typedef enum {
*/
#define MII_BUS_ID_SIZE (20 - 3)
+/* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit
+ IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */
+#define MII_ADDR_C45 (1<<30)
+
/*
* The Bus class for PHYs. Devices which provide access to
* PHYs should register using this structure
@@ -127,8 +131,8 @@ int mdiobus_register(struct mii_bus *bus);
void mdiobus_unregister(struct mii_bus *bus);
void mdiobus_free(struct mii_bus *bus);
struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
-int mdiobus_read(struct mii_bus *bus, int addr, u16 regnum);
-int mdiobus_write(struct mii_bus *bus, int addr, u16 regnum, u16 val);
+int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
+int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
#define PHY_INTERRUPT_DISABLED 0x0
@@ -422,7 +426,7 @@ struct phy_fixup {
* because the bus read/write functions may wait for an interrupt
* to conclude the operation.
*/
-static inline int phy_read(struct phy_device *phydev, u16 regnum)
+static inline int phy_read(struct phy_device *phydev, u32 regnum)
{
return mdiobus_read(phydev->bus, phydev->addr, regnum);
}
@@ -437,7 +441,7 @@ static inline int phy_read(struct phy_device *phydev, u16 regnum)
* because the bus read/write functions may wait for an interrupt
* to conclude the operation.
*/
-static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
+static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
{
return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
}
--
1.5.4.2
^ permalink raw reply related
* tcp_recvmesg hang under NET_DMA
From: Steven J. Magnani @ 2010-03-09 20:44 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, David S. Miller
Hi,
I've run into a case where using NET_DMA seems to cause a PUT to a
modified ftpd to hang. AFAICT this is because the NET_DMA design queues
up lots of memcpy operations, but doesn't issue or wait for them (and
thus free the associated skbs) until it is time for tcp_recvmesg() to
return. In a case where userland requests a large read (as is the case
in my modified ftpd), packet transfer can grind to a halt because so
many packets are buffered up and there is no event that causes them to
be freed.
I can submit a patch that would issue pending memcpys and clean up
completed ones around tcp_recvmsg's call to sk_wait_data(), but first I
wanted to understand the design better. Were there specific reasons for
deferring the async operations so long?
Thanks,
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
^ permalink raw reply
* Re: [PATCH 6/13] bridge: Add core IGMP snooping support
From: Arnd Bergmann @ 2010-03-09 21:12 UTC (permalink / raw)
To: paulmck; +Cc: Herbert Xu, David S. Miller, netdev, Stephen Hemminger
In-Reply-To: <20100307031151.GA7546@linux.vnet.ibm.com>
On Sunday 07 March 2010, Paul E. McKenney wrote:
> On Sun, Mar 07, 2010 at 10:45:00AM +0800, Herbert Xu wrote:
> > On Sat, Mar 06, 2010 at 11:00:00AM -0800, Paul E. McKenney wrote:
>
> Arnd, would it be reasonable to extend your RCU-sparse changes to have
> four different pointer namespaces, one for each flavor of RCU? (RCU,
> RCU-bh, RCU-sched, and SRCU)? Always a fan of making the computer do
> the auditing where reasonable. ;-)
>
> This could potentially catch the mismatched call_rcu()s, at least if the
> rcu_head could be labeled.
>
> Other thoughts?
I've just tried annotating net/ipv4/route.c like this and did not get
very far, because the same pointers are used for rcu and rcu_bh.
Could you check if this is a false positive or an actual finding?
Arnd
^ permalink raw reply
* [PATCH 2/5] drivers/net: drop redundant memset
From: Julia Lawall @ 2010-03-09 21:14 UTC (permalink / raw)
To: Ramkrishna Vepa, Rastapur Santosh, Sivakumar Subramani,
Sreenivasa Honnur <sreenivasa.honnur
From: Julia Lawall <julia@diku.dk>
The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e1,e2,e3,e4;
@@
- memset(e1,e2,e3);
memcpy(e1,e4,e3);
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/net/s2io.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index df70657..2eb7f8a 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -5819,10 +5819,8 @@ static void s2io_vpd_read(struct s2io_nic *nic)
}
}
- if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) {
- memset(nic->product_name, 0, vpd_data[1]);
+ if ((!fail) && (vpd_data[1] < VPD_STRING_LEN))
memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);
- }
kfree(vpd_data);
swstats->mem_freed += 256;
}
^ permalink raw reply related
* Re: [2.6.34-rc1] CPU stalls when closing TCP sockets.
From: Tetsuo Handa @ 2010-03-09 21:44 UTC (permalink / raw)
To: eric.dumazet, davem; +Cc: netdev, linux-kernel, paulmck, shemminger
In-Reply-To: <1268150156.3113.12.camel@edumazet-laptop>
Hello.
Eric Dumazet wrote:
> Le mardi 09 mars 2010 a 15:54 +0900, Tetsuo Handa a ecrit :
> > Eric Dumazet wrote:
> > > Nothing comes to my mind, I'll try to reproduce this here.
> >
> > When stopped at (8), Ctrl-C doesn't work.
> >
> > > Is 2.6.33 OK ?
> >
> > Yes. 2.6.33 and earlier are OK.
>
> OK thanks !
>
> I believe commit d218d11133d888f9745802146a50255a4781d37a
> (tcp: Generalized TTL Security Mechanism) might be the bug origin.
Yes. "git bisect" reported that
d218d11133d888f9745802146a50255a4781d37a is first bad commit.
Your patch (although I needed to change like below in order to
apply on linux-2.6.34-rc1) fixes the CPU stalls.
Thank you.
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index c3588b4..3f8d08f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1651,13 +1651,13 @@ int tcp_v4_rcv(struct sk_buff *skb)
if (!sk)
goto no_tcp_socket;
- if (iph->ttl < inet_sk(sk)->min_ttl)
- goto discard_and_relse;
-
process:
if (sk->sk_state == TCP_TIME_WAIT)
goto do_time_wait;
+ if (iph->ttl < inet_sk(sk)->min_ttl)
+ goto discard_and_relse;
+
if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb))
goto discard_and_relse;
nf_reset(skb);
^ permalink raw reply related
* Re: [net-next-2.6 PATCH 1/3] rename notifier defines for netdev type change
From: Jiri Pirko @ 2010-03-09 22:00 UTC (permalink / raw)
To: netdev; +Cc: fubar, bonding-devel, davem, shemminger
In-Reply-To: <20100309141837.GC2783@psychotron.lab.eng.brq.redhat.com>
Hmm, maybe even better would be
NETDEV_PRE_TYPE_CHANGE
and
NETDEV_POST_TYPE_CHANGE
Tue, Mar 09, 2010 at 03:18:38PM CET, jpirko@redhat.com wrote:
>Since generally there could be more netdevices changing type other than bonding,
>making this event type name "bonding-unrelated"
>
>Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>---
> drivers/net/bonding/bond_main.c | 4 ++--
> include/linux/notifier.h | 4 ++--
> net/ipv4/devinet.c | 4 ++--
> net/ipv6/addrconf.c | 16 ++++++++--------
> 4 files changed, 14 insertions(+), 14 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 430c022..c1b39b7 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1480,14 +1480,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
> bond_dev->name,
> bond_dev->type, slave_dev->type);
>
>- netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE);
>+ netdev_bonding_change(bond_dev, NETDEV_TYPE_CHNG_START);
>
> if (slave_dev->type != ARPHRD_ETHER)
> bond_setup_by_slave(bond_dev, slave_dev);
> else
> ether_setup(bond_dev);
>
>- netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE);
>+ netdev_bonding_change(bond_dev, NETDEV_TYPE_CHNG_DONE);
> }
> } else if (bond_dev->type != slave_dev->type) {
> pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n",
>diff --git a/include/linux/notifier.h b/include/linux/notifier.h
>index fee6c2f..c8145c2 100644
>--- a/include/linux/notifier.h
>+++ b/include/linux/notifier.h
>@@ -199,8 +199,8 @@ static inline int notifier_to_errno(int ret)
> #define NETDEV_FEAT_CHANGE 0x000B
> #define NETDEV_BONDING_FAILOVER 0x000C
> #define NETDEV_PRE_UP 0x000D
>-#define NETDEV_BONDING_OLDTYPE 0x000E
>-#define NETDEV_BONDING_NEWTYPE 0x000F
>+#define NETDEV_TYPE_CHNG_START 0x000E
>+#define NETDEV_TYPE_CHNG_DONE 0x000F
> #define NETDEV_POST_INIT 0x0010
> #define NETDEV_UNREGISTER_BATCH 0x0011
>
>diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
>index 51ca946..16bfc45 100644
>--- a/net/ipv4/devinet.c
>+++ b/net/ipv4/devinet.c
>@@ -1095,10 +1095,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
> case NETDEV_DOWN:
> ip_mc_down(in_dev);
> break;
>- case NETDEV_BONDING_OLDTYPE:
>+ case NETDEV_TYPE_CHNG_START:
> ip_mc_unmap(in_dev);
> break;
>- case NETDEV_BONDING_NEWTYPE:
>+ case NETDEV_TYPE_CHNG_DONE:
> ip_mc_remap(in_dev);
> break;
> case NETDEV_CHANGEMTU:
>diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>index 88fd8c5..b2409ac 100644
>--- a/net/ipv6/addrconf.c
>+++ b/net/ipv6/addrconf.c
>@@ -137,8 +137,8 @@ static DEFINE_SPINLOCK(addrconf_verify_lock);
> static void addrconf_join_anycast(struct inet6_ifaddr *ifp);
> static void addrconf_leave_anycast(struct inet6_ifaddr *ifp);
>
>-static void addrconf_bonding_change(struct net_device *dev,
>- unsigned long event);
>+static void addrconf_type_change(struct net_device *dev,
>+ unsigned long event);
> static int addrconf_ifdown(struct net_device *dev, int how);
>
> static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags);
>@@ -2582,9 +2582,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
> return notifier_from_errno(err);
> }
> break;
>- case NETDEV_BONDING_OLDTYPE:
>- case NETDEV_BONDING_NEWTYPE:
>- addrconf_bonding_change(dev, event);
>+ case NETDEV_TYPE_CHNG_START:
>+ case NETDEV_TYPE_CHNG_DONE:
>+ addrconf_type_change(dev, event);
> break;
> }
>
>@@ -2599,16 +2599,16 @@ static struct notifier_block ipv6_dev_notf = {
> .priority = 0
> };
>
>-static void addrconf_bonding_change(struct net_device *dev, unsigned long event)
>+static void addrconf_type_change(struct net_device *dev, unsigned long event)
> {
> struct inet6_dev *idev;
> ASSERT_RTNL();
>
> idev = __in6_dev_get(dev);
>
>- if (event == NETDEV_BONDING_NEWTYPE)
>+ if (event == NETDEV_TYPE_CHNG_DONE)
> ipv6_mc_remap(idev);
>- else if (event == NETDEV_BONDING_OLDTYPE)
>+ else if (event == NETDEV_TYPE_CHNG_START)
> ipv6_mc_unmap(idev);
> }
>
>--
>1.6.6.1
>
^ permalink raw reply
* Re: [PATCH] ar9170: fix for driver-core ABI change
From: Stephen Rothwell @ 2010-03-09 22:08 UTC (permalink / raw)
To: Stefan Richter; +Cc: David Miller, netdev, John W. Linville, LKML, linux-next
In-Reply-To: <4B968CA2.4040000@s5r6.in-berlin.de>
[-- Attachment #1: Type: text/plain, Size: 690 bytes --]
Hi Stefan,
On Tue, 09 Mar 2010 19:00:02 +0100 Stefan Richter <stefanr@s5r6.in-berlin.de> wrote:
>
> Stephen Rothwell wrote:
> > Greg tells me that the semaphore to mutex change didn't go into Linus'
> > tree. However, this patch can still be applied as the device_lock/unlock
> > primitives did go in. I guess that the include of mutex.h is not needed.
>
> An #include <linux/device.h> seems to be in order though. It is pulled
> in via linux/usb.h and this is surely not bound to change anytime soon,
> but still.
Damn! Caught by my own "Rule #1" :-)
Thanks.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: how to tweak ARP timer on kernel 2.6.9
From: Eric Dumazet @ 2010-03-09 22:10 UTC (permalink / raw)
To: Tom Ammon; +Cc: linux-kernel, netdev
In-Reply-To: <4B96A24A.6060405@utah.edu>
Le mardi 09 mars 2010 à 12:32 -0700, Tom Ammon a écrit :
> Hi,
>
> I've been trying to figure out how to adjust the ARP timeout on kernel
> 2.6.9 and I found the following in /proc/sys/net/ipv4/neigh/ib0 (its an
> IB interface I am interested in changing) with the following values.
> This is on kernel 2.6.9-89ELsmp (RHEL4) :
>
> When I test this, along with per-flow ECMP (using the iproute2 utils), I
> see that the ARP cache is timing out about every 10 minutes (I observe
> this by load balancing an iperf flow between two different gateway
> machines and then graphing the interface traffic)
>
10 minutes seems out of specs.
> On a newer kernel, 2.6.18-164.11.1.el5 (RHEL5), I see mostly the same
> parms available, but a few new ones have been added. However, all of the
> parms that are the same name between the two kernels are the same values:
>
> Yet when I observe the same traffic flow with this machine, the ARP
> cache times out about once per minute.
>
This seems normal, old kernels were a bit lazy about arp.
> Is there another set of parameters somewhere that govern how often the
> kernel times out the ARP cache? If so, where might I find that? Is there
> any kernel documentation that talks about changing ARP timers on the
> linux kernel?
>
I would suggest :
man 7 arp
http://linux.die.net/man/7/arp
base_reachable_time
Once a neighbour has been found, the entry is considered to be
valid for at least a random value between base_reachable_time/2
and 3*base_reachable_time/2. An entry's validity will be
extended if it receives positive feedback from higher level
protocols. Defaults to 30 seconds.
gc_interval
How frequently the garbage collector for neighbour entries
should attempt to run. Defaults to 30 seconds.
gc_stale_time
Determines how often to check for stale neighbour entries. When
a neighbour entry is considered stale it is resolved again
before sending data to it. Defaults to 60 seconds.
and "ip -s neigh"
^ permalink raw reply
* [PATCH] asix: fix setting mac address for AX88772
From: Jussi Kivilinna @ 2010-03-09 22:24 UTC (permalink / raw)
To: netdev; +Cc: David Hollis, David Miller
Setting new MAC address only worked when device was set to promiscuous mode.
Fix MAC address by writing new address to device using undocumented command
AX_CMD_READ_NODE_ID+1. Patch is tested with AX88772 device.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
drivers/net/usb/asix.c | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 20e3460..9e05639 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -54,6 +54,7 @@ static const char driver_name [] = "asix";
#define AX_CMD_WRITE_IPG0 0x12
#define AX_CMD_WRITE_IPG1 0x13
#define AX_CMD_READ_NODE_ID 0x13
+#define AX_CMD_WRITE_NODE_ID 0x14
#define AX_CMD_WRITE_IPG2 0x14
#define AX_CMD_WRITE_MULTI_FILTER 0x16
#define AX88172_CMD_READ_NODE_ID 0x17
@@ -165,6 +166,7 @@ static const char driver_name [] = "asix";
/* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
struct asix_data {
u8 multi_filter[AX_MCAST_FILTER_SIZE];
+ u8 mac_addr[ETH_ALEN];
u8 phymode;
u8 ledmode;
u8 eeprom_len;
@@ -732,6 +734,30 @@ static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
}
+static int asix_set_mac_address(struct net_device *net, void *p)
+{
+ struct usbnet *dev = netdev_priv(net);
+ struct asix_data *data = (struct asix_data *)&dev->data;
+ struct sockaddr *addr = p;
+
+ if (netif_running(net))
+ return -EBUSY;
+ if (!is_valid_ether_addr(addr->sa_data))
+ return -EADDRNOTAVAIL;
+
+ memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
+
+ /* We use the 20 byte dev->data
+ * for our 6 byte mac buffer
+ * to avoid allocating memory that
+ * is tricky to free later */
+ memcpy(data->mac_addr, addr->sa_data, ETH_ALEN);
+ asix_write_cmd_async(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
+ data->mac_addr);
+
+ return 0;
+}
+
/* We need to override some ethtool_ops so we require our
own structure so we don't interfere with other usbnet
devices that may be connected at the same time. */
@@ -919,7 +945,7 @@ static const struct net_device_ops ax88772_netdev_ops = {
.ndo_start_xmit = usbnet_start_xmit,
.ndo_tx_timeout = usbnet_tx_timeout,
.ndo_change_mtu = usbnet_change_mtu,
- .ndo_set_mac_address = eth_mac_addr,
+ .ndo_set_mac_address = asix_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_do_ioctl = asix_ioctl,
.ndo_set_multicast_list = asix_set_multicast,
@@ -1213,7 +1239,7 @@ static const struct net_device_ops ax88178_netdev_ops = {
.ndo_stop = usbnet_stop,
.ndo_start_xmit = usbnet_start_xmit,
.ndo_tx_timeout = usbnet_tx_timeout,
- .ndo_set_mac_address = eth_mac_addr,
+ .ndo_set_mac_address = asix_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_multicast_list = asix_set_multicast,
.ndo_do_ioctl = asix_ioctl,
^ permalink raw reply related
* Re: [PATCH] asix: fix setting mac address for AX88772
From: David Hollis @ 2010-03-09 23:25 UTC (permalink / raw)
To: Jussi Kivilinna; +Cc: netdev, David Miller
In-Reply-To: <20100309222438.10684.46211.stgit@fate.lan>
On 03/09/2010 05:24 PM, Jussi Kivilinna wrote:
> Setting new MAC address only worked when device was set to promiscuous mode.
> Fix MAC address by writing new address to device using undocumented command
> AX_CMD_READ_NODE_ID+1. Patch is tested with AX88772 device.
>
> Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: David Hollis <dhollis@davehollis.com>
> ---
>
> drivers/net/usb/asix.c | 30 ++++++++++++++++++++++++++++--
> 1 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
> index 20e3460..9e05639 100644
> --- a/drivers/net/usb/asix.c
> +++ b/drivers/net/usb/asix.c
> @@ -54,6 +54,7 @@ static const char driver_name [] = "asix";
> #define AX_CMD_WRITE_IPG0 0x12
> #define AX_CMD_WRITE_IPG1 0x13
> #define AX_CMD_READ_NODE_ID 0x13
> +#define AX_CMD_WRITE_NODE_ID 0x14
> #define AX_CMD_WRITE_IPG2 0x14
> #define AX_CMD_WRITE_MULTI_FILTER 0x16
> #define AX88172_CMD_READ_NODE_ID 0x17
> @@ -165,6 +166,7 @@ static const char driver_name [] = "asix";
> /* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
> struct asix_data {
> u8 multi_filter[AX_MCAST_FILTER_SIZE];
> + u8 mac_addr[ETH_ALEN];
> u8 phymode;
> u8 ledmode;
> u8 eeprom_len;
> @@ -732,6 +734,30 @@ static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
> return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
> }
>
> +static int asix_set_mac_address(struct net_device *net, void *p)
> +{
> + struct usbnet *dev = netdev_priv(net);
> + struct asix_data *data = (struct asix_data *)&dev->data;
> + struct sockaddr *addr = p;
> +
> + if (netif_running(net))
> + return -EBUSY;
> + if (!is_valid_ether_addr(addr->sa_data))
> + return -EADDRNOTAVAIL;
> +
> + memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
> +
> + /* We use the 20 byte dev->data
> + * for our 6 byte mac buffer
> + * to avoid allocating memory that
> + * is tricky to free later */
> + memcpy(data->mac_addr, addr->sa_data, ETH_ALEN);
> + asix_write_cmd_async(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
> + data->mac_addr);
> +
> + return 0;
> +}
> +
> /* We need to override some ethtool_ops so we require our
> own structure so we don't interfere with other usbnet
> devices that may be connected at the same time. */
> @@ -919,7 +945,7 @@ static const struct net_device_ops ax88772_netdev_ops = {
> .ndo_start_xmit = usbnet_start_xmit,
> .ndo_tx_timeout = usbnet_tx_timeout,
> .ndo_change_mtu = usbnet_change_mtu,
> - .ndo_set_mac_address = eth_mac_addr,
> + .ndo_set_mac_address = asix_set_mac_address,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_do_ioctl = asix_ioctl,
> .ndo_set_multicast_list = asix_set_multicast,
> @@ -1213,7 +1239,7 @@ static const struct net_device_ops ax88178_netdev_ops = {
> .ndo_stop = usbnet_stop,
> .ndo_start_xmit = usbnet_start_xmit,
> .ndo_tx_timeout = usbnet_tx_timeout,
> - .ndo_set_mac_address = eth_mac_addr,
> + .ndo_set_mac_address = asix_set_mac_address,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_set_multicast_list = asix_set_multicast,
> .ndo_do_ioctl = asix_ioctl,
>
^ permalink raw reply
* [PATCH 1/2] hv: use network device stats
From: Stephen Hemminger @ 2010-03-10 1:42 UTC (permalink / raw)
To: Hank Janssen, Greg KH; +Cc: netdev
In-Reply-To: <8AFC7968D54FB448A30D8F38F259C5621AF725A9@TK5EX14MBXC116.redmond.corp.microsoft.com>
The network device structure has space already reserved for statistics.
Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/staging/hv/TODO | 1 -
drivers/staging/hv/netvsc_drv.c | 31 +++++++++----------------------
2 files changed, 9 insertions(+), 23 deletions(-)
--- a/drivers/staging/hv/TODO 2010-03-09 17:07:51.483312299 -0800
+++ b/drivers/staging/hv/TODO 2010-03-09 17:08:05.812720241 -0800
@@ -9,7 +9,6 @@ TODO:
- see if the vmbus can be merged with the other virtual busses
in the kernel
- audit the network driver
- - use existing net_device_stats struct in network device
- checking for carrier inside open is wrong, network device API
confusion??
- audit the block driver
--- a/drivers/staging/hv/netvsc_drv.c 2010-03-09 17:04:48.453624589 -0800
+++ b/drivers/staging/hv/netvsc_drv.c 2010-03-09 17:25:21.196552131 -0800
@@ -42,7 +42,6 @@
struct net_device_context {
/* point back to our device context */
struct vm_device *device_ctx;
- struct net_device_stats stats;
};
struct netvsc_driver_context {
@@ -57,13 +56,6 @@ static int netvsc_ringbuffer_size = NETV
/* The one and only one */
static struct netvsc_driver_context g_netvsc_drv;
-static struct net_device_stats *netvsc_get_stats(struct net_device *net)
-{
- struct net_device_context *net_device_ctx = netdev_priv(net);
-
- return &net_device_ctx->stats;
-}
-
static void netvsc_set_multicast_list(struct net_device *net)
{
}
@@ -77,9 +69,6 @@ static int netvsc_open(struct net_device
DPRINT_ENTER(NETVSC_DRV);
if (netif_carrier_ok(net)) {
- memset(&net_device_ctx->stats, 0,
- sizeof(struct net_device_stats));
-
/* Open up the device */
ret = RndisFilterOnOpen(device_obj);
if (ret != 0) {
@@ -223,8 +212,8 @@ retry_send:
if (ret == 0) {
ret = NETDEV_TX_OK;
- net_device_ctx->stats.tx_bytes += skb->len;
- net_device_ctx->stats.tx_packets++;
+ net->stats.tx_bytes += skb->len;
+ net->stats.tx_packets++;
} else {
retries++;
if (retries < 4) {
@@ -240,7 +229,7 @@ retry_send:
DPRINT_INFO(NETVSC_DRV, "net device (%p) stopping", net);
ret = NETDEV_TX_BUSY;
- net_device_ctx->stats.tx_dropped++;
+ net->stats.tx_dropped++;
netif_stop_queue(net);
@@ -258,8 +247,8 @@ retry_send:
}
DPRINT_DBG(NETVSC_DRV, "# of xmits %lu total size %lu",
- net_device_ctx->stats.tx_packets,
- net_device_ctx->stats.tx_bytes);
+ net->stats.tx_packets,
+ net->stats.tx_bytes);
DPRINT_EXIT(NETVSC_DRV);
return ret;
@@ -358,17 +347,16 @@ static int netvsc_recv_callback(struct h
switch (ret) {
case NET_RX_DROP:
- net_device_ctx->stats.rx_dropped++;
+ net->stats.rx_dropped++;
break;
default:
- net_device_ctx->stats.rx_packets++;
- net_device_ctx->stats.rx_bytes += skb->len;
+ net->stats.rx_packets++;
+ net->stats.rx_bytes += skb->len;
break;
}
DPRINT_DBG(NETVSC_DRV, "# of recvs %lu total size %lu",
- net_device_ctx->stats.rx_packets,
- net_device_ctx->stats.rx_bytes);
+ net->stats.rx_packets, net->stats.rx_bytes);
DPRINT_EXIT(NETVSC_DRV);
@@ -379,7 +367,6 @@ static const struct net_device_ops devic
.ndo_open = netvsc_open,
.ndo_stop = netvsc_close,
.ndo_start_xmit = netvsc_start_xmit,
- .ndo_get_stats = netvsc_get_stats,
.ndo_set_multicast_list = netvsc_set_multicast_list,
};
^ permalink raw reply
* [PATCH 2/2] hv: handle skb allocation failure
From: Stephen Hemminger @ 2010-03-10 1:42 UTC (permalink / raw)
To: Hank Janssen, Greg KH; +Cc: netdev
In-Reply-To: <20100309173855.7d297c44@nehalam>
Some fixes to receive handling:
* Dieing with assertion failure when running out of memory is not ok
* Use newer alloc function to get aligned skb
* Dropped statistic is supposed to be incremented only by
driver it was responsible for the drop.
Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/staging/hv/netvsc_drv.c | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
--- a/drivers/staging/hv/netvsc_drv.c 2010-03-09 17:27:57.263312289 -0800
+++ b/drivers/staging/hv/netvsc_drv.c 2010-03-09 17:34:45.012686682 -0800
@@ -292,7 +292,6 @@ static int netvsc_recv_callback(struct h
struct net_device_context *net_device_ctx;
struct sk_buff *skb;
void *data;
- int ret;
int i;
unsigned long flags;
@@ -306,12 +305,12 @@ static int netvsc_recv_callback(struct h
net_device_ctx = netdev_priv(net);
- /* Allocate a skb - TODO preallocate this */
- /* Pad 2-bytes to align IP header to 16 bytes */
- skb = dev_alloc_skb(packet->TotalDataBufferLength + 2);
- ASSERT(skb);
- skb_reserve(skb, 2);
- skb->dev = net;
+ /* Allocate a skb - TODO direct I/O to pages? */
+ skb = netdev_alloc_skb_ip_align(net, packet->TotalDataBufferLength);
+ if (unlikely(!skb)) {
+ ++net->stats.rx_dropped;
+ return 0;
+ }
/* for kmap_atomic */
local_irq_save(flags);
@@ -336,25 +335,18 @@ static int netvsc_recv_callback(struct h
local_irq_restore(flags);
skb->protocol = eth_type_trans(skb, net);
-
skb->ip_summed = CHECKSUM_NONE;
+ net->stats.rx_packets++;
+ net->stats.rx_bytes += skb->len;
+
/*
* Pass the skb back up. Network stack will deallocate the skb when it
- * is done
+ * is done.
+ * TODO - use NAPI?
*/
- ret = netif_rx(skb);
-
- switch (ret) {
- case NET_RX_DROP:
- net->stats.rx_dropped++;
- break;
- default:
- net->stats.rx_packets++;
- net->stats.rx_bytes += skb->len;
- break;
+ netif_rx(skb);
- }
DPRINT_DBG(NETVSC_DRV, "# of recvs %lu total size %lu",
net->stats.rx_packets, net->stats.rx_bytes);
^ permalink raw reply
* Re: [PATCH 6/13] bridge: Add core IGMP snooping support
From: Paul E. McKenney @ 2010-03-10 2:14 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Herbert Xu, David S. Miller, netdev, Stephen Hemminger
In-Reply-To: <201003092212.59627.arnd@arndb.de>
On Tue, Mar 09, 2010 at 10:12:59PM +0100, Arnd Bergmann wrote:
> On Sunday 07 March 2010, Paul E. McKenney wrote:
> > On Sun, Mar 07, 2010 at 10:45:00AM +0800, Herbert Xu wrote:
> > > On Sat, Mar 06, 2010 at 11:00:00AM -0800, Paul E. McKenney wrote:
> >
> > Arnd, would it be reasonable to extend your RCU-sparse changes to have
> > four different pointer namespaces, one for each flavor of RCU? (RCU,
> > RCU-bh, RCU-sched, and SRCU)? Always a fan of making the computer do
> > the auditing where reasonable. ;-)
> >
> > This could potentially catch the mismatched call_rcu()s, at least if the
> > rcu_head could be labeled.
> >
> > Other thoughts?
>
> I've just tried annotating net/ipv4/route.c like this and did not get
> very far, because the same pointers are used for rcu and rcu_bh.
> Could you check if this is a false positive or an actual finding?
Hmmm... I am only seeing a call_rcu_bh() here, so unless I am missing
something, this is a real problem in TREE_PREEMPT_RCU kernels. The
call_rcu_bh() only interacts with the rcu_read_lock_bh() readers, not
the rcu_read_lock() readers.
One approach is to run freed blocks through both types of grace periods,
I suppose.
Thanx, Paul
^ permalink raw reply
* [PATCH net-2.6] ipv6 ip6_tunnel: eliminate unused recursion field from ip6_tnl{}.
From: YOSHIFUJI Hideaki @ 2010-03-10 2:47 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji
Commit a43912ab19... ("tunnel: eliminate recursion field") eliminated
use of recursion field from tunnel structures, but its definition
still exists in ip6_tnl{}.
Let's remove that unused field.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
include/net/ip6_tunnel.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 83b4e00..fbf9d1c 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -15,7 +15,6 @@
struct ip6_tnl {
struct ip6_tnl *next; /* next tunnel in list */
struct net_device *dev; /* virtual device associated with tunnel */
- int recursion; /* depth of hard_start_xmit recursion */
struct ip6_tnl_parm parms; /* tunnel configuration parameters */
struct flowi fl; /* flowi template for xmit */
struct dst_entry *dst_cache; /* cached dst */
--
1.5.6.5
^ permalink raw reply related
* [PATCH 0/3] pci: fix/cleanup pcix get and set mmrbc functions
From: Dean Nelson @ 2010-03-10 3:26 UTC (permalink / raw)
To: jbarnes; +Cc: netdev, linux-pci
A customer running RHEL4.8 encountered
"e1000: eth0: e1000_clean_tx_irq: Detected Tx Unit Hang"
type errors, which were determined to be the result of a bad return value
from e1000_pcix_get_mmrbc() causing the call to e1000_pcix_set_mmrbc() to
be skipped in the following snippet of code from e1000_init_hw().
switch (hw->mac_type) {
case e1000_82545_rev_3:
case e1000_82546_rev_3:
break;
default:
/* Workaround for PCI-X problem when BIOS sets MMRBC incorrectly. */
if (hw->bus_type == e1000_bus_type_pcix
&& e1000_pcix_get_mmrbc(hw) > 2048)
e1000_pcix_set_mmrbc(hw, 2048);
break;
}
e1000_pcix_get_mmrbc() is basically a wrapper for a call to pcix_get_mmrbc().
e1000_pcix_set_mmrbc() is the same for pcix_set_mmrbc().
The following three patches are a response to the problems that were found to
exist with pcix_get_max_mmrbc(), pcix_get_mmrbc() and pcix_set_mmrbc().
Versions of these patches applicable to RHEL4 were verified by the customer to
solve their problem.
^ permalink raw reply
* [PATCH 1/3] pci: fix return value from pcix_get_max_mmrbc()
From: Dean Nelson @ 2010-03-10 3:26 UTC (permalink / raw)
To: jbarnes; +Cc: netdev, linux-pci
In-Reply-To: <20100310032632.6331.15414.send-patch@aqua>
For the PCI_X_STATUS register, pcix_get_max_mmrbc() is returning an incorrect
value, which is based on:
(stat & PCI_X_STATUS_MAX_READ) >> 12
Valid return values are 512, 1024, 2048, 4096, which correspond to a 'stat'
(masked and right shifted by 21) of 0, 1, 2, 3, respectively.
A right shift by 11 would generate the correct return value when 'stat' (masked
and right shifted by 21) has a value of 1 or 2. But for a value of 0 or 3 it's
not possible to generate the correct return value by only right shifting.
Fix is based on pcix_get_mmrbc()'s similar dealings with the PCI_X_CMD register.
Signed-off-by: Dean Nelson <dnelson@redhat.com>
---
drivers/pci/pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 5b548ae..1decd4f 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2571,7 +2571,7 @@ int pcix_get_max_mmrbc(struct pci_dev *dev)
if (err)
return -EINVAL;
- return (stat & PCI_X_STATUS_MAX_READ) >> 12;
+ return 512 << ((stat & PCI_X_STATUS_MAX_READ) >> 21);
}
EXPORT_SYMBOL(pcix_get_max_mmrbc);
^ permalink raw reply related
* [PATCH 2/3] pci: fix access of PCI_X_CMD by pcix get and set mmrbc functions
From: Dean Nelson @ 2010-03-10 3:26 UTC (permalink / raw)
To: jbarnes; +Cc: netdev, linux-pci
In-Reply-To: <20100310032632.6331.15414.send-patch@aqua>
An e1000 driver on a system with a PCI-X bus was always being returned
a value of 135 from both pcix_get_mmrbc() and pcix_set_mmrbc(). This
value reflects an error return of PCIBIOS_BAD_REGISTER_NUMBER from
pci_bus_read_config_dword(,, cap + PCI_X_CMD,).
This is because for a dword, the following portion of the PCI_OP_READ()
macro:
if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER;
expands to:
if (pos & 3) return PCIBIOS_BAD_REGISTER_NUMBER;
And is always true for 'cap + PCI_X_CMD', which is 0xe4 + 2 = 0xe6. ('cap' is
the result of calling pci_find_capability(, PCI_CAP_ID_PCIX).)
The same problem exists for pci_bus_write_config_dword(,, cap + PCI_X_CMD,).
In both cases, instead of calling _dword(), _word() should be called.
Signed-off-by: Dean Nelson <dnelson@redhat.com>
---
drivers/pci/pci.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1decd4f..cdf201e 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2585,13 +2585,13 @@ EXPORT_SYMBOL(pcix_get_max_mmrbc);
int pcix_get_mmrbc(struct pci_dev *dev)
{
int ret, cap;
- u32 cmd;
+ u16 cmd;
cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
if (!cap)
return -EINVAL;
- ret = pci_read_config_dword(dev, cap + PCI_X_CMD, &cmd);
+ ret = pci_read_config_word(dev, cap + PCI_X_CMD, &cmd);
if (!ret)
ret = 512 << ((cmd & PCI_X_CMD_MAX_READ) >> 2);
@@ -2611,7 +2611,8 @@ EXPORT_SYMBOL(pcix_get_mmrbc);
int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
{
int cap, err = -EINVAL;
- u32 stat, cmd, v, o;
+ u32 stat, v, o;
+ u16 cmd;
if (mmrbc < 512 || mmrbc > 4096 || !is_power_of_2(mmrbc))
goto out;
@@ -2629,7 +2630,7 @@ int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
if (v > (stat & PCI_X_STATUS_MAX_READ) >> 21)
return -E2BIG;
- err = pci_read_config_dword(dev, cap + PCI_X_CMD, &cmd);
+ err = pci_read_config_word(dev, cap + PCI_X_CMD, &cmd);
if (err)
goto out;
@@ -2641,7 +2642,7 @@ int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
cmd &= ~PCI_X_CMD_MAX_READ;
cmd |= v << 2;
- err = pci_write_config_dword(dev, cap + PCI_X_CMD, cmd);
+ err = pci_write_config_word(dev, cap + PCI_X_CMD, cmd);
}
out:
return err;
^ permalink raw reply related
* [PATCH 3/3] pci: cleanup error return for pcix get and set mmrbc functions
From: Dean Nelson @ 2010-03-10 3:26 UTC (permalink / raw)
To: jbarnes; +Cc: netdev, linux-pci
In-Reply-To: <20100310032632.6331.15414.send-patch@aqua>
pcix_get_mmrbc() returns the maximum memory read byte count (mmrbc), if
successful, or an appropriate error value, if not.
Distinguishing errors from correct values and understanding the meaning of an
error can be somewhat confusing in that:
correct values: 512, 1024, 2048, 4096
errors: -EINVAL -22
PCIBIOS_FUNC_NOT_SUPPORTED 0x81
PCIBIOS_BAD_VENDOR_ID 0x83
PCIBIOS_DEVICE_NOT_FOUND 0x86
PCIBIOS_BAD_REGISTER_NUMBER 0x87
PCIBIOS_SET_FAILED 0x88
PCIBIOS_BUFFER_TOO_SMALL 0x89
The PCIBIOS_ errors are returned from the PCI functions generated by the
PCI_OP_READ() and PCI_OP_WRITE() macros.
In a similar manner, pcix_set_mmrbc() also returns the PCIBIOS_ error values
returned from pci_read_config_[word|dword]() and pci_write_config_word().
Following pcix_get_max_mmrbc()'s example, the following patch simply returns
-EINVAL for all PCIBIOS_ errors encountered by pcix_get_mmrbc(), and -EINVAL
or -EIO for those encountered by pcix_set_mmrbc().
This simplification was chosen in light of the fact that none of the current
callers of these functions are interested in the specific type of error
encountered. In the future, should this change, one could simply create a
function that maps each PCIBIOS_ error to a corresponding unique errno value,
which could be called by pcix_get_max_mmrbc(), pcix_get_mmrbc(), and
pcix_set_mmrbc().
Additionally, this patch eliminates some unnecessary variables.
Signed-off-by: Dean Nelson <dnelson@redhat.com>
---
drivers/pci/pci.c | 36 ++++++++++++++++--------------------
1 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index cdf201e..5b6ed6f 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2560,15 +2560,14 @@ EXPORT_SYMBOL_GPL(pci_reset_function);
*/
int pcix_get_max_mmrbc(struct pci_dev *dev)
{
- int err, cap;
+ int cap;
u32 stat;
cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
if (!cap)
return -EINVAL;
- err = pci_read_config_dword(dev, cap + PCI_X_STATUS, &stat);
- if (err)
+ if (pci_read_config_dword(dev, cap + PCI_X_STATUS, &stat))
return -EINVAL;
return 512 << ((stat & PCI_X_STATUS_MAX_READ) >> 21);
@@ -2584,18 +2583,17 @@ EXPORT_SYMBOL(pcix_get_max_mmrbc);
*/
int pcix_get_mmrbc(struct pci_dev *dev)
{
- int ret, cap;
+ int cap;
u16 cmd;
cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
if (!cap)
return -EINVAL;
- ret = pci_read_config_word(dev, cap + PCI_X_CMD, &cmd);
- if (!ret)
- ret = 512 << ((cmd & PCI_X_CMD_MAX_READ) >> 2);
+ if (pci_read_config_word(dev, cap + PCI_X_CMD, &cmd))
+ return -EINVAL;
- return ret;
+ return 512 << ((cmd & PCI_X_CMD_MAX_READ) >> 2);
}
EXPORT_SYMBOL(pcix_get_mmrbc);
@@ -2610,29 +2608,27 @@ EXPORT_SYMBOL(pcix_get_mmrbc);
*/
int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
{
- int cap, err = -EINVAL;
+ int cap;
u32 stat, v, o;
u16 cmd;
if (mmrbc < 512 || mmrbc > 4096 || !is_power_of_2(mmrbc))
- goto out;
+ return -EINVAL;
v = ffs(mmrbc) - 10;
cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
if (!cap)
- goto out;
+ return -EINVAL;
- err = pci_read_config_dword(dev, cap + PCI_X_STATUS, &stat);
- if (err)
- goto out;
+ if (pci_read_config_dword(dev, cap + PCI_X_STATUS, &stat))
+ return -EINVAL;
if (v > (stat & PCI_X_STATUS_MAX_READ) >> 21)
return -E2BIG;
- err = pci_read_config_word(dev, cap + PCI_X_CMD, &cmd);
- if (err)
- goto out;
+ if (pci_read_config_word(dev, cap + PCI_X_CMD, &cmd))
+ return -EINVAL;
o = (cmd & PCI_X_CMD_MAX_READ) >> 2;
if (o != v) {
@@ -2642,10 +2638,10 @@ int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
cmd &= ~PCI_X_CMD_MAX_READ;
cmd |= v << 2;
- err = pci_write_config_word(dev, cap + PCI_X_CMD, cmd);
+ if (pci_write_config_word(dev, cap + PCI_X_CMD, cmd))
+ return -EIO;
}
-out:
- return err;
+ return 0;
}
EXPORT_SYMBOL(pcix_set_mmrbc);
^ permalink raw reply related
* When best to submit patches with small changes in multiple files?
From: Frans Pop @ 2010-03-10 3:49 UTC (permalink / raw)
To: netdev
I have patches prepared to remove trailing spaces from kernel messages
for ./net and ./drivers/net (including wireless).
In total 15 patches with
81 files changed, 351 insertions(+), 351 deletions(-)
When would be the best time to submit:
- now, to be included in .34
- now, for -next
- any time
- near beginning of merge window (rebased against netdev-next)
- not at all ;-)
?
Cheers,
FJP
^ permalink raw reply
* Re: [PATCH net-2.6] ipv6 ip6_tunnel: eliminate unused recursion field from ip6_tnl{}.
From: Eric Dumazet @ 2010-03-10 4:48 UTC (permalink / raw)
To: YOSHIFUJI Hideaki; +Cc: davem, netdev
In-Reply-To: <201003100247.o2A2lqaX001898@94.43.138.210.xn.2iij.net>
Le mercredi 10 mars 2010 à 11:47 +0900, YOSHIFUJI Hideaki a écrit :
> Commit a43912ab19... ("tunnel: eliminate recursion field") eliminated
> use of recursion field from tunnel structures, but its definition
> still exists in ip6_tnl{}.
>
> Let's remove that unused field.
>
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
^ 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