ice: fix wrong fallback logic for FDIR
authorSimei Su <simei.su@intel.com>
Wed, 22 Mar 2023 02:24:15 +0000 (10:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Apr 2023 14:55:23 +0000 (16:55 +0200)
commitaad3b871efe26f36f45f8b4649653b5d3fd9c35e
tree15174ffafefea325a0a0f6de0679dc9c2e83e713
parent6460fee86abf141ae86c56ab98c72ccc95431b62
ice: fix wrong fallback logic for FDIR

[ Upstream commit b4a01ace20f5c93c724abffc0a83ec84f514b98d ]

When adding a FDIR filter, if ice_vc_fdir_set_irq_ctx returns failure,
the inserted fdir entry will not be removed and if ice_vc_fdir_write_fltr
returns failure, the fdir context info for irq handler will not be cleared
which may lead to inconsistent or memory leak issue. This patch refines
failure cases to resolve this issue.

Fixes: 1f7ea1cd6a37 ("ice: Enable FDIR Configure for AVF")
Signed-off-by: Simei Su <simei.su@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