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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 792F1C43334 for ; Mon, 25 Jul 2022 20:46:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbiGYUqH (ORCPT ); Mon, 25 Jul 2022 16:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbiGYUqF (ORCPT ); Mon, 25 Jul 2022 16:46:05 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C966165CF for ; Mon, 25 Jul 2022 13:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658781964; x=1690317964; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=33hQJQqe+sJK2mM+IsO2nYhvUen3O9ZN6RagIisqqQA=; b=VvbIScQVQXjB8Kd/PAdD4jQKZ2xtaCOVOy16pjup75oWjG1NFxD/7DHT cyguJt+b1GN63IbMrMwNtWe2y895aPEuvsgnuI5sw9rjq+ArNLkLzep9P IOHNfOF4ZUSwLdGC9u+ALu6L1yxY1MnrC7QMtmYnz6ioPyA1ia5nES2+z 4x5mQ9cBQ0xZyDNWlaj3SQe2wGOfuUieVkJOmQT/FshvCWGPUiWv9j0U9 6Uig59+zTRvLv2ddBJ/+AofewWpJjyZOiVEZajIEYUrpgSIhml7YZbOiJ QaP03s6MD/gW8R/VhB7h8R4i94zgBctBeIlxmlS7GgWbU6yMVI4ZGYSFg Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10419"; a="349492744" X-IronPort-AV: E=Sophos;i="5.93,193,1654585200"; d="scan'208";a="349492744" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2022 13:46:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,193,1654585200"; d="scan'208";a="627609828" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga008.jf.intel.com with ESMTP; 25 Jul 2022 13:46:04 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 25 Jul 2022 13:46:03 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Mon, 25 Jul 2022 13:46:03 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.176) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Mon, 25 Jul 2022 13:46:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XleI2xecPzm+J2yIBm6Scp52a6VNvt422x92csrzyJQe8nYppUQQ6Dir3U/TRjtLloCYB2Rkq5itVEMkG0NceZY67PIDx5luk5ykf4R8sUl3pTp9PR4gfK7strc1T5Kcqoal3eTbX0btSOSKyHUZIhDJZqjSVes9ouDerkvw0ztUugONOLu9a585kFPJ7nlysXkbMl4eoWwjze6NAoxuPDHPqVGiNjpgyaKO+p0S7lygVBLmMHeQ0CEPWCPfSZHrle6lUvGn7vN6OP8LZcjOwPwjU5uR36EpA8HZW9VQMbS+hkzlFB8LO2E8ug0co60tsFVotaDkM2JsWitStGLMxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=w7XgROPOjLM0mL7Aziw8Ukto1hNEWASr0KCLULgk9wY=; b=kMUqeQpk8xfxpx7KfInj0DdIaxMbVS6Jiky0/1XXB3APwLgVvAOMyUbqO0sLAoqIA+NHppK1/C0D66QkYqrkVYk/TuE8MIbwkRjdg6JYirrTgfaXFjUKxPEtMDZ3ieUw1/PEDwn5n/TGf/Sxc2vvtRhxiU/YFIjIZd8BQDq9Z6y1ddtp6zywOyimgMmqLT7MB/M/84cnYVE872L6WVi6NRSmj1cLj8gswwnW3EVu9ZB+Xx71QxtAmAJl10RyLx49x+MkjHyNlWEexpotcx6Z0Sa845DytdqiSZrXjPsQJ0YhHDM6UftDRp3ctsYIHvbHkwiLS7MyEYkEM31oXXBtxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SA2PR11MB5100.namprd11.prod.outlook.com (2603:10b6:806:119::11) by DM6PR11MB2586.namprd11.prod.outlook.com (2603:10b6:5:c0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.20; Mon, 25 Jul 2022 20:46:01 +0000 Received: from SA2PR11MB5100.namprd11.prod.outlook.com ([fe80::f97c:8114:1f0c:f811]) by SA2PR11MB5100.namprd11.prod.outlook.com ([fe80::f97c:8114:1f0c:f811%6]) with mapi id 15.20.5458.024; Mon, 25 Jul 2022 20:46:01 +0000 From: "Keller, Jacob E" To: Jakub Kicinski CC: Jiri Pirko , "netdev@vger.kernel.org" Subject: RE: [net-next PATCH 1/2] devlink: add dry run attribute to flash update Thread-Topic: [net-next PATCH 1/2] devlink: add dry run attribute to flash update Thread-Index: AQHYnGds4JyoDr5oaE22k7ooTa/97q2IU/QAgAD0rTCAAKRdgIAA9+uwgAE35ICAA1xV4IAACoOAgAAM5bCAAAIMAIAAACQQ Date: Mon, 25 Jul 2022 20:46:01 +0000 Message-ID: References: <20220720183433.2070122-1-jacob.e.keller@intel.com> <20220720183433.2070122-2-jacob.e.keller@intel.com> <20220725123917.78863f79@kernel.org> <20220725133246.251e51b9@kernel.org> In-Reply-To: <20220725133246.251e51b9@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e6f6ab5d-2f9e-4f17-0482-08da6e7eaf94 x-ms-traffictypediagnostic: DM6PR11MB2586:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /7HwkzBbkHR2s4vgBtSjhhXIX/c001b9+35mHfHEv4FYnTTUzlJ0UKK+xckX+sx2X5L7YFrcd06HBad6Ws7pwKZ2OnRPVATsjtXNwL0QnJzEhltmR8v2DnxmyiZpwfyXoWMp7W/bXrc7tFex0ZMH7GDPfLYaZFgV77sbVs0P6/Iox8bO75PZerLHpojDszvt/BemtqB7p3LdSWN+30fC5BNjEs2daSF5BGquMHCFwmU0SER5UrU6pNJLJsUQt5sY/KnVuRTMpFsnxJPcZLU+ovnoc24BvXFbeX74EiZ0oqk+5O/mIO9kIgQljst9/lsWatqMzd1McsZy2AjtvWZK8UuZ9mckqX/g+aOrbr2wV9mG0SLKcBG9Zz+bvONEMs4JB3A+WP4amHM/S+y7+38RE9rU6+LkCM+REG08fA293bRogR7iQnsa6SK4iE4rwWspOxed3YVShIX6DeixFD705VyWveD/2TbUCYdz04pB2RWCPbL2RslaJBBumU7ro0GZyJGNnC0At4D2XX3PhsE4XiQ9p8AAFXq7dT32V2gqIacXUbFMYZWAf2MfCFXczqaQVHRAa8zthMlxDeEf0qoRTB8u0KZqxY7ugBQFYl1CWbhQNS1CPpepXJfXbY4CjhDzKstNulIfmMc6xT03Nv1Pex5ExdKrIHBWcRti5DKDWtjrF4vxulDHx317ZL3v+PXyhBSvCqqRnsvO5tAYybUdF4gDFWWJrbHDLukHLmrTjdPyt18ZRtwtD/LV4V5pTK51RnFtCne24Ylcqwma8XArovA+QyyX1w8Gf/HSwlIL6VJG50sclzfuL7UEuqYGokgk x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA2PR11MB5100.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39860400002)(366004)(376002)(396003)(136003)(346002)(6916009)(83380400001)(54906003)(316002)(9686003)(7696005)(53546011)(55016003)(6506007)(33656002)(478600001)(41300700001)(26005)(86362001)(186003)(52536014)(8936002)(2906002)(5660300002)(4326008)(38070700005)(82960400001)(15650500001)(71200400001)(64756008)(66946007)(66556008)(66476007)(66446008)(76116006)(8676002)(122000001)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XTthsfTY3yrCMdh1DSvhp8oQkg0gMaR9Cr3JJoQ4A5r8nOFJVY/8qozqFuV5?= =?us-ascii?Q?5/NMAUE0lZs2ujTQ6lCDM2aE7Uoretayij1dvQ+k6Tg3ShyH+DwryLmUOB2Z?= =?us-ascii?Q?hyIiK67FRm6LF5/74sKz4w+sfRocA9HmOudzHfBJqiXFR0eHNWXRz2Zakftc?= =?us-ascii?Q?P0fG29OYo4yb3QlKRp30PP1UvxftbRzVVUYjyY0taHiy8AsyNqE4Kq/80lm8?= =?us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Z8+XmKC89wcIZ/i/4Ht82?= =?us-ascii?Q?DLemI9osbyq/MOpRfZNBYS9auKFKDw29impy1HbgVP7jenrI++0u3ctj/Meb?= =?us-ascii?Q?HAmoyTQUyNTy+PoFqjPKU50yiQC3HhnOpmyEkgwoOUd9wnx08lWggIq6lBlz?= =?us-ascii?Q?/dYjARhlDXZizdUOiN5RGQwxlbO10CrsL77MOgWNZ8/dd58z7FLVRSfPCtg2?= =?us-ascii?Q?IdJNmL/ObkoNjec7+/qsvco9phyS3+7RZkF0Ht/FL9dKth8BpG1Qc2/a1xfC?= =?us-ascii?Q?QDnfR14ucHDJVp9sexGPdt4EoHNibZG653iw/Jl+ufSVl9zoZaIqfiabFocx?= =?us-ascii?Q?QZ+KWVubq7/4Tx70nrDHyDZ++YcacyabFFanJW7JTMnFpgRUB2j22I7lVfVm?= =?us-ascii?Q?3iQvAD3/lOtoA5XK55e4d2sxitDOKXgXsprPlFqM+Rsj9bf/r+Aos1JOK33V?= =?us-ascii?Q?ndz7lpE2fD4kBAnV6FnjyZfSNlkOZaiMa7MA6/Ko?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR11MB5100.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6f6ab5d-2f9e-4f17-0482-08da6e7eaf94 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2022 20:46:01.6525 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 50Hh+pjR94kOCFCn9z83fu+08At4cUTQYlebKmLpRCMTcWGVkmXB+PPzLcGnJL3uCQgrhJbrhUT3pVypR+AHR//Vz/NJv0pb75/Mtbdr1/c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2586 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > -----Original Message----- > From: Jakub Kicinski > Sent: Monday, July 25, 2022 1:33 PM > To: Keller, Jacob E > Cc: Jiri Pirko ; netdev@vger.kernel.org > Subject: Re: [net-next PATCH 1/2] devlink: add dry run attribute to flash= update >=20 > On Mon, 25 Jul 2022 20:27:02 +0000 Keller, Jacob E wrote: > > > ...or repost without the comment and move on. IDK if Jiri would like > > > to see the general problem of attr rejection solved right now but IMH= O > > > it's perfectly fine to just make the user space DTRT. > > > > Its probably worth fixing policy, but would like to come up with a > > proper path that doesn't break compatibility and that will require > > discussion to figure out what approach works. >=20 > The problem does not exist for new commands, right? Because we don't > set GENL_DONT_VALIDATE_STRICT for new additions. For that reason I > don't think we are in the "sooner we fix the better" situation. There are two problems, and only one of them is solved by strict validation= right now: 1) Does the kernel know this attribute? This is the question of whether the kernel is new enough to have the attrib= ute, i.e. does the DEVLINK_ATTR_DRY_RUN even exist in the kernel's uapi yet= . This is straight forward, and usually good enough for most attributes. This= is what is solved by not setting GENL_DONT_VALIDATE_STRICT. However, consider what happens once we add DEVLINK_ATTR_DRY_RUN and suppor= t it in flash update, in version X. This leads us to the next problem. 2) does the *command* recognize and support DEVLINK_ATTR_DRY_RUN Since the kernel in this example already supports DEVLINK_ATTR_DRY_RUN, it = will be recognized and the current setup the policy for attributes is the s= ame for every command. Thus the kernel will accept DEVLINK_ATTR_DRY_RUN for= any command, strict or not. But if the command itself doesn't honor DEVLINK_ATTR_DRY_RUN, it will once = again be silently ignored. We currently use the same policy and the same attribute list for every comm= and, so we already silently ignore unexpected attributes, even in strict va= lidation, at least as far as I can tell when analyzing the code. You could = try to send an attribute for the wrong command. Obviously existing iproute2= user space doesn't' do this.. but nothing stops it. For some attributes, its not a problem. I.e. all flash update attributes ar= e only used for DEVLINK_CMD_FLASH_UPDATE, and passing them to another comma= nd is meaningless and will likely stay meaningless forever. Obviously I thi= nk we would prefer if the kernel rejected the input anyways, but its at lea= st not that surprising and a smaller problem. But for something generic like DRY_RUN, this is problematic because we migh= t want to add support for dry run in the future for other commands. I didn'= t really analyze every existing command today to see which ones make sense.= We could minimize this problem for now by checking DRY_RUN for every comma= nd that might want to support it in the future...