1. 23 3月, 2017 12 次提交
    • O
      net/mlx5e: Change the TC offload rule add/del code path to be per NIC or E-Switch · d85cdccb
      Or Gerlitz 提交于
      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: NOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: NRoi Dayan <roid@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d85cdccb
    • O
      net/mlx5: Add missing entries for set/query rate limit commands · 1f30a86c
      Or Gerlitz 提交于
      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: NOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: NHadar Hen Zion <hadarh@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f30a86c
    • D
      Merge tag 'wireless-drivers-for-davem-2017-03-21' of... · bf601fe5
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      bf601fe5
    • Y
      tipc: fix nametbl deadlock at tipc_nametbl_unsubscribe · 557d054c
      Ying Xue 提交于
      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: NJohn Thompson <thompa.atl@gmail.com>
      Acked-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      557d054c
    • X
      sctp: remove useless err from sctp_association_init · 58194778
      Xin Long 提交于
      This patch is to remove the unnecessary temporary variable 'err' from
      sctp_association_init.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58194778
    • X
      sctp: declare struct sctp_stream before using it · 1511949c
      Xin Long 提交于
      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: NXin Long <lucien.xin@gmail.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1511949c
    • A
      cpsw/netcp: cpts depends on posix_timers · 07fef362
      Arnd Bergmann 提交于
      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: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      07fef362
    • A
      cpsw/netcp: work around reverse cpts dependency · be9ca0d3
      Arnd Bergmann 提交于
      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: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be9ca0d3
    • D
      Merge branch 'r8152-rx-settings' · 8fb106b2
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      8fb106b2
    • H
      r8152: fix the rx early size of RTL8153 · b20cb60e
      hayeswang 提交于
      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: NHayes Wang <hayeswang@realtek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b20cb60e
    • H
      r8152: set the RMS of RTL8153 according to the mtu · 210c4f70
      hayeswang 提交于
      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: NHayes Wang <hayeswang@realtek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      210c4f70
    • T
      cgroup, net_cls: iterate the fds of only the tasks which are being migrated · a05d4fd9
      Tejun Heo 提交于
      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: NDavid 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: NTejun Heo <tj@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a05d4fd9
  2. 22 3月, 2017 20 次提交
  3. 20 3月, 2017 1 次提交
    • R
      ath10k: fix incorrect wlan_mac_base in qca6174_regs · 6be3b6cc
      Ryan Hsu 提交于
      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: NRyan Hsu <ryanhsu@qca.qualcomm.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      6be3b6cc
  4. 17 3月, 2017 7 次提交
    • E
      tcp: tcp_get_info() should read tcp_time_stamp later · db7f00b8
      Eric Dumazet 提交于
      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: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db7f00b8
    • S
      netvsc: fix race during initialization · e14b4db7
      stephen hemminger 提交于
      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: NStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e14b4db7
    • W
      bridge: resolve a false alarm of lockdep · d12c9176
      WANG Cong 提交于
      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: NAndrei Vagin <avagin@gmail.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d12c9176
    • D
      rxrpc: Ignore BUSY packets on old calls · 4d4a6ac7
      David Howells 提交于
      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: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d4a6ac7
    • N
      ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs · 9501df3c
      Nathan Fontenot 提交于
      The pointer array for the tx/rx sub crqs should be free'ed when
      releasing the tx/rx sub crqs.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9501df3c
    • D
      net: ipv6: set route type for anycast routes · 4ee39733
      David Ahern 提交于
      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: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4ee39733
    • D
      net: mpls: Fix nexthop alive tracking on down events · 61733c91
      David Ahern 提交于
      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: NDavid Ahern <dsa@cumulusnetworks.com>
      Acked-by: NRobert Shearman <rshearma@brocade.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61733c91