netfilter: nft_cmp: optimize comparison for 16-bytes
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 7 Feb 2022 18:25:08 +0000 (19:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:41 +0000 (17:16 +0200)
commit9bf98120a9437938cd2c4944ad901311bb9be40e
tree76d9de0a0d50f5667ec28c52988f601d04c36bc9
parentc5ba86cde6bb29051bba98f7b33e6c2748915849
netfilter: nft_cmp: optimize comparison for 16-bytes

[ Upstream commit 23f68d462984bfda47c7bf663dca347e8e3df549 ]

Allow up to 16-byte comparisons with a new cmp fast version. Use two
64-bit words and calculate the mask representing the bits to be
compared. Make sure the comparison is 64-bit aligned and avoid
out-of-bound memory access on registers.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/netfilter/nf_tables_core.h
net/netfilter/nf_tables_core.c
net/netfilter/nft_cmp.c