1. 09 Jan, 2015 15 commits
    • David S. Miller's avatar
      Merge branch 'rhashtable-next' · 4a71d054
      David S. Miller authored
      Ying Xue says:
      
      ====================
      Involve rhashtable_lookup_insert routine
      
      The series aims to involve rhashtable_lookup_insert() to guarantee
      that the process of lookup and insertion of an object from/into hash
      table is finished atomically, allowing rhashtable's users not to
      introduce an extra lock during search and insertion. For example,
      tipc socket is the first user benefiting from this enhancement.
      
      v2 changes:
       - fix the issue of waking up worker thread under a wrong condition in
         patch #2, which is pointed by Thomas.
       - move a comment from rhashtable_inser() to rhashtable_wakeup_worker()
         according to Thomas's suggestion in patch #2.
       - indent the third line of condition statement in
         rhashtable_wakeup_worker() to inner bracket in patch #2.
       - drop patch #3 of v1 series
       - fix an issue of being unable to remove an object from hash table in
         certain special case in patch #4.
       - involve a new patch #5 to avoid unnecessary wakeup for worker queue
         thread
       - involve a new patch #6 to initialize atomic "nelems" variable
       - adjust "nelem_hint" value from 256 to 192 avoiding to unnecessarily
         to shrink hash table from the beginning phase in patch #7.
      
      v1 changes:
       But before rhashtable_lookup_insert() is involved, the following
       optimizations need to be first done:
      - simplify rhashtable_lookup by reusing rhashtable_lookup_compare()
      - introduce rhashtable_wakeup_worker() to further reduce duplicated
        code in patch #2
      - fix an issue in patch #3
      - involve rhashtable_lookup_insert(). But in this version, we firstly
        use rhashtable_lookup() to search duplicate key in both old and new
        bucket table; secondly introduce another __rhashtable_insert() helper
        function to reduce the duplicated code between rhashtable_insert()
        and rhashtable_lookup_insert().
      - add patch #5 into the series as it depends on above patches. But in
        this version, no change is made comparing with its previous version.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a71d054
    • Ying Xue's avatar
      tipc: convert tipc reference table to use generic rhashtable · 07f6c4bc
      Ying Xue authored
      As tipc reference table is statically allocated, its memory size
      requested on stack initialization stage is quite big even if the
      maximum port number is just restricted to 8191 currently, however,
      the number already becomes insufficient in practice. But if the
      maximum ports is allowed to its theory value - 2^32, its consumed
      memory size will reach a ridiculously unacceptable value. Apart from
      this, heavy tipc users spend a considerable amount of time in
      tipc_sk_get() due to the read-lock on ref_table_lock.
      
      If tipc reference table is converted with generic rhashtable, above
      mentioned both disadvantages would be resolved respectively: making
      use of the new resizable hash table can avoid locking on the lookup;
      smaller memory size is required at initial stage, for example, 256
      hash bucket slots are requested at the beginning phase instead of
      allocating the entire 8191 slots in old mode. The hash table will
      grow if entries exceeds 75% of table size up to a total table size
      of 1M, and it will automatically shrink if usage falls below 30%,
      but the minimum table size is allowed down to 256.
      
      Also converts ref_table_lock to a separate mutex to protect hash table
      mutations on write side. Lastly defers the release of the socket
      reference using call_rcu() to allow using an RCU read-side protected
      call to rhashtable_lookup().
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Acked-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Cc: Thomas Graf <tgraf@suug.ch>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      07f6c4bc
    • Ying Xue's avatar
      rhashtable: initialize atomic nelems variable · 545a148e
      Ying Xue authored
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Cc: Thomas Graf <tgraf@suug.ch>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      545a148e
    • Ying Xue's avatar
      rhashtable: avoid unnecessary wakeup for worker queue · c0c09bfd
      Ying Xue authored
      Move condition statements of verifying whether hash table size exceeds
      its maximum threshold or reaches its minimum threshold from resizing
      functions to resizing decision functions, avoiding unnecessary wakeup
      for worker queue thread.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Cc: Thomas Graf <tgraf@suug.ch>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c0c09bfd
    • Ying Xue's avatar
      rhashtable: future table needs to be traversed when remove an object · bd6d4db5
      Ying Xue authored
      When remove an object from hash table, we currently only traverse old
      bucket table to check whether the object exists. If the object is not
      found in it, we will try again. But in the second search loop, we still
      search the object from the old table instead of future table. As a
      result, the object may be not removed from hash table especially when
      resizing is currently in progress and the object is just saved in the
      future table.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Cc: Thomas Graf <tgraf@suug.ch>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd6d4db5
    • Ying Xue's avatar
      rhashtable: involve rhashtable_lookup_insert routine · db304854
      Ying Xue authored
      Involve a new function called rhashtable_lookup_insert() which makes
      lookup and insertion atomic under bucket lock protection, helping us
      avoid to introduce an extra lock when we search and insert an object
      into hash table.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db304854
    • Ying Xue's avatar
      rhashtable: introduce rhashtable_wakeup_worker helper function · 54c5b7d3
      Ying Xue authored
      Introduce rhashtable_wakeup_worker() helper function to reduce
      duplicated code where to wake up worker.
      
      By the way, as long as the both "future_tbl" and "tbl" bucket table
      pointers point to the same bucket array, we should try to wake up
      the resizing worker thread, otherwise, it indicates the work of
      resizing hash table is not finished yet. However, currently we will
      wake up the worker thread only when the two pointers point to
      different bucket array. Obviously this is wrong. So, the issue is
      also fixed as well in the patch.
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Cc: Thomas Graf <tgraf@suug.ch>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54c5b7d3
    • Ying Xue's avatar
      rhashtable: optimize rhashtable_lookup routine · efb975a6
      Ying Xue authored
      Define an internal compare function and relevant compare argument,
      and then make use of rhashtable_lookup_compare() to lookup key in
      hash table, reducing duplicated code between rhashtable_lookup()
      and rhashtable_lookup_compare().
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Cc: Thomas Graf <tgraf@suug.ch>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      efb975a6
    • David S. Miller's avatar
      Merge branch 'cxgb4-next' · 7c1b7023
      David S. Miller authored
      Hariprasad Shenai says:
      
      ====================
      Add support for few debugfs entries
      
      This patch series adds support for devlog, cim_la, cim_qcfg and mps_tcam
      debugfs entries.
      
      The patches series is created against 'net-next' tree.
      And includes patches on cxgb4 driver.
      
      We have included all the maintainers of respective drivers. Kindly review the
      change and let us know in case of any review comments.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c1b7023
    • Hariprasad Shenai's avatar
      cxgb4: Add support for mps_tcam debugfs · ef82f662
      Hariprasad Shenai authored
      Debug log to get the MPS TCAM table
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef82f662
    • Hariprasad Shenai's avatar
      cxgb4: Add support for cim_qcfg entry in debugfs · 74b3092c
      Hariprasad Shenai authored
      Adds debug log to get cim queue config
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      74b3092c
    • Hariprasad Shenai's avatar
      cxgb4: Add support for cim_la entry in debugfs · f1ff24aa
      Hariprasad Shenai authored
      The CIM LA captures the embedded processor’s internal state. Optionally, it can
      also trace the flow of data in and out of the embedded processor. Therefore, the
      CIM LA output contains detailed information of what code the embedded processor
      executed prior to the CIM LA capture.
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f1ff24aa
    • Hariprasad Shenai's avatar
      cxgb4: Add support for devlog · 49aa284f
      Hariprasad Shenai authored
      Add support for device log entry in debugfs
      Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49aa284f
    • WANG Cong's avatar
      doc: fix the compile error of txtimestamp.c · cd91cc5b
      WANG Cong authored
      Vinson reported:
      
        HOSTCC  Documentation/networking/timestamping/txtimestamp
      Documentation/networking/timestamping/txtimestamp.c:64:8: error:
      redefinition of ‘struct in6_pktinfo’
       struct in6_pktinfo {
              ^
      In file included from /usr/include/arpa/inet.h:23:0,
                       from Documentation/networking/timestamping/txtimestamp.c:33:
      /usr/include/netinet/in.h:456:8: note: originally defined here
       struct in6_pktinfo
              ^
      
      After we sync with libc header, we don't need this ugly hack any more.
      Reported-by: default avatarVinson Lee <vlee@twopensource.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd91cc5b
    • WANG Cong's avatar
      ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo · 3b50d902
      WANG Cong authored
      Both netinet/in.h and linux/ipv6.h define these two structs,
      if we include both of them, we got:
      
      	/usr/include/linux/ipv6.h:19:8: error: redefinition of ‘struct in6_pktinfo’
      	 struct in6_pktinfo {
      		^
      	In file included from /usr/include/arpa/inet.h:22:0,
      			 from txtimestamp.c:33:
      	/usr/include/netinet/in.h:524:8: note: originally defined here
      	 struct in6_pktinfo
      		^
      	In file included from txtimestamp.c:40:0:
      	/usr/include/linux/ipv6.h:24:8: error: redefinition of ‘struct ip6_mtuinfo’
      	 struct ip6_mtuinfo {
      		^
      	In file included from /usr/include/arpa/inet.h:22:0,
      			 from txtimestamp.c:33:
      	/usr/include/netinet/in.h:531:8: note: originally defined here
      	 struct ip6_mtuinfo
      		^
      So similarly to what we did for in6_addr, we need to sync with
      libc header on their definitions.
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b50d902
  2. 07 Jan, 2015 3 commits
    • David S. Miller's avatar
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · bdec4196
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Just a pile of random fixes, including:
      
         1) Do not apply TSO limits to non-TSO packets, fix from Herbert Xu.
      
         2) MDI{,X} eeprom check in e100 driver is reversed, from John W.
            Linville.
      
         3) Missing error return assignments in several ethernet drivers, from
            Julia Lawall.
      
         4) Altera TSE device doesn't come back up after ifconfig down/up
            sequence, fix from Kostya Belezko.
      
         5) Add more cases to the check for whether the qmi_wwan device has a
            bogus MAC address and needs to be assigned a random one.  From
            Kristian Evensen.
      
         6) Fix interrupt hangs in CPSW, from Felipe Balbi.
      
         7) Implement ndo_features_check in r8152 so that the stack doesn't
            feed GSO packets which are outside of the chip's capabilities.
            From Hayes Wang"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits)
        qla3xxx: don't allow never end busy loop
        xen-netback: fixing the propagation of the transmit shaper timeout
        r8152: support ndo_features_check
        batman-adv: fix potential TT client + orig-node memory leak
        batman-adv: fix multicast counter when purging originators
        batman-adv: fix counter for multicast supporting nodes
        batman-adv: fix lock class for decoding hash in network-coding.c
        batman-adv: fix delayed foreign originator recognition
        batman-adv: fix and simplify condition when bonding should be used
        Revert "mac80211: Fix accounting of the tailroom-needed counter"
        net: ethernet: cpsw: fix hangs with interrupts
        enic: free all rq buffs when allocation fails
        qmi_wwan: Set random MAC on devices with buggy fw
        openvswitch: Consistently include VLAN header in flow and port stats.
        tcp: Do not apply TSO segment limit to non-TSO packets
        Altera TSE: Add missing phydev
        net/mlx4_core: Fix error flow in mlx4_init_hca()
        net/mlx4_core: Correcly update the mtt's offset in the MR re-reg flow
        qlcnic: Fix return value in qlcnic_probe()
        net: axienet: fix error return code
        ...
      bdec4196
    • Linus Torvalds's avatar
      Merge tag 'for-linus-3' of git://git.code.sf.net/p/openipmi/linux-ipmi · 0adc1803
      Linus Torvalds authored
      Pull IPMI fixlet from Corey Minyard:
       "Fix a compile warning"
      
      * tag 'for-linus-3' of git://git.code.sf.net/p/openipmi/linux-ipmi:
        ipmi: Fix compile warning with tv_usec
      0adc1803
  3. 06 Jan, 2015 22 commits