From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43F76C43381 for ; Wed, 27 Feb 2019 14:28:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03A8220C01 for ; Wed, 27 Feb 2019 14:28:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="fSLLRTqb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730322AbfB0O2q (ORCPT ); Wed, 27 Feb 2019 09:28:46 -0500 Received: from mail-eopbgr50044.outbound.protection.outlook.com ([40.107.5.44]:7520 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728004AbfB0O2q (ORCPT ); Wed, 27 Feb 2019 09:28:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a5+LnAJjK+NjqfG1Z8k+Lk/UfJVBcYDDtKGm5yuo9c8=; b=fSLLRTqbnWGV7Zn0e71n3B8Gl8HH2bgJ0KGxamJThHNjl1jQHmL4pKUzMp2+mC5m+iTn8TADZdXgirm23PZTO6xazokJk5AftTj40qZB09B80URnA7h65eZsPq7ZHDxDQrebEk+Nk6TKY+OK4IzkpoAHwz5zJFaPBQZE2DwEOoM= Received: from HE1PR0502MB3641.eurprd05.prod.outlook.com (10.167.127.11) by HE1PR0502MB3803.eurprd05.prod.outlook.com (10.167.127.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.16; Wed, 27 Feb 2019 14:28:42 +0000 Received: from HE1PR0502MB3641.eurprd05.prod.outlook.com ([fe80::b03d:8cd4:d259:f749]) by HE1PR0502MB3641.eurprd05.prod.outlook.com ([fe80::b03d:8cd4:d259:f749%5]) with mapi id 15.20.1643.019; Wed, 27 Feb 2019 14:28:42 +0000 From: Vlad Buslov To: Cong Wang CC: Linux Kernel Network Developers , Jamal Hadi Salim , Jiri Pirko , David Miller Subject: Re: [PATCH net-next] net: sched: set dedicated tcf_walker flag when tp is empty Thread-Topic: [PATCH net-next] net: sched: set dedicated tcf_walker flag when tp is empty Thread-Index: AQHUzSA84+Ovu25HxU6CQqb1GENP0KXxH2oAgAEQo4CAAH2gAIABCYaA Date: Wed, 27 Feb 2019 14:28:42 +0000 Message-ID: References: <20190225153831.10037-1-vladbu@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0452.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::32) To HE1PR0502MB3641.eurprd05.prod.outlook.com (2603:10a6:7:85::11) authentication-results: spf=none (sender IP is ) smtp.mailfrom=vladbu@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5da29673-6586-4f5b-494f-08d69cbfdf4b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:HE1PR0502MB3803; x-ms-traffictypediagnostic: HE1PR0502MB3803: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1;HE1PR0502MB3803;23:UySmgGFiFAX2dnKtHQXd+C+Z53Q0WD7C/vZ2H?= =?iso-8859-1?Q?IxmsLpsQ3lCQESbDI78pUFPLssrwBe75ixXq8I4m3KViJv8XAXnzh8R0wf?= =?iso-8859-1?Q?2J67xUzQI19GnDLT/F4Xdg4e9+g45R84gkbmaZRpZJ0dVCoSSW8cI7yRYZ?= =?iso-8859-1?Q?is9+xEJoxS5JLBZDS/Od7BavlYqM7AYtCLugzC53B3aXRqIcusxcnoR2xl?= =?iso-8859-1?Q?u4xpkOVIUO1isOndiOLf04Y96NdlRIi6wdmVUqEk3D3DJGytd/wdvl6+F6?= =?iso-8859-1?Q?F9J9kZypt5OEMSfZN0C5dmpovYu580K7uM4OMziCf5RXcYEA6+EIQ778p+?= =?iso-8859-1?Q?DM5g9ZGVKwI2CSRUbzxf3myOqovIP7357+dnObZzMWbM/mzKRBlh/BmYAA?= =?iso-8859-1?Q?JiIIQaCaIlRsWx/dk7PtuzRayuvF6xaixF6sTzslGRSOMC432sFZ5eur3V?= =?iso-8859-1?Q?CM1vc/OLmA6XPovDGXOvDsIyQv0AoXbhXnDICumgpa9w0J5QfuyPTDkzg4?= =?iso-8859-1?Q?0HAwRCc0Md+qmQ4ROHF5uxNtGvlxiBq+MFH+K2miXLpzyO/w1Fk1Qdt8fT?= =?iso-8859-1?Q?8xH+fQYQb5jAN+vatyrCRkp++EwPluowLlWUUUoLAaEZEZhUfzWWWSVf7W?= =?iso-8859-1?Q?EQRoJ5ehBQuC5O9QBgoWoq3cTm+JrxDJj/Rmdib2/9p/ocyMF6HLNccNHs?= =?iso-8859-1?Q?eBzrtS50wTy7vjGt4PtpwBAtVZISFUbkFPxIshqJ1RqfTIJp6BlBtAMt6Z?= =?iso-8859-1?Q?m4o+c9N+BtUlR8W2xri78sfoCJlSTMfuiqW8ZBHrU4t8kFwd0epYG6EHIU?= =?iso-8859-1?Q?cgIXHFpWOQ9uCKQd9errJRoxRzPd32mFYtPf4HXHRpDV8yXuoevpZ3zKGd?= =?iso-8859-1?Q?MPtxQwmxBeZoDMh5Rlbtzv+3tb9fY4gKK6BmMAyxdJ6hR61lAh20VN52vd?= =?iso-8859-1?Q?XhB3c5pdK85tiCJpFwSdvlyFWgC4c+33tC3K9hpacxihEn52UNIfnf9Kra?= =?iso-8859-1?Q?LAXGWe+VHlWlrlfGBWLU6/Gl98q+i24w7/WJ2sFbF94PemAPQ6de+c1zXh?= =?iso-8859-1?Q?Q4m9QBdqSK0nuP9P9n0CT8OU+kAQewMbLEMXLopXV3UYoF5TRuLAUrwiJV?= =?iso-8859-1?Q?j/8NnQRDMTBhFBPAJBWYTZUKA5X/bn+uJd4YtbkUfuzLCctLaqInrQdBgK?= =?iso-8859-1?Q?aJhvkJwTX5xtRFD0KQ4wP8pfAtsYpnPO9V3GM29lDXFD0OVdRvcpIp1+2m?= =?iso-8859-1?Q?xvJR6DqHbY5wn4u5Me9lptnelmuPo1P5iuVLqcX6m8jVooRrdmT5miZBbj?= =?iso-8859-1?Q?0fmBgAvcv4hey2DZQpSRKv33h?= x-microsoft-antispam-prvs: x-forefront-prvs: 0961DF5286 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(366004)(396003)(136003)(346002)(199004)(189003)(229853002)(6246003)(106356001)(66066001)(25786009)(93886005)(105586002)(5660300002)(68736007)(6486002)(14444005)(4326008)(316002)(6916009)(71190400001)(71200400001)(26005)(2616005)(102836004)(6436002)(36756003)(305945005)(53546011)(14454004)(256004)(6512007)(7736002)(186003)(76176011)(486006)(476003)(52116002)(3846002)(478600001)(53936002)(8676002)(54906003)(8936002)(99286004)(11346002)(2906002)(386003)(97736004)(86362001)(81166006)(446003)(81156014)(6116002)(6506007);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0502MB3803;H:HE1PR0502MB3641.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 4LoAxTH/JHrXDvIIZHJ8TTO8tMTTETG3yH6Rl3nzaFJY+45pswBhOWVG9+tlm7Gdo7kjpcbedBJ5nO6f0994U6OZxebEm66yKUvh9eC58C077OSRNAH3xSdJ/VKX25FmEIhgmp3eanQzHz20xjGPW9Y+4HhUJpTrnmg+umY0/2h0DMNHc+TrKAipykiixA4WYxtimijMK0eqTgqwmWk4rDVAIOU1zXxr519ERX51QE/0igF904sUo1+IGK3RwzxVQP9IkS9eb8hhL7YplMGQ56T2gt6JXIlGZRgWmHhv0rJynj/D8W8dkSQuEfY95vtij9fVTtBXSMV9747GzOa2eIoq/uCtsolKsjcs3LIP7Wtx+B6wBbqhLuTpHNcaAcmp+6Ed3T/KCrtBpVXtSSlhDr38guTOVo+3+VlBn3TTMsQ= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5da29673-6586-4f5b-494f-08d69cbfdf4b X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2019 14:28:40.9136 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3803 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue 26 Feb 2019 at 22:38, Cong Wang wrote: > On Tue, Feb 26, 2019 at 7:08 AM Vlad Buslov wrote: >> >> >> On Mon 25 Feb 2019 at 22:52, Cong Wang wrote: >> > On Mon, Feb 25, 2019 at 7:38 AM Vlad Buslov wrot= e: >> >> >> >> Using tcf_walker->stop flag to determine when tcf_walker->fn() was ca= lled >> >> at least once is unreliable. Some classifiers set 'stop' flag on erro= r >> >> before calling walker callback, other classifiers used to call it wit= h NULL >> >> filter pointer when empty. In order to prevent further regressions, e= xtend >> >> tcf_walker structure with dedicated 'nonempty' flag. Set this flag in >> >> tcf_walker->fn() implementation that is used to check if classifier h= as >> >> filters configured. >> > >> > >> > So, after this patch commits like 31a998487641 ("net: sched: fw: don't >> > set arg->stop in fw_walk() when empty") can be reverted?? >> >> Yes, it is safe now to revert following commits: >> >> 3027ff41f67c ("net: sched: route: don't set arg->stop in route4_walk() w= hen empty") >> 31a998487641 ("net: sched: fw: don't set arg->stop in fw_walk() when emp= ty") > > Yeah, and probably commit d66022cd1623 > ("net: sched: matchall: verify that filter is not NULL in mall_walk()"). > > Please send a patch to revert them all. > > Thanks. I think commit d66022cd1623 ("net: sched: matchall: verify that filter is not NULL in mall_walk()") and commit 8b58d12f4ae1 ("net: sched: cgroup: verify that filter is not NULL during walk") shouldn't be reverted. They are still necessary to prevent tcf_chain_dump() from dumping NULL filter pointer. It can happen when dump is initiated in parallel with inserting first filter to unlocked classifier. tcf_fill_node() verifies that filter pointer is not NULL, so it will not crash, but will output tcf_proto info for second time. This might "confuse" user-space. What do you think?