Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp15599lqp; Tue, 11 Jun 2024 12:55:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVt/Cbw1r0OluKhCNCbjON1EYvgJOcQQ/gOQbRqrFyuBi7OgZKbV32slf9revYYlpCQFyWGBSN+Za3FFVMdpWI06YvHM7SvlQOhgisJew== X-Google-Smtp-Source: AGHT+IH0M6PjzZULPNWssMSEEgTtt7sm5ktFqhxjYy96h5/ppSHLA8p4Tg5IznfCfYbi/9Uk4+NH X-Received: by 2002:a17:902:e5c4:b0:1f6:77e3:774c with SMTP id d9443c01a7336-1f6d02f6843mr167777105ad.38.1718135702206; Tue, 11 Jun 2024 12:55:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718135702; cv=pass; d=google.com; s=arc-20160816; b=Towlvnchv5w4rDF8Zm81/TLtNUbiICnhEcJ/eR7L2230BmM2na7XLc+mB8HjTtTgk3 kVhjBhl5lDkqNSkmS6EQO1iQn4xS0se/f4exL/9nxj4gYZEip+49KWtyc77GNgxWzyWr 9UO016u2QSPHuxK2vYuBr5jwl2GF2PbLrfdwLqHklRk46CvU3T7NCNodrIB0Vq2Fks0/ nmDEtmiqDEZJNPd/qT55Y5LjJLNDBYoDUg/eTpdTW6qDoHXcl5++ZUUg+dhmOYxPd8+i WhZSyc6IbXluyC/Ic1HJU0ZjkrLTIqDK/xyfjPV3T/47QWP3EnpcIW3vdutgsaPSyxxb k5oA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9eANHmQBc3AlTNfbBTeiU+zRfE2tvSTSJjYs0pCCYYY=; fh=K8A0LT/ddgmCRMK5eBTgY3PlBikTgLSXF4I53Mz79gk=; b=QAHLjJf+m1P2RlcjV4ruMBMwJoIu7zCOW0mDNwh6Z5IX6S12JoMBYfNFq9zJ4TUBqy CEqN4nHbJLJAVwAL2Os2Y/x3xxi/8rh85OFd9pwnq+kpD52wCzppk0/dEbe2b3aHlvpd 4XO0yir+R7NLzmDAzBOBIFGAnyoLLbKsaBhOrAFS8hMnvKSgy5xAevCReMK5qfF1HfGw /ejV1OGvmTmByLwMmBRaS4LOwmtmiylPyM9xHg2X7xPlb9t7AYdbSMX0RMV+El4rHlBH sLQ30ZXtZeQyx2Ftib3beWYyse1C8A7GW1zxkC9JK+Ti2Gr5n9peGTYpNIzA1ntMxkrQ ns4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TFq+qx36; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210541-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f737636abesi12716975ad.13.2024.06.11.12.55.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:55:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210541-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TFq+qx36; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210541-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210541-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B2D09281C3A for ; Tue, 11 Jun 2024 19:54:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9576A156864; Tue, 11 Jun 2024 19:51:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TFq+qx36" Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21959156C47; Tue, 11 Jun 2024 19:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718135489; cv=none; b=d4IuZK6WOttaTu/SlNQZ8OZmbz2UWShWP42riIPGniG40BXTrKixXn/mctXpkhyHUFRb4KfKPTNeYAHCmPSyFgWvGG1WI6aPOlHkoIdXEnQVSXdnKqKQ+9yR5zlRlg8G2GAWakrJJu2FREyTPoWYc0eQnBhf8D+QKCgHQ0elisw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718135489; c=relaxed/simple; bh=X0ZPmfLloqmpVIb9TshXzGhKrVzZ8CtutBNGM8GN3qM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FJKGyOR7F+TwP1ajWSPvuD8wms48DQRZUKCifO4EcPF6b8cIxLKiKKej9k+k794FlXgHE6sAoiuXHNghVFlqhP49dLhVfU9UvkCDeJ4HvOEInQ1c6IyurwjtDW2wMQhtVlbAEo2w4wTXEiHu2P55leP1Owp9dNXe6sjhVenOwVk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TFq+qx36; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2eaa89464a3so65982241fa.3; Tue, 11 Jun 2024 12:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718135486; x=1718740286; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9eANHmQBc3AlTNfbBTeiU+zRfE2tvSTSJjYs0pCCYYY=; b=TFq+qx36VvgQxufz1JVjWGNw/vfNB/IPziUlYeFQosZ7WGuGmQZ0fkZ2E+ATY9Z1Vr jeqiON9y5Bo7+ma6Y3AuzXz5Rx+lEEpQE4SLjTWg+GHLdpHqrGZc4qZZ95roOtBpijzc CxR97mWS1l9USD1pRo36Kl8Xj3co9IBYP+mFCn4lyn/jo52xHNXYLuhyqWDgSyIdqAw/ 7lw2bb8VnJEiy9Bhy/mZOcGILouVY0jl6v1abQIVPxdPsmnEQv5rhFM12tV43Hnw4jt9 pVqzyWkofRWY9DFtoCr29KmL1YWzHGFhwJC9R/mp/oEvHAVIuKK727X1aRuTdk61agJd ztKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718135486; x=1718740286; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9eANHmQBc3AlTNfbBTeiU+zRfE2tvSTSJjYs0pCCYYY=; b=MDh8we96Va1Vm5XeEiJehntIYnUjVOA7DjNTt5UJjCSvy0urZvsmlY0D2a0QtgCT5s pq+qRJYOfzp9QMdJohOoDi89s9vVE3pcLc6KYQc8S2igr9xjpH1gKl9a2uvLo1w49ZVQ EcYORbakMwkJWT31FyEqqvZy05k/9cQCLemJiAwlyOI6eRNsA8GoYXQ3y/VXsKvNnnG8 nmNZXWWGjpqo15f/TmTTlyxySrYGm2T17+WQ1eS+H3liXC86DhXj30Ye0/ZE62OShJqN HhvWxdP0mC1wTO9ngsu7kCpB1mY4iizyPstfneCEOZYrnQIPszbke4b/z1e+IvAannWl r4NA== X-Forwarded-Encrypted: i=1; AJvYcCVuOnN+arinXu4nQK6qGC5KIt5JLO2nQRfGdL8i7wBCQGNgzSe3UKetXPnZDoGro5wYhjbJQkrztMmWAiDUaX1nfSrA7a2ZwnqVSx3Z X-Gm-Message-State: AOJu0YzNDM189lJ23QBJD9Zkewob0vNVoYid6rPxz1EsciQM4f6yF2TK 6HSJnFpKSlj5DAfPh4a33mKq2VUyzyNBDYVgeZLdyyV13HPQ6nyhIbU4ENcw6Cs= X-Received: by 2002:a2e:2d01:0:b0:2ea:85f0:9165 with SMTP id 38308e7fff4ca-2eadce35604mr85032271fa.19.1718135486075; Tue, 11 Jun 2024 12:51:26 -0700 (PDT) Received: from WBEC325.dom.lan ([185.188.71.122]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57c7650b371sm5286737a12.76.2024.06.11.12.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:51:25 -0700 (PDT) From: Pawel Dembicki To: netdev@vger.kernel.org Cc: Pawel Dembicki , Vladimir Oltean , Florian Fainelli , Linus Walleij , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Russell King , linux-kernel@vger.kernel.org Subject: [PATCH net-next 09/12] net: dsa: Define max num of bridges in tag8021q implementation Date: Tue, 11 Jun 2024 21:50:01 +0200 Message-Id: <20240611195007.486919-10-paweldembicki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611195007.486919-1-paweldembicki@gmail.com> References: <20240611195007.486919-1-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Max number of bridges in tag8021q implementation is strictly limited by VBID size: 3 bits. But zero is reserved and only 7 values can be used. This patch adds define which describe maximum possible value. Suggested-by: Vladimir Oltean Signed-off-by: Pawel Dembicki Reviewed-by: Florian Fainelli Reviewed-by: Linus Walleij --- v1: - resend only --- Before patch series split: https://patchwork.kernel.org/project/netdevbpf/list/?series=841034&state=%2A&archive=both v8: - resend only v7: - added 'Reviewed-by' only v6: - resend only v5: - added 'Reviewed-by' only v4: - introduce patch drivers/net/dsa/sja1105/sja1105_main.c | 3 +-- include/linux/dsa/8021q.h | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index ee0fb1c343f1..0c55a29d7dd3 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -3167,8 +3167,7 @@ static int sja1105_setup(struct dsa_switch *ds) ds->vlan_filtering_is_global = true; ds->untag_bridge_pvid = true; ds->fdb_isolation = true; - /* tag_8021q has 3 bits for the VBID, and the value 0 is reserved */ - ds->max_num_bridges = 7; + ds->max_num_bridges = DSA_TAG_8021Q_MAX_NUM_BRIDGES; /* Advertise the 8 egress queues */ ds->num_tx_queues = SJA1105_NUM_TC; diff --git a/include/linux/dsa/8021q.h b/include/linux/dsa/8021q.h index f3664ee12170..1dda2a13b832 100644 --- a/include/linux/dsa/8021q.h +++ b/include/linux/dsa/8021q.h @@ -8,6 +8,11 @@ #include #include +/* VBID is limited to three bits only and zero is reserved. + * Only 7 bridges can be enumerated. + */ +#define DSA_TAG_8021Q_MAX_NUM_BRIDGES 7 + int dsa_tag_8021q_register(struct dsa_switch *ds, __be16 proto); void dsa_tag_8021q_unregister(struct dsa_switch *ds); -- 2.34.1