1. 26 Jul, 2008 1 commit
  2. 25 Jul, 2008 3 commits
  3. 24 Jul, 2008 2 commits
  4. 23 Jul, 2008 15 commits
    • Patrick McHardy's avatar
    • David S. Miller's avatar
      tcp: Clear probes_out more aggressively in tcp_ack(). · 4b53fb67
      David S. Miller authored
      This is based upon an excellent bug report from Eric Dumazet.
      
      tcp_ack() should clear ->icsk_probes_out even if there are packets
      outstanding.  Otherwise if we get a sequence of ACKs while we do have
      packets outstanding over and over again, we'll never clear the
      probes_out value and eventually think the connection is too sick and
      we'll reset it.
      
      This appears to be some "optimization" added to tcp_ack() in the 2.4.x
      timeframe.  In 2.2.x, probes_out is pretty much always cleared by
      tcp_ack().
      
      Here is Eric's original report:
      
      ----------------------------------------
      Apparently, we can in some situations reset TCP connections in a couple of seconds when some frames are lost.
      
      In order to reproduce the problem, please try the following program on linux-2.6.25.*
      
      Setup some iptables rules to allow two frames per second sent on loopback interface to tcp destination port 12000
      
      iptables -N SLOWLO
      iptables -A SLOWLO -m hashlimit --hashlimit 2 --hashlimit-burst 1 --hashlimit-mode dstip --hashlimit-name slow2 -j ACCEPT
      iptables -A SLOWLO -j DROP
      
      iptables -A OUTPUT -o lo -p tcp --dport 12000 -j SLOWLO
      
      Then run the attached program and see the output :
      
      # ./loop
      State      Recv-Q Send-Q                                  Local Address:Port                                    Peer Address:Port
      ESTAB      0      40                                          127.0.0.1:54455                                      127.0.0.1:12000  timer:(persist,200ms,1)
      State      Recv-Q Send-Q                                  Local Address:Port                                    Peer Address:Port
      ESTAB      0      40                                          127.0.0.1:54455                                      127.0.0.1:12000  timer:(persist,200ms,3)
      State      Recv-Q Send-Q                                  Local Address:Port                                    Peer Address:Port
      ESTAB      0      40                                          127.0.0.1:54455                                      127.0.0.1:12000  timer:(persist,200ms,5)
      State      Recv-Q Send-Q                                  Local Address:Port                                    Peer Address:Port
      ESTAB      0      40                                          127.0.0.1:54455                                      127.0.0.1:12000  timer:(persist,200ms,7)
      State      Recv-Q Send-Q                                  Local Address:Port                                    Peer Address:Port
      ESTAB      0      40                                          127.0.0.1:54455                                      127.0.0.1:12000  timer:(persist,200ms,9)
      State      Recv-Q Send-Q                                  Local Address:Port                                    Peer Address:Port
      ESTAB      0      40                                          127.0.0.1:54455                                      127.0.0.1:12000  timer:(persist,200ms,11)
      State      Recv-Q Send-Q                                  Local Address:Port                                    Peer Address:Port
      ESTAB      0      40                                          127.0.0.1:54455                                      127.0.0.1:12000  timer:(persist,201ms,13)
      State      Recv-Q Send-Q                                  Local Address:Port                                    Peer Address:Port
      ESTAB      0      40                                          127.0.0.1:54455                                      127.0.0.1:12000  timer:(persist,188ms,15)
      write(): Connection timed out
      wrote 890 bytes but was interrupted after 9 seconds
      ESTAB      0      0                 127.0.0.1:12000            127.0.0.1:54455
      Exiting read() because no data available (4000 ms timeout).
      read 860 bytes
      
      While this tcp session makes progress (sending frames with 50 bytes of payload, every 500ms), linux tcp stack decides to reset it, when tcp_retries 2 is reached (default value : 15)
      
      tcpdump :
      
      15:30:28.856695 IP 127.0.0.1.56554 > 127.0.0.1.12000: S 33788768:33788768(0) win 32792 <mss 16396,nop,nop,sackOK,nop,wscale 7>
      15:30:28.856711 IP 127.0.0.1.12000 > 127.0.0.1.56554: S 33899253:33899253(0) ack 33788769 win 32792 <mss 16396,nop,nop,sackOK,nop,wscale 7>
      15:30:29.356947 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 1:61(60) ack 1 win 257
      15:30:29.356966 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 61 win 257
      15:30:29.866415 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 61:111(50) ack 1 win 257
      15:30:29.866427 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 111 win 257
      15:30:30.366516 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 111:161(50) ack 1 win 257
      15:30:30.366527 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 161 win 257
      15:30:30.876196 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 161:211(50) ack 1 win 257
      15:30:30.876207 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 211 win 257
      15:30:31.376282 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 211:261(50) ack 1 win 257
      15:30:31.376290 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 261 win 257
      15:30:31.885619 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 261:311(50) ack 1 win 257
      15:30:31.885631 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 311 win 257
      15:30:32.385705 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 311:361(50) ack 1 win 257
      15:30:32.385715 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 361 win 257
      15:30:32.895249 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 361:411(50) ack 1 win 257
      15:30:32.895266 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 411 win 257
      15:30:33.395341 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 411:461(50) ack 1 win 257
      15:30:33.395351 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 461 win 257
      15:30:33.918085 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 461:511(50) ack 1 win 257
      15:30:33.918096 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 511 win 257
      15:30:34.418163 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 511:561(50) ack 1 win 257
      15:30:34.418172 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 561 win 257
      15:30:34.927685 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 561:611(50) ack 1 win 257
      15:30:34.927698 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 611 win 257
      15:30:35.427757 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 611:661(50) ack 1 win 257
      15:30:35.427766 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 661 win 257
      15:30:35.937359 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 661:711(50) ack 1 win 257
      15:30:35.937376 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 711 win 257
      15:30:36.437451 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 711:761(50) ack 1 win 257
      15:30:36.437464 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 761 win 257
      15:30:36.947022 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 761:811(50) ack 1 win 257
      15:30:36.947039 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 811 win 257
      15:30:37.447135 IP 127.0.0.1.56554 > 127.0.0.1.12000: P 811:861(50) ack 1 win 257
      15:30:37.447203 IP 127.0.0.1.12000 > 127.0.0.1.56554: . ack 861 win 257
      15:30:41.448171 IP 127.0.0.1.12000 > 127.0.0.1.56554: F 1:1(0) ack 861 win 257
      15:30:41.448189 IP 127.0.0.1.56554 > 127.0.0.1.12000: R 33789629:33789629(0) win 0
      
      Source of program :
      
      /*
       * small producer/consumer program.
       * setup a listener on 127.0.0.1:12000
       * Forks a child
       *   child connect to 127.0.0.1, and sends 10 bytes on this tcp socket every 100 ms
       * Father accepts connection, and read all data
       */
      #include <sys/types.h>
      #include <sys/socket.h>
      #include <netinet/in.h>
      #include <unistd.h>
      #include <stdio.h>
      #include <time.h>
      #include <sys/poll.h>
      
      int port = 12000;
      char buffer[4096];
      int main(int argc, char *argv[])
      {
              int lfd = socket(AF_INET, SOCK_STREAM, 0);
              struct sockaddr_in socket_address;
              time_t t0, t1;
              int on = 1, sfd, res;
              unsigned long total = 0;
              socklen_t alen = sizeof(socket_address);
              pid_t pid;
      
              time(&t0);
              socket_address.sin_family = AF_INET;
              socket_address.sin_port = htons(port);
              socket_address.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
      
              if (lfd == -1) {
                      perror("socket()");
                      return 1;
              }
              setsockopt(lfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int));
              if (bind(lfd, (struct sockaddr *)&socket_address, sizeof(socket_address)) == -1) {
                      perror("bind");
                      close(lfd);
                      return 1;
              }
              if (listen(lfd, 1) == -1) {
                      perror("listen()");
                      close(lfd);
                      return 1;
              }
              pid = fork();
              if (pid == 0) {
                      int i, cfd = socket(AF_INET, SOCK_STREAM, 0);
                      close(lfd);
                      if (connect(cfd, (struct sockaddr *)&socket_address, sizeof(socket_address)) == -1) {
                              perror("connect()");
                              return 1;
                              }
                      for (i = 0 ; ;) {
                              res = write(cfd, "blablabla\n", 10);
                              if (res > 0) total += res;
                              else if (res == -1) {
                                      perror("write()");
                                      break;
                              } else break;
                              usleep(100000);
                              if (++i == 10) {
                                      system("ss -on dst 127.0.0.1:12000");
                                      i = 0;
                              }
                      }
                      time(&t1);
                      fprintf(stderr, "wrote %lu bytes but was interrupted after %g seconds\n", total, difftime(t1, t0));
                      system("ss -on | grep 127.0.0.1:12000");
                      close(cfd);
                      return 0;
              }
              sfd = accept(lfd, (struct sockaddr *)&socket_address, &alen);
              if (sfd == -1) {
                      perror("accept");
                      return 1;
              }
              close(lfd);
              while (1) {
                      struct pollfd pfd[1];
                      pfd[0].fd = sfd;
                      pfd[0].events = POLLIN;
                      if (poll(pfd, 1, 4000) == 0) {
                              fprintf(stderr, "Exiting read() because no data available (4000 ms timeout).\n");
                              break;
                      }
                      res = read(sfd, buffer, sizeof(buffer));
                      if (res > 0) total += res;
                      else if (res == 0) break;
                      else perror("read()");
              }
              fprintf(stderr, "read %lu bytes\n", total);
              close(sfd);
              return 0;
      }
      ----------------------------------------
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b53fb67
    • Ingo Molnar's avatar
      e1000e: fix e1000_netpoll(), remove extraneous e1000_clean_tx_irq() call · e8ebe3b8
      Ingo Molnar authored
      Evgeniy Polyakov noticed that drivers/net/e1000e/netdev.c:e1000_netpoll()
      was calling e1000_clean_tx_irq() without taking the TX lock.
      
      David Miller suggested to remove the call altogether: since in this
      callpah there's periodic calls to ->poll() anyway which will do
      e1000_clean_tx_irq() and will garbage-collect any finished TX ring
      descriptors.
      
      This fix solved the e1000e+netconsole crashes i've been seeing:
      
      =============================================================================
      BUG skbuff_head_cache: Poison overwritten
      -----------------------------------------------------------------------------
      
      INFO: 0xf658ae9c-0xf658ae9c. First byte 0x6a instead of 0x6b
      INFO: Allocated in __alloc_skb+0x2c/0x110 age=0 cpu=0 pid=5098
      INFO: Freed in __kfree_skb+0x31/0x80 age=0 cpu=1 pid=4440
      INFO: Slab 0xc16cc140 objects=16 used=1 fp=0xf658ae00 flags=0x400000c3
      INFO: Object 0xf658ae00 @offset=3584 fp=0xf658af00
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8ebe3b8
    • Oliver Hartkopp's avatar
      net: Update entry in af_family_clock_key_strings · b4942af6
      Oliver Hartkopp authored
      In the merge phase of the CAN subsystem the 
      af_family_clock_key_strings[] have been added to sock.c in commit 
      443aef0e 
      (lockdep: fixup sk_callback_lock annotation). This trivial patch adds 
      the missing name for address family 29 (AF_CAN).
      Signed-off-by: default avatarOliver Hartkopp <oliver@hartkopp.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4942af6
    • David S. Miller's avatar
      netdev: Remove warning from __netif_schedule(). · 5b3ab1db
      David S. Miller authored
      It isn't helping anything and we aren't going to be able to change all
      the drivers that do queue wakeups in strange situations.
      
      Just letting a noop_qdisc get scheduled will work because when
      qdisc_run() executes via net_tx_work() it will simply find no packets
      pending when it makes the ->dequeue() call in qdisc_restart.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b3ab1db
    • Stephen Hemminger's avatar
      sky2: don't stop queue on shutdown · 8a6d2ea0
      Stephen Hemminger authored
      It is unnecessary, to stop queue and turn off carrier in shutdown
      routine. With new netdev_queue this causes warnings.
      Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a6d2ea0
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · c010b2f7
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (82 commits)
        ipw2200: Call netif_*_queue() interfaces properly.
        netxen: Needs to include linux/vmalloc.h
        [netdrvr] atl1d: fix !CONFIG_PM build
        r6040: rework init_one error handling
        r6040: bump release number to 0.18
        r6040: handle RX fifo full and no descriptor interrupts
        r6040: change the default waiting time
        r6040: use definitions for magic values in descriptor status
        r6040: completely rework the RX path
        r6040: call napi_disable when puting down the interface and set lp->dev accordingly.
        mv643xx_eth: fix NETPOLL build
        r6040: rework the RX buffers allocation routine
        r6040: fix scheduling while atomic in r6040_tx_timeout
        r6040: fix null pointer access and tx timeouts
        r6040: prefix all functions with r6040
        rndis_host: support WM6 devices as modems
        at91_ether: use netstats in net_device structure
        sfc: Create one RX queue and interrupt per CPU package by default
        sfc: Use a separate workqueue for resets
        sfc: I2C adapter initialisation fixes
        ...
      c010b2f7
    • Linus Torvalds's avatar
      Re-delete zombie 'drivers/usb/serial/airprime.c' file · 6069fb2e
      Linus Torvalds authored
      Stephen Rothwell points out that this file got deleted (on purpose) by
      commit 640c1bce ("USB: delete airprime
      driver"), but then almost immediately incorrectly resurrected by commit
      95da310e ("usb_serial: API all change").
      
      Delete it again.  If it comes back, we'll need to drive a stake through
      its heart.
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: default avatarGreg KH <greg@kroah.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6069fb2e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 · e9dd54da
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
        sparc32: pass -m32 when building vmlinux.lds
        sparc: Fixes the DRM layer build on sparc.
        ide: merge <asm-sparc/ide_64.h> with <asm-sparc/ide_32.h>
        ide: <asm-sparc/ide_64.h>: use __raw_{read,write}w()
        ide: <asm-sparc/ide_32.h>: use __raw_{read,write}w()
        ide: <asm-sparc/ide_64.h>: use %r0 for outw_be()
        sparc64: Do not define BIO_VMERGE_BOUNDARY.
      e9dd54da
    • David S. Miller's avatar
      ipw2200: Call netif_*_queue() interfaces properly. · 521c4d96
      David S. Miller authored
      netif_carrier_{on,off}() handles starting and stopping packet
      flow into the driver.  So there is no reason to invoke netif_stop_queue()
      and netif_wake_queue() in response to link status events.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      521c4d96
    • David S. Miller's avatar
      42555892
    • David S. Miller's avatar
    • Jeff Garzik's avatar
      [netdrvr] atl1d: fix !CONFIG_PM build · d6f8aa85
      Jeff Garzik authored
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      d6f8aa85
    • David S. Miller's avatar
    • Florian Fainelli's avatar
      r6040: rework init_one error handling · b0e45390
      Florian Fainelli authored
      This patch reworks the error handling in r6040_init_one
      in order not to leak resources and correcly unmap and release
      PCI regions of the MAC. Also prefix printk's with the driver name
      for clarity.
      Signed-off-by: default avatarFlorian Fainelli <florian.fainelli@telecomint.eu>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      b0e45390
  5. 22 Jul, 2008 19 commits