1. 12 8月, 2018 21 次提交
    • G
      l2tp: simplify pppol2tp_ioctl() · bdd0292f
      Guillaume Nault 提交于
      * Drop test on 'sk': sock->sk cannot be NULL, or pppox_ioctl() could
          not have called us.
      
        * Drop test on 'SOCK_DEAD' state: if this flag was set, the socket
          would be in the process of being released and no ioctl could be
          running anymore.
      
        * Drop test on 'PPPOX_*' state: we depend on ->sk_user_data to get
          the session structure. If it is non-NULL, then the socket is
          connected. Testing for PPPOX_* is redundant.
      
        * Retrieve session using ->sk_user_data directly, instead of going
          through pppol2tp_sock_to_session(). This avoids grabbing a useless
          reference on the socket.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bdd0292f
    • G
      l2tp: split l2tp_session_get() · 01e28b92
      Guillaume Nault 提交于
      l2tp_session_get() is used for two different purposes. If 'tunnel' is
      NULL, the session is searched globally in the supplied network
      namespace. Otherwise it is searched exclusively in the tunnel context.
      
      Callers always know the context in which they need to search the
      session. But some of them do provide both a namespace and a tunnel,
      making the semantic of the call unclear.
      
      This patch defines l2tp_tunnel_get_session() for lookups done in a
      tunnel and restricts l2tp_session_get() to namespace searches.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      01e28b92
    • G
      l2tp: define l2tp_tunnel_uses_xfrm() · d6a61ec9
      Guillaume Nault 提交于
      Use helper function to figure out if a tunnel is using ipsec.
      Also, avoid accessing ->sk_policy directly since it's RCU protected.
      Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d6a61ec9
    • D
      Merge branch 'netsec-driver-improvements' · 8a8982d1
      David S. Miller 提交于
      Ilias Apalodimas says:
      
      ====================
      netsec driver improvements
      
      This patchset introduces some improvements on socionext netsec driver.
       - patch 1/2, avoids unneeded MMIO reads on the Rx path
       - patch 2/2, is adjusting the numbers of descriptors used
      
      Changes since v1:
       - Move dma_rmb() to protect descriptor accesses until the device
       has updated the NETSEC_RX_PKT_OWN_FIELD bit
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a8982d1
    • I
      net: socionext: Increase descriptors to 256 · b6311b7b
      Ilias Apalodimas 提交于
      Increasing descriptors to 256 from 128 and adjusting the NAPI weight
      to 64 increases performace on Rx by ~20% on 64byte packets
      Signed-off-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b6311b7b
    • I
      net: socionext: Use descriptor info instead of MMIO reads on Rx · 63ae7949
      Ilias Apalodimas 提交于
      MMIO reads for remaining packets in queue occur (at least)twice per
      invocation of netsec_process_rx(). We can use the packet descriptor to
      identify if it's owned by the hardware and break out, avoiding the more
      expensive MMIO read operations. This has a ~2% increase on the pps of the
      Rx path when tested with 64byte packets
      Signed-off-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63ae7949
    • Y
      vxge: remove set but not used variable 'req_out', 'status' and 'ret' · 78aca3bb
      YueHaibing 提交于
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/net/ethernet/neterion/vxge/vxge-config.c:1097:6: warning:
       variable 'ret' set but not used [-Wunused-but-set-variable]
      drivers/net/ethernet/neterion/vxge/vxge-config.c:2263:6: warning:
       variable 'req_out' set but not used [-Wunused-but-set-variable]
      drivers/net/ethernet/neterion/vxge/vxge-config.c:2262:22: warning:
       variable 'status' set but not used [-Wunused-but-set-variable]
      drivers/net/ethernet/neterion/vxge/vxge-config.c:2360:22: warning:
       variable 'status' set but not used [-Wunused-but-set-variable]
        enum vxge_hw_status status = VXGE_HW_OK;
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      78aca3bb
    • D
      Merge branch 'virtio_net-Expand-affinity-to-arbitrary-numbers-of-cpu-and-vq' · 29afde50
      David S. Miller 提交于
      Caleb Raitto says:
      
      ====================
      virtio_net: Expand affinity to arbitrary numbers of cpu and vq
      
      Virtio-net tries to pin each virtual queue rx and tx interrupt to a cpu if
      there are as many queues as cpus.
      
      Expand this heuristic to configure a reasonable affinity setting also
      when the number of cpus != the number of virtual queues.
      
      Patch 1 allows vqs to take an affinity mask with more than 1 cpu.
      Patch 2 generalizes the algorithm in virtnet_set_affinity beyond
      the case where #cpus == #vqs.
      
      v2 changes:
      Renamed "virtio_net: Make vp_set_vq_affinity() take a mask." to
      "virtio: Make vp_set_vq_affinity() take a mask."
      
      Tested:
      
      [InstanceSetup]
      set_multiqueue = false
      
      $ cd /proc/irq
      $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list;  done
      0-15
      0
      0
      1
      1
      2
      2
      3
      3
      4
      4
      5
      5
      6
      6
      7
      7
      8
      8
      9
      9
      10
      10
      11
      11
      12
      12
      13
      13
      14
      14
      15
      15
      0-15
      0-15
      0-15
      0-15
      
      $ cd /sys/class/net/eth0/queues/
      $ for i in `seq 0 15` ; do sudo grep ".*" tx-$i/xps_cpus; done
      0001
      0002
      0004
      0008
      0010
      0020
      0040
      0080
      0100
      0200
      0400
      0800
      1000
      2000
      4000
      8000
      
      $ sudo ethtool -L eth0 combined 15
      
      $ cd /proc/irq
      $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list;  done
      0-15
      0-1
      0-1
      2
      2
      3
      3
      4
      4
      5
      5
      6
      6
      7
      7
      8
      8
      9
      9
      10
      10
      11
      11
      12
      12
      13
      13
      14
      14
      15
      15
      15
      15
      0-15
      0-15
      0-15
      0-15
      
      $ cd /sys/class/net/eth0/queues/
      $ for i in `seq 0 14` ; do sudo grep ".*" tx-$i/xps_cpus; done
      0003
      0004
      0008
      0010
      0020
      0040
      0080
      0100
      0200
      0400
      0800
      1000
      2000
      4000
      8000
      
      $ sudo ethtool -L eth0 combined 8
      
      $ cd /proc/irq
      $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list;  done
      0-15
      0-1
      0-1
      2-3
      2-3
      4-5
      4-5
      6-7
      6-7
      8-9
      8-9
      10-11
      10-11
      12-13
      12-13
      14-15
      14-15
      9
      9
      10
      10
      11
      11
      12
      12
      13
      13
      14
      14
      15
      15
      15
      15
      0-15
      0-15
      0-15
      0-15
      
      $ cd /sys/class/net/eth0/queues/
      $ for i in `seq 0 7` ; do sudo grep ".*" tx-$i/xps_cpus; done
      0003
      000c
      0030
      00c0
      0300
      0c00
      3000
      c000
      
      $ sudo ethtool -L eth0 combined 16
      $ sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu15/online"
      
      $ cd /proc/irq
      $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list;  done
      0-15
      0
      0
      1
      1
      2
      2
      3
      3
      4
      4
      5
      5
      6
      6
      7
      7
      8
      8
      9
      9
      10
      10
      11
      11
      12
      12
      13
      13
      14
      14
      0
      0
      0-15
      0-15
      0-15
      0-15
      
      $ cd /sys/class/net/eth0/queues/
      $ for i in `seq 0 15` ; do sudo grep ".*" tx-$i/xps_cpus; done
      0001
      0002
      0004
      0008
      0010
      0020
      0040
      0080
      0100
      0200
      0400
      0800
      1000
      2000
      4000
      0001
      
      $ for i in `seq 8 15`; \
      do sudo sh -c "echo 0 > /sys/devices/system/cpu/cpu$i/online"; done
      
      $ cd /proc/irq
      $ for i in `seq 24 60` ; do sudo grep ".*" $i/smp_affinity_list;  done
      0-15
      0
      0
      1
      1
      2
      2
      3
      3
      4
      4
      5
      5
      6
      6
      7
      7
      0
      0
      1
      1
      2
      2
      3
      3
      4
      4
      5
      5
      6
      6
      7
      7
      0-15
      0-15
      0-15
      0-15
      
      $ cd /sys/class/net/eth0/queues/
      $ for i in `seq 0 15` ; do sudo grep ".*" tx-$i/xps_cpus; done
      0001
      0002
      0004
      0008
      0010
      0020
      0040
      0080
      0001
      0002
      0004
      0008
      0010
      0020
      0040
      0080
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29afde50
    • C
      virtio_net: Stripe queue affinities across cores. · 2ca653d6
      Caleb Raitto 提交于
      Always set the affinity hint, even if #cpu != #vq.
      
      Handle the case where #cpu > #vq (including when #cpu % #vq != 0) and
      when #vq > #cpu (including when #vq % #cpu != 0).
      Signed-off-by: NCaleb Raitto <caraitto@google.com>
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Acked-by: NJon Olson <jonolson@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2ca653d6
    • C
      virtio: Make vp_set_vq_affinity() take a mask. · 19e226e8
      Caleb Raitto 提交于
      Make vp_set_vq_affinity() take a cpumask instead of taking a single CPU.
      
      If there are fewer queues than cores, queue affinity should be able to
      map to multiple cores.
      
      Link: https://patchwork.ozlabs.org/patch/948149/Suggested-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NCaleb Raitto <caraitto@google.com>
      Acked-by: NGonglei <arei.gonglei@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      19e226e8
    • B
      lan743x: lan743x: Add PTP support · 07624df1
      Bryan Whitehead 提交于
      PTP support includes:
          Ingress, and egress timestamping.
          One step timestamping available.
          PTP clock support.
          Periodic output support.
      Signed-off-by: NBryan Whitehead <Bryan.Whitehead@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      07624df1
    • D
      Merge branch 'tcp-new-mechanism-to-ACK-immediately' · 217e502b
      David S. Miller 提交于
      Yuchung Cheng says:
      
      ====================
      tcp: new mechanism to ACK immediately
      
      This patch is a follow-up feature improvement to the recent fixes on
      the performance issues in ECN (delayed) ACKs. Many of the fixes use
      tcp_enter_quickack_mode routine to force immediate ACKs. However the
      routine also reset tracking interactive session. This is not ideal
      because these immediate ACKs are required by protocol specifics
      unrelated to the interactiveness nature of the application.
      
      This patch set introduces a new flag to send a one-time immediate ACK
      without changing the status of interactive session tracking. With this
      patch set the immediate ACKs are generated upon these protocol states:
      
      1) When a hole is repaired
      2) When CE status changes between subsequent data packets received
      3) When a data packet carries CWR flag
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      217e502b
    • Y
      tcp: avoid resetting ACK timer upon receiving packet with ECN CWR flag · fd2123a3
      Yuchung Cheng 提交于
      Previously commit 9aee4000 ("tcp: ack immediately when a cwr
      packet arrives") calls tcp_enter_quickack_mode to force sending
      two immediate ACKs upon receiving a packet w/ CWR flag. The side
      effect is it'll also reset the delayed ACK timer and interactive
      session tracking. This patch removes that side effect by using the
      new ACK_NOW flag to force an immmediate ACK.
      
      Packetdrill to demonstrate:
      
          0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
         +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
         +0 setsockopt(3, SOL_TCP, TCP_CONGESTION, "dctcp", 5) = 0
         +0 bind(3, ..., ...) = 0
         +0 listen(3, 1) = 0
      
         +0 < [ect0] SEW 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7>
         +0 > SE. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8>
        +.1 < [ect0] . 1:1(0) ack 1 win 257
         +0 accept(3, ..., ...) = 4
      
         +0 < [ect0] . 1:1001(1000) ack 1 win 257
         +0 > [ect01] . 1:1(0) ack 1001
      
         +0 write(4, ..., 1) = 1
         +0 > [ect01] P. 1:2(1) ack 1001
      
         +0 < [ect0] . 1001:2001(1000) ack 2 win 257
         +0 write(4, ..., 1) = 1
         +0 > [ect01] P. 2:3(1) ack 2001
      
         +0 < [ect0] . 2001:3001(1000) ack 3 win 257
         +0 < [ect0] . 3001:4001(1000) ack 3 win 257
         // Ack delayed ...
      
         +.01 < [ce] P. 4001:4501(500) ack 3 win 257
         +0 > [ect01] . 3:3(0) ack 4001
         +0 > [ect01] E. 3:3(0) ack 4501
      
      +.001 read(4, ..., 4500) = 4500
         +0 write(4, ..., 1) = 1
         +0 > [ect01] PE. 3:4(1) ack 4501 win 100
      
       +.01 < [ect0] W. 4501:5501(1000) ack 4 win 257
         // No delayed ACK on CWR flag
         +0 > [ect01] . 4:4(0) ack 5501
      
       +.31 < [ect0] . 5501:6501(1000) ack 4 win 257
         +0 > [ect01] . 4:4(0) ack 6501
      
      Fixes: 9aee4000 ("tcp: ack immediately when a cwr packet arrives")
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd2123a3
    • Y
      tcp: always ACK immediately on hole repairs · 15bdd568
      Yuchung Cheng 提交于
      RFC 5681 sec 4.2:
        To provide feedback to senders recovering from losses, the receiver
        SHOULD send an immediate ACK when it receives a data segment that
        fills in all or part of a gap in the sequence space.
      
      When a gap is partially filled, __tcp_ack_snd_check already checks
      the out-of-order queue and correctly send an immediate ACK. However
      when a gap is fully filled, the previous implementation only resets
      pingpong mode which does not guarantee an immediate ACK because the
      quick ACK counter may be zero. This patch addresses this issue by
      marking the one-time immediate ACK flag instead.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NWei Wang <weiwan@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15bdd568
    • Y
      tcp: avoid resetting ACK timer in DCTCP · d2ccd7bc
      Yuchung Cheng 提交于
      The recent fix of acking immediately in DCTCP on CE status change
      has an undesirable side-effect: it also resets TCP ack timer and
      disables pingpong mode (interactive session). But the CE status
      change has nothing to do with them. This patch addresses that by
      using the new one-time immediate ACK flag instead of calling
      tcp_enter_quickack_mode().
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NWei Wang <weiwan@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d2ccd7bc
    • Y
      tcp: mandate a one-time immediate ACK · 466466dc
      Yuchung Cheng 提交于
      Add a new flag to indicate a one-time immediate ACK. This flag is
      occasionaly set under specific TCP protocol states in addition to
      the more common quickack mechanism for interactive application.
      
      In several cases in the TCP code we want to force an immediate ACK
      but do not want to call tcp_enter_quickack_mode() because we do
      not want to forget the icsk_ack.pingpong or icsk_ack.ato state.
      Signed-off-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NWei Wang <weiwan@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      466466dc
    • G
      wimax: usb-tx: mark expected switch fall-through · 8a8a894e
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      Notice that in this particular case, I placed the "fall through"
      annotation at the bottom of the case, which is what GCC is expecting
      to find.
      
      Addresses-Coverity-ID: 115075 ("Missing break in switch")
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a8a894e
    • G
      wimax: usb-fw: mark expected switch fall-through · 84906307
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      Notice that in this particular case, I placed the "fall through"
      annotation at the bottom of the case, which is what GCC is expecting
      to find.
      
      Addresses-Coverity-ID: 1369529 ("Missing break in switch")
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84906307
    • G
      net: dp83640: Mark expected switch fall-throughs · d331e758
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      Notice that in this particular case, I replaced the code comment at the
      top of the switch statement with a proper "fall through" annotation for
      each case, which is what GCC is expecting to find.
      
      Addresses-Coverity-ID: 1056542 ("Missing break in switch")
      Addresses-Coverity-ID: 1339579 ("Missing break in switch")
      Addresses-Coverity-ID: 1369526 ("Missing break in switch")
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Acked-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d331e758
    • C
      rxrpc: remove redundant static int 'zero' · 98ed1e64
      Colin Ian King 提交于
      The static int 'zero' is defined but is never used hence it is
      redundant and can be removed. The use of this variable was removed
      with commit a158bdd3 ("rxrpc: Fix call timeouts").
      
      Cleans up clang warning:
      warning: 'zero' defined but not used [-Wunused-const-variable=]
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      98ed1e64
    • Z
      drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend · f741917e
      zhong jiang 提交于
      rtl8152_system_suspend defines the variable "ret", but it is not modified
      after initialization. So just remove it.
      Signed-off-by: Nzhong jiang <zhongjiang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f741917e
  2. 11 8月, 2018 18 次提交
  3. 10 8月, 2018 1 次提交