Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp582353lqg; Fri, 1 Mar 2024 14:26:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVmz9R4q6MqM0ZehBB+yHlaIatyViNUAumlAP1I7XOnmMi8+2prQ6haJYW89zRcW72eiBpwEFWkgH+mRiVK7A3f+Sr/3ny/q9bmCSe7dw== X-Google-Smtp-Source: AGHT+IFsdljQoUSkSdXFkyOwM0leDLnMxldUb50jZO6lzjImSsMLvTZ93tPZ5jSYcs0a+Mx7M9Xo X-Received: by 2002:a17:902:650b:b0:1dc:fa7e:f6f5 with SMTP id b11-20020a170902650b00b001dcfa7ef6f5mr171455plk.11.1709331998029; Fri, 01 Mar 2024 14:26:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709331998; cv=pass; d=google.com; s=arc-20160816; b=qrhXsAecgJFbZz/EAU1yCsk4lOEqkwmxqmdJZLB7Hg330NsOzubqcX6KEK86I+PDNY rZiu2/DKDDjgH3xwxdchBlvkknv8SYJdaczhqvNxW9O5ZpZ79Guh55O2sn8X6ZLJ5Y4Q LP0/taQ1QPEIR3cl82lst6C9ULeQgJe8dylxxbdLRDTpvJkUrT45IaL1F+HpQCiHJ8EY EgQzJiOfVQjb9hkGN12BM0PPHmWhM2SibshzGCt++5Jk6DO5tGZiyyPCc6F7KZDuHX6z BGJLmC5iGZI7CgLO1+kxhsUYqgAepvGX0J5yewQ3jIjE/yXBZHTbyYAv0EDuObipJ8NN rCSA== 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=81KI0+qdfK3ZHf++P129aHWPYoB3eKSzWQe3DkfQMFE=; fh=5maFFmTDMDhghtXEDJRH/ru/7aj2yey5EjE3Lc+4k7c=; b=k1RSVuGzxK557/UL9kjZUiC7Y4wm27XQDcmBgGqOnduPoAYjxvhG/rChpKv1R66XrZ Soak02mCiBB0WtjsCi0Y3F9xZOsXKHGno9udoioaULC9NCZZWLdvETygo1Bp1qF//EIg U1gKUrAoec7lIF7bkF2eG937tJ4jJ6vq19rMrLNM3UPna3xRPWSBUKECtNnIT4utuTDo bIsHvEffI6HZptajmtSwOaT2LcG186Sbp+KkFiqLazgfiYrZCntO1d+BxNxOKLbJRs/U A07BIt6Qucfrlt97uRAOxjZnprURQTzFyuamDG6CHcvoxsVRt3CAc4tVQEIQTpJDtpBh QujQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AVTwwBxn; 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-89190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z6-20020a170902d54600b001dbd8225034si4738006plf.590.2024.03.01.14.26.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 14:26:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AVTwwBxn; 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-89190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89190-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A4491B26A8D for ; Fri, 1 Mar 2024 22:22:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A0E45D91D; Fri, 1 Mar 2024 22:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AVTwwBxn" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 F1AB55D750; Fri, 1 Mar 2024 22:18:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709331505; cv=none; b=RL7SVH9dM4b8Lnavzq3RUR3RCaUKR5JpjIbXIoJznKhiSjsfEVkeLda+90BTqc4TOvK9trO60ZeOkB3a0TsuX7n4c0seFWfPUATCKhVWgX5jJ1B77Bhn2f9I/pbhAxDv0i5Uf+HU0afNAHzGXLVPJV3SkDkaskTAsadnDWRbSlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709331505; c=relaxed/simple; bh=uXM915q/jgE2mr1r6Kmy1ijhQ1VyMY2aqb2scH6K9jo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=q1z6zg9b5gXULbs4184wJ/ZiZId0u/Zd0dGCozV2GvF1hN/zXfUweWVgWYFlmNqrFqyoxRqJE0cA19gBBtewV38U5IaV1pPHSFC2c4tFzGp2ilBMZlKS/xCi6mIkcQszD+3nlT3UjpYTQyewe2GX80NUodADmSRa2wokVTcwnE0= 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=AVTwwBxn; arc=none smtp.client-ip=209.85.218.42 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-ej1-f42.google.com with SMTP id a640c23a62f3a-a44cdb2d3a6so18278866b.2; Fri, 01 Mar 2024 14:18:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709331502; x=1709936302; 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=81KI0+qdfK3ZHf++P129aHWPYoB3eKSzWQe3DkfQMFE=; b=AVTwwBxnU1ezdEX2OrY4yYu4EkRy66dXfwPIGxa/LQEGHxQIxKbMJJs3aqimCx48aS FnHgTEzRU7ea3j9JV2Umu6Wlp0xmxMmKIC7YxKj0GaLU/psn1B6CQvKEE/qcHbTZCBro S7dCW3/gUpJodxzlw4wHIJkWcO1FJovWDRW+37cBVkaUkMEHCHF34wTwCZIqYq0zJH0p KfD12TWzT+d9Waj2OEJCVGccUbY0FXVL+cfnuG29OJOctMXGiElYE0lzUPB7oeuNGIB5 I7fO0xyd/EdVMuas9nq05HbJrivx+zFcvs5efKM3s777w7/RyLjZKt99CQjmg7EHPL60 dlBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709331502; x=1709936302; 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=81KI0+qdfK3ZHf++P129aHWPYoB3eKSzWQe3DkfQMFE=; b=WteueFgxMjorQPdZpqlg+ezQLhrMF7K/sVwDtpPk10fLu2oKXxV55/YC1G9HWeCBkI obIVpQXRjcbOvU5et3LMI8sMTSTj3BJlBRKAVGsP49eIDX5e7F8UIbpXuTHQFlQ7a27V pmQXjCYumVJFNm5BwSu4TWeocycVN8Z5HoXO8X+joryEYJOG+TRTt8ENAQzKhuHZF/4w icZMistM4QMhfjlKF8QdOrOGlQCZ6g/nTGphV0OGaSRoppf5fCrtSZa4ol5Oybn8PHiB Xwqto0Q0YxFacdT/5y9a/cr7RyHnAyFPP59eaSWg8SFbw9/HrxmekUCzfwdeFIMGQPEi NyMA== X-Forwarded-Encrypted: i=1; AJvYcCVnGjJFo7uIg7KRezj8sEFwsHCprI82uV0U2sHUO/3EvLrlQL31FOdXDrkg07hI1hUtgTTptPX83myM+dI7N8YAWaijgLUMsyb/qDXS X-Gm-Message-State: AOJu0YzGy/gtdacpxvaORvhn5hkvX3VghoGAL+dqZ7pJ1DHSGqfnzifm r0u+zQ0yhK13JT2lAQYyb8Sqhvne6wf6EdB7OCHfvfUiVsVsguC/F1Z2rmwz0dE= X-Received: by 2002:a17:906:f355:b0:a43:a12b:1951 with SMTP id hg21-20020a170906f35500b00a43a12b1951mr2270723ejb.2.1709331502188; Fri, 01 Mar 2024 14:18:22 -0800 (PST) Received: from WBEC325.dom.lan ([185.188.71.122]) by smtp.gmail.com with ESMTPSA id g16-20020a17090613d000b00a3f480154a3sm2091122ejc.65.2024.03.01.14.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 14:18:21 -0800 (PST) From: Pawel Dembicki To: netdev@vger.kernel.org Cc: Linus Walleij , Simon Horman , Pawel Dembicki , Vladimir Oltean , Florian Fainelli , 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 v6 14/16] net: dsa: Define max num of bridges in tag8021q implementation Date: Fri, 1 Mar 2024 23:16:36 +0100 Message-Id: <20240301221641.159542-15-paweldembicki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240301221641.159542-1-paweldembicki@gmail.com> References: <20240301221641.159542-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 --- 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 6646f7fb0f90..6e22d7a6bfa3 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -3156,8 +3156,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