1. 05 6月, 2018 14 次提交
    • R
      net: skbuff.h: drop unneeded <linux/slab.h> · 1f4c7413
      Randy Dunlap 提交于
      <linux/skbuff.h> does not use nor need <linux/slab.h>, so drop this
      header file from skbuff.h.
      
      <linux/skbuff.h> is currently #included in around 1200 C source and
      header files, making it the 31st most-used header file.
      
      Build tested [allmodconfig] on 20 arch-es.
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f4c7413
    • Y
      net: chelsio: Use zeroing memory allocator instead of allocator/memset · 40434a67
      YueHaibing 提交于
      Use dma_zalloc_coherent for allocating zeroed
      memory and remove unnecessary memset function.
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      40434a67
    • D
      rxrpc: Fix handling of call quietly cancelled out on server · 1a025028
      David Howells 提交于
      Sometimes an in-progress call will stop responding on the fileserver when
      the fileserver quietly cancels the call with an internally marked abort
      (RX_CALL_DEAD), without sending an ABORT to the client.
      
      This causes the client's call to eventually expire from lack of incoming
      packets directed its way, which currently leads to it being cancelled
      locally with ETIME.  Note that it's not currently clear as to why this
      happens as it's really hard to reproduce.
      
      The rotation policy implement by kAFS, however, doesn't differentiate
      between ETIME meaning we didn't get any response from the server and ETIME
      meaning the call got cancelled mid-flow.  The latter leads to an oops when
      fetching data as the rotation partially resets the afs_read descriptor,
      which can result in a cleared page pointer being dereferenced because that
      page has already been filled.
      
      Handle this by the following means:
      
       (1) Set a flag on a call when we receive a packet for it.
      
       (2) Store the highest packet serial number so far received for a call
           (bearing in mind this may wrap).
      
       (3) If, when the "not received anything recently" timeout expires on a
           call, we've received at least one packet for a call and the connection
           as a whole has received packets more recently than that call, then
           cancel the call locally with ECONNRESET rather than ETIME.
      
           This indicates that the call was definitely in progress on the server.
      
       (4) In kAFS, if the rotation algorithm sees ECONNRESET rather than ETIME,
           don't try the next server, but rather abort the call.
      
           This avoids the oops as we don't try to reuse the afs_read struct.
           Rather, as-yet ungotten pages will be reread at a later data.
      
      Also:
      
       (5) Add an rxrpc tracepoint to log detection of the call being reset.
      
      Without this, I occasionally see an oops like the following:
      
          general protection fault: 0000 [#1] SMP PTI
          ...
          RIP: 0010:_copy_to_iter+0x204/0x310
          RSP: 0018:ffff8800cae0f828 EFLAGS: 00010206
          RAX: 0000000000000560 RBX: 0000000000000560 RCX: 0000000000000560
          RDX: ffff8800cae0f968 RSI: ffff8800d58b3312 RDI: 0005080000000000
          RBP: ffff8800cae0f968 R08: 0000000000000560 R09: ffff8800ca00f400
          R10: ffff8800c36f28d4 R11: 00000000000008c4 R12: ffff8800cae0f958
          R13: 0000000000000560 R14: ffff8800d58b3312 R15: 0000000000000560
          FS:  00007fdaef108080(0000) GS:ffff8800ca680000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 00007fb28a8fa000 CR3: 00000000d2a76002 CR4: 00000000001606e0
          Call Trace:
           skb_copy_datagram_iter+0x14e/0x289
           rxrpc_recvmsg_data.isra.0+0x6f3/0xf68
           ? trace_buffer_unlock_commit_regs+0x4f/0x89
           rxrpc_kernel_recv_data+0x149/0x421
           afs_extract_data+0x1e0/0x798
           ? afs_wait_for_call_to_complete+0xc9/0x52e
           afs_deliver_fs_fetch_data+0x33a/0x5ab
           afs_deliver_to_call+0x1ee/0x5e0
           ? afs_wait_for_call_to_complete+0xc9/0x52e
           afs_wait_for_call_to_complete+0x12b/0x52e
           ? wake_up_q+0x54/0x54
           afs_make_call+0x287/0x462
           ? afs_fs_fetch_data+0x3e6/0x3ed
           ? rcu_read_lock_sched_held+0x5d/0x63
           afs_fs_fetch_data+0x3e6/0x3ed
           afs_fetch_data+0xbb/0x14a
           afs_readpages+0x317/0x40d
           __do_page_cache_readahead+0x203/0x2ba
           ? ondemand_readahead+0x3a7/0x3c1
           ondemand_readahead+0x3a7/0x3c1
           generic_file_buffered_read+0x18b/0x62f
           __vfs_read+0xdb/0xfe
           vfs_read+0xb2/0x137
           ksys_read+0x50/0x8c
           do_syscall_64+0x7d/0x1a0
           entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Note the weird value in RDI which is a result of trying to kmap() a NULL
      page pointer.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a025028
    • C
      Allow ethtool to change tun link settings · 4e24f2dd
      Chas Williams 提交于
      Let user space set whatever it would like to advertise for the
      tun interface.  Preserve the existing defaults.
      Signed-off-by: NChas Williams <3chas3@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4e24f2dd
    • D
      Merge branch 'sh_eth-fix-and-clean-up-sh_eth_soft_swap' · 4cd328f8
      David S. Miller 提交于
      Sergei Shtylyov says:
      
      ====================
      sh_eth: fix & clean up sh_eth_soft_swap()
      
      Here's a set of 3 patches against DaveM's 'net-next.git' repo. First one fixes an
      old buffer endiannes issue (luckily, the ARM SoCs are smart enough to not actually
      care) plus couple clean ups around sh_eth_soft_swap()...
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cd328f8
    • S
      sh_eth: use DIV_ROUND_UP() in sh_eth_soft_swap() · 1100149a
      Sergei Shtylyov 提交于
      When initializing 'maxp' in sh_eth_soft_swap(), the buffer length needs
      to be rounded  up -- that's just asking for DIV_ROUND_UP()!
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1100149a
    • S
      sh_eth: uninline sh_eth_soft_swap() · bb2fa4e8
      Sergei Shtylyov 提交于
      sh_eth_tsu_soft_swap() is called twice by the driver, remove *inline* and
      move  that function  from the header to the driver itself to let gcc decide
      whether to expand it inline or not...
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb2fa4e8
    • S
      sh_eth: make sh_eth_soft_swap() work on ARM · 232b6743
      Sergei Shtylyov 提交于
      Browsing  thru the driver disassembly, I noticed that ARM gcc generated
      no  code  whatsoever for sh_eth_soft_swap() while building a little-endian
      kernel -- apparently __LITTLE_ENDIAN__ was not being #define'd, however
      it got implicitly #define'd when building with the SH gcc (I could only
      find the explicit #define __LITTLE_ENDIAN that was #include'd when building
      a little-endian kernel).  Luckily, the Ether controller  only doing big-
      endian DMA is encountered on the early SH771x SoCs only and all ARM SoCs
      implement EDMR.DE and thus set 'sh_eth_cpu_data::hw_swap'. But anyway, we
      need to fix the #ifdef inside sh_eth_soft_swap() to something that would
      work on all architectures...
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      232b6743
    • D
      Merge branch 'mlxsw-Fixes-in-offloading-of-mirror-to-gretap' · 20677108
      David S. Miller 提交于
      Ido Schimmel says:
      
      ====================
      mlxsw: Fixes in offloading of mirror-to-gretap
      
      Petr says:
      
      These two patches fix issues in offloading of mirror-to-gretap when
      bridge is present in the underlay.
      
      In patch #1, reconsideration of SPAN configuration is not done right at
      the point that SWITCHDEV_OBJ_ID_PORT_VLAN deletion notification is
      distributed, but is postponed, because the notifications are actually
      distributed before the relevant change is implemented in the bridge.
      
      In patch #2, a problem in configuring VLAN tagging in situations when a
      VLAN device is on top of an 802.1Q bridge whose egress port is marked as
      "egress untagged". In that case, mlxsw would neglect to suppress the
      tagging implicitly assumed after the VLAN device was seen.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      20677108
    • P
      mlxsw: spectrum_span: Suppress VLAN on BRIDGE_VLAN_INFO_UNTAGGED · 1fc68bb7
      Petr Machata 提交于
      When offloading mirroring to gretap or ip6gretap netdevices, an 802.1q
      bridge is one of the soft devices permissible in the underlay when
      resolving the packet path. After the packet path is resolved to a
      particular bridge egress device, flags on packet VLAN determine whether
      the egressed packet should be tagged.
      
      The current logic however only ever sets the VLAN tag, never suppresses
      it. Thus if there's a VLAN netdevice above the bridge that determines
      the packet VLAN, that VLAN is never unset, and mirroring is configured
      with VLAN tagging.
      
      Fix by setting the packet VLAN on both branches: set to zero (for unset)
      when BRIDGE_VLAN_INFO_UNTAGGED, copy the resolved VLAN (e.g. from bridge
      PVID) otherwise.
      
      Fixes: 946a11e7 ("mlxsw: spectrum_span: Allow bridge for gretap mirror")
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1fc68bb7
    • P
      mlxsw: spectrum_switchdev: Postpone respin on object deletion · f07ff014
      Petr Machata 提交于
      VLAN deletion notifications are emitted before the relevant change is
      projected to bridge configuration. Thus, like with VLAN addition,
      schedule SPAN respin for later.
      
      Fixes: c520bc69 ("mlxsw: Respin SPAN on switchdev events")
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f07ff014
    • M
      ipv6: omit traffic class when calculating flow hash · fa1be7e0
      Michal Kubecek 提交于
      Some of the code paths calculating flow hash for IPv6 use flowlabel member
      of struct flowi6 which, despite its name, encodes both flow label and
      traffic class. If traffic class changes within a TCP connection (as e.g.
      ssh does), ECMP route can switch between path. It's also inconsistent with
      other code paths where ip6_flowlabel() (returning only flow label) is used
      to feed the key.
      
      Use only flow label everywhere, including one place where hash key is set
      using ip6_flowinfo().
      
      Fixes: 51ebd318 ("ipv6: add support of equal cost multipath (ECMP)")
      Fixes: f70ea018 ("net: Add functions to get skb->hash based on flow structures")
      Signed-off-by: NMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fa1be7e0
    • D
      Revert "ipv6: omit traffic class when calculating flow hash" · a925ab48
      David S. Miller 提交于
      This reverts commit 87ae68c8.
      
      Applied the wrong version of this fix, correct version
      coming up.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a925ab48
    • M
      ipv6: omit traffic class when calculating flow hash · 87ae68c8
      Michal Kubecek 提交于
      Some of the code paths calculating flow hash for IPv6 use flowlabel member
      of struct flowi6 which, despite its name, encodes both flow label and
      traffic class. If traffic class changes within a TCP connection (as e.g.
      ssh does), ECMP route can switch between path. It's also incosistent with
      other code paths where ip6_flowlabel() (returning only flow label) is used
      to feed the key.
      
      Use only flow label everywhere, including one place where hash key is set
      using ip6_flowinfo().
      
      Fixes: 51ebd318 ("ipv6: add support of equal cost multipath (ECMP)")
      Fixes: f70ea018 ("net: Add functions to get skb->hash based on flow structures")
      Signed-off-by: NMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Tested-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87ae68c8
  2. 04 6月, 2018 18 次提交
  3. 03 6月, 2018 8 次提交
    • D
      Merge tag 'wireless-drivers-next-for-davem-2018-05-31' of... · f624434a
      David S. Miller 提交于
      Merge tag 'wireless-drivers-next-for-davem-2018-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valo says:
      
      ====================
      wireless-drivers-next patches for 4.18
      
      Hopefully the last pull request to 4.18 before the merge window.
      Nothing major here, we have smaller new features and of course a lots
      of fixes.
      
      Major changes:
      
      ath10k
      
      * add memory dump support for QCA9888 and QCA99X0
      
      * add support to configure channel dwell time
      
      * support new DFS host confirmation feature in the firmware
      
      ath
      
      * update various regulatory mappings
      
      wcn36xx
      
      * various fixes to improve reliability
      
      * add Factory Test Mode support
      
      brmfmac
      
      * add debugfs file for reading firmware capabilities
      
      mwifiex
      
      * support sysfs initiated device coredump
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f624434a
    • T
    • Y
      net: axienet: remove stale comment of axienet_open · deba328c
      YueHaibing 提交于
      axienet_open no longer return -ENODEV when PHY cannot be connected to
      since commit d7cc3163 ("net: axienet: Support phy-less mode of operation")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      deba328c
    • S
      net/ncsi: Avoid GFP_KERNEL in response handler · b0949618
      Samuel Mendoza-Jonas 提交于
      ncsi_rsp_handler_gc() allocates the filter arrays using GFP_KERNEL in
      softirq context, causing the below backtrace. This allocation is only a
      few dozen bytes during probing so allocate with GFP_ATOMIC instead.
      
      [   42.813372] BUG: sleeping function called from invalid context at mm/slab.h:416
      [   42.820900] in_atomic(): 1, irqs_disabled(): 0, pid: 213, name: kworker/0:1
      [   42.827893] INFO: lockdep is turned off.
      [   42.832023] CPU: 0 PID: 213 Comm: kworker/0:1 Tainted: G        W       4.13.16-01441-gad99b38 #65
      [   42.841007] Hardware name: Generic DT based system
      [   42.845966] Workqueue: events ncsi_dev_work
      [   42.850251] [<8010a494>] (unwind_backtrace) from [<80107510>] (show_stack+0x20/0x24)
      [   42.858046] [<80107510>] (show_stack) from [<80612770>] (dump_stack+0x20/0x28)
      [   42.865309] [<80612770>] (dump_stack) from [<80148248>] (___might_sleep+0x230/0x2b0)
      [   42.873241] [<80148248>] (___might_sleep) from [<80148334>] (__might_sleep+0x6c/0xac)
      [   42.881129] [<80148334>] (__might_sleep) from [<80240d6c>] (__kmalloc+0x210/0x2fc)
      [   42.888737] [<80240d6c>] (__kmalloc) from [<8060ad54>] (ncsi_rsp_handler_gc+0xd0/0x170)
      [   42.896770] [<8060ad54>] (ncsi_rsp_handler_gc) from [<8060b454>] (ncsi_rcv_rsp+0x16c/0x1d4)
      [   42.905314] [<8060b454>] (ncsi_rcv_rsp) from [<804d86c8>] (__netif_receive_skb_core+0x3c8/0xb50)
      [   42.914158] [<804d86c8>] (__netif_receive_skb_core) from [<804d96cc>] (__netif_receive_skb+0x20/0x7c)
      [   42.923420] [<804d96cc>] (__netif_receive_skb) from [<804de4b0>] (netif_receive_skb_internal+0x78/0x6a4)
      [   42.932931] [<804de4b0>] (netif_receive_skb_internal) from [<804df980>] (netif_receive_skb+0x78/0x158)
      [   42.942292] [<804df980>] (netif_receive_skb) from [<8042f204>] (ftgmac100_poll+0x43c/0x4e8)
      [   42.950855] [<8042f204>] (ftgmac100_poll) from [<804e094c>] (net_rx_action+0x278/0x4c4)
      [   42.958918] [<804e094c>] (net_rx_action) from [<801016a8>] (__do_softirq+0xe0/0x4c4)
      [   42.966716] [<801016a8>] (__do_softirq) from [<8011cd9c>] (do_softirq.part.4+0x50/0x78)
      [   42.974756] [<8011cd9c>] (do_softirq.part.4) from [<8011cebc>] (__local_bh_enable_ip+0xf8/0x11c)
      [   42.983579] [<8011cebc>] (__local_bh_enable_ip) from [<804dde08>] (__dev_queue_xmit+0x260/0x890)
      [   42.992392] [<804dde08>] (__dev_queue_xmit) from [<804df1f0>] (dev_queue_xmit+0x1c/0x20)
      [   43.000689] [<804df1f0>] (dev_queue_xmit) from [<806099c0>] (ncsi_xmit_cmd+0x1c0/0x244)
      [   43.008763] [<806099c0>] (ncsi_xmit_cmd) from [<8060dc14>] (ncsi_dev_work+0x2e0/0x4c8)
      [   43.016725] [<8060dc14>] (ncsi_dev_work) from [<80133dfc>] (process_one_work+0x214/0x6f8)
      [   43.024940] [<80133dfc>] (process_one_work) from [<80134328>] (worker_thread+0x48/0x558)
      [   43.033070] [<80134328>] (worker_thread) from [<8013ba80>] (kthread+0x130/0x174)
      [   43.040506] [<8013ba80>] (kthread) from [<80102950>] (ret_from_fork+0x14/0x24)
      
      Fixes: 062b3e1b ("net/ncsi: Refactor MAC, VLAN filters")
      Signed-off-by: NSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0949618
    • Y
      net: netcp: ethss: remove unnecessary pointer set to NULL · a6ee84be
      YueHaibing 提交于
      If statement has make sure the 'slave->phy' is NULL
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6ee84be
    • W
      net/smc: fix error return code in smc_setsockopt() · 3dc9f558
      Wei Yongjun 提交于
      Fix to return error code -EINVAL instead of 0 if optlen is invalid.
      
      Fixes: 01d2f7e2 ("net/smc: sockopts TCP_NODELAY and TCP_CORK")
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3dc9f558
    • W
      net/mlx5: Make function mlx5_fpga_tls_send_teardown_cmd() static · 8cb77149
      Wei Yongjun 提交于
      Fixes the following sparse warning:
      
      drivers/net/ethernet/mellanox/mlx5/core/fpga/tls.c:199:6: warning:
       symbol 'mlx5_fpga_tls_send_teardown_cmd' was not declared. Should it be static?
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8cb77149
    • W
      hv_netvsc: fix error return code in netvsc_probe() · 9c6ffbac
      Wei Yongjun 提交于
      Fix to return a negative error code from the failover register fail
      error handling case instead of 0, as done elsewhere in this function.
      
      Fixes: 1ff78076 ("netvsc: refactor notifier/event handling code to use the failover framework")
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c6ffbac