From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DB2642B754 for ; Sat, 28 Feb 2026 11:21:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772277709; cv=none; b=KDQ/o+J9yF+Nz4OhGj5MnMX1z8pBfLpNo7ByWdP2MMCONZemF7U8YmdGPXPscBy4gcl3WIbPg9lHyhTu8xx2ETtTTWrObK0p+5lEhV5c5mpzNTDHcy7cTIoBxfMZGCI9pYiiL6a7TwEwgmyfDoDJvPUHpyC8XHPCztvC0tD9DfI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772277709; c=relaxed/simple; bh=4NJsdHpJv2GquJS2OgvsvP46KG2uKuws/+rrvdkYpD8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LJBr9z/3pux5D9uW5hoOAdmVItoP+h1VBROa/rynYuXqpFoq1baAEK12Ou1i8CUEvCxk7eCFsDptzf8lh9bWr9d+uVhfKSz6WzUTncrCNQS9FeTi/6FhGgwvxQ0H1ikkrUiJr6BJPI65QNDfwNif102yXcuAJV5tdSmxr8swIVU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net; spf=pass smtp.mailfrom=queasysnail.net; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b=aTMahbfv; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ODGZRcly; arc=none smtp.client-ip=103.168.172.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=queasysnail.net header.i=@queasysnail.net header.b="aTMahbfv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ODGZRcly" Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2553A140023C; Sat, 28 Feb 2026 06:21:45 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Sat, 28 Feb 2026 06:21:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=queasysnail.net; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1772277705; x= 1772364105; bh=VISe9Tv/YRlfokLkRlMZQjenaMOhaY27e0QOreiDsoA=; b=a TMahbfv3J50fuJFxPs1cq2Rweztwd8JXPsDDjGfj7TP4/MIoJtYJ+XDK+hdB5INf 4YEMi8oP1YQP2X3t+5kqlGJW7x19nQaAxvhGwe+XKN/oCrMjQJapRvBpbPU7Piga Vg7q5TdCvteNdDctGjI4e3IS3gRidvhDSlTo57hJ/jmzI++6sPVehBYEoUd/YRBW 16xwEHzfCR5wQg6F6D+cYRkXlNvGqAdSigTHmvk/axfXer3iPk1kYEUdkaBNJzbI p5/axyJy58T6NCVStMB6zSh4xHdTYpL7taokGyeqATDRqr0bxPiWKiZTe+3c0T1O J+KOp64H8R17ROwrtH1cw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1772277705; x=1772364105; bh=VISe9Tv/YRlfokLkRlMZQjenaMOhaY27e0Q OreiDsoA=; b=ODGZRcly2WDiAvuO1d8lI22nKdf+AyjkIFj9ka5hwi1YhD1QV2X tiye6u1ZpBxv1gMTbtHgbzNPXjrCsskIrvmSf3IIHZH1rTS7BqRPNtXuYApp15xj 65PSfD/08UPgg2btLnRNUGQcGO98TviIW3j8DcW4FJnxiK89GmsGUj901swiYW9y mnQgEFZvuTAxpniqKt59+qwZjY58dCKuGGMqfxtDlbxQDApIDWszQlD/1vniRS4f GrYnAicfCirjbA/yo45VCqpIF2cLRzXE1Mk4d5+rsIumRtIYjpCLVqq3Urw0TraU h3ld9qVhWou4/6DXHkOgRxtyjt4H7hxEp4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvhedujeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtjeenucfhrhhomhepufgrsghrihhn rgcuffhusghrohgtrgcuoehsugesqhhuvggrshihshhnrghilhdrnhgvtheqnecuggftrf grthhtvghrnhepuefhhfffgfffhfefueeiudegtdefhfekgeetheegheeifffguedvueff fefgudffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgusehquhgvrghshihsnhgrihhlrdhnvghtpdhnsggprhgtphhtthhopeekpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopegtrhgrthhiuhesnhhvihguihgrrdgtohhmpd hrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthht oheprghnughrvgifodhnvghtuggvvheslhhunhhnrdgthhdprhgtphhtthhopegurghvvg hmsegurghvvghmlhhofhhtrdhnvghtpdhrtghpthhtohepvgguuhhmrgiivghtsehgohho ghhlvgdrtghomhdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpth htohepphgrsggvnhhisehrvgguhhgrthdrtghomhdprhgtphhtthhopeguthgrthhulhgv rgesnhhvihguihgrrdgtohhm X-ME-Proxy: Feedback-ID: i934648bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Feb 2026 06:21:44 -0500 (EST) Date: Sat, 28 Feb 2026 12:21:42 +0100 From: Sabrina Dubroca To: Cosmin Ratiu Cc: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Dragos Tatulea Subject: Re: [PATCH net-next v2 1/3] nsim: Add support for VLAN filters Message-ID: References: <20260227090227.1552512-1-cratiu@nvidia.com> <20260227090227.1552512-2-cratiu@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260227090227.1552512-2-cratiu@nvidia.com> 2026-02-27, 11:02:25 +0200, Cosmin Ratiu wrote: > Add support for storing the list of VLANs in nsim devices, together with > ops for adding/removing them and a debug file to show them. > > This will be used in upcoming tests. > > Signed-off-by: Cosmin Ratiu > --- > drivers/net/netdevsim/netdev.c | 59 +++++++++++++++++++++++++++++-- > drivers/net/netdevsim/netdevsim.h | 8 +++++ > 2 files changed, 65 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c > index 6285fbefe38a..7177711cf9fc 100644 > --- a/drivers/net/netdevsim/netdev.c > +++ b/drivers/net/netdevsim/netdev.c > @@ -602,6 +602,36 @@ static int nsim_stop(struct net_device *dev) > return 0; > } > > +static int nsim_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) > +{ > + struct netdevsim *ns = netdev_priv(dev); > + > + if (vid >= VLAN_N_VID) > + return -EINVAL; > + > + if (proto == htons(ETH_P_8021Q)) > + set_bit(vid, ns->vlan.ctag); Maybe DEBUG_NET_WARN_ON_ONCE(test_and_set_bit(vid, ns->vlan.ctag)); > + else if (proto == htons(ETH_P_8021AD)) > + set_bit(vid, ns->vlan.stag); > + > + return 0; > +} > + > +static int nsim_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) > +{ > + struct netdevsim *ns = netdev_priv(dev); > + > + if (vid >= VLAN_N_VID) > + return -EINVAL; > + > + if (proto == htons(ETH_P_8021Q)) > + clear_bit(vid, ns->vlan.ctag); and DEBUG_NET_WARN_ON_ONCE(!test_and_clear_bit(vid, ns->vlan.ctag)); > + else if (proto == htons(ETH_P_8021AD)) > + clear_bit(vid, ns->vlan.stag); > + > + return 0; > +} and in nsim_destroy, something like: for_each_set_bit(vid, ns->vlan.ctag, VLAN_N_VID) DEBUG_NET_WARN_ON_ONCE(1); for_each_set_bit(vid, ns->vlan.stag, VLAN_N_VID) DEBUG_NET_WARN_ON_ONCE(1); just to make sure that we did all the accounting correctly? This last one would catch problems like the error handling spotted by AI (just add 3 offloaded devices + one non-offloaded, then try to offload the last one, netdevsim accepts only 3 secys so mdo_add_secy will fail): # echo 1 > /sys/bus/netdevsim/new_device # ip link add link eni1np1 type macsec port 5 offload mac # ip link add link eni1np1 type macsec port 6 offload mac # ip link add link eni1np1 type macsec port 7 offload mac # ip link add macsec_H link eni1np1 type macsec offload off # ip link add link macsec_H type vlan id 20 # cat /sys/kernel/debug/netdevsim/netdevsim1/ports/0/vlan # ip link set macsec_H type macsec offload mac RTNETLINK answers: No space left on device # cat /sys/kernel/debug/netdevsim/netdevsim1/ports/0/vlan ctag 20 # echo 1 > /sys/bus/netdevsim/del_device -- Sabrina