netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/17] IDR changes for v4.15-rc1
@ 2017-11-29 20:19 Matthew Wilcox
  2017-11-29 20:19 ` [PATCH v2 01/17] idr: Fix build Matthew Wilcox
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Matthew Wilcox @ 2017-11-29 20:19 UTC (permalink / raw)
  To: willy, netdev; +Cc: Matthew Wilcox

From: Matthew Wilcox <mawilcox@microsoft.com>

v2:
 - Rebased on f6454f80e8a965fca203dab28723f68ec78db608 to resolve
   conflicting changes with cls_bpf
 - Fix whitespace
 - Change a WARN_ON to WARN_ON_ONCE (git snafu yesterday)

Original cover letter:

The patches here are of three types:

 - Enhancing the test suite (fixing the build, adding a couple of new
   tests, fixing a bug in the test)
 - Replacing the 'extended' IDR API
 - Fixing some low-probability bugs 

As far as the 'extended' IDR API goes, this was added by Chris Mi to
permit a savvy user to use IDs up to ULONG_MAX in size (the traditional
IDR API only permits IDs to be INT_MAX).  It's harder to use, so we
wouldn't want to convert all users over to it.  But it can be made
easier to use than it currently is, which is what I've done here.  The
principal way that I've made it easier to use is by introducing
idr_alloc_u32(), which is what all but one of the existing users
actually want.

The last patch at the end I thought of just now -- what happens when
somebody adds an IDR entry with an ID > INT_MAX and then tries to
iterate over all entries in the IDR using an old interface that can't
return these large IDs?  It's not safe to return those IDs, so I've
settled for a dmesg warning and terminating the iteration.

Matthew Wilcox (17):
  idr: Fix build
  radix tree test suite: Remove ARRAY_SIZE
  idr test suite: Fix ida_test_random()
  IDR test suite: Check handling negative end correctly
  idr: Delete idr_remove_ext function
  idr: Delete idr_replace_ext function
  idr: Delete idr_find_ext function
  idr: Add idr_alloc_u32 helper
  net sched actions: Convert to use idr_alloc_u32
  cls_basic: Convert to use idr_alloc_u32
  cls_bpf: Convert to use idr_alloc_u32
  cls_flower: Convert to idr_alloc_u32
  cls_u32: Reinstate cyclic allocation
  cls_u32: Convert to idr_alloc_u32
  idr: Rename idr_alloc_ext to idr_alloc_ul
  idr: Rename idr_for_each_entry_ext
  idr: Warn if old iterators see large IDs

 include/linux/idr.h                     | 109 ++++++++++--------------
 include/linux/radix-tree.h              |  17 +---
 lib/idr.c                               | 143 +++++++++++++++++++++++---------
 lib/radix-tree.c                        |   3 +-
 net/sched/act_api.c                     |  72 +++++++---------
 net/sched/cls_basic.c                   |  33 ++++----
 net/sched/cls_bpf.c                     |  30 +++----
 net/sched/cls_flower.c                  |  34 ++++----
 net/sched/cls_u32.c                     |  51 +++++-------
 tools/testing/radix-tree/idr-test.c     |  22 ++++-
 tools/testing/radix-tree/linux/kernel.h |   2 -
 11 files changed, 266 insertions(+), 250 deletions(-)

-- 
2.15.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-11-29 20:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-29 20:19 [PATCH v2 00/17] IDR changes for v4.15-rc1 Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 01/17] idr: Fix build Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 02/17] radix tree test suite: Remove ARRAY_SIZE Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 03/17] idr test suite: Fix ida_test_random() Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 04/17] IDR test suite: Check handling negative end correctly Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 05/17] idr: Delete idr_remove_ext function Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 06/17] idr: Delete idr_replace_ext function Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 07/17] idr: Delete idr_find_ext function Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 08/17] idr: Add idr_alloc_u32 helper Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 09/17] net sched actions: Convert to use idr_alloc_u32 Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 10/17] cls_basic: " Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 11/17] cls_bpf: " Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 12/17] cls_flower: Convert to idr_alloc_u32 Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 13/17] cls_u32: Reinstate cyclic allocation Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 14/17] cls_u32: Convert to idr_alloc_u32 Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 15/17] idr: Rename idr_alloc_ext to idr_alloc_ul Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 16/17] idr: Rename idr_for_each_entry_ext Matthew Wilcox
2017-11-29 20:19 ` [PATCH v2 17/17] idr: Warn if old iterators see large IDs Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).