]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ice: add profile conflict check for AVF FDIR
authorJunfeng Guo <junfeng.guo@intel.com>
Tue, 14 Mar 2023 02:03:15 +0000 (10:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:47 +0000 (12:10 +0200)
commitd10900058fa6d6c0a4ec6f6967a9b4c607e303ce
tree20e1f067611c05b6e1587b374a0d65c0f2a9f186
parent088573884165806248e15b69277c582c31c5f361
ice: add profile conflict check for AVF FDIR

[ Upstream commit 29486b6df3e6a63b57d1ed1dce06051267282ff4 ]

Add profile conflict check while adding some FDIR rules to avoid
unexpected flow behavior, rules may have conflict including:
        IPv4 <---> {IPv4_UDP, IPv4_TCP, IPv4_SCTP}
        IPv6 <---> {IPv6_UDP, IPv6_TCP, IPv6_SCTP}

For example, when we create an FDIR rule for IPv4, this rule will work
on packets including IPv4, IPv4_UDP, IPv4_TCP and IPv4_SCTP. But if we
then create an FDIR rule for IPv4_UDP and then destroy it, the first
FDIR rule for IPv4 cannot work on pkt IPv4_UDP then.

To prevent this unexpected behavior, we add restriction in software
when creating FDIR rules by adding necessary profile conflict check.

Fixes: 1f7ea1cd6a37 ("ice: Enable FDIR Configure for AVF")
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c