Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3135511ybt; Mon, 22 Jun 2020 16:11:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLRnFU7SSun6g3htxZRssG49DRUz0JFDlMOLMRWO9InTJ8tfSAh3Ni7UnbfgOUM/uWui64 X-Received: by 2002:aa7:da89:: with SMTP id q9mr886884eds.273.1592867491538; Mon, 22 Jun 2020 16:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592867491; cv=none; d=google.com; s=arc-20160816; b=oK7ICGv3wiBzpzP945Dz6Hm/wL4MYcfjTJh7h/QbQCaSrgTblZ2BGY/rj9xFvNspjO ZDuWhK/z9roDjfzJxIqPCPpuS3NnLyvYNTbOadf9GCsz3ePbFwKVRuciMQKEUQ4LgBBf zXSgMtkVSFvXNGYgw2pu1UjfXzPsUzS1NY54Ms+mHNhwtMoJGUjMA4dS4x4rEbVGqHzA 5BFd0WADZXKTiHOp81JEohjsligsk+kD3BqJj7QYBYo2p1DjNeijtbJXvj5c3MHl3p4d 1fYEPhl/AkCp/k7ZN8JcUBCa/rfiVDfpo6TFAk9VSmYCwQCi5ZKYY/svW++xSCklOSAW vMQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=S9ecp9sK2YUHP+5NhZirkoolqxnOjLAWWusJ4iHgww0=; b=qay5FllzKYT6TeURRyKhRHXlGjLXy+SiFtZXjWz0lmcEvIKwZjy9vzZ49PLM6noI0B HiF+Wrk3RTZQXycMB61B/LhbVZQCUdrHFqoif/y+YP/9H+EgZweEVQ0e4cTttDZohg6I Yumz9Ipl+KgUjCtqpqhVlgt3A0fX9NH/Uaco7d7NeTCD7gaGQoiYkM5EOzGKu/ksZat7 kZuq2u8jmm014YgrAA/U7uXc5YER+vm+kcXClgZesEBHQ42H5nb8enN0aUdZuzXfoCAl +2i/gt2LzZ/IZrMddpxC5dhHUdTehfUgPw19F9ibEcZfJUH3GO5LH6ks3thfjZPfOPx/ vQ3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz19si9884113edb.40.2020.06.22.16.11.09; Mon, 22 Jun 2020 16:11:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731444AbgFVXHP (ORCPT + 99 others); Mon, 22 Jun 2020 19:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbgFVXHO (ORCPT ); Mon, 22 Jun 2020 19:07:14 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44563C061573; Mon, 22 Jun 2020 16:07:14 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id B1BDA1296E6DB; Mon, 22 Jun 2020 16:07:13 -0700 (PDT) Date: Mon, 22 Jun 2020 16:07:12 -0700 (PDT) Message-Id: <20200622.160712.2300967026610181117.davem@davemloft.net> To: horatiu.vultur@microchip.com Cc: nikolay@cumulusnetworks.com, UNGLinuxDriver@microchip.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [Resend PATCH net] bridge: uapi: mrp: Fix MRP_PORT_ROLE From: David Miller In-Reply-To: <20200620131403.2680293-1-horatiu.vultur@microchip.com> References: <20200620131403.2680293-1-horatiu.vultur@microchip.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 22 Jun 2020 16:07:13 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Horatiu Vultur Date: Sat, 20 Jun 2020 15:14:03 +0200 > Currently the MRP_PORT_ROLE_NONE has the value 0x2 but this is in conflict > with the IEC 62439-2 standard. The standard defines the following port > roles: primary (0x0), secondary(0x1), interconnect(0x2). > Therefore remove the port role none. > > Fixes: 4714d13791f831 ("bridge: uapi: mrp: Add mrp attributes.") > Signed-off-by: Horatiu Vultur The code accepts arbitrary 32-bit values for the role in a configuration but only PRIMARY and SECONDARY seem to be valid. There is no validation that the value used makes sense. In the future if we handle type interconnect, and we add checks, it will break any existing applications. Because they can validly pass any non-zero valid and the code treats that as SECONDARY currently. So you really can't just remove NONE, you have to add validation code too so we don't run into problem in the future. Thanks.