From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LsqJTjxa"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nIWOiChB" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DD3F137 for ; Wed, 6 Dec 2023 23:22:28 -0800 (PST) From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701933746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=guf7bFM7WEo92xyrZ1udRhLTzFoRowkGH5SLHEtlCNw=; b=LsqJTjxau61Z9yETPtDfQGoe8tP6FD7ZwqHKpLw40hlg2e8H+N6PQTjOa/6NjbxmmkZ1lZ 4DGrSrGKMTKJdWeW3iHwY4NL5uBC0A8oVkcGMH4B8Zp2VgXUihAr2dqZWTtk7HwRGjErmZ U/Bno4clvO1gS2JAKe7cAFfP0p4AT3TKScAal+pYlshUSTXMCdKtBUtw0whcEaHCF/Y8me YI+APaU+d6n6eutsJMH7IhT0NKqNv0y+af4odNW8YZaGNW36zHN4wQIvZQH7ZPUuWxRqvH TsXWEopYKtNhEzHvSxts1tmLb7DJd5pqWOhld4iqK8p/jy62ABt0qAzjB0htJg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701933746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=guf7bFM7WEo92xyrZ1udRhLTzFoRowkGH5SLHEtlCNw=; b=nIWOiChBBauBSUl82hSZxKtYu5bD0H/O+njT3MKz6O1WnAjCJuA1JGI7nkWZ+TTI4jpnu0 Pi5d3lk6UqdeqUCA== To: Vinicius Costa Gomes , Jesse Brandeburg , Tony Nguyen Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Suman Ghosh Subject: Re: [PATCH iwl-net] igc: Check VLAN EtherType mask In-Reply-To: <87r0jy6bwy.fsf@intel.com> References: <20231206140718.57433-1-kurt@linutronix.de> <87r0jy6bwy.fsf@intel.com> Date: Thu, 07 Dec 2023 08:22:24 +0100 Message-ID: <874jgufpe7.fsf@kurt> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain On Wed Dec 06 2023, Vinicius Costa Gomes wrote: > Kurt Kanzenbach writes: > >> Currently the driver accepts VLAN EtherType steering rules regardless of >> the configured mask. And things might fail silently or with confusing error >> messages to the user. The VLAN EtherType can only be matched by full >> mask. Therefore, add a check for that. >> >> For instance the following rule is invalid, but the driver accepts it and >> ignores the user specified mask: >> |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 \ >> | m 0x00ff action 0 >> |Added rule with ID 63 >> |root@host:~# ethtool --show-ntuple enp3s0 >> |4 RX rings available >> |Total 1 rules >> | >> |Filter: 63 >> | Flow Type: Raw Ethernet >> | Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF >> | Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF >> | Ethertype: 0x0 mask: 0xFFFF >> | VLAN EtherType: 0x8100 mask: 0x0 >> | VLAN: 0x0 mask: 0xffff >> | User-defined: 0x0 mask: 0xffffffffffffffff >> | Action: Direct to queue 0 >> >> After: >> |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 \ >> | m 0x00ff action 0 >> |rmgr: Cannot insert RX class rule: Operation not supported >> >> Fixes: 2b477d057e33 ("igc: Integrate flex filter into ethtool ops") >> Suggested-by: Suman Ghosh >> Signed-off-by: Kurt Kanzenbach >> --- > > I was just wondering if an alternative would be to use flex filters > for matching vlan-etype with a partial mask. But I don't think > there's any real use case for partial masks, better to reject them: With flex filters it is possible to match by byte wise partial masks. However, I also think there's no use case for it. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCgAxFiEEvLm/ssjDfdPf21mSwZPR8qpGc4IFAmVxcrATHGt1cnRAbGlu dXRyb25peC5kZQAKCRDBk9HyqkZzgg1vD/9t8xIdqGmymTzUoeNETrs4XJFs1fEd rRMHY0LBRfgWljxPsv7cDxU5OrbU97ZHlbTucTnGB/Jus3r1z1R1/tjNqf4ltDrk mpxQ2HVCHTk1fnWgmTGizU6Ux3aIaj2kdwIVk+ycG9xIKN1UH+Huw/Ciz8+t8y6N FGFjmTw3NnJVVICtFvG44i5CJeT645osc+PDm+vBNyYCMtdS2EfaQM0OJ8ullSZC Rt8UtkyjJx24r2gbfneUpR/vweaNdM/ZZQZbHKF+oViJ/Y+pEcjDAHnriRWZEbKp 0xDYwSAkH9P3iMs050+7btmXphQbmAcbevs45sQnJGfRuZjFWoE5UEaDMqYf3aas BHdP4hCGuOZnHycm/TJHLKQNAX6xVklRDZaaA3PuUyB9MGNDFZH1mtXs/NOLhBlQ aV2Y1qXkduRJmxtKZtHDdwmuIiPIS5FRKaN4OBmUUMkpcv9dykhuIUonBOKovB2w CUf63yQXWSz9h1HGscgd5d2VIjFVE1Qu9uRPlH2E7WaTULdVE8YMEnuGlroS2DQ6 CXxOcaiNpo9GkQWKJ5CDIwYBRYDgzRLiiMYarr0/RB6HdsqM2A8ZD/Dr1nrzx992 UAE35iu+nsXaqsij4J14jCyULzdnUm4c3mclSVVxklUdWihk7uzntxmzj63G9SXZ rG1U3laaivZmJg== =qHMT -----END PGP SIGNATURE----- --=-=-=--