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 B117BC61DA4 for ; Fri, 3 Feb 2023 20:44:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232929AbjBCUob (ORCPT ); Fri, 3 Feb 2023 15:44:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbjBCUo2 (ORCPT ); Fri, 3 Feb 2023 15:44:28 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CBC21DB8D; Fri, 3 Feb 2023 12:44:27 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so3299593wms.0; Fri, 03 Feb 2023 12:44:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=2i9kAduLyvWzDNPasV+KzeGgY8drvOps/KxoO5LHdEw=; b=Vh4yFSLP4dnir5alPOP/BdqGJ1iEQMpXhQ+vDTowlNH9vMovkkNBYPi8Uhk8C7itGw pWJPGbneNPZx8bgItqJXAuo9hewbHrvUsmkjhmhjo7iVzDaPKFrVlDjUisuzBbOPzaBk hoew3vOtR7JhNkpbPch0cih/aKZQY3wZX9AulnE0kyyhblR3bKcZnRU35XovU5/9VbYj lHi0Szbc9Ujf075Lgy9ykV7iQTSzJNKLodhKzj3evBAx2txbaKjEgLHvLZEo7Spemc80 Fne13usGX0QFsuTnmHXtqiB94MQK2ebcXK5/Xito6NgmRWOGINev3LN1yORMLgTrA/pn 3OHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2i9kAduLyvWzDNPasV+KzeGgY8drvOps/KxoO5LHdEw=; b=tQRDvalvBCu8Jr0AZDgMSa5WvOI9wSuQwQEWnyWUut5i0QdFndpJwXlscBnaTfLWKy wtfBT3bsid09OJLr0JFLMTZOsEbofvG0FLa6/DFRcmZhzvIIpKPzqAT6LlUzg3t9lT9Y U7k+l6UdCl/oa+KZjwvYiQaJCU6iOazXMbjhEcZgzt2178NBB/eSafKm2W99UUIXehOX 8j2X8N91vhwSe9op3vIL+ymyHCLJhAV0cTWag1AkP1oxTtJKcGL+Iappt/w++t+ynbUi IuTX3RJVPSyZ9prJA25WeX7t3d9aFmv9cUGGBit+j07m9yz4/lyDu2YupULJ4J+NWaO/ 3iow== X-Gm-Message-State: AO0yUKW/pCDgPFsqDHgXW+BeaDg4+0xEPxctLNO2zTuB+HrzI9Rv1lY6 y43RkoVoT0+qTnf94gRQLdM= X-Google-Smtp-Source: AK7set+E0bvJKJbO9QlN+pgygfVmSHBtgpwZ8dotHCW3HBDbg/640wbwRlbuPaDZ1oHGBTvA8Ms6OQ== X-Received: by 2002:a05:600c:1994:b0:3d3:5709:68e8 with SMTP id t20-20020a05600c199400b003d3570968e8mr10077158wmq.36.1675457065628; Fri, 03 Feb 2023 12:44:25 -0800 (PST) Received: from skbuf ([188.26.57.116]) by smtp.gmail.com with ESMTPSA id r30-20020adfa15e000000b002bfafadb22asm2834308wrr.87.2023.02.03.12.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 12:44:25 -0800 (PST) Date: Fri, 3 Feb 2023 22:44:22 +0200 From: Vladimir Oltean To: Simon Horman Cc: netdev@kapio-technology.com, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Florian Fainelli , Andrew Lunn , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , "maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER" , Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Russell King , Christian Marangi , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , "open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER" , "moderated list:ETHERNET BRIDGE" Subject: Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: implementation of dynamic ATU entries Message-ID: <20230203204422.4wrhyathxfhj6hdt@skbuf> References: <20230130173429.3577450-1-netdev@kapio-technology.com> <20230130173429.3577450-6-netdev@kapio-technology.com> <9b12275969a204739ccfab972d90f20f@kapio-technology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 03, 2023 at 09:20:22AM +0100, Simon Horman wrote: > > else if (someflag) > > dosomething(); > > > > For now only one flag will actually be set and they are mutually exclusive, > > as they will not make sense together with the potential flags I know, but > > that can change at some time of course. > > Yes, I see that is workable. I do feel that checking for other flags would > be a bit more robust. But as you say, there are none. So whichever > approach you prefer is fine by me. The model we have for unsupported bits in the SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS and SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS handlers is essentially this: if (flags & ~(supported_flag_mask)) return -EOPNOTSUPP; if (flags & supported_flag_1) ... if (flags & supported_flag_2) ... I suppose applying this model here would address Simon's extensibility concern.