Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2226191rdb; Tue, 3 Oct 2023 14:28:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGLkjWCtTl/K9LZww8qpYG0E388MjdQa4LOq+kapFqJ5VulaHNRuc5Vm3Y0LPJYG0Gn8kU X-Received: by 2002:a17:90b:224c:b0:271:80f2:52bd with SMTP id hk12-20020a17090b224c00b0027180f252bdmr455502pjb.35.1696368483938; Tue, 03 Oct 2023 14:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696368483; cv=none; d=google.com; s=arc-20160816; b=R3fywButnlsz9+/JuL+mYcHTV11w9NrcjpYK4F0tHKlIcRQDXT0AHJuWoERvGgUbBS lx03FrupmKnb1nHC8clSrl0onxCBfWlMSHqqr32X9Q4uY/KqH355OzG63klEWB40g1bx EM9WPa6stuU7Exw2+LKbnQAbkSKlnexXNHZtSbw2hC4wMGumiHMZ4ijVJK6ly5v76Go4 XKIWu0rxg0rUe6eUb630Aq6m7abYIdKJW/acne072kyI5OxkmnNTHRz0Nu66t9+IBMYk kLkw6VDAopRbeH6j9OTdvCUhUHgosA99FWoM8v7QlHFRrfAgVI8E+BT2lMmooV9ZjX2t wHvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZGGKd+eyOpaAhJP41rJ87nk9mJ2Zml+/YtCwN7Pz7js=; fh=JMR/UN1PXlx7c6A5HHpDnFk3LzNuIrzTx1lDwvpr0RU=; b=YwESfEYFxlhYcuXOKkhfUxXb4LeqWZml8ZtYSNrqKjNEQnE/yH9yvHqwnPkDTjE07v TzT+VJQg2F9rfNoLLbAhqHehqDveCIVFwWd49RHwbHyi3tqkCeZFDdQGWC/aqt1q4ymq EsqNkyhCxmQtdt5rZCW8oUXWkMPVrxVq2EfjGmgL3vwqLSn2wcmlRsz4CaqNWbguhe0e 9ZsnVRRPm87LGOTJ/2pJnNdOqQtZi+8sabhL5YUqpmYS6zRiMtn54qsJLSsflKE+MwnI cHvnRCYtJ3+kdhaMHdyZXHMOF6JyOmW3tVZ5tKYVokDua6AB6qscO106CowZjgX+gHXe czVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=idcsbi8c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id p10-20020a17090a2d8a00b002684bc84493si79053pjd.131.2023.10.03.14.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 14:28:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=idcsbi8c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C3ADB802581D; Tue, 3 Oct 2023 14:28:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241230AbjJCV2D (ORCPT + 99 others); Tue, 3 Oct 2023 17:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232084AbjJCV2B (ORCPT ); Tue, 3 Oct 2023 17:28:01 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A294283; Tue, 3 Oct 2023 14:27:58 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-533d9925094so2402639a12.2; Tue, 03 Oct 2023 14:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696368477; x=1696973277; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ZGGKd+eyOpaAhJP41rJ87nk9mJ2Zml+/YtCwN7Pz7js=; b=idcsbi8coXQ3A4DB5GTcq0HKS7Pfyfu9L1oVDRQN8xNelTH+zX96czBLcSws+29UIk yq4yUrfxm66NqghJY6USSUwBQLqVFx5f365q3+zofl+rE/hDw4Nnv1DiCl/qfZD9bha1 J+D8JluRgkRMXm3ZItpcz1f6YrSkSokfitiw5hu1l2XeodyhZsE8n2yNiIisUnALud8B uSWVyBpIy8eVrPs95haz5dCV53v8cSPuDrh4UN8MccxxFhHcdxhU09TdYpwuzu80UHPy 2ERWe9rPSnbLQo/tXWfw4w3/ofzkv4mqHCsaqtOuChaBHtO0DyXq0+G4uJXCXr1YoakF 6vIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696368477; x=1696973277; h=in-reply-to:content-transfer-encoding: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=ZGGKd+eyOpaAhJP41rJ87nk9mJ2Zml+/YtCwN7Pz7js=; b=tIM0u012G5f73ptBkNprTNwbG15SVSooeMPQ9bzRVSMWyAsHtfCK8ZUcIcEAA1mVa/ /xBdwXH1q0Aq9tfanFxL1NET6P8DceFDrf/VdxVQt4puKrvfTMtjL78pf20XK6biYAYX 7PNKBj/y3LGClLaUGS+BCmIz3pwoFbFYVT6xyGv0rKAfUGbQ5D68cWesKzJ7G/opzyC0 Ph2fgJEBWQdp1sn/SgfVHC01bJbodf7MsG4mCvrLD5qaH+tVnkC67j3Cm+cLKc0GewT8 lmUsdGtQmIYvqmvi/VTg4FclpO5u3sWIlqbZ1p8oiRQMC5bh/3ZUVJcsdK+/I+x3zOKr JtTg== X-Gm-Message-State: AOJu0YwxXEgFy3qpCD22f8KlQAIQN5eeMkzTGr8GQWx1hoFneydqo1L0 iVJu/XX3chl5x0Kg3JwB6CS4mmshRDI= X-Received: by 2002:a05:6402:1219:b0:530:77e6:849f with SMTP id c25-20020a056402121900b0053077e6849fmr336413edw.27.1696368476922; Tue, 03 Oct 2023 14:27:56 -0700 (PDT) Received: from skbuf ([188.25.255.218]) by smtp.gmail.com with ESMTPSA id c11-20020aa7df0b000000b00533dd4d2947sm1414737edy.74.2023.10.03.14.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 14:27:56 -0700 (PDT) Date: Wed, 4 Oct 2023 00:27:54 +0300 From: Vladimir Oltean To: =?utf-8?B?UGF3ZcWC?= Dembicki Cc: netdev@vger.kernel.org, Dan Carpenter , Simon Horman , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v3 5/8] net: dsa: vsc73xx: Add vlan filtering Message-ID: <20231003212754.bbel76726dqyrtyn@skbuf> References: <20230912122201.3752918-1-paweldembicki@gmail.com> <20230912122201.3752918-6-paweldembicki@gmail.com> <20230912161709.g34slexfaop6xp7w@skbuf> <20230926235848.3uftpkj7m24qsord@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 14:28:02 -0700 (PDT) On Tue, Oct 03, 2023 at 11:14:55PM +0200, Paweł Dembicki wrote: > Should I make a local copy of the quantity of egress untagged and > tagged vlans per port to resolve this issue, shouldn't I? > And then I check how many vlans are egress tagged or untagged for a > properly restricted solution? Yeah, I guess so. It is the same problem that ocelot_vlan_prepare() tries to solve, and that counts ocelot_port_num_untagged_vlans() and ocelot_port_num_tagged_vlans() indeed. > I see another problem. Even if I return an error value, the untagged > will be marked in 'bridge vlan' listing. I'm not sure how it should > work in this case. What error code are you returning, -EOPNOTSUPP I guess? That's deliberately ignored by callers of br_switchdev_port_vlan_add(), because it means "no one responded to the switchdev notifier, so the VLAN is not offloaded". If you want to deny the configuration you need to return something else, like -EBUSY.