1. 12 Dec, 2013 28 commits
  2. 06 Dec, 2013 12 commits
    • Ben Hutchings's avatar
      512bb06c
    • Robert Stonehouse's avatar
      sfc: Demote "MC Scheduler error" messages · 2d9955be
      Robert Stonehouse authored
      The MC firmware is cooperatively multitasking and its scheduler will
      send an event when a task yields after running for more than the
      expected maximum time.  This can be useful for firmware development
      but does not usually indicate a serious error and does not help to
      detect a lockup (there is a hardware watchdog that does that).
      Change the message and reduce log level accordingly.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      2d9955be
    • Ben Hutchings's avatar
      Merge branch 'sfc-3.13' into master · 2dd64265
      Ben Hutchings authored
      Merge sfc fixes destined for 3.13, as development for 3.14+ depends on
      some of them.
      2dd64265
    • Robert Stonehouse's avatar
      sfc: Poll for MCDI completion once before timeout occurs · 6b294b8e
      Robert Stonehouse authored
      There is an as-yet unexplained bug that sometimes prevents (or delays)
      the driver seeing the completion event for a completed MCDI request on
      the SFC9120.  The requested configuration change will have happened
      but the driver assumes it to have failed, and this can result in
      further failures.  We can mitigate this by polling for completion
      after unsuccessfully waiting for an event.
      
      Fixes: 8127d661 ('sfc: Add support for Solarflare SFC9100 family')
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      6b294b8e
    • Robert Stonehouse's avatar
    • Andrew Rybchenko's avatar
      sfc: RX buffer allocation takes prefix size into account in IP header alignment · 2ec03014
      Andrew Rybchenko authored
      rx_prefix_size is 4-bytes aligned on Falcon/Siena (16 bytes), but it is equal
      to 14 on EF10. So, it should be taken into account if arch requires IP header
      to be 4-bytes aligned (via NET_IP_ALIGN).
      
      Fixes: 8127d661 ('sfc: Add support for Solarflare SFC9100 family')
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      2ec03014
    • Ben Hutchings's avatar
      sfc: Maintain current frequency adjustment when applying a time offset · cd6fe65e
      Ben Hutchings authored
      There is a single MCDI PTP operation for setting the frequency
      adjustment and applying a time offset to the hardware clock.  When
      applying a time offset we should not change the frequency adjustment.
      
      These two operations can now be requested separately but this requires
      a flash firmware update.  Keep using the single operation, but
      remember and repeat the previous frequency adjustment.
      
      Fixes: 7c236c43 ('sfc: Add support for IEEE-1588 PTP')
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      cd6fe65e
    • Alexandre Rames's avatar
      sfc: Stop/re-start PTP when stopping/starting the datapath. · 2ea4dc28
      Alexandre Rames authored
      This disables PTP when we bring the interface down to avoid getting
      unmatched RX timestamp events, and tries to re-enable it when bringing
      the interface up.
      
      [bwh: Make efx_ptp_stop() safe on Falcon. Introduce
       efx_ptp_{start,stop}_datapath() functions; we'll expand them later.]
      
      Fixes: 7c236c43 ('sfc: Add support for IEEE-1588 PTP')
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      2ea4dc28
    • Ben Hutchings's avatar
      sfc: Rate-limit log message for PTP packets without a matching timestamp event · 35f9a7a3
      Ben Hutchings authored
      In case of a flood of PTP packets, the timestamp peripheral and MC
      firmware on the SFN[56]322F boards may not be able to provide
      timestamp events for all packets.  Don't complain too much about this.
      
      Fixes: 7c236c43 ('sfc: Add support for IEEE-1588 PTP')
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      35f9a7a3
    • Laurence Evans's avatar
      sfc: PTP: Moderate log message on event queue overflow · f3211600
      Laurence Evans authored
      Limit syslog flood if a PTP packet storm occurs.
      
      Fixes: 7c236c43 ('sfc: Add support for IEEE-1588 PTP')
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      f3211600
    • Ben Hutchings's avatar
      sfc: Add length checks to efx_xmit_with_hwtstamp() and efx_ptp_is_ptp_tx() · e5a498e9
      Ben Hutchings authored
      efx_ptp_is_ptp_tx() must be robust against skbs from raw sockets that
      have invalid IPv4 and UDP headers.
      
      Add checks that:
      - the transport header has been found
      - there is enough space between network and transport header offset
        for an IPv4 header
      - there is enough space after the transport header offset for a
        UDP header
      
      Fixes: 7c236c43 ('sfc: Add support for IEEE-1588 PTP')
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      e5a498e9
    • Eric Dumazet's avatar
      tcp: auto corking · f54b3111
      Eric Dumazet authored
      With the introduction of TCP Small Queues, TSO auto sizing, and TCP
      pacing, we can implement Automatic Corking in the kernel, to help
      applications doing small write()/sendmsg() to TCP sockets.
      
      Idea is to change tcp_push() to check if the current skb payload is
      under skb optimal size (a multiple of MSS bytes)
      
      If under 'size_goal', and at least one packet is still in Qdisc or
      NIC TX queues, set the TCP Small Queue Throttled bit, so that the push
      will be delayed up to TX completion time.
      
      This delay might allow the application to coalesce more bytes
      in the skb in following write()/sendmsg()/sendfile() system calls.
      
      The exact duration of the delay is depending on the dynamics
      of the system, and might be zero if no packet for this flow
      is actually held in Qdisc or NIC TX ring.
      
      Using FQ/pacing is a way to increase the probability of
      autocorking being triggered.
      
      Add a new sysctl (/proc/sys/net/ipv4/tcp_autocorking) to control
      this feature and default it to 1 (enabled)
      
      Add a new SNMP counter : nstat -a | grep TcpExtTCPAutoCorking
      This counter is incremented every time we detected skb was under used
      and its flush was deferred.
      
      Tested:
      
      Interesting effects when using line buffered commands under ssh.
      
      Excellent performance results in term of cpu usage and total throughput.
      
      lpq83:~# echo 1 >/proc/sys/net/ipv4/tcp_autocorking
      lpq83:~# perf stat ./super_netperf 4 -t TCP_STREAM -H lpq84 -- -m 128
      9410.39
      
       Performance counter stats for './super_netperf 4 -t TCP_STREAM -H lpq84 -- -m 128':
      
            35209.439626 task-clock                #    2.901 CPUs utilized
                   2,294 context-switches          #    0.065 K/sec
                     101 CPU-migrations            #    0.003 K/sec
                   4,079 page-faults               #    0.116 K/sec
          97,923,241,298 cycles                    #    2.781 GHz                     [83.31%]
          51,832,908,236 stalled-cycles-frontend   #   52.93% frontend cycles idle    [83.30%]
          25,697,986,603 stalled-cycles-backend    #   26.24% backend  cycles idle    [66.70%]
         102,225,978,536 instructions              #    1.04  insns per cycle
                                                   #    0.51  stalled cycles per insn [83.38%]
          18,657,696,819 branches                  #  529.906 M/sec                   [83.29%]
              91,679,646 branch-misses             #    0.49% of all branches         [83.40%]
      
            12.136204899 seconds time elapsed
      
      lpq83:~# echo 0 >/proc/sys/net/ipv4/tcp_autocorking
      lpq83:~# perf stat ./super_netperf 4 -t TCP_STREAM -H lpq84 -- -m 128
      6624.89
      
       Performance counter stats for './super_netperf 4 -t TCP_STREAM -H lpq84 -- -m 128':
            40045.864494 task-clock                #    3.301 CPUs utilized
                     171 context-switches          #    0.004 K/sec
                      53 CPU-migrations            #    0.001 K/sec
                   4,080 page-faults               #    0.102 K/sec
         111,340,458,645 cycles                    #    2.780 GHz                     [83.34%]
          61,778,039,277 stalled-cycles-frontend   #   55.49% frontend cycles idle    [83.31%]
          29,295,522,759 stalled-cycles-backend    #   26.31% backend  cycles idle    [66.67%]
         108,654,349,355 instructions              #    0.98  insns per cycle
                                                   #    0.57  stalled cycles per insn [83.34%]
          19,552,170,748 branches                  #  488.244 M/sec                   [83.34%]
             157,875,417 branch-misses             #    0.81% of all branches         [83.34%]
      
            12.130267788 seconds time elapsed
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f54b3111