1. 28 Mar, 2014 24 commits
  2. 27 Mar, 2014 16 commits
    • Florian Fainelli's avatar
      net: bcmgenet: set RBUF_SKIP_FCS based on UniMAC CRC forwarding · ebe5e3c6
      Florian Fainelli authored
      When the UniMAC block is configured to forward the CRC as part of the
      Ethernet frame (priv->crc_fwd_en, set by default), enabling the hardware
      RX checksum block unveiled that the dma_rxchk_bit was never set in the
      per-packet status bits (dma_flag in bcmgenet_desc_rx). This would make
      the chksum_ok variable to be never set to 1, and the networking stack
      would have to compute the packet checksums, which takes a substantial
      amount of time.
      
      In order for the RXCHK block to properly compute the packet checksum in
      hardware, we also need to set the RBUF_SKIP_FCS bit accordingly.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ebe5e3c6
    • Julia Lawall's avatar
      yam: replace del_timer by del_timer_sync · d3be267d
      Julia Lawall authored
      Use del_timer_sync to ensure that the timer is stopped on all CPUs before
      the driver exists.
      
      This change was suggested by Thomas Gleixner
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      declarer name module_exit;
      identifier ex;
      @@
      
      module_exit(ex);
      
      @@
      identifier r.ex;
      @@
      
      ex(...) {
        <...
      - del_timer
      + del_timer_sync
          (...)
        ...>
      }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d3be267d
    • Julia Lawall's avatar
      hsr: replace del_timer by del_timer_sync · 02f2d5a0
      Julia Lawall authored
      Use del_timer_sync to ensure that the timer is stopped on all CPUs before
      the driver exists.
      
      This change was suggested by Thomas Gleixner.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      declarer name module_exit;
      identifier ex;
      @@
      
      module_exit(ex);
      
      @@
      identifier r.ex;
      @@
      
      ex(...) {
        <...
      - del_timer
      + del_timer_sync
          (...)
        ...>
      }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02f2d5a0
    • Julia Lawall's avatar
      atm: replace del_timer by del_timer_sync · 84275593
      Julia Lawall authored
      Use del_timer_sync to ensure that the timer is stopped on all CPUs before
      the driver exists.
      
      This change was suggested by Thomas Gleixner.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      declarer name module_exit;
      identifier ex;
      @@
      
      module_exit(ex);
      
      @@
      identifier r.ex;
      @@
      
      ex(...) {
        <...
      - del_timer
      + del_timer_sync
          (...)
        ...>
      }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84275593
    • Julia Lawall's avatar
      isdn: replace del_timer by del_timer_sync · 0c295e44
      Julia Lawall authored
      Use del_timer_sync to ensure that the timer is stopped on all CPUs before
      the driver exists.
      
      This change was suggested by Thomas Gleixner.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      declarer name module_exit;
      identifier ex;
      @@
      
      module_exit(ex);
      
      @@
      identifier r.ex;
      @@
      
      ex(...) {
        <...
      - del_timer
      + del_timer_sync
          (...)
        ...>
      }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c295e44
    • Eric Dumazet's avatar
      tcp: tcp_make_synack() minor changes · a0b8486c
      Eric Dumazet authored
      There is no need to allocate 15 bytes in excess for a SYNACK packet,
      as it contains no data, only headers.
      
      SYNACK are always generated in softirq context, and contain a single
      segment, we can use TCP_INC_STATS_BH()
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a0b8486c
    • Michal Kubeček's avatar
      ipv6: do not overwrite inetpeer metrics prematurely · e5fd387a
      Michal Kubeček authored
      If an IPv6 host route with metrics exists, an attempt to add a
      new route for the same target with different metrics fails but
      rewrites the metrics anyway:
      
      12sp0:~ # ip route add fec0::1 dev eth0 rto_min 1000
      12sp0:~ # ip -6 route show
      fe80::/64 dev eth0  proto kernel  metric 256
      fec0::1 dev eth0  metric 1024  rto_min lock 1s
      12sp0:~ # ip route add fec0::1 dev eth0 rto_min 1500
      RTNETLINK answers: File exists
      12sp0:~ # ip -6 route show
      fe80::/64 dev eth0  proto kernel  metric 256
      fec0::1 dev eth0  metric 1024  rto_min lock 1.5s
      
      This is caused by all IPv6 host routes using the metrics in
      their inetpeer (or the shared default). This also holds for the
      new route created in ip6_route_add() which shares the metrics
      with the already existing route and thus ip6_route_add()
      rewrites the metrics even if the new route ends up not being
      used at all.
      
      Another problem is that old metrics in inetpeer can reappear
      unexpectedly for a new route, e.g.
      
      12sp0:~ # ip route add fec0::1 dev eth0 rto_min 1000
      12sp0:~ # ip route del fec0::1
      12sp0:~ # ip route add fec0::1 dev eth0
      12sp0:~ # ip route change fec0::1 dev eth0 hoplimit 10
      12sp0:~ # ip -6 route show
      fe80::/64 dev eth0  proto kernel  metric 256
      fec0::1 dev eth0  metric 1024  hoplimit 10 rto_min lock 1s
      
      Resolve the first problem by moving the setting of metrics down
      into fib6_add_rt2node() to the point we are sure we are
      inserting the new route into the tree. Second problem is
      addressed by introducing new flag DST_METRICS_FORCE_OVERWRITE
      which is set for a new host route in ip6_route_add() and makes
      ipv6_cow_metrics() always overwrite the metrics in inetpeer
      (even if they are not "new"); it is reset after that.
      
      v5: use a flag in _metrics member rather than one in flags
      
      v4: fix a typo making a condition always true (thanks to Hannes
      Frederic Sowa)
      
      v3: rewritten based on David Miller's idea to move setting the
      metrics (and allocation in non-host case) down to the point we
      already know the route is to be inserted. Also rebased to
      net-next as it is quite late in the cycle.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e5fd387a
    • Christian Riesch's avatar
      ptp: Fix compiler warnings in the testptp utility · 4ec54f95
      Christian Riesch authored
      Signed-off-by: default avatarChristian Riesch <christian.riesch@omicron.at>
      Cc: Dong Zhu <bluezhudong@gmail.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ec54f95
    • David S. Miller's avatar
      Revert "ptp: Fix compiler warnings in the testptp utility" · 031fe792
      David S. Miller authored
      This reverts commit 203191c3.
      
      A better version of this fix is forthcoming.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      031fe792
    • Yuval Mintz's avatar
      bnx2x: Fix compilation when CONFIG_BNX2X_SRIOV is not set · 19915f53
      Yuval Mintz authored
      Commit 370d4a26 "bnx2x: Create workqueue for IOV related tasks" breaks bnx2x
      compilation when CONFIG_BNX2X_SRIOV is not set - "multiple definition of
      `bnx2x_schedule_iov_task'".
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      19915f53
    • David S. Miller's avatar
      Merge branch 'tipc-next' · b5b6bc32
      David S. Miller authored
      Ying Xue says:
      
      ====================
      tipc: clean up bearer and node layer
      
      This is another commit series which aims at facilitating future
      changes to the locking policy around nodes, links and bearers.
      
      Currently, the tipc routing hierarchy comprises the structures 'node',
      'link' and 'bearer'. The whole hierarchy is protected by a big
      read/write lock (tipc_net_lock), to ensure that nothing is added or
      removed while any of these structures is being accessed. Obviously
      the locking policy makes node, link and bearer components closely
      bound together so that their relationship becomes extremely complex.
      In the worst case, such locking policy not only has a negative
      influence on performance, but also it's prone to lead to deadlock
      occasionally.
      
      In order to decouple the complex relationship between bearer and node
      as well as link, the locking policy is adjusted as follows:
      
      - Bearer level
        RTNL lock is used on update side, and RCU is used on read side.
        Meanwhile, all bearer instances including broadcast bearer are
        saved into bearer_list array.
      
      - Node and link level
        All node instances are saved into two tipc_node_list and node_htable
        lists. The two lists are protected by node_list_lock on write side,
        and they are guarded with RCU lock on read side. All members in node
        structure including link instances are protected by node spin lock.
      
      - The relationship between bearer and node
        When link accesses bearer, it first needs to find the bearer with
        its bearer identity from the bearer_list array. When bearer accesses
        node, it can iterate the node_htable hash list with the node address
        to find the corresponding node.
      
      In the new locking policy, every component has its private locking
      solution and the relationship between bearer and node is very simple,
      that is, they can find each other with node address or bearer identity
      from node_htable hash list or bearer_list array.
      
      But, prior to these changes, we need to do some necessary cleanup and
      code consolidation. This is what we do with this commit series. In a
      later series we will replace net_lock with RTNL as well as RCU lock
      to deploy the new locking policy.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5b6bc32
    • Ying Xue's avatar
      tipc: use node list lock to protect tipc_num_links variable · dde20266
      Ying Xue authored
      Without properly implicit or explicit read memory barrier, it's
      unsafe to read an atomic variable with atomic_read() from another
      thread which is different with the thread of changing the atomic
      variable with atomic_inc() or atomic_dec(). So a stale tipc_num_links
      may be got with atomic_read() in tipc_node_get_links(). If the
      tipc_num_links variable type is converted from atomic to unsigned
      integer and node list lock is used to protect it, the issue would
      be avoided.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dde20266
    • Ying Xue's avatar
      tipc: use node_list_lock to protect tipc_num_nodes variable · 2220646a
      Ying Xue authored
      As tipc_node_list is protected by rcu read lock on read side, it's
      unnecessary to hold node_list_lock to protect tipc_node_list in
      tipc_node_get_links(). Instead, node_list_lock should just protects
      tipc_num_nodes in the function.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2220646a
    • Ying Xue's avatar
      tipc: tipc: convert node list and node hlist to RCU lists · 6c7a762e
      Ying Xue authored
      Convert tipc_node_list list and node_htable hash list to RCU lists.
      On read side, the two lists are protected with RCU read lock, and
      on update side, node_list_lock is applied to them.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c7a762e
    • Ying Xue's avatar
      tipc: rename node create lock to protect node list and hlist · 46651c59
      Ying Xue authored
      When a node is created, tipc_net_lock read lock is first held and
      then node_create_lock is grabbed in order to prevent the same node
      from being created and inserted into both node list and hlist twice.
      But when we query node from the two node lists, we only hold
      tipc_net_lock read lock without grabbing node_create_lock. Obviously
      this locking policy is unable to guarantee that the two node lists
      are always synchronized especially when the operation of changing
      and accessing them occurs in different contexts like currently doing.
      
      Therefore, rename node_create_lock to node_list_lock to protect the
      two node lists, that is, whenever node is inserted into them or node
      is queried from them, the node_list_lock should be always held. As a
      result, tipc_net_lock read lock becomes redundant and then can be
      removed from the node query functions.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46651c59
    • Ying Xue's avatar
      tipc: make broadcast bearer store in bearer_list array · 987b58be
      Ying Xue authored
      Now unicast bearer is dynamically allocated and placed into its
      identity specified slot of bearer_list array. When we search
      bearer_list array with a bearer identity, the corresponding bearer
      instance can be found. But broadcast bearer is statically allocated
      and it is not located in the bearer_list array yet. So we decide to
      enlarge bearer_list array into MAX_BEARERS + 1 slots, and its last
      slot stores the broadcast bearer so that the broadcast bearer can
      be found from bearer_list array with MAX_BEARERS as index. The
      change will help us reduce the complex relationship between bearer
      and link in the future.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      987b58be