lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230729004702.oiloyrt3p3x46u7s@skbuf>
Date:   Sat, 29 Jul 2023 03:47:02 +0300
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Ratheesh Kannoth <rkannoth@...vell.com>
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        claudiu.manoil@....com, alexandre.belloni@...tlin.com,
        andrew@...n.ch, f.fainelli@...il.com, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        olteanv@...il.com, michael.chan@...adcom.com, rajur@...lsio.com,
        yisen.zhuang@...wei.com, salil.mehta@...wei.com,
        jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com,
        taras.chornyi@...ision.eu, saeedm@...dia.com, leon@...nel.org,
        idosch@...dia.com, petrm@...dia.com, horatiu.vultur@...rochip.com,
        lars.povlsen@...rochip.com, Steen.Hegelund@...rochip.com,
        daniel.machon@...rochip.com, simon.horman@...igine.com,
        aelior@...vell.com, manishc@...vell.com, ecree.xilinx@...il.com,
        habetsm.xilinx@...il.com, peppe.cavallaro@...com,
        alexandre.torgue@...s.st.com, joabreu@...opsys.com,
        mcoquelin.stm32@...il.com, pablo@...filter.org,
        kadlec@...filter.org, fw@...len.de,
        muhammad.husaini.zulkifli@...el.com, coreteam@...filter.org,
        ioana.ciornei@....com, wojciech.drewek@...el.com,
        gerhard@...leder-embedded.com, oss-drivers@...igine.com,
        shenjian15@...wei.com, wentao.jia@...igine.com,
        linux-net-drivers@....com, huangguangbin2@...wei.com,
        hui.zhou@...igine.com, linux-rdma@...r.kernel.org,
        louis.peens@...igine.com, zdoychev@...linear.com,
        intel-wired-lan@...ts.osuosl.org, wenjuan.geng@...igine.com,
        grygorii.strashko@...com, kurt@...utronix.de,
        UNGLinuxDriver@...rochip.com, netfilter-devel@...r.kernel.org,
        lanhao@...wei.com, linux-omap@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, shmulik.ladkani@...il.com,
        d-tatianin@...dex-team.ru,
        linux-stm32@...md-mailman.stormreply.com, jdamato@...tly.com
Subject: Re: [PATCH v3 net-next] net: flow_dissector: Use 64bits for used_keys

On Sat, Jul 29, 2023 at 04:52:15AM +0530, Ratheesh Kannoth wrote:
> As 32bits of dissector->used_keys are exhausted,
> increase the size to 64bits.
> 
> This is base change for ESP/AH flow dissector patch.
> Please find patch and discussions at
> https://lore.kernel.org/netdev/ZMDNjD46BvZ5zp5I@corigine.com/T/#t
> 
> Signed-off-by: Ratheesh Kannoth <rkannoth@...vell.com>
> Reviewed-by: Petr Machata <petrm@...dia.com> # for mlxsw
> Tested-by: Petr Machata <petrm@...dia.com>
> Reviewed-by: Martin Habets <habetsm.xilinx@...il.com>
> Reviewed-by: Simon Horman <simon.horman@...igine.com>
> 
> ---
> ChangeLog
> 
> v2 -> v3: commit message subject line fix as per comment of Petr Machata
> v1 -> v2: Commit message typo fix.
> v0 -> v1: Fix errors reported by kernel test robot
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@....com>

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c
> index 2b80fe73549d..8c531f4ec912 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c
> @@ -221,16 +221,21 @@ mlx5_ct_fs_smfs_destroy(struct mlx5_ct_fs *fs)
>  }
>  
>  static inline bool
> -mlx5_tc_ct_valid_used_dissector_keys(const u32 used_keys)
> +mlx5_tc_ct_valid_used_dissector_keys(const u64 used_keys)
>  {
> -#define DISS_BIT(name) BIT(FLOW_DISSECTOR_KEY_ ## name)
> -	const u32 basic_keys = DISS_BIT(BASIC) | DISS_BIT(CONTROL) | DISS_BIT(META);
> -	const u32 ipv4_tcp = basic_keys | DISS_BIT(IPV4_ADDRS) | DISS_BIT(PORTS) | DISS_BIT(TCP);
> -	const u32 ipv6_tcp = basic_keys | DISS_BIT(IPV6_ADDRS) | DISS_BIT(PORTS) | DISS_BIT(TCP);
> -	const u32 ipv4_udp = basic_keys | DISS_BIT(IPV4_ADDRS) | DISS_BIT(PORTS);
> -	const u32 ipv6_udp = basic_keys | DISS_BIT(IPV6_ADDRS) | DISS_BIT(PORTS);
> -	const u32 ipv4_gre = basic_keys | DISS_BIT(IPV4_ADDRS);
> -	const u32 ipv6_gre = basic_keys | DISS_BIT(IPV6_ADDRS);
> +#define DISS_BIT(name) BIT_ULL(FLOW_DISSECTOR_KEY_ ## name)
> +	const u64 basic_keys = DISS_BIT(BASIC) | DISS_BIT(CONTROL) |
> +				DISS_BIT(META);
> +	const u64 ipv4_tcp = basic_keys | DISS_BIT(IPV4_ADDRS) |
> +				DISS_BIT(PORTS) | DISS_BIT(TCP);
> +	const u64 ipv6_tcp = basic_keys | DISS_BIT(IPV6_ADDRS) |
> +				DISS_BIT(PORTS) | DISS_BIT(TCP);
> +	const u64 ipv4_udp = basic_keys | DISS_BIT(IPV4_ADDRS) |
> +				DISS_BIT(PORTS);
> +	const u64 ipv6_udp = basic_keys | DISS_BIT(IPV6_ADDRS) |
> +				 DISS_BIT(PORTS);
> +	const u64 ipv4_gre = basic_keys | DISS_BIT(IPV4_ADDRS);
> +	const u64 ipv6_gre = basic_keys | DISS_BIT(IPV6_ADDRS);
>  
>  	return (used_keys == ipv4_tcp || used_keys == ipv4_udp || used_keys == ipv6_tcp ||
>  		used_keys == ipv6_udp || used_keys == ipv4_gre || used_keys == ipv6_gre);

Probably leaving the style alone here, and just changing the types,
would have been a better choice. Anyway...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ