From patchwork Wed Nov 29 20:19:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 842713 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="ET/dUgP4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ynBhz2hDlz9s4s for ; Thu, 30 Nov 2017 07:19:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbdK2UTp (ORCPT ); Wed, 29 Nov 2017 15:19:45 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:46324 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752720AbdK2UTj (ORCPT ); Wed, 29 Nov 2017 15:19:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hig5YoBlnsDWSNA1s6BdUDsHoDpz51mGSYA/kEVuxhk=; b=ET/dUgP4J9a7ums9EZGh0VXol vs4jGbXJ1AoPvbc1L7cxhdCYIOnFxrH2iGvHvsHzy/xtYa1sX6TMVbq9w+d42B7Eedf8AraR1KXo7 0CRyko7I3l/Ei1zd66D8gffgxWua+Enz/WgPIX7dlyBXeozFYWy2rIqy3LBIf58tGi6f67osTDPSi a4Qlo5/OWOLceq7Z12yAeg0DCct6nxi50uZC+uGBfcjFiWGaJ1J9EfFBc1TbAdHeRT3I1ultqvG4o OjHLzJqYdSS5McZMKGPwU9Z5lSu0Mq232OxukyqVJj291UjqNR0KOSD/nh2yajpto6ddrXxbGSHLn DQwfR+TTA==; Received: from willy by bombadil.infradead.org with local (Exim 4.87 #1 (Red Hat Linux)) id 1eK8pS-0006Mf-53; Wed, 29 Nov 2017 20:19:35 +0000 From: Matthew Wilcox To: willy@infradead.org, netdev@vger.kernel.org Cc: Matthew Wilcox Subject: [PATCH v2 00/17] IDR changes for v4.15-rc1 Date: Wed, 29 Nov 2017 12:19:05 -0800 Message-Id: <20171129201922.24370-1-willy@infradead.org> X-Mailer: git-send-email 2.9.5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Matthew Wilcox 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(-)