1. Mar 23, 2017
    • Or Gerlitz's avatar
      net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch · d85cdccb
      Or Gerlitz authored
      Refactor the code to deal with add/del TC rules to have handler per NIC/E-switch
      offloading use case, and push the latter into the e-switch code. This provides
      better separation and is to be used in down-stream patch for applying a fix.
      
      Fixes: bffaa916
      
       ("net/mlx5: E-Switch, Add control for inline mode")
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d85cdccb
    • Or Gerlitz's avatar
      net/mlx5: Add missing entries for set/query rate limit commands · 1f30a86c
      Or Gerlitz authored
      The switch cases for the rate limit set and query commands were
      missing, which could get us wrong under fw error or driver reset
      flow, fix that.
      
      Fixes: 1466cc5b
      
       ('net/mlx5: Rate limit tables support')
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: default avatarHadar Hen Zion <hadarh@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f30a86c
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-for-davem-2017-03-21' of... · bf601fe5
      David S. Miller authored
      Merge tag 'wireless-drivers-for-davem-2017-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for 4.11
      
      iwlwifi
      
      * fix a user reported warning in DQA
      
      mwifiex
      
      * fix a potential double free
      * fix lost early debug logs
      * fix init wakeup warning message from device framework
      * add Ganapathi and Xinming as maintainers
      
      ath10k
      
      * fix regression with QCA6174 during resume and firmware crash
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf601fe5
    • Ying Xue's avatar
      tipc: fix nametbl deadlock at tipc_nametbl_unsubscribe · 557d054c
      Ying Xue authored
      Until now, tipc_nametbl_unsubscribe() is called at subscriptions
      reference count cleanup. Usually the subscriptions cleanup is
      called at subscription timeout or at subscription cancel or at
      subscriber delete.
      
      We have ignored the possibility of this being called from other
      locations, which causes deadlock as we try to grab the
      tn->nametbl_lock while holding it already.
      
         CPU1:                             CPU2:
      ----------                     ----------------
      tipc_nametbl_publish
      spin_lock_bh(&tn->nametbl_lock)
      tipc_nametbl_insert_publ
      tipc_nameseq_insert_publ
      tipc_subscrp_report_overlap
      tipc_subscrp_get
      tipc_subscrp_send_event
                                   tipc_close_conn
                                   tipc_subscrb_release_cb
                                   tipc_subscrb_delete
                                   tipc_subscrp_put
      tipc_subscrp_put
      tipc_subscrp_kref_release
      tipc_nametbl_unsubscribe
      spin_lock_bh(&tn->nametbl_lock)
      <<grab nametbl_lock again>>
      
         CPU1:                              CPU2:
      ----------                     ----------------
      tipc_nametbl_stop
      spin_lock_bh(&tn->nametbl_lock)
      tipc_purge_publications
      tipc_nameseq_remove_publ
      tipc_subscrp_report_overlap
      tipc_subscrp_get
      tipc_subscrp_send_event
                                   tipc_close_conn
                                   tipc_subscrb_release_cb
                                   tipc_subscrb_delete
                                   tipc_subscrp_put
      tipc_subscrp_put
      tipc_subscrp_kref_release
      tipc_nametbl_unsubscribe
      spin_lock_bh(&tn->nametbl_lock)
      <<grab nametbl_lock again>>
      
      In this commit, we advance the calling of tipc_nametbl_unsubscribe()
      from the refcount cleanup to the intended callers.
      
      Fixes: d094c4d5
      
       ("tipc: add subscription refcount to avoid invalid delete")
      Reported-by: default avatarJohn Thompson <thompa.atl@gmail.com>
      Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      557d054c
    • Xin Long's avatar
      sctp: remove useless err from sctp_association_init · 58194778
      Xin Long authored
      
      
      This patch is to remove the unnecessary temporary variable 'err' from
      sctp_association_init.
      
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58194778
    • Xin Long's avatar
      sctp: declare struct sctp_stream before using it · 1511949c
      Xin Long authored
      sctp_stream_free uses struct sctp_stream as a param, but struct sctp_stream
      is defined after it's declaration.
      
      This patch is to declare struct sctp_stream before sctp_stream_free.
      
      Fixes: a8386317
      
       ("sctp: prepare asoc stream for stream reconf")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1511949c
    • Arnd Bergmann's avatar
      cpsw/netcp: cpts depends on posix_timers · 07fef362
      Arnd Bergmann authored
      With posix timers having become optional, we get a build error with
      the cpts time sync option of the CPSW driver:
      
      drivers/net/ethernet/ti/cpts.c: In function 'cpts_find_ts':
      drivers/net/ethernet/ti/cpts.c:291:23: error: implicit declaration of function 'ptp_classify_raw';did you mean 'ptp_classifier_init'? [-Werror=implicit-function-declaration]
      
      This adds a hard dependency on PTP_CLOCK to avoid the problem, as
      building it without PTP support makes no sense anyway.
      
      Fixes: baa73d9e
      
       ("posix-timers: Make them configurable")
      Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      07fef362
    • Arnd Bergmann's avatar
      cpsw/netcp: work around reverse cpts dependency · be9ca0d3
      Arnd Bergmann authored
      The dependency is reversed: cpsw and netcp call into cpts,
      but cpts depends on the other two in Kconfig. This can lead
      to cpts being a loadable module and its callers built-in:
      
      drivers/net/ethernet/ti/cpsw.o: In function `cpsw_remove':
      cpsw.c:(.text.cpsw_remove+0xd0): undefined reference to `cpts_release'
      drivers/net/ethernet/ti/cpsw.o: In function `cpsw_rx_handler':
      cpsw.c:(.text.cpsw_rx_handler+0x2dc): undefined reference to `cpts_rx_timestamp'
      drivers/net/ethernet/ti/cpsw.o: In function `cpsw_tx_handler':
      cpsw.c:(.text.cpsw_tx_handler+0x7c): undefined reference to `cpts_tx_timestamp'
      drivers/net/ethernet/ti/cpsw.o: In function `cpsw_ndo_stop':
      
      As a workaround, I'm introducing another Kconfig symbol to
      control the compilation of cpts, while making the actual
      module controlled by a silent symbol that is =y when necessary.
      
      Fixes: 6246168b
      
       ("net: ethernet: ti: netcp: add support of cpts")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be9ca0d3
    • David S. Miller's avatar
      Merge branch 'r8152-rx-settings' · 8fb106b2
      David S. Miller authored
      
      
      Hayes Wang says:
      
      ====================
      r8152: fix the rx settings of RTL8153
      
      The RMS and the rx early size should base on the same rx size. However,
      the RMS is set to 9K bytes now and the rx early depends on mtu. For using
      the rx buffer effectively, sync the two settings according to the mtu.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fb106b2
    • hayeswang's avatar
      r8152: fix the rx early size of RTL8153 · b20cb60e
      hayeswang authored
      revert commit a59e6d81
      
       ("r8152: correct the rx early size") and
      fix the rx early size as
      
      	(rx buffer size - rx packet size - rx desc size - alignment) / 4
      
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b20cb60e
    • hayeswang's avatar
      r8152: set the RMS of RTL8153 according to the mtu · 210c4f70
      hayeswang authored
      
      
      Set the received maximum size (RMS) according to the mtu size. It is
      unnecessary to receive a packet which is more than the size we could
      transmit. Besides, this could let the rx buffer be used effectively.
      
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      210c4f70
    • Tejun Heo's avatar
      cgroup, net_cls: iterate the fds of only the tasks which are being migrated · a05d4fd9
      Tejun Heo authored
      The net_cls controller controls the classid field of each socket which
      is associated with the cgroup.  Because the classid is per-socket
      attribute, when a task migrates to another cgroup or the configured
      classid of the cgroup changes, the controller needs to walk all
      sockets and update the classid value, which was implemented by
      3b13758f ("cgroups: Allow dynamically changing net_classid").
      
      While the approach is not scalable, migrating tasks which have a lot
      of fds attached to them is rare and the cost is born by the ones
      initiating the operations.  However, for simplicity, both the
      migration and classid config change paths call update_classid() which
      scans all fds of all tasks in the target css.  This is an overkill for
      the migration path which only needs to cover a much smaller subset of
      tasks which are actually getting migrated in.
      
      On cgroup v1, this can lead to unexpected scalability issues when one
      tries to migrate a task or process into a net_cls cgroup which already
      contains a lot of fds.  Even if the migration traget doesn't have many
      to get scanned, update_classid() ends up scanning all fds in the
      target cgroup which can be extremely numerous.
      
      Unfortunately, on cgroup v2 which doesn't use net_cls, the problem is
      even worse.  Before bfc2cf6f ("cgroup: call subsys->*attach() only
      for subsystems which are actually affected by migration"), cgroup core
      would call the ->css_attach callback even for controllers which don't
      see actual migration to a different css.
      
      As net_cls is always disabled but still mounted on cgroup v2, whenever
      a process is migrated on the cgroup v2 hierarchy, net_cls sees
      identity migration from root to root and cgroup core used to call
      ->css_attach callback for those.  The net_cls ->css_attach ends up
      calling update_classid() on the root net_cls css to which all
      processes on the system belong to as the controller isn't used.  This
      makes any cgroup v2 migration O(total_number_of_fds_on_the_system)
      which is horrible and easily leads to noticeable stalls triggering RCU
      stall warnings and so on.
      
      The worst symptom is already fixed in upstream by bfc2cf6f
      
      
      ("cgroup: call subsys->*attach() only for subsystems which are
      actually affected by migration"); however, backporting that commit is
      too invasive and we want to avoid other cases too.
      
      This patch updates net_cls's cgrp_attach() to iterate fds of only the
      processes which are actually getting migrated.  This removes the
      surprising migration cost which is dependent on the total number of
      fds in the target cgroup.  As this leaves write_classid() the only
      user of update_classid(), open-code the helper into write_classid().
      
      Reported-by: default avatarDavid Goode <dgoode@fb.com>
      Fixes: 3b13758f
      
       ("cgroups: Allow dynamically changing net_classid")
      Cc: stable@vger.kernel.org # v4.4+
      Cc: Nina Schiff <ninasc@fb.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a05d4fd9
  2. Mar 22, 2017
  3. Mar 20, 2017
    • Ryan Hsu's avatar
      ath10k: fix incorrect wlan_mac_base in qca6174_regs · 6be3b6cc
      Ryan Hsu authored
      In the 'commit ebee76f7 ("ath10k: allow setting coverage class")',
      it inherits the design and the address offset from ath9k, but the address
      is not applicable to QCA6174, which leads to a random crash while doing the
      resume() operation, since the set_coverage_class.ops will be called from
      ieee80211_reconfig() when resume() (if the wow is not configured).
      
      Fix the incorrect address offset here to avoid the random crash.
      
      Verified on QCA6174/hw3.0 with firmware WLAN.RM.4.4-00022-QCARMSWPZ-2.
      
      kvalo: this also seems to fix a regression with firmware restart.
      
      Fixes: ebee76f7
      
       ("ath10k: allow setting coverage class")
      Cc: <stable@vger.kernel.org> # v4.10
      Signed-off-by: default avatarRyan Hsu <ryanhsu@qca.qualcomm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
      6be3b6cc
  4. Mar 17, 2017
    • Eric Dumazet's avatar
      tcp: tcp_get_info() should read tcp_time_stamp later · db7f00b8
      Eric Dumazet authored
      Commit b369e7fd
      
       ("tcp: make TCP_INFO more consistent") moved
      lock_sock_fast() earlier in tcp_get_info()
      
      This has the minor effect that jiffies value being sampled at the
      beginning of tcp_get_info() is more likely to be off by one, and we
      report big tcpi_last_data_sent values (like 0xFFFFFFFF).
      
      Since we lock the socket, fetching tcp_time_stamp right before
      doing the jiffies_to_msecs() calls is enough to remove these
      wrong values.
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db7f00b8
    • stephen hemminger's avatar
      netvsc: fix race during initialization · e14b4db7
      stephen hemminger authored
      When device is being setup on boot, there is a small race where
      network device callback is registered, but the netvsc_device pointer
      is not set yet.  This can cause a NULL ptr dereference if packet
      arrives during this window.
      
      Fixes: 46b4f7f5
      
       ("netvsc: eliminate per-device outstanding send counter")
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e14b4db7
    • WANG Cong's avatar
      bridge: resolve a false alarm of lockdep · d12c9176
      WANG Cong authored
      Andrei reported a false alarm of lockdep at net/bridge/br_fdb.c:109,
      this is because in Andrei's case, a spin_bug() was already triggered
      before this, therefore the debug_locks is turned off, lockdep_is_held()
      is no longer accurate after that. We should use lockdep_assert_held_once()
      instead of lockdep_is_held() to respect debug_locks.
      
      Fixes: 410b3d48
      
       ("bridge: fdb: add proper lock checks in searching functions")
      Reported-by: default avatarAndrei Vagin <avagin@gmail.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d12c9176
    • David Howells's avatar
      rxrpc: Ignore BUSY packets on old calls · 4d4a6ac7
      David Howells authored
      
      
      If we receive a BUSY packet for a call we think we've just completed, the
      packet is handed off to the connection processor to deal with - but the
      connection processor doesn't expect a BUSY packet and so flags a protocol
      error.
      
      Fix this by simply ignoring the BUSY packet for the moment.
      
      The symptom of this may appear as a system call failing with EPROTO.  This
      may be triggered by pressing ctrl-C under some circumstances.
      
      This comes about we abort calls due to interruption by a signal (which we
      shouldn't do, but that's going to be a large fix and mostly in fs/afs/).
      What happens is that we abort the call and may also abort follow up calls
      too (this needs offloading somehoe).  So we see a transmission of something
      like the following sequence of packets:
      
      	DATA for call N
      	ABORT call N
      	DATA for call N+1
      	ABORT call N+1
      
      in very quick succession on the same channel.  However, the peer may have
      deferred the processing of the ABORT from the call N to a background thread
      and thus sees the DATA message from the call N+1 coming in before it has
      cleared the channel.  Thus it sends a BUSY packet[*].
      
      [*] Note that some implementations (OpenAFS, for example) mark the BUSY
          packet with one plus the callNumber of the call prior to call N.
          Ordinarily, this would be call N, but there's no requirement for the
          calls on a channel to be numbered strictly sequentially (the number is
          required to increase).
      
          This is wrong and means that the callNumber in the BUSY packet should
          be ignored (it really ought to be N+1 since that's what it's in
          response to).
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d4a6ac7
    • Nathan Fontenot's avatar
      ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs · 9501df3c
      Nathan Fontenot authored
      
      
      The pointer array for the tx/rx sub crqs should be free'ed when
      releasing the tx/rx sub crqs.
      
      Signed-off-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9501df3c
    • David Ahern's avatar
      net: ipv6: set route type for anycast routes · 4ee39733
      David Ahern authored
      Anycast routes have the RTF_ANYCAST flag set, but when dumping routes
      for userspace the route type is not set to RTN_ANYCAST. Make it so.
      
      Fixes: 58c4fb86
      
       ("[IPV6]: Flag RTF_ANYCAST for anycast routes")
      CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ee39733
    • David Ahern's avatar
      net: mpls: Fix nexthop alive tracking on down events · 61733c91
      David Ahern authored
      Alive tracking of nexthops can account for a link twice if the carrier
      goes down followed by an admin down of the same link rendering multipath
      routes useless. This is similar to 79099aab for UNREGISTER events and
      DOWN events.
      
      Fix by tracking number of alive nexthops in mpls_ifdown similar to the
      logic in mpls_ifup. Checking the flags per nexthop once after all events
      have been processed is simpler than trying to maintian a running count
      through all event combinations.
      
      Also, WRITE_ONCE is used instead of ACCESS_ONCE to set rt_nhn_alive
      per a comment from checkpatch:
          WARNING: Prefer WRITE_ONCE(<FOO>, <BAR>) over ACCESS_ONCE(<FOO>) = <BAR>
      
      Fixes: c89359a4
      
       ("mpls: support for dead routes")
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Acked-by: default avatarRobert Shearman <rshearma@brocade.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61733c91