mbox series

[v2,net-next,0/5] rhashtable: New features in walk and bucket

Message ID 20171204183145.3277-1-tom@quantonium.net
Headers show
Series rhashtable: New features in walk and bucket | expand

Message

Tom Herbert Dec. 4, 2017, 6:31 p.m. UTC
This patch contains some changes to related rhashtable:

- Above allow rhashtable_walk_start to return void
- Add a functon to peek at the next entry during a walk
- Abstract out function to compute a has for a table
- A library function to alloc a spinlocks bucket array
- Call the above function for rhashtable locks allocation

Tested: Exercised using various operations on an ILA xlat
table.

v2:
 - Apply feedback from Herbert. Don't change semantics of resize
   event reporting and -EAGAIN, just simplify API for callers that
   ignore those.
 - Add end_of_table in iter to reliably tell when the iterator has
   reached to the eno.

Tom Herbert (5):
  rhashtable: Change rhashtable_walk_start to return void
  rhashtable: Add rhastable_walk_peek
  rhashtable: abstract out function to get hash
  spinlock: Add library function to allocate spinlock buckets array
  rhashtable: Call library function alloc_bucket_locks

 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c       |   6 +-
 .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c   |   7 +-
 fs/gfs2/glock.c                                    |   7 +-
 include/linux/rhashtable.h                         |  38 +++--
 include/linux/spinlock.h                           |   6 +
 include/net/sctp/sctp.h                            |   2 +-
 lib/Makefile                                       |   2 +-
 lib/bucket_locks.c                                 |  54 +++++++
 lib/rhashtable.c                                   | 160 +++++++++++++--------
 lib/test_rhashtable.c                              |   6 +-
 net/ipv6/ila/ila_xlat.c                            |   4 +-
 net/ipv6/seg6.c                                    |   4 +-
 net/mac80211/mesh_pathtbl.c                        |  34 ++---
 net/netfilter/nft_set_hash.c                       |  10 +-
 net/netlink/af_netlink.c                           |   5 +-
 net/netlink/diag.c                                 |   8 +-
 net/sctp/proc.c                                    |   6 +-
 net/sctp/socket.c                                  |  19 +--
 net/tipc/socket.c                                  |   6 +-
 19 files changed, 224 insertions(+), 160 deletions(-)
 create mode 100644 lib/bucket_locks.c

Comments

David Miller Dec. 5, 2017, 7:47 p.m. UTC | #1
From: Tom Herbert <tom@quantonium.net>
Date: Mon,  4 Dec 2017 10:31:40 -0800

> This patch contains some changes to related rhashtable:
> 
> - Above allow rhashtable_walk_start to return void
> - Add a functon to peek at the next entry during a walk
> - Abstract out function to compute a has for a table
> - A library function to alloc a spinlocks bucket array
> - Call the above function for rhashtable locks allocation
> 
> Tested: Exercised using various operations on an ILA xlat
> table.
> 
> v2:
>  - Apply feedback from Herbert. Don't change semantics of resize
>    event reporting and -EAGAIN, just simplify API for callers that
>    ignore those.
>  - Add end_of_table in iter to reliably tell when the iterator has
>    reached to the eno.

I'll allow Herbert time to think about this some more as he requested
in comments against the first version of this series.

Thanks.
Herbert Xu Dec. 11, 2017, 12:03 p.m. UTC | #2
On Tue, Dec 05, 2017 at 02:47:58PM -0500, David Miller wrote:
>
> I'll allow Herbert time to think about this some more as he requested
> in comments against the first version of this series.

Sorry for the late response.  Tom's changes look good to me.

We should also fix up all existing rhashtable users that dump
through netlink to use the new peek interface.

Thanks,
David Miller Dec. 11, 2017, 3:10 p.m. UTC | #3
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 11 Dec 2017 23:03:24 +1100

> On Tue, Dec 05, 2017 at 02:47:58PM -0500, David Miller wrote:
>>
>> I'll allow Herbert time to think about this some more as he requested
>> in comments against the first version of this series.
> 
> Sorry for the late response.  Tom's changes look good to me.
> 
> We should also fix up all existing rhashtable users that dump
> through netlink to use the new peek interface.

Thanks for reviewing Herbert, series applied.

Thanks everyone.