Netdev List
 help / color / mirror / Atom feed
* Re: Jetway JAD3RTLANG, Daughter Board, 3x GigaBit LAN does not work correctly
From: Markus Feldmann @ 2011-03-04 23:41 UTC (permalink / raw)
  To: netdev
In-Reply-To: <20110304222534.GA13681@electric-eye.fr.zoreil.com>

Am 04.03.2011 23:25, schrieb Francois Romieu:
> Are you worried that eth1 keeps going up/down or do you mean
> something else ?
I mean when two computers try to connect to my router, then not both can 
establish a connection. Sometimes only one computer can connect.

regards markus


^ permalink raw reply

* Re: bonding can't change to another slave if you ifdown the active slave
From: Jay Vosburgh @ 2011-03-05  0:38 UTC (permalink / raw)
  To: Weiping Pan; +Cc: netdev, bonding-devel, Linda Wang
In-Reply-To: <4D704B35.20700@gmail.com>

Weiping Pan <panweiping3@gmail.com> wrote:

>I'm doing some Linux bonding driver test, and I find a problem in
>balance-rr mode.
>That's it can't change to another slave if you ifdown the active slave.
>Any comments are warmly welcomed!

	I followed your recipe on a somewhat more recent kernel (2.6.37)
and using real hardware, and I don't see the problem you describe.

	I do have a couple of questions, further down.

[...]
>My host is Fedora 14, and I install VirtualBox (4.0.2), and enable 4

	I've not ever tried virtualbox, but it may be that its virtual
switch is misbehaving.  One possibility that comes to mind is that the
virtual switch is confused by seeing the same MAC address on multiple
ports (which is a problem with a hardware virtual switch I'm familiar
with).

>nics for the guest system.
>My guest is Fedora 14 too.
>First on my host, I run:
>[pwp@localhost linux-2.6.35-comment]$ uname -a
>Linux localhost.localdomain 2.6.35.11-83.fc14.i686 #1 SMP Mon Feb 7
>07:04:18 UTC 2011 i686 i686 i386 GNU/Linux
>
>[pwp@localhost linux-2.6.35-comment]$ sudo ifconfig eth0:0 192.168.1.100
>netmask 255.255.255.0 up
>[pwp@localhost linux-2.6.35-comment]$ sudo ifconfig
>eth0      Link encap:Ethernet  HWaddr 64:31:50:3A:B0:B5
>          inet addr:10.66.65.228  Bcast:10.66.65.255  Mask:255.255.254.0
>          inet6 addr: fe80::6631:50ff:fe3a:b0b5/64 Scope:Link
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:811505 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:777018 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:709681583 (676.8 MiB)  TX bytes:71520005 (68.2 MiB)
>          Interrupt:17
>
>eth0:0    Link encap:Ethernet  HWaddr 64:31:50:3A:B0:B5
>          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          Interrupt:17
>
>Then I enable bonding on my guest, I run:
>[root@localhost ~]# uname -a
>Linux localhost.localdomain 2.6.35.11-83.fc14.i686 #1 SMP Mon Feb 7
>07:04:18 UTC 2011 i686 i686 i386 GNU/Linux
>
>[root@localhost ~]# ifconfig
>eth6      Link encap:Ethernet  HWaddr 08:00:27:3A:4D:BD
>          inet addr:10.66.65.167  Bcast:10.66.65.255  Mask:255.255.254.0
>          inet6 addr: fe80::a00:27ff:fe3a:4dbd/64 Scope:Link
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:65 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:9916 (9.6 KiB)  TX bytes:3090 (3.0 KiB)
>
>eth7      Link encap:Ethernet  HWaddr 08:00:27:26:1B:DB
>          inet addr:10.66.65.154  Bcast:10.66.65.255  Mask:255.255.254.0
>          inet6 addr: fe80::a00:27ff:fe26:1bdb/64 Scope:Link
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:57 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:7358 (7.1 KiB)  TX bytes:1152 (1.1 KiB)
>
>eth8      Link encap:Ethernet  HWaddr 08:00:27:B5:FC:D1
>          inet addr:10.66.65.169  Bcast:10.66.65.255  Mask:255.255.254.0
>          inet6 addr: fe80::a00:27ff:feb5:fcd1/64 Scope:Link
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:57 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:7358 (7.1 KiB)  TX bytes:1152 (1.1 KiB)
>
>eth9      Link encap:Ethernet  HWaddr 08:00:27:C7:7B:FC
>          inet addr:10.66.65.216  Bcast:10.66.65.255  Mask:255.255.254.0
>          inet6 addr: fe80::a00:27ff:fec7:7bfc/64 Scope:Link
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:57 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:7358 (7.1 KiB)  TX bytes:1152 (1.1 KiB)
>
>lo        Link encap:Local Loopback
>          inet addr:127.0.0.1  Mask:255.0.0.0
>          inet6 addr: ::1/128 Scope:Host
>          UP LOOPBACK RUNNING  MTU:16436  Metric:1
>          RX packets:123 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:0
>          RX bytes:13036 (12.7 KiB)  TX bytes:13036 (12.7 KiB)
>
>[root@localhost ~]# ifconfig eth7 down
>[root@localhost ~]# ifconfig eth8 down
>[root@localhost ~]# dmesg -c
>[root@localhost ~]# modprobe bonding mode=0 miimon=100
>[root@localhost ~]# ifconfig bond0 192.168.1.5 netmask 255.255.255.0 up
>[root@localhost ~]# ifenslave bond0 eth7
>
>[root@localhost ~]# dmesg
>[  304.496463] bonding: Ethernet Channel Bonding Driver: v3.6.0
>(September 26, 2009)
>[  304.496468] bonding: MII link monitoring set to 100 ms
>[  353.527680] ADDRCONF(NETDEV_UP): bond0: link is not ready
>[  355.321626] e1000: eth7 NIC Link is Up 1000 Mbps Full Duplex, Flow
>Control: RX
>[  355.322250] bonding: bond0: enslaving eth7 as an active interface
>with an up link.
>[  355.323503] ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
>[  365.394052] bond0: no IPv6 routers present
>
>[pwp@localhost ~]$ ping 192.168.1.100 -c 10

	At this point, what is in the routing table ("ip route show")
and the ARP table ("ip neigh show")?

>PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
>64 bytes from 192.168.1.100: icmp_req=1 ttl=64 time=0.196 ms
>64 bytes from 192.168.1.100: icmp_req=2 ttl=64 time=0.365 ms
>64 bytes from 192.168.1.100: icmp_req=3 ttl=64 time=0.259 ms
>64 bytes from 192.168.1.100: icmp_req=4 ttl=64 time=0.135 ms
>64 bytes from 192.168.1.100: icmp_req=5 ttl=64 time=0.194 ms
>64 bytes from 192.168.1.100: icmp_req=6 ttl=64 time=0.225 ms
>64 bytes from 192.168.1.100: icmp_req=7 ttl=64 time=0.189 ms
>64 bytes from 192.168.1.100: icmp_req=8 ttl=64 time=0.274 ms
>64 bytes from 192.168.1.100: icmp_req=9 ttl=64 time=1.07 ms
>64 bytes from 192.168.1.100: icmp_req=10 ttl=64 time=0.274 ms
>
>--- 192.168.1.100 ping statistics ---
>10 packets transmitted, 10 received, 0% packet loss, time 9002ms
>rtt min/avg/max/mdev = 0.135/0.319/1.079/0.260 ms
>
>[root@localhost ~]# ifenslave bond0 eth8
>[root@localhost ~]# dmesg
>[  304.496463] bonding: Ethernet Channel Bonding Driver: v3.6.0
>(September 26, 2009)
>[  304.496468] bonding: MII link monitoring set to 100 ms
>[  353.527680] ADDRCONF(NETDEV_UP): bond0: link is not ready
>[  355.321626] e1000: eth7 NIC Link is Up 1000 Mbps Full Duplex, Flow
>Control: RX
>[  355.322250] bonding: bond0: enslaving eth7 as an active interface
>with an up link.
>[  355.323503] ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
>[  365.394052] bond0: no IPv6 routers present
>[  510.913797] e1000: eth8 NIC Link is Up 1000 Mbps Full Duplex, Flow
>Control: RX
>[  510.917312] bonding: bond0: enslaving eth8 as an active interface
>with an up link.
>
>[pwp@localhost ~]$ ping 192.168.1.100 -c 10
>PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
>64 bytes from 192.168.1.100: icmp_req=1 ttl=64 time=0.182 ms
>64 bytes from 192.168.1.100: icmp_req=2 ttl=64 time=0.211 ms
>64 bytes from 192.168.1.100: icmp_req=3 ttl=64 time=0.270 ms
>64 bytes from 192.168.1.100: icmp_req=4 ttl=64 time=0.248 ms
>64 bytes from 192.168.1.100: icmp_req=5 ttl=64 time=0.132 ms
>64 bytes from 192.168.1.100: icmp_req=6 ttl=64 time=0.291 ms
>64 bytes from 192.168.1.100: icmp_req=7 ttl=64 time=0.246 ms
>64 bytes from 192.168.1.100: icmp_req=8 ttl=64 time=0.272 ms
>64 bytes from 192.168.1.100: icmp_req=9 ttl=64 time=0.293 ms
>64 bytes from 192.168.1.100: icmp_req=10 ttl=64 time=0.133 ms
>
>--- 192.168.1.100 ping statistics ---
>10 packets transmitted, 10 received, 0% packet loss, time 9000ms
>rtt min/avg/max/mdev = 0.132/0.227/0.293/0.060 ms
>
>[root@localhost ~]# ifconfig
>bond0     Link encap:Ethernet  HWaddr 08:00:27:26:1B:DB
>          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
>          inet6 addr: fe80::a00:27ff:fe26:1bdb/64 Scope:Link
>          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
>          RX packets:311 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:0
>          RX bytes:38075 (37.1 KiB)  TX bytes:8698 (8.4 KiB)
>
>eth7      Link encap:Ethernet  HWaddr 08:00:27:26:1B:DB
>          inet addr:10.66.65.154  Bcast:10.66.65.255  Mask:255.255.254.0
>          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
>          RX packets:181 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:22297 (21.7 KiB)  TX bytes:4578 (4.4 KiB)
>
>eth8      Link encap:Ethernet  HWaddr 08:00:27:26:1B:DB
>          inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0
>          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
>          RX packets:130 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:15778 (15.4 KiB)  TX bytes:4120 (4.0 KiB)
>
>[root@localhost ~]# ifconfig eth7 down

	Next question: just after setting eth7 down, what do the routing
and ARP tables look like?

>[root@localhost ~]# dmesg
>[  304.496463] bonding: Ethernet Channel Bonding Driver: v3.6.0
>(September 26, 2009)
>[  304.496468] bonding: MII link monitoring set to 100 ms
>[  353.527680] ADDRCONF(NETDEV_UP): bond0: link is not ready
>[  355.321626] e1000: eth7 NIC Link is Up 1000 Mbps Full Duplex, Flow
>Control: RX
>[  355.322250] bonding: bond0: enslaving eth7 as an active interface
>with an up link.
>[  355.323503] ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
>[  365.394052] bond0: no IPv6 routers present
>[  510.913797] e1000: eth8 NIC Link is Up 1000 Mbps Full Duplex, Flow
>Control: RX
>[  510.917312] bonding: bond0: enslaving eth8 as an active interface
>with an up link.
>[  592.208534] bonding: bond0: link status definitely down for interface
>eth7, disabling it
>
>Now, if bonding driver works well, eth8 will be the active slave, and
>the network connection is ok.
>__But__ ...
>
>[pwp@localhost ~]$ ping 192.168.1.100 -c 10
>PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
>From 192.168.1.5 icmp_seq=10 Destination Host Unreachable
>
>--- 192.168.1.100 ping statistics ---
>10 packets transmitted, 0 received, +1 errors, 100% packet loss, time 8999ms
>
>How strange!
>
>[root@localhost ~]# ifconfig
>bond0     Link encap:Ethernet  HWaddr 08:00:27:26:1B:DB
>          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
>          inet6 addr: fe80::a00:27ff:fe26:1bdb/64 Scope:Link
>          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
>          RX packets:357 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:0
>          RX bytes:42971 (41.9 KiB)  TX bytes:9832 (9.6 KiB)
>
>eth8      Link encap:Ethernet  HWaddr 08:00:27:26:1B:DB
>          inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0
>          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
>          RX packets:163 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:19073 (18.6 KiB)  TX bytes:5254 (5.1 KiB)
>
>[root@localhost ~]# arp
>Address                  HWtype  HWaddress           Flags
>Mask            Iface
>corerouter.nay.redhat.c  ether   00:1d:45:20:d5:ff
>C                     eth6
>192.168.1.100
>(incomplete)                              bond0
>
>I think maybe there is something wrong about arp.
>So I run ping and tcpdump synchronously.
>
>[pwp@localhost ~]$ ping 192.168.1.100 -c 10
>PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
>From 192.168.1.5 icmp_seq=2 Destination Host Unreachable
>From 192.168.1.5 icmp_seq=3 Destination Host Unreachable
>From 192.168.1.5 icmp_seq=4 Destination Host Unreachable
>From 192.168.1.5 icmp_seq=6 Destination Host Unreachable
>From 192.168.1.5 icmp_seq=7 Destination Host Unreachable
>From 192.168.1.5 icmp_seq=8 Destination Host Unreachable
>From 192.168.1.5 icmp_seq=9 Destination Host Unreachable
>From 192.168.1.5 icmp_seq=10 Destination Host Unreachable
>
>--- 192.168.1.100 ping statistics ---
>10 packets transmitted, 0 received, +8 errors, 100% packet loss, time 9002ms
>pipe 3
>
>And meanwhile,
>[root@localhost ~]# tcpdump -i bond0 -p arp
>tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
>listening on bond0, link-type EN10MB (Ethernet), capture size 65535 bytes
>02:46:56.983092 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
>length 28
[...]

	At this point, does tcpdump on the host system see the incoming
ARP requests?

>But I'm sure eth8 works well.
>
>[root@localhost ~]# modprobe -r bonding
>[root@localhost ~]# modprobe bonding mode=0 miimon=100
>[root@localhost ~]# ifconfig bond0 192.168.1.5 netmask 255.255.255.0 up
>[root@localhost ~]# ifenslave bond0 eth8
>
>[pwp@localhost ~]$ ping 192.168.1.100 -c 10
>PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
>64 bytes from 192.168.1.100: icmp_req=1 ttl=64 time=0.683 ms
>64 bytes from 192.168.1.100: icmp_req=2 ttl=64 time=0.222 ms
>64 bytes from 192.168.1.100: icmp_req=3 ttl=64 time=0.265 ms
>64 bytes from 192.168.1.100: icmp_req=4 ttl=64 time=0.237 ms
>64 bytes from 192.168.1.100: icmp_req=5 ttl=64 time=0.214 ms
>64 bytes from 192.168.1.100: icmp_req=6 ttl=64 time=0.214 ms
>64 bytes from 192.168.1.100: icmp_req=7 ttl=64 time=0.238 ms
>64 bytes from 192.168.1.100: icmp_req=8 ttl=64 time=0.152 ms
>64 bytes from 192.168.1.100: icmp_req=9 ttl=64 time=0.234 ms
>64 bytes from 192.168.1.100: icmp_req=10 ttl=64 time=0.221 ms
>
>--- 192.168.1.100 ping statistics ---
>10 packets transmitted, 10 received, 0% packet loss, time 9004ms
>rtt min/avg/max/mdev = 0.152/0.268/0.683/0.141 ms
>
>[root@localhost ~]# ifconfig
>bond0     Link encap:Ethernet  HWaddr 08:00:27:B5:FC:D1
>          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
>          inet6 addr: fe80::a00:27ff:feb5:fcd1/64 Scope:Link
>          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
>          RX packets:263 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:0
>          RX bytes:28246 (27.5 KiB)  TX bytes:9810 (9.5 KiB)
>
>eth8      Link encap:Ethernet  HWaddr 08:00:27:B5:FC:D1
>          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
>          RX packets:263 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:28246 (27.5 KiB)  TX bytes:9810 (9.5 KiB)
>
>[root@localhost ~]# arp
>Address                  HWtype  HWaddress           Flags
>Mask            Iface
>corerouter.nay.redhat.c  ether   00:1d:45:20:d5:ff
>C                     eth6
>192.168.1.100            ether   64:31:50:3a:b0:b5
>C                     bond0

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

^ permalink raw reply

* FYI: tftp-hpa breaks when used on secondary ip addresses
From: Eric W. Biederman @ 2011-03-05  0:58 UTC (permalink / raw)
  To: H. Peter Anvin, netdev; +Cc: Joel Sing, David Miller


tftp-hpa has code to test to see if the address it received a connection
on is a local address.  I don't have a clue why tftp-hpa doesn't trust
the kernel but the code looks like:

static int address_is_local(const struct sockaddr_in *addr)
{
        struct sokcaddr sa;
        int sockfd = -1;
        sockfd = socket(AF_INET, SOCK_DGRAM, 0);
        connect(sockfd, (struct sockaddr *)&addr, sizeof(*addr));
        getsockname(sockfd, (struct sockaddr *)&sa, sizeof(sa));
        return sa.sin_addr.s_addr == addr->sin_addr.s_addr;
}

Which if fails now if you happen to be running tftp-hpa on a secondary
ip address on the same subnet as your first ip.  Because pref_source
in the routing table points at the first ip.

The change in kernel behavior appears to be from the commit below to
honor the preferred source address in local connections.

This all seems very fuzzy to me and mostly this appears to be a bug in
tftp-hpa but since I tracked it down I figured I would let everyone
know what happened.

Eric



commit 9fc3bbb4a752f108cf096d96640f3b548bbbce6c
Author: Joel Sing <jsing@google.com>
Date:   Mon Jan 3 20:24:20 2011 +0000

    ipv4/route.c: respect prefsrc for local routes
    
    The preferred source address is currently ignored for local routes,
    which results in all local connections having a src address that is the
    same as the local dst address. Fix this by respecting the preferred source
    address when it is provided for local routes.
    
    This bug can be demonstrated as follows:
    
     # ifconfig dummy0 192.168.0.1
     # ip route show table local | grep local.*dummy0
     local 192.168.0.1 dev dummy0  proto kernel  scope host  src
     # 192.168.0.1
     # ip route change table local local 192.168.0.1 dev dummy0 \
         proto kernel scope host src 127.0.0.1
     # ip route show table local | grep local.*dummy0
     local 192.168.0.1 dev dummy0  proto kernel  scope host  src
     # 127.0.0.1
    
    We now establish a local connection and verify the source IP
    address selection:
    
     # nc -l 192.168.0.1 3128 &
     # nc 192.168.0.1 3128 &
     # netstat -ant | grep 192.168.0.1:3128.*EST
     tcp        0      0 192.168.0.1:3128        192.168.0.1:33228
     # ESTABLISHED
     tcp        0      0 192.168.0.1:33228       192.168.0.1:3128
     # ESTABLISHED
    
    Signed-off-by: Joel Sing <jsing@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index df948b0..93bfd95 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2649,8 +2649,12 @@ static int ip_route_output_slow(struct net *net,
struct rtable **rp,
        }
 
        if (res.type == RTN_LOCAL) {
-               if (!fl.fl4_src)
-                       fl.fl4_src = fl.fl4_dst;
+               if (!fl.fl4_src) {
+                       if (res.fi->fib_prefsrc)
+                               fl.fl4_src = res.fi->fib_prefsrc;
+                       else
+                               fl.fl4_src = fl.fl4_dst;
+               }
                dev_out = net->loopback_dev;
                fl.oif = dev_out->ifindex;
                res.fi = NULL;


^ permalink raw reply related

* [PATCH] drivers/net/macvtap: fix error check
From: Nicolas Kaiser @ 2011-03-04 23:49 UTC (permalink / raw)
  To: David S. Miller; +Cc: Arnd Bergmann, Eric Dumazet, netdev, linux-kernel

'len' is unsigned of type size_t and can't be negative.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
 drivers/net/macvtap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 5933621..fc27a99 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -528,8 +528,9 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q,
 		vnet_hdr_len = q->vnet_hdr_sz;
 
 		err = -EINVAL;
-		if ((len -= vnet_hdr_len) < 0)
+		if (len < vnet_hdr_len)
 			goto err;
+		len -= vnet_hdr_len;
 
 		err = memcpy_fromiovecend((void *)&vnet_hdr, iv, 0,
 					   sizeof(vnet_hdr));
-- 
1.7.3.4

^ permalink raw reply related

* Re: [Bugme-new] [Bug 30462] New: High cpu usage when someone sends many ipv6 udp packages
From: Andrew Morton @ 2011-03-05  1:15 UTC (permalink / raw)
  To: netdev; +Cc: bugzilla-daemon, bugme-daemon, ernstp
In-Reply-To: <bug-30462-10286@https.bugzilla.kernel.org/>


(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Sat, 5 Mar 2011 01:10:53 GMT
bugzilla-daemon@bugzilla.kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=30462
> 
>            Summary: High cpu usage when someone sends many ipv6 udp
>                     packages
>            Product: Networking
>            Version: 2.5
>     Kernel Version: 2.6.38-rc3
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: high
>           Priority: P1
>          Component: IPV6
>         AssignedTo: yoshfuji@linux-ipv6.org
>         ReportedBy: ernstp@gmail.com
>         Regression: Yes
> 
> 
> Hi,
> 
> while testing ipv6 performance on my local network I found the following
> problem.
> When sending lots of UDP packages over ipv6 to a machine running kernel
> 2.6.38-rc3 or later that machines become heavily loaded and X may stop
> responding for long periods of time for example, sound skips etc.
> A ksoftirqd and kworker thread each run 100% on my machine.
> 
> I'm using this command to trigger this:
> iperf -c fe80::21f:d0ff:fe54:1ad4%eth0 -b 1000M -u -V
> You _don't_ have to setup an iperf server on the reciever.
> 
> I have a gigabit network with a WNDR3700 with the new V1.0.7.98 firmware that's
> "IPv6 ready".
> 
> I've used the kernels from http://kernel.ubuntu.com/~kernel-ppa/mainline/ to
> narrow down that this happens with 2.6.38-rc3 and later but not with 2.6.38-rc2
> and earlier like 2.6.37 and 2.6.35.
> 
> The following ipv6 related changes were introduced between -rc2 and -rc3 that I
> can see. The "Revert 'administrative down' address handling changes." looked
> big...
>       ipv6: Always clone offlink routes.
>       ipv6: Revert 'administrative down' address handling changes.
> 


^ permalink raw reply

* Re: [Bugme-new] [Bug 30462] New: High cpu usage when someone sends many ipv6 udp packages
From: David Miller @ 2011-03-05  1:21 UTC (permalink / raw)
  To: akpm; +Cc: netdev, bugzilla-daemon, bugme-daemon, ernstp
In-Reply-To: <20110304171506.0e27cde1.akpm@linux-foundation.org>

From: Andrew Morton <akpm@linux-foundation.org>
Date: Fri, 4 Mar 2011 17:15:06 -0800

>> The following ipv6 related changes were introduced between -rc2 and -rc3 that I
>> can see. The "Revert 'administrative down' address handling changes." looked
>> big...
>>       ipv6: Always clone offlink routes.
>>       ipv6: Revert 'administrative down' address handling changes.

Can we narrow it down to which of those two changes introduced the
regression?

We have another issue, still open, which is caused by the first
change, so maybe try reverting that one first.

Thanks.

^ permalink raw reply

* Re: FYI: tftp-hpa breaks when used on secondary ip addresses
From: H. Peter Anvin @ 2011-03-05  1:31 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: netdev, Joel Sing, David Miller
In-Reply-To: <m1sjv2qt68.fsf@fess.ebiederm.org>

On 03/04/2011 04:58 PM, Eric W. Biederman wrote:
> 
> Which if fails now if you happen to be running tftp-hpa on a secondary
> ip address on the same subnet as your first ip.  Because pref_source
> in the routing table points at the first ip.
> 
> The change in kernel behavior appears to be from the commit below to
> honor the preferred source address in local connections.
> 

If this is done for all local connections (as opposed to the ones that
have been configured explicitly by the administrator to behave that
way), that's a massive lossage.  Not only does a large number of
applications use this trick to determine if an address is local (e.g.
allowing bypass) -- it is pretty much the only portable way to do it --
but it would cause applications which expect to get a reply back from
the same address they sent a request to to completely fall on their face.

tftp-hpa needs this information in order to handle clients that send
their initial request to a broadcast (or multicast) address.

> This all seems very fuzzy to me and mostly this appears to be a bug in
> tftp-hpa but since I tracked it down I figured I would let everyone
> know what happened.

This seems like a broken change to me, or at the very least having
seriously unintended consequences.

	-hpa

^ permalink raw reply

* Re: bonding can't change to another slave if you ifdown the active slave
From: Andy Gospodarek @ 2011-03-05  2:53 UTC (permalink / raw)
  To: Weiping Pan; +Cc: netdev, bonding-devel, Linda Wang
In-Reply-To: <4D704B35.20700@gmail.com>

On Fri, Mar 04, 2011 at 10:15:17AM +0800, Weiping Pan wrote:
> Hi,
>
> I'm doing some Linux bonding driver test, and I find a problem in
> balance-rr mode.
> That's it can't change to another slave if you ifdown the active slave.
> Any comments are warmly welcomed!
>
> regards
> Weiping Pan
>
> My host is Fedora 14, and I install VirtualBox (4.0.2), and enable 4
> nics for the guest system.

Does this mean you are passing 4 NICs from your host to your guest
(maybe via direct pci-device assignment to the guest) or are you
creating 4 virtual devices on the host that are in a bridge group on the
host?

[...]
> [root@localhost ~]# ifconfig eth7 down

This is not a great way to test link failure with bonding.  The best way
is to actually pull the cable so the interface is truly down.

> [root@localhost ~]# dmesg
> [  304.496463] bonding: Ethernet Channel Bonding Driver: v3.6.0
> (September 26, 2009)
> [  304.496468] bonding: MII link monitoring set to 100 ms
> [  353.527680] ADDRCONF(NETDEV_UP): bond0: link is not ready
> [  355.321626] e1000: eth7 NIC Link is Up 1000 Mbps Full Duplex, Flow
> Control: RX
> [  355.322250] bonding: bond0: enslaving eth7 as an active interface
> with an up link.
> [  355.323503] ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
> [  365.394052] bond0: no IPv6 routers present
> [  510.913797] e1000: eth8 NIC Link is Up 1000 Mbps Full Duplex, Flow
> Control: RX
> [  510.917312] bonding: bond0: enslaving eth8 as an active interface
> with an up link.
> [  592.208534] bonding: bond0: link status definitely down for interface
> eth7, disabling it

I suspect I know, but what does /proc/net/bonding/bond0 look like?

[...]
> And meanwhile,
> [root@localhost ~]# tcpdump -i bond0 -p arp
> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
> listening on bond0, link-type EN10MB (Ethernet), capture size 65535 bytes
> 02:46:56.983092 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:46:57.984040 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:46:58.988442 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:47:00.987340 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:47:01.988136 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:47:02.990033 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:47:04.985086 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:47:05.992368 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:47:06.996727 ARP, Request who-has 192.168.1.100 tell 192.168.1.5,
> length 28
> 02:47:17.231106 ARP, Request who-has dhcp-65-32.nay.redhat.com tell
> dhcp-65-180.nay.redhat.com, length 46
> ^C
> 10 packets captured
> 10 packets received by filter
> 0 packets dropped by kernel
>
>

What does a tcpdump on eth0 look like?  I'm curious if these arp
requests make it there or if the responses are the frames being dropped
(possibly by the connected bridge/switch).

^ permalink raw reply

* Lacking to initialize "IP6CB(skb)->nhoff" for ipv6 transmission ?
From: Eduardo Panisset @ 2011-03-05  3:59 UTC (permalink / raw)
  To: netdev

Hi,

Im using iptables for marking outgoing packets and then divert them to
specific routing tables.
Whenever a flow matches a rule into mangle table it is marked properly
and reaches over the function ip6_route_me_harder.
That function ends up calling xfrm_decode_session and in particular
_decode_session6 for v6 flows.
The latter uses "IP6CB(skb)->nhoff" for locating nextheader value but
on my debugs it was presenting a weird value (96) instead of the
expected (6), since it was a TCP flow.
So I made the decision of initializing "IP6CB(skb)->nhoff" (with the
value offset(struct ipv6hdr, nexthdr) ) in "ip6_xmit" function and
then the (6) started to be shown and the (96) value did not appeared
anymore.
Is this proceeding correct ? (and then that would be a kernel bug ?)

Rgds,
Eduardo Panisset.

^ permalink raw reply

* Re: FYI: tftp-hpa breaks when used on secondary ip addresses
From: David Miller @ 2011-03-05  4:58 UTC (permalink / raw)
  To: hpa; +Cc: ebiederm, netdev, jsing
In-Reply-To: <4D719254.8000903@zytor.com>

From: "H. Peter Anvin" <hpa@zytor.com>
Date: Fri, 04 Mar 2011 17:31:00 -0800

> If this is done for all local connections (as opposed to the ones that
> have been configured explicitly by the administrator to behave that
> way), that's a massive lossage.  Not only does a large number of
> applications use this trick to determine if an address is local (e.g.
> allowing bypass) -- it is pretty much the only portable way to do it --
> but it would cause applications which expect to get a reply back from
> the same address they sent a request to to completely fall on their face.

Actually this is what SOL_IP, IP_PKTINFO, was created for.  Even glibc
uses it.

^ permalink raw reply

* [PATCH] ipv4: Get peer more cheaply in rt_init_metrics().
From: David Miller @ 2011-03-05  5:26 UTC (permalink / raw)
  To: netdev


We know this is a new route object, so doing atomics and
stuff makes no sense at all.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv4/route.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6c87403..9794a2c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1759,9 +1759,9 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
 	if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)
 		create = 1;
 
-	rt_bind_peer(rt, create);
-	peer = rt->peer;
+	rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
 	if (peer) {
+		rt->rt_peer_genid = rt_peer_genid();
 		if (inet_metrics_new(peer))
 			memcpy(peer->metrics, fi->fib_metrics,
 			       sizeof(u32) * RTAX_MAX);
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH] ipv4: Use passed-in protocol in ip_route_newports().
From: David Miller @ 2011-03-05  5:35 UTC (permalink / raw)
  To: netdev


Signed-off-by: David S. Miller <davem@davemloft.net>
---
 include/net/route.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/net/route.h b/include/net/route.h
index 60daf74..8905d90 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -217,7 +217,7 @@ static inline struct rtable *ip_route_newports(struct rtable *rt,
 				    .fl4_dst = rt->fl.fl4_dst,
 				    .fl4_src = rt->fl.fl4_src,
 				    .fl4_tos = rt->fl.fl4_tos,
-				    .proto = rt->fl.proto,
+				    .proto = protocol,
 				    .fl_ip_sport = sport,
 				    .fl_ip_dport = dport };
 
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH] ipv4: Set rt->rt_iif more sanely on output routes.
From: David Miller @ 2011-03-05  5:36 UTC (permalink / raw)
  To: netdev


rt->rt_iif is only ever inspected on input routes, for example DCCP
uses this to populate a route lookup flow key when generating replies
to another packet.

Therefore, setting it to anything other than zero on output routes
makes no sense.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv4/route.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 9794a2c..602473c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2381,7 +2381,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
 	rth->fl.mark    = oldflp->mark;
 	rth->rt_dst	= fl->fl4_dst;
 	rth->rt_src	= fl->fl4_src;
-	rth->rt_iif	= oldflp->oif ? : dev_out->ifindex;
+	rth->rt_iif	= 0;
 	/* get references to the devices that are to be hold by the routing
 	   cache entry */
 	rth->dst.dev	= dev_out;
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH] ipv4: Remove flowi from struct rtable.
From: David Miller @ 2011-03-05  6:12 UTC (permalink / raw)
  To: netdev


The only necessary parts are the src/dst addresses, the
interface indexes, the TOS, and the mark.

The rest is unnecessary bloat, which amounts to nearly
50 bytes on 64-bit.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 include/net/route.h     |   22 ++++---
 net/ipv4/icmp.c         |    2 +-
 net/ipv4/ipmr.c         |   52 +++++++++++++----
 net/ipv4/route.c        |  153 +++++++++++++++++++++++++---------------------
 net/ipv4/xfrm4_policy.c |    7 ++-
 net/sched/cls_route.c   |    2 +-
 net/sched/em_meta.c     |    2 +-
 7 files changed, 146 insertions(+), 94 deletions(-)

diff --git a/include/net/route.h b/include/net/route.h
index 8905d90..9257f5f 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -53,16 +53,20 @@ struct fib_info;
 struct rtable {
 	struct dst_entry	dst;
 
-	/* Cache lookup keys */
-	struct flowi		fl;
+	/* Lookup key. */
+	__be32			rt_key_dst;
+	__be32			rt_key_src;
 
 	int			rt_genid;
 	unsigned		rt_flags;
 	__u16			rt_type;
+	__u8			rt_tos;
 
 	__be32			rt_dst;	/* Path destination	*/
 	__be32			rt_src;	/* Path source		*/
 	int			rt_iif;
+	int			rt_oif;
+	__u32			rt_mark;
 
 	/* Info on neighbour */
 	__be32			rt_gateway;
@@ -76,12 +80,12 @@ struct rtable {
 
 static inline bool rt_is_input_route(struct rtable *rt)
 {
-	return rt->fl.iif != 0;
+	return rt->rt_iif != 0;
 }
 
 static inline bool rt_is_output_route(struct rtable *rt)
 {
-	return rt->fl.iif == 0;
+	return rt->rt_iif == 0;
 }
 
 struct ip_rt_acct {
@@ -212,11 +216,11 @@ static inline struct rtable *ip_route_newports(struct rtable *rt,
 					       __be16 dport, struct sock *sk)
 {
 	if (sport != orig_sport || dport != orig_dport) {
-		struct flowi fl = { .oif = rt->fl.oif,
-				    .mark = rt->fl.mark,
-				    .fl4_dst = rt->fl.fl4_dst,
-				    .fl4_src = rt->fl.fl4_src,
-				    .fl4_tos = rt->fl.fl4_tos,
+		struct flowi fl = { .oif = rt->rt_oif,
+				    .mark = rt->rt_mark,
+				    .fl4_dst = rt->rt_key_dst,
+				    .fl4_src = rt->rt_key_src,
+				    .fl4_tos = rt->rt_tos,
 				    .proto = protocol,
 				    .fl_ip_sport = sport,
 				    .fl_ip_dport = dport };
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 994a785..1771ce6 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -563,7 +563,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
 		rcu_read_lock();
 		if (rt_is_input_route(rt) &&
 		    net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr)
-			dev = dev_get_by_index_rcu(net, rt->fl.iif);
+			dev = dev_get_by_index_rcu(net, rt->rt_iif);
 
 		if (dev)
 			saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK);
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 26ca2f2..9d5f634 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1813,12 +1813,22 @@ int ip_mr_input(struct sk_buff *skb)
 	if (IPCB(skb)->flags & IPSKB_FORWARDED)
 		goto dont_forward;
 
-	err = ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt);
-	if (err < 0) {
-		kfree_skb(skb);
-		return err;
+	{
+		struct rtable *rt = skb_rtable(skb);
+		struct flowi fl = {
+			.fl4_dst = rt->rt_key_dst,
+			.fl4_src = rt->rt_key_src,
+			.fl4_tos = rt->rt_tos,
+			.oif = rt->rt_oif,
+			.iif = rt->rt_iif,
+			.mark = rt->rt_mark,
+		};
+		err = ipmr_fib_lookup(net, &fl, &mrt);
+		if (err < 0) {
+			kfree_skb(skb);
+			return err;
+		}
 	}
-
 	if (!local) {
 		if (IPCB(skb)->opt.router_alert) {
 			if (ip_call_ra_chain(skb))
@@ -1946,9 +1956,19 @@ int pim_rcv_v1(struct sk_buff *skb)
 
 	pim = igmp_hdr(skb);
 
-	if (ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt) < 0)
-		goto drop;
-
+	{
+		struct rtable *rt = skb_rtable(skb);
+		struct flowi fl = {
+			.fl4_dst = rt->rt_key_dst,
+			.fl4_src = rt->rt_key_src,
+			.fl4_tos = rt->rt_tos,
+			.oif = rt->rt_oif,
+			.iif = rt->rt_iif,
+			.mark = rt->rt_mark,
+		};
+		if (ipmr_fib_lookup(net, &fl, &mrt) < 0)
+			goto drop;
+	}
 	if (!mrt->mroute_do_pim ||
 	    pim->group != PIM_V1_VERSION || pim->code != PIM_V1_REGISTER)
 		goto drop;
@@ -1978,9 +1998,19 @@ static int pim_rcv(struct sk_buff *skb)
 	     csum_fold(skb_checksum(skb, 0, skb->len, 0))))
 		goto drop;
 
-	if (ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt) < 0)
-		goto drop;
-
+	{
+		struct rtable *rt = skb_rtable(skb);
+		struct flowi fl = {
+			.fl4_dst = rt->rt_key_dst,
+			.fl4_src = rt->rt_key_src,
+			.fl4_tos = rt->rt_tos,
+			.oif = rt->rt_oif,
+			.iif = rt->rt_iif,
+			.mark = rt->rt_mark,
+		};
+		if (ipmr_fib_lookup(net, &fl, &mrt) < 0)
+			goto drop;
+	}
 	if (__pim_rcv(mrt, skb, sizeof(*pim))) {
 drop:
 		kfree_skb(skb);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 602473c..92a24ea 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -424,7 +424,7 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v)
 			dst_metric(&r->dst, RTAX_WINDOW),
 			(int)((dst_metric(&r->dst, RTAX_RTT) >> 3) +
 			      dst_metric(&r->dst, RTAX_RTTVAR)),
-			r->fl.fl4_tos,
+			r->rt_tos,
 			r->dst.hh ? atomic_read(&r->dst.hh->hh_refcnt) : -1,
 			r->dst.hh ? (r->dst.hh->hh_output ==
 				       dev_queue_xmit) : 0,
@@ -711,22 +711,22 @@ static inline bool rt_caching(const struct net *net)
 		net->ipv4.sysctl_rt_cache_rebuild_count;
 }
 
-static inline bool compare_hash_inputs(const struct flowi *fl1,
-					const struct flowi *fl2)
+static inline bool compare_hash_inputs(const struct rtable *rt1,
+				       const struct rtable *rt2)
 {
-	return ((((__force u32)fl1->fl4_dst ^ (__force u32)fl2->fl4_dst) |
-		((__force u32)fl1->fl4_src ^ (__force u32)fl2->fl4_src) |
-		(fl1->iif ^ fl2->iif)) == 0);
+	return ((((__force u32)rt1->rt_key_dst ^ (__force u32)rt2->rt_key_dst) |
+		((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) |
+		(rt1->rt_iif ^ rt2->rt_iif)) == 0);
 }
 
-static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
+static inline int compare_keys(struct rtable *rt1, struct rtable *rt2)
 {
-	return (((__force u32)fl1->fl4_dst ^ (__force u32)fl2->fl4_dst) |
-		((__force u32)fl1->fl4_src ^ (__force u32)fl2->fl4_src) |
-		(fl1->mark ^ fl2->mark) |
-		(*(u16 *)&fl1->fl4_tos ^ *(u16 *)&fl2->fl4_tos) |
-		(fl1->oif ^ fl2->oif) |
-		(fl1->iif ^ fl2->iif)) == 0;
+	return (((__force u32)rt1->rt_key_dst ^ (__force u32)rt2->rt_key_dst) |
+		((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) |
+		(rt1->rt_mark ^ rt2->rt_mark) |
+		(rt1->rt_tos ^ rt2->rt_tos) |
+		(rt1->rt_oif ^ rt2->rt_oif) |
+		(rt1->rt_iif ^ rt2->rt_iif)) == 0;
 }
 
 static inline int compare_netns(struct rtable *rt1, struct rtable *rt2)
@@ -813,7 +813,7 @@ static int has_noalias(const struct rtable *head, const struct rtable *rth)
 	const struct rtable *aux = head;
 
 	while (aux != rth) {
-		if (compare_hash_inputs(&aux->fl, &rth->fl))
+		if (compare_hash_inputs(aux, rth))
 			return 0;
 		aux = rcu_dereference_protected(aux->dst.rt_next, 1);
 	}
@@ -1073,7 +1073,7 @@ restart:
 			rt_free(rth);
 			continue;
 		}
-		if (compare_keys(&rth->fl, &rt->fl) && compare_netns(rth, rt)) {
+		if (compare_keys(rth, rt) && compare_netns(rth, rt)) {
 			/* Put it first */
 			*rthp = rth->dst.rt_next;
 			/*
@@ -1136,7 +1136,7 @@ restart:
 			rt_emergency_hash_rebuild(net);
 			spin_unlock_bh(rt_hash_lock_addr(hash));
 
-			hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src,
+			hash = rt_hash(rt->rt_key_dst, rt->rt_key_src,
 					ifindex, rt_genid(net));
 			goto restart;
 		}
@@ -1344,12 +1344,12 @@ static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst)
 			ip_rt_put(rt);
 			ret = NULL;
 		} else if (rt->rt_flags & RTCF_REDIRECTED) {
-			unsigned hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src,
-						rt->fl.oif,
+			unsigned hash = rt_hash(rt->rt_key_dst, rt->rt_key_src,
+						rt->rt_oif,
 						rt_genid(dev_net(dst->dev)));
 #if RT_CACHE_DEBUG >= 1
 			printk(KERN_DEBUG "ipv4_negative_advice: redirect to %pI4/%02x dropped\n",
-				&rt->rt_dst, rt->fl.fl4_tos);
+				&rt->rt_dst, rt->rt_tos);
 #endif
 			rt_del(hash, rt);
 			ret = NULL;
@@ -1697,8 +1697,17 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
 	if (rt_is_output_route(rt))
 		src = rt->rt_src;
 	else {
+		struct flowi fl = {
+			.fl4_dst = rt->rt_key_dst,
+			.fl4_src = rt->rt_key_src,
+			.fl4_tos = rt->rt_tos,
+			.oif = rt->rt_oif,
+			.iif = rt->rt_iif,
+			.mark = rt->rt_mark,
+		};
+
 		rcu_read_lock();
-		if (fib_lookup(dev_net(rt->dst.dev), &rt->fl, &res) == 0)
+		if (fib_lookup(dev_net(rt->dst.dev), &fl, &res) == 0)
 			src = FIB_RES_PREFSRC(res);
 		else
 			src = inet_select_addr(rt->dst.dev, rt->rt_gateway,
@@ -1748,7 +1757,8 @@ static unsigned int ipv4_default_mtu(const struct dst_entry *dst)
 	return mtu;
 }
 
-static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
+static void rt_init_metrics(struct rtable *rt, const struct flowi *oldflp,
+			    struct fib_info *fi)
 {
 	struct inet_peer *peer;
 	int create = 0;
@@ -1756,7 +1766,7 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
 	/* If a peer entry exists for this destination, we must hook
 	 * it up in order to get at cached metrics.
 	 */
-	if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)
+	if (oldflp && (oldflp->flags & FLOWI_FLAG_PRECOW_METRICS))
 		create = 1;
 
 	rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
@@ -1783,7 +1793,8 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
 	}
 }
 
-static void rt_set_nexthop(struct rtable *rt, const struct fib_result *res,
+static void rt_set_nexthop(struct rtable *rt, const struct flowi *oldflp,
+			   const struct fib_result *res,
 			   struct fib_info *fi, u16 type, u32 itag)
 {
 	struct dst_entry *dst = &rt->dst;
@@ -1792,7 +1803,7 @@ static void rt_set_nexthop(struct rtable *rt, const struct fib_result *res,
 		if (FIB_RES_GW(*res) &&
 		    FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK)
 			rt->rt_gateway = FIB_RES_GW(*res);
-		rt_init_metrics(rt, fi);
+		rt_init_metrics(rt, oldflp, fi);
 #ifdef CONFIG_IP_ROUTE_CLASSID
 		dst->tclassid = FIB_RES_NH(*res).nh_tclassid;
 #endif
@@ -1861,20 +1872,19 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
 
 	rth->dst.output = ip_rt_bug;
 
-	rth->fl.fl4_dst	= daddr;
+	rth->rt_key_dst	= daddr;
 	rth->rt_dst	= daddr;
-	rth->fl.fl4_tos	= tos;
-	rth->fl.mark    = skb->mark;
-	rth->fl.fl4_src	= saddr;
+	rth->rt_tos	= tos;
+	rth->rt_mark    = skb->mark;
+	rth->rt_key_src	= saddr;
 	rth->rt_src	= saddr;
 #ifdef CONFIG_IP_ROUTE_CLASSID
 	rth->dst.tclassid = itag;
 #endif
-	rth->rt_iif	=
-	rth->fl.iif	= dev->ifindex;
+	rth->rt_iif	= dev->ifindex;
 	rth->dst.dev	= init_net.loopback_dev;
 	dev_hold(rth->dst.dev);
-	rth->fl.oif	= 0;
+	rth->rt_oif	= 0;
 	rth->rt_gateway	= daddr;
 	rth->rt_spec_dst= spec_dst;
 	rth->rt_genid	= rt_genid(dev_net(dev));
@@ -1999,25 +2009,24 @@ static int __mkroute_input(struct sk_buff *skb,
 		goto cleanup;
 	}
 
-	rth->fl.fl4_dst	= daddr;
+	rth->rt_key_dst	= daddr;
 	rth->rt_dst	= daddr;
-	rth->fl.fl4_tos	= tos;
-	rth->fl.mark    = skb->mark;
-	rth->fl.fl4_src	= saddr;
+	rth->rt_tos	= tos;
+	rth->rt_mark    = skb->mark;
+	rth->rt_key_src	= saddr;
 	rth->rt_src	= saddr;
 	rth->rt_gateway	= daddr;
-	rth->rt_iif 	=
-		rth->fl.iif	= in_dev->dev->ifindex;
+	rth->rt_iif 	= in_dev->dev->ifindex;
 	rth->dst.dev	= (out_dev)->dev;
 	dev_hold(rth->dst.dev);
-	rth->fl.oif 	= 0;
+	rth->rt_oif 	= 0;
 	rth->rt_spec_dst= spec_dst;
 
 	rth->dst.input = ip_forward;
 	rth->dst.output = ip_output;
 	rth->rt_genid = rt_genid(dev_net(rth->dst.dev));
 
-	rt_set_nexthop(rth, res, res->fi, res->type, itag);
+	rt_set_nexthop(rth, NULL, res, res->fi, res->type, itag);
 
 	rth->rt_flags = flags;
 
@@ -2172,17 +2181,16 @@ local_input:
 	rth->dst.output= ip_rt_bug;
 	rth->rt_genid = rt_genid(net);
 
-	rth->fl.fl4_dst	= daddr;
+	rth->rt_key_dst	= daddr;
 	rth->rt_dst	= daddr;
-	rth->fl.fl4_tos	= tos;
-	rth->fl.mark    = skb->mark;
-	rth->fl.fl4_src	= saddr;
+	rth->rt_tos	= tos;
+	rth->rt_mark    = skb->mark;
+	rth->rt_key_src	= saddr;
 	rth->rt_src	= saddr;
 #ifdef CONFIG_IP_ROUTE_CLASSID
 	rth->dst.tclassid = itag;
 #endif
-	rth->rt_iif	=
-	rth->fl.iif	= dev->ifindex;
+	rth->rt_iif	= dev->ifindex;
 	rth->dst.dev	= net->loopback_dev;
 	dev_hold(rth->dst.dev);
 	rth->rt_gateway	= daddr;
@@ -2261,12 +2269,12 @@ int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr,
 
 	for (rth = rcu_dereference(rt_hash_table[hash].chain); rth;
 	     rth = rcu_dereference(rth->dst.rt_next)) {
-		if ((((__force u32)rth->fl.fl4_dst ^ (__force u32)daddr) |
-		     ((__force u32)rth->fl.fl4_src ^ (__force u32)saddr) |
-		     (rth->fl.iif ^ iif) |
-		     rth->fl.oif |
-		     (rth->fl.fl4_tos ^ tos)) == 0 &&
-		    rth->fl.mark == skb->mark &&
+		if ((((__force u32)rth->rt_key_dst ^ (__force u32)daddr) |
+		     ((__force u32)rth->rt_key_src ^ (__force u32)saddr) |
+		     (rth->rt_iif ^ iif) |
+		     rth->rt_oif |
+		     (rth->rt_tos ^ tos)) == 0 &&
+		    rth->rt_mark == skb->mark &&
 		    net_eq(dev_net(rth->dst.dev), net) &&
 		    !rt_is_expired(rth)) {
 			if (noref) {
@@ -2374,11 +2382,11 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
 	if (!rth)
 		return ERR_PTR(-ENOBUFS);
 
-	rth->fl.fl4_dst	= oldflp->fl4_dst;
-	rth->fl.fl4_tos	= tos;
-	rth->fl.fl4_src	= oldflp->fl4_src;
-	rth->fl.oif	= oldflp->oif;
-	rth->fl.mark    = oldflp->mark;
+	rth->rt_key_dst	= oldflp->fl4_dst;
+	rth->rt_tos	= tos;
+	rth->rt_key_src	= oldflp->fl4_src;
+	rth->rt_oif	= oldflp->oif;
+	rth->rt_mark    = oldflp->mark;
 	rth->rt_dst	= fl->fl4_dst;
 	rth->rt_src	= fl->fl4_src;
 	rth->rt_iif	= 0;
@@ -2416,7 +2424,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
 #endif
 	}
 
-	rt_set_nexthop(rth, res, fi, type, 0);
+	rt_set_nexthop(rth, oldflp, res, fi, type, 0);
 
 	rth->rt_flags = flags;
 	return rth;
@@ -2629,12 +2637,12 @@ struct rtable *__ip_route_output_key(struct net *net, const struct flowi *flp)
 	rcu_read_lock_bh();
 	for (rth = rcu_dereference_bh(rt_hash_table[hash].chain); rth;
 		rth = rcu_dereference_bh(rth->dst.rt_next)) {
-		if (rth->fl.fl4_dst == flp->fl4_dst &&
-		    rth->fl.fl4_src == flp->fl4_src &&
+		if (rth->rt_key_dst == flp->fl4_dst &&
+		    rth->rt_key_src == flp->fl4_src &&
 		    rt_is_output_route(rth) &&
-		    rth->fl.oif == flp->oif &&
-		    rth->fl.mark == flp->mark &&
-		    !((rth->fl.fl4_tos ^ flp->fl4_tos) &
+		    rth->rt_oif == flp->oif &&
+		    rth->rt_mark == flp->mark &&
+		    !((rth->rt_tos ^ flp->fl4_tos) &
 			    (IPTOS_RT_MASK | RTO_ONLINK)) &&
 		    net_eq(dev_net(rth->dst.dev), net) &&
 		    !rt_is_expired(rth)) {
@@ -2693,7 +2701,12 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
 		if (new->dev)
 			dev_hold(new->dev);
 
-		rt->fl = ort->fl;
+		rt->rt_key_dst = ort->rt_key_dst;
+		rt->rt_key_src = ort->rt_key_src;
+		rt->rt_tos = ort->rt_tos;
+		rt->rt_iif = ort->rt_iif;
+		rt->rt_oif = ort->rt_oif;
+		rt->rt_mark = ort->rt_mark;
 
 		rt->rt_genid = rt_genid(net);
 		rt->rt_flags = ort->rt_flags;
@@ -2756,7 +2769,7 @@ static int rt_fill_info(struct net *net,
 	r->rtm_family	 = AF_INET;
 	r->rtm_dst_len	= 32;
 	r->rtm_src_len	= 0;
-	r->rtm_tos	= rt->fl.fl4_tos;
+	r->rtm_tos	= rt->rt_tos;
 	r->rtm_table	= RT_TABLE_MAIN;
 	NLA_PUT_U32(skb, RTA_TABLE, RT_TABLE_MAIN);
 	r->rtm_type	= rt->rt_type;
@@ -2768,9 +2781,9 @@ static int rt_fill_info(struct net *net,
 
 	NLA_PUT_BE32(skb, RTA_DST, rt->rt_dst);
 
-	if (rt->fl.fl4_src) {
+	if (rt->rt_key_src) {
 		r->rtm_src_len = 32;
-		NLA_PUT_BE32(skb, RTA_SRC, rt->fl.fl4_src);
+		NLA_PUT_BE32(skb, RTA_SRC, rt->rt_key_src);
 	}
 	if (rt->dst.dev)
 		NLA_PUT_U32(skb, RTA_OIF, rt->dst.dev->ifindex);
@@ -2780,7 +2793,7 @@ static int rt_fill_info(struct net *net,
 #endif
 	if (rt_is_input_route(rt))
 		NLA_PUT_BE32(skb, RTA_PREFSRC, rt->rt_spec_dst);
-	else if (rt->rt_src != rt->fl.fl4_src)
+	else if (rt->rt_src != rt->rt_key_src)
 		NLA_PUT_BE32(skb, RTA_PREFSRC, rt->rt_src);
 
 	if (rt->rt_dst != rt->rt_gateway)
@@ -2789,8 +2802,8 @@ static int rt_fill_info(struct net *net,
 	if (rtnetlink_put_metrics(skb, dst_metrics_ptr(&rt->dst)) < 0)
 		goto nla_put_failure;
 
-	if (rt->fl.mark)
-		NLA_PUT_BE32(skb, RTA_MARK, rt->fl.mark);
+	if (rt->rt_mark)
+		NLA_PUT_BE32(skb, RTA_MARK, rt->rt_mark);
 
 	error = rt->dst.error;
 	expires = (rt->peer && rt->peer->pmtu_expires) ?
@@ -2824,7 +2837,7 @@ static int rt_fill_info(struct net *net,
 			}
 		} else
 #endif
-			NLA_PUT_U32(skb, RTA_IIF, rt->fl.iif);
+			NLA_PUT_U32(skb, RTA_IIF, rt->rt_iif);
 	}
 
 	if (rtnl_put_cacheinfo(skb, &rt->dst, id, ts, tsage,
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 45b8214..c70c42e 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -70,7 +70,12 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
 {
 	struct rtable *rt = (struct rtable *)xdst->route;
 
-	xdst->u.rt.fl = *fl;
+	rt->rt_key_dst = fl->fl4_dst;
+	rt->rt_key_src = fl->fl4_src;
+	rt->rt_tos = fl->fl4_tos;
+	rt->rt_iif = fl->iif;
+	rt->rt_oif = fl->oif;
+	rt->rt_mark = fl->mark;
 
 	xdst->u.dst.dev = dev;
 	dev_hold(dev);
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index d580cdf..a9079053 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -143,7 +143,7 @@ static int route4_classify(struct sk_buff *skb, struct tcf_proto *tp,
 	if (head == NULL)
 		goto old_method;
 
-	iif = ((struct rtable *)dst)->fl.iif;
+	iif = ((struct rtable *)dst)->rt_iif;
 
 	h = route4_fastmap_hash(id, iif);
 	if (id == head->fastmap[h].id &&
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c
index e5e1747..a4de67e 100644
--- a/net/sched/em_meta.c
+++ b/net/sched/em_meta.c
@@ -264,7 +264,7 @@ META_COLLECTOR(int_rtiif)
 	if (unlikely(skb_rtable(skb) == NULL))
 		*err = -1;
 	else
-		dst->value = skb_rtable(skb)->fl.iif;
+		dst->value = skb_rtable(skb)->rt_iif;
 }
 
 /**************************************************************************
-- 
1.7.4.1


^ permalink raw reply related

* Re: [PATCH] ipv4: Get peer more cheaply in rt_init_metrics().
From: Eric Dumazet @ 2011-03-05  6:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20110304.212636.226786422.davem@davemloft.net>

Le vendredi 04 mars 2011 à 21:26 -0800, David Miller  écrit :
> We know this is a new route object, so doing atomics and
> stuff makes no sense at all.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  net/ipv4/route.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 6c87403..9794a2c 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1759,9 +1759,9 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
>  	if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)
>  		create = 1;
>  
> -	rt_bind_peer(rt, create);
> -	peer = rt->peer;
> +	rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
>  	if (peer) {
> +		rt->rt_peer_genid = rt_peer_genid();
>  		if (inet_metrics_new(peer))
>  			memcpy(peer->metrics, fi->fib_metrics,
>  			       sizeof(u32) * RTAX_MAX);

Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>



^ permalink raw reply

* Re: [PATCH] ipv4: Use passed-in protocol in ip_route_newports().
From: Eric Dumazet @ 2011-03-05  6:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20110304.213553.71108798.davem@davemloft.net>

Le vendredi 04 mars 2011 à 21:35 -0800, David Miller a écrit :
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  include/net/route.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/net/route.h b/include/net/route.h
> index 60daf74..8905d90 100644
> --- a/include/net/route.h
> +++ b/include/net/route.h
> @@ -217,7 +217,7 @@ static inline struct rtable *ip_route_newports(struct rtable *rt,
>  				    .fl4_dst = rt->fl.fl4_dst,
>  				    .fl4_src = rt->fl.fl4_src,
>  				    .fl4_tos = rt->fl.fl4_tos,
> -				    .proto = rt->fl.proto,
> +				    .proto = protocol,
>  				    .fl_ip_sport = sport,
>  				    .fl_ip_dport = dport };
>  

Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>




^ permalink raw reply

* Re: [PATCH] ipv4: Set rt->rt_iif more sanely on output routes.
From: Eric Dumazet @ 2011-03-05  6:52 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20110304.213625.104050222.davem@davemloft.net>

Le vendredi 04 mars 2011 à 21:36 -0800, David Miller a écrit :
> rt->rt_iif is only ever inspected on input routes, for example DCCP
> uses this to populate a route lookup flow key when generating replies
> to another packet.
> 
> Therefore, setting it to anything other than zero on output routes
> makes no sense.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  net/ipv4/route.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 9794a2c..602473c 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2381,7 +2381,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
>  	rth->fl.mark    = oldflp->mark;
>  	rth->rt_dst	= fl->fl4_dst;
>  	rth->rt_src	= fl->fl4_src;
> -	rth->rt_iif	= oldflp->oif ? : dev_out->ifindex;
> +	rth->rt_iif	= 0;
>  	/* get references to the devices that are to be hold by the routing
>  	   cache entry */
>  	rth->dst.dev	= dev_out;

Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>



^ permalink raw reply

* Re: [PATCH] ipv4: Remove flowi from struct rtable.
From: Eric Dumazet @ 2011-03-05  6:59 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20110304.221214.189707201.davem@davemloft.net>

Le vendredi 04 mars 2011 à 22:12 -0800, David Miller a écrit :
> The only necessary parts are the src/dst addresses, the
> interface indexes, the TOS, and the mark.
> 
> The rest is unnecessary bloat, which amounts to nearly
> 50 bytes on 64-bit.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---



> +		struct rtable *rt = skb_rtable(skb);
> +		struct flowi fl = {
> +			.fl4_dst = rt->rt_key_dst,
> +			.fl4_src = rt->rt_key_src,
> +			.fl4_tos = rt->rt_tos,
> +			.oif = rt->rt_oif,
> +			.iif = rt->rt_iif,
> +			.mark = rt->rt_mark,
> +		};

Eventually we could have a helper for this, as this is done three times
in this file. Or maybe you have further plans for ipmr ?



^ permalink raw reply

* [PATCH] ixgbe: fix for 82599 erratum on Header Splitting
From: Jeff Kirsher @ 2011-03-05  7:06 UTC (permalink / raw)
  To: gregkh; +Cc: Don Skidmore, stable, netdev, Jeff Kirsher

From: Don Skidmore <donald.c.skidmore@intel.com>

We have found a hardware erratum on 82599 hardware that can lead to
unpredictable behavior when Header Splitting mode is enabled.  So
we are no longer enabling this feature on affected hardware.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ixgbe/ixgbe_main.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a873c5d..67d1d97 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2131,6 +2131,10 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
 	/* Decide whether to use packet split mode or not */
 	adapter->flags |= IXGBE_FLAG_RX_PS_ENABLED;
 
+	/* Disable packet split due to 82599 erratum #45 */
+	if (hw->mac.type == ixgbe_mac_82599EB)
+		adapter->flags &= ~IXGBE_FLAG_RX_PS_ENABLED;
+
 	/* Set the RX buffer length according to the mode */
 	if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) {
 		rx_buf_len = IXGBE_RX_HDR_SIZE;
-- 
1.7.4


^ permalink raw reply related

* Re: [PATCH] ipv4: Remove flowi from struct rtable.
From: David Miller @ 2011-03-05  7:09 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1299308388.2758.71.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 05 Mar 2011 07:59:48 +0100

> Eventually we could have a helper for this, as this is done three times
> in this file. Or maybe you have further plans for ipmr ?

No immediate plans, so yes I'll make a helper, good idea.

^ permalink raw reply

* [PATCH] ethtool: remove mask for Auto in advertise section
From: Jeff Kirsher @ 2011-03-05  7:27 UTC (permalink / raw)
  To: bhutchings; +Cc: Emil Tantilov, netdev, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

The mask for Auto in the advertise section is incorrect for any interface
that supports speeds > 1000Mbps. Since the description already states that
the mask can be a combination of the supported values it's probably better
to just remove it. 'Auto' was misleading anyway.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 ethtool.8.in |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/ethtool.8.in b/ethtool.8.in
index 0ee91a0..d7bcc51 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -516,8 +516,6 @@ a hexadecimal value using one or a combination of the following values:
 .BR "0x8000" "   2500 Full" "(not supported by IEEE standards)"
 .TP 3
 .BR "0x1000" "   10000 Full"
-.TP 3
-.BR "0x03F" "    Auto"
 .PD
 .RE
 .TP
-- 
1.7.4


^ permalink raw reply related

* Re: [PATCH] ixgbe: fix for 82599 erratum on Header Splitting
From: Greg KH @ 2011-03-05  7:44 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Don Skidmore, stable, netdev
In-Reply-To: <1299308767-28735-1-git-send-email-jeffrey.t.kirsher@intel.com>

On Fri, Mar 04, 2011 at 11:06:07PM -0800, Jeff Kirsher wrote:
> From: Don Skidmore <donald.c.skidmore@intel.com>
> 
> We have found a hardware erratum on 82599 hardware that can lead to
> unpredictable behavior when Header Splitting mode is enabled.  So
> we are no longer enabling this feature on affected hardware.
> 
> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
> Tested-by: Stephen Ko <stephen.s.ko@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_main.c |    4 ++++

I'm confused, why did you just send this patch to me?

What am I supposed to do with it?

greg k-h

^ permalink raw reply

* Re: [PATCH] ixgbe: fix for 82599 erratum on Header Splitting
From: Jeff Kirsher @ 2011-03-05  7:51 UTC (permalink / raw)
  To: Greg KH; +Cc: Skidmore, Donald C, stable@kernel.org, netdev@vger.kernel.org
In-Reply-To: <20110305074419.GA19596@suse.de>

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

On Fri, 2011-03-04 at 23:44 -0800, Greg KH wrote:
> On Fri, Mar 04, 2011 at 11:06:07PM -0800, Jeff Kirsher wrote:
> > From: Don Skidmore <donald.c.skidmore@intel.com>
> > 
> > We have found a hardware erratum on 82599 hardware that can lead to
> > unpredictable behavior when Header Splitting mode is enabled.  So
> > we are no longer enabling this feature on affected hardware.
> > 
> > Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
> > Tested-by: Stephen Ko <stephen.s.ko@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_main.c |    4 ++++
> 
> I'm confused, why did you just send this patch to me?
> 
> What am I supposed to do with it?
> 
> greg k-h

This is the fix for ixgbe (that Ben and others pointed out) which has
been accepted into Linus's tree which did not apply to stable-2.6.32
tree.  This is the updated patch that apply's to the stable-2.6.32 tree.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH] ixgbe: fix for 82599 erratum on Header Splitting
From: Greg KH @ 2011-03-05  7:59 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: Skidmore, Donald C, stable@kernel.org, netdev@vger.kernel.org
In-Reply-To: <1299311467.26413.31.camel@jtkirshe-MOBL1>

On Fri, Mar 04, 2011 at 11:51:07PM -0800, Jeff Kirsher wrote:
> On Fri, 2011-03-04 at 23:44 -0800, Greg KH wrote:
> > On Fri, Mar 04, 2011 at 11:06:07PM -0800, Jeff Kirsher wrote:
> > > From: Don Skidmore <donald.c.skidmore@intel.com>
> > > 
> > > We have found a hardware erratum on 82599 hardware that can lead to
> > > unpredictable behavior when Header Splitting mode is enabled.  So
> > > we are no longer enabling this feature on affected hardware.
> > > 
> > > Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
> > > Tested-by: Stephen Ko <stephen.s.ko@intel.com>
> > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > > ---
> > >  drivers/net/ixgbe/ixgbe_main.c |    4 ++++
> > 
> > I'm confused, why did you just send this patch to me?
> > 
> > What am I supposed to do with it?
> > 
> > greg k-h
> 
> This is the fix for ixgbe (that Ben and others pointed out) which has
> been accepted into Linus's tree which did not apply to stable-2.6.32
> tree.  This is the updated patch that apply's to the stable-2.6.32 tree.

How nice, but why didn't you say so in the first place?  Am I really
supposed to remember the hundreds of stable patches I handle every week?

Oh, I need the git commit id of it as well, care to resend this with
that and the proper "please apply this for the .32 longterm tree"
message so I can?

If so, I'll queue it up for the after-next .32-longterm release.

thanks,

greg k-h

^ permalink raw reply

* tun routing is broken [was: tun: Failed to create tun sysfs files]
From: Jiri Slaby @ 2011-03-05  8:04 UTC (permalink / raw)
  To: David Miller; +Cc: Jiri Slaby, linux-kernel, akpm, mm-commits, netdev, maxk
In-Reply-To: <4D70B2DC.2000005@gmail.com>

On 03/04/2011 10:37 AM, Jiri Slaby wrote:
> On 03/04/2011 10:06 AM, David Miller wrote:
>> From: Jiri Slaby <jslaby@suse.cz>
>> Date: Fri, 04 Mar 2011 09:56:09 +0100
>>
>>> On 03/03/2011 01:52 AM, akpm@linux-foundation.org wrote:
>>>> The mm-of-the-moment snapshot 2011-03-02-16-52 has been uploaded to
>>>
>>> Hi, I'm seeing this with tun (also with earlier versions):
>>
>> The name of the attribute was changed to netdev_group in order to
>> fix this problem, in fact quite some time ago.
>>
>> See the last entry of the net_class_attributes array in
>> net/core/net-sysfs.c, if it isn't called "netdev_group"
>> something is awry.
> 
> <idiocy>
> Aha, sorry for the noise, I booted the old kernel.
> </idiocy>

Ok, so I booted the new kernel, and tun is broken there completely. If I
try to ping a vpn peer:
...
capget(0x20080522, 0, NULL)             = 0
capset(0x20080522, 0, {0, 0, 0})        = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(1025),
sin_addr=inet_addr("10.20.11.1")}, 16) = -1 EINVAL (Invalid argument)

the route is:
10.20.11.1 dev tun0  proto kernel  scope link  src 10.20.11.33

When I try to ping a router on eth0 10.0.28.10, it works as expected.

Maybe the changes in ipv4 routing cause this? But my amateur eyes can't
see any breakage there...

Now I'm back in mmotm 2011-02-10-16-26 and it works, indeed.

regards,
-- 
js
suse labs

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox